Skip to content

Commit

Permalink
add test for #19277
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 25, 2024
1 parent 93b5259 commit 7072f39
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/template/m19277_1.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
template foo*(x: untyped) =
echo "got: ", x
2 changes: 2 additions & 0 deletions tests/template/m19277_2.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
proc foo*(a: string) =
echo "got string: ", a
13 changes: 13 additions & 0 deletions tests/template/t19277.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# issue #19277

import m19277_1, m19277_2

template injector(val: untyped): untyped =
template subtemplate: untyped = val
subtemplate()

template methodCall(val: untyped): untyped = val

{.push raises: [Defect].}

foo(injector(0).methodCall())

0 comments on commit 7072f39

Please sign in to comment.