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

remove fauxMatch for tyFromExpr, remove tyProxy and tyUnknown aliases #24018

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Aug 27, 2024

updated version of #22193

After #22029 and the followups #23983 and #24005 which fixed issues with it, tyFromExpr no longer match any proc params in generic type bodies but delay all non-matching calls until the type is instantiated. Previously the mechanism fauxMatch was used to pretend that any failing match against tyFromExpr actually matched, but prevented the instantiation of the type until later.

Since this mechanism is not needed anymore for tyFromExpr, it is now only used for tyError to prevent cascading errors and changed to a bool field for simplicity. A change in semtypes was also needed to prevent calling fitNode on default param values resolving to type tyFromExpr in generic procs for params with non-generic types, as this would try to coerce the expression into a concrete type when it can't be instantiated yet.

The aliases tyProxy and tyUnknown for tyError and tyFromExpr are also removed for uniformity.

@metagn metagn changed the title test removing fauxMatch for tyFromExpr, test removing fauxMatch for tyFromExpr Aug 27, 2024
@metagn metagn marked this pull request as draft August 27, 2024 08:57
@metagn metagn changed the title test removing fauxMatch for tyFromExpr remove fauxMatch for tyFromExpr, remove tyProxy and tyUnknown aliases Aug 27, 2024
@metagn metagn marked this pull request as ready for review August 27, 2024 13:22
@Araq Araq merged commit d3af51e into nim-lang:devel Aug 28, 2024
19 checks passed
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
173730 lines; 9.180s; 654.512MiB 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