wip type class reforms (the compiler bootstraps fine)

* replace tfAny and tfAll with tyAnd and tyOr
* integrate matchTypeClass into typeRel
* introduce tyBuiltInTypeClass to handle types such as tuple, object, proc, etc
This commit is contained in:
Zahary Karadjov 2013-12-25 19:25:04 +02:00
commit 1d02f2ea53
8 changed files with 94 additions and 99 deletions

View file

@ -1163,7 +1163,7 @@ proc semAsgn(c: PContext, n: PNode): PNode =
if lhsIsResult:
n.typ = EnforceVoidContext
if lhs.sym.typ.kind == tyGenericParam:
if matchTypeClass(lhs.typ, rhs.typ):
if cmpTypes(c, lhs.typ, rhs.typ) == isGeneric:
InternalAssert c.p.resultSym != nil
lhs.typ = rhs.typ
c.p.resultSym.typ = rhs.typ