c2bb2f0837
If the expected type is none (due to a type error), we shouldn't fail with an ICE, but rather, just print out another type error. Changed the do-expr type error message to make sense in this context (see the test case for how it works). Closes #3044.
10 lines
369 B
Rust
10 lines
369 B
Rust
// error-pattern: Non-function passed to a `do` function as its last argument, or wrong number of arguments passed to a `do` function
|
|
fn main() {
|
|
let needlesArr: ~[char] = ~['a', 'f'];
|
|
do vec::foldr(needlesArr) |x, y| {
|
|
}
|
|
// for some reason if I use the new error syntax for the two error messages this generates,
|
|
// the test runner gets confused -- tjc
|
|
}
|
|
|