Record Class DispatchFacts
- Record Components:
targetTypeName- the type the CALL names - the type whose member is calledisTraitCall- that type compiles to an interface (a trait orAny) -TraitCallisVirtualCall- the call dispatches on the receiver's runtime typeisExternTarget- the named type is externally linked: EXTERN or PRE_BUILT (Java on the JVM, C natively); a user type, or a compiler-generated member of one, is NOT
CallDetails fields that say WHERE the call goes and HOW it gets
there: the type it names (targetTypeName), whether that type is an interface (isTraitCall),
whether the call dispatches through the vtable (isVirtualCall) and whether the named type is externally linked
(isExternTarget - EXTERN or PRE_BUILT, see IsExternallyLinked; Steve 2026-10-28).
Use this - do not derive the four flags again at a new call site.
Each route that builds a CallDetails from a resolved symbol derives these facts here, by a NAMED factory
that states its rule, so the rules sit side by side and a difference between two of them is visible in one file
rather than in six (IR tidy plan MONO-6 (b)). CallDetailsFactory.resolvedCall turns the facts into the
record; a route that keeps a literal new CallDetails( is one still to migrate (W4.4).
The factories are a pure extraction: each gives exactly the answer its route gave before it moved here. Where two routes answer the same question differently, that difference is recorded on the factory and left as it is, because changing it moves goldens and is a wave-4 decision:
ofResolvedCall(ISymbol, ISymbol, ISymbol, boolean, TypeNameOrException, UnaryOperator)(a call phase 3 recorded) andofOperatorFallback(Optional, ISymbol, boolean, TypeNameOrException, UnaryOperator)(an operator with no parse node) disagree on a zero-argument operator on a generic's bareT(virtual from the resolved member vs from the static type's openness) - MONO-5, W4.3. Not visible on the JVM; read by the native back end.isExternTargetis NOT a route difference any more (IR lane F, Steve 2026-10-28): every factory here answersIsExternallyLinkedof the type its call NAMES.
The JVM back end reads targetTypeName, isTraitCall and the explicit-trait-default flag; it ignores
isVirtualCall and isExternTarget, so a change to either must be named for the LLVM branch.
CallDetails.toString() renders virtual= and trait= but never isExternTarget
(IR tidy plan section 9.1).
-
Constructor Summary
ConstructorsConstructorDescriptionDispatchFacts(String targetTypeName, boolean isTraitCall, boolean isVirtualCall, boolean isExternTarget) Creates an instance of aDispatchFactsrecord 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.booleanReturns the value of theisExternTargetrecord component.booleanReturns the value of theisTraitCallrecord component.booleanReturns the value of theisVirtualCallrecord component.(package private) static DispatchFactsThe facts of a generatedclose- seeCloseCallTarget, which decides them.static DispatchFactsofForwardToBase(String definingTypeName, ISymbol definingType, ISymbol baseType) The facts of a call a constrained type FORWARDS to its base (a delegated member, a constraint comparison): the call names the type that DECLARES the base member and the trait flag is read off that same type, dispatch is the BASE type's openness, and extern is the declaring type's (IsExternallyLinked).static DispatchFactsofOperatorFallback(Optional<ScopedSymbol> servingMember, ISymbol staticType, boolean explicitSuperReceiver, TypeNameOrException typeNames, UnaryOperator<ISymbol> concreteType) The facts of an operator call with no parse node (path B ofCallDetailsBuilder: a compound assignment, a unary operator, a phase-7 protocol call): the call names the type that declares the serving member when one resolves, else the static type; a trait call is virtual by definition, otherwise dispatch is the static type's openness; extern is the STATIC type's (MONO-5 - see the class note).static DispatchFactsofResolvedCall(ISymbol resolvedMethod, ISymbol servingMethod, ISymbol staticType, boolean explicitSuperReceiver, TypeNameOrException typeNames, UnaryOperator<ISymbol> concreteType) The facts of a call to a member phase 3 RESOLVED (path A ofCallDetailsBuilder): the call names the type that DECLARES the serving member, the trait flag is read off that same type (they move together -CallTargetResolution), dispatch isIsVirtualCallof the RECORDED member and the static type, and extern is the declaring type's.static DispatchFactsofSynthesisedCallee(String targetTypeName, boolean isTraitCall, ISymbol calleeType, UnaryOperator<ISymbol> concreteType) The facts of a call the compiler SYNTHESISED on a value's type (?,close): the named type and its trait flag as given, dispatch from the callee type's openness (IsVirtualForSynthesisedCallee), extern the callee type's (IsExternallyLinked).static DispatchFactsofTargetType(String targetTypeName, ISymbol targetType, boolean shapePermitsDispatch) The facts of a call on a type held as a SYMBOL but with no resolved member (CallDetailsFactory.call's symbol overload): the call names that type, the trait flag and openness are read off it, the call SHAPE may veto dispatch, and extern is the named type's (IsExternallyLinked).Returns the value of thetargetTypeNamerecord component.final StringtoString()Returns a string representation of this record class.viaSuper()These facts for the same member reached throughsuper: the named type is kept, and the call is neither an interface call nor dispatched - it runs exactly that type's body.
-
Constructor Details
-
DispatchFacts
public DispatchFacts(String targetTypeName, boolean isTraitCall, boolean isVirtualCall, boolean isExternTarget) Creates an instance of aDispatchFactsrecord class.- Parameters:
targetTypeName- the value for thetargetTypeNamerecord componentisTraitCall- the value for theisTraitCallrecord componentisVirtualCall- the value for theisVirtualCallrecord componentisExternTarget- the value for theisExternTargetrecord component
-
-
Method Details
-
ofResolvedCall
public static DispatchFacts ofResolvedCall(ISymbol resolvedMethod, ISymbol servingMethod, ISymbol staticType, boolean explicitSuperReceiver, TypeNameOrException typeNames, UnaryOperator<ISymbol> concreteType) The facts of a call to a member phase 3 RESOLVED (path A ofCallDetailsBuilder): the call names the type that DECLARES the serving member, the trait flag is read off that same type (they move together -CallTargetResolution), dispatch isIsVirtualCallof the RECORDED member and the static type, and extern is the declaring type's.- Parameters:
resolvedMethod- the member phase 3 recorded (it decides dispatch)servingMethod- the member that serves the call - the type argument's own inside a monomorphisation (OperatorTargetMethodResolver.onTypeArgument), elseresolvedMethodstaticType- the receiver's static type (or a value symbol, resolved to its type here)explicitSuperReceiver- the call is made onsuper, which never dispatchestypeNames- THE resolver-aware type namer of the generation in progressconcreteType- the generation's symbol resolver (IRGenerationContext::resolveType): inside a monomorphised body a bareTis the type argument, whose linkage is asked
-
ofOperatorFallback
public static DispatchFacts ofOperatorFallback(Optional<ScopedSymbol> servingMember, ISymbol staticType, boolean explicitSuperReceiver, TypeNameOrException typeNames, UnaryOperator<ISymbol> concreteType) The facts of an operator call with no parse node (path B ofCallDetailsBuilder: a compound assignment, a unary operator, a phase-7 protocol call): the call names the type that declares the serving member when one resolves, else the static type; a trait call is virtual by definition, otherwise dispatch is the static type's openness; extern is the STATIC type's (MONO-5 - see the class note).- Parameters:
servingMember- the member that serves the call, when one resolves on the static typestaticType- the receiver's static type (or a value symbol, resolved to its type here)explicitSuperReceiver- the call is made onsuper, which never dispatchestypeNames- THE resolver-aware type namer of the generation in progressconcreteType- the generation's symbol resolver (IRGenerationContext::resolveType): inside a monomorphised body a bareTis the type argument, whose linkage is asked
-
ofTargetType
public static DispatchFacts ofTargetType(String targetTypeName, ISymbol targetType, boolean shapePermitsDispatch) The facts of a call on a type held as a SYMBOL but with no resolved member (CallDetailsFactory.call's symbol overload): the call names that type, the trait flag and openness are read off it, the call SHAPE may veto dispatch, and extern is the named type's (IsExternallyLinked).- Parameters:
targetTypeName- the IR name of that typetargetType- the type that defines the methodshapePermitsDispatch- false for a lifecycle method or an explicitsupercall
-
ofForwardToBase
public static DispatchFacts ofForwardToBase(String definingTypeName, ISymbol definingType, ISymbol baseType) The facts of a call a constrained type FORWARDS to its base (a delegated member, a constraint comparison): the call names the type that DECLARES the base member and the trait flag is read off that same type, dispatch is the BASE type's openness, and extern is the declaring type's (IsExternallyLinked).- Parameters:
definingTypeName- the IR name of the declaring typedefiningType- the type that declares the base member (DefiningType)baseType- the constrained type's base, whose openness decides dispatch
-
ofSynthesisedCallee
public static DispatchFacts ofSynthesisedCallee(String targetTypeName, boolean isTraitCall, ISymbol calleeType, UnaryOperator<ISymbol> concreteType) The facts of a call the compiler SYNTHESISED on a value's type (?,close): the named type and its trait flag as given, dispatch from the callee type's openness (IsVirtualForSynthesisedCallee), extern the callee type's (IsExternallyLinked).- Parameters:
targetTypeName- the IR name of the type the call names (keeps any Scenario-3 substitution)isTraitCall- that type compiles to an interfacecalleeType- the type whose openness decides dispatch (may benull: not virtual)concreteType- the generation's symbol resolver (IRGenerationContext::resolveType)
-
ofClose
static DispatchFacts ofClose(String ownerTypeName, boolean isTraitCall, boolean isVirtualCall, ISymbol ownerType) The facts of a generatedclose- seeCloseCallTarget, which decides them.- Parameters:
ownerTypeName- the type that declarescloseisTraitCall- that type compiles to an interfaceisVirtualCall- the value's static type may hold a subtype that overridescloseownerType- the type that declaresclose(decidesisExternTarget)
-
viaSuper
These facts for the same member reached throughsuper: the named type is kept, and the call is neither an interface call nor dispatched - it runs exactly that type's body. -
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. -
targetTypeName
Returns the value of thetargetTypeNamerecord component.- Returns:
- the value of the
targetTypeNamerecord component
-
isTraitCall
public boolean isTraitCall()Returns the value of theisTraitCallrecord component.- Returns:
- the value of the
isTraitCallrecord component
-
isVirtualCall
public boolean isVirtualCall()Returns the value of theisVirtualCallrecord component.- Returns:
- the value of the
isVirtualCallrecord component
-
isExternTarget
public boolean isExternTarget()Returns the value of theisExternTargetrecord component.- Returns:
- the value of the
isExternTargetrecord component
-