-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Changing generic weight of tyGenericParam
#22143
Conversation
On the CI failure, there is a test in the Nim codebase under Also, I know the test file is a little bit messed up. If preferable I can get rid of some of those "anti-regression" tests and I will fix the Also, if this ends up working I think I should add a blurb to the manual |
You really should start with the manual/spec. |
Is there a formal spec? I looked but all I could find was the manual. p[T: t](arg1: f): y
After matching / resolution the "formal" parameters that are not concrete crystalize into call-specific bindings. |
The manual is the spec. Could be more formal, we're getting there by telling contributors to write spec'y documentation. |
It is:
|
Alright, thank you and
If I can iron out that list I might be done with this. For a first pass at least. If anyone thinks that test in |
This comment was marked as outdated.
This comment was marked as outdated.
PR #23033 appears to fix datamancer on this PR. As far as I know that is the last caveat here, so this should be ready if/when that gets merged |
I'm merging this but it needs a follow PR as the documentation is incomprehensible. Also, the whole approach is kinda nuts (not your fault, of course). Instead we need a formal type relation |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
Just for posterity and to throw an idea out there: The hypothetical function Documenting "specificity" would be 99% documenting Also, for the record, I don't like the way specificity sounds in these contexts. I'm the one that started saying it, so not blaming anyone but me for that. Still, it does seem to fit the idea well enough. |
The goal of this PR is to make `typeRel` accurate to it's definition for generics: ``` # 3) When used with two type classes, it will check whether the types # matching the first type class (aOrig) are a strict subset of the types matching # the other (f). This allows us to compare the signatures of generic procs in # order to give preferrence to the most specific one: ``` I don't want this PR to break any code, and I want to preserve all of Nims current behaviors. I think that making this more accurate will help serve as ground work for the future. It may not be possible to not break anything but this is my attempt. So that it is understood, this code was part of another PR (#22143) but that problem statement only needed this change by extension. It's more organized to split two problems into two PRs and this issue, being non-breaking, should be a more immediate improvement. --------- Co-authored-by: Andreas Rumpf <[email protected]> (cherry picked from commit b2ca6be)
This is in reference to a [feature request](#22142) that I posted. I'm making this PR to demonstrate the suggested change and expect that this should be scrutinized --------- Co-authored-by: Bung <[email protected]> Co-authored-by: Andreas Rumpf <[email protected]> (cherry picked from commit 74fa8ed)
This is in reference to a [feature request](#22142) that I posted. I'm making this PR to demonstrate the suggested change and expect that this should be scrutinized --------- Co-authored-by: Bung <[email protected]> Co-authored-by: Andreas Rumpf <[email protected]> (cherry picked from commit 74fa8ed)
This is in reference to a feature request that I posted.
I'm making this PR to demonstrate the suggested change and expect that this should be scrutinized