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

warn on overloaded = with refc #20846

Open
arnetheduck opened this issue Nov 15, 2022 · 1 comment
Open

warn on overloaded = with refc #20846

arnetheduck opened this issue Nov 15, 2022 · 1 comment

Comments

@arnetheduck
Copy link
Contributor

What happened?

Per conversation with @Araq, overloading = is broken in the refc 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 with refc 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

Araq pushed a commit that referenced this issue Dec 5, 2022
give a deprecation message for overriding `=` hook
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
@bung87
Copy link
Collaborator

bung87 commented Aug 7, 2023

overloading = is a case for cpp, see #13093

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 a pull request may close this issue.

2 participants