mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 23:41:29 +00:00
fix is "closure" (#16552)
This commit is contained in:
@@ -408,8 +408,7 @@ proc isOpImpl(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
of "closure":
|
||||
let t = skipTypes(t1, abstractRange)
|
||||
res = t.kind == tyProc and
|
||||
t.callConv == ccClosure and
|
||||
tfIterator notin t.flags
|
||||
t.callConv == ccClosure
|
||||
of "iterator":
|
||||
let t = skipTypes(t1, abstractRange)
|
||||
res = t.kind == tyProc and
|
||||
|
||||
@@ -4,6 +4,15 @@ discard """
|
||||
|
||||
import std/hashes
|
||||
|
||||
|
||||
when not defined(js) and not defined(cpp):
|
||||
block:
|
||||
var x = 12
|
||||
iterator hello(): int {.closure.} =
|
||||
yield x
|
||||
|
||||
discard hash(hello)
|
||||
|
||||
block hashes:
|
||||
block hashing:
|
||||
var dummy = 0.0
|
||||
|
||||
Reference in New Issue
Block a user