Skip to content

Commit 6e02518

Browse files
committed
make clear that instanceof supertypes are not base types
1 parent abaa063 commit 6e02518

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/codeql/ql-language-reference/types.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,9 @@ However, `foo_method` is not exposed in `Bar`, so the query `select any(Bar b).f
406406
results in a compile time error. Note from the example that it is still possible to access
407407
methods from instanceof supertypes from within the specialising class with the `super` keyword.
408408

409-
Crucially, the base class methods are not just hidden. The extension relationship is severed.
409+
Crucially, the instanceof **supertypes** are not **base types**.
410+
This means that these supertypes do not participate in overriding, and any fields of such
411+
supertypes are not part of the new class.
410412
This has implications on method resolution when complex class hierarchies are involved.
411413
The following example demonstrates this.
412414

0 commit comments

Comments
 (0)