Skip to content

Commit

Permalink
Change typestate to use visit instead of walk
Browse files Browse the repository at this point in the history
Typestate was failing to check some code because if it saw an item,
it would quit immediately. This was to avoid checking nested items
in the same context as the lexically enclosing item, but it was
having the wrong effect: not checking the code after the item at all.

Fixed by switching to visit and skipping over items in a proper
nested fashion. Closes #668.
  • Loading branch information
catamorphism committed Jul 12, 2011
1 parent 0e59493 commit 21b94d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/compile-fail/uninit-after-item.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// error-pattern:Unsatisfied precondition constraint (for example, init(bar
// xfail-stage0
fn main() {
auto bar;
fn baz(int x) { }
bind baz(bar);
}

0 comments on commit 21b94d5

Please sign in to comment.