summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-03-06 14:12:47 +0800
committerGitHub <noreply@github.com>2023-03-06 14:12:47 +0800
commit4d76725299e524e19d515c04d923bd408607a966 (patch)
tree5544b380fa9e6503beb9ddc7ba3273439cdf4c94
parent05e8a60bb4fe40d450aaec4603209e310ea490a4 (diff)
downloadNim-4d76725299e524e19d515c04d923bd408607a966.tar.gz
closes #16654; add a test case (#21478)
-rw-r--r--tests/errmsgs/t16654.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/errmsgs/t16654.nim b/tests/errmsgs/t16654.nim
new file mode 100644
index 000000000..749707c06
--- /dev/null
+++ b/tests/errmsgs/t16654.nim
@@ -0,0 +1,12 @@
+discard """
+  cmd: "nim check $options $file"
+  errormsg: "type mismatch: got <int> but expected 'float'"
+"""
+
+when true: # bug #16654
+  func fn[T](a: T, op: proc(a: T): float) = discard
+  proc main() =
+    let v = 1
+    proc bar(r: auto): auto = v
+    fn(1, bar)
+  main()