From 35b0e833708080d736fa77db2e2814f581cf8ca5 Mon Sep 17 00:00:00 2001 From: Philip Ginsbach Date: Fri, 3 Sep 2021 10:52:05 +0100 Subject: [PATCH] simpler first instanceof extension example --- docs/codeql/ql-language-reference/types.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/codeql/ql-language-reference/types.rst b/docs/codeql/ql-language-reference/types.rst index 751e56d7d24..9d3984b5f5e 100644 --- a/docs/codeql/ql-language-reference/types.rst +++ b/docs/codeql/ql-language-reference/types.rst @@ -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`.