39 overrides of GetAttributes
Microsoft.CodeAnalysis.CSharp (39)
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (1)
53
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (1)
70
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
132
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEEventSymbol.cs (1)
360
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
578
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
948
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEModuleSymbol.cs (1)
240
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
682
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
1012
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
636
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
631
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\ReducedExtensionMethodSymbol.cs (1)
449
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
201
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
156
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
78
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
211
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
276
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
227
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
216
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
71
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
34
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceAssemblySymbol.cs (1)
1586
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceClonedParameterSymbol.cs (1)
108
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceEventSymbol.cs (1)
205
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
308
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceModuleSymbol.cs (1)
483
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceNamedTypeSymbol.cs (1)
860
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceParameterSymbol.cs (1)
199
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourcePropertySymbolBase.cs (1)
1078
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Source\SourceTypeParameterSymbol.cs (1)
165
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\SubstitutedEventSymbol.cs (1)
54
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\SubstitutedFieldSymbol.cs (1)
77
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\SubstitutedMethodSymbol.cs (1)
205
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\SubstitutedNamedTypeSymbol.cs (1)
183
public sealed override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\SubstitutedPropertySymbol.cs (1)
63
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
354
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Tuples\TupleFieldSymbol.cs (1)
133
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
69
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
170
public override ImmutableArray<CSharpAttributeData>
GetAttributes
()
1216 references to GetAttributes
Microsoft.CodeAnalysis.CSharp (43)
Binder\Binder.cs (1)
667
leastOverriddenSymbol.
GetAttributes
();
Compiler\ClsComplianceChecker.cs (4)
335
foreach (CSharpAttributeData attribute in symbol.
GetAttributes
())
581
CheckForAttributeWithArrayArgumentInternal(symbol.
GetAttributes
());
688
if (TryGetClsComplianceAttributeLocation(parameters[i].
GetAttributes
(), parameters[i], out attributeLocation))
1180
foreach (CSharpAttributeData data in symbol.
GetAttributes
())
Emitter\Model\SymbolAdapter.cs (1)
99
userDefined = this.
GetAttributes
();
Emitter\NoPia\EmbeddedEvent.cs (1)
78
foreach (var attrData in underlyingContainingType.
GetAttributes
())
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
541
if (!reportedAttributes && !p.
GetAttributes
().IsEmpty)
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
28
foreach (var attrData in @interface.
GetAttributes
())
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (2)
57
Debug.Assert(base.
GetAttributes
().Length == 0);
63
foreach (var attribute in kickoffType.
GetAttributes
())
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (2)
74
Debug.Assert(base.
GetAttributes
().Length == 0);
80
foreach (var attribute in kickoffMethod.
GetAttributes
())
Lowering\SynthesizedMethodBaseSymbol.cs (1)
165
? BaseMethod.
GetAttributes
()
Symbols\EventSymbol.cs (1)
119
this.AssociatedField.
GetAttributes
();
Symbols\PublicModel\Symbol.cs (1)
122
return StaticCast<AttributeData>.From(UnderlyingSymbol.
GetAttributes
());
Symbols\ReducedExtensionMethodSymbol.cs (1)
451
return _reducedFrom.
GetAttributes
();
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
158
return _underlyingEvent.
GetAttributes
();
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
80
return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingField.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
213
return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingMethod.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
229
return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingType.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingParameterSymbol.cs (1)
63
return this.RetargetingModule.RetargetingTranslator.GetRetargetedAttributes(_underlyingParameter.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
218
return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingProperty.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
344
foreach (var attrData in type.
GetAttributes
())
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
65
return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingTypeParameter.
GetAttributes
(), ref _lazyCustomAttributes);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
533
GetAttributes
();
Symbols\Source\SourceMemberMethodSymbol.cs (1)
771
field.
GetAttributes
();
Symbols\Source\SourceModuleSymbol.cs (1)
309
foreach (var attrData in a.
GetAttributes
())
Symbols\SubstitutedEventSymbol.cs (1)
56
return OriginalDefinition.
GetAttributes
();
Symbols\SubstitutedFieldSymbol.cs (1)
79
return OriginalDefinition.
GetAttributes
();
Symbols\SubstitutedMethodSymbol.cs (1)
207
return this.OriginalDefinition.
GetAttributes
();
Symbols\SubstitutedNamedTypeSymbol.cs (1)
185
return OriginalDefinition.
GetAttributes
();
Symbols\SubstitutedPropertySymbol.cs (1)
65
return OriginalDefinition.
GetAttributes
();
Symbols\Symbol.cs (1)
1302
foreach (var attrData in this.
GetAttributes
())
Symbols\Symbol_Attributes.cs (1)
931
this.
GetAttributes
();
Symbols\SymbolCompletionState.cs (2)
43
/// of <see cref="Symbol.
GetAttributes
"/> will set the part <see cref="CompletionPart.Attributes"/> on
53
_ = symbol.
GetAttributes
();
Symbols\SymbolExtensions.cs (1)
828
foreach (var attr in symbol.
GetAttributes
())
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
49
return _underlyingTypeParameter.
GetAttributes
();
Symbols\Tuples\TupleFieldSymbol.cs (2)
135
return _underlyingField.
GetAttributes
();
326
return _underlyingField.
GetAttributes
();
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
71
return _underlyingParameter.
GetAttributes
();
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
172
return _underlyingTypeParameter.
GetAttributes
();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (87)
CodeGen\CodeGenAsyncIteratorTests.cs (3)
855
GetAttributeNames(method.
GetAttributes
()));
857
var attribute = method.
GetAttributes
().Single();
882
Assert.Empty(GetAttributeNames(method.
GetAttributes
()));
CodeGen\CodeGenDynamicTests.cs (6)
595
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(container.
GetAttributes
()));
608
Assert.Equal(0, field.
GetAttributes
().Length);
653
var attributes = d.
GetAttributes
();
686
Assert.Equal(0, member.
GetAttributes
().Length);
804
Assert.Equal(0, container.GetMembers().Single().
GetAttributes
().Length);
832
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(d.
GetAttributes
()));
CodeGen\CodeGenFunctionPointersTests.cs (15)
5406
string getAttribute(string fieldName) => c.GetField(fieldName).
GetAttributes
().Single().ToString()!;
5462
Assert.Empty(field.
GetAttributes
());
5466
Assert.Equal(expectedAttribute, field.
GetAttributes
().Single().ToString());
5548
Assert.Empty(f.
GetAttributes
());
5552
Assert.Equal(expectedAttribute, f.
GetAttributes
().Single().ToString());
5601
Assert.Equal("System.Runtime.CompilerServices.DynamicAttribute({false, false, false, false, false, true, false, true})", param.
GetAttributes
().Single().ToString());
11618
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
11646
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
11699
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
11756
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
11788
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
12015
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
12148
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
12176
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
12206
var attr = c.
GetAttributes
().Single(d => d.AttributeClass?.Name == "A");
CodeGen\CodeGenLocalFunctionTests.cs (20)
5236
var attrs1 = localFn1.
GetAttributes
();
5246
var attrs3 = localFn3.GetParameters().Single().
GetAttributes
();
5250
var attrs4 = localFn4.TypeParameters.Single().
GetAttributes
();
5285
var attrs = localFn1.
GetAttributes
();
5326
var attrs1 = localFn1.
GetAttributes
();
5359
var attrs1 = localFn1.
GetAttributes
();
5366
Assert.Empty(param.
GetAttributes
());
5393
var attrs1 = localFn1.
GetAttributes
();
5399
Assert.Equal("DynamicAttribute", param.
GetAttributes
().Single().AttributeClass.Name);
5426
var attrs1 = localFn1.
GetAttributes
();
5432
Assert.Empty(param.
GetAttributes
());
5539
var attrs1 = localFn1.
GetAttributes
();
5635
var attrs1 = localFn1.
GetAttributes
();
5638
Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.TypeParameters.Single().
GetAttributes
()));
5639
Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.Parameters.Single().
GetAttributes
()));
5646
var attrs1 = localFn1.
GetAttributes
();
5649
Assert.Empty(localFn1.TypeParameters.Single().
GetAttributes
());
5650
Assert.Empty(localFn1.Parameters.Single().
GetAttributes
());
5760
var attrs1 = localFn1.
GetAttributes
().As<CSharpAttributeData>();
5834
var attrs1 = localFn1.
GetAttributes
().As<CSharpAttributeData>();
CodeGen\CodeGenReadonlyStructTests.cs (1)
912
Assert.Empty(s1.
GetAttributes
());
CodeGen\CodeGenTupleTest.cs (35)
3365
Assert.True(mFirst.
GetAttributes
().IsEmpty);
3383
Assert.True(mItem1.
GetAttributes
().IsEmpty);
4602
Assert.True(mItem1.
GetAttributes
().IsEmpty);
11217
Assert.True(m1Tuple.
GetAttributes
().IsEmpty);
11259
Assert.True(m1Item1.
GetAttributes
().IsEmpty);
11280
Assert.True(m2Item1.
GetAttributes
().IsEmpty);
11301
Assert.True(m2a2.
GetAttributes
().IsEmpty);
11507
Assert.True(m1Tuple.
GetAttributes
().IsEmpty);
11554
Assert.True(m1Item9.
GetAttributes
().IsEmpty);
11569
Assert.True(m2Item9.
GetAttributes
().IsEmpty);
11586
Assert.True(m2i2.
GetAttributes
().IsEmpty);
11788
Assert.True(m3Item8.
GetAttributes
().IsEmpty);
11981
Assert.True(m4Item8.
GetAttributes
().IsEmpty);
12000
Assert.True(m4h4.
GetAttributes
().IsEmpty);
12229
Assert.True(m5Item8.
GetAttributes
().IsEmpty);
12597
Assert.True(m8Item8.
GetAttributes
().IsEmpty);
12617
Assert.True(m8Item1.
GetAttributes
().IsEmpty);
12764
Assert.True(m1Tuple.
GetAttributes
().IsEmpty);
12810
Assert.True(m1Item1.
GetAttributes
().IsEmpty);
12829
Assert.True(m2Item1.
GetAttributes
().IsEmpty);
12848
Assert.True(m2a2.
GetAttributes
().IsEmpty);
12868
Assert.True(m1ToString.
GetAttributes
().IsEmpty);
13209
Assert.Equal("System.ObsoleteAttribute", m10Tuple.
GetAttributes
().Single().ToString());
13223
Assert.Equal("System.ObsoleteAttribute", m10Item1.
GetAttributes
().Single().ToString());
13224
Assert.Equal("System.ObsoleteAttribute", m102Item20.
GetAttributes
().Single().ToString());
13225
Assert.Equal("System.ObsoleteAttribute", m102a.
GetAttributes
().Single().ToString());
13262
Assert.Equal("System.ObsoleteAttribute", m10M2.
GetAttributes
().Single().ToString());
13274
Assert.Equal("System.ObsoleteAttribute", m10P2.
GetAttributes
().Single().ToString());
13286
Assert.Equal("System.ObsoleteAttribute", m10E2.
GetAttributes
().Single().ToString());
15833
Assert.True(m1P1.
GetAttributes
().IsEmpty);
15863
Assert.True(m1this.
GetAttributes
().IsEmpty);
16063
Assert.True(m1E1.
GetAttributes
().IsEmpty);
16094
Assert.True(m1E2.
GetAttributes
().IsEmpty);
29009
Assert.Empty(field.
GetAttributes
());
29013
Assert.Equal(expectedAttribute, field.
GetAttributes
().Single().ToString());
Emit\CompilationEmitTests.cs (4)
2153
compWithReal.SourceModule.GetReferencedAssemblySymbols().Last().
GetAttributes
().Select(a => a.AttributeClass.ToTestDisplayString()));
2184
compWithReal2.SourceModule.GetReferencedAssemblySymbols().Last().
GetAttributes
().Select(a => a.AttributeClass.ToTestDisplayString()));
2211
compWithMetadata.SourceModule.GetReferencedAssemblySymbols().Last().
GetAttributes
().Select(a => a.AttributeClass.ToTestDisplayString()));
2239
compWithRef.SourceModule.GetReferencedAssemblySymbols().Last().
GetAttributes
().Select(a => a.AttributeClass.ToTestDisplayString()));
Emit\EmitMetadataTests.cs (1)
1303
var attribute = backingField.
GetAttributes
().Single();
Emit\NoPiaEmbedTypes.cs (1)
3109
Assert.Equal(0, m1.Parameters[0].
GetAttributes
().Length);
Emit\OptionalArgumentsTests.cs (1)
218
var attributes = parameter.
GetAttributes
();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (565)
Attributes\AttributeTests.cs (181)
489
var attrs = assembly.
GetAttributes
();
588
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
620
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
651
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
683
var attrs = m0.
GetAttributes
();
1023
var attrs = program.
GetAttributes
();
1066
var attrs = program.
GetAttributes
();
1103
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1144
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1184
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1224
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1263
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1304
var attributeData = (SourceAttributeData)program.
GetAttributes
()[0];
1389
var attrs = compilation.Assembly.
GetAttributes
();
1456
var attrs = compilation.SourceModule.GlobalNamespace.GetMember("A").
GetAttributes
();
1480
var attrs = compilation.SourceModule.GlobalNamespace.GetMember("Goo").
GetAttributes
();
1566
var attrs = prop.
GetAttributes
();
1670
var attrs = type.
GetAttributes
();
1676
attrs = prop.GetMethod.
GetAttributes
();
1681
attrs = prop.
GetAttributes
();
1684
attrs = prop.SetMethod.
GetAttributes
();
1766
Assert.Empty(prop1.
GetAttributes
());
1767
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.GetMethod.
GetAttributes
()));
1768
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.SetMethod.
GetAttributes
()));
1771
AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(1)" }), GetAttributeStrings(field1.
GetAttributes
()));
1774
Assert.Empty(prop2.
GetAttributes
());
1775
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.GetMethod.
GetAttributes
()));
1779
AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(2)" }), GetAttributeStrings(field2.
GetAttributes
()));
1782
Assert.Equal("B(3)", prop3.
GetAttributes
().Single().ToString());
1783
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop3.GetMethod.
GetAttributes
()));
1787
AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(33)" }), GetAttributeStrings(field3.
GetAttributes
()));
1790
Assert.Equal("B(4)", prop4.
GetAttributes
().Single().ToString());
1791
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop3.GetMethod.
GetAttributes
()));
1795
AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(44)", "A(444)" }), GetAttributeStrings(field4.
GetAttributes
()));
1820
Assert.Empty(field1.
GetAttributes
());
1828
AssertEx.SetEqual(s_backingFieldAttributes.Concat(dynamicAndTupleNames), GetAttributeStrings(field1.
GetAttributes
()));
1860
Assert.Empty(prop1.
GetAttributes
());
1863
var attributes1 = field1.
GetAttributes
();
1875
Assert.Empty(prop2.
GetAttributes
());
1878
AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.
GetAttributes
()));
1882
var attributes3 = field3.
GetAttributes
();
1922
Assert.Empty(prop1.
GetAttributes
());
1925
var attributes1 = field1.
GetAttributes
();
1937
Assert.Empty(prop2.
GetAttributes
());
1940
AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.
GetAttributes
()));
1944
var attributes3 = field3.
GetAttributes
();
2161
Assert.Empty(prop1.
GetAttributes
());
2165
GetAttributeStrings(field1.
GetAttributes
()));
2168
Assert.Empty(prop2.
GetAttributes
());
2172
GetAttributeStrings(field2.
GetAttributes
()));
2210
Assert.Empty(prop1.
GetAttributes
());
2215
AssertEx.SetEqual(fieldAttributesExpected.Concat(decimalAttributeExpected), GetAttributeStrings(field1.
GetAttributes
()));
2219
AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field1.
GetAttributes
()));
2224
Assert.Empty(prop2.
GetAttributes
());
2227
AssertEx.SetEqual(fieldAttributesExpected.Concat(decimalAttributeExpected), GetAttributeStrings(field2.
GetAttributes
()));
2232
AssertEx.SetEqual(decimalAttributeExpected, GetAttributeStrings(field3.
GetAttributes
()));
2236
Assert.Empty(GetAttributeStrings(field3.
GetAttributes
()));
2292
Assert.Empty(prop1.
GetAttributes
());
2296
GetAttributeStrings(field1.
GetAttributes
()));
2302
Assert.Empty(prop2.
GetAttributes
());
2306
GetAttributeStrings(field2.
GetAttributes
()));
2426
Assert.Equal("A(2)", prop1.
GetAttributes
().Single().ToString());
2427
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.GetMethod.
GetAttributes
()));
2428
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.SetMethod.
GetAttributes
()));
2431
AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(1)" }), GetAttributeStrings(field1.
GetAttributes
()));
2436
Assert.Empty(prop2.
GetAttributes
());
2437
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.GetMethod.
GetAttributes
()));
2438
AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.SetMethod.
GetAttributes
()));
2441
AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.
GetAttributes
()));
2597
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.AddMethod.
GetAttributes
()));
2598
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.RemoveMethod.
GetAttributes
()));
2607
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.AddMethod.
GetAttributes
()));
2608
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.RemoveMethod.
GetAttributes
()));
2616
AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.AddMethod.
GetAttributes
()));
2617
AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.RemoveMethod.
GetAttributes
()));
2625
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.AddMethod.
GetAttributes
()));
2626
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.RemoveMethod.
GetAttributes
()));
2789
return symbol.
GetAttributes
().Single().AttributeClass.Name;
2794
Assert.Equal(0, symbol.
GetAttributes
().Length);
2863
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2864
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
2987
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2988
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
3059
var attrs = m.
GetAttributes
();
3065
attrs = assembly.
GetAttributes
();
3075
attrs = field.
GetAttributes
();
3082
attrs = nenum.
GetAttributes
();
3091
attrs = nenum.GetMember("three").
GetAttributes
();
3138
var attrs = dele.
GetAttributes
();
3144
attrs = mem.Parameters[0].
GetAttributes
();
3146
attrs = mem.Parameters[1].
GetAttributes
();
3178
var attrs = type.GetMember<MethodSymbol>("F").
GetAttributes
();
3226
var attrs = cDoc.
GetAttributes
();
3274
var attrs = cDoc.
GetAttributes
();
3326
var attrs = cDoc.
GetAttributes
();
3378
var attrs = cDoc.
GetAttributes
();
3412
var attrs = type.
GetAttributes
();
3423
var attrs = type.
GetAttributes
();
3549
var attrs = type.
GetAttributes
();
3560
var attrs = type.
GetAttributes
();
3595
var attrs = type.
GetAttributes
();
3641
var attrs = type.
GetAttributes
();
4038
var attrs = type.
GetAttributes
();
4054
attrs = fieldSymbol.
GetAttributes
();
4060
attrs = fieldSymbol.
GetAttributes
();
4096
var attrs = type.
GetAttributes
();
4139
var attrs = type.
GetAttributes
();
4183
var attrs = type.
GetAttributes
();
4228
var attrs = type.
GetAttributes
();
4272
var attrs = type.
GetAttributes
();
4603
var ca = goo.
GetAttributes
().First().CommonConstructorArguments.First();
4844
Assert.Equal(2, type.
GetAttributes
().Length);
4881
Assert.Equal(2, typeParameter.
GetAttributes
().Length);
5194
var attrs = classC1.
GetAttributes
();
5199
attrs = classC2.
GetAttributes
();
5204
attrs = classC3.
GetAttributes
();
5210
attrs = classC4.
GetAttributes
();
5217
attrs = classC5.
GetAttributes
();
5226
attrs = classC6.
GetAttributes
();
5318
var attributes = field.
GetAttributes
();
5456
var attr = c.
GetAttributes
().Single();
5500
var attr = c.
GetAttributes
().Single();
5532
Assert.Empty(classTypeParameter.
GetAttributes
());
5534
var attribute = methodTypeParameter.
GetAttributes
().Single();
8056
var attrs = type.
GetAttributes
();
8063
var attrs = type.
GetAttributes
();
8384
Assert.Equal(0, assembly.
GetAttributes
().Length);
8386
Assert.Equal(0, type.
GetAttributes
().Length);
8427
Assert.Equal(0, assembly.
GetAttributes
().Length);
8429
Assert.Equal(0, type.
GetAttributes
().Length);
8474
Assert.Equal(0, assembly.
GetAttributes
().Length);
8476
Assert.Equal(0, type.
GetAttributes
().Length);
8520
Assert.Equal(0, yParam.
GetAttributes
().Length);
8557
Assert.Equal(0, type.
GetAttributes
()[0].ConstructorArguments.Count());
9113
var attrs1 = method1.
GetAttributes
();
9119
var attrs2 = method2.
GetAttributes
();
9124
var attrs3 = method3.
GetAttributes
();
9194
var attrs1 = method1.
GetAttributes
();
9201
var attrs2 = method2.
GetAttributes
();
9207
var attrs3 = method3.
GetAttributes
();
9213
var attrs4 = method4.
GetAttributes
();
9278
var attrs1 = method1.
GetAttributes
();
9284
var attrs2 = method2.
GetAttributes
();
9289
var attrs3 = method3.
GetAttributes
();
9294
var attrs4 = method4.
GetAttributes
();
9351
var attrs1 = method1.
GetAttributes
();
9356
var attrs2 = method2.
GetAttributes
();
9361
var attrs3 = method3.
GetAttributes
();
9425
var attrs1 = method1.
GetAttributes
();
9431
var attrs2 = method2.
GetAttributes
();
9437
var attrs3 = method3.
GetAttributes
();
9443
var attrs4 = method4.
GetAttributes
();
9505
var attrs1 = method1.
GetAttributes
();
9511
var attrs2 = method2.
GetAttributes
();
9516
var attrs3 = method3.
GetAttributes
();
9521
var attrs4 = method4.
GetAttributes
();
9571
var attrs = methods.Select(m => m.
GetAttributes
().Single()).ToArray();
9615
var typeInAttribute = (INamedTypeSymbol)type.
GetAttributes
()[0].ConstructorArguments.First().Value;
9617
Assert.True(((NamedTypeSymbol)type.
GetAttributes
()[0].ConstructorArguments.First().ValueInternal).IsUnboundGenericType);
9625
typeInAttribute = (INamedTypeSymbol)type.
GetAttributes
()[0].ConstructorArguments.First().Value;
9627
Assert.True(((NamedTypeSymbol)type.
GetAttributes
()[0].ConstructorArguments.First().ValueInternal).IsUnboundGenericType);
9699
Assert.True(cc.TypeParameters.Single().
GetAttributes
().IsEmpty);
9700
Assert.Equal("XAttribute", mm.TypeParameters.Single().
GetAttributes
().Single().ToString());
9942
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
9946
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
9963
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
9971
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
9992
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
9996
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
10018
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
10022
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
10044
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
10048
Assert.False(comp.GlobalNamespace.GetTypeMember("C").
GetAttributes
().Single().AttributeClass.IsGenericType);
10069
var attribute = m.
GetAttributes
().Single();
10716
var attrs = lambda.
GetAttributes
();
10851
var attrs = program.
GetAttributes
();
10945
var attrs = holder.
GetAttributes
();
10955
var attrs = holder.
GetAttributes
();
11006
var attrs = module.ContainingAssembly.
GetAttributes
();
11019
var attrs = module.ContainingAssembly.
GetAttributes
();
11078
var attrs = c.
GetAttributes
();
Attributes\AttributeTests_Assembly.cs (17)
870
var attrs = comp.Assembly.
GetAttributes
();
893
var attrs = comp.Assembly.
GetAttributes
();
1021
.
GetAttributes
()
1034
.
GetAttributes
()
1082
var attrs = consoleappCompilation.Assembly.
GetAttributes
();
1125
Assert.Equal(0, consoleappCompilation.Assembly.
GetAttributes
().Length);
1203
var attrs = consoleappCompilation.Assembly.
GetAttributes
();
1240
Assert.Equal(0, consoleappCompilation.Assembly.
GetAttributes
().Length);
1283
var attrs = consoleappCompilation.Assembly.
GetAttributes
();
1331
foreach (var a in module.ContainingAssembly.
GetAttributes
())
1376
var attrs = consoleappCompilation.Assembly.
GetAttributes
();
1424
var attrs = compilation.Assembly.
GetAttributes
();
1435
attrs = compilation.Assembly.
GetAttributes
();
1443
attrs = compilation.Assembly.
GetAttributes
();
1839
var attrs = moduleSymbol.ContainingAssembly.
GetAttributes
().Select(a => a.ToString()).ToArray();
2130
return assembly.
GetAttributes
().Where(data => data.IsTargetAttribute(assembly, AttributeDescription.AssemblyDescriptionAttribute));
2242
var attrs = m.ContainingAssembly.
GetAttributes
();
Attributes\AttributeTests_CallerInfoAttributes.cs (3)
2299
var arguments = compilation.GetTypeByMetadataName("Program").
GetAttributes
().Single().CommonConstructorArguments;
4393
var attr = ctor.Parameters.Single().
GetAttributes
().Single();
4423
var attr = ctor.Parameters.Single().
GetAttributes
()[0];
Attributes\AttributeTests_Conditional.cs (23)
142
attributesArrayBuilder.Add(classZ.
GetAttributes
());
143
attributesArrayBuilder.Add(classZ.TypeParameters[0].
GetAttributes
());
146
attributesArrayBuilder.Add(methodM.
GetAttributes
());
149
attributesArrayBuilder.Add(param1.
GetAttributes
());
152
attributesArrayBuilder.Add(fieldF.
GetAttributes
());
155
attributesArrayBuilder.Add(propP1.
GetAttributes
());
157
attributesArrayBuilder.Add(propGetMethod.
GetAttributes
());
160
attributesArrayBuilder.Add(propSetMethod.
GetAttributes
());
161
attributesArrayBuilder.Add(propSetMethod.Parameters[0].
GetAttributes
());
164
attributesArrayBuilder.Add(propP2.
GetAttributes
());
166
attributesArrayBuilder.Add(propGetMethod.
GetAttributes
());
170
attributesArrayBuilder.Add(propP3.
GetAttributes
());
172
attributesArrayBuilder.Add(propGetMethod.
GetAttributes
());
175
attributesArrayBuilder.Add(propSetMethod.
GetAttributes
());
176
attributesArrayBuilder.Add(propSetMethod.Parameters[0].
GetAttributes
());
179
attributesArrayBuilder.Add(eventE.
GetAttributes
());
180
attributesArrayBuilder.Add(eventE.AddMethod.
GetAttributes
());
181
attributesArrayBuilder.Add(eventE.RemoveMethod.
GetAttributes
());
184
attributesArrayBuilder.Add(eventE.AssociatedField.
GetAttributes
());
188
attributesArrayBuilder.Add(enumE.
GetAttributes
());
191
attributesArrayBuilder.Add(fieldA.
GetAttributes
());
194
attributesArrayBuilder.Add(structS.
GetAttributes
());
634
var attributes = paramY.
GetAttributes
();
Attributes\AttributeTests_Dynamic.cs (64)
164
ValidateDynamicAttribute(_base0Class.
GetAttributes
(), expectedDynamicAttribute: false);
167
ValidateDynamicAttribute(_base1Class.
GetAttributes
(), expectedDynamicAttribute: false);
170
ValidateDynamicAttribute(_base2Class.
GetAttributes
(), expectedDynamicAttribute: false);
176
ValidateDynamicAttribute(_derivedClass.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
182
ValidateDynamicAttribute(_outerClass.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
188
ValidateDynamicAttribute(_innerClass.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
194
ValidateDynamicAttribute(_innerInnerClass.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
200
ValidateDynamicAttribute(_outer2Class.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
204
ValidateDynamicAttribute(_inner2Class.
GetAttributes
(), expectedDynamicAttribute: false);
208
ValidateDynamicAttribute(_innerInner2Class.
GetAttributes
(), expectedDynamicAttribute: false);
211
ValidateDynamicAttribute(_inner3Class.
GetAttributes
(), expectedDynamicAttribute: false);
221
ValidateDynamicAttribute(field1.
GetAttributes
(), expectedDynamicAttribute: true);
227
ValidateDynamicAttribute(field2.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
233
ValidateDynamicAttribute(field3.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
238
ValidateDynamicAttribute(field4.
GetAttributes
(), expectedDynamicAttribute: true);
244
ValidateDynamicAttribute(field5.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
250
ValidateDynamicAttribute(field6.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
256
ValidateDynamicAttribute(field7.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
262
ValidateDynamicAttribute(field8.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
268
ValidateDynamicAttribute(field9.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
274
ValidateDynamicAttribute(field10.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
280
ValidateDynamicAttribute(field11.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
286
ValidateDynamicAttribute(field12.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
292
ValidateDynamicAttribute(field13.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
298
ValidateDynamicAttribute(field14.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
304
ValidateDynamicAttribute(field15.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
310
ValidateDynamicAttribute(field16.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
316
ValidateDynamicAttribute(field17.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
322
ValidateDynamicAttribute(field1.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
329
ValidateDynamicAttribute(f1.
GetAttributes
(), expectedDynamicAttribute: false);
335
ValidateDynamicAttribute(f1.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true);
339
ValidateDynamicAttribute(f2.
GetAttributes
(), expectedDynamicAttribute: false);
346
ValidateDynamicAttribute(f2.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
350
ValidateDynamicAttribute(f3.
GetAttributes
(), expectedDynamicAttribute: false);
356
ValidateDynamicAttribute(f3.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
360
ValidateDynamicAttribute(f4.
GetAttributes
(), expectedDynamicAttribute: false);
367
ValidateDynamicAttribute(f4.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
371
ValidateDynamicAttribute(f5.
GetAttributes
(), expectedDynamicAttribute: false);
378
ValidateDynamicAttribute(f5.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
386
ValidateDynamicAttribute(prop1.
GetAttributes
(), expectedDynamicAttribute: true);
397
ValidateDynamicAttribute(prop2.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
407
ValidateDynamicAttribute(prop2.SetMethod.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
415
ValidateDynamicAttribute(indexer.
GetAttributes
(), expectedDynamicAttribute: true);
423
ValidateDynamicAttribute(indexer.GetMethod.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true);
431
ValidateDynamicAttribute(indexer.SetMethod.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true);
432
ValidateDynamicAttribute(indexer.SetMethod.Parameters[1].
GetAttributes
(), expectedDynamicAttribute: true);
442
ValidateDynamicAttribute(_unsafeClass.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
451
ValidateDynamicAttribute(nullableField.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags);
460
ValidateDynamicAttribute(_synthesizedMyDelegateType.
GetAttributes
(), expectedDynamicAttribute: false);
470
ValidateDynamicAttribute(ctor.
GetAttributes
(), expectedDynamicAttribute: false);
474
ValidateDynamicAttribute(param.
GetAttributes
(), expectedDynamicAttribute: false);
482
ValidateDynamicAttribute(invokeMethod.
GetAttributes
(), expectedDynamicAttribute: false);
488
ValidateDynamicAttribute(invokeMethod.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
498
ValidateDynamicAttribute(beginInvokeMethod.
GetAttributes
(), expectedDynamicAttribute: false);
503
ValidateDynamicAttribute(parameters[0].
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
504
ValidateDynamicAttribute(parameters[1].
GetAttributes
(), expectedDynamicAttribute: false);
505
ValidateDynamicAttribute(parameters[2].
GetAttributes
(), expectedDynamicAttribute: false);
512
ValidateDynamicAttribute(endInvokeMethod.
GetAttributes
(), expectedDynamicAttribute: false);
516
ValidateDynamicAttribute(endInvokeMethod.Parameters[0].
GetAttributes
(), expectedDynamicAttribute: false);
828
DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.
GetAttributes
(), expectedDynamicAttribute: true);
861
DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags);
896
DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags);
918
DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.
GetAttributes
(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags);
1095
var attrs = getEnumerator.
GetAttributes
();
Attributes\AttributeTests_IsByRefLike.cs (5)
623
AssertNotReferencedIsByRefLikeAttribute(property.Type.
GetAttributes
());
674
var attribute = type.
GetAttributes
().Single();
759
var attribute = type.
GetAttributes
().Single();
810
var attributes = type.
GetAttributes
();
1095
var attributes = typeSymbol.
GetAttributes
().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_IsUnmanaged.cs (1)
833
var isUnmanagedTypeAttributes = attributeType.
GetAttributes
().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_NativeInteger.cs (4)
1109
AssertNativeIntegerAttribute(method.Parameters[0].
GetAttributes
());
1133
AssertAttributes(method.
GetAttributes
(), "System.Runtime.CompilerServices.CompilerGeneratedAttribute");
1156
AssertNativeIntegerAttribute(method.Parameters[0].
GetAttributes
());
1493
var attributes = member.
GetAttributes
();
Attributes\AttributeTests_Nullable.cs (28)
528
CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").
GetAttributes
().Single(), "A"));
538
CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").
GetAttributes
().Single(), "B"));
563
CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").
GetAttributes
().Single(), "A"));
573
CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").
GetAttributes
().Single(), "A"));
803
AssertNoNullableAttribute(field.
GetAttributes
());
804
AssertNoNullableAttribute(module.
GetAttributes
());
805
AssertAttributes(assembly.
GetAttributes
(),
817
AssertNoNullableAttribute(field.
GetAttributes
());
818
AssertNoNullableAttribute(module.
GetAttributes
());
819
AssertAttributes(assembly.
GetAttributes
(),
976
AssertNullableAttribute(field.
GetAttributes
());
977
AssertNoNullableAttribute(module.
GetAttributes
());
978
AssertAttributes(assembly.
GetAttributes
(),
1007
AssertAttributes(module.
GetAttributes
());
2170
AssertAttributes(method.
GetAttributes
());
2197
AssertAttributes(method.
GetAttributes
(), "System.Runtime.CompilerServices.NullableContextAttribute");
2198
AssertAttributes(method.Parameters[0].
GetAttributes
());
2225
AssertAttributes(method.Parameters[0].
GetAttributes
());
2226
AssertNullableAttribute(method.Parameters[1].
GetAttributes
());
2278
AssertAttributes(method.
GetAttributes
(), "System.Runtime.CompilerServices.CompilerGeneratedAttribute");
2301
AssertNullableAttribute(method.Parameters[0].
GetAttributes
());
2302
AssertNoNullableAttribute(method.Parameters[1].
GetAttributes
());
2511
AssertNoNullableAttribute(method.
GetAttributes
());
2535
AssertNoNullableAttribute(property.
GetAttributes
());
2538
AssertAttributes(method.
GetAttributes
(), "System.Diagnostics.DebuggerHiddenAttribute");
2561
AssertNoNullableAttribute(property.
GetAttributes
());
2564
AssertAttributes(method.
GetAttributes
(), "System.Diagnostics.DebuggerHiddenAttribute");
4996
var attributes = method.Parameters[0].
GetAttributes
();
Attributes\AttributeTests_NullablePublicOnly.cs (1)
587
var attribute = module.
GetAttributes
().SingleOrDefault();
Attributes\AttributeTests_ReadOnlyStruct.cs (10)
41
Assert.Empty(type.
GetAttributes
());
60
Assert.Empty(type.
GetAttributes
());
78
Assert.Empty(type.
GetAttributes
());
96
Assert.Empty(type.
GetAttributes
());
114
Assert.Empty(type.
GetAttributes
());
140
Assert.Empty(type.
GetAttributes
());
436
Assert.Empty(type.
GetAttributes
());
586
AssertNotReferencedIsReadOnlyAttribute(type.
GetAttributes
());
615
AssertNotReferencedIsReadOnlyAttribute(property.Type.
GetAttributes
());
662
var attributes = typeSymbol.
GetAttributes
().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_RefReadOnly.cs (87)
44
Assert.Empty(parameter.
GetAttributes
());
69
Assert.Empty(parameter.
GetAttributes
());
126
Assert.Empty(parameter.
GetAttributes
());
155
Assert.Empty(parameter.
GetAttributes
());
177
Assert.Empty(parameter.
GetAttributes
());
207
Assert.Empty(parameter.
GetAttributes
());
234
Assert.Empty(parameter.
GetAttributes
());
251
Assert.Empty(parameter.
GetAttributes
());
278
Assert.Empty(parameter.
GetAttributes
());
313
Assert.Empty(property.
GetAttributes
());
342
Assert.Empty(property.
GetAttributes
());
378
Assert.Empty(property.
GetAttributes
());
408
Assert.Empty(parameter.
GetAttributes
());
409
Assert.Empty(indexer.
GetAttributes
());
428
Assert.Empty(parameter.
GetAttributes
());
449
Assert.Empty(indexer.
GetAttributes
());
480
Assert.Empty(parameter.
GetAttributes
());
481
Assert.Empty(indexer.
GetAttributes
());
507
Assert.Empty(parameter.
GetAttributes
());
523
Assert.Empty(parameter.
GetAttributes
());
567
Assert.Empty(parameter.
GetAttributes
());
604
Assert.Empty(parameter.
GetAttributes
());
627
Assert.Empty(parameter.
GetAttributes
());
692
Assert.Empty(parameter.
GetAttributes
());
731
Assert.Empty(parameter.
GetAttributes
());
758
Assert.Empty(parameter.
GetAttributes
());
825
Assert.Empty(parameter.
GetAttributes
());
1162
Assert.Empty(parameter.
GetAttributes
());
1313
Assert.Empty(parameter.
GetAttributes
());
1350
Assert.Empty(parameter.
GetAttributes
());
1593
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1596
Assert.Empty(@operator.Parameters[0].
GetAttributes
());
1597
Assert.Empty(@operator.Parameters[1].
GetAttributes
());
1600
Assert.Empty(property.
GetAttributes
());
1603
Assert.Empty(indexer.
GetAttributes
());
1604
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1635
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1638
Assert.Empty(@operator.Parameters[0].
GetAttributes
());
1639
Assert.Empty(@operator.Parameters[1].
GetAttributes
());
1642
Assert.Empty(property.
GetAttributes
());
1645
Assert.Empty(indexer.
GetAttributes
());
1646
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1679
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1682
Assert.Empty(@operator.Parameters[0].
GetAttributes
());
1683
Assert.Empty(@operator.Parameters[1].
GetAttributes
());
1686
Assert.Empty(property.
GetAttributes
());
1689
Assert.Empty(indexer.
GetAttributes
());
1690
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1728
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1731
Assert.Empty(property.
GetAttributes
());
1734
Assert.Empty(indexer.
GetAttributes
());
1735
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1775
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1778
Assert.Empty(property.
GetAttributes
());
1781
Assert.Empty(indexer.
GetAttributes
());
1782
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1819
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1822
Assert.Empty(property.
GetAttributes
());
1825
Assert.Empty(indexer.
GetAttributes
());
1826
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1868
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1871
Assert.Empty(property.
GetAttributes
());
1874
Assert.Empty(indexer.
GetAttributes
());
1875
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1908
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1911
Assert.Empty(@operator.Parameters[0].
GetAttributes
());
1912
Assert.Empty(@operator.Parameters[1].
GetAttributes
());
1915
Assert.Empty(property.
GetAttributes
());
1918
Assert.Empty(indexer.
GetAttributes
());
1919
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
1977
Assert.Empty(method.Parameters.Single().
GetAttributes
());
1980
Assert.Empty(property.
GetAttributes
());
1983
Assert.Empty(indexer.
GetAttributes
());
1984
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
2026
Assert.Empty(method.Parameters.Single().
GetAttributes
());
2029
Assert.Empty(property.
GetAttributes
());
2032
Assert.Empty(indexer.
GetAttributes
());
2033
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
2066
Assert.Empty(method.Parameters.Single().
GetAttributes
());
2069
Assert.Empty(property.
GetAttributes
());
2072
Assert.Empty(indexer.
GetAttributes
());
2073
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
2108
Assert.Empty(method.Parameters.Single().
GetAttributes
());
2111
Assert.Empty(property.
GetAttributes
());
2114
Assert.Empty(indexer.
GetAttributes
());
2115
Assert.Empty(indexer.Parameters.Single().
GetAttributes
());
2554
var attributes = typeSymbol.
GetAttributes
().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_RefSafetyRules.cs (1)
222
var attribute = module.
GetAttributes
().SingleOrDefault();
Attributes\AttributeTests_Synthesized.cs (69)
130
var actualAttrs = GetAttributeNames(pid.
GetAttributes
());
152
var actualAttrs = GetAttributeNames(bufferType.
GetAttributes
());
265
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(displayClass.
GetAttributes
()));
269
Assert.Equal(0, member.
GetAttributes
().Length);
304
AssertEx.SetEqual(expected, GetAttributeNames(anon.
GetAttributes
()));
308
var actual = GetAttributeNames(member.
GetAttributes
());
405
var dd = anon.
GetAttributes
().Where(a => a.AttributeClass.Name == "DebuggerDisplayAttribute").Single();
431
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(iter.
GetAttributes
()));
444
AssertEx.SetEqual(new[] { "DebuggerHiddenAttribute" }, GetAttributeNames(member.
GetAttributes
()));
450
AssertEx.SetEqual(new string[] { }, GetAttributeNames(member.
GetAttributes
()));
488
new[] { "AsyncStateMachineAttribute" }, GetAttributeNames(goo.
GetAttributes
()));
491
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(iter.
GetAttributes
()));
501
AssertEx.SetEqual(new[] { "DebuggerHiddenAttribute" }, GetAttributeNames(member.
GetAttributes
()));
505
AssertEx.SetEqual(new string[] { }, GetAttributeNames(member.
GetAttributes
()));
543
var attributes = module.GlobalNamespace.GetTypeMember("B").GetMember<MethodSymbol>("<>n__0").
GetAttributes
();
582
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute", "DebuggerHiddenAttribute" }, GetAttributeNames(baseMethodWrapper.
GetAttributes
()));
586
Assert.Empty(parameter.
GetAttributes
());
625
AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute", "DebuggerHiddenAttribute" }, GetAttributeNames(baseMethodWrapper.
GetAttributes
()));
629
Assert.Empty(parameter.
GetAttributes
());
632
Assert.Empty(typeParameter.
GetAttributes
());
652
Assert.Equal(new[] { "Attr" }, GetAttributeNames(typeParam.
GetAttributes
()));
703
Assert.Empty(ctor[1].
GetAttributes
()); // shouldn't have attribute.
709
Assert.Empty(myProperty.
GetAttributes
());
720
var attributeNames = GetAttributeNames(symbol.
GetAttributes
());
763
Assert.Empty(ctor.
GetAttributes
());
766
Assert.Empty(myProperty.
GetAttributes
());
777
var attributeNames = GetAttributeNames(symbol.
GetAttributes
());
845
Assert.Empty(ctor[0].
GetAttributes
());
854
Assert.Empty(p1.
GetAttributes
());
859
var attributeNames = GetAttributeNames(symbol.
GetAttributes
());
885
Assert.Empty(ctor[0].
GetAttributes
());
886
Assert.Empty(ctor[1].
GetAttributes
());
918
Assert.Empty(p1.
GetAttributes
());
923
var attributeNames = GetAttributeNames(symbol.
GetAttributes
());
946
Assert.Empty(ctor.
GetAttributes
());
949
Assert.Empty(toString.
GetAttributes
());
952
Assert.Empty(op_Equality.
GetAttributes
());
955
Assert.Empty(op_Inequality.
GetAttributes
());
958
Assert.Empty(getHashCode.
GetAttributes
());
962
Assert.Empty(equals[0].
GetAttributes
());
963
Assert.Empty(equals[1].
GetAttributes
());
984
var attributes = module.ContainingAssembly.
GetAttributes
();
1019
var attributes = module.ContainingAssembly.
GetAttributes
();
1054
var attributes = module.ContainingAssembly.
GetAttributes
();
1089
var attributes = module.ContainingAssembly.
GetAttributes
();
1126
VerifyDebuggableAttribute(module.
GetAttributes
().Single(), optimizationLevel, isSynthesized: false);
1128
var attributes = module.ContainingAssembly.
GetAttributes
();
1164
var attributes = module.ContainingAssembly.
GetAttributes
();
1200
VerifyCompilationRelaxationsAttribute(module.
GetAttributes
().Single(), isSynthesized: false);
1202
var assemblyAttributes = module.ContainingAssembly.
GetAttributes
();
1238
VerifyDebuggableAttribute(module.
GetAttributes
().Single(), options.OptimizationLevel, isSynthesized: false);
1240
var assemblyAttributes = module.ContainingAssembly.
GetAttributes
();
1280
var assemblyAttributes = module.ContainingAssembly.
GetAttributes
();
1310
var attributes = module.ContainingAssembly.
GetAttributes
();
1359
var attributes = module.ContainingAssembly.
GetAttributes
();
1406
var attributes = module.ContainingAssembly.
GetAttributes
();
1450
var attributes = module.ContainingAssembly.
GetAttributes
();
1495
var assemblyAttributes = module.ContainingAssembly.
GetAttributes
();
1535
var attributes = module.ContainingAssembly.
GetAttributes
();
1576
var attributes = module.ContainingAssembly.
GetAttributes
();
1613
var unverifiableCode = module.
GetAttributes
().Single();
1680
var attributes = asyncMethod.
GetAttributes
();
1723
var attributes = asyncMethod.
GetAttributes
();
1765
var attributes = asyncMethod.
GetAttributes
();
1812
Assert.Equal("DebuggerStepThroughAttribute", asyncMethod.
GetAttributes
().Single().AttributeClass.Name);
1816
Assert.Empty(asyncMethod.
GetAttributes
());
1846
var iteratorAttribute = iteratorMethod.
GetAttributes
().Single();
1876
var iteratorAttribute = iteratorMethod.
GetAttributes
().Single();
1907
Assert.Empty(type.GetMember<MethodSymbol>("F").
GetAttributes
());
Attributes\AttributeTests_Tuples.cs (30)
349
ValidateTupleNameAttribute(invokeMethod.
GetAttributes
(), expectedTupleNamesAttribute: false);
355
ValidateTupleNameAttribute(sender.
GetAttributes
(), expectedTupleNamesAttribute: false);
364
ValidateTupleNameAttribute(args.
GetAttributes
(),
369
args.
GetAttributes
(),
386
ValidateTupleNameAttribute(event1.
GetAttributes
(),
393
event1.
GetAttributes
(),
405
ValidateTupleNameAttribute(_base0Class.
GetAttributes
(), expectedTupleNamesAttribute: false);
408
ValidateTupleNameAttribute(_base1Class.
GetAttributes
(), expectedTupleNamesAttribute: false);
411
ValidateTupleNameAttribute(_base2Class.
GetAttributes
(), expectedTupleNamesAttribute: false);
416
ValidateTupleNameAttribute(_outerClass.
GetAttributes
(),
429
ValidateTupleNameAttribute(_derivedClass.
GetAttributes
(),
439
ValidateTupleNameAttribute(field1.
GetAttributes
(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames);
444
ValidateTupleNameAttribute(field2.
GetAttributes
(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames);
449
ValidateTupleNameAttribute(field3.
GetAttributes
(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames);
454
ValidateTupleNameAttribute(field4.
GetAttributes
(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames);
456
field4.
GetAttributes
(),
469
ValidateTupleNameAttribute(field5.
GetAttributes
(),
473
field5.
GetAttributes
(),
484
ValidateTupleNameAttribute(field6.
GetAttributes
(), expectedTupleNamesAttribute: false);
499
ValidateTupleNameAttribute(field7.
GetAttributes
(), expectedTupleNamesAttribute: false);
510
ValidateTupleNameAttribute(field8.
GetAttributes
(), expectedTupleNamesAttribute: true,
520
ValidateTupleNameAttribute(field9.
GetAttributes
(), expectedTupleNamesAttribute: true,
536
ValidateTupleNameAttribute(method2.Parameters.Single().
GetAttributes
(),
547
ValidateTupleNameAttribute(method3.Parameters.Single().
GetAttributes
(),
558
ValidateTupleNameAttribute(method4.Parameters.Single().
GetAttributes
(),
571
ValidateTupleNameAttribute(method5.Parameters.Single().
GetAttributes
(), expectedTupleNamesAttribute: false);
590
ValidateTupleNameAttribute(prop1.
GetAttributes
(),
597
ValidateTupleNameAttribute(prop2.
GetAttributes
(),
604
ValidateTupleNameAttribute(indexer.
GetAttributes
(),
608
ValidateTupleNameAttribute(indexer.Parameters.Single().
GetAttributes
(),
Attributes\AttributeTests_WellKnownAttributes.cs (38)
134
var attrs = assembly.
GetAttributes
();
155
Assert.Equal(6, igoo.
GetAttributes
().Length);
181
Assert.Equal(1, mem.
GetAttributes
().Length);
182
attrSym = mem.
GetAttributes
().First();
187
attrSym = mem.
GetAttributes
().First();
192
Assert.Equal(1, mem.
GetAttributes
().Length);
195
attrSym = mem.
GetAttributes
().First();
263
Assert.Equal(2, type1.
GetAttributes
().Length);
279
Assert.Equal(2, type2.
GetAttributes
().Length);
303
Assert.Equal(2, type3.
GetAttributes
().Length);
312
Assert.Equal(0, field.
GetAttributes
().Length);
315
Assert.Equal(1, field.
GetAttributes
().Length);
316
attrSym = field.
GetAttributes
().First();
320
attrSym = field.
GetAttributes
().First();
422
Assert.Equal(3, parm.
GetAttributes
().Length);
433
Assert.Equal(3, parm.
GetAttributes
().Length);
443
attrSym = method.
GetAttributes
().First();
447
attrSym = parm.
GetAttributes
().First();
452
attrSym = parm.
GetAttributes
().First();
463
Assert.Equal(2, type2.
GetAttributes
().Length);
476
Assert.Equal(3, field.
GetAttributes
().Length);
873
Assert.Equal(0, ps[0].
GetAttributes
().Length);
903
Assert.Equal(0, ps[0].
GetAttributes
().Length);
932
Assert.Equal(0, ps[0].
GetAttributes
().Length);
2397
var attrSym = method.
GetAttributes
().First();
2405
attrSym = method.
GetAttributes
().First();
3595
Assert.Equal(2, typeA.
GetAttributes
().Length);
3609
Assert.Equal(1, typeA.
GetAttributes
().Length);
3675
var attrs = worksheetInterface.
GetAttributes
().AsEnumerable();
3806
var attrs = worksheetInterface.
GetAttributes
().AsEnumerable();
4811
AssertEx.SetEqual(expectedAttributes, typeC.
GetAttributes
().Select(a => a.ToString()));
4990
Assert.Empty(noParamsParameter.
GetAttributes
());
5555
Assert.Equal(0, typeA.
GetAttributes
().Length);
5621
Assert.Equal(0, method.
GetAttributes
().Length);
5664
Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(method.
GetAttributes
()));
13051
GetMember<MethodSymbol>("MoveNext").
GetAttributes
().Length);
13061
GetMember<MethodSymbol>("MoveNext").
GetAttributes
().Length);
13365
var attribute = module.ContainingAssembly.GetTypeByMetadataName("Program").GetMethod("Test").Parameters.Single().
GetAttributes
().Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (3)
110
foreach (var attrData in m.ContainingAssembly.
GetAttributes
())
224
foreach (var attrData in m.ContainingAssembly.
GetAttributes
())
2749
Assert.False(assembly.
GetAttributes
().Any(attr => attr.IsTargetAttribute(assembly, AttributeDescription.InternalsVisibleToAttribute)));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (376)
Semantics\BindingTests.cs (3)
2570
var a = x.
GetAttributes
()[0];
2600
var a = foo.
GetAttributes
()[0];
2630
var a = tt.
GetAttributes
()[0];
Semantics\InitOnlyMemberTests.cs (4)
1453
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
1460
var getterAttributes = getter.
GetAttributes
().Select(a => a.ToString());
1473
var setterAttributes = property.SetMethod.
GetAttributes
().Select(a => a.ToString());
1488
var backingFieldAttributes = backingField.
GetAttributes
().Select(a => a.ToString());
Semantics\InterpolationTests.cs (45)
4991
Assert.Equal("Attr..ctor(CustomHandler c)", attr.
GetAttributes
().Single().AttributeConstructor.ToTestDisplayString());
5016
Assert.Equal("Attr..ctor(System.String s)", attr.
GetAttributes
().Single().AttributeConstructor.ToTestDisplayString());
6796
sParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6822
sParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6854
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6889
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6929
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6964
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7004
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7042
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7082
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7117
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7157
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7192
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7225
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7265
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7305
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7345
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7385
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7420
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7462
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7497
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7539
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7580
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7620
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7688
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7782
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7894
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7960
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7990
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8163
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8223
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8343
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8573
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8698
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8849
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8960
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9027
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9083
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9199
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9315
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9440
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9702
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
9778
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
11836
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
Semantics\LambdaTests.cs (2)
3629
return format(expr, method.
GetAttributes
(), method.GetReturnTypeAttributes(), method.Parameters.SelectMany(p => p.
GetAttributes
()));
Semantics\LocalFunctionTests.cs (4)
1723
var attrs = typeParam.
GetAttributes
();
1928
var attrs = typeParam.
GetAttributes
();
1978
var attrs = param.
GetAttributes
();
1984
attrs = param.
GetAttributes
();
Semantics\MultiDimensionalArrayTests.cs (4)
1681
var a1 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test1").
GetAttributes
().Single().ConstructorArguments.Single().Value;
1686
var a2 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test2").
GetAttributes
().Single().ConstructorArguments.Single().Value;
1691
Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test3").
GetAttributes
().Single().ConstructorArguments.Single().Value).IsErrorType());
1692
Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test4").
GetAttributes
().Single().ConstructorArguments.Single().Value).IsErrorType());
Semantics\NamedAndOptionalTests.cs (34)
2056
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2062
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
2068
Assert.Equal(0, parameters[2].
GetAttributes
().Length);
2074
Assert.Equal(isFromSource ? 1 : 0, parameters[3].
GetAttributes
().Length);
2081
Assert.Equal(isFromSource ? 1 : 0, parameters[4].
GetAttributes
().Length);
2088
Assert.Equal(isFromSource ? 1 : 0, parameters[5].
GetAttributes
().Length);
2094
Assert.Equal(isFromSource ? 2 : 0, parameters[6].
GetAttributes
().Length);
2100
Assert.Equal(isFromSource ? 2 : 0, parameters[7].
GetAttributes
().Length);
2138
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2144
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
2150
Assert.Equal(isFromSource ? 1 : 0, parameters[2].
GetAttributes
().Length);
2189
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2195
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
2201
Assert.Equal(0, parameters[2].
GetAttributes
().Length);
2207
Assert.Equal(isFromSource ? 1 : 0, parameters[3].
GetAttributes
().Length);
2214
Assert.Equal(isFromSource ? 1 : 0, parameters[4].
GetAttributes
().Length);
2220
Assert.Equal(isFromSource ? 2 : 0, parameters[5].
GetAttributes
().Length);
2227
Assert.Equal(isFromSource ? 1 : 0, parameters[6].
GetAttributes
().Length);
2233
Assert.Equal(isFromSource ? 2 : 0, parameters[7].
GetAttributes
().Length);
2272
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2278
Assert.Equal(0, parameters[1].
GetAttributes
().Length);
2284
Assert.Equal(0, parameters[2].
GetAttributes
().Length);
2290
Assert.Equal(isFromSource ? 1 : 0, parameters[3].
GetAttributes
().Length);
2297
Assert.Equal(1, parameters[4].
GetAttributes
().Length); // DecimalConstantAttribute
2304
Assert.Equal(1, parameters[5].
GetAttributes
().Length); // DecimalConstantAttribute
2310
Assert.Equal(isFromSource ? 2 : 0, parameters[6].
GetAttributes
().Length); // Optional+DecimalConstantAttribute / DecimalConstantAttribute
2316
Assert.Equal(isFromSource ? 2 : 0, parameters[7].
GetAttributes
().Length); // Optional+DecimalConstantAttribute / DecimalConstantAttribute
2354
Assert.Equal(0, parameters[0].
GetAttributes
().Length);
2360
Assert.Equal(0, parameters[1].
GetAttributes
().Length); // As in dev11, [DateTimeConstant] is not emitted in this case.
2366
Assert.Equal(isFromSource ? 1 : 0, parameters[2].
GetAttributes
().Length);
2373
Assert.Equal(1, parameters[3].
GetAttributes
().Length); // DateTimeConstant
2380
Assert.Equal(1, parameters[4].
GetAttributes
().Length); // DateTimeConstant
2386
Assert.Equal(isFromSource ? 2 : 0, parameters[5].
GetAttributes
().Length); // Optional+DateTimeConstant / DateTimeConstant
2392
Assert.Equal(isFromSource ? 2 : 0, parameters[6].
GetAttributes
().Length); // Optional+DateTimeConstant / DateTimeConstant
Semantics\NullableReferenceTypesTests.cs (211)
6456
var attribute = c.
GetAttributes
().Single();
6478
var attribute = c.
GetAttributes
().Single();
28234
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
28245
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
28256
var getterAttributes = getter.
GetAttributes
().Select(a => a.ToString());
28278
var setterAttributes = setter.
GetAttributes
();
28337
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
28348
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
28359
var getterAttributes = getter.
GetAttributes
().Select(a => a.ToString());
28861
var fieldAttributes = field.
GetAttributes
().Select(a => a.ToString());
38720
var fieldAttributes = field.
GetAttributes
().Select(a => a.ToString());
38894
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
38905
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
38916
var setterAttributes = setter.
GetAttributes
();
38919
var setterValueAttributes = setter.Parameters.Last().
GetAttributes
().Select(a => a.ToString());
38955
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
38966
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
38977
var setterAttributes = setter.
GetAttributes
();
38980
var setterValueAttributes = setter.Parameters.Last().
GetAttributes
().Select(a => a.ToString());
42575
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
42586
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
42597
var setterAttributes = setter.
GetAttributes
().Select(a => a.ToString());
42607
var setterValueAttributes = setter.Parameters.Last().
GetAttributes
().Select(a => a.ToString());
42824
var fieldAttributes = field.
GetAttributes
().Select(a => a.ToString());
45857
var copenAttributes = copen.
GetAttributes
().Select(a => a.ToString());
45868
var propertyAttributes = property.
GetAttributes
().Select(a => a.ToString());
45879
Assert.Empty(getter.
GetAttributes
());
45969
var fieldAttributes = field.
GetAttributes
().Select(a => a.ToString());
93915
Assert.Empty(b.
GetAttributes
());
93919
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.
GetAttributes
().First().ToString());
93925
Assert.Empty(t1.
GetAttributes
());
93937
Assert.Empty(t2.
GetAttributes
());
93941
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.
GetAttributes
().Single().ToString());
93978
Assert.Empty(t1.
GetAttributes
());
93982
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.
GetAttributes
().Single().ToString());
93991
Assert.Empty(t2.
GetAttributes
());
93995
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.
GetAttributes
().Single().ToString());
94036
Assert.Empty(t1.
GetAttributes
());
94042
Assert.Empty(t2.
GetAttributes
());
94085
Assert.Empty(t1.
GetAttributes
());
94089
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t1.
GetAttributes
().Single().ToString());
94098
Assert.Empty(t2.
GetAttributes
());
94102
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.
GetAttributes
().Single().ToString());
94694
Assert.Empty(bf1.
GetAttributes
());
94698
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
94702
Assert.Empty(t11.
GetAttributes
());
94708
Assert.Empty(bf2.
GetAttributes
());
94712
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.
GetAttributes
().Single().ToString());
94717
Assert.Empty(t22.
GetAttributes
());
94885
Assert.Empty(bf1.
GetAttributes
());
94889
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
94893
Assert.Empty(t11.
GetAttributes
());
94899
Assert.Empty(bf2.
GetAttributes
());
94903
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.
GetAttributes
().Single().ToString());
94908
Assert.Empty(t22.
GetAttributes
());
94992
Assert.Empty(bf1.
GetAttributes
());
94996
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
95000
Assert.Empty(t11.
GetAttributes
());
95006
Assert.Empty(bf2.
GetAttributes
());
95010
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.
GetAttributes
().Single().ToString());
95015
Assert.Empty(t22.
GetAttributes
());
95058
Assert.Empty(bf1.
GetAttributes
());
95062
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
95066
Assert.Empty(t11.
GetAttributes
());
95072
Assert.Empty(bf2.
GetAttributes
());
95076
CSharpAttributeData nullableAttribute = bf2.
GetAttributes
().Single();
95084
Assert.Empty(t22.
GetAttributes
());
95130
Assert.Empty(bf1.
GetAttributes
());
95134
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
95139
Assert.Empty(t11.
GetAttributes
());
95145
Assert.Empty(bf2.
GetAttributes
());
95149
CSharpAttributeData nullableAttribute = bf2.
GetAttributes
().Single();
95156
Assert.Empty(t22.
GetAttributes
());
95199
Assert.Empty(bf1.
GetAttributes
());
95203
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
95207
Assert.Empty(t11.
GetAttributes
());
95213
Assert.Empty(bf2.
GetAttributes
());
95217
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.
GetAttributes
().Single().ToString());
95222
Assert.Empty(t22.
GetAttributes
());
95289
Assert.Empty(f2.
GetAttributes
());
95293
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", f2.
GetAttributes
().Single().ToString());
95297
Assert.Empty(t2.
GetAttributes
());
95324
Assert.Empty(t2.
GetAttributes
());
95328
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.
GetAttributes
().Single().ToString());
95365
Assert.Empty(t2.
GetAttributes
());
95573
Assert.Empty(bf1.
GetAttributes
());
95577
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
95581
Assert.Empty(t11.
GetAttributes
());
95587
Assert.Empty(bf2.
GetAttributes
());
95591
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.
GetAttributes
().Single().ToString());
95596
Assert.Empty(t22.
GetAttributes
());
96567
Assert.Empty(f1.
GetAttributes
());
96571
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.
GetAttributes
().Single().ToString());
96576
var attributes = t1.
GetAttributes
();
96605
Assert.Empty(f1.
GetAttributes
());
96609
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.
GetAttributes
().Single().ToString());
96615
var attributes = t1.
GetAttributes
();
96658
Assert.Empty(t1.
GetAttributes
());
96665
Assert.Empty(t2.
GetAttributes
());
96697
Assert.Empty(t1.
GetAttributes
());
96717
Assert.Empty(t1.
GetAttributes
());
96773
Assert.Empty(t1.
GetAttributes
());
96781
Assert.Empty(t2.
GetAttributes
());
96816
Assert.Empty(t1.
GetAttributes
());
96823
Assert.Empty(t2.
GetAttributes
());
96861
Assert.Empty(t1.
GetAttributes
());
96868
Assert.Empty(t2.
GetAttributes
());
96944
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.
GetAttributes
().Single().ToString());
96953
Assert.Empty(at1.
GetAttributes
());
96958
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.
GetAttributes
().Single().ToString());
96974
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.
GetAttributes
().Single().ToString());
96982
Assert.Empty(tf1.
GetAttributes
());
96987
var attributes = tf1.
GetAttributes
();
97039
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.
GetAttributes
().Single().ToString());
97048
Assert.Empty(at1.
GetAttributes
());
97053
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.
GetAttributes
().Single().ToString());
97067
Assert.Empty(bf1.
GetAttributes
());
97075
Assert.Empty(tf1.
GetAttributes
());
97080
Assert.Empty(tf1.
GetAttributes
());
98202
Assert.Empty(tf1.
GetAttributes
());
98226
Assert.Empty(tf1.
GetAttributes
());
98254
Assert.Empty(tf1.
GetAttributes
());
98281
Assert.Empty(tf1.
GetAttributes
());
98308
Assert.Empty(tf1.
GetAttributes
());
98335
Assert.Empty(tf1.
GetAttributes
());
98362
Assert.Empty(tf1.
GetAttributes
());
98393
Assert.Empty(i1.
GetAttributes
());
98397
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98404
Assert.Empty(tf1.
GetAttributes
());
98435
Assert.Empty(tf1.
GetAttributes
());
98462
Assert.Empty(i1.
GetAttributes
());
98466
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98473
Assert.Empty(tf1.
GetAttributes
());
98496
Assert.Empty(i1.
GetAttributes
());
98500
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98508
Assert.Empty(tf1.
GetAttributes
());
98536
Assert.Empty(i1.
GetAttributes
());
98540
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98547
Assert.Empty(tf1.
GetAttributes
());
98574
Assert.Empty(i1.
GetAttributes
());
98578
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.
GetAttributes
().Single().ToString());
98585
Assert.Empty(tf1.
GetAttributes
());
98612
var attributes = tf1.
GetAttributes
();
98640
var attributes = tf1.
GetAttributes
();
98668
var attributes = tf1.
GetAttributes
();
98696
Assert.Empty(i1.
GetAttributes
());
98700
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98707
var attributes = tf1.
GetAttributes
();
98735
var attributes = tf1.
GetAttributes
();
98762
Assert.Empty(tf1.
GetAttributes
());
98785
Assert.Empty(tf1.
GetAttributes
());
98812
Assert.Empty(tf1.
GetAttributes
());
98838
Assert.Empty(tf1.
GetAttributes
());
98864
Assert.Empty(tf1.
GetAttributes
());
98890
Assert.Empty(tf1.
GetAttributes
());
98916
Assert.Empty(tf1.
GetAttributes
());
98947
Assert.Empty(i1.
GetAttributes
());
98951
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
98956
var attributes = tf1.
GetAttributes
();
98987
Assert.Empty(tf1.
GetAttributes
());
99014
Assert.Empty(i1.
GetAttributes
());
99018
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99023
var attributes = tf1.
GetAttributes
();
99047
Assert.Empty(i1.
GetAttributes
());
99051
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99057
var attributes = tf1.
GetAttributes
();
99086
Assert.Empty(i1.
GetAttributes
());
99090
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99095
var attributes = tf1.
GetAttributes
();
99123
Assert.Empty(i1.
GetAttributes
());
99127
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.
GetAttributes
().Single().ToString());
99132
var attributes = tf1.
GetAttributes
();
99159
var attributes = tf1.
GetAttributes
();
99186
var attributes = tf1.
GetAttributes
();
99213
var attributes = tf1.
GetAttributes
();
99241
Assert.Empty(i1.
GetAttributes
());
99245
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99250
var attributes = tf1.
GetAttributes
();
99277
var attributes = tf1.
GetAttributes
();
99309
var attributes = tf1.
GetAttributes
();
99341
Assert.Empty(i1.
GetAttributes
());
99345
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99350
var attributes = tf1.
GetAttributes
();
99384
Assert.Empty(i1.
GetAttributes
());
99388
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99393
var attributes = tf1.
GetAttributes
();
99428
Assert.Empty(i1.
GetAttributes
());
99432
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.
GetAttributes
().Single().ToString());
99437
var attributes = tf1.
GetAttributes
();
101086
Assert.Empty(t11.
GetAttributes
());
101090
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t11.
GetAttributes
().Single().ToString());
101099
Assert.Empty(t1.
GetAttributes
());
101103
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.
GetAttributes
().Single().ToString());
101113
Assert.Empty(t22.
GetAttributes
());
101117
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t22.
GetAttributes
().Single().ToString());
101127
Assert.Empty(t2.
GetAttributes
());
101131
Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.
GetAttributes
().Single().ToString());
101178
Assert.Empty(b.
GetAttributes
());
101182
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.
GetAttributes
().First().ToString());
101188
Assert.Empty(t11.
GetAttributes
());
101197
Assert.Empty(t22.
GetAttributes
());
101201
CSharpAttributeData nullableAttribute = t22.
GetAttributes
().Single();
101255
Assert.Empty(b.
GetAttributes
());
101259
Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.
GetAttributes
().First().ToString());
101265
Assert.Empty(t11.
GetAttributes
());
101274
Assert.Empty(t22.
GetAttributes
());
101278
CSharpAttributeData nullableAttribute = t22.
GetAttributes
().Single();
104549
Assert.Empty(tm1.
GetAttributes
());
120191
Assert.Empty(f.
GetAttributes
());
120195
Assert.Equal(baseline[i].attribute, f.
GetAttributes
().Single().ToString());
120469
Assert.Equal(typeParametersBaseline[i].attribute, t.
GetAttributes
().Single().ToString());
Semantics\PrimaryConstructorTests.cs (9)
2939
return GetAttributeStrings(symbol.
GetAttributes
());
2994
Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].
GetAttributes
());
2995
Assert.Equal(2, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].
GetAttributes
().Count());
3037
Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].
GetAttributes
());
3038
Assert.Equal(1, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].
GetAttributes
().Count());
14698
var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().
GetAttributes
();
14720
var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().
GetAttributes
();
14741
var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().
GetAttributes
();
14762
var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().
GetAttributes
();
Semantics\RawInterpolationTests_Handler.cs (42)
3226
Assert.Equal("Attr..ctor(CustomHandler c)", attr.
GetAttributes
().Single().AttributeConstructor.ToTestDisplayString());
3251
Assert.Equal("Attr..ctor(System.String s)", attr.
GetAttributes
().Single().AttributeConstructor.ToTestDisplayString());
5078
sParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5106
sParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5143
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5183
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5230
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5270
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5317
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5360
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5407
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5447
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5494
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5534
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5581
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5628
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5675
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5715
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5764
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5804
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5853
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5899
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5946
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
5976
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6102
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6171
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6201
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6438
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6500
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6622
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6854
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
6981
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7134
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7247
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7318
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7378
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7496
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7614
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
7742
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8015
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8094
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
8521
cParam.
GetAttributes
().Single().AttributeClass.ToTestDisplayString());
Semantics\RecordStructTests.cs (1)
10522
return GetAttributeStrings(symbol.
GetAttributes
().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D"));
Semantics\RecordTests.cs (7)
25117
return GetAttributeStrings(symbol.
GetAttributes
().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D"));
25177
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
25254
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
25315
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
25396
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
25480
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
25544
return GetAttributeStrings(symbol.
GetAttributes
().Where(a =>
Semantics\RefFieldTests.cs (1)
11506
var attribute = parameter.
GetAttributes
().FirstOrDefault(a => a.GetTargetAttributeSignatureIndex(parameter, AttributeDescription.ScopedRefAttribute) != -1);
Semantics\TopLevelStatementsTests.cs (9)
6159
var programAttributes = GetAttributeNames(program.
GetAttributes
().As<CSharpAttributeData>());
6171
Assert.Empty(method.
GetAttributes
());
6177
Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(localFn1.
GetAttributes
().As<CSharpAttributeData>()));
9055
Assert.Empty(program.
GetAttributes
().As<CSharpAttributeData>());
9059
Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(program.
GetAttributes
().As<CSharpAttributeData>()));
9061
Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).
GetAttributes
());
9106
Assert.Empty(program.
GetAttributes
().As<CSharpAttributeData>());
9108
Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).
GetAttributes
().As<CSharpAttributeData>());
9493
var fieldAttributes = GetAttributeNames(field.
GetAttributes
().As<CSharpAttributeData>());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (131)
Symbols\AnonymousTypesSymbolTests.cs (1)
1147
var actual = symbol.
GetAttributes
();
Symbols\DefaultInterfaceImplementationTests.cs (12)
10908
Assert.Equal(2, m2.
GetAttributes
().Length);
10909
Assert.Equal("Test2(1)", m2.
GetAttributes
()[0].ToString());
10910
Assert.Equal("Test2(2)", m2.
GetAttributes
()[1].ToString());
10926
Assert.Equal(2, m2Impl.
GetAttributes
().Length);
10927
Assert.Equal("Test2(1)", m2Impl.
GetAttributes
()[0].ToString());
10928
Assert.Equal("Test2(2)", m2Impl.
GetAttributes
()[1].ToString());
11015
Assert.Equal(2, m2.
GetAttributes
().Length);
11016
Assert.Equal("Test2(1)", m2.
GetAttributes
()[0].ToString());
11017
Assert.Equal("Test2(2)", m2.
GetAttributes
()[1].ToString());
11033
Assert.Equal(2, m2Impl.
GetAttributes
().Length);
11034
Assert.Equal("Test2(1)", m2Impl.
GetAttributes
()[0].ToString());
11035
Assert.Equal("Test2(2)", m2Impl.
GetAttributes
()[1].ToString());
Symbols\ImplicitClassTests.cs (2)
32
Assert.Equal(0, implicitClass.
GetAttributes
().Length);
61
Assert.Equal(0, scriptClass.
GetAttributes
().Length);
Symbols\IndexerTests.cs (1)
2130
Assert.True(indexer.
GetAttributes
().Single().IsTargetAttribute(indexer, AttributeDescription.IndexerNameAttribute));
Symbols\Metadata\PE\LoadingAttributes.cs (71)
205
c1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "C1");
208
innerC1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "InnerC1");
215
innerC2.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "InnerC2");
218
field1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "field1");
221
property1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "Property1");
224
sub1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "Sub1");
227
sub1P1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "p1");
230
function1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "Function1");
385
c1.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, "C1");
432
l.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<>");
435
l.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<C1>");
438
l.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.String>");
441
l.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<C1, System.String>>");
444
l.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, C1.InnerC1<System.Int32>.InnerC2<System.String, System.String>>>");
476
var arg = field.
GetAttributes
().Single();
480
arg = field.
GetAttributes
().Single();
484
arg = field.
GetAttributes
().Single();
488
arg = field.
GetAttributes
().Single();
492
arg = field.
GetAttributes
().Single();
496
var t = field.
GetAttributes
().First().CommonConstructorArguments.Single().Type;
498
arg = field.
GetAttributes
().Single();
502
arg = field.
GetAttributes
().Single();
508
arg = field.
GetAttributes
().Single();
546
foreach (var sa in s.
GetAttributes
())
598
var attrs = asm.
GetAttributes
();
688
Assert.Equal(4, igoo.
GetAttributes
().Length);
711
Assert.Equal(1, mem.
GetAttributes
().Length);
713
Assert.Equal(1, mem.
GetAttributes
().Length);
715
Assert.Equal(1, mem.
GetAttributes
().Length);
717
attrSym = mem.
GetAttributes
().First();
742
Assert.Equal(2, dfoo.
GetAttributes
().Length);
781
var modattr = assemblies[0].Modules[0].
GetAttributes
().First();
787
Assert.Equal(2, myEnum.
GetAttributes
().Length);
791
Assert.Equal(0, field.
GetAttributes
().Length);
794
Assert.Equal(1, field.
GetAttributes
().Length);
795
var attrSym = field.
GetAttributes
().First();
848
Assert.Equal(5, ibar.
GetAttributes
().Length);
849
var atts = ibar.
GetAttributes
();
863
mem.
GetAttributes
().First().VerifyValue(0, TypedConstantKind.Primitive, 10);
871
Assert.Equal(1, mem2.
GetAttributes
().Length);
875
Assert.Equal(1, mem2.
GetAttributes
().Length);
894
Assert.Equal(1, mem2.
GetAttributes
().Length);
895
attrSym = mem2.
GetAttributes
().First();
920
Assert.Equal(4, assemblies[0].
GetAttributes
().Length);
929
attrSym = assemblies[0].Modules[0].
GetAttributes
().First();
964
var attrSym = tp.
GetAttributes
().First();
985
Assert.Equal(1, mtd.
GetAttributes
().Length);
986
attrSym = mtd.
GetAttributes
().First();
1060
var attrs = (from a in foo.
GetAttributes
()
1064
Assert.Equal(foo.
GetAttributes
().Length, attrs.Count());
1109
Assert.Equal(2, tp.
GetAttributes
().Length);
1113
Assert.Equal(2, fld.
GetAttributes
().Length);
1114
Assert.Equal(0, fld.
GetAttributes
().First().CommonNamedArguments.Length);
1118
Assert.Equal(1, prop.
GetAttributes
().Length);
1119
Assert.Equal(-1, prop.
GetAttributes
().First().CommonConstructorArguments[0].Value);
1121
Assert.Equal(3, prop.GetMethod.
GetAttributes
().Length);
1122
Assert.Equal(1, prop.SetMethod.
GetAttributes
().Length);
1128
Assert.Equal(3, mtd.
GetAttributes
().Length);
1130
attrs = (from a in mtd.
GetAttributes
()
1141
attrs = (from a in mtd.
GetAttributes
()
1241
var attr = prop.
GetAttributes
().First();
1433
Assert.Empty(field1.
GetAttributes
());
1438
Assert.Equal(2, field2.
GetAttributes
().Length);
1444
Assert.Empty(parameters.First().
GetAttributes
());
1447
Assert.Empty(parameters.Last().
GetAttributes
());
1461
Assert.Empty(field1.
GetAttributes
());
1466
Assert.Equal(2, field2.
GetAttributes
().Length);
1472
Assert.Empty(parameters.First().
GetAttributes
());
1475
Assert.Empty(parameters.Last().
GetAttributes
());
1514
Assert.Equal(expected, c.GetTypeByMetadataName("Test").
GetAttributes
().Single().ToString());
1518
Assert.Equal(expected, m.GlobalNamespace.GetTypeMember("Test").
GetAttributes
().Single().ToString());
Symbols\Metadata\PE\LoadingNamespacesAndTypes.cs (1)
260
Assert.Equal(0, collections.
GetAttributes
().Length);
Symbols\RequiredMembersTests.cs (18)
59
Assert.All(member.
GetAttributes
(), attr => AssertEx.NotEqual("System.Runtime.CompilerServices.RequiredMemberAttribute", attr.AttributeClass.ToTestDisplayString()));
88
var ctorAttributes = ctor.
GetAttributes
();
3323
var attr = c.
GetAttributes
().Single();
3352
var attr = attrAttribute.
GetAttributes
().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single();
3382
var attr = p.
GetAttributes
().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single();
3412
var attr = f.
GetAttributes
().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single();
5215
Assert.Empty(copyCtor.
GetAttributes
());
5220
copyCtor.
GetAttributes
().Single(a => a.AttributeClass!.IsWellKnownSetsRequiredMembersAttribute()).AttributeConstructor.ToTestDisplayString());
5277
Assert.Empty(copyCtor.
GetAttributes
());
5282
copyCtor.
GetAttributes
().Single(a => a.AttributeClass!.IsWellKnownSetsRequiredMembersAttribute()).AttributeConstructor.ToTestDisplayString());
5440
var attrData = ctor.
GetAttributes
().Single();
5486
var attrData = ctor.
GetAttributes
().Single();
5734
Assert.Empty(c.
GetAttributes
());
5735
Assert.Empty(field1.
GetAttributes
());
5736
Assert.Empty(property1.
GetAttributes
());
5737
Assert.Empty(d.
GetAttributes
());
5738
Assert.Empty(field2.
GetAttributes
());
5739
Assert.Empty(property2.
GetAttributes
());
Symbols\Retargeting\NoPia.cs (18)
2056
var args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2071
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2086
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2101
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2181
var args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2196
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2211
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2226
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2306
var args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2321
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2336
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2351
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2418
var args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2433
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2514
var args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2529
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2544
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
2559
args = attrTest1.
GetAttributes
()[0].CommonConstructorArguments;
Symbols\Retargeting\RetargetCustomAttributes.cs (4)
103
TestAttributeRetargeting(symbol.
GetAttributes
());
303
var attr = c.
GetAttributes
().Single();
349
var a = c1.
GetAttributes
().Single();
391
var a = c1.
GetAttributes
().Single();
Symbols\TypeTests.cs (3)
500
Assert.Equal(0, retType.
GetAttributes
().Length); // Enumerable.Empty<SymbolAttribute>()
1879
i1.
GetAttributes
();
1931
i1.
GetAttributes
();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (12)
Extensions.cs (7)
329
return @this.
GetAttributes
().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2));
334
return @this.
GetAttributes
().Where(a => a.IsTargetAttribute(namespaceName, typeName));
339
return @this.
GetAttributes
().Where(a => a.IsTargetAttribute(@this, description));
344
return @this.
GetAttributes
().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2)).First();
349
return @this.
GetAttributes
().Where(a => a.IsTargetAttribute(namespaceName, typeName)).First();
354
return (from a in @this.
GetAttributes
()
361
return (from a in @this.
GetAttributes
()
NullableAttributesVisitor.cs (4)
37
_nullableContext = GetNullableContextAttribute(type.
GetAttributes
()) ?? _nullableContext;
47
_nullableContext = GetNullableContextAttribute(method.
GetAttributes
()) ?? _nullableContext;
63
var nullableContextAttribute = GetNullableContextAttribute(symbol.
GetAttributes
());
64
var nullableAttribute = GetNullableAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.
GetAttributes
());
TestAttributesVisitor.cs (1)
141
var attribute = GetTargetAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.
GetAttributes
());
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
44
if (container.
GetAttributes
().Length > 0)
221
var attributes = symbol.
GetAttributes
();