Skip to content

Duplicate name definitions in interface even if function is overloaded #359

Description

@danilych
sol_interface! {
    interface IERC721 {
        function balanceOf(address owner) external view returns (uint256 balance);

        function ownerOf(uint256 tokenId) external view returns (address owner);

        function safeTransferFrom(address from, address to, uint256 tokenId) external;

        function transferFrom(address from, address to, uint256 tokenId) external;

        function approve(address to, uint256 tokenId) external;

        function getApproved(uint256 tokenId) external view returns (address operator);

        function setApprovalForAll(address operator, bool _approved) external;

        function isApprovedForAll(address owner, address operator) external view returns (bool);

        function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
    }
}
cargo stylus check
error[E0592]: duplicate definitions with name `safe_transfer_from`
  --> src/interfaces/erc721_interface.rs:3:1
   |
3  | / sol_interface! {
4  | |     interface IERC721 {
5  | |         function balanceOf(address owner) external view returns (uint256 balance);
...  |
23 | | }
   | | ^
   | | |
   | |_duplicate definitions for `safe_transfer_from`
   |   other definition for `safe_transfer_from`
   |
   = note: this error originates in the macro `sol_interface` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions