提交 eb68fb80 编写于 作者: N Neal Gafter

Use helpers when possible for lvalue and rvalue result.

上级 9160b423
......@@ -1236,7 +1236,7 @@ protected override BoundExpression VisitExpressionWithoutStackGuard(BoundExpress
if (node.IsSuppressed || node.HasAnyErrors || !wasReachable)
{
var result = resultType.WithNonNullState();
SetResult(result, _visitResult.LValueType);
SetResult(result, LvalueResultType);
}
return null;
}
......@@ -2630,7 +2630,7 @@ private VisitResult VisitArgumentEvaluate(ImmutableArray<BoundExpression> argume
{
Visit(argument);
// No Unsplit
_visitResult = new VisitResult(_visitResult.RValueType, _visitResult.RValueType.ToTypeSymbolWithAnnotations());
ResultType = ResultType; // force use of flow result
}
else
{
......@@ -2643,7 +2643,7 @@ private VisitResult VisitArgumentEvaluate(ImmutableArray<BoundExpression> argume
Visit(argument);
// We'll want to use the l-value type, rather than the result type, for method re-inference
LvalueResultType = _visitResult.LValueType;
LvalueResultType = LvalueResultType;
break;
}
......@@ -4083,7 +4083,7 @@ public override BoundNode VisitAssignmentOperator(BoundAssignmentOperator node)
var left = node.Left;
var right = node.Right;
Visit(left);
TypeSymbolWithAnnotations leftLValueType = _visitResult.LValueType;
TypeSymbolWithAnnotations leftLValueType = LvalueResultType;
if (left.Kind == BoundKind.EventAccess && ((BoundEventAccess)left).EventSymbol.IsWindowsRuntimeEvent)
{
......@@ -4300,7 +4300,7 @@ DeconstructionVariable getDeconstructionAssignmentVariable(BoundExpression expr)
return new DeconstructionVariable(GetDeconstructionAssignmentVariables((BoundTupleExpression)expr));
default:
Visit(expr);
return new DeconstructionVariable(expr, _visitResult.LValueType);
return new DeconstructionVariable(expr, LvalueResultType);
}
}
}
......@@ -4347,7 +4347,7 @@ public override BoundNode VisitIncrementOperator(BoundIncrementOperator node)
Debug.Assert(!IsConditionalState);
var operandType = VisitRvalueWithState(node.Operand);
var operandLvalue = _visitResult.LValueType;
var operandLvalue = LvalueResultType;
bool setResult = false;
if (this.State.Reachable)
......@@ -4443,8 +4443,8 @@ public override BoundNode VisitIncrementOperator(BoundIncrementOperator node)
public override BoundNode VisitCompoundAssignmentOperator(BoundCompoundAssignmentOperator node)
{
Visit(node.Left);
TypeSymbolWithAnnotations leftLValueType = _visitResult.LValueType;
TypeWithState leftResultType = _visitResult.RValueType;
TypeSymbolWithAnnotations leftLValueType = LvalueResultType;
TypeWithState leftResultType = ResultType;
TypeWithState resultType;
Debug.Assert(!IsConditionalState);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册