Moved C# to not pass multiple children to constructors, and instead just pass...

Moved C# to not pass multiple children to constructors, and instead just pass the original bound node.
上级 bbea94b8
......@@ -4580,9 +4580,9 @@ private BoundExpression BindUnexpectedComplexElementInitializer(InitializerExpre
return new BoundDynamicCollectionElementInitializer(
elementInitializer,
arguments: boundElementInitializerExpressions,
implicitReceiver,
applicableMethods: ImmutableArray<MethodSymbol>.Empty,
implicitReceiver,
arguments: boundElementInitializerExpressions,
type: GetSpecialType(SpecialType.System_Void, diagnostics, elementInitializer),
hasErrors: hasErrors);
}
......@@ -4601,9 +4601,9 @@ private BoundExpression BindUnexpectedComplexElementInitializer(InitializerExpre
var dynamicInvocation = (BoundDynamicInvocation)addMethodInvocation;
return new BoundDynamicCollectionElementInitializer(
elementInitializer,
dynamicInvocation.Arguments,
implicitReceiver,
dynamicInvocation.ApplicableMethods,
implicitReceiver,
dynamicInvocation.Arguments,
dynamicInvocation.Type,
hasErrors: dynamicInvocation.HasAnyErrors);
}
......
......@@ -347,11 +347,11 @@ private BoundExpression BindArgListOperator(InvocationExpressionSyntax node, Dia
return new BoundDynamicInvocation(
node,
expression,
argArray,
arguments.GetNames(),
refKindsArray,
applicableMethods,
expression,
argArray,
type: Compilation.DynamicType,
hasErrors: hasErrors);
}
......
......@@ -460,7 +460,7 @@ private BoundExpression BindSimpleBinaryOperator(BinaryExpressionSyntax node, Di
if (left.HasAnyErrors || right.HasAnyErrors)
{
// NOTE: no user-defined conversion candidates
return new BoundBinaryOperator(node, kind, left, right, ConstantValue.NotAvailable, null, LookupResultKind.Empty, GetBinaryOperatorErrorType(kind, diagnostics, node), true);
return new BoundBinaryOperator(node, kind, ConstantValue.NotAvailable, null, LookupResultKind.Empty, left, right, GetBinaryOperatorErrorType(kind, diagnostics, node), true);
}
TypeSymbol leftType = left.Type;
......@@ -733,8 +733,8 @@ private BoundExpression BindConditionalLogicalOperator(BinaryExpressionSyntax no
if (left.HasAnyErrors || right.HasAnyErrors)
{
// NOTE: no candidate user-defined operators.
return new BoundBinaryOperator(node, kind, left, right, ConstantValue.NotAvailable, methodOpt: null,
resultKind: LookupResultKind.Empty, type: GetBinaryOperatorErrorType(kind, diagnostics, node), hasErrors: true);
return new BoundBinaryOperator(node, kind, ConstantValue.NotAvailable, methodOpt: null,
resultKind: LookupResultKind.Empty, left, right, type: GetBinaryOperatorErrorType(kind, diagnostics, node), hasErrors: true);
}
// Let's take an easy out here. The vast majority of the time the operands will
......@@ -747,8 +747,8 @@ private BoundExpression BindConditionalLogicalOperator(BinaryExpressionSyntax no
var constantValue = FoldBinaryOperator(node, kind | BinaryOperatorKind.Bool, left, right, SpecialType.System_Boolean, diagnostics);
// NOTE: no candidate user-defined operators.
return new BoundBinaryOperator(node, kind | BinaryOperatorKind.Bool, left, right, constantValue, methodOpt: null,
resultKind: LookupResultKind.Viable, type: left.Type, hasErrors: constantValue != null && constantValue.IsBad);
return new BoundBinaryOperator(node, kind | BinaryOperatorKind.Bool, constantValue, methodOpt: null,
resultKind: LookupResultKind.Viable, left, right, type: left.Type, hasErrors: constantValue != null && constantValue.IsBad);
}
if (left.HasDynamicType() || right.HasDynamicType())
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundAnonymousObjectCreationExpression : IBoundAnonymousObjectCreation
{
ImmutableArray<BoundExpression> IBoundAnonymousObjectCreation.Arguments => this.Arguments;
ImmutableArray<BoundAnonymousPropertyDeclaration> IBoundAnonymousObjectCreation.PropertyDeclarationsOpt => this.Declarations;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundCall : IBoundInvocableExpression
{
BoundExpression IBoundInvocableExpression.GetAsBoundNode() => this;
BoundExpression IBoundInvocableExpression.ReceiverOpt => this.ReceiverOpt;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundCollectionElementInitializer : IBoundInvocableExpression
{
BoundExpression IBoundInvocableExpression.GetAsBoundNode() => this;
BoundExpression IBoundInvocableExpression.ReceiverOpt => this.ImplicitReceiverOpt;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundConditionalOperator : IBoundConditional
{
BoundNode IBoundConditional.AlternativeOpt => this.Alternative;
BoundNode IBoundConditional.Condition => this.Condition;
BoundNode IBoundConditional.Consequence => this.Consequence;
}
}
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundDynamicCollectionElementInitializer
{
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundIfStatement : IBoundConditional
{
BoundNode IBoundConditional.Condition => this.Condition;
BoundNode IBoundConditional.Consequence => this.Consequence;
BoundNode IBoundConditional.AlternativeOpt => this.AlternativeOpt;
}
}
......@@ -340,13 +340,15 @@
<Field Name="MethodOpt" Type="MethodSymbol" Null="allow"/>
</Node>
<Node Name="BoundBinaryOperator" Base="BoundExpression">
<AbstractNode Name="BoundBinaryOperatorBase" Base="BoundExpression">
<!-- Non-null type is required for this node kind -->
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/>
<Field Name="OperatorKind" Type="BinaryOperatorKind"/>
<Field Name="Left" Type="BoundExpression"/>
<Field Name="Right" Type="BoundExpression"/>
</AbstractNode>
<Node Name="BoundBinaryOperator" Base="BoundBinaryOperatorBase">
<Field Name="OperatorKind" Type="BinaryOperatorKind"/>
<Field Name="ConstantValueOpt" Type="ConstantValue" Null="allow"/>
<Field Name="MethodOpt" Type="MethodSymbol" Null="allow"/>
<Field Name="ResultKind" PropertyOverrides="true" Type="LookupResultKind"/>
......@@ -367,13 +369,8 @@
<Field Name="Operators" Type="TupleBinaryOperatorInfo.Multiple"/>
</Node>
<Node Name="BoundUserDefinedConditionalLogicalOperator" Base="BoundExpression">
<!-- Non-null type is required for this node kind -->
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/>
<Node Name="BoundUserDefinedConditionalLogicalOperator" Base="BoundBinaryOperatorBase">
<Field Name="OperatorKind" Type="BinaryOperatorKind"/>
<Field Name="Left" Type="BoundExpression"/>
<Field Name="Right" Type="BoundExpression"/>
<Field Name="LogicalOperator" Type="MethodSymbol"/>
<Field Name="TrueOperator" Type="MethodSymbol"/>
<Field Name="FalseOperator" Type="MethodSymbol"/>
......@@ -920,16 +917,16 @@
<Field Name="ContinueLabel" Type="GeneratedLabelSymbol"/>
</AbstractNode>
<Node Name="BoundDoStatement" Base="BoundLoopStatement">
<AbstractNode Name="BoundConditionalLoopStatement" Base="BoundLoopStatement">
<Field Name="Locals" Type="ImmutableArray&lt;LocalSymbol&gt;"/>
<Field Name="Condition" Type="BoundExpression"/>
<Field Name="Body" Type="BoundStatement"/>
</AbstractNode>
<Node Name="BoundDoStatement" Base="BoundConditionalLoopStatement">
</Node>
<Node Name="BoundWhileStatement" Base="BoundLoopStatement">
<Field Name="Locals" Type="ImmutableArray&lt;LocalSymbol&gt;"/>
<Field Name="Condition" Type="BoundExpression"/>
<Field Name="Body" Type="BoundStatement"/>
<Node Name="BoundWhileStatement" Base="BoundConditionalLoopStatement">
</Node>
<Node Name="BoundForStatement" Base="BoundLoopStatement">
......@@ -1209,11 +1206,14 @@
<Field Name="Invoked" Type="bool"/>
<Field Name="Indexed" Type="bool"/>
</Node>
<Node Name="BoundDynamicInvocation" Base="BoundExpression">
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/>
<AbstractNode Name="BoundDynamicInvocableBase" Base="BoundExpression">
<Field Name="Expression" Type="BoundExpression"/>
<Field Name="Arguments" Type="ImmutableArray&lt;BoundExpression&gt;"/>
</AbstractNode>
<Node Name="BoundDynamicInvocation" Base="BoundDynamicInvocableBase">
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/>
<Field Name="ArgumentNamesOpt" Type="ImmutableArray&lt;string&gt;" Null="allow"/>
<Field Name="ArgumentRefKindsOpt" Type="ImmutableArray&lt;RefKind&gt;" Null="allow"/>
......@@ -1460,14 +1460,11 @@
<Field Name="BinderOpt" Type="Binder" Null="allow" />
</Node>
<Node Name="BoundDynamicCollectionElementInitializer" Base="BoundExpression">
<Node Name="BoundDynamicCollectionElementInitializer" Base="BoundDynamicInvocableBase">
<!-- Non-null type is required for this node kind -->
<Field Name="Type" Type="TypeSymbol" Override="true" Null="disallow"/>
<!-- We don't hold on DynamicMethodInvocation directly since dynamic invocation isn't specified explicitly in the source. -->
<Field Name="Arguments" Type="ImmutableArray&lt;BoundExpression&gt;"/>
<!-- Used for IOperation to enable translating the initializer to a IDynamicInvocationOperation -->
<Field Name="ImplicitReceiver" Type="BoundImplicitReceiver" />
<!-- The set of applicable Add methods that may be invoked at runtime. Empty otherwise. -->
<Field Name="ApplicableMethods" Type="ImmutableArray&lt;MethodSymbol&gt;" />
......
......@@ -5,7 +5,7 @@
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundObjectCreationExpression
internal partial class BoundObjectCreationExpression : IBoundAnonymousObjectCreation
{
public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<string> argumentNamesOpt,
ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, ConstantValue constantValueOpt,
......@@ -13,6 +13,10 @@ internal partial class BoundObjectCreationExpression
: this(syntax, constructor, ImmutableArray<MethodSymbol>.Empty, arguments, argumentNamesOpt, argumentRefKindsOpt, expanded, argsToParamsOpt, constantValueOpt, initializerExpressionOpt, binderOpt, type, hasErrors)
{ }
ImmutableArray<BoundExpression> IBoundAnonymousObjectCreation.Arguments => this.Arguments;
ImmutableArray<BoundAnonymousPropertyDeclaration> IBoundAnonymousObjectCreation.PropertyDeclarationsOpt => ImmutableArray<BoundAnonymousPropertyDeclaration>.Empty;
public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<string> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded,
ImmutableArray<int> argsToParamsOpt, ConstantValue constantValueOpt, BoundObjectInitializerExpressionBase initializerExpressionOpt, Binder binderOpt, TypeSymbol type)
{
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundPatternSwitchSection : IBoundSwitchSection
{
ImmutableArray<BoundNode> IBoundSwitchSection.SwitchLabels => this.SwitchLabels.CastArray<BoundNode>();
ImmutableArray<BoundStatement> IBoundSwitchSection.Statements => this.Statements;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundPatternSwitchStatement : IBoundSwitchStatement
{
BoundNode IBoundSwitchStatement.Value => this.Expression;
ImmutableArray<BoundStatementList> IBoundSwitchStatement.Cases => this.SwitchSections.CastArray<BoundStatementList>();
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundSwitchSection : IBoundSwitchSection
{
ImmutableArray<BoundNode> IBoundSwitchSection.SwitchLabels => this.SwitchLabels.CastArray<BoundNode>();
ImmutableArray<BoundStatement> IBoundSwitchSection.Statements => this.Statements;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal partial class BoundSwitchStatement : IBoundSwitchStatement
{
BoundNode IBoundSwitchStatement.Value => this.Expression;
ImmutableArray<BoundStatementList> IBoundSwitchStatement.Cases => this.SwitchSections.CastArray<BoundStatementList>();
}
}
......@@ -141,7 +141,7 @@ public sealed override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
binary = stack.Pop();
var right = (BoundExpression)this.Visit(binary.Right);
var type = this.VisitType(binary.Type);
left = binary.Update(binary.OperatorKind, left, right, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, type);
left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, left, right, type);
}
while (stack.Count > 0);
......
......@@ -336,11 +336,11 @@ internal sealed partial class BoundBinaryOperator
: this(
syntax,
operatorKind,
left,
right,
constantValueOpt,
methodOpt,
resultKind,
left,
right,
type,
hasErrors)
{
......@@ -365,12 +365,12 @@ internal sealed partial class BoundUserDefinedConditionalLogicalOperator
: this(
syntax,
operatorKind,
left,
right,
logicalOperator,
trueOperator,
falseOperator,
resultKind,
left,
right,
type,
hasErrors)
{
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal interface IBoundAnonymousObjectCreation
{
ImmutableArray<BoundExpression> Arguments { get; }
ImmutableArray<BoundAnonymousPropertyDeclaration> PropertyDeclarationsOpt { get; }
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
interface IBoundConditional
{
BoundNode Condition { get; }
BoundNode Consequence { get; }
BoundNode AlternativeOpt { get; }
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.CSharp
{
internal interface IBoundInvocableExpression
{
BoundExpression GetAsBoundNode();
BoundExpression ReceiverOpt { get; }
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal interface IBoundSwitchSection
{
ImmutableArray<BoundNode> SwitchLabels { get; }
ImmutableArray<BoundStatement> Statements { get; }
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.CSharp
{
internal interface IBoundSwitchStatement
{
BoundNode Value { get; }
ImmutableArray<BoundStatementList> Cases { get; }
}
}
......@@ -1388,7 +1388,7 @@ public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
}
var type = this.VisitType(binary.Type);
left = binary.Update(binary.OperatorKind, left, right, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, type);
left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, left, right, type);
if (stack.Count == 0)
{
......@@ -1422,7 +1422,7 @@ private BoundNode VisitBinaryOperatorSimple(BoundBinaryOperator node)
EnsureStackState(cookie); // implicit label here
return node.Update(node.OperatorKind, left, right, node.ConstantValueOpt, node.MethodOpt, node.ResultKind, node.Type);
return node.Update(node.OperatorKind, node.ConstantValueOpt, node.MethodOpt, node.ResultKind, left, right, node.Type);
}
return base.VisitBinaryOperator(node);
......@@ -1997,7 +1997,7 @@ public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
binary = stack.Pop();
var right = (BoundExpression)this.Visit(binary.Right);
var type = this.VisitType(binary.Type);
left = binary.Update(binary.OperatorKind, left, right, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, type);
left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.MethodOpt, binary.ResultKind, left, right, type);
if (stack.Count == 0)
{
......
......@@ -809,7 +809,7 @@ public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
}
}
return UpdateExpression(builder, node.Update(node.OperatorKind, left, right, node.ConstantValue, node.MethodOpt, node.ResultKind, node.Type));
return UpdateExpression(builder, node.Update(node.OperatorKind, node.ConstantValue, node.MethodOpt, node.ResultKind, left, right, node.Type));
}
public override BoundNode VisitCall(BoundCall node)
......
......@@ -79,7 +79,7 @@ public override BoundNode VisitUserDefinedConditionalLogicalOperator(BoundUserDe
if (_inExpressionLambda)
{
return node.Update(operatorKind, loweredLeft, loweredRight, node.LogicalOperator, node.TrueOperator, node.FalseOperator, node.ResultKind, type);
return node.Update(operatorKind, node.LogicalOperator, node.TrueOperator, node.FalseOperator, node.ResultKind, loweredLeft, loweredRight, type);
}
BoundAssignmentOperator tempAssignment;
......@@ -473,8 +473,8 @@ public BoundExpression VisitBinaryOperator(BoundBinaryOperator node, BoundUnaryO
}
return (oldNode != null) ?
oldNode.Update(operatorKind, loweredLeft, loweredRight, oldNode.ConstantValueOpt, oldNode.MethodOpt, oldNode.ResultKind, type) :
new BoundBinaryOperator(syntax, operatorKind, loweredLeft, loweredRight, null, null, LookupResultKind.Viable, type);
oldNode.Update(operatorKind, oldNode.ConstantValueOpt, oldNode.MethodOpt, oldNode.ResultKind, loweredLeft, loweredRight, type) :
new BoundBinaryOperator(syntax, operatorKind, null, null, LookupResultKind.Viable, loweredLeft, loweredRight, type);
}
private BoundExpression RewriteLiftedBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, MethodSymbol method)
......@@ -1832,7 +1832,7 @@ private BoundExpression RewriteStringEquality(BoundBinaryOperator oldNode, Synta
{
if (oldNode != null && (loweredLeft.ConstantValue == ConstantValue.Null || loweredRight.ConstantValue == ConstantValue.Null))
{
return oldNode.Update(operatorKind, loweredLeft, loweredRight, oldNode.ConstantValueOpt, oldNode.MethodOpt, oldNode.ResultKind, type);
return oldNode.Update(operatorKind, oldNode.ConstantValueOpt, oldNode.MethodOpt, oldNode.ResultKind, loweredLeft, loweredRight, type);
}
var method = UnsafeGetSpecialTypeMethod(syntax, member);
......@@ -1853,7 +1853,7 @@ private BoundExpression RewriteDelegateOperation(SyntaxNode syntax, BinaryOperat
{
// use reference equality in the absence of overloaded operators for System.Delegate.
operatorKind = (operatorKind & (~BinaryOperatorKind.Delegate)) | BinaryOperatorKind.Object;
return new BoundBinaryOperator(syntax, operatorKind, loweredLeft, loweredRight, default(ConstantValue), null, LookupResultKind.Empty, type);
return new BoundBinaryOperator(syntax, operatorKind, default(ConstantValue), null, LookupResultKind.Empty, loweredLeft, loweredRight, type);
}
}
else
......@@ -1863,7 +1863,7 @@ private BoundExpression RewriteDelegateOperation(SyntaxNode syntax, BinaryOperat
Debug.Assert((object)method != null);
BoundExpression call = _inExpressionLambda
? new BoundBinaryOperator(syntax, operatorKind, loweredLeft, loweredRight, null, method, default(LookupResultKind), method.ReturnType.TypeSymbol)
? new BoundBinaryOperator(syntax, operatorKind, null, method, default(LookupResultKind), loweredLeft, loweredRight, method.ReturnType.TypeSymbol)
: (BoundExpression)BoundCall.Synthesized(syntax, null, method, loweredLeft, loweredRight);
BoundExpression result = method.ReturnType.SpecialType == SpecialType.System_Delegate ?
MakeConversionNode(syntax, call, Conversion.ExplicitReference, type, @checked: false) :
......@@ -1988,11 +1988,11 @@ private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewritt
loweredRight = new BoundBinaryOperator(
rightSyntax,
andOperatorKind,
loweredRight,
MakeLiteral(rightSyntax, ConstantValue.Create(rightMask), rightType),
null,
null,
LookupResultKind.Viable,
loweredRight,
MakeLiteral(rightSyntax, ConstantValue.Create(rightMask), rightType),
rightType);
}
......@@ -2000,19 +2000,19 @@ private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewritt
? new BoundBinaryOperator(
syntax,
operatorKind,
loweredLeft,
loweredRight,
null,
null,
LookupResultKind.Viable,
loweredLeft,
loweredRight,
type)
: oldNode.Update(
operatorKind,
loweredLeft,
loweredRight,
null,
null,
oldNode.ResultKind,
loweredLeft,
loweredRight,
type);
}
......@@ -2047,11 +2047,11 @@ private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewritt
return new BoundBinaryOperator(
syntax,
kind,
loweredLeft,
loweredRight,
ConstantValue.NotAvailable,
null,
LookupResultKind.Viable,
loweredLeft,
loweredRight,
returnType);
}
......
......@@ -213,11 +213,11 @@ public override BoundNode VisitCall(BoundCall node)
rewrittenBoundCall = new BoundBinaryOperator(
syntax,
BinaryOperatorKind.ObjectEqual,
rewrittenArguments[0],
rewrittenArguments[1],
null,
null,
resultKind,
rewrittenArguments[0],
rewrittenArguments[1],
type);
}
else if (node == null)
......
......@@ -349,7 +349,7 @@ private BoundExpression RewriteStringConcatInExpressionLambda(SyntaxNode syntax,
var method = UnsafeGetSpecialTypeMethod(syntax, member);
Debug.Assert((object)method != null);
return new BoundBinaryOperator(syntax, operatorKind, loweredLeft, loweredRight, default(ConstantValue), method, default(LookupResultKind), type);
return new BoundBinaryOperator(syntax, operatorKind, default(ConstantValue), method, default(LookupResultKind), loweredLeft, loweredRight, type);
}
/// <summary>
......
......@@ -497,7 +497,7 @@ public ParameterSymbol SynthesizedParameter(TypeSymbol type, string name, Method
public BoundBinaryOperator Binary(BinaryOperatorKind kind, TypeSymbol type, BoundExpression left, BoundExpression right)
{
return new BoundBinaryOperator(this.Syntax, kind, left, right, ConstantValue.NotAvailable, null, LookupResultKind.Viable, type) { WasCompilerGenerated = true };
return new BoundBinaryOperator(this.Syntax, kind, ConstantValue.NotAvailable, null, LookupResultKind.Viable, left, right, type) { WasCompilerGenerated = true };
}
public BoundAsOperator As(BoundExpression operand, TypeSymbol type)
......
......@@ -19,7 +19,7 @@ private static Optional<object> ConvertToOptional(ConstantValue value)
return value != null && !value.IsBad ? new Optional<object>(value.Value) : default(Optional<object>);
}
private ImmutableArray<BoundStatement> ToStatements(BoundStatement statement)
internal ImmutableArray<BoundStatement> ToStatements(BoundStatement statement)
{
if (statement == null)
{
......@@ -350,13 +350,14 @@ private IInvalidOperation CreateInvalidExpressionForHasArgumentsExpression(Bound
}
internal ImmutableArray<IOperation> GetAnonymousObjectCreationInitializers(
ImmutableArray<BoundExpression> arguments,
ImmutableArray<BoundAnonymousPropertyDeclaration> declarations,
IBoundAnonymousObjectCreation anonymousObjectCreation,
SyntaxNode syntax,
ITypeSymbol type,
bool isImplicit)
{
// For error cases and non-assignment initializers, the binder generates only the argument.
ImmutableArray<BoundExpression> arguments = anonymousObjectCreation.Arguments;
ImmutableArray<BoundAnonymousPropertyDeclaration> declarations = anonymousObjectCreation.PropertyDeclarationsOpt;
Debug.Assert(arguments.Length >= declarations.Length);
var builder = ArrayBuilder<IOperation>.GetInstance(arguments.Length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册