diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-10-21 15:53:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 15:53:43 -0700 |
commit | e09c259bf3dc8beb2c4d5abf9334c787d18f99f5 (patch) | |
tree | dbffd1874475abfecf94d3d326d0bd6c90289261 /compiler | |
parent | ec6a1125a0d20909db63bd8305c66445bf7bf78e (diff) | |
download | Nim-e09c259bf3dc8beb2c4d5abf9334c787d18f99f5.tar.gz |
reuse existing toHumanStr (#15674)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/parampatterns.nim | 2 | ||||
-rw-r--r-- | compiler/semtypes.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index c2be4b134..eb99004ab 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -100,7 +100,7 @@ proc compileConstraints(p: PNode, result: var TPatternCode; conf: ConfigRef) = # check all symkinds: internalAssert conf, int(high(TSymKind)) < 255 for i in TSymKind: - if cmpIgnoreStyle(($i).substr(2), spec) == 0: + if cmpIgnoreStyle(i.toHumanStr, spec) == 0: result.add(ppSymKind) result.add(chr(i.ord)) return diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 8ef393839..f2bb82a5c 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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]) else: 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) of nkObjectTy: result = semObjectNode(c, n, prev, isInheritable=false) of nkTupleTy: result = semTuple(c, n, prev) |