-
-
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
unsafeAddr broken in JS for proc parameters #14100
Comments
this was introduced in 61f2f1f |
No, I guess this never works, Nim v1.0.4 doesn't work too. |
there's lot changes after v1.0.4, test agains it does not results "never works" worked version maybe #15078 |
In Nim 0.19.0 proc foo[T](x: T) = # generics doesn't matter here, you can try writing a proc for each type used below
echo(unsafeAddr(x)[])
foo("hello")
foo(@[1, 2, 3])
foo([1, 2, 3])
foo(1) gave:
|
I don't think there's really a way for this to be "introduced", this is very special behavior that the compiler must account for that I haven't seen implemented. You would have to track whether a proc uses |
Example
Current Output
Expected Output
Additional Information
Simply addingvar x = x
thenaddr
fixes all of these.let x = x
also works.let
&for
variables.The text was updated successfully, but these errors were encountered: