fix a regrsesion in signature matching of derived ptr types

This commit is contained in:
Zahary Karadjov 2017-04-18 23:55:59 +03:00
commit 3e52bb6535
2 changed files with 25 additions and 3 deletions

View file

@ -1240,13 +1240,15 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
if prev == nil: put(c, f, a)
result = isGeneric
else:
var aAsObject = roota.lastSon
if rootf.lastSon.kind in {tyAnd, tyOr}:
let fKind = rootf.lastSon.kind
if fKind in {tyAnd, tyOr}:
result = typeRel(c, lastSon(f), a)
if result != isNone: put(c, f, a)
return
if rootf.lastSon.kind == tyRef and aAsObject.kind == tyRef:
var aAsObject = roota.lastSon
if fKind in {tyRef, tyPtr} and aAsObject.kind == fKind:
aAsObject = aAsObject.base
if aAsObject.kind == tyObject: