-
-
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
make proc
not implicitly convert to pointer
with a preview define
#21953
Conversation
proc
not converting to pointer
proc
and cstring
not converting to pointer
proc
and cstring
not converting to pointer
proc
not converting to pointer
proc
not converting to pointer
proc
not implicitly convert to pointer
proc
not implicitly convert to pointer
proc
not implicitly convert to pointer
with a preview define
-1 from me, we allow |
Maybe it can be an optional Hint or Warning ?. 🙂 |
Why? Nobody reported any bugs due to this behavior. |
The problem mentioned in nim-lang/RFCs#229 is that the conversion can happen implicitly in proc parameters. # defined in system:
proc `==`(a, b: pointer)
proc `==`[T: proc](a, b: proc)
proc foo(a: int) = discard
proc bar(a: float) = discard
echo foo == bar # does pointer(foo) == pointer(bar) This conversion is safe but maybe not always wanted. I don't know which mechanism makes it so this kind of "implicit" conversion doesn't work but |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
…nim-lang#21953) * test `proc` not converting to `pointer` * ignore define for now to test * remove cstring * fixes, changelog
closes nim-lang/RFCs#229
Preview define for now because a package broke.
There is also cstring to pointer conversion which was not removed in #20761 or mentioned in #13790, however this is also documented so I didn't touch it for now.