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

xtr.arrays.zip doesn't work with arrays of uneven lengths #24

Open
MrSnapperVibes opened this issue Aug 19, 2024 · 0 comments
Open

xtr.arrays.zip doesn't work with arrays of uneven lengths #24

MrSnapperVibes opened this issue Aug 19, 2024 · 0 comments

Comments

@MrSnapperVibes
Copy link

The documentation reads the function "Returns a new Array of equal size to the shortest array given. Every n-th element in the result is an Array containing the n-th element of the given arrays."

However, xtr.arrays.zip([1, 2, 3], ["x", "y"]) throws

sjsonnet.Error: Internal Error
	at [ApplyBuiltin].((main):1:15)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
	at io.github.jam01.xtrasonnet.modules.Arrays$.$anonfun$functions$34(Arrays.scala:228)
	at sjsonnet.Std$$anon$7.evalRhs(Std.scala:1234)
	at sjsonnet.Evaluator.visitApplyBuiltin(Evaluator.scala:245)
	at sjsonnet.Evaluator.visitExpr(Evaluator.scala:59)
	at sjsonnet.Evaluator$$anon$1.evalRhs(Evaluator.scala:485)
	at io.github.jam01.xtrasonnet.Transformer$$anon$2.evalRhs(Transformer.scala:237)
	at sjsonnet.Val$Func.apply(Val.scala:388)
	at sjsonnet.Materializer.apply0(Materializer.scala:61)
	at io.github.jam01.xtrasonnet.plugins.DefaultJSONPlugin.write(DefaultJSONPlugin.java:106)
	at io.github.jam01.xtrasonnet.DataFormatService.mandatoryWrite(DataFormatService.java:64)
	at io.github.jam01.xtrasonnet.Transformer.$anonfun$transform$2(Transformer.scala:244)
	at io.github.jam01.xtrasonnet.Transformer$.io$github$jam01$xtrasonnet$Transformer$$handleException(Transformer.scala:36)
	at io.github.jam01.xtrasonnet.Transformer.transform(Transformer.scala:244)
	at io.github.jam01.xtrasonnet.playground.App.handleRequest(App.java:94)
	at io.github.jam01.xtrasonnet.playground.App.handleRequest(App.java:41)
	at io.quarkus.amazon.lambda.runtime.AmazonLambdaRecorder$1.processRequest(AmazonLambdaRecorder.java:167)
	at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:137)
	at [email protected]/java.lang.Thread.run(Thread.java:833)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant