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

Forge Flatten creates duplicate declarations (unable to compile) #6022

Closed
2 tasks done
daweth opened this issue Oct 11, 2023 · 2 comments · Fixed by #6936
Closed
2 tasks done

Forge Flatten creates duplicate declarations (unable to compile) #6022

daweth opened this issue Oct 11, 2023 · 2 comments · Fixed by #6936
Labels
A-compiler Area: compiler C-forge Command: forge Cmd-forge-build Command: forge build T-bug Type: bug

Comments

@daweth
Copy link

daweth commented Oct 11, 2023

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 (95a93cd 2023-08-25T00:32:44.694202000Z)

What command(s) is the bug in?

forge flatten

Operating System

macOS (Apple Silicon)

Describe the bug

To repro:

https://github.com/balancer/balancer-v2-monorepo/blob/master/pkg/vault/contracts/Vault.sol
Clone the repo and call forge flatten Vault.sol > VaultFlattened.sol

Try to compile VaultFlattened.sol in a blank forge repo

Screen Shot 2023-10-10 at 5 22 40 PM
@daweth daweth added the T-bug Type: bug label Oct 11, 2023
@mds1 mds1 added C-forge Command: forge Cmd-forge-build Command: forge build A-compiler Area: compiler labels Oct 18, 2023
@SidestreamColdMelon
Copy link

Hey @mds1, thanks for collecting those issues in one place!

As investigated in #4034 (comment), the flattening is actually implemented in the dependency from the same author called ethers-rs. The issue in that repo which contains description of the problem: gakonst/ethers-rs#2588.

For anyone wanting to contribute, you can start by extending "Reproducible example" provided in that issue with other use-cases and making it into a PR with a failing test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiler Area: compiler C-forge Command: forge Cmd-forge-build Command: forge build T-bug Type: bug
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants