Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fmt): support transient keyword #9088

Open
2 tasks done
adhusson opened this issue Oct 10, 2024 · 2 comments
Open
2 tasks done

feat(fmt): support transient keyword #9088

adhusson opened this issue Oct 10, 2024 · 2 comments
Labels
Cmd-forge-fmt Command: forge fmt T-blocked Type: blocked T-feature Type: feature

Comments

@adhusson
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (f79c53c 2024-10-10T00:25:05.432733000Z)

What command(s) is the bug in?

forge fmt

Operating System

macOS (Apple Silicon)

Describe the bug

When the new transient keyword is used, forge fmt fails. For instance if transient is added to the number state variable of the initial Counter contract:

Error:
Failed to parse Solidity code for src/Counter.sol. Leaving source unchanged.

Context:
- failed to parse file:
Error: ParserError
   ╭─[:5:30]
   │
 5 │     uint256 public transient number;
   │                              ───┬──
   │                                 ╰──── unrecognised token 'number', expected ";", "="
───╯
@adhusson adhusson added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Oct 10, 2024
@adhusson adhusson changed the title Support the transient keyword in fmt No support for the transient keyword in fmt Oct 10, 2024
@yash-atreya yash-atreya added Cmd-forge-fmt Command: forge fmt and removed T-needs-triage Type: this issue needs to be labelled labels Oct 10, 2024
@zerosnacks
Copy link
Member

Hi @adhusson thanks for flagging

For future reference: https://soliditylang.org/blog/2024/10/09/solidity-0.8.28-release-announcement/ this was introduced in 0.8.28

To fix this we'll need an update to Solang: https://crates.io/crates/solang-parser

See: hyperledger-solang/solang#1670

@zerosnacks zerosnacks added the T-blocked Type: blocked label Oct 11, 2024
@DaniPopes DaniPopes added T-feature Type: feature and removed T-bug Type: bug labels Oct 16, 2024
@DaniPopes DaniPopes changed the title No support for the transient keyword in fmt feat(fmt): support transient keyword Oct 16, 2024
@zerosnacks
Copy link
Member

Update @adhusson: the Solang team is now aware and adding it should be straightforward, just looking for the time to add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmd-forge-fmt Command: forge fmt T-blocked Type: blocked T-feature Type: feature
Projects
Status: Todo
Development

No branches or pull requests

4 participants