Skip to content

Commit

Permalink
add nim-lang#23406 test
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Mar 15, 2024
1 parent 3403ae6 commit a4a7239
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/generics/tcalltype.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# issue #23406

template helper(_: untyped): untyped =
int

type # Each of them should always be `int`.
GenA[T] = helper int
GenB[T] = helper(int)
GenC[T] = helper helper(int)

block:
template helper(_: untyped): untyped =
float

type
A = GenA[int]
B = GenB[int]
C = GenC[int]

assert A is int # OK.
assert B is int # Fails; it is `float`!
assert C is int # OK.

0 comments on commit a4a7239

Please sign in to comment.