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: 217 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Vanicat Rémi
Version: ocaml 3.00 and 3.00+18
OS: linux
Submission from: apu.u-bordeaux.fr (147.210.245.1)
this seems very, very strange to me :
let toto = (A : [A]);;
val toto : [ A] = A
let f = function
| A as arg -> arg | B as arg -> arg
| _ -> B;; val f : [> A | B] -> [> A | `B] =
f toto;;
: _[> A | B] = `A
let (f2 : [> A | B] -> [> A | B]) = function
| A as arg -> arg | B as arg -> arg
| _ -> B;; val f2 : [> A | B] -> [> A | `B] =
f2 toto;;
This expression has type [ A] but is here used with type [> A | `B]
as the toplevel tell me that f and f2 have the same type, i would suposed
they accept the same argument, but it is not the case, so i supose their
is a bug in the polymorphic variants type printer
The text was updated successfully, but these errors were encountered:
Indeed, this is a bug.
Not exactly in the printer: some types are created internally that should not
exist, and the printer could not print them correctly.
Since around 3.00+10, typing of variants has become stricter, and the
printed types are actually the expected ones. The bug is now fixed (3.00+19),
so that their internal representation corresponds to what is printed.
Original bug ID: 217
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Vanicat Rémi
Version: ocaml 3.00 and 3.00+18
OS: linux
Submission from: apu.u-bordeaux.fr (147.210.245.1)
this seems very, very strange to me :
let toto = (
A : [
A]);;val toto : [
A] =
Alet f = function
|
A as arg -> arg |
B as arg -> arg| _ ->
B;; val f : [>
A |B] -> [>
A | `B] =f toto;;
A |
B] = `Alet (f2 : [>
A |
B] -> [>A |
B]) = function|
A as arg -> arg |
B as arg -> arg| _ ->
B;; val f2 : [>
A |B] -> [>
A | `B] =f2 toto;;
This expression has type [
A] but is here used with type [>
A | `B]as the toplevel tell me that f and f2 have the same type, i would suposed
they accept the same argument, but it is not the case, so i supose their
is a bug in the polymorphic variants type printer
The text was updated successfully, but these errors were encountered: