diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2023-12-12 16:54:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 16:54:50 +0100 |
commit | db603237c648a796ef7bff77641febd30b3999cd (patch) | |
tree | 13e693ac432b1542cab7f2b2bbe1b8c11ca258e0 /compiler/aliases.nim | |
parent | 8cc3c774c8925c3d21626d09b41ad352bd898e4a (diff) | |
download | Nim-db603237c648a796ef7bff77641febd30b3999cd.tar.gz |
Types: Refactorings; step 1 (#23055)
Diffstat (limited to 'compiler/aliases.nim')
-rw-r--r-- | compiler/aliases.nim | 10 |
1 files changed, 6 insertions, 4 deletions
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..<a.len: result = isPartOfAux(a[i], b, marker) if result == arYes: return |