fix dispatcher call type [backport] (#20696)

fix dispatcher call type

The call node should have the type of the dispatcher, not the static
call

(cherry picked from commit f8b5464f31)
This commit is contained in:
Jacek Sieka
2022-10-29 18:12:19 +02:00
committed by narimiran
parent 38730862fc
commit 565cd4dd25

View File

@@ -46,6 +46,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: