Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] typer: apply use an injective unification (wip) (see below …

…for more info)

Arguments can have for all when the fun doesn't expect ones.
Here is an example of a typing problem it solves:
module MakeQ(X) {
 function f(int v) {

module M {
  function g(v){ v }

Q = MakeQ(M)

This fix uses the previous work to enable restricted coercion on module:
 | ((W_Algebra.SType_forall schm1), _)
         when is_under_coercion  -> (... specialize schm1...)

Todo: rename is_under_coercion by something more general.

Important: note that this patch switches unify_simple_type type arguments. In the unification the order is important.
  • Loading branch information...
commit 38bc18b051af5de5d48ea38fd57bad7b306b4a68 1 parent 4473302
@cedricss cedricss authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  compiler/libqmlcompil/typer_w/
2  compiler/libqmlcompil/typer_w/
@@ -642,7 +642,7 @@ let rec infer_expr_type ~bypass_typer typing_env original_expr =
arguments in negative part. *)
let tmp_arrow_type = W_CoreTypes.type_arrow args_tys ty_app_result in
W_TypeInfo.add_loc_object tmp_arrow_type.W_Algebra.sty_desc loc ;
- (try W_Unify.unify_simple_type typing_env fun_part_ty tmp_arrow_type
+ (try W_Unify.unify_simple_type_in_coercion typing_env tmp_arrow_type fun_part_ty
with W_Unify.Unification_simple_type_conflict (err_t1, err_t2, detail) ->
Please sign in to comment.
Something went wrong with that request. Please try again.