summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-30 23:09:55 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-30 23:09:55 +0100
commita2db3c24d11c5f6caedf8ac6a24e664d75ba7f80 (patch)
treec89f3fd878481a5c6b8d1bff4e2dafe7ca8f8e9a /compiler
parent3e33084da7ed51818335ba785c2de837a4d653db (diff)
downloadNim-a2db3c24d11c5f6caedf8ac6a24e664d75ba7f80.tar.gz
fixes #3799
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semcall.nim13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 8445b24d9..a0d0db3ad 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -255,12 +255,13 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
 
 
 proc instGenericConvertersArg*(c: PContext, a: PNode, x: TCandidate) =
-  if a.kind == nkHiddenCallConv and a.sons[0].kind == nkSym and
-      isGenericRoutine(a.sons[0].sym):
-    let finalCallee = generateInstance(c, a.sons[0].sym, x.bindings, a.info)
-    a.sons[0].sym = finalCallee
-    a.sons[0].typ = finalCallee.typ
-    #a.typ = finalCallee.typ.sons[0]
+  if a.kind == nkHiddenCallConv and a.sons[0].kind == nkSym:
+    let s = a.sons[0].sym
+    if s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty:
+      let finalCallee = generateInstance(c, s, x.bindings, a.info)
+      a.sons[0].sym = finalCallee
+      a.sons[0].typ = finalCallee.typ
+      #a.typ = finalCallee.typ.sons[0]
 
 proc instGenericConvertersSons*(c: PContext, n: PNode, x: TCandidate) =
   assert n.kind in nkCallKinds