blob: 0d04c21484cbef4bbee3260272cffe89dcf016bc [file] [log] [blame]
//! Test that we get the expected type mismatch error instead of "closure is expected to take 0
//! arguments" (which got introduced after implementing resume arguments).
#![feature(coroutines, coroutine_trait)]
use std::ops::Coroutine;
fn f<G: Coroutine>(_: G, _: G::Return) {}
fn main() {
f(
|a: u8| {
if false {
yield ();
} else {
a
//~^ error: `if` and `else` have incompatible types
}
},
0u8,
);
}