Skip to content

forge flatten with renamed interface import does not compile #3265

@chad-js

Description

@chad-js

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 (084ef3d 2022-09-19T00:04:35.98318Z)

What command(s) is the bug in?

forge flatten

Operating System

macOS (Apple Silicon)

Describe the bug

If I have a contract using a named import of an interface, such as

import { IERC20 as MyIERC20 } from "src/interfaces/IERC20.sol";

forge flatten on that file results in output that includes the IERC20 interface, and the contract using the named import. Since the contract uses the named import MyIERC20, and the flattened file includes interface IERC20 but not interface MyIERC20, forge build fails with DeclarationError: Identifier not found or not unique.

This seems related to #1440

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions