Class IncompleteConstructorCallOrError
- All Implemented Interfaces:
Consumer<EK9Parser.CallContext>
A private constructor may leave properties unset - the 'default private X()' idiom - because it is meant to be
reached only through this(...) from a constructor that then sets them. Walk 0
(ConstructorFieldInitialisationListener) marks a constructor with the properties it leaves unset
(PropertiesLeftUnset); for a private one this rejects any other way of reaching it - the type
constructing an object of itself, such as blank() <- rtn as Label: Label() or, in a generic,
Holder() of T. Without it the object exists with a property that is a raw null, and the first read of
it - or the generated ? - fails at run time.
this(...) and super(...) are not construction calls (they are steps of a constructor), so they are not checked here: a this(...) to such a constructor is judged where it is made, by what the delegating constructor then sets. An accessible constructor that leaves a property unset is reported at the property instead, and an abstract type is never constructed directly.
collect as T makes its T with T's no-argument constructor, exactly as T() would, so it is a
construction call too (acceptCollect(EK9Parser.StreamExpressionTerminationContext)): inside T, where a private no-argument constructor is accessible,
collect as T reaching a 'default private T()' that leaves properties unset is E08264 as T() is
(lane defects-w3, 2026-10-09 - it compiled clean and the first | threw a NullPointerException).
Outside T the private constructor is not accessible at all (phase 3, E06180).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionIncompleteConstructorCallOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoid(package private) voidThe constructioncollect as Tmakes: T's no-argument constructor, reached asT()would be.Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isAlreadyInError, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
IncompleteConstructorCallOrError
IncompleteConstructorCallOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.CallContext>
-
acceptCollect
The constructioncollect as Tmakes: T's no-argument constructor, reached asT()would be.
-