Skip to content

Instantly share code, notes, and snippets.

@catamorphism
Created March 28, 2012 23:35
Show Gist options
  • Save catamorphism/2231533 to your computer and use it in GitHub Desktop.
Save catamorphism/2231533 to your computer and use it in GitHub Desktop.
Strange type error message
fn foo(a: int, b: int, c: int, d:int) {
fail;
}
fn main() {
foo(1, 2, 3);
}
@catamorphism
Copy link
Author

src/test/compile-fail/not-enough-arguments.rs:6:2: 6:14 error: this function takes 4 parameters but 3 parameters were supplied
src/test/compile-fail/not-enough-arguments.rs:6 foo(1, 2, 3);
^~~~~~~~~~~~
src/test/compile-fail/not-enough-arguments.rs:6:6: 6:7 error: mismatched types: expected _|_ but found int (types differ)
src/test/compile-fail/not-enough-arguments.rs:6 foo(1, 2, 3);
^
src/test/compile-fail/not-enough-arguments.rs:6:9: 6:10 error: mismatched types: expected _|_ but found int (types differ)
src/test/compile-fail/not-enough-arguments.rs:6 foo(1, 2, 3);
^
src/test/compile-fail/not-enough-arguments.rs:6:12: 6:13 error: mismatched types: expected _|_ but found int (types differ)
src/test/compile-fail/not-enough-arguments.rs:6 foo(1, 2, 3);
^
error: aborting due to previous errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment