alanrgan / rust-interpreter

0 stars 0 forks source link

Functions with duplicate parameter names #3

Closed alanrgan closed 7 years ago

alanrgan commented 7 years ago

Right now it is possible to write a function as follows: fn foo(a: int, a: int) { }

This behavior should be prevented at parse-time.

alanrgan commented 7 years ago

Current behavior is that the second argument overwrites the first:

fn foo(a: int, a: int) {
    print(a);
}

foo(3,4); // prints '4'