Revert "fixes #20155; repr range with distinct types is broken with ORC" (#20334)

Revert "fixes #20155; repr range with distinct types is broken with ORC (#20158)"

This reverts commit 37b3f62eef.
This commit is contained in:
Clay Sweetser 2022-09-11 16:56:11 -04:00 • committed by GitHub
commit 8850644cb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 10 deletions

View file

@ -9,8 +9,6 @@ proc isNamedTuple(T: typedesc): bool {.magic: "TypeTrait".}
proc distinctBase(T: typedesc, recursive: static bool = true): typedesc {.magic: "TypeTrait".}
## imported from typetraits
proc skipRanges(T: typedesc): typedesc {.magic: "TypeTrait".}
proc repr*(x: NimNode): string {.magic: "Repr", noSideEffect.}
proc repr*(x: int): string =
@ -98,10 +96,7 @@ proc repr*(p: proc): string =
repr(cast[ptr pointer](unsafeAddr p)[])
template repr*(x: distinct): string =
when x is range: # hacks for ranges with distinct sub types
repr(distinctBase(skipRanges(typeof(x)))(x))
else:
repr(distinctBase(typeof(x))(x))
repr(distinctBase(typeof(x))(x))
template repr*(t: typedesc): string = $t