4 overrides of GetReturnTypeAttributes
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1080public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() => Signature.ReturnParam.GetAttributes();
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
222public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
325public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
Symbols\SubstitutedMethodSymbol.cs (1)
211public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
140 references to GetReturnTypeAttributes
Microsoft.CodeAnalysis.CSharp (8)
Compiler\ClsComplianceChecker.cs (2)
591CheckForAttributeWithArrayArgumentInternal(((MethodSymbol)symbol).GetReturnTypeAttributes()); 705if (TryGetClsComplianceAttributeLocation(method.GetReturnTypeAttributes(), out attributeLocation))
Emitter\Model\MethodSymbolAdapter.cs (1)
512ImmutableArray<CSharpAttributeData> userDefined = AdaptedMethodSymbol.GetReturnTypeAttributes();
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
611if (!lambda.GetAttributes().IsEmpty || !lambda.GetReturnTypeAttributes().IsEmpty)
Lowering\SynthesizedMethodBaseSymbol.cs (1)
161return InheritsBaseMethodAttributes ? BaseMethod.GetReturnTypeAttributes() : ImmutableArray<CSharpAttributeData>.Empty;
Symbols\PublicModel\MethodSymbol.cs (1)
268return _underlying.GetReturnTypeAttributes().Cast<CSharpAttributeData, AttributeData>();
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
224return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingMethod.GetReturnTypeAttributes(), ref _lazyReturnTypeCustomAttributes);
Symbols\SubstitutedMethodSymbol.cs (1)
213return this.OriginalDefinition.GetReturnTypeAttributes();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenDynamicTests.cs (1)
690var attributes = ((MethodSymbol)member).GetReturnTypeAttributes();
CodeGen\CodeGenLocalFunctionTests.cs (6)
5242var attrs2 = localFn2.GetReturnTypeAttributes(); 5362Assert.Empty(localFn1.GetReturnTypeAttributes()); 5396Assert.Equal("DynamicAttribute", localFn1.GetReturnTypeAttributes().Single().AttributeClass.Name); 5429Assert.Empty(localFn1.GetReturnTypeAttributes()); 5637Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.GetReturnTypeAttributes())); 5648Assert.Empty(localFn1.GetReturnTypeAttributes());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (98)
Attributes\AttributeTests.cs (16)
2695Assert.Equal("JJ", event10.AddMethod.GetReturnTypeAttributes().Single().AttributeClass.Name); 2883Assert.Equal(1, invokeMethod.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, returnTypeAttrType, TypeCompareKind.ConsiderEverything2)).Count()); 2898Assert.Equal(0, ctor.GetReturnTypeAttributes().Length); 2908Assert.Equal(0, beginInvokeMethod.GetReturnTypeAttributes().Length); 2925Assert.Equal(1, endInvokeMethod.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, returnTypeAttrType, TypeCompareKind.ConsiderEverything2)).Count()); 3793var attrs = getter.GetReturnTypeAttributes(); 3799attrs = setter.GetReturnTypeAttributes(); 3805attrs = method.GetReturnTypeAttributes(); 3814attrs = invokeMethod.GetReturnTypeAttributes(); 3820attrs = ctor.GetReturnTypeAttributes(); 3824attrs = beginInvokeMethod.GetReturnTypeAttributes(); 3828attrs = endInvokeMethod.GetReturnTypeAttributes(); 4020attrs = setter.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, attributeTypeForReturn, TypeCompareKind.ConsiderEverything2)); 4033attrs = getter.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, attributeTypeForReturn, TypeCompareKind.ConsiderEverything2)); 5094Assert.Equal(1, gooMethod.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, b1Class, TypeCompareKind.ConsiderEverything2)).Count()); 5095Assert.Equal(1, gooMethod.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, b2Class, TypeCompareKind.ConsiderEverything2)).Count());
Attributes\AttributeTests_Conditional.cs (4)
147attributesArrayBuilder.Add(methodM.GetReturnTypeAttributes()); 158attributesArrayBuilder.Add(propGetMethod.GetReturnTypeAttributes()); 167attributesArrayBuilder.Add(propGetMethod.GetReturnTypeAttributes()); 173attributesArrayBuilder.Add(propGetMethod.GetReturnTypeAttributes());
Attributes\AttributeTests_Dynamic.cs (13)
334ValidateDynamicAttribute(f1.GetReturnTypeAttributes(), expectedDynamicAttribute: true); 344ValidateDynamicAttribute(f2.GetReturnTypeAttributes(), expectedDynamicAttribute: true); 355ValidateDynamicAttribute(f3.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 366ValidateDynamicAttribute(f4.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 377ValidateDynamicAttribute(f5.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 391ValidateDynamicAttribute(prop1.GetMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: true); 402ValidateDynamicAttribute(prop2.GetMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 422ValidateDynamicAttribute(indexer.GetMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: true); 430ValidateDynamicAttribute(indexer.SetMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: false); 471ValidateDynamicAttribute(ctor.GetReturnTypeAttributes(), expectedDynamicAttribute: false); 487ValidateDynamicAttribute(invokeMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 499ValidateDynamicAttribute(beginInvokeMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: false); 515ValidateDynamicAttribute(endInvokeMethod.GetReturnTypeAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags);
Attributes\AttributeTests_NativeInteger.cs (2)
1087AssertNativeIntegerAttribute(method.GetReturnTypeAttributes()); 1134AssertNativeIntegerAttribute(method.GetReturnTypeAttributes());
Attributes\AttributeTests_Nullable.cs (6)
2171AssertNullableAttribute(method.GetReturnTypeAttributes()); 2224AssertAttributes(method.GetReturnTypeAttributes()); 2277AssertNullableAttribute(method.GetReturnTypeAttributes()); 2510AssertNullableAttribute(method.GetReturnTypeAttributes()); 2537AssertNullableAttribute(method.GetReturnTypeAttributes()); 2563AssertNullableAttribute(method.GetReturnTypeAttributes());
Attributes\AttributeTests_RefReadOnly.cs (26)
45Assert.Empty(method.GetReturnTypeAttributes()); 95Assert.Empty(method.GetReturnTypeAttributes()); 127Assert.Empty(method.GetReturnTypeAttributes()); 508Assert.Empty(method.GetReturnTypeAttributes()); 539Assert.Empty(method.GetReturnTypeAttributes()); 568Assert.Empty(method.GetReturnTypeAttributes()); 605Assert.Empty(method.GetReturnTypeAttributes()); 655Assert.Empty(method.GetReturnTypeAttributes()); 693Assert.Empty(method.GetReturnTypeAttributes()); 732Assert.Empty(method.GetReturnTypeAttributes()); 786Assert.Empty(method.GetReturnTypeAttributes()); 826Assert.Empty(method.GetReturnTypeAttributes()); 1309Assert.Empty(method.GetReturnTypeAttributes()); 1346Assert.Empty(method.GetReturnTypeAttributes()); 1592Assert.Empty(method.GetReturnTypeAttributes()); 1634Assert.Empty(method.GetReturnTypeAttributes()); 1678Assert.Empty(method.GetReturnTypeAttributes()); 1727Assert.Empty(method.GetReturnTypeAttributes()); 1774Assert.Empty(method.GetReturnTypeAttributes()); 1818Assert.Empty(method.GetReturnTypeAttributes()); 1867Assert.Empty(method.GetReturnTypeAttributes()); 1907Assert.Empty(method.GetReturnTypeAttributes()); 1976Assert.Empty(method.GetReturnTypeAttributes()); 2025Assert.Empty(method.GetReturnTypeAttributes()); 2065Assert.Empty(method.GetReturnTypeAttributes()); 2107Assert.Empty(method.GetReturnTypeAttributes());
Attributes\AttributeTests_Synthesized.cs (2)
583Assert.Empty(baseMethodWrapper.GetReturnTypeAttributes()); 626Assert.Empty(baseMethodWrapper.GetReturnTypeAttributes());
Attributes\AttributeTests_Tuples.cs (5)
529ValidateTupleNameAttribute(method1.GetReturnTypeAttributes(), 543ValidateTupleNameAttribute(method3.GetReturnTypeAttributes(), 554ValidateTupleNameAttribute(method4.GetReturnTypeAttributes(), 569ValidateTupleNameAttribute(method5.GetReturnTypeAttributes(), expectedTupleNamesAttribute: false); 582ValidateTupleNameAttribute(method6.GetReturnTypeAttributes(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames);
PartialEventsAndConstructorsTests.cs (8)
3383AssertEx.Equal(["A(33)"], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 3386AssertEx.Equal(["A(34)"], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3394AssertEx.Equal(["A(33)"], eImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3397AssertEx.Equal(["A(34)"], eImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3404AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 3407AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3415AssertEx.Equal([], fImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3418AssertEx.Equal([], fImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings());
Semantics\ExtensionTests2.cs (13)
1005m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1630m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1632Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").GetReturnTypeAttributes()); 1635Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P2").GetReturnTypeAttributes()); 1637Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P2").GetReturnTypeAttributes()); 1697m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1699Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").GetReturnTypeAttributes()); 1702Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P2").GetReturnTypeAttributes()); 1704Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P2").GetReturnTypeAttributes()); 1748Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").GetReturnTypeAttributes()); 1751Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P2").GetReturnTypeAttributes()); 1811Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").GetReturnTypeAttributes()); 1814Assert.Empty(m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P2").GetReturnTypeAttributes());
Semantics\PrimaryConstructorTests.cs (3)
3252Assert.True(c.Constructors.All(ctor => ctor.GetReturnTypeAttributes().IsEmpty)); 3328Assert.True(e.Constructors.All(ctor => ctor.GetReturnTypeAttributes().IsEmpty)); 3360Assert.True(c.Constructors.All(ctor => ctor.GetReturnTypeAttributes().IsEmpty));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\LambdaTests.cs (1)
3632return format(expr, method.GetAttributes(), method.GetReturnTypeAttributes(), method.Parameters.SelectMany(p => p.GetAttributes()));
Semantics\NullableReferenceTypesTests.cs (5)
30204var getterReturnAttributes = getter.GetReturnTypeAttributes().Select(a => a.ToString()); 30227var setterReturnAttributes = setter.GetReturnTypeAttributes(); 30307var getterReturnAttributes = getter.GetReturnTypeAttributes().Select(a => a.ToString()); 40997var setterReturnAttributes = setter.GetReturnTypeAttributes(); 48001var getterReturnAttributes = getter.GetReturnTypeAttributes().Select(a => a.ToString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (19)
Symbols\ExtendedPartialMethodsTests.cs (3)
2317Assert.Equal(expectedAttributeNames, GetAttributeNames(definitionPart.GetReturnTypeAttributes())); 2322Assert.Equal(expectedAttributeNames, GetAttributeNames(implementationPart.GetReturnTypeAttributes())); 2330Assert.Equal(expectedAttributeNames, GetAttributeNames(method.GetReturnTypeAttributes()));
Symbols\Metadata\PE\LoadingAttributes.cs (5)
388var attr = property1.GetMethod.GetReturnTypeAttributes().First(); 391Assert.Equal(0, property1.SetMethod.GetReturnTypeAttributes().Length); 394attr = function1.GetReturnTypeAttributes().First(); 398Assert.Equal(0, sub1.GetReturnTypeAttributes().Length); 995attrSym = mtd.GetReturnTypeAttributes().First();
Symbols\Retargeting\RetargetCustomAttributes.cs (5)
125TestAttributeRetargeting(symbol.GetReturnTypeAttributes()); 128TestAttributeRetargeting(symbol.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, newMsCorLib_debuggerTypeProxyAttributeType, TypeCompareKind.ConsiderEverything2))); 131Assert.Empty(symbol.GetReturnTypeAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, oldMsCorLib_debuggerTypeProxyAttributeType, TypeCompareKind.ConsiderEverything2))); 134TestAttributeRetargeting(symbol.GetReturnTypeAttributes().Where(a => a.AttributeConstructor == newMsCorLib_debuggerTypeProxyAttributeCtor)); 137Assert.Empty(symbol.GetReturnTypeAttributes().Where(a => a.AttributeConstructor == oldMsCorLib_debuggerTypeProxyAttributeCtor));
Symbols\Source\EventTests.cs (6)
2861AssertEx.Equal([], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 2864AssertEx.Equal([], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2871AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 2874AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2880AssertEx.Equal(["A(24)"], g.AddMethod.GetReturnTypeAttributes().ToStrings()); 2883AssertEx.Equal(["A(34)"], g.RemoveMethod.GetReturnTypeAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
NullableAttributesVisitor.cs (1)
64var nullableAttribute = GetNullableAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes());
TestAttributesVisitor.cs (1)
141var attribute = GetTargetAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes());