-
-
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
toOpenArray with var openArray doesn't work in nim js #15952
Labels
Comments
timotheecour
changed the title
VM: Error: cannot generate code for: mSlice with toOpenArray
toOpenArray doesn't work in VM; toOpenArray with var openArray doesn't work in nim js
Feb 5, 2021
Araq
pushed a commit
that referenced
this issue
Feb 10, 2021
narimiran
pushed a commit
that referenced
this issue
Feb 18, 2021
IMO the correct way to fix this is to represent openArray's in backends other than C as:
in jsorigin is represented as a js array in vmorigin is represented as a PNode toOpenArray(x, a1, a2) computationthis can then be computed by propagating notethis will fix a large number of issues related to vm and js backends, in particular wrt |
ardek66
pushed a commit
to ardek66/Nim
that referenced
this issue
Mar 26, 2021
* ref 15952 toOpenArray works in JS * fix
This was referenced Jun 4, 2021
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Jun 23, 2021
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Jun 23, 2021
timotheecour
added a commit
to timotheecour/Nim
that referenced
this issue
Jun 25, 2021
ringabout
changed the title
toOpenArray doesn't work in VM; toOpenArray with var openArray doesn't work in nim js
toOpenArray with var openArray doesn't work in nim js
Feb 1, 2023
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
…im-lang#16306 (nim-lang#20610) closes nim-lang#19969; add testcase
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
…im-lang#16306 (nim-lang#20610) closes nim-lang#19969; add testcase
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VM:
Error: cannot generate code for: mSlice
with toOpenArrayjs:
Error: internal error: genAddr: nkCall
with toOpenArray + var openArrayExample 1
Current Output
see above
Expected Output
works
Additional Information
devel 1.5.1 1413818
note
fixing this would avoid workarounds like this in #16459:
Example 2
as of f3e4c4d (after #17001):
nim r -b:js main
: assert failsimplementation
for js: maybe using js slice refs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
for vm: TBD
links
see also nim-lang/RFCs#381
The text was updated successfully, but these errors were encountered: