Skip to content

fix(analysis): improve TRON builtin diagnostics, drop dead via-ir branch#125

Merged
CodeNinjaEvan merged 1 commit into
tronprotocol:release_0.8.28from
yanghang8612:fix/tron-analysis-diagnostics
Jun 26, 2026
Merged

fix(analysis): improve TRON builtin diagnostics, drop dead via-ir branch#125
CodeNinjaEvan merged 1 commit into
tronprotocol:release_0.8.28from
yanghang8612:fix/tron-analysis-diagnostics

Conversation

@yanghang8612

Copy link
Copy Markdown

Summary

Two diagnostic improvements for TRON builtins and one dead-code removal in the analysis / CLI layer. No change to the generated bytecode.

Changes

  • address payable hint covers all payable-only TRON members (TypeChecker). The 9862 "only available for objects of type address payable" hint listed only send / transfer / transferToken, but freeze / unfreeze / delegateResource / unDelegateResource are payable-only members too. Calling one of them on a plain address previously fell back to the generic 9582 "member not found"; now it gives the helpful "use address payable" hint.
  • payable-only error mentions msg.tokenid / msg.tokenvalue (ViewPureChecker). msg.tokenid and msg.tokenvalue are classified as payable (correctly), but the 5887 error text was hardcoded to "msg.value" and "callvalue()". Reading msg.tokenid in a non-payable function therefore reported a misleading msg.value message; the text now lists the TRON members as well.
  • Remove unreachable --via-ir branch (CommandLineParser). After --via-ir is unconditionally rejected with solThrow, the || m_args.count(g_strViaIR) > 0 term in the following assignment is dead. Removed.

Verification

  • A plain address calling freeze(...) now reports error 9862 (the "address payable" hint) instead of the generic 9582.
  • Reading msg.tokenid in a non-payable function reports an error that names msg.tokenid / msg.tokenvalue, not just msg.value.

Targets release_0.8.28.

🤖 Generated with Claude Code

Extend the address-payable hint to freeze/unfreeze/delegateResource/
unDelegateResource; mention msg.tokenid/msg.tokenvalue in the payable
error; remove the unreachable via-ir OR term in CommandLineParser.
@github-actions

Copy link
Copy Markdown

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.

@yanghang8612 yanghang8612 marked this pull request as ready for review June 26, 2026 06:51
@CodeNinjaEvan CodeNinjaEvan merged commit 0192596 into tronprotocol:release_0.8.28 Jun 26, 2026
1 check 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.

2 participants