From db603237c648a796ef7bff77641febd30b3999cd Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 12 Dec 2023 16:54:50 +0100 Subject: Types: Refactorings; step 1 (#23055) --- compiler/aliases.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'compiler/aliases.nim') diff --git a/compiler/aliases.nim b/compiler/aliases.nim index 40d6e272c..3910ecb9d 100644 --- a/compiler/aliases.nim +++ b/compiler/aliases.nim @@ -51,12 +51,14 @@ proc isPartOfAux(a, b: PType, marker: var IntSet): TAnalysisResult = if compareTypes(a, b, dcEqIgnoreDistinct): return arYes case a.kind of tyObject: - if a[0] != nil: - result = isPartOfAux(a[0].skipTypes(skipPtrs), b, marker) + if a.baseClass != nil: + result = isPartOfAux(a.baseClass.skipTypes(skipPtrs), b, marker) if result == arNo: result = isPartOfAux(a.n, b, marker) of tyGenericInst, tyDistinct, tyAlias, tySink: - result = isPartOfAux(lastSon(a), b, marker) - of tyArray, tySet, tyTuple: + result = isPartOfAux(skipModifier(a), b, marker) + of tySet, tyArray: + result = isPartOfAux(a.elementType, b, marker) + of tyTuple: for i in 0..