Skip to content

Bug: forge flatten does not account for as keyword in imports #1440

@transmissions11

Description

@transmissions11

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

latest

What command(s) is the bug in?

forge flatten

Operating System

macOS (M1)

Describe the bug

the as keyword, used to remap imports like

import {FixedPointMath as Math} from "..."

Math.mul()

is ignored by forge flatten, which just indiscriminately pastes FixedPointMath in and fails to rename/alias it to Math

this results in the output of forge flatten failing to compile because the compiler does not know what Math is if FixedPointMath is not alias'd/renamed, while the input could be a perfectly valid contract like above

Metadata

Metadata

Assignees

No one assigned

    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