Skip to content

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

@frontier159

Description

@frontier159

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions