generalize_expansive: test that we treat missing types as abstract types
parent
35006b9d88
commit
b9312affa2
|
@ -0,0 +1 @@
|
|||
val foo : unit -> 'a Foo.t
|
|
@ -0,0 +1 @@
|
|||
let x = Bar.foo ()
|
|
@ -0,0 +1 @@
|
|||
type 'a t
|
|
@ -0,0 +1 @@
|
|||
test.ml
|
|
@ -0,0 +1 @@
|
|||
val x : '_weak1 Foo.t
|
|
@ -0,0 +1,15 @@
|
|||
(* TEST
|
||||
files = "foo.mli bar.mli baz.ml"
|
||||
* setup-ocamlc.byte-build-env
|
||||
** ocamlc.byte
|
||||
module = "foo.mli"
|
||||
*** ocamlc.byte
|
||||
module = "bar.mli"
|
||||
**** script
|
||||
script = "rm foo.cmi"
|
||||
***** ocamlc.byte
|
||||
flags = "-c -i"
|
||||
module = "baz.ml"
|
||||
ocamlc_byte_exit_status = "0"
|
||||
****** check-ocamlc.byte-output
|
||||
*)
|
|
@ -795,7 +795,10 @@ let rec generalize_expansive env var_level visited ty =
|
|||
Tconstr (path, tyl, abbrev) ->
|
||||
let variance =
|
||||
try (Env.find_type path env).type_variance
|
||||
with Not_found -> List.map (fun _ -> Variance.may_inv) tyl in
|
||||
with Not_found ->
|
||||
(* See testsuite/tests/typing-missing-cmi-2 for an example *)
|
||||
List.map (fun _ -> Variance.may_inv) tyl
|
||||
in
|
||||
abbrev := Mnil;
|
||||
List.iter2
|
||||
(fun v t ->
|
||||
|
|
Loading…
Reference in New Issue