support for parametric user-defined type classes

This commit is contained in:
Zahary Karadjov 2014-01-24 14:13:32 +02:00
commit a6a18be089
6 changed files with 102 additions and 71 deletions

View file

@ -322,12 +322,12 @@ proc isOpImpl(c: PContext, n: PNode): PNode =
tfIterator in t.flags))
else:
var match: bool
let t2 = n[2].typ
let t2 = n[2].typ.skipTypes({tyTypeDesc})
case t2.kind
of tyTypeClasses:
var m: TCandidate
initCandidate(c, m, t2)
match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil
match = typeRel(m, t2, t1) != isNone
of tyOrdinal:
var m: TCandidate
initCandidate(c, m, t2)