diff options
Diffstat (limited to 'tests/compiles/trecursive_generic_in_compiles.nim')
-rw-r--r-- | tests/compiles/trecursive_generic_in_compiles.nim | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/compiles/trecursive_generic_in_compiles.nim b/tests/compiles/trecursive_generic_in_compiles.nim index 77bf0bb02..ab31ad0f5 100644 --- a/tests/compiles/trecursive_generic_in_compiles.nim +++ b/tests/compiles/trecursive_generic_in_compiles.nim @@ -1,6 +1,10 @@ -# bug #3313 -import unittest, future +discard """ +action: compile +""" +# bug #3313 +import unittest, sugar +{.experimental: "notnil".} type ListNodeKind = enum lnkNil, lnkCons @@ -46,7 +50,7 @@ proc `==`*[T](xs, ys: List[T]): bool = proc asList*[T](xs: varargs[T]): List[T] = ## Creates list from varargs - proc initListImpl(i: int, xs: openarray[T]): List[T] = + proc initListImpl(i: int, xs: openArray[T]): List[T] = if i > high(xs): Nil[T]() else: @@ -88,11 +92,3 @@ proc foldLeft*[T,U](xs: List[T], z: U, f: (U, T) -> U): U = case xs.isEmpty of true: z else: foldLeft(xs.tail, f(z, xs.head), f) - -suite "unittest compilation error": - - test "issue 3313": - let lst = lc[$x | (x <- 'a'..'z'), string].asList - - let lstCopy = lst.dup - check: lstCopy == lst |