Skip to content

adapt generic matches to inheritance penalty of final objects #24691

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

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Feb 15, 2025

Applies #24144 to the equivalent matches of generic types, and adds the behavior to matches of generic invocations to generic invocations. Not encountered in many cases so it's hard to come up with tests but an example is the test code in #24688, the match to the generic body never sets the inheritance penalty leaving it at -1, but the match to the generic invocation sets it to 0 which matches worse, when it should set it to -1 because the object does not participate in inheritance.

@Araq Araq merged commit ebeef10 into nim-lang:devel Feb 19, 2025
18 checks passed
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from ebeef10

Hint: mm: orc; opt: speed; options: -d:release
178487 lines; 8.577s; 650.875MiB peakmem

narimiran pushed a commit that referenced this pull request Mar 3, 2025
Applies #24144 to the equivalent matches of generic types, and adds the
behavior to matches of generic invocations to generic invocations. Not
encountered in many cases so it's hard to come up with tests but an
example is the test code in #24688, the match to the generic body never
sets the inheritance penalty leaving it at -1, but the match to the
generic invocation sets it to 0 which matches worse, when it should set
it to -1 because the object does not participate in inheritance.

(cherry picked from commit ebeef10)
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