This commit is contained in:
Araq 2015-09-13 23:26:44 +02:00
commit 14354b436f
5 changed files with 40 additions and 13 deletions

View file

@ -265,9 +265,6 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1;
proc typeRel*(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation
proc concreteType(c: TCandidate, t: PType): PType =
# currently `[]=` is defined rather sloppily in system.nim, so we have
# a special type matching rule for it:
if c.calleeSym != nil and c.calleeSym.magic == mArrPut: return t
case t.kind
of tyArrayConstr:
# make it an array
@ -1694,7 +1691,7 @@ proc partialMatch*(c: PContext, n, nOrig: PNode, m: var TCandidate) =
matchesAux(c, n, nOrig, m, marker)
proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) =
if m.calleeSym != nil and m.calleeSym.magic == mArrGet:
if m.calleeSym != nil and m.calleeSym.magic in {mArrGet, mArrPut}:
m.state = csMatch
m.call = n
return