parent
f3eeb3f921
commit
13fa338ada
2 changed files with 9 additions and 8 deletions
|
|
@ -481,15 +481,10 @@ proc forceBool(c: PContext, n: PNode): PNode =
|
||||||
if result == nil: result = n
|
if result == nil: result = n
|
||||||
|
|
||||||
proc semConstBoolExpr(c: PContext, n: PNode): PNode =
|
proc semConstBoolExpr(c: PContext, n: PNode): PNode =
|
||||||
let nn = semExprWithType(c, n)
|
result = forceBool(c, semConstExpr(c, n))
|
||||||
result = fitNode(c, getSysType(c.graph, n.info, tyBool), nn, nn.info)
|
if result.kind != nkIntLit:
|
||||||
if result == nil:
|
|
||||||
localError(c.config, n.info, errConstExprExpected)
|
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 semGenericStmt(c: PContext, n: PNode): PNode
|
||||||
proc semConceptBody(c: PContext, n: PNode): PNode
|
proc semConceptBody(c: PContext, n: PNode): PNode
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,9 @@ block:
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var x: Foo4[0]
|
var x: Foo4[0]
|
||||||
|
|
||||||
|
type
|
||||||
|
MyObject = object
|
||||||
|
x: int
|
||||||
|
when (NimMajor, NimMinor) >= (1, 1):
|
||||||
|
y: int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue