Skip to content

Analyzer produces duplicate IL2092 for default interface method #104627

@vitek-karas

Description

@vitek-karas
			interface IBaseWithDefault
			{
				void DefaultMethod (Type type);
			}

			interface IDerivedWithDefault : IBaseWithDefault
			{
				[ExpectedWarning ("IL2092")]
				[ExpectedWarning ("IL2092", ProducedBy = ProducedBy.Analyzer)] // Analyzer produces the warning again
				void IBaseWithDefault.DefaultMethod ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] Type type) { }
			}

			class ImplDerivedWithDefault : IDerivedWithDefault
			{
			}

This is because the analyzer uses symbol action (so called for every symbol). In this case it's called for ImplDerivedWithDefault and then for IDerivedWithDefault and both return the DefaultMethod override pair (the exact same pair) from their call to GetMemberInterfaceImplementationPairs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions