Skip to content

Commit eb2e73a

Browse files
committed
add tests/stdlib/tsugar.nim ; add test case from @mratsim
1 parent 1cbcce4 commit eb2e73a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/pure/sugar.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,4 @@ proc distinctBase*[T](a: T, recursive: static[bool] = false): auto =
241241

242242
when isMainModule:
243243
# pending https://github.com/nim-lang/Nim/issues/7280
244-
discard distinctBase[int](0)
244+
discard distinctBase[int](0, recursive = true)

tests/stdlib/tsugar.nim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
discard """
2+
file: "tsugar.nim"
3+
output: ""
4+
"""
5+
import sugar
6+
7+
block distinctBase:
8+
type
9+
Foo[T] = distinct seq[T]
10+
var a: Foo[int]
11+
doAssert a.type.distinctBase is seq[int]

0 commit comments

Comments
 (0)