-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #11354 jsgen not carefully handle genAddr with nkHiddenAddr,nkStm… (
#15078) * fix #11354 jsgen not carefully handle genAddr with nkHiddenAddr,nkStmtListExpr; genAsgn with lvalue tyVar and rvalue tyPtr * correct logic * add test for #11354 * handle nkHiddenAddr when n.len == 1 * Update compiler/jsgen.nim * Update compiler/jsgen.nim * Apply suggestions from code review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
discard """ | ||
output: ''' | ||
0 | ||
@[@[0, 1]] | ||
''' | ||
""" | ||
|
||
type | ||
TrackySeq[T] = object | ||
s: seq[T] | ||
pos: int | ||
|
||
proc foobar(ls: var TrackySeq[seq[int]], i: int): var seq[int] = | ||
echo ls.pos # removing this, or making the return explicit works | ||
ls.s[i] | ||
|
||
var foo: TrackySeq[seq[int]] | ||
foo.s.add(@[0]) | ||
foo.foobar(0).add(1) | ||
echo foo.s |