89 references to ERR_AttributeOnBadSymbolType
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
983
or ErrorCode.
ERR_AttributeOnBadSymbolType
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1218
diagnostics.Add(ErrorCode.
ERR_AttributeOnBadSymbolType
, arguments.AttributeSyntaxOpt.Name.Location, arguments.AttributeSyntaxOpt.GetErrorDisplayName(), "struct");
Symbols\Symbol_Attributes.cs (1)
922
diagnostics.Add(ErrorCode.
ERR_AttributeOnBadSymbolType
, node.Name.Location, node.GetErrorDisplayName(), attributeUsageInfo.GetValidTargetsErrorArgument());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
Attributes\AttributeTests.cs (18)
2507
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(10, 13),
2510
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(7, 13)
2539
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassAllowed").WithArguments("ClassAllowed", "class").WithLocation(14, 13),
2542
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassAllowed").WithArguments("ClassAllowed", "class").WithLocation(10, 13)
2572
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "property, indexer").WithLocation(13, 13),
6004
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Derived").WithArguments("Derived", "struct, method, parameter").WithLocation(7, 6),
6211
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "AttributeUsage").WithArguments("AttributeUsage", "class").WithLocation(4, 6),
6214
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "AttributeUsage").WithArguments("AttributeUsage", "class").WithLocation(6, 6),
6385
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "class").WithLocation(2, 10),
6387
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(1, 10));
6414
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "class").WithLocation(11, 12),
6417
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(1, 13));
6445
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "struct").WithLocation(10, 2),
6447
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(14, 2));
6475
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "struct").WithLocation(11, 20),
6478
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "B").WithArguments("B", "method").WithLocation(14, 20));
6531
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "A").WithArguments("A", "assembly, module, struct, enum, constructor, method, property, indexer, field, event, interface, parameter, delegate, return, type parameter")
6547
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Attr").WithArguments("Attr", "assembly"));
Attributes\AttributeTests_Embedded.cs (1)
646
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Embedded").WithArguments("Embedded", "struct, enum, interface, delegate").WithLocation(4, 6)
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_WellKnownAttributes.cs (8)
1474
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Optional").WithArguments("Optional", "class"));
3622
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(9, 6),
3628
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(15, 6),
3631
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(18, 6),
3640
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(31, 2),
3643
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DllImport").WithArguments("DllImport", "method").WithLocation(34, 2));
5410
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ClassInterface").WithArguments("ClassInterface", "assembly, class"));
5489
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "InterfaceType").WithArguments("InterfaceType", "interface"));
Semantics\ExtensionTests.cs (3)
2620
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Obsolete").WithArguments("System.Obsolete", "class, struct, enum, constructor, method, property, indexer, field, event, interface, delegate").WithLocation(3, 6));
2648
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "My").WithArguments("My", "assembly, module, class, struct, enum, constructor, method, property, indexer, field, event, interface, parameter, delegate, return, type parameter").WithLocation(3, 6),
31366
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "ComImport").WithArguments("ComImport", "class, interface").WithLocation(9, 2));
Semantics\InlineArrayTests.cs (4)
689
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.CompilerServices.InlineArray").WithArguments("System.Runtime.CompilerServices.InlineArray", "struct").WithLocation(2, 2)
779
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.CompilerServices.InlineArray").WithArguments("System.Runtime.CompilerServices.InlineArray", "struct").WithLocation(2, 2)
858
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.CompilerServices.InlineArray").WithArguments("System.Runtime.CompilerServices.InlineArray", "struct").WithLocation(2, 2)
964
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.CompilerServices.InlineArray").WithArguments("System.Runtime.CompilerServices.InlineArray", "struct").WithLocation(2, 2),
Semantics\PrimaryConstructorTests.cs (4)
3097
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "C").WithArguments("C", "field").WithLocation(26, 6),
3100
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "D").WithArguments("D", "property, indexer").WithLocation(27, 6)
3143
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "C").WithArguments("C", "field").WithLocation(20, 6)
6811
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.InteropServices.ComImport").WithArguments("System.Runtime.InteropServices.ComImport", "class, interface").WithLocation(4, 2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\LambdaTests.cs (6)
3876
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(23, 14),
3879
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Return").WithArguments("Return", "return").WithLocation(24, 14),
3882
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Prop").WithArguments("Prop", "property, indexer").WithLocation(26, 22),
3885
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Method").WithArguments("Method", "method").WithLocation(28, 22),
3888
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeParam").WithArguments("TypeParam", "type parameter").WithLocation(31, 14));
4817
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)
36623
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "NotNull").WithArguments("NotNull", "property, indexer, field, parameter, return").WithLocation(5, 6)
44372
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 14)
45355
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(4, 30),
45358
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 31)
45376
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(4, 25),
45379
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "DisallowNull").WithArguments("DisallowNull", "property, indexer, field, parameter").WithLocation(5, 26)
Semantics\RecordStructTests.cs (1)
11511
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "System.Runtime.InteropServices.ComImport").WithArguments("System.Runtime.InteropServices.ComImport", "class, interface").WithLocation(2, 2)
Semantics\RefFieldTests.cs (1)
23553
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "UnscopedRef").WithArguments("UnscopedRef", "method, property, indexer, parameter").WithLocation(15, 6),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (26)
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\PartialPropertiesTests.cs (2)
4999
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "UnmanagedCallersOnly").WithArguments("UnmanagedCallersOnly", "method").WithLocation(5, 6),
5002
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "UnmanagedCallersOnly").WithArguments("UnmanagedCallersOnly", "method").WithLocation(10, 6),
Symbols\RequiredMembersTests.cs (1)
7894
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Conditional").WithArguments("Conditional", "class, method").WithLocation(6, 6)
Symbols\SymbolErrorTests.cs (11)
4883
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4885
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4887
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4889
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4891
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
4893
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "IndexerName").WithArguments("IndexerName", "property, indexer"),
11309
new ErrorDescription { Code = (int)ErrorCode.
ERR_AttributeOnBadSymbolType
, Line = 8, Column = 2 });
15061
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "Extension").WithArguments("Extension", "assembly, class, method"),
22061
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(4, 10),
22070
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(7, 2),
22079
Diagnostic(ErrorCode.
ERR_AttributeOnBadSymbolType
, "TypeForwardedTo").WithArguments("TypeForwardedTo", "assembly").WithLocation(9, 6),