rust/src/test/compile-fail/shadow.rs
Tim Chevalier 4f792f2dbb Track spans for each local variable in typestate
This lets us print better messages in situations with name
shadowing.
2011-05-26 18:14:32 -07:00

26 lines
349 B
Rust

// -*- rust -*-
// error-pattern: a \[./src/test/compile-fail/shadow.rs:11:8:11:20
fn foo(vec[int] c) {
let int a = 5;
let vec[int] b = [];
alt (none[int]) {
case (some[int](_)) {
for (int i in c) {
log a;
auto a = 17;
b += [a];
}
}
}
}
tag t[T] {
none;
some(T);
}
fn main() {
foo([]);
}