Skip to content

Commit 31e9188

Browse files
committed
Fix name resolution errors around alias ancestor types
`StructTypeImpl.parent` was not being resolved correctly when the relevant ancestor was a type alias. This was because we did an `instanceof StructTypeImpl` check, which is incompatible with the generated type alias impl classes introduced in b3b14dd.
1 parent 4db9844 commit 31e9188

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
### Fixed
2323

24+
- Name resolution errors around alias ancestor types.
2425
- Parsing errors around partial `asm` blocks blocks in conditional branches.
2526
- False positives around case items with multiple values in `CaseStatementSize`.
2627

delphi-frontend/src/main/java/au/com/integradev/delphi/type/factory/StructTypeImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void setAncestors(Set<Type> ancestorList) {
7070
} else {
7171
this.parent =
7272
this.ancestorList.stream()
73-
.filter(StructTypeImpl.class::isInstance)
73+
.filter(Type::isStruct)
7474
.filter(not(Type::isInterface))
7575
.findFirst()
7676
.orElse(TypeFactory.unknownType());

0 commit comments

Comments
 (0)