forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocaml#9385 from lpw25/fix-copy-scope-bugs
Fix incorrect copy_scopes in Subst (cherry picked from commit 288bb81) (cherry picked from commit 2e08e99)
- Loading branch information
Showing
2 changed files
with
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(* TEST | ||
* expect | ||
*) | ||
|
||
module M : sig | ||
type 'a t := [< `A ] as 'a | ||
val f : 'a -> 'a t | ||
end = struct | ||
let f x = x | ||
end;; | ||
[%%expect{| | ||
module M : sig val f : ([< `A ] as 'a) -> 'a end | ||
|}] | ||
|
||
type foo = { foo : 'a. ([< `A] as 'a) -> 'a } | ||
|
||
module Foo (X : sig type 'a t := [< `A ] as 'a type foo2 = foo = { foo : 'a. 'a t -> 'a t } end) = struct | ||
let f { X.foo } = foo | ||
end;; | ||
[%%expect{| | ||
type foo = { foo : 'a. ([< `A ] as 'a) -> 'a; } | ||
module Foo : | ||
functor | ||
(X : sig type foo2 = foo = { foo : 'a. ([< `A ] as 'a) -> 'a; } end) -> | ||
sig val f : X.foo2 -> ([< `A ] as 'a) -> 'a end | ||
|}] | ||
|
||
type bar = { bar : 'a. ([< `A] as 'a) -> 'a } | ||
|
||
module Bar (X : sig type 'a t := 'a type bar2 = bar = { bar : 'a. ([< `A] as 'a) t -> 'a t } end) = struct | ||
let f { X.bar } = bar | ||
end;; | ||
[%%expect{| | ||
type bar = { bar : 'a. ([< `A ] as 'a) -> 'a; } | ||
module Bar : | ||
functor | ||
(X : sig type bar2 = bar = { bar : 'a. ([< `A ] as 'a) -> 'a; } end) -> | ||
sig val f : X.bar2 -> ([< `A ] as 'a) -> 'a end | ||
|}] |
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