equality and hashing for closures
This commit is contained in:
parent
19e57bf70d
commit
832da8a303
7 changed files with 31 additions and 11 deletions
|
|
@ -262,11 +262,12 @@ proc semOf(c: PContext, n: PNode): PNode =
|
|||
|
||||
proc semIs(c: PContext, n: PNode): PNode =
|
||||
if sonsLen(n) == 3:
|
||||
var a = semTypeNode(c, n[1], nil)
|
||||
var b = semTypeNode(c, n[2], nil)
|
||||
n.typ = getSysType(tyBool)
|
||||
let a = semTypeNode(c, n[1], nil)
|
||||
n.sons[1] = newNodeIT(nkType, n[1].info, a)
|
||||
n.sons[2] = newNodeIT(nkType, n[2].info, b)
|
||||
if n[2].kind notin {nkStrLit..nkTripleStrLit}:
|
||||
let b = semTypeNode(c, n[2], nil)
|
||||
n.sons[2] = newNodeIT(nkType, n[2].info, b)
|
||||
result = n
|
||||
else:
|
||||
GlobalError(n.info, errXExpectsTwoArguments, "is")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue