mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-20 07:51:32 +00:00
close #8199 by adding a test
This commit is contained in:
25
tests/vm/tcompiletimerange.nim
Normal file
25
tests/vm/tcompiletimerange.nim
Normal file
@@ -0,0 +1,25 @@
|
||||
# issue #8199
|
||||
|
||||
const rangesGCHoldEnabled = not defined(rangesDisableGCHold)
|
||||
|
||||
type
|
||||
# A view into immutable array
|
||||
Range* {.shallow.} [T] = object
|
||||
when rangesGCHoldEnabled:
|
||||
gcHold: seq[T]
|
||||
start: ptr T
|
||||
mLen: int32
|
||||
|
||||
type
|
||||
BytesRange* = Range[byte]
|
||||
NibblesRange* = object
|
||||
bytes: BytesRange
|
||||
|
||||
const
|
||||
zeroBytesRange* = BytesRange()
|
||||
|
||||
proc initNibbleRange*(bytes: BytesRange): NibblesRange =
|
||||
result.bytes = bytes
|
||||
|
||||
const
|
||||
zeroNibblesRange* = initNibbleRange(zeroBytesRange)
|
||||
Reference in New Issue
Block a user