summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJason Beetham <beefers331@gmail.com>2023-12-12 01:06:13 -0700
committerGitHub <noreply@github.com>2023-12-12 09:06:13 +0100
commit8cc3c774c8925c3d21626d09b41ad352bd898e4a (patch)
tree7d9d4576e4c00cb3dc22fff8504f48a94a26d6e2 /tests
parentcf4cef498489f1dbbb3dea287e88a9a0d820e8b7 (diff)
downloadNim-8cc3c774c8925c3d21626d09b41ad352bd898e4a.tar.gz
Look up generic parameters when found inside semOverloadedCall, fixin… (#23054)
…g static procs

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/statictypes/tstaticprocparams.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/statictypes/tstaticprocparams.nim b/tests/statictypes/tstaticprocparams.nim
new file mode 100644
index 000000000..f0bb6fb5f
--- /dev/null
+++ b/tests/statictypes/tstaticprocparams.nim
@@ -0,0 +1,9 @@
+proc consumer[T: static proc(i: int): int{.nimcall.}](i: int): int = T(i)
+proc addIt(i: int): int = i + i
+proc squareIt(i: int): int = i * i
+
+assert consumer[addIt](10) == 20
+assert consumer[squareIt](30) == 900
+assert consumer[proc(i: int): int{.nimcall.} = i * i + i](10) == 110
+
+