Co-authored-by: cooldome <ariabushenko@bk.ru>
This commit is contained in:
cooldome
2020-04-25 18:59:56 +01:00
committed by GitHub
parent f3eeb3f921
commit 13fa338ada
2 changed files with 9 additions and 8 deletions

View File

@@ -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:
result = forceBool(c, semConstExpr(c, n))
if result.kind != nkIntLit:
localError(c.config, n.info, errConstExprExpected)
return nn
result = getConstExpr(c.module, result, c.graph)
if result == nil:
localError(c.config, n.info, errConstExprExpected)
result = nn
proc semGenericStmt(c: PContext, n: PNode): PNode
proc semConceptBody(c: PContext, n: PNode): PNode

View File

@@ -49,3 +49,9 @@ block:
block:
var x: Foo4[0]
type
MyObject = object
x: int
when (NimMajor, NimMinor) >= (1, 1):
y: int