reuse existing toHumanStr (#15674)
This commit is contained in:
parent
ec6a1125a0
commit
e09c259bf3
2 changed files with 2 additions and 2 deletions
|
|
@ -100,7 +100,7 @@ proc compileConstraints(p: PNode, result: var TPatternCode; conf: ConfigRef) =
|
||||||
# check all symkinds:
|
# check all symkinds:
|
||||||
internalAssert conf, int(high(TSymKind)) < 255
|
internalAssert conf, int(high(TSymKind)) < 255
|
||||||
for i in TSymKind:
|
for i in TSymKind:
|
||||||
if cmpIgnoreStyle(($i).substr(2), spec) == 0:
|
if cmpIgnoreStyle(i.toHumanStr, spec) == 0:
|
||||||
result.add(ppSymKind)
|
result.add(ppSymKind)
|
||||||
result.add(chr(i.ord))
|
result.add(chr(i.ord))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -1913,7 +1913,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
|
||||||
localError(c.config, n.info, "type expected, but symbol '$1' has no type." % [s.name.s])
|
localError(c.config, n.info, "type expected, but symbol '$1' has no type." % [s.name.s])
|
||||||
else:
|
else:
|
||||||
localError(c.config, n.info, "type expected, but got symbol '$1' of kind '$2'" %
|
localError(c.config, n.info, "type expected, but got symbol '$1' of kind '$2'" %
|
||||||
[s.name.s, substr($s.kind, 2)])
|
[s.name.s, s.kind.toHumanStr])
|
||||||
result = newOrPrevType(tyError, prev, c)
|
result = newOrPrevType(tyError, prev, c)
|
||||||
of nkObjectTy: result = semObjectNode(c, n, prev, isInheritable=false)
|
of nkObjectTy: result = semObjectNode(c, n, prev, isInheritable=false)
|
||||||
of nkTupleTy: result = semTuple(c, n, prev)
|
of nkTupleTy: result = semTuple(c, n, prev)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue