Add a test that tests typestate checking inside of fn exprs.

This commit is contained in:
Michael Sullivan 2011-06-24 15:36:17 -07:00
parent b732ec6f82
commit 4499ebe858

View File

@ -0,0 +1,11 @@
// error-pattern:Unsatisfied precondition
// xfail-stage0
fn main() {
// Typestate should work even in a lambda. we should reject this program.
auto f = fn () -> int {
let int i;
ret i;
};
log_err f();
}