C#: Base Useless Code tests on stubs.

This commit is contained in:
Michael Nebel
2023-08-29 16:20:59 +02:00
parent e9b3f1282a
commit 35a1dd8ba9
6 changed files with 11 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ class MyDefaultToStringType extends DefaultToStringType {
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
exists(Location l | l = this.getLocation() |
if l instanceof SourceLocation
if this.fromSource()
then l.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
else
any(EmptyLocation el).hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)