-
-
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
Value lost when assigning variable to itself #19613
Comments
With the following changes everything works as expected https://play.nim-lang.org/#ix=3Syp @@ -1,6 +1,6 @@
type
Eth2Digest = object
- data: array[42, byte]
+ data: seq[byte]
BlockId* = object
root*: Eth2Digest
@@ -14,7 +14,7 @@ func init*(T: type BlockSlotId, bid: BlockId, slot: uint64): T =
BlockSlotId(bid: bid, slot: slot)
var x: BlockSlotId
-x.bid.root.data[0] = 42
+x.bid.root.data.add 42
x =
if x.slot > 0:
I wonder if it's related to #16017 |
May also be related to #18342 |
fixed by #19618 |
can we get a 1.2/1.6 backport? this is a significant issue. |
Fyi, it has been backported to 1.6: ff81975 |
nim 1.2.16, 1.6.4
The text was updated successfully, but these errors were encountered: