Skip to content

Duplicate function parameters are accepted #387

Description

@LesterEvSe

Project version

master (released)

Project

ast

What happened?

A function may declare the same parameter name twice. Nothing is reported, and the second declaration silently shadows the first.

Minimal reproduction steps

This compiles, but should not:

fn foo(x: u32, x: u32) -> u32 {
    x
}

fn main() {
    let x: u32 = foo(1, 2);
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions