diff options
Diffstat (limited to 'testsuite/tests/typing-modules/generative.ml')
-rw-r--r-- | testsuite/tests/typing-modules/generative.ml | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/testsuite/tests/typing-modules/generative.ml b/testsuite/tests/typing-modules/generative.ml index 9bc795163a..547f955348 100644 --- a/testsuite/tests/typing-modules/generative.ml +++ b/testsuite/tests/typing-modules/generative.ml @@ -42,10 +42,17 @@ module H : functor () -> S (* Alias *) module U = struct end;; -module M = F(struct end);; (* ok *) +module M1 = F();; (* ok *) +module M2 = F(struct end);; (* accepted with a warning *) [%%expect{| module U : sig end -module M : S +module M1 : S +Line 3, characters 14-24: +3 | module M2 = F(struct end);; (* accepted with a warning *) + ^^^^^^^^^^ +Warning 73 [generative-application-expects-unit]: A generative functor +should be applied to '()'; using '(struct end)' is deprecated. +module M2 : S |}];; module M = F(U);; (* fail *) [%%expect{| @@ -98,3 +105,12 @@ module Y : functor (X : sig end) (Y : sig end) (Z : sig end) -> sig end module Z : sig end -> sig end -> sig end -> sig end module GZ : functor (X : sig end) () (Z : sig end) -> sig end |}];; + +(* disabling warning 73 in the argument *) +module F5 () = struct end;; +module No_warn = F5 (struct end [@warning "-73"]) + +[%%expect{| +module F5 : functor () -> sig end +module No_warn : sig end +|}] |