This commit is contained in:
Andreas Rumpf 2016-07-19 15:24:42 +02:00
commit 2d8572e948
2 changed files with 9 additions and 3 deletions

View file

@ -69,13 +69,19 @@ proc sameMethodBucket(a, b: PSym): MethodResult =
else:
break
if sameType(aa, bb):
if aa.kind == tyObject and result != Invalid: result = Yes
if aa.kind == tyObject and result != Invalid:
result = Yes
elif aa.kind == tyObject and bb.kind == tyObject:
let diff = inheritanceDiff(bb, aa)
if diff < 0:
if result != Invalid: result = Yes
if result != Invalid:
result = Yes
else:
return No
elif diff != high(int):
result = Invalid
else:
return No
else:
return No