#23172
This commit is contained in:
Ryan McConnell
2024-01-06 05:50:09 +00:00
committed by GitHub
parent 3dee1a3e4c
commit a4f3bf3742
3 changed files with 16 additions and 1 deletions

View File

@@ -1710,7 +1710,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
if tfExplicitCallConv in target.flags and
target.callConv != effectiveArgType.callConv:
return isNone
put(c, f, a)
if doBind: put(c, f, a)
return isGeneric
else:
return isNone

View File

@@ -0,0 +1,6 @@
type
Foo* = object
Bar* = object
func `$`*(x: Foo | Bar): string =
"X"

9
tests/lookups/t23172.nim Normal file
View File

@@ -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"