newruntime: 'owned distinct' is a valid construct (required by async)

(cherry picked from commit a85e20c125)
This commit is contained in:
Araq
2019-07-09 15:23:46 +02:00
committed by narimiran
parent 7c7bab0626
commit ce9eaee303

View File

@@ -1293,6 +1293,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
inc(c.inheritancePenalty, depth)
result = isSubtype
of tyDistinct:
skipOwned(a)
if a.kind == tyDistinct:
if sameDistinctTypes(f, a): result = isEqual
#elif f.base.kind == tyAnything: result = isGeneric # issue 4435