This commit is contained in:
Andreas Rumpf 2016-06-01 01:59:06 +02:00
commit 041054e038
3 changed files with 12 additions and 7 deletions

View file

@ -536,7 +536,7 @@ proc semConst(c: PContext, n: PNode): PNode =
localError(a.sons[2].info, errConstExprExpected)
continue
if typeAllowed(typ, skConst) != nil and def.kind != nkNilLit:
localError(a.info, errXisNoType, typeToString(typ))
localError(a.info, "invalid type for const: " & typeToString(typ))
continue
v.typ = typ
v.ast = def # no need to copy