From 5142d3a5372d35319721c1df8240cf5197719244 Mon Sep 17 00:00:00 2001 From: Julien Date: Wed, 3 Aug 2016 15:50:43 -0700 Subject: [PATCH] Compacting C# 7 error codes (#12884) --- .../CSharp/Portable/Errors/ErrorCode.cs | 139 ++++++----- .../Emit/Attributes/AttributeTests_Tuples.cs | 70 +++--- .../Emit/CodeGen/CodeGenDeconstructTests.cs | 98 ++++---- .../Emit/CodeGen/CodeGenExprLambdaTests.cs | 4 +- .../Test/Emit/CodeGen/CodeGenTupleTest.cs | 218 +++++++++--------- .../Symbols/Source/CustomModifierCopyTests.cs | 16 +- .../Test/Symbol/Symbols/Source/FieldTests.cs | 8 +- .../Test/Symbol/Symbols/SymbolErrorTests.cs | 8 +- .../Syntax/Parsing/ParserErrorMessageTests.cs | 6 +- 9 files changed, 283 insertions(+), 284 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs index dc62310e1c8..f4bed839d35 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs @@ -15,7 +15,7 @@ internal enum ErrorCode //ERR_MissingOptionArg = 5, ERR_NoMetadataFile = 6, //FTL_ComPlusInit = 7, - //FTL_MetadataImportFailure = 8, no longer used in Roslyn. + //FTL_MetadataImportFailure = 8, no longer used in Roslyn. FTL_MetadataCantOpenFile = 9, //ERR_FatalError = 10, //ERR_CantImportBase = 11, @@ -123,7 +123,7 @@ internal enum ErrorCode ERR_ConstantExpected = 150, // ERR_V6SwitchGoverningTypeValueExpected shares the same error code (CS0151) with ERR_IntegralTypeValueExpected in Dev10 compiler. // However ERR_IntegralTypeValueExpected is currently unused and hence being removed. If we need to generate this error in future - // we can use error code CS0166. CS0166 was originally reserved for ERR_SwitchFallInto in Dev10, but was never used. + // we can use error code CS0166. CS0166 was originally reserved for ERR_SwitchFallInto in Dev10, but was never used. ERR_V6SwitchGoverningTypeValueExpected = 151, ERR_DuplicateCaseLabel = 152, ERR_InvalidGotoCase = 153, @@ -1293,8 +1293,6 @@ internal enum ErrorCode ERR_BlockBodyAndExpressionBody = 8057, ERR_FeatureIsExperimental = 8058, ERR_FeatureNotAvailableInVersion6 = 8059, - ERR_FeatureIsUnimplemented = 8060, - ERR_FeatureNotAvailableInVersion7 = 8061, // available 8062-8069 ERR_SwitchFallOut = 8070, // ERR_UnexpectedBoundGenericName = 8071, // for nameof - used in an early prototype @@ -1338,12 +1336,14 @@ internal enum ErrorCode ERR_OptionMustBeAbsolutePath = 8106, #endregion diagnostics introduced in C# 6 updates + ERR_FeatureNotAvailableInVersion7 = 8107, + #region diagnostics for local functions introduced in C# 7 ERR_DynamicLocalFunctionParamsParameter = 8108, ERR_ExpressionTreeContainsLocalFunction = 8110, #endregion diagnostics for local functions introduced in C# 7 - // gap here; available 8111-8115 + // Available = 8111, 8112, 8113, 8114, 8115 #region diagnostics for pattern-matching introduced in C# 7 ERR_PatternNullableType = 8116, @@ -1353,87 +1353,86 @@ internal enum ErrorCode ERR_PatternWrongType = 8121, #endregion diagnostics for pattern-matching introduced in C# 7 - // gap here; available 8122-8199 + // Available = 8122, 8123 #region tuple diagnostics introduced in C# 7 + ERR_TupleTooFewElements = 8124, + ERR_TupleReservedMemberName = 8125, + ERR_TupleReservedMemberNameAnyPosition = 8126, + ERR_TupleDuplicateMemberName = 8127, + ERR_PredefinedTypeMemberNotFoundInAssembly = 8128, + ERR_MissingDeconstruct = 8129, + ERR_DeconstructCouldNotInferMergedType = 8130, + ERR_DeconstructRequiresExpression = 8131, + ERR_DeconstructWrongCardinality = 8132, + ERR_CannotDeconstructDynamic = 8133, + ERR_DeconstructTooFewElements = 8134, - ERR_TupleTooFewElements = 8200, - ERR_TupleReservedMemberName = 8201, - ERR_TupleReservedMemberNameAnyPosition = 8202, - ERR_TupleDuplicateMemberName = 8203, - // 8204 available - - ERR_PredefinedTypeMemberNotFoundInAssembly = 8205, - ERR_MissingDeconstruct = 8206, - ERR_DeconstructCouldNotInferMergedType = 8209, - ERR_DeconstructRequiresExpression = 8210, - ERR_DeconstructWrongCardinality = 8211, - ERR_CannotDeconstructDynamic = 8212, - ERR_DeconstructTooFewElements = 8213, + ERR_ConversionNotTupleCompatible = 8135, + ERR_DeconstructionVarFormDisallowsSpecificType = 8136, - ERR_ConversionNotTupleCompatible = 8214, - ERR_DeconstructionVarFormDisallowsSpecificType = 8215, - - ERR_TupleElementNamesAttributeMissing = 8216, - ERR_ExplicitTupleElementNames = 8217, - ERR_CantChangeTupleNamesOnOverride = 8218, - ERR_DuplicateInterfaceWithTupleNamesInBaseList = 8219, - ERR_ImplBadTupleNames = 8220, - ERR_PartialMethodInconsistentTupleNames = 8221, + ERR_TupleElementNamesAttributeMissing = 8137, + ERR_ExplicitTupleElementNames = 8138, + ERR_CantChangeTupleNamesOnOverride = 8139, + ERR_DuplicateInterfaceWithTupleNamesInBaseList = 8140, + ERR_ImplBadTupleNames = 8141, + ERR_PartialMethodInconsistentTupleNames = 8142, #endregion tuple diagnostics introduced in C# 7 - // huge gap here; available 8222-8889 + // Available = 8143, 8144 #region diagnostics for ref locals and ref returns introduced in C# 7 - ERR_AutoPropertyCannotBeRefReturning = 8890, - ERR_RefPropertyMustHaveGetAccessor = 8891, - ERR_RefPropertyCannotHaveSetAccessor = 8892, - ERR_CantChangeRefReturnOnOverride = 8893, - ERR_MustNotHaveRefReturn = 8894, - ERR_MustHaveRefReturn = 8895, - ERR_RefReturnMustHaveIdentityConversion = 8896, - ERR_CloseUnimplementedInterfaceMemberWrongRefReturn = 8897, - ERR_VoidReturningMethodCannotReturnByRef = 8898, - ERR_BadIteratorReturnRef = 8899, - ERR_BadRefReturnExpressionTree = 8900, - ERR_RefReturningCallInExpressionTree = 8901, + ERR_AutoPropertyCannotBeRefReturning = 8145, + ERR_RefPropertyMustHaveGetAccessor = 8146, + ERR_RefPropertyCannotHaveSetAccessor = 8147, + ERR_CantChangeRefReturnOnOverride = 8148, + ERR_MustNotHaveRefReturn = 8149, + ERR_MustHaveRefReturn = 8150, + ERR_RefReturnMustHaveIdentityConversion = 8151, + ERR_CloseUnimplementedInterfaceMemberWrongRefReturn = 8152, + ERR_VoidReturningMethodCannotReturnByRef = 8153, + ERR_BadIteratorReturnRef = 8154, + ERR_BadRefReturnExpressionTree = 8155, + ERR_RefReturningCallInExpressionTree = 8156, - ERR_RefReturnLvalueExpected = 8910, - ERR_RefReturnNonreturnableLocal = 8911, - ERR_RefReturnNonreturnableLocal2 = 8912, - ERR_RefReturnRangeVariable = 8913, - ERR_RefReturnRangeVariable2 = 8914, - ERR_RefReturnReadonly = 8916, - ERR_RefReturnReadonlyStatic = 8917, - ERR_RefReturnReadonly2 = 8918, - ERR_RefReturnReadonlyStatic2 = 8919, - ERR_RefReturnCall = 8920, - ERR_RefReturnCall2 = 8921, - ERR_RefReturnParameter = 8922, - ERR_RefReturnParameter2 = 8923, - ERR_RefReturnLocal = 8924, - ERR_RefReturnLocal2 = 8925, - ERR_RefReturnStructThis = 8926, + ERR_RefReturnLvalueExpected = 8157, + ERR_RefReturnNonreturnableLocal = 8158, + ERR_RefReturnNonreturnableLocal2 = 8159, + ERR_RefReturnRangeVariable = 8160, + ERR_RefReturnRangeVariable2 = 8170, + ERR_RefReturnReadonly = 8171, + ERR_RefReturnReadonlyStatic = 8172, + ERR_RefReturnReadonly2 = 8173, + ERR_RefReturnReadonlyStatic2 = 8174, + ERR_RefReturnCall = 8175, + ERR_RefReturnCall2 = 8176, + ERR_RefReturnParameter = 8177, + ERR_RefReturnParameter2 = 8178, + ERR_RefReturnLocal = 8179, + ERR_RefReturnLocal2 = 8180, + ERR_RefReturnStructThis = 8181, - // Available = 8927-8929, + // Available = 8182, 8183 - ERR_MustBeRefAssignable = 8930, - ERR_MustBeRefAssignableLocal = 8931, - ERR_InitializeByValueVariableWithReference = 8932, - ERR_InitializeByReferenceVariableWithValue = 8933, - ERR_RefAssignmentMustHaveIdentityConversion = 8934, - ERR_ByReferenceVariableMustBeInitialized = 8935, + ERR_MustBeRefAssignable = 8184, + ERR_MustBeRefAssignableLocal = 8185, + ERR_InitializeByValueVariableWithReference = 8186, + ERR_InitializeByReferenceVariableWithValue = 8187, + ERR_RefAssignmentMustHaveIdentityConversion = 8188, + ERR_ByReferenceVariableMustBeInitialized = 8189, - ERR_AnonDelegateCantUseLocal = 8940, - ERR_BadIteratorLocalType = 8941, - ERR_BadAsyncLocalType = 8942, - ERR_RefReturningCallAndAwait = 8943, + ERR_AnonDelegateCantUseLocal = 8190, + ERR_BadIteratorLocalType = 8191, + ERR_BadAsyncLocalType = 8192, + ERR_RefReturningCallAndAwait = 8193, #endregion diagnostics for ref locals and ref returns introduced in C# 7 + // Available = 8194, 8195 + #region diagnostics for out var - ERR_ImplicitlyTypedOutVariableUsedInTheSameArgumentList = 8944, - ERR_TypeInferenceFailedForImplicitlyTypedOutVariable = 8945, + ERR_ImplicitlyTypedOutVariableUsedInTheSameArgumentList = 8196, + ERR_TypeInferenceFailedForImplicitlyTypedOutVariable = 8197, #endregion diagnostics for out var } } diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Tuples.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Tuples.cs index a887676c050..65e1f55b358 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Tuples.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Tuples.cs @@ -591,110 +591,110 @@ public void TupleAttributeMissing() references: new[] { SystemCoreRef }, options: TestOptions.ReleaseDll); comp.VerifyDiagnostics( - // (8,31): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (8,31): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public class Outer : Base1<(int key, int val)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int key, int val)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(8, 31), - // (10,38): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (10,38): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public class Inner : Base2<(int key2, int val2), V> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int key2, int val2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(10, 38), - // (12,44): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (12,44): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public class InnerInner : Base1<(int key3, int val3)> { } Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int key3, int val3)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(12, 44), - // (16,42): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (16,42): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public class Derived : Outer<(int e1, (int e2, int e3) e4)>.Inner< Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e2, int e3)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(16, 42), - // (16,33): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (16,33): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public class Derived : Outer<(int e1, (int e2, int e3) e4)>.Inner< Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, (int e2, int e3) e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(16, 33), - // (17,11): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (17,11): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // Outer<(int e5, int e6)>.Inner<(int e7, int e8)[], (int e9, int e10)>.InnerInner[], Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e5, int e6)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(17, 11), - // (17,35): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (17,35): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // Outer<(int e5, int e6)>.Inner<(int e7, int e8)[], (int e9, int e10)>.InnerInner[], Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e7, int e8)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(17, 35), - // (17,55): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (17,55): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // Outer<(int e5, int e6)>.Inner<(int e7, int e8)[], (int e9, int e10)>.InnerInner[], Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e9, int e10)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(17, 55), - // (18,6): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (18,6): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // ((int e11, int e12) e13, int e14)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e11, int e12)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(18, 6), - // (18,5): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (18,5): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // ((int e11, int e12) e13, int e14)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "((int e11, int e12) e13, int e14)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(18, 5), - // (19,18): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (19,18): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // .InnerInner<((int e15, int e16) e17, (int e18, Base1<(int e19, int e20)> e21) e22)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e15, int e16)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(19, 18), - // (19,58): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (19,58): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // .InnerInner<((int e15, int e16) e17, (int e18, Base1<(int e19, int e20)> e21) e22)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e19, int e20)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(19, 58), - // (19,42): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (19,42): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // .InnerInner<((int e15, int e16) e17, (int e18, Base1<(int e19, int e20)> e21) e22)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e18, Base1<(int e19, int e20)> e21)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(19, 42), - // (19,17): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (19,17): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // .InnerInner<((int e15, int e16) e17, (int e18, Base1<(int e19, int e20)> e21) e22)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "((int e15, int e16) e17, (int e18, Base1<(int e19, int e20)> e21) e22)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(19, 17), - // (62,47): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (62,47): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // ValueTuple<(dynamic e2, dynamic e3)> e4)> Event1 Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(dynamic e2, dynamic e3)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(62, 47), - // (61,35): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (61,35): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static event Delegate1<(dynamic e1, Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, @"(dynamic e1, ValueTuple<(dynamic e2, dynamic e3)> e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(61, 35), - // (35,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (35,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Method1() => (0, 0); Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(35, 19), - // (36,32): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (36,32): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static void Method2((int e1, int e2) x) { } Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(36, 32), - // (37,44): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (37,44): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Method3((int e3, int e4) x) => (0, 0); Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e3, int e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(37, 44), - // (37,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (37,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Method3((int e3, int e4) x) => (0, 0); Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(37, 19), - // (38,48): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (38,48): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Method4(ref (int e3, int e4) x) => x; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e3, int e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(38, 48), - // (38,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (38,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Method4(ref (int e3, int e4) x) => x; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(38, 19), - // (47,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (47,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Prop1 => (0, 0); Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(47, 19), - // (48,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (48,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Prop2 { get; set; } Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(48, 19), - // (50,34): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (50,34): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public (int e1, int e2) this[(int e3, int e4) param] Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e3, int e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(50, 34), - // (50,12): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (50,12): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public (int e1, int e2) this[(int e3, int e4) param] Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(50, 12), - // (58,14): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (58,14): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // ((dynamic e1, dynamic e2, object e3) e4, dynamic e5), Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(dynamic e1, dynamic e2, object e3)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(58, 14), - // (58,13): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (58,13): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // ((dynamic e1, dynamic e2, object e3) e4, dynamic e5), Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "((dynamic e1, dynamic e2, object e3) e4, dynamic e5)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(58, 13), - // (22,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (22,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Field2; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(22, 19), - // (23,34): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (23,34): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static Base1<(int e1, (int e2, int e3) e4)> Field3; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e2, int e3)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(23, 34), - // (23,25): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (23,25): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static Base1<(int e1, (int e2, int e3) e4)> Field3; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, (int e2, int e3) e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(23, 25), - // (25,36): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (25,36): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static ValueTuple, int> Field4; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, (int, (dynamic, dynamic)) e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(25, 36), - // (27,25): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (27,25): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static Outer<(object e1, dynamic e2)> Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(object e1, dynamic e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(27, 25), - // (28,16): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (28,16): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // .Inner<(dynamic e3, object e4), Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(dynamic e3, object e4)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(28, 16), - // (21,19): error CS8216: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? + // (21,19): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // public static (int e1, int e2) Field1; Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int e1, int e2)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(21, 19)); } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs index a68ae585472..11ea5de8b55 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs @@ -125,7 +125,7 @@ static void Main() // (8,18): error CS1061: 'C' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'C' could be found (are you missing a using directive or an assembly reference?) // (x, y) = new C(); Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "new C()").WithArguments("C", "Deconstruct").WithLocation(8, 18), - // (8,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (8,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(8, 18) ); @@ -183,7 +183,7 @@ static void Main() // (8,18): error CS1501: No overload for method 'Deconstruct' takes 2 arguments // (x, y) = new C(); Diagnostic(ErrorCode.ERR_BadArgCount, "new C()").WithArguments("Deconstruct", "2").WithLocation(8, 18), - // (8,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (8,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(8, 18) ); @@ -210,7 +210,7 @@ static void Main() // (7,18): error CS7036: There is no argument given that corresponds to the required formal parameter 'c' of 'C.Deconstruct(out int, out int, out int)' // (x, y) = new C(); Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "new C()").WithArguments("c", "C.Deconstruct(out int, out int, out int)").WithLocation(7, 18), - // (7,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (7,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(7, 18) ); @@ -242,7 +242,7 @@ static void Main() // (8,22): error CS1501: No overload for method 'Deconstruct' takes 2 arguments // (x.f, y.g) = new C(); Diagnostic(ErrorCode.ERR_BadArgCount, "new C()").WithArguments("Deconstruct", "2").WithLocation(8, 22), - // (8,22): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (8,22): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x.f, y.g) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(8, 22) ); @@ -268,7 +268,7 @@ static void Main() // (8,9): error CS1615: Argument 2 may not be passed with the 'out' keyword // (x, y) = new C(); Diagnostic(ErrorCode.ERR_BadArgExtraRef, "(x, y) = new C()").WithArguments("2", "out").WithLocation(8, 9), - // (8,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (8,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(8, 18) ); @@ -294,7 +294,7 @@ static void Main() // (8,9): error CS1620: Argument 1 must be passed with the 'ref' keyword // (x, y) = new C(); Diagnostic(ErrorCode.ERR_BadArgRef, "(x, y) = new C()").WithArguments("1", "ref").WithLocation(8, 9), - // (8,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (8,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(8, 18) ); @@ -554,7 +554,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (9,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (9,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(9, 18) ); @@ -589,7 +589,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (13,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (13,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(13, 18) ); @@ -620,7 +620,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (9,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (9,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(9, 18) ); @@ -686,7 +686,7 @@ static void Main() // (9,18): error CS7036: There is no argument given that corresponds to the required formal parameter '__arglist' of 'C.Deconstruct(out int, out string, __arglist)' // (x, y) = new C(); Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "new C()").WithArguments("__arglist", "C.Deconstruct(out int, out string, __arglist)").WithLocation(9, 18), - // (9,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (9,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(9, 18) ); @@ -747,7 +747,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (11,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (11,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C() { Deconstruct = DeconstructMethod }; Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C() { Deconstruct = DeconstructMethod }").WithArguments("C", "2").WithLocation(11, 18) ); @@ -818,7 +818,7 @@ public static void DeconstructMethod(out int a, out int b) var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (14,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (14,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = c; Diagnostic(ErrorCode.ERR_MissingDeconstruct, "c").WithArguments("C", "2").WithLocation(14, 18), // (6,21): warning CS0067: The event 'C.Deconstruct' is never used @@ -1278,7 +1278,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, parseOptions: TestOptions.Regular.WithRefsFeature()); comp.VerifyDiagnostics( - // (7,18): error CS8210: Deconstruct assignment requires an expression with a type on the right-hand-side. + // (7,18): error CS8131: Deconstruct assignment requires an expression with a type on the right-hand-side. // (x, x) = null; Diagnostic(ErrorCode.ERR_DeconstructRequiresExpression, "null").WithLocation(7, 18) ); @@ -1326,7 +1326,7 @@ static void Main() // (7,18): error CS1061: 'void' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'void' could be found (are you missing a using directive or an assembly reference?) // (x, x) = M(); Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "M()").WithArguments("void", "Deconstruct").WithLocation(7, 18), - // (7,18): error CS8206: No Deconstruct instance or extension method was found for type 'void', with 2 out parameters. + // (7,18): error CS8129: No Deconstruct instance or extension method was found for type 'void', with 2 out parameters. // (x, x) = M(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "M()").WithArguments("void", "2").WithLocation(7, 18) ); @@ -1706,7 +1706,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, assemblyName: "comp"); comp.VerifyDiagnostics(); comp.VerifyEmitDiagnostics( - // (22,9): error CS8205: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (22,9): error CS8128: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // (x, y) = (1, 2); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "(x, y) = (1, 2)").WithArguments("Item2", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(22, 9) ); @@ -1809,7 +1809,7 @@ static void Main() // (12,18): error CS0121: The call is ambiguous between the following methods or properties: 'Base.Deconstruct(out int, out int)' and 'Base.Deconstruct(out long, out long)' // (x, y) = new C(); Diagnostic(ErrorCode.ERR_AmbigCall, "new C()").WithArguments("Base.Deconstruct(out int, out int)", "Base.Deconstruct(out long, out long)").WithLocation(12, 18), - // (12,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (12,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(12, 18) ); @@ -1877,7 +1877,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, SystemCoreRef, CSharpRef }); comp.VerifyDiagnostics( - // (7,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (7,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(7, 18) ); @@ -1904,7 +1904,7 @@ static void Main() // (7,18): error CS1955: Non-invocable member 'C.Deconstruct' cannot be used like a method. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_NonInvocableMemberCalled, "new C()").WithArguments("C.Deconstruct").WithLocation(7, 18), - // (7,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (7,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(7, 18) ); @@ -1990,7 +1990,7 @@ static void Main() // (8,113): error CS1501: No overload for method 'Deconstruct' takes 22 arguments // (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) = CreateLongRef(1, 2, 3, 4, 5, 6, 7, CreateLongRef(8, 9, 10, 11, 12, 13, 14, Tuple.Create(15, 16, 17, 18, 19, 20, 21, 22))); Diagnostic(ErrorCode.ERR_BadArgCount, "CreateLongRef(1, 2, 3, 4, 5, 6, 7, CreateLongRef(8, 9, 10, 11, 12, 13, 14, Tuple.Create(15, 16, 17, 18, 19, 20, 21, 22)))").WithArguments("Deconstruct", "22").WithLocation(8, 113), - // (8,113): error CS8206: No Deconstruct instance or extension method was found for type 'Tuple>>>', with 22 out parameters. + // (8,113): error CS8129: No Deconstruct instance or extension method was found for type 'Tuple>>>', with 22 out parameters. // (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) = CreateLongRef(1, 2, 3, 4, 5, 6, 7, CreateLongRef(8, 9, 10, 11, 12, 13, 14, Tuple.Create(15, 16, 17, 18, 19, 20, 21, 22))); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "CreateLongRef(1, 2, 3, 4, 5, 6, 7, CreateLongRef(8, 9, 10, 11, 12, 13, 14, Tuple.Create(15, 16, 17, 18, 19, 20, 21, 22)))").WithArguments("System.Tuple>>>", "22").WithLocation(8, 113) ); @@ -2076,7 +2076,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (10,18): error CS8212: Cannot deconstruct dynamic objects. + // (10,18): error CS8133: Cannot deconstruct dynamic objects. // (x, y) = c; Diagnostic(ErrorCode.ERR_CannotDeconstructDynamic, "c").WithLocation(10, 18) ); @@ -2106,7 +2106,7 @@ class C1 // (9,18): error CS0122: 'C1.Deconstruct(out int, out string)' is inaccessible due to its protection level // (x, y) = new C1(); Diagnostic(ErrorCode.ERR_BadAccess, "new C1()").WithArguments("C1.Deconstruct(out int, out string)").WithLocation(9, 18), - // (9,18): error CS8206: No Deconstruct instance or extension method was found for type 'C1', with 2 out parameters. + // (9,18): error CS8129: No Deconstruct instance or extension method was found for type 'C1', with 2 out parameters. // (x, y) = new C1(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C1()").WithArguments("C1", "2").WithLocation(9, 18) ); @@ -2145,7 +2145,7 @@ static void Main() // (7,18): error CS0012: The type 'Missing' is defined in an assembly that is not referenced. You must add a reference to assembly 'libMissingComp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_NoTypeDef, "new C()").WithArguments("Missing", "libMissingComp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 18), - // (7,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (7,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(7, 18) ); @@ -2172,7 +2172,7 @@ static void Main() // (9,18): error CS0176: Member 'C.Deconstruct(out int, out string)' cannot be accessed with an instance reference; qualify it with a type name instead // (x, y) = new C(); Diagnostic(ErrorCode.ERR_ObjectProhibited, "new C()").WithArguments("C.Deconstruct(out int, out string)").WithLocation(9, 18), - // (9,18): error CS8206: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. + // (9,18): error CS8129: No Deconstruct instance or extension method was found for type 'C', with 2 out parameters. // (x, y) = new C(); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(9, 18) ); @@ -2563,7 +2563,7 @@ public static (int, int) MakePair() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (8,9): error CS8211: Cannot deconstruct a tuple of '2' elements into '3' variables. + // (8,9): error CS8132: Cannot deconstruct a tuple of '2' elements into '3' variables. // (x, y, z) = MakePair(); Diagnostic(ErrorCode.ERR_DeconstructWrongCardinality, "(x, y, z) = MakePair()").WithArguments("2", "3").WithLocation(8, 9) ); @@ -2586,7 +2586,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (8,9): error CS8211: Cannot deconstruct a tuple of '2' elements into '3' variables. + // (8,9): error CS8132: Cannot deconstruct a tuple of '2' elements into '3' variables. // (x, (y, z, w)) = Pair.Create(42, (43, 44)); Diagnostic(ErrorCode.ERR_DeconstructWrongCardinality, "(x, (y, z, w)) = Pair.Create(42, (43, 44))").WithArguments("2", "3").WithLocation(8, 9) ); @@ -2607,7 +2607,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,14): error CS8213: Deconstruction must contain at least two variables. + // (6,14): error CS8134: Deconstruction must contain at least two variables. // for ((var (x, y)) = Pair.Create(1, 2); ;) { } Diagnostic(ErrorCode.ERR_DeconstructTooFewElements, "(var (x, y)) = Pair.Create(1, 2)").WithLocation(6, 14) ); @@ -2889,7 +2889,7 @@ static void Main() // (6,28): error CS1061: 'void' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'void' could be found (are you missing a using directive or an assembly reference?) // (int x1, int x2) = M(x1); Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "M(x1)").WithArguments("void", "Deconstruct").WithLocation(6, 28), - // (6,28): error CS8206: No Deconstruct instance or extension method was found for type 'void', with 2 out parameters. + // (6,28): error CS8129: No Deconstruct instance or extension method was found for type 'void', with 2 out parameters. // (int x1, int x2) = M(x1); Diagnostic(ErrorCode.ERR_MissingDeconstruct, "M(x1)").WithArguments("void", "2").WithLocation(6, 28), // (6,30): error CS0165: Use of unassigned local variable 'x1' @@ -2934,7 +2934,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,28): error CS8210: Deconstruct assignment requires an expression with a type on the right-hand-side. + // (6,28): error CS8131: Deconstruct assignment requires an expression with a type on the right-hand-side. // (int x1, int x2) = null; Diagnostic(ErrorCode.ERR_DeconstructRequiresExpression, "null").WithLocation(6, 28) ); @@ -2954,7 +2954,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,24): error CS8210: Deconstruct assignment requires an expression with a type on the right-hand-side. + // (6,24): error CS8131: Deconstruct assignment requires an expression with a type on the right-hand-side. // var (x1, x2) = null; Diagnostic(ErrorCode.ERR_DeconstructRequiresExpression, "null").WithLocation(6, 24) ); @@ -2974,7 +2974,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8209: The type information on the left-hand-side 'x2' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. + // (6,9): error CS8130: The type information on the left-hand-side 'x2' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. // var (x1, x2) = (1, null); Diagnostic(ErrorCode.ERR_DeconstructCouldNotInferMergedType, "var (x1, x2) = (1, null);").WithArguments("x2", "null").WithLocation(6, 9) ); @@ -3098,10 +3098,10 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8209: The type information on the left-hand-side 'var x3' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. + // (6,9): error CS8130: The type information on the left-hand-side 'var x3' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. // (string x1, (byte x2, var x3), var x4) = (null, (2, null), null); Diagnostic(ErrorCode.ERR_DeconstructCouldNotInferMergedType, "(string x1, (byte x2, var x3), var x4) = (null, (2, null), null);").WithArguments("var x3", "null").WithLocation(6, 9), - // (6,9): error CS8209: The type information on the left-hand-side 'var x4' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. + // (6,9): error CS8130: The type information on the left-hand-side 'var x4' and right-hand-side 'null' of the deconstruction was insufficient to infer a merged type. // (string x1, (byte x2, var x3), var x4) = (null, (2, null), null); Diagnostic(ErrorCode.ERR_DeconstructCouldNotInferMergedType, "(string x1, (byte x2, var x3), var x4) = (null, (2, null), null);").WithArguments("var x4", "null").WithLocation(6, 9) ); @@ -3121,7 +3121,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,51): error CS8210: Deconstruct assignment requires an expression with a type on the right-hand-side. + // (6,51): error CS8131: Deconstruct assignment requires an expression with a type on the right-hand-side. // ((string x1, byte x2, var x3), int x4) = (null, 4); Diagnostic(ErrorCode.ERR_DeconstructRequiresExpression, "null").WithLocation(6, 51) ); @@ -3141,7 +3141,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8209: The type information on the left-hand-side 'var x2' and right-hand-side '(null, 2)' of the deconstruction was insufficient to infer a merged type. + // (6,9): error CS8130: The type information on the left-hand-side 'var x2' and right-hand-side '(null, 2)' of the deconstruction was insufficient to infer a merged type. // (string x1, var x2) = (null, (null, 2)); Diagnostic(ErrorCode.ERR_DeconstructCouldNotInferMergedType, "(string x1, var x2) = (null, (null, 2));").WithArguments("var x2", "(null, 2)").WithLocation(6, 9) ); @@ -3161,7 +3161,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8211: Cannot deconstruct a tuple of '2' elements into '3' variables. + // (6,9): error CS8132: Cannot deconstruct a tuple of '2' elements into '3' variables. // (string x1, var x2, int x3) = (null, "hello"); Diagnostic(ErrorCode.ERR_DeconstructWrongCardinality, @"(string x1, var x2, int x3) = (null, ""hello"");").WithArguments("2", "3").WithLocation(6, 9) ); @@ -3182,10 +3182,10 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8211: Cannot deconstruct a tuple of '3' elements into '2' variables. + // (6,9): error CS8132: Cannot deconstruct a tuple of '3' elements into '2' variables. // (string x1, var y1) = (null, "hello", 3); Diagnostic(ErrorCode.ERR_DeconstructWrongCardinality, @"(string x1, var y1) = (null, ""hello"", 3);").WithArguments("3", "2").WithLocation(6, 9), - // (7,47): error CS8210: Deconstruct assignment requires an expression with a type on the right-hand-side. + // (7,47): error CS8131: Deconstruct assignment requires an expression with a type on the right-hand-side. // (string x2, var y2) = (null, "hello", null); Diagnostic(ErrorCode.ERR_DeconstructRequiresExpression, "null").WithLocation(7, 47) ); @@ -3366,10 +3366,10 @@ class var { } var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,14): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (6,14): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // var (x1, x2) = (1, 2); Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "x1").WithLocation(6, 14), - // (6,18): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (6,18): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // var (x1, x2) = (1, 2); Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "x2").WithLocation(6, 18), // (6,14): error CS0029: Cannot implicitly convert type 'int' to 'var' @@ -3508,10 +3508,10 @@ class D var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (7,14): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (7,14): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // var (x3, x4) = (3, 4); Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "x3").WithLocation(7, 14), - // (7,18): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (7,18): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // var (x3, x4) = (3, 4); Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "x4").WithLocation(7, 18), // (7,14): error CS0029: Cannot implicitly convert type 'int' to 'D' @@ -3538,7 +3538,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (6,9): error CS8211: Cannot deconstruct a tuple of '3' elements into '2' variables. + // (6,9): error CS8132: Cannot deconstruct a tuple of '3' elements into '2' variables. // (var (x1, x2), var x3) = (1, 2, 3); Diagnostic(ErrorCode.ERR_DeconstructWrongCardinality, "(var (x1, x2), var x3) = (1, 2, 3);").WithArguments("3", "2").WithLocation(6, 9) ); @@ -3614,7 +3614,7 @@ static void Main() // (9,21): error CS1061: 'int' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?) // var(x, y) = 42; Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "42").WithArguments("int", "Deconstruct").WithLocation(9, 21), - // (9,21): error CS8206: No Deconstruct instance or extension method was found for type 'int', with 2 out parameters. + // (9,21): error CS8129: No Deconstruct instance or extension method was found for type 'int', with 2 out parameters. // var(x, y) = 42; Diagnostic(ErrorCode.ERR_MissingDeconstruct, "42").WithArguments("int", "2").WithLocation(9, 21), // (8,13): warning CS0219: The variable 'x' is assigned but its value is never used @@ -3655,7 +3655,7 @@ static void Main() //var comp = CompileAndVerify(source, expectedOutput: "42 43 44"); var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (11,9): error CS8213: Deconstruction must contain at least two variables. + // (11,9): error CS8134: Deconstruction must contain at least two variables. // (var(x, y)) = 43; // parsed as invocation Diagnostic(ErrorCode.ERR_DeconstructTooFewElements, "(var(x, y)) = 43").WithLocation(11, 9), // (13,20): error CS1026: ) expected @@ -3673,7 +3673,7 @@ static void Main() // (9,9): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?) // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "@var").WithArguments("var").WithLocation(9, 9), - // (9,14): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (9,14): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "x").WithLocation(9, 14), // (9,17): error CS0128: A local variable named 'y' is already defined in this scope @@ -3682,13 +3682,13 @@ static void Main() // (9,9): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?) // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "@var").WithArguments("var").WithLocation(9, 9), - // (9,17): error CS8215: Deconstruction `var (...)` form disallows a specific type for 'var'. + // (9,17): error CS8136: Deconstruction `var (...)` form disallows a specific type for 'var'. // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_DeconstructionVarFormDisallowsSpecificType, "y").WithLocation(9, 17), // (9,22): error CS1061: 'int' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?) // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "42").WithArguments("int", "Deconstruct").WithLocation(9, 22), - // (9,22): error CS8206: No Deconstruct instance or extension method was found for type 'int', with 2 out parameters. + // (9,22): error CS8129: No Deconstruct instance or extension method was found for type 'int', with 2 out parameters. // @var(x, y) = 42; // parsed as invocation Diagnostic(ErrorCode.ERR_MissingDeconstruct, "42").WithArguments("int", "2").WithLocation(9, 22), // (11,14): error CS0128: A local variable named 'x' is already defined in this scope @@ -3700,7 +3700,7 @@ static void Main() // (11,23): error CS1061: 'int' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?) // (var(x, y)) = 43; // parsed as invocation Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "43").WithArguments("int", "Deconstruct").WithLocation(11, 23), - // (11,23): error CS8206: No Deconstruct instance or extension method was found for type 'int', with 1 out parameters. + // (11,23): error CS8129: No Deconstruct instance or extension method was found for type 'int', with 1 out parameters. // (var(x, y)) = 43; // parsed as invocation Diagnostic(ErrorCode.ERR_MissingDeconstruct, "43").WithArguments("int", "1").WithLocation(11, 23), // (13,14): error CS0128: A local variable named 'x' is already defined in this scope @@ -3712,7 +3712,7 @@ static void Main() // (13,22): error CS1061: 'int' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?) // (var(x, y) = 44); // parsed as invocation Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "44").WithArguments("int", "Deconstruct").WithLocation(13, 22), - // (13,22): error CS8206: No Deconstruct instance or extension method was found for type 'int', with 1 out parameters. + // (13,22): error CS8129: No Deconstruct instance or extension method was found for type 'int', with 1 out parameters. // (var(x, y) = 44); // parsed as invocation Diagnostic(ErrorCode.ERR_MissingDeconstruct, "44").WithArguments("int", "1").WithLocation(13, 22), // (8,13): warning CS0219: The variable 'x' is assigned but its value is never used diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs index a015068b42d..5e4344c7dc9 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs @@ -3611,7 +3611,7 @@ namespace global::((System.Linq.Expressions.Expression>)(() => B // (2,19): error CS1001: Identifier expected // namespace global::((System.Linq.Expressions.Expression>)(() => B )).Compile()(){} Diagnostic(ErrorCode.ERR_IdentifierExpected, "(").WithLocation(2, 19), - // (2,20): error CS8200: Tuple must contain at least two elements. + // (2,20): error CS8124: Tuple must contain at least two elements. // namespace global::((System.Linq.Expressions.Expression>)(() => B )).Compile()(){} Diagnostic(ErrorCode.ERR_TupleTooFewElements, "(System.Linq.Expressions.Expression>)").WithLocation(2, 20), // (2,76): error CS1026: ) expected @@ -3635,7 +3635,7 @@ namespace global::((System.Linq.Expressions.Expression>)(() => B // (2,93): error CS1002: ; expected // namespace global::((System.Linq.Expressions.Expression>)(() => B )).Compile()(){} Diagnostic(ErrorCode.ERR_SemicolonExpected, "(").WithLocation(2, 93), - // (2,93): error CS8200: Tuple must contain at least two elements. + // (2,93): error CS8124: Tuple must contain at least two elements. // namespace global::((System.Linq.Expressions.Expression>)(() => B )).Compile()(){} Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(2, 93), // (2,93): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs index af83ca45c89..121aeb0a01f 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs @@ -1467,7 +1467,7 @@ static void Main() " + trivial2uple + trivial3uple; CreateCompilationWithMscorlib(source).VerifyDiagnostics( - // (6,27): error CS8206: Tuple with 3 elements cannot be converted to type '(int, string)'. + // (6,27): error CS8135: Tuple with 3 elements cannot be converted to type '(int, string)'. // (int, string) x = (1, null, 2); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "(1, null, 2)").WithArguments("3", "(int, string)").WithLocation(6, 27) ); @@ -2877,7 +2877,7 @@ static void Main() "; var comp = CreateCompilationWithMscorlib(source, assemblyName: "comp"); comp.VerifyEmitDiagnostics( - // (11,24): error CS8205: Member '.ctor' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (11,24): error CS8128: Member '.ctor' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // (int, int) x = (1, 2); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "(1, 2)").WithArguments(".ctor", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(11, 24) ); @@ -2898,13 +2898,13 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (6,24): error CS8203: 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); Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "a").WithLocation(6, 24), - // (6,38): error CS8203: 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); Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 38), - // (6,50): error CS8203: 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); Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 50) ); @@ -2926,16 +2926,16 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (6,28): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 28), - // (6,50): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 50), - // (7,14): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(7, 14), - // (7,40): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(7, 40) ); @@ -2956,13 +2956,13 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef }); comp.VerifyDiagnostics( - // (6,37): error CS8201: 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); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item10").WithArguments("Item10", "10").WithLocation(6, 37), - // (6,61): error CS8201: 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); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(6, 61), - // (6,71): error CS8201: 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); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item10").WithArguments("Item10", "10").WithLocation(6, 71) ); @@ -3003,10 +3003,10 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (6,24): error CS8203: 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); Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "a").WithLocation(6, 24), - // (6,50): error CS8203: 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); Diagnostic(ErrorCode.ERR_TupleDuplicateMemberName, "b").WithLocation(6, 50) ); @@ -3027,22 +3027,22 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef }); comp.VerifyDiagnostics( - // (6,28): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item3").WithArguments("Item3", "3").WithLocation(6, 28), - // (6,42): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(6, 42), - // (6,100): error CS8202: Tuple membername 'Rest' is disallowed at any position. + // (6,100): error CS8126: Tuple membername '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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 100), - // (6,111): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(6, 111), - // (6,125): error CS8201: 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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item4").WithArguments("Item4", "4").WithLocation(6, 125), - // (6,189): error CS8202: Tuple membername 'Rest' is disallowed at any position. + // (6,189): error CS8126: Tuple membername '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"); Diagnostic(ErrorCode.ERR_TupleReservedMemberNameAnyPosition, "Rest").WithArguments("Rest").WithLocation(6, 189) ); @@ -3063,22 +3063,22 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef }); comp.VerifyDiagnostics( - // (6,18): error CS8202: Tuple membername 'CompareTo' is disallowed at any position. + // (6,18): error CS8126: Tuple membername 'CompareTo' is disallowed at any position. // 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), - // (6,43): error CS8202: Tuple membername 'Deconstruct' is disallowed at any position. + // (6,43): error CS8126: Tuple membername 'Deconstruct' is disallowed at any position. // 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), - // (6,59): error CS8202: Tuple membername 'Equals' is disallowed at any position. + // (6,59): error CS8126: Tuple membername 'Equals' is disallowed at any position. // 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), - // (6,70): error CS8202: Tuple membername 'GetHashCode' is disallowed at any position. + // (6,70): error CS8126: Tuple membername 'GetHashCode' is disallowed at any position. // 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), - // (6,86): error CS8202: Tuple membername 'Rest' is disallowed at any position. + // (6,86): error CS8126: Tuple membername 'Rest' is disallowed at any position. // 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), - // (6,95): error CS8202: Tuple membername 'ToString' is disallowed at any position. + // (6,95): error CS8126: Tuple membername 'ToString' is disallowed at any position. // 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) ); @@ -3930,19 +3930,19 @@ public ValueTuple(T1 item1, T2 item2) // (11,13): error CS8207: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference? // void M2((int a, int b) y) Diagnostic(ErrorCode.ERR_TupleElementNamesAttributeMissing, "(int a, int b)").WithArguments("System.Runtime.CompilerServices.TupleElementNamesAttribute").WithLocation(11, 13), - // (7,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (7,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.Item1}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "Item1").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 39), - // (13,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (13,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{y.Item1}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "Item1").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(13, 39), - // (14,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (14,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{y.a}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "a").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(14, 39), // (15,39): error CS0229: Ambiguity between '(int a, int b).Item2' and '(int a, int b).Item2' // System.Console.WriteLine($"{y.Item2}"); Diagnostic(ErrorCode.ERR_AmbigMember, "Item2").WithArguments("(int a, int b).Item2", "(int a, int b).Item2").WithLocation(15, 39), - // (16,39): error CS8205: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (16,39): error CS8128: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{y.b}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "b").WithArguments("Item2", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(16, 39) ); @@ -3963,7 +3963,7 @@ public ValueTuple(T1 item1, T2 item2) Assert.Same(mTuple, mItem1.ContainingSymbol); Assert.True(mItem1.CustomModifiers.IsEmpty); Assert.True(mItem1.GetAttributes().IsEmpty); - Assert.Equal("error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.", + Assert.Equal("error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.", mItem1.GetUseSiteDiagnostic().ToString()); Assert.False(mItem1.Locations.IsDefaultOrEmpty); Assert.Equal("string", mItem1.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); @@ -4018,7 +4018,7 @@ public ValueTuple(T1 item1, T2 item2) "; var comp = CreateCompilationWithMscorlib(source, assemblyName: "comp"); comp.VerifyDiagnostics( - // (7,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (7,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.a}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "a").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 39) ); @@ -4053,16 +4053,16 @@ public struct ValueTuple "; var comp = CreateCompilationWithMscorlib(source, assemblyName: "comp"); comp.VerifyDiagnostics( - // (7,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (7,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.a}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "a").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 39), - // (8,39): error CS8205: Member 'Item7' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (8,39): error CS8128: Member 'Item7' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.g}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "g").WithArguments("Item7", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(8, 39), - // (9,39): error CS8205: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (9,39): error CS8128: Member 'Item1' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.h}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "h").WithArguments("Item1", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(9, 39), - // (10,39): error CS8205: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (10,39): error CS8128: Member 'Item2' was not found on type 'ValueTuple' from assembly 'comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // System.Console.WriteLine($"{x.i}"); Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "i").WithArguments("Item2", "System.ValueTuple", "comp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(10, 39) ); @@ -4174,7 +4174,7 @@ class C : I "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (9,40): error CS8220: The tuple element names in the signature of method 'C.M((string, string))' must match the tuple element names of interface method 'I.M((string, string))' (including on the return type). + // (9,40): error CS8141: The tuple element names in the signature of method 'C.M((string, string))' must match the tuple element names of interface method 'I.M((string, string))' (including on the return type). // public System.ValueTuple M(System.ValueTuple a) Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M").WithArguments("C.M((string, string))", "I.M((string, string))").WithLocation(9, 40) ); @@ -4308,7 +4308,7 @@ public override (int e, int f) M((int g, int h) y) "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (11,36): error CS8218: 'D.M((int g, int h))': cannot change tuple element names when overriding inherited member 'C.M((int c, int d))' + // (11,36): error CS8139: 'D.M((int g, int h))': cannot change tuple element names when overriding inherited member 'C.M((int c, int d))' // public override (int e, int f) M((int g, int h) y) Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("D.M((int g, int h))", "C.M((int c, int d))").WithLocation(11, 36) ); @@ -5581,7 +5581,7 @@ static void Main() // (12,20): error CS1525: Invalid expression term ')' // x = (1, 1, ); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ")").WithArguments(")").WithLocation(12, 20), - // (8,13): error CS8206: Tuple with 3 elements cannot be converted to type '(int, int)'. + // (8,13): error CS8129: Tuple with 3 elements cannot be converted to type '(int, int)'. // x = (null, null, null); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "(null, null, null)").WithArguments("3", "(int, int)").WithLocation(8, 13), // (9,13): error CS0029: Cannot implicitly convert type '(int, int, int)' to '(int, int)' @@ -5638,7 +5638,7 @@ static void Main() // (12,32): error CS1525: Invalid expression term ')' // x = ((int, int))(1, 1, ); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ")").WithArguments(")").WithLocation(12, 32), - // (8,13): error CS8206: Tuple with 3 elements cannot be converted to type '(int, int)'. + // (8,13): error CS8129: Tuple with 3 elements cannot be converted to type '(int, int)'. // x = ((int, int))(null, null, null); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "((int, int))(null, null, null)").WithArguments("3", "(int, int)").WithLocation(8, 13), // (9,13): error CS0030: Cannot convert type '(int, int, int)' to '(int, int)' @@ -5696,7 +5696,7 @@ static void Main() // (12,20): error CS1525: Invalid expression term ')' // x = (1, 1, ); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ")").WithArguments(")").WithLocation(12, 20), - // (8,13): error CS8206: Tuple with 3 elements cannot be converted to type '(int, int)'. + // (8,13): error CS8129: Tuple with 3 elements cannot be converted to type '(int, int)'. // x = (null, null, null); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "(null, null, null)").WithArguments("3", "(int, int)").WithLocation(8, 13), // (9,13): error CS0029: Cannot implicitly convert type '(int, int, int)' to '(int, int)' @@ -5755,7 +5755,7 @@ static void Main() // (12,20): error CS1525: Invalid expression term ')' // x = (1, 1, ); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ")").WithArguments(")").WithLocation(12, 20), - // (8,13): error CS8206: Tuple with 3 elements cannot be converted to type '(string, string)'. + // (8,13): error CS8129: Tuple with 3 elements cannot be converted to type '(string, string)'. // x = (null, null, null); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "(null, null, null)").WithArguments("3", "(string, string)").WithLocation(8, 13), // (9,13): error CS0029: Cannot implicitly convert type '(int, int, int)' to '(string, string)' @@ -5811,7 +5811,7 @@ static void Main() // (12,21): error CS1525: Invalid expression term ')' // x = ((1, 1, ), 1); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ")").WithArguments(")").WithLocation(12, 21), - // (8,14): error CS8206: Tuple with 3 elements cannot be converted to type '(int, int)'. + // (8,14): error CS8129: Tuple with 3 elements cannot be converted to type '(int, int)'. // x = ((null, null, null), 1); Diagnostic(ErrorCode.ERR_ConversionNotTupleCompatible, "(null, null, null)").WithArguments("3", "(int, int)").WithLocation(8, 14), // (9,14): error CS0029: Cannot implicitly convert type '(int, int, int)' to '(int, int)' @@ -8304,13 +8304,13 @@ public override ((int b, int a), (int b, int a)) M(((int a, int b), (int b, int "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (9,49): error CS8220: The tuple element names in the signature of method 'C.M(((int, int), (int, int)))' must match the tuple element names of interface method 'I<(int b, int a), (int a, int b)>.M(((int b, int a) paramA, (int a, int b) paramB))' (including on the return type). + // (9,49): error CS8141: The tuple element names in the signature of method 'C.M(((int, int), (int, int)))' must match the tuple element names of interface method 'I<(int b, int a), (int a, int b)>.M(((int b, int a) paramA, (int a, int b) paramB))' (including on the return type). // public virtual ((int, int) x, (int, int) y) M(((int, int), (int, int)) x) Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M").WithArguments("C.M(((int, int), (int, int)))", "I<(int b, int a), (int a, int b)>.M(((int b, int a) paramA, (int a, int b) paramB))").WithLocation(9, 49), - // (17,54): error CS8218: 'D.M(((int a, int b), (int b, int a)))': cannot change tuple element names when overriding inherited member 'C.M(((int, int), (int, int)))' + // (17,54): error CS8139: 'D.M(((int a, int b), (int b, int a)))': cannot change tuple element names when overriding inherited member 'C.M(((int, int), (int, int)))' // public override ((int b, int a), (int b, int a)) M(((int a, int b), (int b, int a)) y) Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("D.M(((int a, int b), (int b, int a)))", "C.M(((int, int), (int, int)))").WithLocation(17, 54), - // (17,54): error CS8220: The tuple element names in the signature of method 'D.M(((int a, int b), (int b, int a)))' must match the tuple element names of interface method 'I<(int a, int b), (int c, int d)>.M(((int a, int b) paramA, (int c, int d) paramB))' (including on the return type). + // (17,54): error CS8141: The tuple element names in the signature of method 'D.M(((int a, int b), (int b, int a)))' must match the tuple element names of interface method 'I<(int a, int b), (int c, int d)>.M(((int a, int b) paramA, (int c, int d) paramB))' (including on the return type). // public override ((int b, int a), (int b, int a)) M(((int a, int b), (int b, int a)) y) Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M").WithArguments("D.M(((int a, int b), (int b, int a)))", "I<(int a, int b), (int c, int d)>.M(((int a, int b) paramA, (int c, int d) paramB))").WithLocation(17, 54) ); @@ -9529,31 +9529,31 @@ static void Main() var comp = CreateCompilationWithMscorlib(source); comp.VerifyDiagnostics( - // (9,17): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item9").WithArguments("Item9", "9").WithLocation(9, 17), - // (9,28): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(9, 28), - // (9,39): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(9, 39), - // (9,50): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item3").WithArguments("Item3", "3").WithLocation(9, 50), - // (9,61): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item4").WithArguments("Item4", "4").WithLocation(9, 61), - // (9,72): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item5").WithArguments("Item5", "5").WithLocation(9, 72), - // (9,83): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item6").WithArguments("Item6", "6").WithLocation(9, 83), - // (9,94): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item7").WithArguments("Item7", "7").WithLocation(9, 94), - // (9,105): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item8").WithArguments("Item8", "8").WithLocation(9, 105) ); @@ -9633,7 +9633,7 @@ static void Main() var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (9,73): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item1").WithArguments("Item1", "1").WithLocation(9, 73) ); @@ -10160,7 +10160,7 @@ static void Test03() // (23,12): warning CS0612: '(int a, int b)' is obsolete // static (int a, int b) M102() Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "(int a, int b)").WithArguments("(int a, int b)").WithLocation(23, 12), - // (35,73): error CS8201: 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() Diagnostic(ErrorCode.ERR_TupleReservedMemberName, "Item2").WithArguments("Item2", "2").WithLocation(35, 73), // (55,10): error CS0636: The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) @@ -12644,10 +12644,10 @@ public TestAttribute((int, string) val) var comp = CreateCompilationWithMscorlib(source, references: new[] { SystemRef }); comp.VerifyDiagnostics( - // (6,32): error CS8206: Type of the tuple element cannot be infered from ''. + // (6,32): error CS8129: Type of the tuple element cannot be infered from ''. // var x0 = new {tuple = (null, null)}; Diagnostic(ErrorCode.Unknown, "null").WithArguments("").WithLocation(6, 32), - // (6,38): error CS8206: Type of the tuple element cannot be infered from ''. + // (6,38): error CS8129: Type of the tuple element cannot be infered from ''. // var x0 = new {tuple = (null, null)}; Diagnostic(ErrorCode.Unknown, "null").WithArguments("").WithLocation(6, 38), // (8,31): error CS8207: Cannot implicitly convert tuple expression to 'ValueType' @@ -12665,7 +12665,7 @@ public TestAttribute((int, string) val) // (14,20): error CS0655: 'Val' is not a valid named attribute argument because it is not a valid attribute parameter type // [TestAttribute(Val = (5, "5"))] Diagnostic(ErrorCode.ERR_BadNamedAttributeArgumentType, "Val").WithArguments("Val").WithLocation(14, 20), - // (19,16): error CS8206: Type of the tuple element cannot be infered from ''. + // (19,16): error CS8129: Type of the tuple element cannot be infered from ''. // await (null, "6"); Diagnostic(ErrorCode.Unknown, "null").WithArguments("").WithLocation(19, 16), // (20,9): error CS1061: '(int, string)' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type '(int, string)' could be found (are you missing a using directive or an assembly reference?) @@ -12695,7 +12695,7 @@ public TestAttribute((int, string) val) // (36,14): error CS8207: Cannot implicitly convert tuple expression to 'int' // V3 = ("15", "15"), Diagnostic(ErrorCode.Unknown, @"(""15"", ""15"")").WithArguments("int").WithLocation(36, 14), - // (41,28): error CS8206: Type of the tuple element cannot be infered from ''. + // (41,28): error CS8129: Type of the tuple element cannot be infered from ''. // var x = (16, (16 , null)); Diagnostic(ErrorCode.Unknown, "null").WithArguments("").WithLocation(41, 28), // (44,17): error CS8207: Cannot implicitly convert tuple expression to 'TypedReference' @@ -14253,7 +14253,7 @@ public ValueTuple(T1 item1, T2 item2) var comp = CreateCompilationWithMscorlib(source, assemblyName: "ImplicitConversions06Err"); comp.VerifyEmitDiagnostics( - // (7,26): error CS8205: Member 'Item2' was not found on type 'ValueTuple' from assembly 'ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (7,26): error CS8128: Member 'Item2' was not found on type 'ValueTuple' from assembly 'ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // (long, long) y = x; Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "x").WithArguments("Item2", "System.ValueTuple", "ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 26) ); @@ -14293,7 +14293,7 @@ public ValueTuple(T1 item1, T2 item2) var comp = CreateCompilationWithMscorlib(source, assemblyName: "ImplicitConversions06Err"); comp.VerifyEmitDiagnostics( - // (7,26): error CS8205: Member 'Item2' was not found on type 'ValueTuple' from assembly 'ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. + // (7,26): error CS8128: Member 'Item2' was not found on type 'ValueTuple' from assembly 'ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // (byte, byte) y = ((byte, byte))x; Diagnostic(ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, "((byte, byte))x").WithArguments("Item2", "System.ValueTuple", "ImplicitConversions06Err, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(7, 26) ); @@ -15305,19 +15305,19 @@ public class Derived : Base "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef, SystemCoreRef }); comp.VerifyDiagnostics( - // (14,42): error CS8218: 'Derived.M2()': cannot change tuple element names when overriding inherited member 'Base.M2()' + // (14,42): error CS8139: 'Derived.M2()': cannot change tuple element names when overriding inherited member 'Base.M2()' // public override (int notA, int notB) M2() { return (1, 2); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M2").WithArguments("Derived.M2()", "Base.M2()").WithLocation(14, 42), - // (15,44): error CS8218: 'Derived.M3()': cannot change tuple element names when overriding inherited member 'Base.M3()' + // (15,44): error CS8139: 'Derived.M3()': cannot change tuple element names when overriding inherited member 'Base.M3()' // public override (int notA, int notB)[] M3() { return new[] { (1, 2) }; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M3").WithArguments("Derived.M3()", "Base.M3()").WithLocation(15, 44), - // (16,59): error CS8218: 'Derived.M4()': cannot change tuple element names when overriding inherited member 'Base.M4()' + // (16,59): error CS8139: 'Derived.M4()': cannot change tuple element names when overriding inherited member 'Base.M4()' // public override System.Nullable<(int notA, int notB)> M4() { return (1, 2); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M4").WithArguments("Derived.M4()", "Base.M4()").WithLocation(16, 59), - // (17,53): error CS8218: 'Derived.M5()': cannot change tuple element names when overriding inherited member 'Base.M5()' + // (17,53): error CS8139: 'Derived.M5()': cannot change tuple element names when overriding inherited member 'Base.M5()' // public override ((int notA, int notB) c, int d) M5() { return ((1, 2), 3); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M5").WithArguments("Derived.M5()", "Base.M5()").WithLocation(17, 53), - // (18,45): error CS8218: 'Derived.M6()': cannot change tuple element names when overriding inherited member 'Base.M6()' + // (18,45): error CS8139: 'Derived.M6()': cannot change tuple element names when overriding inherited member 'Base.M6()' // public override (dynamic notA, dynamic) M6() { return (1, 2); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M6").WithArguments("Derived.M6()", "Base.M6()").WithLocation(18, 45) ); @@ -15344,16 +15344,16 @@ public class Derived : Base "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (12,26): error CS8218: 'Derived.M2((int notA, int notB)[])': cannot change tuple element names when overriding inherited member 'Base.M2((int a, int b)[])' + // (12,26): error CS8139: 'Derived.M2((int notA, int notB)[])': cannot change tuple element names when overriding inherited member 'Base.M2((int a, int b)[])' // public override void M2((int notA, int notB)[] x) { } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M2").WithArguments("Derived.M2((int notA, int notB)[])", "Base.M2((int a, int b)[])").WithLocation(12, 26), - // (13,26): error CS8218: 'Derived.M3((int notA, int notB)?)': cannot change tuple element names when overriding inherited member 'Base.M3((int a, int b)?)' + // (13,26): error CS8139: 'Derived.M3((int notA, int notB)?)': cannot change tuple element names when overriding inherited member 'Base.M3((int a, int b)?)' // public override void M3(System.Nullable<(int notA, int notB)> x) { } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M3").WithArguments("Derived.M3((int notA, int notB)?)", "Base.M3((int a, int b)?)").WithLocation(13, 26), - // (14,26): error CS8218: 'Derived.M4(((int notA, int notB) c, int d))': cannot change tuple element names when overriding inherited member 'Base.M4(((int a, int b) c, int d))' + // (14,26): error CS8139: 'Derived.M4(((int notA, int notB) c, int d))': cannot change tuple element names when overriding inherited member 'Base.M4(((int a, int b) c, int d))' // public override void M4(((int notA, int notB) c, int d) x) { } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M4").WithArguments("Derived.M4(((int notA, int notB) c, int d))", "Base.M4(((int a, int b) c, int d))").WithLocation(14, 26), - // (11,26): error CS8218: 'Derived.M1((int notA, int notB))': cannot change tuple element names when overriding inherited member 'Base.M1((int a, int b))' + // (11,26): error CS8139: 'Derived.M1((int notA, int notB))': cannot change tuple element names when overriding inherited member 'Base.M1((int a, int b))' // public override void M1((int notA, int notB) y) { } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M1").WithArguments("Derived.M1((int notA, int notB))", "Base.M1((int a, int b))").WithLocation(11, 26) ); @@ -15380,40 +15380,40 @@ public class Derived : Base "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (12,44): error CS8218: 'Derived.P2': cannot change tuple element names when overriding inherited member 'Base.P2' + // (12,44): error CS8139: 'Derived.P2': cannot change tuple element names when overriding inherited member 'Base.P2' // public override (int notA, int notB)[] P2 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "P2").WithArguments("Derived.P2", "Base.P2").WithLocation(12, 44), - // (12,49): error CS8218: 'Derived.P2.get': cannot change tuple element names when overriding inherited member 'Base.P2.get' + // (12,49): error CS8139: 'Derived.P2.get': cannot change tuple element names when overriding inherited member 'Base.P2.get' // public override (int notA, int notB)[] P2 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "get").WithArguments("Derived.P2.get", "Base.P2.get").WithLocation(12, 49), - // (12,54): error CS8218: 'Derived.P2.set': cannot change tuple element names when overriding inherited member 'Base.P2.set' + // (12,54): error CS8139: 'Derived.P2.set': cannot change tuple element names when overriding inherited member 'Base.P2.set' // public override (int notA, int notB)[] P2 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "set").WithArguments("Derived.P2.set", "Base.P2.set").WithLocation(12, 54), - // (13,43): error CS8218: 'Derived.P3': cannot change tuple element names when overriding inherited member 'Base.P3' + // (13,43): error CS8139: 'Derived.P3': cannot change tuple element names when overriding inherited member 'Base.P3' // public override (int notA, int notB)? P3 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "P3").WithArguments("Derived.P3", "Base.P3").WithLocation(13, 43), - // (13,48): error CS8218: 'Derived.P3.get': cannot change tuple element names when overriding inherited member 'Base.P3.get' + // (13,48): error CS8139: 'Derived.P3.get': cannot change tuple element names when overriding inherited member 'Base.P3.get' // public override (int notA, int notB)? P3 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "get").WithArguments("Derived.P3.get", "Base.P3.get").WithLocation(13, 48), - // (13,71): error CS8218: 'Derived.P3.set': cannot change tuple element names when overriding inherited member 'Base.P3.set' + // (13,71): error CS8139: 'Derived.P3.set': cannot change tuple element names when overriding inherited member 'Base.P3.set' // public override (int notA, int notB)? P3 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "set").WithArguments("Derived.P3.set", "Base.P3.set").WithLocation(13, 71), - // (14,53): error CS8218: 'Derived.P4': cannot change tuple element names when overriding inherited member 'Base.P4' + // (14,53): error CS8139: 'Derived.P4': cannot change tuple element names when overriding inherited member 'Base.P4' // public override ((int notA, int notB) c, int d) P4 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "P4").WithArguments("Derived.P4", "Base.P4").WithLocation(14, 53), - // (14,58): error CS8218: 'Derived.P4.get': cannot change tuple element names when overriding inherited member 'Base.P4.get' + // (14,58): error CS8139: 'Derived.P4.get': cannot change tuple element names when overriding inherited member 'Base.P4.get' // public override ((int notA, int notB) c, int d) P4 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "get").WithArguments("Derived.P4.get", "Base.P4.get").WithLocation(14, 58), - // (14,63): error CS8218: 'Derived.P4.set': cannot change tuple element names when overriding inherited member 'Base.P4.set' + // (14,63): error CS8139: 'Derived.P4.set': cannot change tuple element names when overriding inherited member 'Base.P4.set' // public override ((int notA, int notB) c, int d) P4 { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "set").WithArguments("Derived.P4.set", "Base.P4.set").WithLocation(14, 63), - // (11,42): error CS8218: 'Derived.P1': cannot change tuple element names when overriding inherited member 'Base.P1' + // (11,42): error CS8139: 'Derived.P1': cannot change tuple element names when overriding inherited member 'Base.P1' // public override (int notA, int notB) P1 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "P1").WithArguments("Derived.P1", "Base.P1").WithLocation(11, 42), - // (11,47): error CS8218: 'Derived.P1.get': cannot change tuple element names when overriding inherited member 'Base.P1.get' + // (11,47): error CS8139: 'Derived.P1.get': cannot change tuple element names when overriding inherited member 'Base.P1.get' // public override (int notA, int notB) P1 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "get").WithArguments("Derived.P1.get", "Base.P1.get").WithLocation(11, 47), - // (11,70): error CS8218: 'Derived.P1.set': cannot change tuple element names when overriding inherited member 'Base.P1.set' + // (11,70): error CS8139: 'Derived.P1.set': cannot change tuple element names when overriding inherited member 'Base.P1.set' // public override (int notA, int notB) P1 { get { return (1, 2); } set { } } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "set").WithArguments("Derived.P1.set", "Base.P1.set").WithLocation(11, 70) ); @@ -15445,31 +15445,31 @@ public class Derived : Base "; var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); comp.VerifyDiagnostics( - // (15,54): error CS8218: 'Derived.E2': cannot change tuple element names when overriding inherited member 'Base.E2' + // (15,54): error CS8139: 'Derived.E2': cannot change tuple element names when overriding inherited member 'Base.E2' // public override event Func<(int notA, int notB)> E2; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E2").WithArguments("Derived.E2", "Base.E2").WithLocation(15, 54), - // (15,54): error CS8218: 'Derived.E2.add': cannot change tuple element names when overriding inherited member 'Base.E2.add' + // (15,54): error CS8139: 'Derived.E2.add': cannot change tuple element names when overriding inherited member 'Base.E2.add' // public override event Func<(int notA, int notB)> E2; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E2").WithArguments("Derived.E2.add", "Base.E2.add").WithLocation(15, 54), - // (15,54): error CS8218: 'Derived.E2.remove': cannot change tuple element names when overriding inherited member 'Base.E2.remove' + // (15,54): error CS8139: 'Derived.E2.remove': cannot change tuple element names when overriding inherited member 'Base.E2.remove' // public override event Func<(int notA, int notB)> E2; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E2").WithArguments("Derived.E2.remove", "Base.E2.remove").WithLocation(15, 54), - // (16,56): error CS8218: 'Derived.E3': cannot change tuple element names when overriding inherited member 'Base.E3' + // (16,56): error CS8139: 'Derived.E3': cannot change tuple element names when overriding inherited member 'Base.E3' // public override event Func<(int notA, int notB)[]> E3; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E3").WithArguments("Derived.E3", "Base.E3").WithLocation(16, 56), - // (16,56): error CS8218: 'Derived.E3.add': cannot change tuple element names when overriding inherited member 'Base.E3.add' + // (16,56): error CS8139: 'Derived.E3.add': cannot change tuple element names when overriding inherited member 'Base.E3.add' // public override event Func<(int notA, int notB)[]> E3; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E3").WithArguments("Derived.E3.add", "Base.E3.add").WithLocation(16, 56), - // (16,56): error CS8218: 'Derived.E3.remove': cannot change tuple element names when overriding inherited member 'Base.E3.remove' + // (16,56): error CS8139: 'Derived.E3.remove': cannot change tuple element names when overriding inherited member 'Base.E3.remove' // public override event Func<(int notA, int notB)[]> E3; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E3").WithArguments("Derived.E3.remove", "Base.E3.remove").WithLocation(16, 56), - // (17,60): error CS8218: 'Derived.E4': cannot change tuple element names when overriding inherited member 'Base.E4' + // (17,60): error CS8139: 'Derived.E4': cannot change tuple element names when overriding inherited member 'Base.E4' // public override event Func<((int notA, int) c, int d)> E4; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E4").WithArguments("Derived.E4", "Base.E4").WithLocation(17, 60), - // (17,60): error CS8218: 'Derived.E4.add': cannot change tuple element names when overriding inherited member 'Base.E4.add' + // (17,60): error CS8139: 'Derived.E4.add': cannot change tuple element names when overriding inherited member 'Base.E4.add' // public override event Func<((int notA, int) c, int d)> E4; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E4").WithArguments("Derived.E4.add", "Base.E4.add").WithLocation(17, 60), - // (17,60): error CS8218: 'Derived.E4.remove': cannot change tuple element names when overriding inherited member 'Base.E4.remove' + // (17,60): error CS8139: 'Derived.E4.remove': cannot change tuple element names when overriding inherited member 'Base.E4.remove' // public override event Func<((int notA, int) c, int d)> E4; Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "E4").WithArguments("Derived.E4.remove", "Base.E4.remove").WithLocation(17, 60) ); @@ -15610,16 +15610,16 @@ public class C : I0 var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (12,13): error CS8220: The tuple element names in the signature of method 'C.M2((int notA, int notB))' must match the tuple element names of interface method 'I0.M2((int a, int b))' (including on the return type). + // (12,13): error CS8141: The tuple element names in the signature of method 'C.M2((int notA, int notB))' must match the tuple element names of interface method 'I0.M2((int a, int b))' (including on the return type). // void I0.M2((int notA, int notB) z) { } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M2").WithArguments("C.M2((int notA, int notB))", "I0.M2((int a, int b))").WithLocation(12, 13), - // (13,32): error CS8220: The tuple element names in the signature of method 'C.MR1()' must match the tuple element names of interface method 'I0.MR1()' (including on the return type). + // (13,32): error CS8141: The tuple element names in the signature of method 'C.MR1()' must match the tuple element names of interface method 'I0.MR1()' (including on the return type). // (int notMissing, int b) I0.MR1() { return (1, 2); } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "MR1").WithArguments("C.MR1()", "I0.MR1()").WithLocation(13, 32), - // (14,29): error CS8220: The tuple element names in the signature of method 'C.MR2()' must match the tuple element names of interface method 'I0.MR2()' (including on the return type). + // (14,29): error CS8141: The tuple element names in the signature of method 'C.MR2()' must match the tuple element names of interface method 'I0.MR2()' (including on the return type). // (int notA, int notB) I0.MR2() { return (1, 2); } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "MR2").WithArguments("C.MR2()", "I0.MR2()").WithLocation(14, 29), - // (11,13): error CS8220: The tuple element names in the signature of method 'C.M1((int notMissing, int b))' must match the tuple element names of interface method 'I0.M1((int, int b))' (including on the return type). + // (11,13): error CS8141: The tuple element names in the signature of method 'C.M1((int notMissing, int b))' must match the tuple element names of interface method 'I0.M1((int, int b))' (including on the return type). // void I0.M1((int notMissing, int b) z) { } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M1").WithArguments("C.M1((int notMissing, int b))", "I0.M1((int, int b))").WithLocation(11, 13), // (9,18): error CS0535: 'C' does not implement interface member 'I0.MR2()' @@ -15721,7 +15721,7 @@ public class C3 : I0, I0 { } // (4,39): error CS0528: 'I0<(int a, int b)>' is already listed in interface list // public class C2 : I0<(int a, int b)>, I0<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceInBaseList, "I0<(int a, int b)>").WithArguments("I0<(int a, int b)>").WithLocation(4, 39), - // (3,14): error CS8219: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C1' with different tuple element names, as 'I0<(int a, int b)>'. + // (3,14): error CS8140: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C1' with different tuple element names, as 'I0<(int a, int b)>'. // public class C1 : I0<(int a, int b)>, I0<(int notA, int notB)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C1").WithArguments("I0<(int notA, int notB)>", "I0<(int a, int b)>", "C1").WithLocation(3, 14) ); @@ -15749,10 +15749,10 @@ public class D : I0<(int a, int b)> "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (10,17): error CS8220: The tuple element names in the signature of method 'C.set((int notA, int notB))' must match the tuple element names of interface method 'I0<(int a, int b)>.set((int a, int b))'. + // (10,17): error CS8141: The tuple element names in the signature of method 'C.set((int notA, int notB))' must match the tuple element names of interface method 'I0<(int a, int b)>.set((int a, int b))'. // public void set((int notA, int notB) y) { } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "set").WithArguments("C.set((int notA, int notB))", "I0<(int a, int b)>.set((int a, int b))").WithLocation(10, 17), - // (9,33): error CS8220: The tuple element names in the signature of method 'C.get()' must match the tuple element names of interface method 'I0<(int a, int b)>.get()'. + // (9,33): error CS8141: The tuple element names in the signature of method 'C.get()' must match the tuple element names of interface method 'I0<(int a, int b)>.get()'. // public (int notA, int notB) get() { return (1, 2); } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "get").WithArguments("C.get()", "I0<(int a, int b)>.get()").WithLocation(9, 33) ); @@ -15790,10 +15790,10 @@ public class D2 : D1, I0<(int notA, int notB)> "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (20,17): error CS8220: The tuple element names in the signature of method 'D1.set((int notA, int notB))' must match the tuple element names of interface method 'I0<(int a, int b)>.set((int a, int b))' (including on the return type). + // (20,17): error CS8141: The tuple element names in the signature of method 'D1.set((int notA, int notB))' must match the tuple element names of interface method 'I0<(int a, int b)>.set((int a, int b))' (including on the return type). // public void set((int notA, int notB) y) { } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "set").WithArguments("D1.set((int notA, int notB))", "I0<(int a, int b)>.set((int a, int b))").WithLocation(20, 17), - // (19,33): error CS8220: The tuple element names in the signature of method 'D1.get()' must match the tuple element names of interface method 'I0<(int a, int b)>.get()' (including on the return type). + // (19,33): error CS8141: The tuple element names in the signature of method 'D1.get()' must match the tuple element names of interface method 'I0<(int a, int b)>.get()' (including on the return type). // public (int notA, int notB) get() { return (1, 2); } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "get").WithArguments("D1.get()", "I0<(int a, int b)>.get()").WithLocation(19, 33), // (25,10): error CS0540: 'D2.I0<(int a, int b)>.set((int a, int b))': containing type does not implement interface 'I0<(int a, int b)>' @@ -15824,10 +15824,10 @@ public partial class C "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (4,18): error CS8221: Both partial method declarations, 'C.M1((int a, int b))' and 'C.M1((int notA, int notB))', must use the same tuple element names. + // (4,18): error CS8142: Both partial method declarations, 'C.M1((int a, int b))' and 'C.M1((int notA, int notB))', must use the same tuple element names. // partial void M1((int a, int b) x); Diagnostic(ErrorCode.ERR_PartialMethodInconsistentTupleNames, "M1").WithArguments("C.M1((int a, int b))", "C.M1((int notA, int notB))").WithLocation(4, 18), - // (5,18): error CS8221: Both partial method declarations, 'C.M2((int a, int b))' and 'C.M2((int, int))', must use the same tuple element names. + // (5,18): error CS8142: Both partial method declarations, 'C.M2((int a, int b))' and 'C.M2((int, int))', must use the same tuple element names. // partial void M2((int a, int b) x); Diagnostic(ErrorCode.ERR_PartialMethodInconsistentTupleNames, "M2").WithArguments("C.M2((int a, int b))", "C.M2((int, int))").WithLocation(5, 18) ); @@ -15847,10 +15847,10 @@ public partial class D : I0<(int a, int b)> { } "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (3,22): error CS8219: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. + // (3,22): error CS8140: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. // public partial class C : I0<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C").WithArguments("I0<(int notA, int notB)>", "I0<(int a, int b)>", "C").WithLocation(3, 22), - // (3,22): error CS8219: 'I0<(int, int)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. + // (3,22): error CS8140: 'I0<(int, int)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. // public partial class C : I0<(int a, int b)> { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C").WithArguments("I0<(int, int)>", "I0<(int a, int b)>", "C").WithLocation(3, 22) ); @@ -15893,7 +15893,7 @@ public class D : I1, I3 { } "; var comp = CreateCompilationWithMscorlib(source, references: s_valueTupleRefs); comp.VerifyDiagnostics( - // (7,14): error CS8219: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. + // (7,14): error CS8140: 'I0<(int notA, int notB)>' is already listed in the interface list on type 'C' with different tuple element names, as 'I0<(int a, int b)>'. // public class C : I1, I2 { } Diagnostic(ErrorCode.ERR_DuplicateInterfaceWithTupleNamesInBaseList, "C").WithArguments("I0<(int notA, int notB)>", "I0<(int a, int b)>", "C").WithLocation(7, 14) ); @@ -16077,7 +16077,7 @@ public class C : Base2 options: TestOptions.DebugDll); compDifferent1.VerifyDiagnostics( - // (4,36): error CS8218: 'C.M()': cannot change tuple element names when overriding inherited member 'Base2.M()' + // (4,36): error CS8139: 'C.M()': cannot change tuple element names when overriding inherited member 'Base2.M()' // public override (int a, int b) M() { return (1, 2); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("C.M()", "Base2.M()").WithLocation(4, 36) ); @@ -16093,7 +16093,7 @@ public class C : Base2 options: TestOptions.DebugDll); compDifferent2.VerifyDiagnostics( - // (4,32): error CS8218: 'C.M()': cannot change tuple element names when overriding inherited member 'Base2.M()' + // (4,32): error CS8139: 'C.M()': cannot change tuple element names when overriding inherited member 'Base2.M()' // public override (int, int) M() { return (1, 2); } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("C.M()", "Base2.M()").WithLocation(4, 32) ); diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/CustomModifierCopyTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/CustomModifierCopyTests.cs index b3b8e18bc95..c246a004b1b 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/CustomModifierCopyTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/CustomModifierCopyTests.cs @@ -876,7 +876,7 @@ class C : I "; var comp2 = CreateCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); comp2.VerifyDiagnostics( - // (4,28): error CS8220: The tuple element names in the signature of method 'C.M((object, object))' must match the tuple element names of interface method 'I.M((object c, object d))' (including on the return type). + // (4,28): error CS8141: The tuple element names in the signature of method 'C.M((object, object))' must match the tuple element names of interface method 'I.M((object c, object d))' (including on the return type). // (object a, object b) I.M((object, object) x) { return x; } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M").WithArguments("C.M((object, object))", "I.M((object c, object d))").WithLocation(4, 28), // (2,11): error CS0535: 'C' does not implement interface member 'I.M((object c, object d))' @@ -898,7 +898,7 @@ class C : I "; var comp3 = CreateCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); comp3.VerifyDiagnostics( - // (4,24): error CS8220: The tuple element names in the signature of method 'C.M((object c, object d))' must match the tuple element names of interface method 'I.M((object c, object d))' (including on the return type). + // (4,24): error CS8141: The tuple element names in the signature of method 'C.M((object c, object d))' must match the tuple element names of interface method 'I.M((object c, object d))' (including on the return type). // (object, object) I.M((object c, object d) x) { return x; } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "M").WithArguments("C.M((object c, object d))", "I.M((object c, object d))").WithLocation(4, 24), // (2,11): error CS0535: 'C' does not implement interface member 'I.M((object c, object d))' @@ -994,7 +994,7 @@ class C : I "; var comp2 = CreateCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); comp2.VerifyDiagnostics( - // (4,24): error CS8220: The tuple element names in the signature of method 'C.P' must match the tuple element names of interface method 'I.P' (including on the return type). + // (4,24): error CS8141: The tuple element names in the signature of method 'C.P' must match the tuple element names of interface method 'I.P' (including on the return type). // (object, object) I.P { get; set; } Diagnostic(ErrorCode.ERR_ImplBadTupleNames, "P").WithArguments("C.P", "I.P").WithLocation(4, 24), // (2,11): error CS0535: 'C' does not implement interface member 'I.P' @@ -1161,16 +1161,16 @@ class C : Base "; var comp2 = CreateCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); comp2.VerifyDiagnostics( - // (5,38): error CS8218: 'C.M((object c, object d))': cannot change tuple element names when overriding inherited member 'Base.M((object c, object d))' + // (5,38): error CS8139: 'C.M((object c, object d))': cannot change tuple element names when overriding inherited member 'Base.M((object c, object d))' // public override (object, object) M((object c, object d) y) { return y; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("C.M((object c, object d))", "Base.M((object c, object d))").WithLocation(5, 38), - // (4,38): error CS8218: 'C.P': cannot change tuple element names when overriding inherited member 'Base.P' + // (4,38): error CS8139: 'C.P': cannot change tuple element names when overriding inherited member 'Base.P' // public override (object, object) P { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "P").WithArguments("C.P", "Base.P").WithLocation(4, 38), - // (4,42): error CS8218: 'C.P.get': cannot change tuple element names when overriding inherited member 'Base.P.get' + // (4,42): error CS8139: 'C.P.get': cannot change tuple element names when overriding inherited member 'Base.P.get' // public override (object, object) P { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "get").WithArguments("C.P.get", "Base.P.get").WithLocation(4, 42), - // (4,47): error CS8218: 'C.P.set': cannot change tuple element names when overriding inherited member 'Base.P.set' + // (4,47): error CS8139: 'C.P.set': cannot change tuple element names when overriding inherited member 'Base.P.set' // public override (object, object) P { get; set; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "set").WithArguments("C.P.set", "Base.P.set").WithLocation(4, 47) ); @@ -1196,7 +1196,7 @@ class C : Base "; var comp3 = CreateCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); comp3.VerifyDiagnostics( - // (5,42): error CS8218: 'C.M((object, object))': cannot change tuple element names when overriding inherited member 'Base.M((object c, object d))' + // (5,42): error CS8139: 'C.M((object, object))': cannot change tuple element names when overriding inherited member 'Base.M((object c, object d))' // public override (object a, object b) M((object, object) y) { return y; } Diagnostic(ErrorCode.ERR_CantChangeTupleNamesOnOverride, "M").WithArguments("C.M((object, object))", "Base.M((object c, object d))").WithLocation(5, 42) ); diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/FieldTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/FieldTests.cs index d0ec32e6f5b..65479030b1a 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/FieldTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/FieldTests.cs @@ -289,7 +289,7 @@ class A // (5,37): error CS1002: ; expected // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_SemicolonExpected, "const").WithLocation(5, 37), - // (5,43): error CS8200: Tuple must contain at least two elements. + // (5,43): error CS8124: Tuple must contain at least two elements. // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 43), // (5,46): error CS1001: Identifier expected @@ -313,7 +313,7 @@ class A // (5,46): error CS0102: The type 'A' already contains a definition for '' // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "").WithArguments("A", "").WithLocation(5, 46), - // (5,43): error CS8200: Tuple must contain at least two elements. + // (5,43): error CS8124: Tuple must contain at least two elements. // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 43), // (5,23): error CS0670: Field cannot have void type @@ -354,7 +354,7 @@ class A // (5,37): error CS1002: ; expected // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_SemicolonExpected, "const").WithLocation(5, 37), - // (5,43): error CS8200: Tuple must contain at least two elements. + // (5,43): error CS8124: Tuple must contain at least two elements. // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 43), // (5,43): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. @@ -381,7 +381,7 @@ class A // (5,46): error CS0102: The type 'A' already contains a definition for '' // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "").WithArguments("A", "").WithLocation(5, 46), - // (5,43): error CS8200: Tuple must contain at least two elements. + // (5,43): error CS8124: Tuple must contain at least two elements. // protected virtual void Finalize const () { } Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 43), // (5,23): error CS0670: Field cannot have void type diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/SymbolErrorTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/SymbolErrorTests.cs index 14329e17cb2..547e431e148 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/SymbolErrorTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/SymbolErrorTests.cs @@ -1053,7 +1053,7 @@ class C // (5,15): error CS1003: Syntax error, ',' expected // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_SyntaxError, "(").WithArguments(",", "(").WithLocation(5, 15), - // (5,15): error CS8200: Tuple must contain at least two elements. + // (5,15): error CS8124: Tuple must contain at least two elements. // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 15), // (5,18): error CS1001: Identifier expected @@ -1062,7 +1062,7 @@ class C // (5,18): error CS1026: ) expected // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_CloseParenExpected, "{").WithLocation(5, 18), - // (5,15): error CS8200: Tuple must contain at least two elements. + // (5,15): error CS8124: Tuple must contain at least two elements. // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 15), // (5,9): error CS0161: 'C.F<>(int, ?)': not all code paths return a value @@ -1104,7 +1104,7 @@ class C // (5,15): error CS1003: Syntax error, ',' expected // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_SyntaxError, "(").WithArguments(",", "(").WithLocation(5, 15), - // (5,15): error CS8200: Tuple must contain at least two elements. + // (5,15): error CS8124: Tuple must contain at least two elements. // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 15), // (5,15): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. @@ -1116,7 +1116,7 @@ class C // (5,18): error CS1026: ) expected // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_CloseParenExpected, "{").WithLocation(5, 18), - // (5,15): error CS8200: Tuple must contain at least two elements. + // (5,15): error CS8124: Tuple must contain at least two elements. // int F() { } // CS0081 Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(5, 15), // (5,9): error CS0161: 'C.F<>(int, ?)': not all code paths return a value diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs index 877624f5396..3da49e9b6be 100644 --- a/src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs @@ -2111,7 +2111,7 @@ public static void Main() // (8,21): error CS1002: ; expected // e = new this; // CS1031, not a type Diagnostic(ErrorCode.ERR_SemicolonExpected, "this").WithLocation(8, 21), - // (9,21): error CS8200: Tuple must contain at least two elements. + // (9,21): error CS8124: Tuple must contain at least two elements. // e = new (); // CS1031, not a type Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(9, 21), // (9,21): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. @@ -2248,7 +2248,7 @@ public static A operator () // (4,32): error CS1041: Identifier expected; 'operator' is a keyword // public static int explicit operator () Diagnostic(ErrorCode.ERR_IdentifierExpectedKW, "operator").WithArguments("", "operator").WithLocation(4, 32), - // (4,41): error CS8200: Tuple must contain at least two elements. + // (4,41): error CS8124: Tuple must contain at least two elements. // public static int explicit operator () Diagnostic(ErrorCode.ERR_TupleTooFewElements, "()").WithLocation(4, 41), // (4,41): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. @@ -3628,7 +3628,7 @@ public static int Main () // (3,32): error CS1041: Identifier expected; 'operator' is a keyword // public static int implicit operator (foo f) { return 6; } // Error Diagnostic(ErrorCode.ERR_IdentifierExpectedKW, "operator").WithArguments("", "operator").WithLocation(3, 32), - // (3,41): error CS8200: Tuple must contain at least two elements. + // (3,41): error CS8124: Tuple must contain at least two elements. // public static int implicit operator (foo f) { return 6; } // Error Diagnostic(ErrorCode.ERR_TupleTooFewElements, "(foo f)").WithLocation(3, 41), // (3,41): error CS8059: Feature 'tuples' is not available in C# 6. Please use language version 7 or greater. -- GitLab