Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000217OCamlOCaml generalpublic2000-11-02 13:572000-11-06 10:50
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000217: polymorphic variants type printer bug
DescriptionFull_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] = <fun>
# 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] = <fun>
# 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


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000461)
administrator (administrator)
2000-11-06 10:49

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
(0000462)
administrator (administrator)
2000-11-06 10:50

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

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker