system.nim: avoid 'cannot prove init' warnings for the '..' constructors

This commit is contained in:
Araq
2019-02-20 12:28:22 +01:00
parent 6a5c74722e
commit 7b31a81d45

View File

@@ -407,12 +407,11 @@ proc `..`*[T, U](a: T, b: U): HSlice[T, U] {.noSideEffect, inline, magic: "DotDo
## and `b` are inclusive. Slices can also be used in the set constructor
## and in ordinal case statements, but then they are special-cased by the
## compiler.
result.a = a
result.b = b
result = HSlice[T, U](a: a, b: b)
proc `..`*[T](b: T): HSlice[int, T] {.noSideEffect, inline, magic: "DotDot".} =
## unary `slice`:idx: operator that constructs an interval ``[default(int), b]``
result.b = b
result = HSlice[int, T](a: 0, b: b)
when not defined(niminheritable):
{.pragma: inheritable.}