Class SymbolTypeOrException

java.lang.Object
org.ek9lang.compiler.common.SymbolTypeOrException
All Implemented Interfaces:
Function<ISymbol,ISymbol>, UnaryOperator<ISymbol>

public final class SymbolTypeOrException extends Object implements UnaryOperator<ISymbol>
Just gets the type from a symbol, or throws a compiler exception if missing. Missing types should have been detected in earlier stages. So be carful which phase you use this with.

Optionally accepts a type resolver for Scenario 3 parameterized type IR generation - the SYMBOL counterpart of TypeNameOrException(java.util.function.Function): inside a monomorphized generic body every recorded type is a TEMPLATE type (T, List of T, Predicate of T), so a generator that reads a type to emit it or to reason about it must take the concrete one (IRGenerationContext#resolveType(ISymbol)).

  • Constructor Details

    • SymbolTypeOrException

      public SymbolTypeOrException()
      Create with identity resolver (no type substitution).
    • SymbolTypeOrException

      public SymbolTypeOrException(UnaryOperator<ISymbol> typeResolver)
      Create with a type resolver for Scenario 3 type parameter substitution.
      Parameters:
      typeResolver - maps a (possibly conceptual) type symbol to the concrete type symbol to use
  • Method Details