Class RequiredOperatorPresentOrError

All Implemented Interfaces:
Function<CheckOperatorData, Optional<ISymbol>>

final class RequiredOperatorPresentOrError extends TypedSymbolAccess implements Function<CheckOperatorData, Optional<ISymbol>>
To be used with operators on aggregates (except for the is-set ? operator, that has to deal with functions). This function attempts to locate the method on the aggregate and returns the type of the return variable or empty.
  • Constructor Details

  • Method Details

    • apply

      public Optional<ISymbol> apply(CheckOperatorData checkOperatorData)
      Specified by:
      apply in interface Function<CheckOperatorData, Optional<ISymbol>>
    • apply

      public Optional<ISymbol> apply(CheckOperatorData checkOperatorData, CallSymbol callSymbol)
      Overloaded version that accepts a CallSymbol and sets the resolved method on it. This is used for operator expressions where we need to store the resolved method for later IR generation (particularly for parameter promotion).
    • notAnEnumerationTypeOrError

      boolean notAnEnumerationTypeOrError(IToken operatorUse, ISymbol operand)
      THE check that an operand is a VALUE, not the enumeration TYPE itself (CardSuit > CardSuit.Hearts), which is E07630. Shared by every operator check on a value, and by the operators that judge their operands' common TYPE (<? >? ?:), which check each operand here first.
      Returns:
      true when the operand is not an enumeration type