-
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.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module A : | ||
sig type ('foo, 'bar) t val get_foo : ('foo, 'a) t -> 'foo option end | ||
- : ('foo, 'a) A.t -> 'foo option = <fun> | ||
val _bar : ('a, 'b) A.t -> 'a option = <fun> | ||
|
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,27 @@ | ||
(* TEST | ||
* toplevel | ||
* toplevel.opt | ||
*) | ||
|
||
module A : sig | ||
type ('foo, 'bar) t | ||
|
||
val get_foo : ('foo, _) t -> 'foo option | ||
end = struct | ||
type ('foo, 'bar) t = | ||
| Foo of 'foo | ||
| Bar of 'bar | ||
|
||
let get_foo = function | ||
| Foo foo -> Some foo | ||
| Bar _ -> None | ||
end | ||
;; | ||
|
||
(* Type variables should be 'foo and 'a (name persists) *) | ||
A.get_foo | ||
;; | ||
|
||
(* Type variables be 'a and 'b (original names lost in let-binding) *) | ||
let _bar = A.get_foo | ||
;; |