Skip to content

Commit faf4c16

Browse files
authored
Mark the QL code as invalid more explicitly
1 parent 2d47537 commit faf4c16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/language/ql-handbook/types.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ For example, the following construction is legal::
513513
However, a similar implementation that restricts ``InitialValueSource`` in a class extension is not valid.
514514
If we had implemented ``DefiniteInitialization`` as a class extension instead, it would trigger a type test for ``InitialValueSource``. This results in an illegal recursion ``DefiniteInitialization -> InitialValueSource -> UnknownInitialGarbage -> ¬DefiniteInitialization`` since ``UnknownInitialGarbage`` relies on ``DefiniteInitialization``::
515515

516+
// THIS WON'T WORK: The implicit type check for InitialValueSource involves an illegal recursion
517+
// DefiniteInitialization -> InitialValueSource -> UnknownInitialGarbage -> ¬DefiniteInitialization!
516518
class DefiniteInitialization extends InitialValueSource {
517519
DefiniteInitialization() {
518520
this instanceof ParameterPassing or this instanceof ExplicitInitialization

0 commit comments

Comments
 (0)