Skip to content

Commit 4499ebe

Browse files
committed
Add a test that tests typestate checking inside of fn exprs.
1 parent b732ec6 commit 4499ebe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// error-pattern:Unsatisfied precondition
2+
// xfail-stage0
3+
4+
fn main() {
5+
// Typestate should work even in a lambda. we should reject this program.
6+
auto f = fn () -> int {
7+
let int i;
8+
ret i;
9+
};
10+
log_err f();
11+
}

0 commit comments

Comments
 (0)