Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006419OCamlOCaml typingpublic2014-05-13 16:192014-05-14 17:10
ReporterNick Chapman 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.02.0+dev 
Summary0006419: trunk/4.02 - Unexpected/incorrect "contains type variables that cannot be generalized"
Description
Reproduce using the following 3-line example, build with Jane street's Core library.

open Core.Std
let () = Printf.printf "some unrelated message"
let my_table (*: int String.Table.t*) = String.Table.of_alist_exn [("OK",0)]

$ ocamlopt -I lib/core_kernel -I lib/core -c cant_generalise.ml

File "cant_generalise.ml", line 3, characters 40-76:
Error: The type of this expression, ('_a, int) Core.Std.String.Table.t_,
       contains type variables that cannot be generalized
       
The type error is avoided if either:
- the explicit type annotation is uncommented
- the unrelated printf line is removed
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0011444)
Nick Chapman (reporter)
2014-05-13 17:30

The type error is also avoided by adding the following type annotation
to the printf format string...

let () = Printf.printf ("some unrelated message":(_,_,_)format)
(0011451)
garrigue (manager)
2014-05-14 06:35

Somebody forgot to call instance_def...

Fixed in 4.02 branch at revision 14861.
(0011462)
gasche (developer)
2014-05-14 17:10

PS: the faulty part of the code is now completely gone (use of a nominal type instead of a tuple for format6).

- Issue History
Date Modified Username Field Change
2014-05-13 16:19 Nick Chapman New Issue
2014-05-13 16:20 shinwell Assigned To => garrigue
2014-05-13 16:20 shinwell Status new => assigned
2014-05-13 16:51 gasche Assigned To garrigue => gasche
2014-05-13 17:30 Nick Chapman Note Added: 0011444
2014-05-14 06:35 garrigue Note Added: 0011451
2014-05-14 06:35 garrigue Status assigned => resolved
2014-05-14 06:35 garrigue Fixed in Version => 4.02.0+dev
2014-05-14 06:35 garrigue Resolution open => fixed
2014-05-14 17:10 gasche Note Added: 0011462


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker