Consider unop deref as an lval. Un-XFAIL vec-push.

This commit is contained in:
Graydon Hoare 2011-04-28 16:37:18 -07:00
parent f2fe26a821
commit e300b8047f
2 changed files with 2 additions and 3 deletions

View File

@ -1958,6 +1958,7 @@ fn is_lval(@ast.expr expr) -> bool {
case (ast.expr_field(_,_,_)) { ret true; }
case (ast.expr_index(_,_,_)) { ret true; }
case (ast.expr_path(_,_,_)) { ret true; }
case (ast.expr_unary(ast.deref,_,_)) { ret true; }
case (_) { ret false; }
}
}

View File

@ -1,11 +1,9 @@
// xfail-stage0
fn push[T](&mutable vec[mutable? T] v, &T t) {
v += vec(t);
}
fn main() {
auto v = @vec(1, 2, 3);
push(*v, 1);
push[int](*v, 1);
}