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

fix subtype match of generic object types #24430

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Nov 12, 2024

split from #24425

Matching tyGenericBody performs a match on the last child of the generic body, in this case the uninstantied tyObject type. If the object contains no generic fields, this ends up being the same type as all instantiated ones, but if it does, a new type is created. This fails the sameObjectTypes check that subtype matching for object types uses. To fix this, also consider that the pattern type could be the generic uninstantiated object type of the matched type in subtype matching.

@Araq Araq merged commit 511ab72 into nim-lang:devel Nov 12, 2024
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 511ab72

Hint: mm: orc; opt: speed; options: -d:release
177442 lines; 8.840s; 652.32MiB peakmem

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