提交 46428522 编写于 作者: V VSadov

CR feedback

上级 195e7ad1
......@@ -4015,9 +4015,9 @@ internal class CSharpResources {
/// <summary>
/// Looks up a localized string similar to Cannot reference &apos;System.Runtime.CompilerServices.TupleElementNamesAttribute&apos; explicitly. Use the tuple syntax to define tuple names..
/// </summary>
internal static string ERR_ExplicitTupleElementNames {
internal static string ERR_ExplicitTupleElementNamesAttribute {
get {
return ResourceManager.GetString("ERR_ExplicitTupleElementNames", resourceCulture);
return ResourceManager.GetString("ERR_ExplicitTupleElementNamesAttribute", resourceCulture);
}
}
......
......@@ -4926,7 +4926,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_TupleElementNamesAttributeMissing" xml:space="preserve">
<value>Cannot define a class or member that utilizes tuples because the compiler required type '{0}' cannot be found. Are you missing a reference?</value>
</data>
<data name="ERR_ExplicitTupleElementNames" xml:space="preserve">
<data name="ERR_ExplicitTupleElementNamesAttribute" xml:space="preserve">
<value>Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.</value>
</data>
<data name="ERR_DeconstructCouldNotInferMergedType" xml:space="preserve">
......
......@@ -1379,7 +1379,7 @@ internal enum ErrorCode
ERR_ConversionNotTupleCompatible = 8135,
ERR_DeconstructionVarFormDisallowsSpecificType = 8136,
ERR_TupleElementNamesAttributeMissing = 8137,
ERR_ExplicitTupleElementNames = 8138,
ERR_ExplicitTupleElementNamesAttribute = 8138,
ERR_CantChangeTupleNamesOnOverride = 8139,
ERR_DuplicateInterfaceWithTupleNamesInBaseList = 8140,
ERR_ImplBadTupleNames = 8141,
......
......@@ -625,7 +625,7 @@ internal override void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArgu
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
}
......
......@@ -287,7 +287,7 @@ internal sealed override void DecodeWellKnownAttribute(ref DecodeWellKnownAttrib
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
}
......
......@@ -364,7 +364,7 @@ internal sealed override void DecodeWellKnownAttribute(ref DecodeWellKnownAttrib
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
}
......
......@@ -1223,7 +1223,7 @@ private void DecodeWellKnownAttributeAppliedToReturnValue(ref DecodeWellKnownAtt
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
}
......
......@@ -694,7 +694,7 @@ internal sealed override void DecodeWellKnownAttribute(ref DecodeWellKnownAttrib
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.SecurityCriticalAttribute)
|| attribute.IsTargetAttribute(this, AttributeDescription.SecuritySafeCriticalAttribute))
......
......@@ -1153,7 +1153,7 @@ internal override void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArgu
}
else if (attribute.IsTargetAttribute(this, AttributeDescription.TupleElementNamesAttribute))
{
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location);
arguments.Diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location);
}
}
......
......@@ -813,34 +813,34 @@ public struct S
comp.VerifyDiagnostics(
// (31,2): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new[] { "a", "b" })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(31, 2),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(31, 2),
// (5,2): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new[] { "a", "b" })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(5, 2),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(5, 2),
// (18,10): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new[] { "x" })]ValueTuple<T> args);
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, @"TupleElementNames(new[] { ""x"" })").WithLocation(18, 10),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, @"TupleElementNames(new[] { ""x"" })").WithLocation(18, 10),
// (11,6): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new[] { "x", "y" })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, @"TupleElementNames(new[] { ""x"", ""y"" })").WithLocation(11, 6),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, @"TupleElementNames(new[] { ""x"", ""y"" })").WithLocation(11, 6),
// (14,14): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [return: TupleElementNames(new string[] { null, null })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, "TupleElementNames(new string[] { null, null })").WithLocation(14, 14),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, "TupleElementNames(new string[] { null, null })").WithLocation(14, 14),
// (15,36): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// public ValueTuple<int, int> M([TupleElementNames(new string[] { null})] ValueTuple x) => (0, 0);
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, "TupleElementNames(new string[] { null})").WithLocation(15, 36),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, "TupleElementNames(new string[] { null})").WithLocation(15, 36),
// (20,6): error CS0592: Attribute 'TupleElementNames' is not valid on this declaration type. It is only valid on 'class, struct, property, indexer, field, parameter, return' declarations.
// [TupleElementNames(new[] { "y" })]
Diagnostic(ErrorCode.ERR_AttributeOnBadSymbolType, "TupleElementNames").WithArguments("TupleElementNames", "class, struct, property, indexer, field, parameter, return").WithLocation(20, 6),
// (27,6): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new[] { "a", "b" })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(27, 6),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, @"TupleElementNames(new[] { ""a"", ""b"" })").WithLocation(27, 6),
// (28,33): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// public (int x, int y) this[[TupleElementNames](int a, int b) t] => t;
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, "TupleElementNames").WithLocation(28, 33),
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, "TupleElementNames").WithLocation(28, 33),
// (8,6): error CS8208: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.
// [TupleElementNames(new string[] { null, null })]
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNames, "TupleElementNames(new string[] { null, null })").WithLocation(8, 6));
Diagnostic(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, "TupleElementNames(new string[] { null, null })").WithLocation(8, 6));
}
}
}
......@@ -1703,8 +1703,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_ValueTupleTypeRefResolutionError = 37267
ERR_TupleElementNamesAttributeMissing = 37268
ERR_ExplicitTupleElementNames = 37269
ERR_ExplicitTupleElementNamesAttribute = 37269
'// WARNINGS BEGIN HERE
WRN_UseOfObsoleteSymbol2 = 40000
......
......@@ -645,7 +645,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim attrData = arguments.Attribute
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If attrData.IsTargetAttribute(Me, AttributeDescription.NonSerializedAttribute) Then
......
......@@ -311,7 +311,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Debug.Assert(arguments.SymbolPart = AttributeLocation.None)
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If attrData.IsTargetAttribute(Me, AttributeDescription.SpecialNameAttribute) Then
......
......@@ -1561,7 +1561,7 @@ lReportErrorOnTwoTokens:
Debug.Assert(Not attrData.HasErrors)
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If arguments.SymbolPart = AttributeLocation.Return Then
......
......@@ -1055,7 +1055,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Debug.Assert(arguments.SymbolPart = AttributeLocation.None)
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If attrData.IsTargetAttribute(Me, AttributeDescription.DefaultCharSetAttribute) Then
......
......@@ -2127,7 +2127,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
' If we start caching information about ComVisibleAttribute here, implementation of GetComVisibleState function should be changed accordingly.
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
Dim decoded As Boolean = False
......
......@@ -291,7 +291,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
' - metadata flag set, no diagnostics reported, don't influence language semantics
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If attrData.IsTargetAttribute(Me, AttributeDescription.DefaultParameterValueAttribute) Then
......
......@@ -545,7 +545,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim attrData = arguments.Attribute
If attrData.IsTargetAttribute(Me, AttributeDescription.TupleElementNamesAttribute) Then
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNames, arguments.AttributeSyntaxOpt.Location)
arguments.Diagnostics.Add(ERRID.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location)
End If
If arguments.SymbolPart = AttributeLocation.Return Then
......
......@@ -4460,9 +4460,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
'''<summary>
''' Looks up a localized string similar to Cannot reference &apos;System.Runtime.CompilerServices.TupleElementNamesAttribute&apos; explicitly. Use the tuple syntax to define tuple names..
'''</summary>
Friend ReadOnly Property ERR_ExplicitTupleElementNames() As String
Friend ReadOnly Property ERR_ExplicitTupleElementNamesAttribute() As String
Get
Return ResourceManager.GetString("ERR_ExplicitTupleElementNames", resourceCulture)
Return ResourceManager.GetString("ERR_ExplicitTupleElementNamesAttribute", resourceCulture)
End Get
End Property
......
......@@ -5394,7 +5394,7 @@
<data name="ERR_TupleElementNamesAttributeMissing" xml:space="preserve">
<value>Cannot define a class or member that utilizes tuples because the compiler required type '{0}' cannot be found. Are you missing a reference?</value>
</data>
<data name="ERR_ExplicitTupleElementNames" xml:space="preserve">
<data name="ERR_ExplicitTupleElementNamesAttribute" xml:space="preserve">
<value>Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.</value>
</data>
<data name="ERR_RefReturningCallInExpressionTree" xml:space="preserve">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册