Templates will pick the candidate in the nearest scope when symbols are mixed-in

This commit is contained in:
Zahary Karadjov 2013-12-31 03:58:31 +02:00
commit 8f3d5a25a6
6 changed files with 32 additions and 16 deletions

View file

@ -1164,7 +1164,7 @@ proc semAsgn(c: PContext, n: PNode): PNode =
if lhsIsResult: {efAllowDestructor} else: {})
if lhsIsResult:
n.typ = enforceVoidContext
if lhs.sym.typ.isMetaType:
if lhs.sym.typ.isMetaType and lhs.sym.typ.kind != tyTypeDesc:
if cmpTypes(c, lhs.typ, rhs.typ) == isGeneric:
internalAssert c.p.resultSym != nil
lhs.typ = rhs.typ