Skip to content

bug(doc): forge doc does not support overloaded functions in interfaces properly #11823

@KirienzoEth

Description

@KirienzoEth

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

1.3.5-stable

What version of Foundryup are you on?

1.3.0

What command(s) is the bug in?

forge doc --serve

Operating System

Windows

Describe the bug

forge doc does not support overloaded functions in interfaces properly.
The doc generated for the interface is correct, but the doc for the contract uses the NatSpecs of the first function it finds with the same name in the interface.

Interface:

Image

Contract:

Image

I published an example repo here: https://github.com/KirienzoEth/foundry-forge-doc-overloaded-functions-interface-issue

I suspect it's because the name of the function is used instead of its signature when merging the comments:
https://github.com/foundry-rs/foundry/blob/v1.3.6/crates/doc/src/writer/as_doc.rs#L304

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions