Class AutoMatchSuperFunctionSignature
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.AutoMatchSuperFunctionSignature
- All Implemented Interfaces:
BiConsumer<IFunctionSymbol, Boolean>
final class AutoMatchSuperFunctionSignature
extends TypedSymbolAccess
implements BiConsumer<IFunctionSymbol, Boolean>
The ek9 developer does not need to redeclare incoming or returning parameters for dynamic functions.
They are inferred for the developer - this is that 'inference'.
In short the compiler - uses the same symbols from the super class for incoming and returning parameters.
D28: the INHERITED returning variable of a dynamic function WITH a body starts unassigned, whatever the
super declared. The super's initialiser (or its built-in implementation) belongs to the super's own body,
which the dynamic function's body replaces - phase 7 declares the inherited variable as a bare REFERENCE.
So it is cleared here and phase 5 (DynamicFunctionOrError) holds it to E08050 on every path,
exactly as a declared returning variable. Only a BODYLESS dynamic function (legal over a concrete super)
keeps it: it forwards to the super's _call, which supplies the value.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionAutoMatchSuperFunctionSignature(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IFunctionSymbol functionSymbol, Boolean bodyProvided) Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbolMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
AutoMatchSuperFunctionSignature
AutoMatchSuperFunctionSignature(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<IFunctionSymbol, Boolean>
-