diff options
Diffstat (limited to 'compiler/semexprs.nim')
-rwxr-xr-x | compiler/semexprs.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index af3048586..d21f557d4 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -222,11 +222,12 @@ proc semOf(c: PContext, n: PNode): PNode = proc semIs(c: PContext, n: PNode): PNode = if sonsLen(n) == 3: - var a = semExprWithType(c, n.sons[1], {efAllowType}) - var b = semExprWithType(c, n.sons[2], {efAllowType}) - result = newIntNode(nkIntLit, ord(sameType(a.typ, b.typ))) - result.typ = getSysType(tyBool) - result.info = n.info + var a = semTypeNode(c, n[1], nil) + var b = semTypeNode(c, n[2], nil) + n.typ = getSysType(tyBool) + n.sons[1] = newNodeIT(nkType, n[1].info, a) + n.sons[2] = newNodeIT(nkType, n[2].info, b) + result = n else: GlobalError(n.info, errXExpectsTwoArguments, "is") |