Revert "static and default params for generics"

This reverts commit 46813bbe4e.
This commit is contained in:
Araq 2013-05-27 23:18:38 +02:00
commit 0662ec4a43
4 changed files with 62 additions and 93 deletions

View file

@ -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