summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2022-10-29 18:12:19 +0200
committerGitHub <noreply@github.com>2022-10-29 18:12:19 +0200
commitf8b5464f31834bf97e7f9023644e255f2e9b6485 (patch)
tree113a70f9eac434b2b46af04056ec33c0ad1a6d5e
parent1dab8ba334a1b53f3c8780bc8a4f8045a6ea0375 (diff)
downloadNim-f8b5464f31834bf97e7f9023644e255f2e9b6485.tar.gz
fix dispatcher call type [backport] (#20696)
fix dispatcher call type

The call node should have the type of the dispatcher, not the static
call
-rw-r--r--compiler/cgmeth.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim
index 8fe8f225c..4940a9093 100644
--- a/compiler/cgmeth.nim
+++ b/compiler/cgmeth.nim
@@ -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: