Skip to content

Commit 863eede

Browse files
committed
easier second example for instanceof extensions
1 parent cd646c8 commit 863eede

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,13 @@ The following example demonstrates this.
417417
.. code-block:: ql
418418
419419
class Interface extends int {
420-
Interface() { this in [1 .. 100] }
420+
Interface() { this in [1 .. 10] }
421421
string foo() { result = "" }
422422
}
423423
424-
class Foo extends Interface {
425-
Foo() { this in [1 .. 10] }
426-
override string foo() { result = "foo" }
424+
class Foo extends int {
425+
Foo() { this in [1 .. 5] }
426+
string foo() { result = "foo" }
427427
}
428428
429429
class Bar extends Interface instanceof Foo {
@@ -432,8 +432,8 @@ The following example demonstrates this.
432432
433433
Here, the method `Bar::foo` does not override `Foo::foo`.
434434
Instead, it overrides only `Interface::foo`.
435-
This means that `select any(Foo b).foo()` yields only `foo`.
436-
Had `bar been defined as `extends Foo`, then `select any(Foo b).foo()` would yield `bar`.
435+
This means that `select any(Foo f).foo()` yields only `foo`.
436+
Had `Bar` been defined as `extends Foo`, then `select any(Foo b)` would yield `bar`.
437437

438438
.. _character-types:
439439
.. _domain-types:

0 commit comments

Comments
 (0)