Fix fold bug on expr_unary.
This commit is contained in:
parent
df5f8f3e37
commit
cdcab742a7
@ -404,7 +404,7 @@ fn fold_expr[ENV](&ENV env, ast_fold[ENV] fld, &@expr e) -> @expr {
|
||||
|
||||
case (ast.expr_unary(?op, ?a, ?t)) {
|
||||
auto aa = fold_expr(env_, fld, a);
|
||||
ret fld.fold_expr_unary(env_, e.span, op, a, t);
|
||||
ret fld.fold_expr_unary(env_, e.span, op, aa, t);
|
||||
}
|
||||
|
||||
case (ast.expr_lit(?lit, ?t)) {
|
||||
|
@ -271,6 +271,7 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
|
||||
|
||||
case (ast.ty_path(?path, ?def)) {
|
||||
auto def_id;
|
||||
check (def != none[ast.def]);
|
||||
alt (option.get[ast.def](def)) {
|
||||
case (ast.def_ty(?id)) { def_id = id; }
|
||||
case (_) { fail; }
|
||||
@ -1247,6 +1248,7 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
|
||||
|
||||
case (ast.expr_name(?name, ?defopt, _)) {
|
||||
auto t = plain_ty(ty_nil);
|
||||
check (defopt != none[ast.def]);
|
||||
alt (option.get[ast.def](defopt)) {
|
||||
case (ast.def_arg(?id)) {
|
||||
check (fcx.locals.contains_key(id));
|
||||
|
Loading…
Reference in New Issue
Block a user