diff options
author | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
commit | 032599c156260a0892522b6ce858b1cdff08df84 (patch) | |
tree | 582c86f5e7a23595e1253af47133be3c4764da1f /rod/semexprs.nim | |
parent | 220dd54acfd5527c7c569811013b178fc462898e (diff) | |
download | Nim-032599c156260a0892522b6ce858b1cdff08df84.tar.gz |
bugfix: type converter that converts to bool in 'if' context
Diffstat (limited to 'rod/semexprs.nim')
-rwxr-xr-x | rod/semexprs.nim | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/rod/semexprs.nim b/rod/semexprs.nim index 712ce4e6e..cf9900155 100755 --- a/rod/semexprs.nim +++ b/rod/semexprs.nim @@ -792,8 +792,7 @@ proc semIfExpr(c: PContext, n: PNode): PNode = case it.kind of nkElifExpr: checkSonsLen(it, 2) - it.sons[0] = semExprWithType(c, it.sons[0]) - checkBool(it.sons[0]) + it.sons[0] = forceBool(c, semExprWithType(c, it.sons[0])) it.sons[1] = semExprWithType(c, it.sons[1]) if typ == nil: typ = it.sons[1].typ else: it.sons[1] = fitNode(c, typ, it.sons[1]) |