From a4f3bf374238df96f0982b7106e3702da6b485b1 Mon Sep 17 00:00:00 2001 From: Ryan McConnell Date: Sat, 6 Jan 2024 05:50:09 +0000 Subject: Fixes #23172 (#23173) #23172 --- tests/lookups/issue_23172/m23172.nim | 6 ++++++ tests/lookups/t23172.nim | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/lookups/issue_23172/m23172.nim create mode 100644 tests/lookups/t23172.nim (limited to 'tests/lookups') diff --git a/tests/lookups/issue_23172/m23172.nim b/tests/lookups/issue_23172/m23172.nim new file mode 100644 index 000000000..36af48761 --- /dev/null +++ b/tests/lookups/issue_23172/m23172.nim @@ -0,0 +1,6 @@ +type + Foo* = object + Bar* = object + +func `$`*(x: Foo | Bar): string = + "X" diff --git a/tests/lookups/t23172.nim b/tests/lookups/t23172.nim new file mode 100644 index 000000000..9edf9905a --- /dev/null +++ b/tests/lookups/t23172.nim @@ -0,0 +1,9 @@ +import issue_23172/m23172 + +type FooX = distinct Foo + +func `$`*(x: FooX): string = + $m23172.Foo(x) + +var a: FooX +doAssert $a == "X" -- cgit 1.4.1-2-gfad0