1
Fork 0

Fox the clauses that actually satisfy box and mutable constraints; in all the confusion I had got those wrong.

This commit is contained in:
Graydon Hoare 2010-07-01 18:39:58 -07:00
parent c27879a1aa
commit bb018b24f5

View file

@ -417,13 +417,11 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
| (TYSPEC_box a', TYSPEC_box b') -> | (TYSPEC_box a', TYSPEC_box b') ->
unify_tyvars ucx a' b'; !a unify_tyvars ucx a' b'; !a
| (TYSPEC_box a', | (TYSPEC_box tv,
TYSPEC_resolved (_, Ast.TY_box _)) -> TYSPEC_resolved (params, Ast.TY_box ty))
unify_tyvars ucx a' b; !b | (TYSPEC_resolved (params, Ast.TY_box ty),
TYSPEC_box tv) ->
| (TYSPEC_resolved (_, Ast.TY_box _), unify_ty_parametric ucx ty params tv; !a
TYSPEC_box b') ->
unify_tyvars ucx a b'; !a
| (_, TYSPEC_resolved (params, Ast.TY_box ty)) | (_, TYSPEC_resolved (params, Ast.TY_box ty))
when ucx.box_ok -> when ucx.box_ok ->
@ -446,13 +444,11 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
| (TYSPEC_mutable a', TYSPEC_mutable b') -> | (TYSPEC_mutable a', TYSPEC_mutable b') ->
unify_tyvars ucx a' b'; !a unify_tyvars ucx a' b'; !a
| (TYSPEC_mutable a', | (TYSPEC_mutable tv,
TYSPEC_resolved (_, Ast.TY_mutable _)) -> TYSPEC_resolved (params, Ast.TY_mutable ty))
unify_tyvars ucx a' b; !b | (TYSPEC_resolved (params, Ast.TY_mutable ty),
TYSPEC_mutable tv) ->
| (TYSPEC_resolved (_, Ast.TY_mutable _), unify_ty_parametric ucx ty params tv; !a
TYSPEC_mutable b') ->
unify_tyvars ucx a b'; !a
| (_, TYSPEC_resolved (params, Ast.TY_mutable ty)) | (_, TYSPEC_resolved (params, Ast.TY_mutable ty))
when ucx.mut_ok -> when ucx.mut_ok ->