Class PlannedOperatorStaticSemantics
The declared type of an operation, as the plan of the operation has it (OperationPlanner): the one table of the effective types of the operators, consulted for declared types here as it is for values at run time.
public abstract record PlannedOperatorStaticSemantics : StaticSemantics, IEquatable<StaticSemantics>, IStaticSemantics, IEquatable<PlannedOperatorStaticSemantics>
- Inheritance
-
PlannedOperatorStaticSemantics
- Implements
- Derived
- Inherited Members
Remarks
An operand declared Variant makes the operation a Variant: its plan is deferred, and what it yields is decided by the value. An operand
declared Object makes it late-bound (VBUnknownType): the default member of the object is evaluated at run time, which says what the
operand is - an object, as such, is not made into a Variant. Neither may be operated on with an array or a user-defined type, which is a compile
error. Any other operation is the plan's: its effective type is the declared type of the operation, and no effective type is the compile error.
👉 The relational operators, Like and Is have static rules of their own: an operand that only a value tells about - a class, which its
default member decides - is compared all the same.
Properties
Operator
The operator: one of the Tokens operators, which is what the plan of the operation is made for.
protected abstract string Operator { get; }
Property Value
Methods
DetermineDeclaredType(StaticEvaluationContext, ExpressionNode, params VBType[])
Determines a static VBType from specified operands.
public override sealed StaticSemanticsEvaluationResult DetermineDeclaredType(StaticEvaluationContext context, ExpressionNode expression, params VBType[] operandDeclaredTypes)
Parameters
contextStaticEvaluationContextThe compile-time context this expression is evaluated against.
expressionExpressionNodeThe expression node being evaluated.
operandDeclaredTypesVBType[]The declared type of each operand involved in the evaluation.
Returns
- StaticSemanticsEvaluationResult
A StaticSemanticsEvaluationResult encapsulating the resulting VBType if successful, or VBCompileErrorInfo error metadata otherwise.