Skip to content

Preserve failAfter directive in isoltest ASTJSON reformatting#16574

Open
tavian-dev wants to merge 1 commit intoargotorg:developfrom
tavian-dev:fix-isoltest-failafter-stripping
Open

Preserve failAfter directive in isoltest ASTJSON reformatting#16574
tavian-dev wants to merge 1 commit intoargotorg:developfrom
tavian-dev:fix-isoltest-failafter-stripping

Conversation

@tavian-dev
Copy link
Copy Markdown

Description

Fixes #14093.

When isoltest updates test expectations for ASTJSON tests (via --accept-updates), it calls ASTJSONTest::printSource() to rewrite the .sol input file. The function was not outputting the failAfter directive that was parsed and stored in m_expectedFailAfter, causing the directive to be silently dropped during reformatting.

The Fix

Added output of the failAfter directive in ASTJSONTest::printSource() when m_expectedFailAfter has a value. The directive is written in the same format that fillSources() parses: // failAfter: <CompilerState>.

Changes

  • test/libsolidity/ASTJSONTest.cpp: Add failAfter output to printSource() (3 lines)

Testing

  • Built and ran ASTJSON tests (72 pass)
  • Built and ran syntax tests (3551 pass)
  • Code style check passes
  • The fix is minimal and directly addresses the parsing/output asymmetry identified in the issue

When isoltest updates test expectations for ASTJSON tests, it calls
printSource() to rewrite the .sol input file. The function was not
outputting the failAfter directive that was parsed and stored in
m_expectedFailAfter, causing the directive to be silently dropped.

Fixes argotorg#14093
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isoltest strips failAfter directive from ASTJSON tests when it reformats them

1 participant