This commit is contained in:
Andreas Rumpf 2016-08-23 17:11:10 +02:00
commit 200ccff015

View file

@ -1280,14 +1280,15 @@ proc genInfixCall(p: PProc, n: PNode, r: var TCompRes) =
assert(typ.kind == tyProc) assert(typ.kind == tyProc)
genPatternCall(p, n, pat, typ, r) genPatternCall(p, n, pat, typ, r)
return return
gen(p, n.sons[1], r) if n.len != 1:
if r.typ == etyBaseIndex: gen(p, n.sons[1], r)
if r.address == nil: if r.typ == etyBaseIndex:
globalError(n.info, "cannot invoke with infix syntax") if r.address == nil:
r.res = "$1[$2]" % [r.address, r.res] globalError(n.info, "cannot invoke with infix syntax")
r.address = nil r.res = "$1[$2]" % [r.address, r.res]
r.typ = etyNone r.address = nil
add(r.res, "." | "->") r.typ = etyNone
add(r.res, "." | "->")
var op: TCompRes var op: TCompRes
if p.target == targetPHP: if p.target == targetPHP:
op.kind = resCallee op.kind = resCallee