Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java][jvm] varargs of extern libs not parsed correctly #9845

Closed
RealyUniqueName opened this issue Aug 17, 2020 · 1 comment · Fixed by #9846
Closed

[java][jvm] varargs of extern libs not parsed correctly #9845

RealyUniqueName opened this issue Aug 17, 2020 · 1 comment · Fixed by #9846
Labels
platform-jvm Everything related to JVM

Comments

@RealyUniqueName
Copy link
Member

RealyUniqueName commented Aug 17, 2020

Varargs parsed as java.NativeArray<T>, while it should be haxe.extern.Rest<T>
E.g. java signature of java.nio.file.Paths.get is public static Path get(String first, String... more)
But using it from Haxe as a method with rest arguments fails:

class Main {
	static function main() {
		java.nio.file.Paths.get('.');
	}
}

error:

$ haxe build.hxml 
src/Main.hx:3: characters 3-31 : Could not find a suitable overload, reasons follow
src/Main.hx:3: characters 3-31 : Overload resolution failed for (param1 : java.net.URI) -> java.nio.file.Path
src/Main.hx:3: characters 28-29 : String should be java.net.URI
src/Main.hx:3: characters 28-29 : For function argument 'param1'
src/Main.hx:3: characters 3-31 : Overload resolution failed for (param1 : String, param2 : java.NativeArray<String>) -> java.nio.file.Path
src/Main.hx:3: characters 3-31 : Not enough arguments, expected param2:java.NativeArray<String>
src/Main.hx:3: characters 3-31 : End of overload failure reasons
@RealyUniqueName RealyUniqueName added the platform-jvm Everything related to JVM label Aug 17, 2020
@RealyUniqueName RealyUniqueName added this to the Release 4.2 milestone Aug 17, 2020
@RealyUniqueName RealyUniqueName modified the milestones: Release 4.2, Bugs Aug 17, 2020
@RealyUniqueName
Copy link
Member Author

RealyUniqueName commented Aug 17, 2020

While working on a fix I suddenly understood there's currently no way to pass a native array of values if that was parsed as haxe.extern.Rest.
So, #9274 should be addressed first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-jvm Everything related to JVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant