Skip to content

Commit

Permalink
Add test of princiaplity from polymorphic type constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
lpw25 committed Dec 16, 2022
1 parent 82c7afe commit 4b68bb3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions testsuite/tests/typing-poly/pr11544.ml
@@ -0,0 +1,18 @@
(* TEST
* expect
*)

module M = struct type t = T end
let poly3 : 'b. M.t -> 'b -> 'b =
fun T x -> x
[%%expect {|
module M : sig type t = T end
val poly3 : M.t -> 'b -> 'b = <fun>
|}, Principal{|
module M : sig type t = T end
Line 3, characters 6-7:
3 | fun T x -> x
^
Warning 18 [not-principal]: this type-based constructor disambiguation is not principal.
val poly3 : M.t -> 'b -> 'b = <fun>
|}];;

0 comments on commit 4b68bb3

Please sign in to comment.