support for matching generic types' procs in generic concepts
This commit is contained in:
parent
33f4e69759
commit
0a9a878bd3
5 changed files with 145 additions and 11 deletions
|
|
@ -319,11 +319,11 @@ proc isOpImpl(c: PContext, n: PNode): PNode =
|
|||
result = newIntNode(nkIntLit, 0)
|
||||
else:
|
||||
var rhsOrigType = n[2].typ
|
||||
discard inferTypeClassParam(c, t1, rhsOrigType)
|
||||
var t2 = rhsOrigType.skipTypes({tyTypeDesc})
|
||||
maybeLiftType(t2, c, n.info)
|
||||
var m: TCandidate
|
||||
initCandidate(c, m, t2)
|
||||
discard inferTypeClassParam(m, t1, rhsOrigType)
|
||||
let match = typeRel(m, t2, t1) >= isSubtype # isNone
|
||||
result = newIntNode(nkIntLit, ord(match))
|
||||
|
||||
|
|
@ -912,8 +912,6 @@ const
|
|||
tyTypeParamsHolders = {tyGenericInst, tyUserTypeClassInst, tyCompositeTypeClass}
|
||||
tyDotOpTransparent = {tyVar, tyPtr, tyRef, tyAlias}
|
||||
|
||||
|
||||
|
||||
proc readTypeParameter(c: PContext, typ: PType,
|
||||
paramName: PIdent, info: TLineInfo): PNode =
|
||||
let ty = if typ.kind in {tyGenericInst, tyUserTypeClassInst}: typ.skipGenericAlias
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue