Skip to content

dynamic-test-linking "Identifier already declared" #10312

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

Closed
2 tasks done
frontier159 opened this issue Apr 15, 2025 · 1 comment · Fixed by #10313
Closed
2 tasks done

dynamic-test-linking "Identifier already declared" #10312

frontier159 opened this issue Apr 15, 2025 · 1 comment · Fixed by #10313
Labels
C-forge Command: forge T-bug Type: bug

Comments

@frontier159
Copy link
Contributor

frontier159 commented Apr 15, 2025

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.1.0-rc

What version of Foundryup are you on?

foundryup: 1.0.1

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

while trying to build with
forge build --dynamic-test-linking

Error (9097): Identifier already declared.
  --> contracts/.../MyContract.sol:62:5:
   |
62 |     struct ConstructorArgs {
   |     ^ (Relevant source part starts here and spans across multiple lines).
Note: The previous declaration is here:
 --> foundry-pp/DeployHelper231.sol:7:5:
  |
7 |     struct ConstructorArgs {
  |     ^ (Relevant source part starts here and spans across multiple lines).
  • forge clean doesn't fix.
  • It builds fine without this new flag
  • forge build --dynamic-test-linking --skip test worked - so could be related

Unfortunately this was in a large private repo and I couldn't repro with a smaller example

@grandizzy not sure if there's some other log data I can gather which could help

@frontier159 frontier159 added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Apr 15, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Apr 15, 2025
@grandizzy
Copy link
Collaborator

@frontier159 thank you, yeah, looks like an edge case, can you scan your code base and see if you have any struct named ConstructorArgs declared? Thanks!

@grandizzy grandizzy added C-forge Command: forge and removed T-needs-triage Type: this issue needs to be labelled labels Apr 16, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-bug Type: bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants