Skip to content

Commit

Permalink
Add new haxe.Rest abstract to rest parameter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Jul 12, 2024
1 parent 679a3d8 commit 56163a7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ private static ResultHolder resolveParameterType(HaxeParameterModel parameter, H
if (type.getClassType() != null) {
SpecificHaxeClassReference classType = type.getClassType();
@NotNull ResultHolder[] specifics = classType.getSpecifics();
if (isExternRestClass(classType)) {
if (isExternRestClass(classType) || isRestClass(classType)) {
if (specifics.length == 1) {
return specifics[0];
}
Expand Down Expand Up @@ -1041,8 +1041,8 @@ private static boolean isVarArg(HaxeParameterModel model) {
if (classType.isArray() && isMacroExpr(specificType)) {
return true;
}
// haxe.extern.Rest<>
return isExternRestClass(classType);
// haxe.extern.Rest<> / haxe.Rest<>
return isExternRestClass(classType) || isRestClass(classType);
}
}
}
Expand All @@ -1056,6 +1056,10 @@ private static boolean isMacroExpr(SpecificHaxeClassReference classReference) {
return classReference.getHaxeClass().getQualifiedName().equals("haxe.macro.Expr");
}

private static boolean isRestClass(SpecificHaxeClassReference classReference) {
if (classReference.getHaxeClass() == null) return false;
return classReference.getHaxeClass().getQualifiedName().equals("haxe.Rest");
}
private static boolean isExternRestClass(SpecificHaxeClassReference classReference) {
if (classReference.getHaxeClass() == null) return false;
return classReference.getHaxeClass().getQualifiedName().equals("haxe.extern.Rest");
Expand Down

0 comments on commit 56163a7

Please sign in to comment.