提交 7fc985fa 编写于 作者: J Julien 提交者: GitHub

Align tuple error messages to use 'element' terminology (#14080)

上级 82dd290d
...@@ -519,17 +519,17 @@ private static bool CheckTupleMemberName(string name, int index, CSharpSyntaxNod ...@@ -519,17 +519,17 @@ private static bool CheckTupleMemberName(string name, int index, CSharpSyntaxNod
int reserved = TupleTypeSymbol.IsElementNameReserved(name); int reserved = TupleTypeSymbol.IsElementNameReserved(name);
if (reserved == 0) if (reserved == 0)
{ {
Error(diagnostics, ErrorCode.ERR_TupleReservedMemberNameAnyPosition, syntax, name); Error(diagnostics, ErrorCode.ERR_TupleReservedElementNameAnyPosition, syntax, name);
return false; return false;
} }
else if (reserved > 0 && reserved != index + 1) else if (reserved > 0 && reserved != index + 1)
{ {
Error(diagnostics, ErrorCode.ERR_TupleReservedMemberName, syntax, name, reserved); Error(diagnostics, ErrorCode.ERR_TupleReservedElementName, syntax, name, reserved);
return false; return false;
} }
else if (!uniqueFieldNames.Add(name)) else if (!uniqueFieldNames.Add(name))
{ {
Error(diagnostics, ErrorCode.ERR_TupleDuplicateMemberName, syntax); Error(diagnostics, ErrorCode.ERR_TupleDuplicateElementName, syntax);
return false; return false;
} }
return true; return true;
......
...@@ -4857,14 +4857,14 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ ...@@ -4857,14 +4857,14 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_PeWritingFailure" xml:space="preserve"> <data name="ERR_PeWritingFailure" xml:space="preserve">
<value>An error occurred while writing the output file: {0}.</value> <value>An error occurred while writing the output file: {0}.</value>
</data> </data>
<data name="ERR_TupleDuplicateMemberName" xml:space="preserve"> <data name="ERR_TupleDuplicateElementName" xml:space="preserve">
<value>Tuple member names must be unique.</value> <value>Tuple element names must be unique.</value>
</data> </data>
<data name="ERR_TupleReservedMemberName" xml:space="preserve"> <data name="ERR_TupleReservedElementName" xml:space="preserve">
<value>Tuple member name '{0}' is only allowed at position {1}.</value> <value>Tuple element name '{0}' is only allowed at position {1}.</value>
</data> </data>
<data name="ERR_TupleReservedMemberNameAnyPosition" xml:space="preserve"> <data name="ERR_TupleReservedElementNameAnyPosition" xml:space="preserve">
<value>Tuple member name '{0}' is disallowed at any position.</value> <value>Tuple element name '{0}' is disallowed at any position.</value>
</data> </data>
<data name="ERR_PredefinedTypeMemberNotFoundInAssembly" xml:space="preserve"> <data name="ERR_PredefinedTypeMemberNotFoundInAssembly" xml:space="preserve">
<value>Member '{0}' was not found on type '{1}' from assembly '{2}'.</value> <value>Member '{0}' was not found on type '{1}' from assembly '{2}'.</value>
......
...@@ -1366,9 +1366,9 @@ internal enum ErrorCode ...@@ -1366,9 +1366,9 @@ internal enum ErrorCode
#region tuple diagnostics introduced in C# 7 #region tuple diagnostics introduced in C# 7
WRN_TupleLiteralNameMismatch = 8123, WRN_TupleLiteralNameMismatch = 8123,
ERR_TupleTooFewElements = 8124, ERR_TupleTooFewElements = 8124,
ERR_TupleReservedMemberName = 8125, ERR_TupleReservedElementName = 8125,
ERR_TupleReservedMemberNameAnyPosition = 8126, ERR_TupleReservedElementNameAnyPosition = 8126,
ERR_TupleDuplicateMemberName = 8127, ERR_TupleDuplicateElementName = 8127,
ERR_PredefinedTypeMemberNotFoundInAssembly = 8128, ERR_PredefinedTypeMemberNotFoundInAssembly = 8128,
ERR_MissingDeconstruct = 8129, ERR_MissingDeconstruct = 8129,
ERR_TypeInferenceFailedForImplicitlyTypedDeconstructionVariable = 8130, ERR_TypeInferenceFailedForImplicitlyTypedDeconstructionVariable = 8130,
......
...@@ -2902,13 +2902,13 @@ static void Main() ...@@ -2902,13 +2902,13 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,24): error CS8127: Tuple member names must be unique. // (6,24): error CS8127: Tuple member names must be unique.
// (int a, string a) x = (b: 1, b: "hello", b: 2); // (int a, string a) x = (b: 1, b: "hello", b: 2);
Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "a").WithLocation(6, 24), Diagnostic(ErrorCode.ERR_TupleDuplicateElementName, "a").WithLocation(6, 24),
// (6,38): error CS8127: Tuple member names must be unique. // (6,38): error CS8127: Tuple member names must be unique.
// (int a, string a) x = (b: 1, b: "hello", b: 2); // (int a, string a) x = (b: 1, b: "hello", b: 2);
Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 38), Diagnostic(ErrorCode.ERR_TupleDuplicateElementName, "b").WithLocation(6, 38),
// (6,50): error CS8127: Tuple member names must be unique. // (6,50): error CS8127: Tuple member names must be unique.
// (int a, string a) x = (b: 1, b: "hello", b: 2); // (int a, string a) x = (b: 1, b: "hello", b: 2);
Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 50) Diagnostic(ErrorCode.ERR_TupleDuplicateElementName, "b").WithLocation(6, 50)
); );
} }
...@@ -2930,16 +2930,16 @@ static void Main() ...@@ -2930,16 +2930,16 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,28): error CS8125: Tuple member name 'Item1' is only allowed at position 1. // (6,28): error CS8125: Tuple member name 'Item1' is only allowed at position 1.
// (int Item1, string Item1) x = (Item1: 1, Item1: "hello"); // (int Item1, string Item1) x = (Item1: 1, Item1: "hello");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 28), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item1").WithArguments("Item1", "1").WithLocation(6, 28),
// (6,50): error CS8125: Tuple member name 'Item1' is only allowed at position 1. // (6,50): error CS8125: Tuple member name 'Item1' is only allowed at position 1.
// (int Item1, string Item1) x = (Item1: 1, Item1: "hello"); // (int Item1, string Item1) x = (Item1: 1, Item1: "hello");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 50), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item1").WithArguments("Item1", "1").WithLocation(6, 50),
// (7,14): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (7,14): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// (int Item2, string Item2) y = (Item2: 1, Item2: "hello"); // (int Item2, string Item2) y = (Item2: 1, Item2: "hello");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(7, 14), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(7, 14),
// (7,40): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (7,40): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// (int Item2, string Item2) y = (Item2: 1, Item2: "hello"); // (int Item2, string Item2) y = (Item2: 1, Item2: "hello");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(7, 40) Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(7, 40)
); );
} }
...@@ -2960,13 +2960,13 @@ static void Main() ...@@ -2960,13 +2960,13 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,37): error CS8125: Tuple member name 'Item10' is only allowed at position 10. // (6,37): error CS8125: Tuple member name 'Item10' is only allowed at position 10.
// (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3); // (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3);
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item10").WithArguments("Item10", "10").WithLocation(6, 37), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item10").WithArguments("Item10", "10").WithLocation(6, 37),
// (6,61): error CS8125: Tuple member name 'Item1' is only allowed at position 1. // (6,61): error CS8125: Tuple member name 'Item1' is only allowed at position 1.
// (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3); // (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3);
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 61), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item1").WithArguments("Item1", "1").WithLocation(6, 61),
// (6,71): error CS8125: Tuple member name 'Item10' is only allowed at position 10. // (6,71): error CS8125: Tuple member name 'Item10' is only allowed at position 10.
// (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3); // (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3);
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item10").WithArguments("Item10", "10").WithLocation(6, 71) Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item10").WithArguments("Item10", "10").WithLocation(6, 71)
); );
} }
...@@ -3007,10 +3007,10 @@ static void Main() ...@@ -3007,10 +3007,10 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,24): error CS8127: Tuple member names must be unique. // (6,24): error CS8127: Tuple member names must be unique.
// (int a, string a) x = (b: 1, c: "hello", b: 2); // (int a, string a) x = (b: 1, c: "hello", b: 2);
Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "a").WithLocation(6, 24), Diagnostic(ErrorCode.ERR_TupleDuplicateElementName, "a").WithLocation(6, 24),
// (6,50): error CS8127: Tuple member names must be unique. // (6,50): error CS8127: Tuple member names must be unique.
// (int a, string a) x = (b: 1, c: "hello", b: 2); // (int a, string a) x = (b: 1, c: "hello", b: 2);
Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 50) Diagnostic(ErrorCode.ERR_TupleDuplicateElementName, "b").WithLocation(6, 50)
); );
} }
...@@ -3031,22 +3031,22 @@ static void Main() ...@@ -3031,22 +3031,22 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,28): error CS8125: Tuple member name 'Item3' is only allowed at position 3. // (6,28): error CS8125: Tuple member name 'Item3' is only allowed at position 3.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item3").WithArguments("Item3", "3").WithLocation(6, 28), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item3").WithArguments("Item3", "3").WithLocation(6, 28),
// (6,42): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (6,42): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(6, 42), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(6, 42),
// (6,100): error CS8126: Tuple member name 'Rest' is disallowed at any position. // (6,100): error CS8126: Tuple member name 'Rest' is disallowed at any position.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 100), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 100),
// (6,111): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (6,111): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(6, 111), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(6, 111),
// (6,125): error CS8125: Tuple member name 'Item4' is only allowed at position 4. // (6,125): error CS8125: Tuple member name 'Item4' is only allowed at position 4.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item4").WithArguments("Item4", "4").WithLocation(6, 125), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item4").WithArguments("Item4", "4").WithLocation(6, 125),
// (6,189): error CS8126: Tuple member name 'Rest' is disallowed at any position. // (6,189): error CS8126: Tuple member name 'Rest' is disallowed at any position.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad"); // (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 189) Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 189)
); );
} }
...@@ -3067,22 +3067,22 @@ static void Main() ...@@ -3067,22 +3067,22 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (6,18): error CS8126: Tuple member name 'CompareTo' is disallowed at any position. // (6,18): error CS8126: Tuple member name 'CompareTo' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "CompareTo").WithArguments("CompareTo").WithLocation(6, 18), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "CompareTo").WithArguments("CompareTo").WithLocation(6, 18),
// (6,43): error CS8126: Tuple member name 'Deconstruct' is disallowed at any position. // (6,43): error CS8126: Tuple member name 'Deconstruct' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Deconstruct").WithArguments("Deconstruct").WithLocation(6, 43), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "Deconstruct").WithArguments("Deconstruct").WithLocation(6, 43),
// (6,59): error CS8126: Tuple member name 'Equals' is disallowed at any position. // (6,59): error CS8126: Tuple member name 'Equals' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Equals").WithArguments("Equals").WithLocation(6, 59), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "Equals").WithArguments("Equals").WithLocation(6, 59),
// (6,70): error CS8126: Tuple member name 'GetHashCode' is disallowed at any position. // (6,70): error CS8126: Tuple member name 'GetHashCode' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "GetHashCode").WithArguments("GetHashCode").WithLocation(6, 70), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "GetHashCode").WithArguments("GetHashCode").WithLocation(6, 70),
// (6,86): error CS8126: Tuple member name 'Rest' is disallowed at any position. // (6,86): error CS8126: Tuple member name 'Rest' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 86), Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 86),
// (6,95): error CS8126: Tuple member name 'ToString' is disallowed at any position. // (6,95): error CS8126: Tuple member name 'ToString' is disallowed at any position.
// var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10); // var x = (CompareTo: 2, Create: 3, Deconstruct: 4, Equals: 5, GetHashCode: 6, Rest: 8, ToString: 10);
Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "ToString").WithArguments("ToString").WithLocation(6, 95) Diagnostic(ErrorCode.ERR_TupleReservedElementNameAnyPosition, "ToString").WithArguments("ToString").WithLocation(6, 95)
); );
} }
...@@ -9562,31 +9562,31 @@ static void Main() ...@@ -9562,31 +9562,31 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (9,17): error CS8125: Tuple member name 'Item9' is only allowed at position 9. // (9,17): error CS8125: Tuple member name 'Item9' is only allowed at position 9.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item9").WithArguments("Item9", "9").WithLocation(9, 17), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item9").WithArguments("Item9", "9").WithLocation(9, 17),
// (9,28): error CS8125: Tuple member name 'Item1' is only allowed at position 1. // (9,28): error CS8125: Tuple member name 'Item1' is only allowed at position 1.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(9, 28), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item1").WithArguments("Item1", "1").WithLocation(9, 28),
// (9,39): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (9,39): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(9, 39), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(9, 39),
// (9,50): error CS8125: Tuple member name 'Item3' is only allowed at position 3. // (9,50): error CS8125: Tuple member name 'Item3' is only allowed at position 3.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item3").WithArguments("Item3", "3").WithLocation(9, 50), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item3").WithArguments("Item3", "3").WithLocation(9, 50),
// (9,61): error CS8125: Tuple member name 'Item4' is only allowed at position 4. // (9,61): error CS8125: Tuple member name 'Item4' is only allowed at position 4.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item4").WithArguments("Item4", "4").WithLocation(9, 61), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item4").WithArguments("Item4", "4").WithLocation(9, 61),
// (9,72): error CS8125: Tuple member name 'Item5' is only allowed at position 5. // (9,72): error CS8125: Tuple member name 'Item5' is only allowed at position 5.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item5").WithArguments("Item5", "5").WithLocation(9, 72), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item5").WithArguments("Item5", "5").WithLocation(9, 72),
// (9,83): error CS8125: Tuple member name 'Item6' is only allowed at position 6. // (9,83): error CS8125: Tuple member name 'Item6' is only allowed at position 6.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item6").WithArguments("Item6", "6").WithLocation(9, 83), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item6").WithArguments("Item6", "6").WithLocation(9, 83),
// (9,94): error CS8125: Tuple member name 'Item7' is only allowed at position 7. // (9,94): error CS8125: Tuple member name 'Item7' is only allowed at position 7.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item7").WithArguments("Item7", "7").WithLocation(9, 94), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item7").WithArguments("Item7", "7").WithLocation(9, 94),
// (9,105): error CS8125: Tuple member name 'Item8' is only allowed at position 8. // (9,105): error CS8125: Tuple member name 'Item8' is only allowed at position 8.
// static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7() // static (int Item9, int Item1, int Item2, int Item3, int Item4, int Item5, int Item6, int Item7, int Item8) M7()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item8").WithArguments("Item8", "8").WithLocation(9, 105) Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item8").WithArguments("Item8", "8").WithLocation(9, 105)
); );
var c = comp.GetTypeByMetadataName("C"); var c = comp.GetTypeByMetadataName("C");
...@@ -9666,7 +9666,7 @@ static void Main() ...@@ -9666,7 +9666,7 @@ static void Main()
comp.VerifyDiagnostics( comp.VerifyDiagnostics(
// (9,73): error CS8125: Tuple member name 'Item1' is only allowed at position 1. // (9,73): error CS8125: Tuple member name 'Item1' is only allowed at position 1.
// static (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int Item1) M8() // static (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int Item1) M8()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(9, 73) Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item1").WithArguments("Item1", "1").WithLocation(9, 73)
); );
var c = comp.GetTypeByMetadataName("C"); var c = comp.GetTypeByMetadataName("C");
...@@ -10204,7 +10204,7 @@ static void Test03() ...@@ -10204,7 +10204,7 @@ static void Test03()
Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "(int a, int b)").WithArguments("(int a, int b)").WithLocation(23, 12), Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "(int a, int b)").WithArguments("(int a, int b)").WithLocation(23, 12),
// (35,73): error CS8125: Tuple member name 'Item2' is only allowed at position 2. // (35,73): error CS8125: Tuple member name 'Item2' is only allowed at position 2.
// static (int a, int b, int c, int d, int e, int f, int g, int h, int Item2) M103() // static (int a, int b, int c, int d, int e, int f, int g, int h, int Item2) M103()
Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(35, 73), Diagnostic(ErrorCode.ERR_TupleReservedElementName, "Item2").WithArguments("Item2", "2").WithLocation(35, 73),
// (35,12): warning CS0612: 'ValueTuple<T1, T2>' is obsolete // (35,12): warning CS0612: 'ValueTuple<T1, T2>' is obsolete
// static (int a, int b, int c, int d, int e, int f, int g, int h, int Item2) M103() // static (int a, int b, int c, int d, int e, int f, int g, int h, int Item2) M103()
Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "(int a, int b, int c, int d, int e, int f, int g, int h, int Item2)").WithArguments("System.ValueTuple<T1, T2>").WithLocation(35, 12), Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "(int a, int b, int c, int d, int e, int f, int g, int h, int Item2)").WithArguments("System.ValueTuple<T1, T2>").WithLocation(35, 12),
......
...@@ -450,15 +450,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -450,15 +450,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Private Shared Function CheckTupleMemberName(name As String, index As Integer, syntax As VisualBasicSyntaxNode, diagnostics As DiagnosticBag, uniqueFieldNames As HashSet(Of String)) As Boolean Private Shared Function CheckTupleMemberName(name As String, index As Integer, syntax As VisualBasicSyntaxNode, diagnostics As DiagnosticBag, uniqueFieldNames As HashSet(Of String)) As Boolean
Dim reserved As Integer = TupleTypeSymbol.IsElementNameReserved(name) Dim reserved As Integer = TupleTypeSymbol.IsElementNameReserved(name)
If reserved = 0 Then If reserved = 0 Then
Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleReservedMemberNameAnyPosition, name) Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleReservedElementNameAnyPosition, name)
Return False Return False
ElseIf reserved > 0 AndAlso reserved <> index + 1 Then ElseIf reserved > 0 AndAlso reserved <> index + 1 Then
Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleReservedMemberName, name, reserved) Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleReservedElementName, name, reserved)
Return False Return False
ElseIf (Not uniqueFieldNames.Add(name)) Then ElseIf (Not uniqueFieldNames.Add(name)) Then
Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleDuplicateMemberName) Binder.ReportDiagnostic(diagnostics, syntax, ERRID.ERR_TupleDuplicateElementName)
Return False Return False
End If End If
......
...@@ -1689,9 +1689,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -1689,9 +1689,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_DocFileGen = 37258 ERR_DocFileGen = 37258
ERR_TupleTooFewElements = 37259 ERR_TupleTooFewElements = 37259
ERR_TupleReservedMemberNameAnyPosition = 37260 ERR_TupleReservedElementNameAnyPosition = 37260
ERR_TupleReservedMemberName = 37261 ERR_TupleReservedElementName = 37261
ERR_TupleDuplicateMemberName = 37262 ERR_TupleDuplicateElementName = 37262
ERR_RefReturningCallInExpressionTree = 37263 ERR_RefReturningCallInExpressionTree = 37263
......
...@@ -5379,14 +5379,14 @@ ...@@ -5379,14 +5379,14 @@
<data name="ERR_SourceLinkRequiresPortablePdb" xml:space="preserve"> <data name="ERR_SourceLinkRequiresPortablePdb" xml:space="preserve">
<value>/sourcelink switch is only supported when emitting Portable PDB (/debug:portable or /debug:embedded must be specified).</value> <value>/sourcelink switch is only supported when emitting Portable PDB (/debug:portable or /debug:embedded must be specified).</value>
</data> </data>
<data name="ERR_TupleDuplicateMemberName" xml:space="preserve"> <data name="ERR_TupleDuplicateElementName" xml:space="preserve">
<value>Tuple member names must be unique.</value> <value>Tuple element names must be unique.</value>
</data> </data>
<data name="ERR_TupleReservedMemberName" xml:space="preserve"> <data name="ERR_TupleReservedElementName" xml:space="preserve">
<value>Tuple member name '{0}' is only allowed at position {1}.</value> <value>Tuple element name '{0}' is only allowed at position {1}.</value>
</data> </data>
<data name="ERR_TupleReservedMemberNameAnyPosition" xml:space="preserve"> <data name="ERR_TupleReservedElementNameAnyPosition" xml:space="preserve">
<value>Tuple member name '{0}' is disallowed at any position.</value> <value>Tuple element name '{0}' is disallowed at any position.</value>
</data> </data>
<data name="ERR_TupleTooFewElements" xml:space="preserve"> <data name="ERR_TupleTooFewElements" xml:space="preserve">
<value>Tuple must contain at least two elements.</value> <value>Tuple must contain at least two elements.</value>
......
...@@ -3891,13 +3891,13 @@ End Module ...@@ -3891,13 +3891,13 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2) Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2)
~ ~
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2) Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2)
~ ~
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2) Dim x As (a As Integer, a As String) = (b:=1, b:="hello", b:=2)
~ ~
</errors>) </errors>)
...@@ -3923,16 +3923,16 @@ End Module ...@@ -3923,16 +3923,16 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37261: Tuple member name 'Item1' is only allowed at position 1. BC37261: Tuple element name 'Item1' is only allowed at position 1.
Dim x As (Item1 As Integer, Item1 As String) = (Item1:=1, Item1:="hello") Dim x As (Item1 As Integer, Item1 As String) = (Item1:=1, Item1:="hello")
~~~~~ ~~~~~
BC37261: Tuple member name 'Item1' is only allowed at position 1. BC37261: Tuple element name 'Item1' is only allowed at position 1.
Dim x As (Item1 As Integer, Item1 As String) = (Item1:=1, Item1:="hello") Dim x As (Item1 As Integer, Item1 As String) = (Item1:=1, Item1:="hello")
~~~~~ ~~~~~
BC37261: Tuple member name 'Item2' is only allowed at position 2. BC37261: Tuple element name 'Item2' is only allowed at position 2.
Dim y As (Item2 As Integer, Item2 As String) = (Item2:=1, Item2:="hello") Dim y As (Item2 As Integer, Item2 As String) = (Item2:=1, Item2:="hello")
~~~~~ ~~~~~
BC37261: Tuple member name 'Item2' is only allowed at position 2. BC37261: Tuple element name 'Item2' is only allowed at position 2.
Dim y As (Item2 As Integer, Item2 As String) = (Item2:=1, Item2:="hello") Dim y As (Item2 As Integer, Item2 As String) = (Item2:=1, Item2:="hello")
~~~~~ ~~~~~
</errors>) </errors>)
...@@ -3957,13 +3957,13 @@ End Module ...@@ -3957,13 +3957,13 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37261: Tuple member name 'Item10' is only allowed at position 10. BC37261: Tuple element name 'Item10' is only allowed at position 10.
Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3) Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3)
~~~~~~ ~~~~~~
BC37261: Tuple member name 'Item1' is only allowed at position 1. BC37261: Tuple element name 'Item1' is only allowed at position 1.
Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3) Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3)
~~~~~ ~~~~~
BC37261: Tuple member name 'Item10' is only allowed at position 10. BC37261: Tuple element name 'Item10' is only allowed at position 10.
Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3) Dim x As (Item1 As Integer, Item01 As Integer, Item10 As Integer) = (Item01:=1, Item1:=2, Item10:=3)
~~~~~~ ~~~~~~
</errors>) </errors>)
...@@ -4011,10 +4011,10 @@ End Module ...@@ -4011,10 +4011,10 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x As (a As Integer, a As String) = (b:=1, c:="hello", b:=2) Dim x As (a As Integer, a As String) = (b:=1, c:="hello", b:=2)
~ ~
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x As (a As Integer, a As String) = (b:=1, c:="hello", b:=2) Dim x As (a As Integer, a As String) = (b:=1, c:="hello", b:=2)
~ ~
</errors>) </errors>)
...@@ -4040,22 +4040,22 @@ End Module ...@@ -4040,22 +4040,22 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37261: Tuple member name 'Item3' is only allowed at position 3. BC37261: Tuple element name 'Item3' is only allowed at position 3.
Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) = Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) =
~~~~~ ~~~~~
BC37261: Tuple member name 'Item2' is only allowed at position 2. BC37261: Tuple element name 'Item2' is only allowed at position 2.
Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) = Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) =
~~~~~ ~~~~~
BC37260: Tuple member name 'Rest' is disallowed at any position. BC37260: Tuple element name 'Rest' is disallowed at any position.
Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) = Dim x As (Item1 As Integer, Item3 As String, Item2 As Integer, Item4 As Integer, Item5 As Integer, Item6 As Integer, Item7 As Integer, Rest As Integer) =
~~~~ ~~~~
BC37261: Tuple member name 'Item2' is only allowed at position 2. BC37261: Tuple element name 'Item2' is only allowed at position 2.
(Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad") (Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad")
~~~~~ ~~~~~
BC37261: Tuple member name 'Item4' is only allowed at position 4. BC37261: Tuple element name 'Item4' is only allowed at position 4.
(Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad") (Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad")
~~~~~ ~~~~~
BC37260: Tuple member name 'Rest' is disallowed at any position. BC37260: Tuple element name 'Rest' is disallowed at any position.
(Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad") (Item2:="bad", Item4:="bad", Item3:=3, Item4:=4, Item5:=5, Item6:=6, Item7:=7, Rest:="bad")
~~~~ ~~~~
</errors>) </errors>)
...@@ -4080,22 +4080,22 @@ End Module ...@@ -4080,22 +4080,22 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37260: Tuple member name 'CompareTo' is disallowed at any position. BC37260: Tuple element name 'CompareTo' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~~~~~~ ~~~~~~~~~
BC37260: Tuple member name 'Deconstruct' is disallowed at any position. BC37260: Tuple element name 'Deconstruct' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~~~~~~~~ ~~~~~~~~~~~
BC37260: Tuple member name 'Equals' is disallowed at any position. BC37260: Tuple element name 'Equals' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~~~ ~~~~~~
BC37260: Tuple member name 'GetHashCode' is disallowed at any position. BC37260: Tuple element name 'GetHashCode' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~~~~~~~~ ~~~~~~~~~~~
BC37260: Tuple member name 'Rest' is disallowed at any position. BC37260: Tuple element name 'Rest' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~ ~~~~
BC37260: Tuple member name 'ToString' is disallowed at any position. BC37260: Tuple element name 'ToString' is disallowed at any position.
Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10) Dim x = (CompareTo:=2, Create:=3, Deconstruct:=4, Equals:=5, GetHashCode:=6, Rest:=8, ToString:=10)
~~~~~~~~ ~~~~~~~~
</errors>) </errors>)
...@@ -6502,7 +6502,7 @@ End Module ...@@ -6502,7 +6502,7 @@ End Module
comp.AssertTheseDiagnostics( comp.AssertTheseDiagnostics(
<errors> <errors>
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x1 = (A:=10, a:=20) Dim x1 = (A:=10, a:=20)
~ ~
BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'. BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'.
...@@ -6511,7 +6511,7 @@ BC31429: 'A' is ambiguous because multiple kinds of members with this name exist ...@@ -6511,7 +6511,7 @@ BC31429: 'A' is ambiguous because multiple kinds of members with this name exist
BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'. BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'.
System.Console.Write(x1.A) System.Console.Write(x1.A)
~~~~ ~~~~
BC37262: Tuple member names must be unique. BC37262: Tuple element names must be unique.
Dim x2 as (A as Integer, a As Integer) = (10, 20) Dim x2 as (A as Integer, a As Integer) = (10, 20)
~ ~
BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'. BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'.
...@@ -6520,19 +6520,19 @@ BC31429: 'A' is ambiguous because multiple kinds of members with this name exist ...@@ -6520,19 +6520,19 @@ BC31429: 'A' is ambiguous because multiple kinds of members with this name exist
BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'. BC31429: 'A' is ambiguous because multiple kinds of members with this name exist in structure '(A As Integer, a As Integer)'.
System.Console.Write(x1.A) System.Console.Write(x1.A)
~~~~ ~~~~
BC37261: Tuple member name 'item1' is only allowed at position 1. BC37261: Tuple element name 'item1' is only allowed at position 1.
Dim x3 = (I1:=10, item1:=20) Dim x3 = (I1:=10, item1:=20)
~~~~~ ~~~~~
BC37261: Tuple member name 'item1' is only allowed at position 1. BC37261: Tuple element name 'item1' is only allowed at position 1.
Dim x4 = (Item1:=10, item1:=20) Dim x4 = (Item1:=10, item1:=20)
~~~~~ ~~~~~
BC37261: Tuple member name 'item1' is only allowed at position 1. BC37261: Tuple element name 'item1' is only allowed at position 1.
Dim x5 = (item1:=10, item1:=20) Dim x5 = (item1:=10, item1:=20)
~~~~~ ~~~~~
BC37260: Tuple member name 'tostring' is disallowed at any position. BC37260: Tuple element name 'tostring' is disallowed at any position.
Dim x6 = (tostring:=10, item1:=20) Dim x6 = (tostring:=10, item1:=20)
~~~~~~~~ ~~~~~~~~
BC37261: Tuple member name 'item1' is only allowed at position 1. BC37261: Tuple element name 'item1' is only allowed at position 1.
Dim x6 = (tostring:=10, item1:=20) Dim x6 = (tostring:=10, item1:=20)
~~~~~ ~~~~~
</errors>) </errors>)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册