misc cleanups in compiler msgs: use toHumanStr, etc (#14677)
This commit is contained in:
parent
49033eb531
commit
faedb14a16
4 changed files with 9 additions and 12 deletions
|
|
@ -905,8 +905,7 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType =
|
|||
if t.kind == tyTypeDesc and tfUnresolved notin t.flags:
|
||||
t = t.base
|
||||
if t.kind == tyVoid:
|
||||
const kindToStr: array[tyPtr..tyRef, string] = ["ptr", "ref"]
|
||||
localError(c.config, n.info, "type '$1 void' is not allowed" % kindToStr[kind])
|
||||
localError(c.config, n.info, "type '$1 void' is not allowed" % kind.toHumanStr)
|
||||
result = newOrPrevType(kind, prev, c)
|
||||
var isNilable = false
|
||||
var wrapperKind = tyNone
|
||||
|
|
@ -1400,7 +1399,7 @@ proc semObjectTypeForInheritedGenericInst(c: PContext, n: PNode, t: PType) =
|
|||
proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType =
|
||||
if s.typ == nil:
|
||||
localError(c.config, n.info, "cannot instantiate the '$1' $2" %
|
||||
[s.name.s, ($s.kind).substr(2).toLowerAscii])
|
||||
[s.name.s, s.kind.toHumanStr])
|
||||
return newOrPrevType(tyError, prev, c)
|
||||
|
||||
var t = s.typ
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue