diff --git a/compiler/ast.nim b/compiler/ast.nim index 5f6b658cfc..25c66e117b 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1359,7 +1359,8 @@ proc getStrOrChar*(a: PNode): string = proc isGenericRoutine*(s: PSym): bool = case s.kind of skProc, skTemplate, skMacro, skIterator, skMethod, skConverter: - result = sfFromGeneric in s.flags + result = sfFromGeneric in s.flags or + (s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty) else: nil proc isRoutine*(s: PSym): bool {.inline.} = diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 163ea41362..9a40b350e1 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -220,7 +220,7 @@ proc getHiddenParam(routine: PSym): PSym = proc isInnerProc(s, outerProc: PSym): bool {.inline.} = result = s.kind in {skProc, skMethod, skConverter} and - s.owner == outerProc and not isGenericRoutine(s) + s.owner == outerProc #s.typ.callConv == ccClosure proc addClosureParam(i: PInnerContext, e: PEnv) = diff --git a/compiler/seminst.nim b/compiler/seminst.nim index ed842d98ef..15be332610 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -91,17 +91,8 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) = addDecl(c, result) pushProcCon(c, result) # add params to scope - let origFormalParams = result.typ.n - result.typ.n = newNodeI(nkFormalParams, - origFormalParams.info, - origFormalParams.len) - result.typ.n.sons[0] = copyNode(origFormalParams.sons[0]) - for i in 1 ..