dotnet / dotnet/linker

New slot virtuals should be handled as separate methods and not overrides of the base

Open
#2,815 1 comment 0 reactions 0 assignees View on GitHub
area-Linker: DataFlow
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

```C#
class Base
{
[RequiresUnreferencedCode("Base")]
public virtual void Method() {}
}

class Derived
{
[RequiresUnreferencedCode("Derived")]
public virtual void Method() {}
}

void Test()
{
// Should produce two warnings
// IL2026 .... Base
// IL2026 .... Derived
typeof(Derived).GetMethods();
}
```

Currently trimmer only reports the "Base" warning in this case. Analyzer reports both (correctly).
If the derived method was an `override` then only the "Base" warning should be generated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.