Skip to content

Commit 7ce3925

Browse files
committed
int => string
1 parent 4f4dd20 commit 7ce3925

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/semmagic.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
170170
if arg.kind in NumberLikeTypes:
171171
# needed otherwise we could get different ids, see tests
172172
arg = getSysType(c.graph, traitCall[1].info, arg.kind)
173-
result = newIntNode(nkIntLit, arg.id)
173+
result = newStrNode(nkStrLit, $arg.id)
174174
# `id` better than cast[int](arg) so that it's reproducible across compiles
175-
result.typ = getSysType(c.graph, traitCall[1].info, tyInt)
175+
result.typ = getSysType(c.graph, traitCall[1].info, tyString)
176176
result.info = traitCall.info
177177
of "genericHead":
178178
var arg = operand

lib/pure/typetraits.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export system.`$` # for backward compatibility
1616

1717
include "system/inclrtl"
1818

19-
proc getTypeid*(t: typedesc): int {.magic: "TypeTrait", since: (1, 1).} =
20-
## returns a unique id representing a type; the id is stable across
19+
proc getTypeid*(t: typedesc): string {.magic: "TypeTrait", since: (1, 1).} =
20+
## returns a unique string id representing a type; the id is stable across
2121
## recompilations of the same program, but may differ if the program source
2222
## changes.
2323
runnableExamples:

0 commit comments

Comments
 (0)