C#: Address review comments

This commit is contained in:
Tom Hvitved
2019-02-06 13:17:47 +01:00
parent 0211837e24
commit 8812f26517
3 changed files with 5 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ class DefaultToStringType extends ValueOrRefType {
result instanceof SourceLocation
or
not super.getLocation() instanceof SourceLocation and
result.hasLocationInfo("", 0, 0, 0, 0)
result instanceof EmptyLocation
}
}

View File

@@ -372,7 +372,7 @@ module ExprOrStmtParentCached {
result = min(Location l | l = e.getALocation() | l order by l.getFile().toString())
or
not exists(e.getALocation()) and
result.hasLocationInfo("", 0, 0, 0, 0)
result instanceof EmptyLocation
}
}
private import ExprOrStmtParentCached

View File

@@ -51,6 +51,9 @@ class Location extends @location {
final int getEndColumn() { this.hasLocationInfo(_, _, _, _, result) }
}
/** An empty location. */
class EmptyLocation extends Location { EmptyLocation() { this.hasLocationInfo("", 0, 0, 0, 0) } }
/**
* A location in source code, comprising of a source file and a segment of text
* within the file.