From c67abd7e61764c681c4ef472996b8d01269fce83 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 27 May 2013 23:16:56 +0200 Subject: Revert "more test made green" This reverts commit 911e6e710f28f454cf8bc1bb493c1a28c4694b76. --- compiler/ast.nim | 3 +- compiler/lambdalifting.nim | 2 +- compiler/seminst.nim | 37 +++++++++----------- compiler/semtypes.nim | 2 +- tests/compile/tobjects.nim | 86 +++++++++++++++++++++++----------------------- tests/compile/toverprc.nim | 55 +++++++++++++++-------------- 6 files changed, 89 insertions(+), 96 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 00e4b3bda..5f3ce2613 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1285,8 +1285,7 @@ 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 or - (s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty) + result = sfFromGeneric in s.flags else: nil proc isRoutine*(s: PSym): bool {.inline.} = diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 9a40b350e..163ea4136 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 + s.owner == outerProc and not isGenericRoutine(s) #s.typ.callConv == ccClosure proc addClosureParam(i: PInnerContext, e: PEnv) = diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 15be33261..ed842d98e 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -91,8 +91,17 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) = addDecl(c, result) pushProcCon(c, result) # add params to scope - for i in 1 .. 95b28700c ^
1
2
3
4
5
6
7
8
9
10
11
12
13