Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000003OCamlOCaml generalpublic1999-12-20 10:582001-11-19 10:52
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000003: type abbreviation hides constraints
DescriptionFull_Name: Hendrik Tews
Version: 2.02
Submission from: (
Submitted by: xleroy

if I type
# class type ['a] cta = object val a_val : 'a method b : int end;;
# class ['a] ca (a:'a) : ['a] cta =
   object val a_val = a method b = a_val#get + 5 end;;
into the toplevel, the system derives the type
class ['a] ca : 'a -> ['a] cta
IMO this is wrong, because there must be a constraint for the type
parameter of class ca (the constraint becomes visible, if the
type annotation ['a] cta is left out). The problem becomes even
more apparent, when the system derives for
# module M = struct class ['a] ca (a:'a) : ['a] cta =
  object val a_val = a method b = a_val#get + 5 end end ;;
the type
  module M : sig class ['a] ca : 'a -> ['a] cta end
# module type MT = sig class ['a] ca : 'a -> ['a] cta end;;
# module M : MT = struct class ['a] ca (a:'a) : ['a] cta =
  object val a_val = a method b = a_val#get + 5 end end ;;
produces an error.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2001-11-19 10:52


I have finally closed PR#3.
The fix was much simpler than what I thought, but it is somehow weak:
all classes whose parameters have constraints will not be abbreviated,
independently of wether the abbreviation is correct or not.

Jacques Garrigue
administrator (administrator)
2001-11-19 10:52

Fixed by Jacques on 2001-11-19.

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

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker