Skip to content

Fix returning directly instantiated arrays#203

Open
pnm03 wants to merge 1 commit into
Syncleus:masterfrom
pnm03:codex/bounty-66-return-new-array
Open

Fix returning directly instantiated arrays#203
pnm03 wants to merge 1 commit into
Syncleus:masterfrom
pnm03:codex/bounty-66-return-new-array

Conversation

@pnm03
Copy link
Copy Markdown

@pnm03 pnm03 commented May 13, 2026

Fixes #66.

This is intended as a submission for the `$25 bounty on returning directly instantiated arrays.

Summary:

  • Allow return new <primitive>[size] by emitting a named local return array before the return statement.
  • Match the generated OpenCL shape used by the existing supported workaround: assign the new array to a local variable, then return that local.
  • Update the primitive direct-new array codegen tests and their fixture comments.
  • Re-enable the runtime regression test that demonstrates the issue.

Validation:

  • git diff --check
  • mvn '-Dtest=ReturnBooleanNewArrayTest,ReturnByteArrayNewTest,ReturnDoubleArrayNewTest,ReturnFloatArrayNewTest,ReturnIntArrayNewTest,ReturnLongArrayNewTest,ReturnShortArrayNewTest,ReturnInstantiatedArrayDirectlyTest' test

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

Successfully merging this pull request may close these issues.

[BOUNTY $25] Can not directly return an instantiated array.

1 participant