You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7592 Reporter: lavi Assigned to:@garrigue Status: confirmed (set by @garrigue on 2017-08-02T04:17:38Z) Resolution: open Priority: normal Severity: feature Version: 4.05.0 Category: typing Child of:#5998
Bug description
This is not a bug as OCaml stay in the safe side, but behavior of GADT in presence of polymorphic variant is sometimes disturbing.
For example, the following is accepted:
type_ c1 = C1 : [> `A | `B ] c1type_ c2 = C2 : [> `A | `C ] c2letf : type a. a c1 -> a c2 -> a =fun C1 C2 -> `Alet x = f C1C2letg : type a. a c1 -> a c2 -> a =fun C1 C2 -> `Blet y = g C1C2
with the right type:
valy : [> `A | `B | `C ] =`B
However this does not work with `C:
let h : type a. a c1 -> a c2 -> a = fun C1 C2 -> `C;;
Error: This expression has type [> `C ]
but an expression was expected of type a
The second variant type does not allow tag(s) `C
The text was updated successfully, but these errors were encountered:
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 7592
Reporter: lavi
Assigned to: @garrigue
Status: confirmed (set by @garrigue on 2017-08-02T04:17:38Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.05.0
Category: typing
Child of: #5998
Bug description
This is not a bug as OCaml stay in the safe side, but behavior of GADT in presence of polymorphic variant is sometimes disturbing.
For example, the following is accepted:
with the right type:
However this does not work with `C:
The text was updated successfully, but these errors were encountered: