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

polymorphic variants type printer bug #2605

Closed
vicuna opened this issue Nov 2, 2000 · 2 comments
Closed

polymorphic variants type printer bug #2605

vicuna opened this issue Nov 2, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 2, 2000

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

@vicuna
Copy link
Author

vicuna commented Nov 6, 2000

Comment author: administrator

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.

Jacques Garrigue

@vicuna
Copy link
Author

vicuna commented Nov 6, 2000

Comment author: administrator

corrected by Jacques in 3.00+19, on 2000-11-06.

@vicuna vicuna closed this as completed Nov 6, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant