You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeFoo*=object
boo: intproc`=`(dest: varFoo, src: Foo) =debugEcho"assingment"proctest(): auto=var a,b : Fooreturn (a, b)
var (a, b) =test()
It doesn't compile, nim crashes with:
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Tested nim head and stable.
Is there a workaround? I do want to overload assignment operator and use tuples with it.
The text was updated successfully, but these errors were encountered:
edubart
changed the title
Assingment overload crashes the compiler when using tuples
Assignment overload crashes the compiler when using tuples
Sep 25, 2017
This prints "assignment" 4 times ( I think I remember something about return a being translated to result = a; return result, that may be the reason ) but seems to work as a workaround.
Note that:
proc`=`(dest: varFoo, src: Foo) =debugEcho"assingment"
dest = src
causes a stack overflow (because of recursively calling the assignment I guess?)
Test case
It doesn't compile, nim crashes with:
Tested nim head and stable.
Is there a workaround? I do want to overload assignment operator and use tuples with it.
The text was updated successfully, but these errors were encountered: