Record Class InputClassProbeArg
- Record Components:
paramIndex- zero-based position in the callable's flattened leaf-dimension list (the receiver, when present, is index 0 and the arguments follow)variableName- the IR local variable name the backend loads onto the stack (ignored for the receiver, which loadsthis)typeName- the fully-qualified declared type of the dimension (diagnostic / metadata)receiver-trueiff this is the receiver dimension — the backend loadsthis(ALOAD 0) rather than a named parameter localenumeration-trueiff this dimension's classes are enumeration members, so the runtime records the member name rather than bucketing the valuegenericDimension-trueiff this dimension is declared as a conceptual type parameter (T) on the generic being monomorphised, so the runtime must qualify the recorded class by the value's concrete TYPE. Without it,Holder of Stringdriven with a String that classifiesTYPICALandHolder of Integerdriven with an Integer that also classifiesTYPICALcollapse into ONE cell, so the numerator can never climb toward the widened denominator (D11/W5b). ⚠️ Deliberately NOT applied to every dimension: a parameter declared as a trait orAnylegitimately receives several concrete types, and qualifying it would let its covered cells exceed that type's floor of two - the exact failure the design warns about for opaque values.
INPUT_CLASS_PROBE (design
EK9_INPUT_VARIATION_METRIC_DESIGN.md §5) — either a declared argument or the receiver as the
implicit p0 (§4.5). Names the live local the backend loads (a parameter variable, or
this for the receiver) so the runtime classifier can place the actual value into a
ValueClassId leaf cell during the -t run.
Records need nothing special here. A record decomposes into one dimension per field leaf
(§4.5), but that decomposition is expressed as ordinary LOAD_FIELD instructions emitted
before the probe — so a record leaf arrives as just another named local, indistinguishable to the
backend from a scalar parameter.
Enumerations need one bit. An enum's value-classes are its members, and the member name is
only reachable at runtime via _string() — but a generated enum is a plain class implementing
Any with no runtime marker, so the classifier cannot tell one from any other user type.
(It must not simply call _string() on everything unrecognised: for an opaque class that
returns arbitrary text, and every distinct string would become a new class, letting the numerator
exceed that type's floor of 2.) The genus is compile-time knowledge, so enumeration carries
it to the backend, which selects the enum-aware runtime entry point. That is a method choice, not
logic — no backend walks anything.
-
Constructor Summary
ConstructorsConstructorDescriptionInputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration, boolean genericDimension) Creates an instance of aInputClassProbeArgrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic InputClassProbeArgA declared-argument dimension — the backend loads the named parameter local.booleanReturns the value of theenumerationrecord component.final booleanIndicates whether some other object is "equal to" this one.static InputClassProbeArggenericArgument(int paramIndex, String variableName, String typeName, boolean enumeration) A declared-argument dimension whose declared type on the GENERIC is a conceptual type parameter (T) — seegenericDimension.booleanReturns the value of thegenericDimensionrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theparamIndexrecord component.booleanreceiver()Returns the value of thereceiverrecord component.static InputClassProbeArgThe receiver dimension (p0, §4.5) — the backend loadsthis.final StringtoString()Returns a string representation of this record class.typeName()Returns the value of thetypeNamerecord component.Returns the value of thevariableNamerecord component.
-
Constructor Details
-
InputClassProbeArg
public InputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration, boolean genericDimension) Creates an instance of aInputClassProbeArgrecord class.- Parameters:
paramIndex- the value for theparamIndexrecord componentvariableName- the value for thevariableNamerecord componenttypeName- the value for thetypeNamerecord componentreceiver- the value for thereceiverrecord componentenumeration- the value for theenumerationrecord componentgenericDimension- the value for thegenericDimensionrecord component
-
-
Method Details
-
argument
public static InputClassProbeArg argument(int paramIndex, String variableName, String typeName, boolean enumeration) A declared-argument dimension — the backend loads the named parameter local. -
genericArgument
public static InputClassProbeArg genericArgument(int paramIndex, String variableName, String typeName, boolean enumeration) A declared-argument dimension whose declared type on the GENERIC is a conceptual type parameter (T) — seegenericDimension. -
receiver
The receiver dimension (p0, §4.5) — the backend loadsthis. -
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. -
paramIndex
public int paramIndex()Returns the value of theparamIndexrecord component.- Returns:
- the value of the
paramIndexrecord component
-
variableName
Returns the value of thevariableNamerecord component.- Returns:
- the value of the
variableNamerecord component
-
typeName
-
receiver
-
enumeration
public boolean enumeration()Returns the value of theenumerationrecord component.- Returns:
- the value of the
enumerationrecord component
-
genericDimension
public boolean genericDimension()Returns the value of thegenericDimensionrecord component.- Returns:
- the value of the
genericDimensionrecord component
-