Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006124OCamlOCaml typingpublic2013-08-06 18:042014-05-25 20:20
Reporterlpw25 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.01.0+dev 
Target Version4.02.0+devFixed in Version 
Summary0006124: Odd behaviour of type expressions in polymorphic variant tag specifications
DescriptionI'm sure Jacques is already aware of this behaviour, but I find the following behaviour a bit odd, and at the very least the error message could be improved:

  # let f : ([`A | `B ] as 'a) -> [> 'a ] -> unit = fun x y -> ();;
  val f : [ `A | `B ] -> [> `A | `B ] -> unit = <fun>

  # let f : ([`A | `B ] as 'a) -> [> 'a] -> unit = fun x (y : [> 'a]) -> ();;
  Characters 61-63:
    let f : ([`A | `B ] as 'a) -> [> 'a] -> unit = fun x (y : [> 'a]) -> ();;
                                                                 ^^
  Error: The type 'a is not a polymorphic variant type

  # let f (x : [`A | `B] as 'a) (y : [> 'a]) = ();;
  Characters 36-38:
    let f (x : [`A | `B] as 'a) (y : [> 'a]) = ();;
                                      ^^
  Error: The type 'a is not a polymorphic variant type
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-08-06 18:04 lpw25 New Issue
2013-08-06 18:45 gasche Note Added: 0010134
2013-08-06 19:31 gasche Note Deleted: 0010134
2013-08-19 19:10 doligez Status new => acknowledged
2013-08-19 19:10 doligez Target Version => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker