78 references to ERR_AttributeOnBadSymbolType
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
921
case ErrorCode.
ERR_AttributeOnBadSymbolType
:
Symbols\Symbol_Attributes.cs (1)
901
diagnostics.Add(ErrorCode.
ERR_AttributeOnBadSymbolType
, node.Name.Location, node.GetErrorDisplayName(), attributeUsageInfo.GetValidTargetsErrorArgument());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (29)
Attributes\AttributeTests.cs (18)
2469
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(10, 13),
2472
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(7, 13)
2501
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassAllowed").WithArguments("ClassAllowed", "class").WithLocation(14, 13),
2504
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassAllowed").WithArguments("ClassAllowed", "class").WithLocation(10, 13)
2534
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(13, 13),
5706
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Derived").WithArguments("Derived", "struct, method, parameter").WithLocation(7, 6),
5913
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "AttributeUsage").WithArguments("AttributeUsage", "class").WithLocation(4, 6),
5916
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "AttributeUsage").WithArguments("AttributeUsage", "class").WithLocation(6, 6),
6087
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "class").WithLocation(2, 10),
6089
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(1, 10));
6116
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "class").WithLocation(11, 12),
6119
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(1, 13));
6147
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "struct").WithLocation(10, 2),
6149
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(14, 2));
6177
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "struct").WithLocation(11, 20),
6180
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(14, 20));
6233
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "assembly, module, struct, enum, constructor, method, property, indexer, field, event, interface, parameter, delegate, return, type parameter")
6249
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Attr").WithArguments("Attr", "assembly"));
Attributes\AttributeTests_Security.cs (2)
201
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "PrincipalPermission").WithArguments("PrincipalPermission", "class, method").WithLocation(12, 10));
245
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "MySecurityAttribute").WithArguments("MySecurityAttribute", "assembly, class, struct, constructor, method").WithLocation(18, 10));
Attributes\AttributeTests_Tuples.cs (1)
839
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TupleElementNames").WithArguments("TupleElementNames", "class, struct, property, indexer, field, parameter, return").WithLocation(20, 6),
Attributes\AttributeTests_WellKnownAttributes.cs (8)
1473
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Optional").WithArguments("Optional", "class"));
3541
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(9, 6),
3547
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(15, 6),
3550
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(18, 6),
3559
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(31, 2),
3562
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(34, 2));
5321
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassInterface").WithArguments("ClassInterface", "assembly, class"));
5400
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "InterfaceType").WithArguments("InterfaceType", "interface"));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (24)
Semantics\LambdaTests.cs (6)
3861
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(23, 14),
3864
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Return").WithArguments("Return", "return").WithLocation(24, 14),
3867
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(26, 22),
3870
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Method").WithArguments("Method", "method").WithLocation(28, 22),
3873
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeParam").WithArguments("TypeParam", "type parameter").WithLocation(31, 14));
4802
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DoesNotReturn").WithArguments("DoesNotReturn", "method").WithLocation(6, 10),
Semantics\LocalFunctionTests.cs (6)
950
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(22, 10),
953
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Return").WithArguments("Return", "return").WithLocation(23, 10),
956
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(25, 18),
959
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Method").WithArguments("Method", "method").WithLocation(27, 18),
962
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Param").WithArguments("Param", "parameter").WithLocation(29, 14),
965
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeParam").WithArguments("TypeParam", "type parameter").WithLocation(33, 14));
Semantics\NullableReferenceTypesTests.cs (6)
34685
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "NotNull").WithArguments("NotNull", "property, indexer, field, parameter, return").WithLocation(5, 6)
42306
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 14)
43234
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(4, 30),
43237
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 31)
43255
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(4, 25),
43258
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 26)
Semantics\PrimaryConstructorTests.cs (4)
2988
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "C").WithArguments("C", "field").WithLocation(26, 6),
2991
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "D").WithArguments("D", "property, indexer").WithLocation(27, 6)
3034
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "C").WithArguments("C", "field").WithLocation(20, 6)
6195
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.InteropServices.ComImport").WithArguments("System.Runtime.InteropServices.ComImport", "class, interface").WithLocation(4, 2)
Semantics\RecordStructTests.cs (1)
11441
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.InteropServices.ComImport").WithArguments("System.Runtime.InteropServices.ComImport", "class, interface").WithLocation(2, 2)
Semantics\RefFieldTests.cs (1)
22406
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "UnscopedRef").WithArguments("UnscopedRef", "method, property, indexer, parameter").WithLocation(15, 6),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (23)
Symbols\ModuleInitializers\TargetsTests.cs (12)
71
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(10, 10)
120
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(7, 6)
169
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(7, 6)
218
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(7, 6)
280
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(9, 10),
283
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(11, 10)
345
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(9, 10),
348
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(11, 10)
410
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(9, 10),
413
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "class").WithLocation(11, 10)
462
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "method").WithLocation(7, 6)
511
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ModuleInitializer").WithArguments("ModuleInitializer", "method").WithLocation(7, 6)
Symbols\SymbolErrorTests.cs (11)
4807
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4809
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4811
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4813
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4815
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4817
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
11166
new ErrorDescription { Code = (int)ErrorCode.
ERR_AttributeOnBadSymbolType
, Line = 8, Column = 2 });
14913
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Extension").WithArguments("Extension", "assembly, class, method"),
21903
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(4, 10),
21912
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(7, 2),
21921
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(9, 6),