Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001274OCamlOCaml generalpublic2002-07-30 09:342002-08-02 03:29
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001274: first-class polymorphism type-checking failure (crash)
DescriptionFull_Name: John Prevost
Version: 3.05
OS: Windows
Submission from: (

I've discovered a fairly serious typechecking bug in 3.05. I'm
also mentioning it on the mailing list so that people are aware.

You can do the following:

# type bad = { x : 'a . 'a option ref };;
type bad = { x : 'a. 'a option ref; }
# let bv = { x = ref None };;
val bv : bad = {x = {contents = None}}
# bv.x := Some 5;;
- : unit = ()
# let extra_bad = !(bv.x);;
val extra_bad : '_a option = Some <poly>
# f extra_bad;;


It looks like mutable fields are handled correctly and catch that the
value is not, in fact, general enough. But when the mutable field is
part of the value (in this case, part of the ref), the check is not

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2002-08-02 03:28

Thanks for your report.
This was really a stupid bug: as others in the group already assessed, I just
forgot to check for non-expansiveness when generalizing first-class polymorphic
The problem was specific to records: methods are always non-expansive.
This is now fixed (2 lines of code).

Jacques Garrigue
administrator (administrator)
2002-08-02 03:29

Fixed by Jacques (2002-08-02)

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

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker