diff options
author | cooldome <cdome@bk.ru> | 2020-04-25 18:59:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 19:59:56 +0200 |
commit | 13fa338ada7fcd8f7f33365ffd2000c79a4607fe (patch) | |
tree | 51dc65763798358f850172003c7e8a1e0469b43a /compiler | |
parent | f3eeb3f921edb1d70e751eb6262e3e87f9b1e806 (diff) | |
download | Nim-13fa338ada7fcd8f7f33365ffd2000c79a4607fe.tar.gz |
implement (#14114)
Co-authored-by: cooldome <ariabushenko@bk.ru>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sem.nim | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim index 1ced234f5..aa5928c18 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -481,15 +481,10 @@ proc forceBool(c: PContext, n: PNode): PNode = if result == nil: result = n proc semConstBoolExpr(c: PContext, n: PNode): PNode = - let nn = semExprWithType(c, n) - result = fitNode(c, getSysType(c.graph, n.info, tyBool), nn, nn.info) - if result == nil: - localError(c.config, n.info, errConstExprExpected) - return nn - result = getConstExpr(c.module, result, c.graph) - if result == nil: + result = forceBool(c, semConstExpr(c, n)) + if result.kind != nkIntLit: localError(c.config, n.info, errConstExprExpected) - result = nn + proc semGenericStmt(c: PContext, n: PNode): PNode proc semConceptBody(c: PContext, n: PNode): PNode |