Skip to content

GROOVY-3330: keep stub generation from rewriting the AST early - #3344

Open
daniellansun wants to merge 1 commit into
apache:masterfrom
daniellansun:GROOVY-3330
Open

daniellansun wants to merge 1 commit into
apache:masterfrom
daniellansun:GROOVY-3330

Conversation

@daniellansun

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/GROOVY-3330

Joint compilation still runs verification while printing Java stubs, so the stub text keeps GroovyObject, property accessors, default-argument overloads, and the Java main signature. After the stub is written, the class is restored to its pre-verification AST, so later phases and transforms see the same tree a non-joint compile has until class generation.

Named inner classes are captured and restored the same way. Labels on implicit returns were already preserved by the stub verifier's addReturnIfNeeded override; this change also keeps synthetic members, main, default-argument metadata, and enclosing-method pointers off the tree during conversion.

Coverage is in Groovy3330.

JavaStubGenerator runs Verifier while printing stubs during conversion.
Restore the class after the stub text is written so later phases still
see the pre-verification AST.
@testlens-app

testlens-app Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: edabed1
▶️ Tests: 144936 executed
⚪️ Checks: 26/26 completed


Learn more about TestLens at testlens.app/docs.

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.

1 participant