simpler first instanceof extension example

This commit is contained in:
Philip Ginsbach
2021-09-03 10:52:05 +01:00
parent 6e025186ab
commit 35b0e83370

View File

@@ -397,8 +397,8 @@ Besides extending base types, classes can also declare `instanceof` relationship
string foo_method() { result = "foo" }
}
class Bar extends int instanceof Foo {
string bar_method() { result = super.foo_method() }
class Bar instanceof Foo {
string toString() { result = super.foo_method() }
}
In this example, the characteristic predicate from `Foo` also applies to `Bar`.