fixes tcompiletimerange [bugfix] (#11720)

This commit is contained in:
Andreas Rumpf
2019-07-12 15:37:54 +02:00
committed by GitHub
parent 38b836b49e
commit 2895ad70c8
3 changed files with 29 additions and 7 deletions

View File

@@ -1,18 +1,17 @@
discard """
disabled: "true"
"""
# issue #8199
const rangesGCHoldEnabled = not defined(rangesDisableGCHold)
const rangesGCHoldEnabled = true # not defined(rangesDisableGCHold)
type
# A view into immutable array
Range*[T] {.shallow.} = object
when rangesGCHoldEnabled:
gcHold: seq[T]
start: ptr T
mLen: int32
gcHold: seq[T] # 0
start: ptr T # 1
mLen: int32 # 2
type
BytesRange* = Range[byte]