mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
ignore typeof in closure iterators (#24861)
fixes #24859
(cherry picked from commit f58cd51fc4)
This commit is contained in:
@@ -163,7 +163,7 @@ type
|
||||
|
||||
const
|
||||
nkSkip = {nkEmpty..nkNilLit, nkTemplateDef, nkTypeSection, nkStaticStmt,
|
||||
nkCommentStmt, nkMixinStmt, nkBindStmt} + procDefs
|
||||
nkCommentStmt, nkMixinStmt, nkBindStmt, nkTypeOfExpr} + procDefs
|
||||
|
||||
proc newStateAccess(ctx: var Ctx): PNode =
|
||||
if ctx.stateVarSym.isNil:
|
||||
|
||||
7
tests/iter/ttypeofclosureiter.nim
Normal file
7
tests/iter/ttypeofclosureiter.nim
Normal file
@@ -0,0 +1,7 @@
|
||||
# issue #24859
|
||||
|
||||
template u(): int =
|
||||
yield 0
|
||||
0
|
||||
iterator s(): int {.closure.} = discard default(typeof(u()))
|
||||
let _ = s
|
||||
Reference in New Issue
Block a user