summary refs log tree commit diff stats
path: root/tests/misc/t20289.nim
blob: 5a0a269f00bd32c3d8fd48b6f489cc0c40f9d6b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
  action: reject
"""

type E[T] = object
  v: T

template j[T](R: type E[T], x: untyped): R = R(v: x)
template d[T](O: type E, v: T): E[T] = E[T].j(v)

proc w[T](): E[T] =
  template r(k: int): auto = default(T)
  E.d r

discard w[int]()