Strip off TY_mutables and TY_constraineds when unboxing values during autoderef

This commit is contained in:
Patrick Walton 2010-07-19 19:12:02 -07:00
parent ae515c017c
commit b0f77088fa

View File

@ -55,6 +55,7 @@ let check_stmt (cx:Semant.ctxt) : (fn_ctx -> Ast.stmt -> unit) =
let rec unbox ty acc =
match ty with
Ast.TY_box ty' -> unbox ty' (acc + 1)
| Ast.TY_mutable ty' | Ast.TY_constrained (ty', _) -> unbox ty' acc
| _ -> (ty, acc)
in
unbox ty 0