Class IsSetCallDetailsCreator

java.lang.Object
org.ek9lang.compiler.phase7.calls.IsSetCallDetailsCreator

public final class IsSetCallDetailsCreator extends Object
Creates CallDetails for _isSet() method invocation. The _isSet() operator (?) checks if a value is set/valid.

When the target operand is a trait (interface), the call must use INVOKEINTERFACE in JVM bytecode, so isTraitCall must be set correctly.

Takes the operand type as a SYMBOL, not a name. ? is user-overridable (override operator ?), so its purity and complexity are properties of the user's code and must be READ off the resolved operator - this previously hard-coded (true, 0), reporting every user's impure or complex ? as pure with zero complexity.

The trait flag is derived HERE from the operand (TraitCall.requiredForValue(ISymbol), substituted inside a monomorphisation), so the named type, the metadata, the dispatch and the trait flag all come from the one operand symbol (MONO-18) - callers used to pass it in.

  • Constructor Details

  • Method Details

    • apply

      public CallDetails apply(String operandVariable, ISymbol operandSymbol)
      Create CallDetails for _isSet() call on the specified operand.
      Parameters:
      operandVariable - The variable to call _isSet() on
      operandSymbol - The operand symbol - its type names the target, supplies the metadata and decides whether the call is an interface call
      Returns:
      CallDetails for the _isSet() method call