Class OptionalLocation::Location
A class that represents a location that may not exist.
The API resembles a union of the codeql.util.Option class with the codeql.util.Location
class.
Example usage:
OptionalLocation locationOf(... x) {
if x.hasLocation()
then result.asSome() = x.getLocation()}}
else result.isNone()
}
Note that if you used Option<Location>, then CodeQL would not know that the class is a
location, as it does not have the hasLocationInfo predicate.
Import path
import qtil.locations.OptionalLocationDirect supertypes
Predicates
| asSome | Gets the location if it exists. |
| hasLocationInfo | Location info predicate so that CodeQL can use this class as a location. |
| isNone | Holds when this refers to a location that does not exist. |
| toString |