mirror of
https://github.com/github/codeql.git
synced 2026-02-10 04:01:11 +01:00
simpler first instanceof extension example
This commit is contained in:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user