Class SyntheticParameterNames

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

public final class SyntheticParameterNames extends Object
THE names the compiler gives the parameters of constructors it SYNTHESISES - a constrained type's, an enumeration's, a text's, a generic's required pair and its type parameters'. No declaration exists for these, so the compiler is the author; but the name is published in the type's API (ek9 -h Age), it is what an LLM reads before writing a call, and EK9 CHECKS an argument label against it (E06250), so it is part of the contract rather than decoration.

They follow the same convention as the standard library's own parameters (2026-09-24): a same-type operand is other; a value a type is constructed FROM is from, which reads as a sentence at the only place the name is ever typed - Age(from: 21); an enumeration constructed from its name takes name. value is deliberately absent: E11031 bans it as non-descriptive, and the compiler must not emit what it rejects.

The same names serve a generic's TYPE PARAMETERS: each conceptual T is given a constructor per type parameter, and a parameter of type S takes the name the generic gives S here - never arg (2026-10-05). A T constrain by X also takes X's own constructors, with X's own names.

A generic's inferring constructor (forGenericTypeParameters(List)): item for ONE type parameter, as the stdlib's Optional/List/Iterator do - Box(item: 21); otherwise each type parameter's name with its first letter lowercased, as Dict/DictEntry do - Pair(k: 1, v: "x"). If any such name would be a keyword that cannot be a name (Ek9Keywords), an E11031-banned word, or a duplicate, the WHOLE constructor uses ordinals (first, second, ...). Decided 2026-09-25 (front-end audit DUP2); it was arg0, arg1, ....

  • Field Details

    • SAME_TYPE

      public static final String SAME_TYPE
      A self-copy constructor's operand - the same word the stdlib uses for a same-type operand.
      See Also:
    • CONSTRAINED_BASE

      public static final String CONSTRAINED_BASE
      The base-type value a constrained type is constructed from: Age(from: 21).
      See Also:
    • ENUM_NAME

      public static final String ENUM_NAME
      The enumeration name being matched: Colour(name: "RED").
      See Also:
    • GENERIC_ITEM

      public static final String GENERIC_ITEM
      The single value a one-type-parameter generic is constructed from: Box(item: 21).
      See Also:
    • TEXT_LANGUAGE_TAG

      public static final String TEXT_LANGUAGE_TAG
      The language tag a text is constructed with: WelcomePageText(languageTag: "de").
      See Also:
    • OPERATOR_OPERAND

      public static final String OPERATOR_OPERAND
      The operand of an operator the compiler synthesises (default operator ==, <=>, :=:, ...).

      The one deliberate exception to the other convention: the IR generators load it by this name (IRConstants.PARAM_VAR is this constant), so renaming it rewrites every @IR/@BYTECODE golden of a defaulted operator. It was two independent "param" literals until front-end audit DUP8.

      See Also:
  • Method Details

    • forGenericTypeParameters

      public static List<String> forGenericTypeParameters(List<String> typeParameterNames)
      The parameter names for a generic type's synthesised inferring constructor, one per type parameter, in order.