Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a check for values in with type constraints #2338

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test
  • Loading branch information
goldfirere committed Mar 6, 2024
commit 294387a282ca8604fb686fb9d62827fb31922371
23 changes: 23 additions & 0 deletions ocaml/testsuite/tests/typing-layouts/modules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -716,3 +716,26 @@ Error: Function arguments and returns must be representable.
it's the type of a function argument.
|}]

(***********************************)
(* Test 11: [any] in package types *)

module type S = sig
type t : any
end

module C : S = struct
type t = float
end

let x = (module C : S with type t = 'a)

(* This should be accepted *)
[%%expect{|
module type S = sig type t : any end
module C : S
Line 9, characters 16-17:
9 | let x = (module C : S with type t = 'a)
^
Error: The type t in this module cannot be exported.
Its type contains local dependencies: C.t
|}]