Class Scenario2FunctionWrapperGenerator

java.lang.Object
org.ek9lang.compiler.phase7.Scenario2FunctionWrapperGenerator

final class Scenario2FunctionWrapperGenerator extends Object
Generates IR operations for Scenario 2 function type wrappers.

For abstract parameterized functions (Consumer, Acceptor, Predicate, etc.), generates type-based identity operators rather than delegation for some operations. Functions have no state - their identity IS their type.

Generated operations:

  • Constructor - creates delegate instance
  • _call(T) - no-op (concrete functions override via virtual dispatch)
  • _string() - returns friendly type name literal
  • _hashcode() - returns precomputed hash of FQN
  • _eq(Any) - delegates to delegate
  • _isSet() - delegates to delegate
  • Constructor Details

  • Method Details

    • generate

      void generate(IRConstruct construct, FunctionSymbol functionSymbol, String baseTypeName)
      Generate all operations for a FunctionSymbol wrapper.