Skip to content

Preserve failAfter directive in isoltest ASTJSON reformatting#16574

Merged
clonker merged 1 commit into
argotorg:developfrom
tavian-dev:fix-isoltest-failafter-stripping
May 7, 2026
Merged

Preserve failAfter directive in isoltest ASTJSON reformatting#16574
clonker merged 1 commit into
argotorg:developfrom
tavian-dev:fix-isoltest-failafter-stripping

Conversation

@tavian-dev
Copy link
Copy Markdown
Contributor

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

@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.

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
@clonker clonker force-pushed the fix-isoltest-failafter-stripping branch from 1f06566 to ea0a8c1 Compare May 7, 2026 11:39
Copy link
Copy Markdown
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@clonker clonker merged commit b41c161 into argotorg:develop May 7, 2026
76 of 82 checks passed
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

4 participants