fix dispatcher call type [backport] (#20696)

fix dispatcher call type

The call node should have the type of the dispatcher, not the static
call
This commit is contained in:
Jacek Sieka
2022-10-29 18:12:19 +02:00
committed by GitHub
parent 1dab8ba334
commit f8b5464f31

View File

@@ -50,6 +50,7 @@ proc methodCall*(n: PNode; conf: ConfigRef): PNode =
# replace ordinary method by dispatcher method:
let disp = getDispatcher(result[0].sym)
if disp != nil:
result[0].typ = disp.typ
result[0].sym = disp
# change the arguments to up/downcasts to fit the dispatcher's parameters:
for i in 1..<result.len: