From 6e025186aba8da3f95fb9c727714d2eebb9088ff Mon Sep 17 00:00:00 2001 From: Philip Ginsbach Date: Fri, 3 Sep 2021 10:23:58 +0100 Subject: [PATCH] make clear that instanceof supertypes are not base types --- docs/codeql/ql-language-reference/types.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/types.rst b/docs/codeql/ql-language-reference/types.rst index 30c028f0a0c..751e56d7d24 100644 --- a/docs/codeql/ql-language-reference/types.rst +++ b/docs/codeql/ql-language-reference/types.rst @@ -406,7 +406,9 @@ However, `foo_method` is not exposed in `Bar`, so the query `select any(Bar b).f results in a compile time error. Note from the example that it is still possible to access methods from instanceof supertypes from within the specialising class with the `super` keyword. -Crucially, the base class methods are not just hidden. The extension relationship is severed. +Crucially, the instanceof **supertypes** are not **base types**. +This means that these supertypes do not participate in overriding, and any fields of such +supertypes are not part of the new class. This has implications on method resolution when complex class hierarchies are involved. The following example demonstrates this.