-
-
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
NimVM reuses default-value sequences, differing from Nim and from NimVM with explicit defaults #20985
Comments
Related/same #10938 |
ringabout
added a commit
that referenced
this issue
Dec 6, 2022
Duplicate of #10938 |
Araq
pushed a commit
that referenced
this issue
Mar 1, 2023
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
nim-lang#20985; always initializes global variables with null values in VM (nim-lang#21351) * fixes nim-lang#10938; always initialize global variable in VM * fixes importc vars * there is a pre-existing issue regarding closure types in the VM * add tests
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
nim-lang#20985; always initializes global variables with null values in VM (nim-lang#21351) * fixes nim-lang#10938; always initialize global variable in VM * fixes importc vars * there is a pre-existing issue regarding closure types in the VM * add tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following program with identical code blocks (but for
let
v.const
) results ina != b
. This isn't the case when thegroup
andgroups
variables are explicitly initialized to@[]
.Nim Version
Nim Compiler Version 1.6.10 [Linux: amd64]
and:
Nim Compiler Version 1.7.3 [Linux: amd64]
Compiled at 2022-12-01
Copyright (c) 2006-2022 by Andreas Rumpf
git hash: b36f511
Current Output
Expected Output
Possible Solution
No response
Additional Information
Workaround: don't trust https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement in const blocks:
The text was updated successfully, but these errors were encountered: