Skip to content

Can declare two methods with the same name and different arguments #3099

Closed
@Emm

Description

@Emm
fn a(x: ~str) -> ~str {
    #fmt("First function with %s", x)
}

fn a(x: ~str, y: ~str) -> ~str {
    #fmt("Second function with %s and %s", x, y)
}

fn main() {
    #info("Result: ");
}

Compiles with a recent rust master (899400c) (but using a(x: ~str) does not compile)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions