Skip to content

Commit

Permalink
Assign hint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Feb 5, 2024
1 parent 42c8900 commit dc6185a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,13 @@ else if (entry.type().equals(specific)) {
}
return null;
}

public void addAssignHint(HaxeGenericResolver resolver) {
Optional<ResolverEntry> assign = resolver.findAssignToType();
if(assign.isPresent()) {
// remove old if present
resolvers.removeIf(entry -> entry.resolveSource() == ResolveSource.ASSIGN_TYPE);
resolvers.add(assign.get().copy());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ static private ResultHolder getFunctionReturnType(HaxeNamedComponent comp, HaxeG
if (typeOrAnonymous != null) {
HaxeClass aClass = (HaxeClass) method.getContainingClass();
HaxeGenericResolver localResolver = HaxeGenericSpecialization.fromGenericResolver(null, resolver).toGenericResolver(aClass);
localResolver.addAssignHint(resolver);
ResultHolder anonymous = HaxeTypeResolver.getTypeFromTypeOrAnonymous(typeOrAnonymous, localResolver, true);
ResultHolder resolve = resolver.resolve(anonymous);
ResultHolder resolve = resolver.resolveReturnType(anonymous);
if (resolve != null && !resolve.isUnknown()) {
return resolve;
}
Expand Down

0 comments on commit dc6185a

Please sign in to comment.