Skip to content

Commit 7f802dd

Browse files
authored
Revert "fixes #20155; repr range with distinct types is broken with ORC (#20158)"
This reverts commit 37b3f62.
1 parent 37b3f62 commit 7f802dd

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

compiler/semmagic.nim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,6 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
190190
arg = arg.base.skipTypes(skippedTypes + {tyGenericInst})
191191
if not rec: break
192192
result = getTypeDescNode(c, arg, operand.owner, traitCall.info)
193-
of "skipRanges":
194-
var arg = operand.skipTypes({tyRange})
195-
result = getTypeDescNode(c, arg, operand.owner, traitCall.info)
196193
else:
197194
localError(c.config, traitCall.info, "unknown trait: " & s)
198195
result = newNodeI(nkEmpty, traitCall.info)

lib/system/repr_v2.nim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ proc isNamedTuple(T: typedesc): bool {.magic: "TypeTrait".}
99
proc distinctBase(T: typedesc, recursive: static bool = true): typedesc {.magic: "TypeTrait".}
1010
## imported from typetraits
1111

12-
proc skipRanges(T: typedesc): typedesc {.magic: "TypeTrait".}
13-
1412
proc repr*(x: NimNode): string {.magic: "Repr", noSideEffect.}
1513

1614
proc repr*(x: int): string =
@@ -98,10 +96,7 @@ proc repr*(p: proc): string =
9896
repr(cast[ptr pointer](unsafeAddr p)[])
9997

10098
template repr*(x: distinct): string =
101-
when x is range: # hacks for ranges with distinct sub types
102-
repr(distinctBase(skipRanges(typeof(x)))(x))
103-
else:
104-
repr(distinctBase(typeof(x))(x))
99+
repr(distinctBase(typeof(x))(x))
105100

106101
template repr*(t: typedesc): string = $t
107102

tests/metatype/tmetatype_various.nim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
discard """
2-
matrix: "--mm:refc; --mm:orc"
32
output: '''[1, 0, 0, 0, 0, 0, 0, 0] CTBool[Ct[system.uint32]]'''
43
"""
54

0 commit comments

Comments
 (0)