Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004350OCamlOCaml generalpublic2007-07-26 18:252007-10-29 05:41
Reporterjm 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.10+dev 
Target VersionFixed in Version3.10+dev 
Summary0004350: Polymorphism failure on polymorphic variants inside a record through a local and open function.
Description$ocamlc -v
The Objective Caml compiler, version 3.10.1+dev0 (2007-05-21)
...
$cat file.ml
module Ok =
  struct
type 'a t = [ `A of 'a | `B ]

let fuun = function `A _ -> () | _ -> ()

let ook (t: 'a t) =
        fuun t

let ok (t: 'a t) =
        (function `A _ -> () | `B -> ()) t

let ko (t: 'a t) =
        (function `A _ -> () | _ -> ()) t
  end

module Ko =
  struct
type 'a s = [ `A of 'a | `B ]
type 'a t = { s : 'a s }

let fuun = function `A _ -> () | _ -> ()

let ook (t: 'a t) =
        fuun t.s

let ok (t: 'a t) =
        (function `A _ -> () | `B -> ()) t.s

let ko (t: 'a t) =
        (function `A _ -> () | _ -> ()) t.s
  end

$ocamlc -c -i file.ml
module Ok :
  sig
    type 'a t = [ `A of 'a | `B ]
    val fuun : [> `A of 'a ] -> unit
    val ook : 'a t -> unit
    val ok : 'a t -> unit
    val ko : 'a t -> unit
  end
module Ko :
  sig
    type 'a s = [ `A of 'a | `B ]
    type 'a t = { s : 'a s; }
    val fuun : [> `A of 'a ] -> unit
    val ook : 'a t -> unit
    val ok : 'a t -> unit
    val ko : '_a t -> unit
  end

To my mind, Ko.ko should have the signature: 'a t -> unit,
as it has with ocamlc 3.09.2 for instance.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004216)
garrigue (manager)
2007-10-29 05:41

Delayed checks were changing type levels...
Fixed in branch release310 (typing/typecore.ml)

- Issue History
Date Modified Username Field Change
2007-07-26 18:25 jm New Issue
2007-10-29 05:41 garrigue Status new => closed
2007-10-29 05:41 garrigue Note Added: 0004216
2007-10-29 05:41 garrigue Resolution open => fixed
2007-10-29 05:41 garrigue Fixed in Version => 3.10+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker