Class ConstructDisplayName

java.lang.Object
org.ek9lang.compiler.support.ConstructDisplayName

public final class ConstructDisplayName extends Object
THE display name of a construct - the name a person reads for it at RUN TIME (F2, Steve 2026-10-08, Contract 21 in EK9_BACKEND_IR_CONTRACTS.md). Use this, never a demangler.

A construct's IDENTITY is its fully qualified name, and for a monomorphised generic that name is a DIGEST (module::_Holder_68EF...): it can never be turned back into Holder of String at run time. So the display name is fixed HERE, at compile time, from the SYMBOL - the generic it parameterises and its type arguments, rendered exactly as the compiler's own friendly name renders them (ToCommaSeparated) - and handed to the back ends as IR data (IRConstruct.getDisplayName()), which store it on the type.

Present ONLY where it differs from the identity: a parameterised type or function. Every other construct has none (its identity already reads correctly), so ordinary classes' IR and bytecode are unchanged. A dynamic class or function (_Class_<hash>) has none either: it has no source name to show.

🔑 Display only - never an identity, never a join key: two parameterisations in different modules can share a display name.

  • Method Details

    • of

      public static Optional<String> of(ISymbol symbol)
      The fully qualified display name (module::Holder of String) of a monomorphised generic, else empty.
      Parameters:
      symbol - the construct's symbol
      Returns:
      the display name, present only where it differs from the symbol's fully qualified name