diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-04-23 00:26:17 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-04-23 00:26:17 +0100 |
commit | 9e69e4e078466886565565d6763b1e4794ea0670 (patch) | |
tree | 2d9adb4a13d6c8f132fa8592092a46da70601c33 /compiler/semexprs.nim | |
parent | 13a5ecda320ada29f19432df805dfc4538f8e103 (diff) | |
parent | 3b00d9cc7a06fd7720d56548b7139b8c52be5f33 (diff) | |
download | Nim-9e69e4e078466886565565d6763b1e4794ea0670.tar.gz |
Merge branch 'devel' into underscore-tuple-unpack
Conflicts: compiler/semstmts.nim
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 28373e3c6..eb8d0c561 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -31,7 +31,7 @@ proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.typ != nil: # XXX tyGenericInst here? if result.typ.kind == tyVar: result = newDeref(result) - elif efWantStmt in flags: + elif {efWantStmt, efAllowStmt} * flags != {}: result.typ = newTypeS(tyEmpty, c) else: localError(n.info, errExprXHasNoType, @@ -389,7 +389,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode = maybeLiftType(t2, c, n.info) var m: TCandidate initCandidate(c, m, t2) - let match = typeRel(m, t2, t1) != isNone + let match = typeRel(m, t2, t1) >= isSubtype # isNone result = newIntNode(nkIntLit, ord(match)) result.typ = n.typ @@ -1298,6 +1298,9 @@ proc semAsgn(c: PContext, n: PNode): PNode = typeMismatch(n, lhs.typ, rhs.typ) n.sons[1] = fitNode(c, le, rhs) + if tfHasAsgn in lhs.typ.flags and not lhsIsResult: + return overloadedAsgn(c, lhs, n.sons[1]) + fixAbstractType(c, n) asgnToResultVar(c, n, n.sons[0], n.sons[1]) result = n |