Record Class CaptureConstructorParameters
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.support.CaptureConstructorParameters
- Record Components:
typeNames- the type names the call is described withtypeSymbols- the same types as symbols, to resolve the constructor by
public record CaptureConstructorParameters(List<String> typeNames, List<ISymbol> typeSymbols)
extends Record
THE parameter types of the constructor a dynamic class or a dynamic function is created through: one per captured
variable, in capture order, named from the construct's OWN captured variables - exactly as
FieldsFromCapture
declares its fields, so the call and the constructor it calls cannot disagree. Use this at every site that calls
such a constructor.
The call sites once named each type from the captured EXPRESSION, and each in its own way. For a captured function
the expression's symbol is the function itself, whose type name is its RETURN type: a dynamic class capturing
(delegate: labeller) declared <init>(labeller) but was called as <init>(String) - a
VerifyError at class load, so every function-valued capture was unusable (front-end audit FE47). A captured
VARIABLE names its declared type, which is right for a value and for a function alike.
-
Constructor Summary
ConstructorsConstructorDescriptionCaptureConstructorParameters(List<String> typeNames, List<ISymbol> typeSymbols) Creates an instance of aCaptureConstructorParametersrecord 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.static CaptureConstructorParametersof(ICanCaptureVariables construct, TypeNameOrException typeNames) The constructor parameters of this dynamic class or dynamic function.final StringtoString()Returns a string representation of this record class.Returns the value of thetypeNamesrecord component.Returns the value of thetypeSymbolsrecord component.
-
Constructor Details
-
CaptureConstructorParameters
-
-
Method Details
-
of
public static CaptureConstructorParameters of(ICanCaptureVariables construct, TypeNameOrException typeNames) The constructor parameters of this dynamic class or dynamic function.- Parameters:
construct- the dynamic class or dynamic function being createdtypeNames- the call site's own type namer, so any type-parameter substitution it applies still applies
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
typeNames
-
typeSymbols
Returns the value of thetypeSymbolsrecord component.- Returns:
- the value of the
typeSymbolsrecord component
-