Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
17 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 |
---|---|---|
|
@@ -9,7 +9,11 @@ Error: This pattern matches values of type (int s, int s) eq | |
but a pattern was expected which matches values of type | ||
(int s, int t) eq | ||
Type int s is not compatible with type int t | ||
# module M : | ||
functor (S : sig type 'a t = T of 'a type 'a s = T of 'a end) -> | ||
sig val f : ($'a S.s, $'a S.t) eq -> unit end | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
garrigue
Author
Contributor
|
||
# Characters 120-124: | ||
struct let f : ('a S.s, 'a S.t) eq -> unit = function Refl -> () end;; | ||
^^^^ | ||
Error: This pattern matches values of type ($'a S.s, $'a S.s) eq | ||
but a pattern was expected which matches values of type | ||
($'a S.s, $'a S.t) eq | ||
The type constructor $'a would escape its scope | ||
# |
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,10 @@ | ||
type +'a n = private int | ||
type nil = private Nil_type | ||
type (_,_) elt = | ||
| Elt_fine: 'nat n -> ('l,'nat * 'l) elt | ||
| Elt: 'nat n -> ('l,'nat -> 'l) elt | ||
type _ t = Nil : nil t | Cons : ('x, 'fx) elt * 'x t -> 'fx t;; | ||
|
||
let undetected: ('a -> 'b -> nil) t -> 'a n -> 'b n -> unit = fun sh i j -> | ||
let Cons(Elt dim, _) = sh in () | ||
;; |
15 changes: 15 additions & 0 deletions
15
testsuite/tests/typing-gadts/pr7222.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,15 @@ | ||
|
||
# type +'a n = private int | ||
type nil = private Nil_type | ||
type (_, _) elt = | ||
Elt_fine : 'nat n -> ('l, 'nat * 'l) elt | ||
| Elt : 'nat n -> ('l, 'nat -> 'l) elt | ||
type _ t = Nil : nil t | Cons : ('x, 'fx) elt * 'x t -> 'fx t | ||
# Characters 83-99: | ||
let Cons(Elt dim, _) = sh in () | ||
^^^^^^^^^^^^^^^^ | ||
Error: This pattern matches values of type ('a -> $0 -> nil) t | ||
but a pattern was expected which matches values of type | ||
('a -> 'b -> nil) t | ||
The type constructor $0 would escape its scope | ||
# |
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,15 @@ | ||
|
||
# type +'a n = private int | ||
type nil = private Nil_type | ||
type (_, _) elt = | ||
Elt_fine : 'nat n -> ('l, 'nat * 'l) elt | ||
| Elt : 'nat n -> ('l, 'nat -> 'l) elt | ||
type _ t = Nil : nil t | Cons : ('x, 'fx) elt * 'x t -> 'fx t | ||
# Characters 88-95: | ||
let Cons(Elt dim, _) = sh in () | ||
^^^^^^^ | ||
Error: This pattern matches values of type ($Cons_'x, 'a -> $Cons_'x) elt | ||
but a pattern was expected which matches values of type | ||
($Cons_'x, 'a -> $'b -> nil) elt | ||
The type constructor $'b would escape its scope | ||
# |
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
I'm a bit confused by this part of the diff. It looks like the previous testsuite reference was wrong, as the code given was unsound, and it is now correctly failing. Is that correct? Did you mention the fact that this was not working correctly in PR#6158, is this what you referred to as the "minor side problem"?