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 anyrunsInstanceInit- 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 Summary
ConstructorsConstructorDescriptionConstructionSteps(Optional<IAggregateSymbol> implicitSuper, boolean runsInstanceInit) Creates an instance of aConstructionStepsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theimplicitSuperrecord component.static ConstructionStepsof(MethodSymbol constructor) The steps this constructor takes before its body.booleanReturns the value of therunsInstanceInitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConstructionSteps
Creates an instance of aConstructionStepsrecord class.- Parameters:
implicitSuper- the value for theimplicitSuperrecord componentrunsInstanceInit- the value for therunsInstanceInitrecord component
-
-
Method Details
-
of
The steps this constructor takes before its body.- Parameters:
constructor- a constructor of an aggregate
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
implicitSuper
Returns the value of theimplicitSuperrecord component.- Returns:
- the value of the
implicitSuperrecord component
-
runsInstanceInit
public boolean runsInstanceInit()Returns the value of therunsInstanceInitrecord component.- Returns:
- the value of the
runsInstanceInitrecord component
-