4 overrides of AddMethod
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Metadata\PE\PEEventSymbol.cs (1)
334public override MethodSymbol AddMethod
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
57public override MethodSymbol? AddMethod
Symbols\Source\SourceEventSymbol.cs (1)
90public abstract override MethodSymbol? AddMethod { get; }
Symbols\SubstitutedEventSymbol.cs (1)
59public override MethodSymbol? AddMethod
389 references to AddMethod
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder_Lookup.cs (1)
1629method1 = @event.AddMethod;
Binder\Binder_Operators.cs (1)
683MethodSymbol method = isAddition ? eventSymbol.AddMethod : eventSymbol.RemoveMethod;
Compilation\CSharpSemanticModel.cs (1)
3511var methodSymbol = eventAssignment.IsAddition ? eventSymbol.AddMethod : eventSymbol.RemoveMethod;
Emitter\Model\EventSymbolAdapter.cs (2)
31var addMethod = AdaptedEventSymbol.AddMethod?.GetCciAdapter(); 51var addMethod = AdaptedEventSymbol.AddMethod?.GetCciAdapter();
Emitter\NoPia\EmbeddedTypesManager.cs (1)
571var addMethod = @event.AdaptedEventSymbol.AddMethod?.GetCciAdapter();
Lowering\LocalRewriter\LocalRewriter_Event.cs (2)
56MethodSymbol? method = node.IsAddition ? node.Event.AddMethod : node.Event.RemoveMethod; 146methodOpt: eventSymbol.AddMethod,
Symbols\EventSymbol.cs (1)
162MethodSymbol? accessor = AddMethod ?? RemoveMethod;
Symbols\MemberSymbolExtensions.cs (2)
374return isImplementableAndNotPublic(eventSymbol.AddMethod) || isImplementableAndNotPublic(eventSymbol.RemoveMethod); 732MethodSymbol addMethod = @event.AddMethod;
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
352MethodSymbol correspondingAccessor = accessorIsAdder ? eventHiddenByEvent.AddMethod : eventHiddenByEvent.RemoveMethod;
Symbols\PublicModel\EventSymbol.cs (1)
44return _underlying.AddMethod.GetPublicSymbol();
Symbols\Retargeting\RetargetingEventSymbol.cs (2)
61return (object?)_underlyingEvent.AddMethod == null 63: this.RetargetingTranslator.Retarget(_underlyingEvent.AddMethod);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
324checkAccessorIsAccessibleIfImplementable(eventSymbol.AddMethod);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
60MethodSymbol implementedAccessor = isAdder ? explicitlyImplementedEventOpt.AddMethod : explicitlyImplementedEventOpt.RemoveMethod;
Symbols\Source\SourceEventSymbol.cs (1)
847CheckExplicitImplementationAccessor(AddMethod, explicitlyImplementedEvent.AddMethod, explicitlyImplementedEvent, diagnostics);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4446var locationFrom = (Symbol?)(isAdder ? propertySymbol.AddMethod : propertySymbol.RemoveMethod) ?? propertySymbol;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
613var addMethod = @event.AddMethod;
Symbols\SubstitutedEventSymbol.cs (1)
63MethodSymbol? originalAddMethod = OriginalDefinition.AddMethod;
Symbols\TypeSymbol.cs (1)
1431interfaceAccessor1 = interfaceEvent.AddMethod;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenReadonlyStructTests.cs (3)
1588verifyReadOnly(s1.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 1602verifyReadOnly(s2.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 2602Assert.True(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)testStruct.GetEvent("E").AddMethod).Handle));
CodeGen\CodeGenTupleTest.cs (5)
13274Assert.True(m10I1E1.AddMethod.IsExplicitInterfaceImplementation); 13275Assert.Equal("void I1.E1.add", m10I1E1.AddMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 16061Assert.True(m1E1Add.Equals(m1E1.AddMethod, TypeCompareKind.ConsiderEverything)); 16092Assert.NotSame(m1E2Add, m1E2.AddMethod); 16093Assert.True(m1E2Add.Equals(m1E2.AddMethod, TypeCompareKind.ConsiderEverything));
CodeGen\EventTests.cs (3)
215var addMethod = @event.AddMethod; 718var addMethod = @event.AddMethod; 790var addMethod = @event.AddMethod;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (39)
Attributes\AttributeTests.cs (12)
2635AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.AddMethod.GetAttributes())); 2645AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.AddMethod.GetAttributes())); 2654AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.AddMethod.GetAttributes())); 2663AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.AddMethod.GetAttributes())); 2672AssertNoAttributes(event5.AddMethod); 2676AssertNoAttributes(event6.AddMethod); 2680Assert.Equal("GG", GetSingleAttributeName(event7.AddMethod)); 2684Assert.Equal("HH", GetSingleAttributeName(event8.AddMethod)); 2688AssertNoAttributes(event9.AddMethod); 2690Assert.Equal("II", GetSingleAttributeName(event9.AddMethod.Parameters.Single())); 2693AssertNoAttributes(event10.AddMethod); 2695Assert.Equal("JJ", event10.AddMethod.GetReturnTypeAttributes().Single().AttributeClass.Name);
Attributes\AttributeTests_Conditional.cs (1)
180attributesArrayBuilder.Add(eventE.AddMethod.GetAttributes());
Attributes\AttributeTests_Synthesized.cs (1)
238Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.AddMethod).Handle).Single().AttributeClass.Name);
OverloadResolutionPriorityTests.cs (1)
1650Assert.Equal(0, indexer!.AddMethod!.OverloadResolutionPriority);
PartialEventsAndConstructorsTests.cs (24)
1081validateAccessor(e.AddMethod!); 1239validateAccessor(e.AddMethod!); 1571Assert.True(ev.PartialImplementationPart!.AddMethod!.GetPublicSymbol().IsExtern); 1595Assert.False(ev.AddMethod!.GetPublicSymbol().IsExtern); 1702verifyAccessor(e.AddMethod!, "add_E", "remove_E"); 1710verifyAccessor(eImpl.AddMethod!, "add_E", "remove_E"); 1779Assert.False(ev.AddMethod!.GetPublicSymbol().IsExtern); 1780Assert.Null(ev.AddMethod!.GetDllImportData()); 1781Assert.Equal(MethodImplAttributes.InternalCall, ev.AddMethod.ImplementationAttributes); 1782Assert.False(ev.AddMethod.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1902Assert.True(e.AddMethod!.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1962var addMethod = e.AddMethod!; 3381AssertEx.Equal(["A(3)", "A(13)"], e.AddMethod!.GetAttributes().ToStrings()); 3382AssertEx.Equal(["A(23)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3383AssertEx.Equal(["A(33)"], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 3392AssertEx.Equal(["A(3)", "A(13)"], eImpl.AddMethod!.GetAttributes().ToStrings()); 3393AssertEx.Equal(["A(23)"], eImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3394AssertEx.Equal(["A(33)"], eImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3402AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.AddMethod!.GetAttributes().ToStrings()); 3403AssertEx.Equal(["A(22)", "A(21)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3404AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 3413AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.AddMethod!.GetAttributes().ToStrings()); 3414AssertEx.Equal(["A(22)", "A(21)"], fImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3415AssertEx.Equal([], fImpl.AddMethod.GetReturnTypeAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InheritanceBindingTests.cs (3)
6650Assert.Equal(classEvent.AddMethod, @class.FindImplementationForInterfaceMember(interfaceEvent.AddMethod)); 6653Assert.True(classEvent.AddMethod.IsMetadataVirtual());
Semantics\InitOnlyMemberTests.cs (1)
2452Assert.False(eventSymbol.AddMethod.IsInitOnly);
Semantics\NullableReferenceTypesTests.cs (3)
12347Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12715Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12803Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (304)
DocumentationComments\EventDocumentationCommentTests.cs (2)
43Assert.Equal("M:Acme.Widget.add_E(System.Action)", eventSymbol.AddMethod.GetDocumentationCommentId()); 52Assert.Equal("M:Acme.Widget.add_F(System.Action)", eventSymbol.AddMethod.GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (1)
5007eventSymbol.AddMethod.ToDisplayParts(format),
Symbols\CovariantReturnTests.cs (2)
330if (eventSymbol.AddMethod is MethodSymbol addMethod && overriddenEvent.AddMethod is MethodSymbol overriddenAddMethod)
Symbols\CSharpCompilerFeatureRequiredTests.cs (2)
192Assert.True(onEventAdderEvent.AddMethod!.HasUnsupportedMetadata); 199Assert.False(onEventRemoverEvent.AddMethod!.HasUnsupportedMetadata);
Symbols\DefaultInterfaceImplementationTests.cs (152)
6399var addE1 = e1.AddMethod; 6486var addP1 = e1.AddMethod; 6992Assert.Same(e7.AddMethod, derived.FindImplementationForInterfaceMember(e7.AddMethod)); 6993Assert.Same(e8.AddMethod, derived.FindImplementationForInterfaceMember(e8.AddMethod)); 7168Assert.Equal("void Test.I1.E7.add", derived.FindImplementationForInterfaceMember(e7.AddMethod).ToTestDisplayString()); 7169Assert.Equal("void Test.I1.E8.add", derived.FindImplementationForInterfaceMember(e8.AddMethod).ToTestDisplayString()); 7275Assert.Equal("void Test.E7.add", derived.FindImplementationForInterfaceMember(e7.AddMethod).ToTestDisplayString()); 7276Assert.Equal("void Test.E8.add", derived.FindImplementationForInterfaceMember(e8.AddMethod).ToTestDisplayString()); 7397Assert.True(e7.AddMethod.IsVirtual); 7400Assert.True(e7.AddMethod.IsMetadataVirtual()); 7403Assert.False(e7.AddMethod.IsAbstract); 7406Assert.Same(e7.AddMethod, derived.FindImplementationForInterfaceMember(e7.AddMethod)); 7519Assert.Null(test2.FindImplementationForInterfaceMember(e7.AddMethod)); 7794Assert.False(e7.AddMethod.IsVirtual); 7797Assert.False(e7.AddMethod.IsMetadataVirtual()); 7800Assert.False(e7.AddMethod.IsAbstract); 7803Assert.True(e7.AddMethod.IsStatic); 7806Assert.Null(derived.FindImplementationForInterfaceMember(e7.AddMethod)); 26860ValidateP01Accessor(p01.AddMethod); 26876var p02get = p02.AddMethod; 26918var p04get = p04.AddMethod; 26960var p06get = p06.AddMethod; 27002var p08get = p08.AddMethod; 27044var p10get = p10.AddMethod; 27076ValidateP11Accessor(p11.AddMethod); 27102ValidateP14Accessor(p14.AddMethod); 27659ValidateAccessor(p1.AddMethod, test1P1.AddMethod); 27732ValidateAccessor(p1.AddMethod); 27833ValidateAccessor(p1.AddMethod); 28001ValidateAccessor1(p1.AddMethod); 28028ValidateAccessor2(p2.AddMethod); 28055ValidateAccessor3(p3.AddMethod); 28162ValidateAccessor(p1.AddMethod); 28258ValidateP1Accessor(p1.AddMethod); 28285ValidateP2Accessor(p2.AddMethod); 28312ValidateP3Accessor(p3.AddMethod); 28339ValidateP4Accessor(p4.AddMethod); 28454var p1add = p1.AddMethod; 28461Assert.Same(test1P1.AddMethod, test1.FindImplementationForInterfaceMember(p1add)); 28499ValidateMethod(p1.AddMethod); 28555Assert.Null(test2.FindImplementationForInterfaceMember(p1.AddMethod)); 28697var p1Add = p1.AddMethod; 28702Assert.Same(test1P1.AddMethod, test1.FindImplementationForInterfaceMember(p1Add)); 28705Assert.True(test1P1.AddMethod.IsMetadataVirtual()); 29524Assert.Null(test1.FindImplementationForInterfaceMember(p1.AddMethod)); 29611ValidateAccessor(p1.AddMethod); 29727Validate1(p1.AddMethod); 29757Validate2(p2.AddMethod); 29787Validate3(p3.AddMethod); 30033Assert.Null(p2.AddMethod); 30040ValidateAccessor(p2.AddMethod, test1P2.AddMethod); 30043ValidateAccessor(p2.AddMethod, test1P2.AddMethod); 30140ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30170ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30200ValidateP3Accessor(p3.AddMethod); 30229ValidateP4Accessor(p4.AddMethod); 30258ValidateP5Accessor(p5.AddMethod); 30470ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30500ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30530ValidateP3Accessor(p3.AddMethod); 30559ValidateP4Accessor(p4.AddMethod); 30691ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30721ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30751ValidateP3Accessor(p3.AddMethod); 30781ValidateP4Accessor(p4.AddMethod); 30810ValidateP5Accessor(p5.AddMethod); 30891var p1add = p1.AddMethod; 30937ValidateMethod(p1.AddMethod); 31252ValidateAccessor(p1.AddMethod); 40128ValidateAccessor(expected?.AddMethod, interfaceEvent.AddMethod); 40147ValidateAccessor(expected?.AddMethod, interfaceEvent.AddMethod); 40173ValidateAccessor(m1.AddMethod, isAbstract); 57511Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 57512Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57513Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57531if (reabstracting.AddMethod is object) 57533ValidateReabstraction(reabstracting.AddMethod, isStatic); 57690Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57691Assert.Same(test12p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57838Assert.Null(i3.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57839Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57998Assert.Same(i3p1.AddMethod, i3.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57999Assert.Same(i3p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58147Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58300Assert.Null(i4.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58301Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58430Assert.Same(i4p1.AddMethod, i4.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58431Assert.Same(i4p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58503if (i1p1.AddMethod is object) 58505if (i2p1.AddMethod is object) 58507Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 58510Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58511Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58513else if (i2p1.AddMethod is object) 58515Assert.Empty(i2p1.AddMethod.ExplicitInterfaceImplementations); 58694var c2p1Add = c2p1.AddMethod; 58701Assert.Same(i1p1.AddMethod, c2p1Add.ExplicitInterfaceImplementations.Single()); 58702Assert.Same(c2p1Add, c2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58706Assert.Null(c2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59275Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 59276Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59277Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59331Assert.Empty(i2p1.AddMethod.ExplicitInterfaceImplementations); 62732Assert.Same(i1Normal.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceNormal.AddMethod)); 62735Assert.Same(i1WinRT.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62739Assert.Same(i1Normal.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceNormal.AddMethod)); 62742Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62745Assert.Equal("void I1.Interface<System.Int32>.Normal.add", i1Normal.AddMethod.ToTestDisplayString()); 62747Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.Interface<System.Int32>.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 62794Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(i1WinRT.AddMethod)); 62797Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 62854Assert.Same(i1WinRT.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62858Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62861Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.Interface.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 63164Assert.Same(i2i1E1add, test2.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63175Assert.Same(c1i1E1add, test1.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63186Assert.Same(c1i1E1add, test4.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63197Assert.Same(i2i1E1add, test3.FindImplementationForInterfaceMember(i1E1.AddMethod)); 64099Assert.Same(i2i1E1add, test2.FindImplementationForInterfaceMember(i1E1.AddMethod)); 64110Assert.Same(i2i1E1add, test3.FindImplementationForInterfaceMember(i1E1.AddMethod)); 67522Assert.Empty(m.AddMethod.ExplicitInterfaceImplementations); 67594Assert.Same(m2.AddMethod, m1.AddMethod.ExplicitInterfaceImplementations.Single());
Symbols\InterfaceImplementationTests.cs (1)
2217var interfaceAdder = interfaceEvent.AddMethod;
Symbols\Metadata\PE\LoadingEvents.cs (6)
79CheckAccessorShape(instanceEvent.AddMethod, instanceEvent); 88CheckAccessorShape(staticEvent.AddMethod, staticEvent); 99Assert.Same(@event.AddMethod, accessor); 135Assert.NotEqual(mismatchedAddEvent.Type, mismatchedAddEvent.AddMethod.Parameters.Single().Type); 158Assert.Equal(0, noParamAddEvent.AddMethod.Parameters.Length); 446var addMethod = @event.AddMethod;
Symbols\Source\EventTests.cs (32)
88var addMethod = @event.AddMethod; 126var addMethod = @event.AddMethod; 165var addMethod = @event.AddMethod; 200var addMethod = @event.AddMethod; 326Assert.NotNull(fevent.AddMethod); 327Assert.True(fevent.AddMethod.IsImplicitlyDeclared, "FieldLikeEvent AddAccessor"); 328Assert.NotNull(fevent.AddMethod); 354Assert.Equal(1, e1.AddMethod.ParameterTypesWithAnnotations.Length); 355Assert.Equal("System.Action<dynamic>", e1.AddMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 360Assert.Equal(1, e2.AddMethod.ParameterTypesWithAnnotations.Length); 361Assert.Equal("System.Action<dynamic>", e2.AddMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 1867Assert.NotNull(event1.AddMethod); 1868Assert.Equal(Accessibility.Private, event1.AddMethod.DeclaredAccessibility); 1872Assert.NotNull(event2.AddMethod); 1873Assert.Equal(Accessibility.Protected, event2.AddMethod.DeclaredAccessibility); 1877Assert.NotNull(event3.AddMethod); 1878Assert.Equal(Accessibility.Internal, event3.AddMethod.DeclaredAccessibility); 2269Assert.Equal(baseEventType, event1.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2276Assert.Equal(baseEventType, event2.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2342Assert.Equal("myAdd", event1.AddMethod.Name); 2347Assert.Equal("myAdd", event2.AddMethod.Name); 2388Assert.Equal("add_E", event1.AddMethod.Name); 2393Assert.Equal("add_E", event2.AddMethod.Name); 2859AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.AddMethod!.GetAttributes().ToStrings()); 2860AssertEx.Equal(["A(3)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2861AssertEx.Equal([], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 2869AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.AddMethod!.GetAttributes().ToStrings()); 2870AssertEx.Equal(["A(3)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2871AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 2878AssertEx.Equal(["A(21)", "A(22)"], g.AddMethod!.GetAttributes().ToStrings()); 2879AssertEx.Equal(["A(23)"], g.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2880AssertEx.Equal(["A(24)"], g.AddMethod.GetReturnTypeAttributes().ToStrings());
Symbols\StaticAbstractMembersInInterfacesTests.cs (106)
2748return addAccessor ? e.AddMethod : e.RemoveMethod; 25947Assert.Same(i6m.AddMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).AddMethod); 26036Assert.Same(i6m.AddMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).AddMethod); 26249var m01Add = m01.AddMethod; 26264var cM01Add = cM01.AddMethod; 26344var m01Add = m01.AddMethod; 26359var cM01Add = cM01.AddMethod; 26456Assert.Same(cM01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 26460Assert.Same(m01.AddMethod, cM01.AddMethod.ExplicitInterfaceImplementations.Single()); 26617Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26620Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26625Assert.Same(c1M01.AddMethod, c2.FindImplementationForInterfaceMember(m01.AddMethod)); 26630Assert.Same(c1M01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 26635Assert.Same(c1M01.AddMethod, c4.FindImplementationForInterfaceMember(m01.AddMethod)); 26642Assert.Same(c2M01.AddMethod, c5.FindImplementationForInterfaceMember(m01.AddMethod)); 26718Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26719Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26757Assert.Same(c1m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26758Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26785Assert.Same(c1m01.AddMethod, c.FindImplementationForInterfaceMember(m01.AddMethod)); 26841Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26842Assert.Null(i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26870Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26873Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26894var m01Add = m01.AddMethod; 26907var cM01Add = cM01.AddMethod; 26968Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26971Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26998Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27028Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27058Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27117Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27118Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 27145Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27194var cM01Add = cM01.AddMethod; 27206Assert.Same(cM01Add, c.FindImplementationForInterfaceMember(m01.AddMethod)); 27212Assert.Same(m01.AddMethod, cM01Add.ExplicitInterfaceImplementations.Single()); 27243Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27246Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27273Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27302Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27332Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27335Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27418Assert.Same(i2M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27419Assert.Same(i2M01.AddMethod, i2.FindImplementationForInterfaceMember(m01.AddMethod)); 27424Assert.Same(m01.AddMethod, i2M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27464var c2M01Add = (MethodSymbol)c2.FindImplementationForInterfaceMember(m01.AddMethod); 27487Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27499var c1M01Add = c1M01.AddMethod; 27541Assert.Same(c2M01.AddMethod, c2M01Add); 27665var c1M01Add = c1M01.AddMethod; 27698c1M01Add = (MethodSymbol)c1.FindImplementationForInterfaceMember(m01.AddMethod); 27701Assert.Same(m01.AddMethod, c1M01Add.ExplicitInterfaceImplementations.Single()); 27728Assert.Same(c1M01Add, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27735var c2M01Add = c2M01.AddMethod; 27754Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27755Assert.Same(c2M01Add, c2.FindImplementationForInterfaceMember(m01.AddMethod)); 27776var c3M02Add = c3M02.AddMethod; 27809c3M02Add = (MethodSymbol)c3.FindImplementationForInterfaceMember(m02.AddMethod); 27812Assert.Same(m02.AddMethod, c3M02Add.ExplicitInterfaceImplementations.Single()); 27839Assert.Same(c3M02Add, c3.FindImplementationForInterfaceMember(m02.AddMethod)); 27846var c4M02Add = c4M02.AddMethod; 27868Assert.Same(m02.AddMethod, c4M02Add.ExplicitInterfaceImplementations.Single()); 27869Assert.Same(c4M02Add, c4.FindImplementationForInterfaceMember(m02.AddMethod)); 28001var c1M01Add = c1M01.AddMethod; 28023var c2M01Add = c3.FindImplementationForInterfaceMember(m01.AddMethod); 28035Assert.Same(c1M01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 28044Assert.Same(c2M02.AddMethod, c3.FindImplementationForInterfaceMember(m02.AddMethod)); 28124var c2M01Add = c2M01.AddMethod; 28155var c3M01Add = (MethodSymbol)c3.FindImplementationForInterfaceMember(m01.AddMethod); 28157Assert.Same(m01.AddMethod, c3M01Add.ExplicitInterfaceImplementations.Single()); 28166Assert.Same(c2M01Add, c3.FindImplementationForInterfaceMember(m01.AddMethod));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
LifetimeAnnotationAttributesVisitor.cs (1)
63Visit(@event.AddMethod);
TestAttributesVisitor.cs (1)
63Visit(@event.AddMethod);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdEventTests.cs (4)
3506Assert.False(instanceEvent.AddMethod.IsStatic); 3511Assert.True(staticEvent.AddMethod.IsStatic); 3579var addMethod = @event.AddMethod; 3610var addMethod = @event.AddMethod;