Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005450OCamlOCaml generalpublic2011-12-23 17:162011-12-27 10:01
Reporterpilki 
Assigned Togarrigue 
PrioritynoneSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.13.0+dev 
Summary0005450: The name of types introduced by (type foo) are not used for the inferred type variables
DescriptionIf you write
<<<
let f (x:'foo) = x
>>>
the inferred type is
val f : 'foo -> 'foo

but if you write
<<<
let g (type bar) (x:bar) = x
>>>
you end up with
val g : 'a -> 'a
instead of
val g : 'bar -> 'bar
TagsNo tags attached.
Attached Files

- Relationships
child of 0005444closedgarrigue A parent "feature request" for a serie of FR about printing type variables 

-  Notes
(0006531)
garrigue (manager)
2011-12-24 02:39

As mentioned in PR#5445, this is a consequence of dropping variable names upon instantiation.
We probably need to do something in this case, as we clearly want to keep those explicit names, at least in the current function definition.
(0006541)
garrigue (manager)
2011-12-27 10:01

Fixed in revision 11958.

Note that this also solves the same problem for explicit polymorphism:

# let id : 't. 't -> 't = fun x -> x;;
val id : 't -> 't = <fun>
# let id : type foo. foo -> foo = fun x -> x;;
val id : 'foo -> 'foo = <fun>

Potential glitch (but not new):

# let magic : type t t'. t -> t' = Obj.magic;;
val magic : 't -> 't' = <fun>

- Issue History
Date Modified Username Field Change
2011-12-23 17:16 pilki New Issue
2011-12-23 17:26 protz Relationship added child of 0005444
2011-12-24 02:39 garrigue Note Added: 0006531
2011-12-24 02:39 garrigue Assigned To => garrigue
2011-12-24 02:39 garrigue Status new => acknowledged
2011-12-27 10:01 garrigue Note Added: 0006541
2011-12-27 10:01 garrigue Status acknowledged => closed
2011-12-27 10:01 garrigue Resolution open => fixed
2011-12-27 10:01 garrigue Fixed in Version => 3.13.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker