Class UnaryLetCoerceOperatorStaticSemantics
MS-VBAL 5.6.6 Parenthesized Expressions (static semantics): the operator a pair of parentheses around an expression is.
public sealed record UnaryLetCoerceOperatorStaticSemantics : StaticSemantics, IStaticSemantics, IEquatable<StaticSemantics>, IEquatable<UnaryLetCoerceOperatorStaticSemantics>
- Inheritance
-
UnaryLetCoerceOperatorStaticSemantics
- Implements
- Inherited Members
Remarks
"The declared type of a parenthesized expression is that of the enclosed expression" — so this determines no type of its own, and no operand type is a mismatch. What the parentheses change is the expression's classification: 5.6.6 classifies it as a value expression, where the enclosed expression may have been a variable. That is not a declared type, and it is not recorded here — it is what the operator's run-time semantics produce.
The binary form of the same operator (an explicit coercion to a named target type) is BinaryLetCoerceOperatorStaticSemantics.
Constructors
UnaryLetCoerceOperatorStaticSemantics()
MS-VBAL 5.6.6 Parenthesized Expressions (static semantics): the operator a pair of parentheses around an expression is.
public UnaryLetCoerceOperatorStaticSemantics()
Remarks
"The declared type of a parenthesized expression is that of the enclosed expression" — so this determines no type of its own, and no operand type is a mismatch. What the parentheses change is the expression's classification: 5.6.6 classifies it as a value expression, where the enclosed expression may have been a variable. That is not a declared type, and it is not recorded here — it is what the operator's run-time semantics produce.
The binary form of the same operator (an explicit coercion to a named target type) is BinaryLetCoerceOperatorStaticSemantics.
Methods
DetermineDeclaredType(StaticEvaluationContext, ExpressionNode, params VBType[])
Determines a static VBType from the specified operands.
public override 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 enclosed expression's own declared type.