summary refs log tree commit diff stats
path: root/compiler/renderer.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2021-03-11 14:03:25 +0100
committerGitHub <noreply@github.com>2021-03-11 14:03:25 +0100
commit3cbc80045dfe84e47e28abc4d19f2bbeba82748d (patch)
tree5f77f08131e2a090c4788e1e28a98b61cea30f2c /compiler/renderer.nim
parent3ce27511adac12785b51ecc33dc9d2a2fcd2f0b8 (diff)
downloadNim-3cbc80045dfe84e47e28abc4d19f2bbeba82748d.tar.gz
Fix #14325 (#17308)
* Fix #14325
* Refactor and fix
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r--compiler/renderer.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index ed1c52bb7..13ff6941f 100644
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -1143,9 +1143,9 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
     gcomma(g, n)
     put(g, tkParRi, ")")
   of nkObjDownConv, nkObjUpConv:
+    let typ = if (n.typ != nil) and (n.typ.sym != nil): n.typ.sym.name.s else: ""
+    put(g, tkParLe, typ & "(")
     if n.len >= 1: gsub(g, n[0])
-    put(g, tkParLe, "(")
-    gcomma(g, n, 1)
     put(g, tkParRi, ")")
   of nkClosedSymChoice, nkOpenSymChoice:
     if renderIds in g.flags: