preparations for C++ template support

This commit is contained in:
Araq 2015-01-22 13:32:20 +01:00
commit 6004280522
6 changed files with 25 additions and 21 deletions

View file

@ -178,9 +178,9 @@ proc semStmtScope(c: PContext, n: PNode): PNode
proc typeAllowedCheck(info: TLineInfo; typ: PType; kind: TSymKind) =
let t = typeAllowed(typ, kind)
if t != nil:
if t == typ: localError(info, "invalid type: " & typeToString(typ))
else: localError(info, "invalid type: " & typeToString(t) &
" in this context: " & typeToString(typ))
if t == typ: localError(info, "invalid type: '" & typeToString(typ) & "'")
else: localError(info, "invalid type: '" & typeToString(t) &
"' in this context: '" & typeToString(typ) & "'")
proc paramsTypeCheck(c: PContext, typ: PType) {.inline.} =
typeAllowedCheck(typ.n.info, typ, skConst)