-
-
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
Regression with mixin
and generics from 2.0.8 to version-2-0
/version-2-2
, fixed in devel
#24163
Comments
Was caused by #23870 and fixed by #24144 @narimiran |
Thanks for the ping. Backported now. @tersec, it should be ok now (the example now works on my machine). |
Well, I realized the repro I posted above somehow omitted the last line, so it always compiles. For reference, one example of how to complete it: type
K = distinct int
M = object
proc p(e: auto, T: type): T =
mixin p
p(e, result)
proc p[T](r: M, g: T) =
when g is object:
mixin p
discard p(r, K)
else:
{.error: "u".}
proc p(_: M, _: K | K) = discard
p(default(M), default(K)) and, obviously, that first type
K = distinct int
M = object
proc p[T](r: M, g: T) =
when g is object:
mixin p
discard p(r, K)
else:
{.error: "u".}
proc p(_: M, _: K | K) = discard
p(default(M), default(K)) exhibits the same pattern. But haven't verified yet with new |
I noticed and forgot to mention it, that's what I used to check the issue |
The fix is backported, I think this can be closed. (If not, please reopen) |
Description
Nim Version
Builds:
v2.0.8
:devel
:Does not build:
version-2-0
:version-2-2
:Current Output
Expected Output
No response
Known Workarounds
No response
Additional Information
Fixed in
devel
, so presumably there's something to backport fromdevel
toversion 2-0
/version-2-2
.The text was updated successfully, but these errors were encountered: