summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorBung <crc32@qq.com>2022-10-15 13:15:58 +0800
committerGitHub <noreply@github.com>2022-10-15 07:15:58 +0200
commit0510a2be0d6df674aa91ae3f2884d98473cade4c (patch)
treeeac4583e7d17be4eb0c840b14bf8d821b11a0994 /tests
parent57574eaf319a592f338f6b0b57a5f3a8fc0a466c (diff)
downloadNim-0510a2be0d6df674aa91ae3f2884d98473cade4c.tar.gz
fix #19700 Crash when passing a template to a generic functio… (#20567)
fix nim-lang#19700 Crash when passing a template to a generic function expecting a procedure
Diffstat (limited to 'tests')
-rw-r--r--tests/template/t19700.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/template/t19700.nim b/tests/template/t19700.nim
new file mode 100644
index 000000000..cc2944944
--- /dev/null
+++ b/tests/template/t19700.nim
@@ -0,0 +1,10 @@
+discard """
+  errormsg: "type mismatch: got <Obj, Obj, template (x: untyped, y: untyped): untyped>"
+"""
+
+type Obj = object
+
+proc apply[T, R](a, b: T; f: proc(x, y: T): R): R = f(a, b)
+
+let a, b = Obj()
+discard apply(a, b, `!=`)