Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Nov 5, 2023
1 parent 644ed56 commit 9a904a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ private static void checkInterfaceFields(

if (intReference.getHaxeClass() != null) {
List<HaxeFieldDeclaration> fieldsInThisClass = clazz.haxeClass.getFieldSelf(clazz.getGenericResolver(null));
List<HaxeFieldDeclaration> allFields = clazz.haxeClass.getHaxeFieldAll(HaxeComponentType.CLASS, HaxeComponentType.ENUM);
List<HaxeNamedComponent> allFields = clazz.haxeClass.getHaxeFieldAll(HaxeComponentType.CLASS, HaxeComponentType.ENUM);
for (HaxeFieldModel intField : intReference.getHaxeClass().getFields()) {
if (!intField.isStatic()) {


String interfaceFieldName = intField.getName();
Optional<HaxeFieldDeclaration> fieldResultAll = allFields.stream()
Optional<HaxeNamedComponent> fieldResultAll = allFields.stream()
.filter(method -> interfaceFieldName.equals(method.getName()))
.findFirst();
Optional<HaxeFieldDeclaration> fieldResultClassOnly = fieldsInThisClass.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public String getName() {
* @return list of FieldDeclaration
*/
@NotNull
List<HaxeFieldDeclaration> getHaxeFieldAll(HaxeComponentType... fromTypesFilter);
List<HaxeNamedComponent> getHaxeFieldAll(HaxeComponentType... fromTypesFilter);

@Nullable
HaxeNamedComponent findHaxeFieldByName(@NotNull final String name, @Nullable HaxeGenericResolver resolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,20 +524,20 @@ public List<HaxeMethod> getHaxeMethodsAncestor(boolean unique) {
}

@NotNull
public List<HaxeFieldDeclaration> getHaxeFieldAll(HaxeComponentType... fromTypesFilter) {
public List<HaxeNamedComponent> getHaxeFieldAll(HaxeComponentType... fromTypesFilter) {
List<HaxeNamedComponent> fields = getAllHaxeNamedComponents(HaxeComponentType.FIELD, fromTypesFilter);
final List<HaxeFieldDeclaration> result = new ArrayList<>();
final List<HaxeNamedComponent> result = new ArrayList<>();
for (HaxeNamedComponent field : fields) {
result.add((HaxeFieldDeclaration)field);
result.add(field);
}
if (this.getModel() instanceof HaxeAbstractClassModel model) {
if (model.hasForwards()) {
HaxeClass underlyingClass = model.getUnderlyingClass(null);
if (underlyingClass instanceof AbstractHaxePsiClass abstractHaxePsiClass) {
List<HaxeNamedComponent> components = abstractHaxePsiClass.getAllHaxeNamedComponents(HaxeComponentType.FIELD);
for (HaxeNamedComponent field : fields) {
if (model.isForwarded(field.getName())) {
result.add((HaxeFieldDeclaration)field);
for (HaxeNamedComponent component : components) {
if (model.isForwarded(component.getName())) {
result.add(component);
}
}
}
Expand Down

0 comments on commit 9a904a5

Please sign in to comment.