Skip to content

Commit

Permalink
bugfix: now making sure types are the same when mapping typeParameter…
Browse files Browse the repository at this point in the history
…s collected from usage.
  • Loading branch information
m0rkeulv committed Jan 9, 2025
1 parent d7b71de commit 0db1067
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,17 @@ public static ResultHolder searchReferencesForTypeParameters(final HaxeComponent
}
return current;
}

private static @NotNull ResultHolder mapTypeParameter(ResultHolder current, ResultHolder found) {
SpecificHaxeClassReference foundType = found.getClassType();
if (foundType == null) return found;
HaxeGenericResolver foundResolver = foundType.getGenericResolver();
HaxeGenericResolver mappedResolver = foundResolver.translateFromTo(foundType.getHaxeClass(), current.getClassType().getHaxeClass());
SpecificHaxeClassReference foundType = found.getClassType();
if (foundType == null) return current;

// if class try to cast before attempting to extract generics (Dynamic, Any etc will get passed canAssign checks)
foundType = foundType.tryCastTo(current.getClassType());
if (foundType == null) return current;

HaxeGenericResolver foundResolver = foundType.getGenericResolver();
HaxeGenericResolver mappedResolver = foundResolver.translateFromTo(foundType.getHaxeClass(), current.getClassType().getHaxeClass());

@NotNull ResultHolder[] currentSpecifics = current.getClassType().getSpecifics();
@NotNull ResultHolder[] foundSpecifics = mappedResolver.getSpecifics();
Expand Down

0 comments on commit 0db1067

Please sign in to comment.