-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Interaction between GADTs and polymorphic variants #5724
Copy link
Copy link
Closed
Labels
Description
Original bug ID: 5724
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:42Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.00.0
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Child of: #5998
Bug description
OCaml reports an error for the last line of the following program:
type _ t =
| A : int t
| B : [`C] -> bool t
let isA (type a) (r : a t) = match r with
| A -> true
| B `C -> false
^^^^
Error: This pattern matches values of type bool t
but a pattern was expected which matches values of type int t
If the `C in the pattern is replaced with an underscore, the program is accepted.
Reactions are currently unavailable