-
-
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
Can't overload =
for a generic.
#8973
Comments
That's currently the only supported syntax and it is invoked, I have plenty of tests that prove it. :P |
I wouldn't trust assignment overloading. Quoting @Araq in #6348 (comment)
My experiments to introduce a custom copy-on-write also failed utterly due to it: #6786 |
I'm obviously not someone who knows the Nim compiler as well as @Araq, but it hasn't been invoked on my tests in devel. My guess is [T] is being defined as Generic[X] so it has to match Generic[Generic[X]], which it doesn't. For whatever reason it isn't working, do you have an test that explicitly tests overloading for generics? |
Here's the exact code I'm testing with a devel compiler from November 11th.
1 is never printed; the value is set to 5. |
Those are three different methods of Generic creation. One uses alloc inside a function. One doesn't alloc anything. One uses alloc outside of a function. Only the one that uses alloc inside a function triggers. |
For a Generic defined as:
There are four potential definitions of
=
.Is this a feature that has yet to be implemented/is broken or will Nim not support Generic
=
overloading?The text was updated successfully, but these errors were encountered: