mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
18 lines
653 B
Plaintext
18 lines
653 B
Plaintext
import csharp
|
|
import Useless_code.DefaultToString
|
|
|
|
class MyDefaultToStringType extends DefaultToStringType {
|
|
// A workaround for generating empty URLs for non-source locations, because qltest
|
|
// does not support non-source locations
|
|
override predicate hasLocationInfo(
|
|
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
|
) {
|
|
exists(Location l | l = this.getLocation() |
|
|
if l instanceof SourceLocation
|
|
then l.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
|
else
|
|
any(EmptyLocation el).hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
|
)
|
|
}
|
|
}
|