File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ OCaml 4.14 maintenance branch
17
17
18
18
### Bug fixes:
19
19
20
+ - #10768, #11340: Fix typechecking regression when combining first class
21
+ modules and GADTs.
22
+ (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)
23
+
20
24
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
21
25
calling virtual methods introduced by constraining the self type from within
22
26
the class definition.
Original file line number Diff line number Diff line change @@ -2048,8 +2048,11 @@ and package_constraints env loc mty constrs =
2048
2048
end
2049
2049
2050
2050
let modtype_of_package env loc p fl =
2051
- package_constraints env loc (Mty_ident p)
2052
- (List. map (fun (n , t ) -> (Longident. flatten n, t)) fl)
2051
+ let mty =
2052
+ package_constraints env loc (Mty_ident p)
2053
+ (List. map (fun (n , t ) -> (Longident. flatten n, t)) fl)
2054
+ in
2055
+ Subst. modtype Keep Subst. identity mty
2053
2056
2054
2057
let package_subtype env p1 fl1 p2 fl2 =
2055
2058
let mkmty p fl =
@@ -2069,9 +2072,11 @@ let () = Ctype.package_subtype := package_subtype
2069
2072
2070
2073
let wrap_constraint env mark arg mty explicit =
2071
2074
let mark = if mark then Includemod. Mark_both else Includemod. Mark_neither in
2075
+ let mty1 = Subst. modtype Keep Subst. identity arg.mod_type in
2076
+ let mty2 = Subst. modtype Keep Subst. identity mty in
2072
2077
let coercion =
2073
2078
try
2074
- Includemod. modtypes ~loc: arg.mod_loc env ~mark arg.mod_type mty
2079
+ Includemod. modtypes ~loc: arg.mod_loc env ~mark mty1 mty2
2075
2080
with Includemod. Error msg ->
2076
2081
raise(Error (arg.mod_loc, env, Not_included msg)) in
2077
2082
{ mod_desc = Tmod_constraint (arg, mty, explicit, coercion);
You can’t perform that action at this time.
0 commit comments