system.nim: avoid 'cannot prove init' warnings for the '..' constructors
This commit is contained in:
parent
6a5c74722e
commit
7b31a81d45
1 changed files with 2 additions and 3 deletions
|
|
@ -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 `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
|
## and in ordinal case statements, but then they are special-cased by the
|
||||||
## compiler.
|
## compiler.
|
||||||
result.a = a
|
result = HSlice[T, U](a: a, b: b)
|
||||||
result.b = b
|
|
||||||
|
|
||||||
proc `..`*[T](b: T): HSlice[int, T] {.noSideEffect, inline, magic: "DotDot".} =
|
proc `..`*[T](b: T): HSlice[int, T] {.noSideEffect, inline, magic: "DotDot".} =
|
||||||
## unary `slice`:idx: operator that constructs an interval ``[default(int), b]``
|
## 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):
|
when not defined(niminheritable):
|
||||||
{.pragma: inheritable.}
|
{.pragma: inheritable.}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue