summary refs log tree commit diff stats
path: root/tests/overload/issue22142/tfail_object_is_generic.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/overload/issue22142/tfail_object_is_generic.nim')
-rw-r--r--tests/overload/issue22142/tfail_object_is_generic.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/overload/issue22142/tfail_object_is_generic.nim b/tests/overload/issue22142/tfail_object_is_generic.nim
new file mode 100644
index 000000000..b46795bd5
--- /dev/null
+++ b/tests/overload/issue22142/tfail_object_is_generic.nim
@@ -0,0 +1,16 @@
+discard """
+  errormsg: "ambiguous call"
+"""
+
+#[
+As of the time of writing `object` needs some special
+treament in order to be considered "generic" in the right
+context when used implicitly
+]#
+
+type
+  C = object
+
+proc test[T: object](param: T): bool = false
+proc test(param: object): bool = true  
+doAssert test(C()) == true  # previously would pass