Class SynthesizeSuperFunction
- All Implemented Interfaces:
Consumer<FunctionSymbol>
Also ensures that purity is retained. So for some abstract generic functions like UnaryOperator of T for example the function must be pure. i.e. is it really a Supplier of T and Consumer of T, etc.
The reason for this, is that it enables just functions to be defined but then accept them via their generic function signature. Less coding for the EK9 developer.
A closeable type is never a type argument (E81061), and that holds for the compiler's own parameterisations
too (D7, Steve 2026-10-06): a function whose parameter or return type is closeable gets NO implicit generic
super (no Consumer of TCP, Acceptor of Res, Supplier of Res, ...) - its super is
Any, as for any function with no idiomatic super. A caller that wants to pass such a function declares
a dedicated non-generic function type for it, as TCPReadyHandler does. The parameterisations made here
are checked by CloseableNotInGenericParameterOrError like any other, so a synthesis path that ever named
a closeable would be an E81061, not a silent exemption.
-
Constructor Summary
ConstructorsConstructorDescriptionSynthesizeSuperFunction(SymbolsAndScopes symbolsAndScopes, SymbolFactory symbolFactory, ErrorListener errorListener) -
Method Summary
-
Constructor Details
-
SynthesizeSuperFunction
SynthesizeSuperFunction(SymbolsAndScopes symbolsAndScopes, SymbolFactory symbolFactory, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<FunctionSymbol>
-