dotnet / linker

388 stars 126 forks source link

Don't mark override of abstract base if the override's declaring type is not marked #3098

Closed jtschuster closed 1 year ago

jtschuster commented 1 year ago

Adds a check to ensure the declaring type is marked in ShouldMarkOverrideForBase.

Adds a test to check for this behavior.

Should fix the issues in linker flow to sdk at https://github.com/dotnet/sdk/pull/28796.

Before the change, in OverrideInUnmarkedClassIsRemoved we would mark UnmarkedDerived.Method and UnmarkedDerived because MarkedBase.Method was marked and abstract.