summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-modules/functors.ml
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typing-modules/functors.ml')
-rw-r--r--testsuite/tests/typing-modules/functors.ml44
1 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/typing-modules/functors.ml b/testsuite/tests/typing-modules/functors.ml
index 932bc9f9fc..3fa34a1d89 100644
--- a/testsuite/tests/typing-modules/functors.ml
+++ b/testsuite/tests/typing-modules/functors.ml
@@ -1701,3 +1701,47 @@ Error: The functor application Bar(A)(FiveArgsExt)(TY)(TY)(TY)(TY)(TY) is ill-ty
8. Module TY matches the expected module type ty
9. Module TY matches the expected module type ty
|}]
+
+module Shape_arg = struct
+ module M1 (Arg1 : sig end) = struct
+ module type S1 = sig
+ type t
+ end
+ end
+
+ module type S2 = sig
+ module Make (Arg2 : sig end) : M1(Arg2).S1
+ end
+
+ module M2 : S2 = struct
+ module Make (Arg3 : sig end) = struct
+ type t = T
+ end
+ end
+
+ module M3 (Arg4 : sig end) = struct
+ module type S3 = sig
+ type t = M2.Make(Arg4).t
+ end
+ end
+
+ module M4 (Arg5 : sig end) : M3(Arg5).S3 = struct
+ module M5 = M2.Make (Arg5)
+
+ type t = M5.t
+ end
+end
+[%%expect{|
+module Shape_arg :
+ sig
+ module M1 :
+ functor (Arg1 : sig end) -> sig module type S1 = sig type t end end
+ module type S2 =
+ sig module Make : functor (Arg2 : sig end) -> M1(Arg2).S1 end
+ module M2 : S2
+ module M3 :
+ functor (Arg4 : sig end) ->
+ sig module type S3 = sig type t = M2.Make(Arg4).t end end
+ module M4 : functor (Arg5 : sig end) -> M3(Arg5).S3
+ end
+|}]