Skip to content

Commit

Permalink
avoid check usage when type is known for Literal Array + stackoverflo…
Browse files Browse the repository at this point in the history
…w prevention
  • Loading branch information
m0rkeulv committed Oct 27, 2023
1 parent a65913d commit fd5a094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public static HaxeGenericSpecialization fromGenericResolver(@Nullable PsiElement
specialization.put(element, name, resolved);
} else if (classType != null && !holder.isUnknown()) {
HaxeClass clazz = classType.getHaxeClass();
HaxeResolveResult resolved = HaxeResolveResult.create(clazz, fromGenericResolver(null, classType.getGenericResolver()));
HaxeResolveResult resolved = HaxeResolveResult.create(clazz, fromGenericResolver(context, classType.getGenericResolver()));
specialization.put(element, name, resolved);
} else if (holder.getFunctionType() != null) {
SpecificFunctionReference type = holder.getFunctionType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,9 +1028,9 @@ else if (subelement instanceof AbstractHaxeNamedComponent namedComponent) {
}
}
}
// empty expression with type tag (var x:Array<T> = []), no need to look for usage
// empty expression with type tag (var x:Array<T> = []), no need to look for usage, use typetag
if (references.isEmpty() && suggestedType != null && !suggestedType.isUnknown()) {
return SpecificHaxeClassReference.createArray(suggestedType.createHolder(), element).createHolder();
return typeTagType;
} else {
ResultHolder elementTypeHolder = references.isEmpty()
? SpecificTypeReference.getUnknown(element).createHolder()
Expand Down

0 comments on commit fd5a094

Please sign in to comment.