diff options
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 4fc69043b..441102989 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -421,7 +421,9 @@ proc semConst(c: PContext, n: PNode): PNode = def = fitRemoveHiddenConv(c, typ, def) else: typ = def.typ - if typ == nil: continue + if typ == nil: + LocalError(a.sons[2].info, errConstExprExpected) + continue if not typeAllowed(typ, skConst): LocalError(a.info, errXisNoType, typeToString(typ)) continue |