summary refs log tree commit diff stats
path: root/tests/overload/toverl3.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/overload/toverl3.nim')
-rw-r--r--tests/overload/toverl3.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/overload/toverl3.nim b/tests/overload/toverl3.nim
new file mode 100644
index 000000000..b3e0f2fa7
--- /dev/null
+++ b/tests/overload/toverl3.nim
@@ -0,0 +1,20 @@
+discard """
+  file: "toverl3.nim"
+  output: '''m1
+tup1'''
+"""
+
+# Tests more specific generic match:

+

+proc m[T](x: T) = echo "m2"
+proc m[T](x: var ref T) = echo "m1"
+
+proc tup[S, T](x: tuple[a: S, b: ref T]) = echo "tup1"
+proc tup[S, T](x: tuple[a: S, b: T]) = echo "tup2"
+
+var
+  obj: ref int
+  tu: tuple[a: int, b: ref bool]
+  
+m(obj)
+tup(tu)