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

object self-assignment order-of-evaluation broken #9844

Closed
arnetheduck opened this issue Dec 3, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@arnetheduck
Copy link
Contributor

commented Dec 3, 2018

Same as #9684 but for objects...
test.nim

proc f(v: int): int = v

type X = object
  v: int

var x = X(v: 42)

x = X(v: f(x.v))
assert x.v == 42
bin/nim --version
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2018-12-03
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: c74226f4c1d156f2124783ac4464a8473d79c651
active boot switches: -d:release
bin/nim c -r ../../tmp/test
Hint: used config file '/home/arnetheduck/src/Nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: test [Processing]
CC: test
CC: stdlib_system
Hint:  [Link]
Hint: operation successful (12324 lines compiled; 0.412 sec total; 16.191MiB peakmem; Debug Build) [SuccessX]
Hint: /home/arnetheduck/tmp/test  [Exec]
test.nim(9)              test
system.nim(3928)         failedAssertImpl
system.nim(3921)         raiseAssert
system.nim(2968)         sysFatal
Error: unhandled exception: /home/arnetheduck/tmp/test.nim(9, 8) `x.v == 42`  [AssertionError]
Error: execution of an external program failed: '/home/arnetheduck/tmp/test '
@zevv

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2018

Or just a oneliner:

let a = [ int ]
@Araq

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@zevv that is a different bug.

@Araq Araq added the Showstopper label Apr 23, 2019

Clyybber added a commit to Clyybber/Nim that referenced this issue May 9, 2019

Clyybber added a commit to Clyybber/Nim that referenced this issue May 9, 2019

@Araq Araq closed this in 6be9b98 May 9, 2019

narimiran added a commit that referenced this issue May 10, 2019

Fix #9844 (#11216)
(cherry picked from commit 6be9b98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.