diff options
author | Bung <crc32@qq.com> | 2022-12-27 19:07:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-27 12:07:15 +0100 |
commit | f232329bb12fc9d93fe1e09769e291eae4e2953d (patch) | |
tree | 27ff86bf2ef2d6cc3caf5a3149065a735cb9e2fe /tests | |
parent | 9b4516fbcb4ad9c5db1e6f563601855f0e9982a0 (diff) | |
download | Nim-f232329bb12fc9d93fe1e09769e291eae4e2953d.tar.gz |
add test case for #20289 (#21180)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/misc/t20289.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/misc/t20289.nim b/tests/misc/t20289.nim new file mode 100644 index 000000000..5a0a269f0 --- /dev/null +++ b/tests/misc/t20289.nim @@ -0,0 +1,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]() |