Skip to content

Fix inline declaration codegen - #183

Open
KingParmenides wants to merge 2 commits into
Syncleus:masterfrom
KingParmenides:bounty-97-inline-declarations
Open

KingParmenides wants to merge 2 commits into
Syncleus:masterfrom
KingParmenides:bounty-97-inline-declarations

Conversation

@KingParmenides

@KingParmenides KingParmenides commented May 11, 2026 •

Copy link
Copy Markdown

Fixes #97.
Fixes #99.

This hoists declarations for locals whose first assignment appears inside inline assignment and chained multi-assignment expressions, then emits the expression as a normal assignment. That prevents invalid declaration-in-expression OpenCL such as result = int assignMe = value; while preserving the existing guard for unhandled inline declaration contexts.

Validation run locally:

  • Direct JDK 11 compile plus JUnitCore: FirstAssignInExpression2Test, AssignAndPassAsParameterSimpleTest, AssignAndPassAsParameterTest, ConstantAssignInExpressionTest, MultipleAssignExprTest - 10 tests OK.
  • git diff --check

I also attempted the equivalent focused Maven test target, but this sandbox blocked scala-maven-plugin when it tried to create /Users/jpappas/.sbt.

This branch has not been deployed

No deployments
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 $20] Two inline assignments in the same statement produce incorrect opencl code. [Bounty $20] Inline declarations throw exception.

1 participant