-
-
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
warn on overloaded =
with refc
#20846
Comments
Araq
pushed a commit
that referenced
this issue
Dec 5, 2022
survivorm
pushed a commit
to survivorm/Nim
that referenced
this issue
Feb 28, 2023
nim-lang#21020) give a deprecation message for overriding `=` hook
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
nim-lang#21020) give a deprecation message for overriding `=` hook
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
nim-lang#21020) give a deprecation message for overriding `=` hook
overloading |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Per conversation with @Araq, overloading
=
is broken in therefc
GC and cannot work with the sequence implementation - there are also bugs with reference counting in the generated code which lead to hard-to-debug bugs when / if=
leaks into the codebase accidentally.Calling an overloaded
=
should thus give an error at compile-time when used withrefc
since there is no case where one would actually want them.Nuance: there is one use case for overloaded
=
which maybe is not broken: when using it to disable copying altogether for a type, ie when declaring it without a definition - thus it makes sense to make the compile-time error happen when=
would be called, not when it's declared.Nim Version
1.6.x
Current Standard Output Logs
No response
Expected Standard Output Logs
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: