-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10693 from lpw25/fix-includemod-ident-collision
Fix ident collision in includemod
- Loading branch information
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
testsuite/tests/typing-modules-bugs/pr10693_bad.compilers.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
File "pr10693_bad.ml", line 27, characters 26-27: | ||
27 | module Bad (A : S') : S = A | ||
^ | ||
Error: Signature mismatch: | ||
Modules do not match: | ||
sig val x : 'a option module M : Dep -> S end | ||
is not included in | ||
S | ||
In module M: | ||
Modules do not match: | ||
Dep -> S | ||
is not included in | ||
functor (X : Dep) -> | ||
sig | ||
val x : X.t option | ||
module M : functor (Y : Dep) -> sig val x : X.t option end | ||
end | ||
In module M: | ||
Modules do not match: | ||
S | ||
is not included in | ||
sig | ||
val x : X.t option | ||
module M : functor (Y : Dep) -> sig val x : X.t option end | ||
end | ||
In module M.M: | ||
Modules do not match: | ||
functor (X : Dep) -> | ||
sig | ||
val x : X.t option | ||
module M : functor (Y : Dep) -> sig val x : X.t option end | ||
end | ||
is not included in | ||
functor (Y : Dep) -> sig val x : X.t option end | ||
In module M.M: | ||
Modules do not match: | ||
sig | ||
val x : X/2.t option | ||
module M : functor (Y : Dep) -> sig val x : X/2.t option end | ||
end | ||
is not included in | ||
sig val x : X.t option end | ||
In module M.M: | ||
Values do not match: | ||
val x : X/1.t option | ||
is not included in | ||
val x : X/2.t option | ||
The type X/1.t option is not compatible with the type X/2.t option | ||
Type X/1.t is not compatible with type X/2.t | ||
File "_none_", line 1: | ||
Definition of module X/1 | ||
File "_none_", line 1: | ||
Definition of module X/2 | ||
File "pr10693_bad.ml", line 17, characters 6-24: Expected declaration | ||
File "pr10693_bad.ml", line 15, characters 4-22: Actual declaration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
(* TEST | ||
flags = "-no-app-funct" | ||
ocamlc_byte_exit_status = "2" | ||
* setup-ocamlc.byte-build-env | ||
** ocamlc.byte | ||
*** check-ocamlc.byte-output | ||
*) | ||
module type Dep = sig type t val x : t end | ||
module String = struct type t = string let x = "Forty Two" end | ||
module Int = struct type t = int let x = 42 end | ||
|
||
module type S = sig | ||
val x : 'a option | ||
module M : functor (X : Dep) -> sig | ||
val x : X.t option | ||
module M : functor (Y : Dep) -> sig | ||
val x : X.t option | ||
end | ||
end | ||
end | ||
|
||
module type S' = sig | ||
val x : 'a option | ||
module M : functor (_ : Dep) -> S | ||
end | ||
|
||
module Bad (A : S') : S = A | ||
|
||
module M = struct | ||
let x = None | ||
module M (_ : Dep) = struct | ||
let x = None | ||
module M (X : Dep) = struct | ||
let x = Some X.x | ||
module M (Y : Dep) = struct | ||
let x = Some X.x | ||
end | ||
end | ||
end | ||
end | ||
|
||
module N = Bad(M) | ||
module N' = N.M(String) | ||
module N'' = N'.M(Int) | ||
|
||
let () = print_endline (Option.get N''.x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters