Skip to content

Commit

Permalink
disabled some tests pending regression nim-lang#9855
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 4, 2018
1 parent eaf691f commit 3ed1b6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/pure/sugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ macro extractGeneric*(T: typedesc, index:static[int]): untyped =
type Foo[T1, T2]=object
doAssert extractGeneric(Foo[float, string], 0) is float
doAssert extractGeneric(Foo[float, string], 1) is string
doAssert extractGeneric(Foo[float, string], -1) is Foo
# pending https://github.com/nim-lang/Nim/issues/9855
# doAssert extractGeneric(Foo[float, string], -1) is Foo

var impl = getTypeImpl(T)
expectKind(impl, nnkBracketExpr)
Expand Down
9 changes: 7 additions & 2 deletions tests/stdlib/tsugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ block distinctBase:
block extractGeneric:
type Foo[T1, T2]=object
type Foo2=Foo[float, string]
doAssert extractGeneric(Foo[float, string], 1) is string
# pending https://github.com/nim-lang/Nim/issues/9855
# doAssert extractGeneric(Foo2, -1) is Foo
doAssert extractGeneric(Foo2, 0) is float
doAssert extractGeneric(Foo2, 1) is string
doAssert extractGeneric(Foo[float, string], 1) is string
# pending https://github.com/nim-lang/Nim/issues/9855
# doAssert extractGeneric(Foo[float, string], -1) is Foo
# workaround for seq[int].T not working,
# see https://github.com/nim-lang/Nim/issues/8433
doAssert extractGeneric(seq[int], 0) is int
doAssert extractGeneric(seq[seq[string]], 0) is seq[string]
doAssert: not compiles(extractGeneric(seq[int], 1))
doAssert not compiles(extractGeneric(seq[int], 1))
doAssert extractGeneric(seq[int], -1) is seq

type Foo3[T] = T
Expand Down

0 comments on commit 3ed1b6e

Please sign in to comment.