diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs index 6ff4f6e15ada20089c8bf305ea5591c57ee5cac1..f36907f7510b2bd6ac691165c8f720b639859589 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs @@ -58,10 +58,10 @@ internal partial class Binder { // identity tuple conversions result in a converted tuple // to indicate that tuple conversions are no longer applicable. - if (source.Kind == BoundKind.NaturalTupleExpression) + if (source.Kind == BoundKind.TupleLiteral) { - var tuple = (BoundNaturalTupleExpression)source; - return new BoundConvertedTupleExpression(tuple.Syntax, tuple.Arguments, tuple.ArgumentNamesOpt, tuple.Type, tuple.HasErrors); + var tuple = (BoundTupleLiteral)source; + return new BoundConvertedTupleLiteral(tuple.Syntax, tuple.Arguments, tuple.ArgumentNamesOpt, tuple.Type, tuple.HasErrors); } // We need to preserve any conversion that changes the type (even identity conversions, like object->dynamic), @@ -85,7 +85,7 @@ internal partial class Binder } if (conversion.IsTuple || - (conversion.Kind == ConversionKind.ImplicitNullable && source.Kind == BoundKind.NaturalTupleExpression)) + (conversion.Kind == ConversionKind.ImplicitNullable && source.Kind == BoundKind.TupleLiteral)) { return CreateTupleConversion(syntax, source, conversion, destination, diagnostics); } @@ -330,7 +330,7 @@ private BoundExpression CreateTupleConversion(CSharpSyntaxNode syntax, BoundExpr // We have a successful tuple conversion; rather than producing a node // which is a conversion on top of a tuple literal, tuple conversion is an element-wise conversion of arguments. - var sourceTuple = (BoundNaturalTupleExpression)source; + var sourceTuple = (BoundTupleLiteral)source; var targetType = (NamedTypeSymbol)destination; Debug.Assert(conversion.Kind == ConversionKind.ImplicitTuple || conversion.Kind == ConversionKind.ImplicitNullable); @@ -371,11 +371,11 @@ private BoundExpression CreateTupleConversion(CSharpSyntaxNode syntax, BoundExpr if ((object)destinationWithoutNullable == null) { - return new BoundConvertedTupleExpression(syntax, convertedArguments.ToImmutableAndFree(), sourceTuple.ArgumentNamesOpt, destination, hasErrors); + return new BoundConvertedTupleLiteral(syntax, convertedArguments.ToImmutableAndFree(), sourceTuple.ArgumentNamesOpt, destination, hasErrors); } else { - var tuple = new BoundConvertedTupleExpression(syntax, convertedArguments.ToImmutableAndFree(), sourceTuple.ArgumentNamesOpt, destinationWithoutNullable, hasErrors); + var tuple = new BoundConvertedTupleLiteral(syntax, convertedArguments.ToImmutableAndFree(), sourceTuple.ArgumentNamesOpt, destinationWithoutNullable, hasErrors); return new BoundConversion( syntax, diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs index eb79538e57822ff5250c782ef8778991cd4dea36..745691e1114a27f27097619cef9c807be72a66b8 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs @@ -719,7 +719,7 @@ private BoundExpression BindTupleExpression(TupleExpressionSyntax node, Diagnost tupleTypeOpt = new TupleTypeSymbol(elements, elementNamesArray, node, this, diagnostics); } - return new BoundNaturalTupleExpression(node, boundArguments.ToImmutableAndFree(), elementNamesArray, tupleTypeOpt, hasErrors); + return new BoundTupleLiteral(node, boundArguments.ToImmutableAndFree(), elementNamesArray, tupleTypeOpt, hasErrors); } /// diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/Conversions.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/Conversions.cs index 47a5571e8ab9ea6cb2af4a13593040461967b3ab..f7f6b9344d5b9c8010cb5adaa043211228bf3b64 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/Conversions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/Conversions.cs @@ -148,7 +148,7 @@ private Conversion ClassifyImplicitBuiltInConversionFromExpression(BoundExpressi } break; - case BoundKind.NaturalTupleExpression: + case BoundKind.TupleLiteral: kind = ClassifyImplicitTupleConversion(sourceExpression, destination, ref useSiteDiagnostics); if (kind != ConversionKind.NoConversion) { @@ -700,13 +700,13 @@ public override Conversion GetMethodGroupConversion(BoundMethodGroup source, Typ protected override bool HasImplicitTupleConversion(BoundExpression source, TypeSymbol destination, ref HashSet useSiteDiagnostics) { - if (source.Kind != BoundKind.NaturalTupleExpression) + if (source.Kind != BoundKind.TupleLiteral) { - // source must be a natural tuple expression + // source must be a tuple literal with no conversions return false; } - var tupleExpression = (BoundNaturalTupleExpression)source; + var tupleExpression = (BoundTupleLiteral)source; var arguments = tupleExpression.Arguments; // unwrap tuple to its underlying diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs index eb86cdccd2d1e7e2131578d01883dc9c857594c8..b784c9ac1ffcd935617cbbc28e3e69c191ba736a 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs @@ -1830,7 +1830,7 @@ private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref Hash return true; } - if (node.Kind == BoundKind.NaturalTupleExpression) + if (node.Kind == BoundKind.TupleLiteral) { if ((object)node.Type != null) { @@ -1841,7 +1841,7 @@ private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref Hash } // recurse into tuple constituent arguments - return ExpressionMatchExactly((BoundNaturalTupleExpression)node, t, ref useSiteDiagnostics); + return ExpressionMatchExactly((BoundTupleLiteral)node, t, ref useSiteDiagnostics); } // - E is an anonymous function, T is either a delegate type D or an expression tree @@ -1940,7 +1940,7 @@ private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref Hash } // check every argument of a tuple vs corresponding type in destination tuple type - private bool ExpressionMatchExactly(BoundNaturalTupleExpression tupleSource, TypeSymbol targetType, ref HashSet useSiteDiagnostics) + private bool ExpressionMatchExactly(BoundTupleLiteral tupleSource, TypeSymbol targetType, ref HashSet useSiteDiagnostics) { if (targetType.Kind != SymbolKind.NamedType) { diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml index 5b56fab6b2bae24849e8d416f088850eabadf269..142808e0c0cbf27af05109c88bc2e0991c2dae52 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml @@ -1144,7 +1144,7 @@ @@ -1155,11 +1155,11 @@ - + @@ -1172,7 +1172,7 @@ The Converted tuple literal is one which has been already converted to a target type. Converted tuple literal always has a type. --> - + diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs index 3cdb2b6c22093d1aa22fc3832cab3a8bced9719e..010d7baeabb88bfe024ec97bf71136d3118b66c4 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs @@ -910,12 +910,12 @@ public override BoundNode VisitIsPatternExpression(BoundIsPatternExpression node return null; } - public override BoundNode VisitNaturalTupleExpression(BoundNaturalTupleExpression node) + public override BoundNode VisitTupleLiteral(BoundTupleLiteral node) { return VisitTupleExpression(node); } - public override BoundNode VisitConvertedTupleExpression(BoundConvertedTupleExpression node) + public override BoundNode VisitConvertedTupleLiteral(BoundConvertedTupleLiteral node) { return VisitTupleExpression(node); } diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_TupleCreationExpression.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_TupleCreationExpression.cs index ffc93c89c31c63800aea050193539d1e61003d75..33567de0901ca64fbc5c54d0281c1ab3949a515c 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_TupleCreationExpression.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_TupleCreationExpression.cs @@ -7,12 +7,12 @@ namespace Microsoft.CodeAnalysis.CSharp { internal partial class LocalRewriter { - public override BoundNode VisitNaturalTupleExpression(BoundNaturalTupleExpression node) + public override BoundNode VisitTupleLiteral(BoundTupleLiteral node) { return VisitTupleExpression(node); } - public override BoundNode VisitConvertedTupleExpression(BoundConvertedTupleExpression node) + public override BoundNode VisitConvertedTupleLiteral(BoundConvertedTupleLiteral node) { return VisitTupleExpression(node); }