Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Nov 2, 2022

Conversation

jtschuster
Copy link
Member

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 dotnet/sdk#28796.

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

@jtschuster jtschuster enabled auto-merge (squash) November 2, 2022 15:25
@jtschuster jtschuster merged commit 391ac60 into dotnet:main Nov 2, 2022
jtschuster added a commit to jtschuster/linker that referenced this pull request Nov 2, 2022
… is not marked (dotnet#3098)

* Don't mark an override every time the base is abstract, only if the declaring type is also marked
Adds a condition to ShouldMarkOverrideForBase to exit early if the declaring type of the method is not marked.
tlakollo pushed a commit to dotnet/runtime that referenced this pull request Nov 4, 2022
… is not marked (dotnet/linker#3098)

* Don't mark an override every time the base is abstract, only if the declaring type is also marked
Adds a condition to ShouldMarkOverrideForBase to exit early if the declaring type of the method is not marked.

Commit migrated from dotnet/linker@391ac60
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
… is not marked (dotnet/linker#3098)

* Don't mark an override every time the base is abstract, only if the declaring type is also marked
Adds a condition to ShouldMarkOverrideForBase to exit early if the declaring type of the method is not marked.

Commit migrated from dotnet/linker@391ac60
sbomer added a commit that referenced this pull request Jan 18, 2023
…state changes (#3094)

* Check for marking virtual method due to base only when state changes (#3073)

Instead of checking every virtual method to see if it should be kept due
to a base method every iteration of the MarkStep pipeline, check each
method only when its relevant state has changed.

Co-authored-by: Sven Boemer <sbomer@gmail.com>

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

* Don't mark an override every time the base is abstract, only if the declaring type is also marked
Adds a condition to ShouldMarkOverrideForBase to exit early if the declaring type of the method is not marked.

* Add test case for #3112 with pseudo-circular reference with ifaces

* Link issue to TODO

* Adds a test for recursive generics on interfaces

This is a copy of the test added in #3156

Co-authored-by: Sven Boemer <sbomer@gmail.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants