implement the special treatment of explicit type params in concepts
This commit is contained in:
parent
0f2c4be129
commit
644d645ea7
6 changed files with 20 additions and 5 deletions
|
|
@ -638,6 +638,7 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate,
|
|||
if modifier != tyNone:
|
||||
dummyName = param[0]
|
||||
dummyType = c.makeTypeWithModifier(modifier, a)
|
||||
if modifier == tyTypeDesc: dummyType.flags.incl tfExplicit
|
||||
else:
|
||||
dummyName = param
|
||||
dummyType = a
|
||||
|
|
@ -833,7 +834,8 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
|
|||
var
|
||||
useTypeLoweringRuleInTypeClass = c.c.inTypeClass > 0 and
|
||||
not c.isNoCall and
|
||||
f.kind != tyTypeDesc
|
||||
f.kind != tyTypeDesc and
|
||||
tfExplicit notin aOrig.flags
|
||||
|
||||
aOrig = if useTypeLoweringRuleInTypeClass:
|
||||
aOrig.skipTypes({tyTypeDesc, tyFieldAccessor})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue