File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
testsuite/tests/typing-modules Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -340,3 +340,14 @@ module Remove_aliases :
340
340
end
341
341
end
342
342
| }]
343
+
344
+ module Recursive = struct
345
+ module rec M : sig end with N = N
346
+ and N : sig end = struct end
347
+ end
348
+ [%% expect{|
349
+ Line 2 , characters 30-31 :
350
+ 2 | module rec M : sig end with N = N
351
+ ^
352
+ Error : Illegal recursive module reference
353
+ | }]
Original file line number Diff line number Diff line change @@ -911,8 +911,10 @@ and approx_modtype_jane_syntax env = function
911
911
| Jane_syntax.Module_type. Jmty_strengthen { mty = smty ; mod_id } ->
912
912
let mty = approx_modtype env smty in
913
913
let path =
914
+ (* CR-someday: potentially improve error message for strengthening with
915
+ a mutually recursive module. *)
914
916
Env. lookup_module_path ~use: false ~load: false
915
- ~loc: smty.pmty_loc mod_id.txt env
917
+ ~loc: mod_id.loc mod_id.txt env
916
918
in
917
919
let aliasable = (not (Env. is_functor_arg path env)) in
918
920
Mty_strengthen (mty, path, Aliasability. aliasable aliasable)
You can’t perform that action at this time.
0 commit comments