diff options
author | Araq <rumpf_a@web.de> | 2013-05-27 23:18:38 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-05-27 23:18:38 +0200 |
commit | 0662ec4a434f4656b5afc486bc4ebaab82c52da6 (patch) | |
tree | d523f18a63b849bd24b241c73abd803d5d5e1859 /compiler/sigmatch.nim | |
parent | e3f93241c3824e49b69c647bbd44726a79e8f8f8 (diff) | |
download | Nim-0662ec4a434f4656b5afc486bc4ebaab82c52da6.tar.gz |
Revert "static and default params for generics"
This reverts commit 46813bbe4e1423181521d4792b9af7593f48fa1f.
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r-- | compiler/sigmatch.nim | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 048067a44..4ca3e9d43 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -84,9 +84,6 @@ proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, #debug(formalTypeParam) put(c.bindings, formalTypeParam, binding[i].typ) -proc newCandidate*(callee: PSym, binding: PNode, calleeScope = -1): TCandidate = - initCandidate(result, callee, binding, calleeScope) - proc copyCandidate(a: var TCandidate, b: TCandidate) = a.exactMatches = b.exactMatches a.subtypeMatches = b.subtypeMatches @@ -864,22 +861,16 @@ proc matchesAux(c: PContext, n, nOrig: PNode, else: m.state = csNoMatch return - - var - # iterates over formal parameters - f = if m.callee.kind != tyGenericBody: 1 - else: 0 - # iterates over the actual given arguments - a = 1 - - m.state = csMatch # until proven otherwise + + var f = 1 # iterates over formal parameters + var a = 1 # iterates over the actual given arguments + m.state = csMatch # until proven otherwise m.call = newNodeI(n.kind, n.info) m.call.typ = base(m.callee) # may be nil - var formalLen = m.callee.n.len + var formalLen = sonsLen(m.callee.n) addSon(m.call, copyTree(n.sons[0])) var container: PNode = nil # constructed container var formal: PSym = nil - while a < n.len: if n.sons[a].kind == nkExprEqExpr: # named param |