Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14305 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
- Loading branch information
Jacques Garrigue
committed
Nov 19, 2013
1 parent
7c98525
commit 9b974c1
Showing
5 changed files
with
56 additions
and
5 deletions.
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
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,16 @@ | ||
type (_, _) t = | ||
A : ('a, 'a) t | ||
| B : string -> ('a, 'b) t | ||
;; | ||
|
||
module M (A : sig module type T end) (B : sig module type T end) = | ||
struct | ||
let f : ((module A.T), (module B.T)) t -> string = function | ||
| B s -> s | ||
end;; | ||
|
||
module A = struct module type T = sig end end;; | ||
|
||
module N = M(A)(A);; | ||
|
||
let x = N.f A;; |
16 changes: 16 additions & 0 deletions
16
testsuite/tests/typing-gadts/pr6241.ml.principal.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,16 @@ | ||
|
||
# type (_, _) t = A : ('a, 'a) t | B : string -> ('a, 'b) t | ||
# Characters 127-149: | ||
....................................................function | ||
| B s -> s | ||
Warning 8: this pattern-matching is not exhaustive. | ||
Here is an example of a value that is not matched: | ||
A | ||
module M : | ||
functor (A : sig module type T end) -> | ||
functor (B : sig module type T end) -> | ||
sig val f : ((module A.T), (module B.T)) t -> string end | ||
# module A : sig module type T = sig end end | ||
# module N : sig val f : ((module A.T), (module A.T)) t -> string end | ||
# Exception: Match_failure ("//toplevel//", 7, 52). | ||
# |
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,16 @@ | ||
|
||
# type (_, _) t = A : ('a, 'a) t | B : string -> ('a, 'b) t | ||
# Characters 127-149: | ||
....................................................function | ||
| B s -> s | ||
Warning 8: this pattern-matching is not exhaustive. | ||
Here is an example of a value that is not matched: | ||
A | ||
module M : | ||
functor (A : sig module type T end) -> | ||
functor (B : sig module type T end) -> | ||
sig val f : ((module A.T), (module B.T)) t -> string end | ||
# module A : sig module type T = sig end end | ||
# module N : sig val f : ((module A.T), (module A.T)) t -> string end | ||
# Exception: Match_failure ("//toplevel//", 7, 52). | ||
# |
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