Record Class ConstructionSteps

java.lang.Object
java.lang.Record
org.ek9lang.compiler.support.ConstructionSteps
Record Components:
implicitSuper - the super type whose no-argument constructor is called implicitly, if any
runsInstanceInit - true if the constructor runs this type's property initialisers itself

public record ConstructionSteps(Optional<IAggregateSymbol> implicitSuper, boolean runsInstanceInit) extends Record
THE steps a constructor of an aggregate takes before its own body - use this wherever those steps are generated or modelled, so the generated code and the phase-5 call graph cannot disagree about what construction runs.
  • It calls the super type's no-argument constructor, unless it calls super(...) or this(...) itself, and only when the super is a real EK9 super (NotImplicitSuper): implicitSuper().
  • It runs this type's property initialisers (_i_init), unless it delegates with this(...), where the constructor delegated to runs them: runsInstanceInit().

Every input is in the symbol table by the end of FULL_RESOLUTION: the super type (phase 2) and the explicit super/this calls (squirrelled in phase 3). So the phase-5 call graph records construction without IR - it had no edge for either step, and a function reached only through construction looked dead (front-end audit SF2).

  • Constructor Details

    • ConstructionSteps

      public ConstructionSteps(Optional<IAggregateSymbol> implicitSuper, boolean runsInstanceInit)
      Creates an instance of a ConstructionSteps record class.
      Parameters:
      implicitSuper - the value for the implicitSuper record component
      runsInstanceInit - the value for the runsInstanceInit record component
  • Method Details

    • of

      public static ConstructionSteps of(MethodSymbol constructor)
      The steps this constructor takes before its body.
      Parameters:
      constructor - a constructor of an aggregate
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • implicitSuper

      public Optional<IAggregateSymbol> implicitSuper()
      Returns the value of the implicitSuper record component.
      Returns:
      the value of the implicitSuper record component
    • runsInstanceInit

      public boolean runsInstanceInit()
      Returns the value of the runsInstanceInit record component.
      Returns:
      the value of the runsInstanceInit record component