| Anonymous | Login | Signup for a new account | 2013-05-24 08:44 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004766 | OCaml | OCaml general | public | 2009-04-09 16:12 | 2009-04-10 08:33 | |||
| Reporter | pveber | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | major | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | ||||||||
| Target Version | Fixed in Version | 3.11.1+dev | ||||||
| Summary | 0004766: Incorrect type inference with objects | |||||||
| Description | Consider the following session with ocaml 3.11 interpreter : Objective Caml version 3.11.0 # class virtual ['a] c = object (s : 'a) method virtual m : 'b end ;; class virtual ['a] c : object ('a) constraint 'a = < m : 'b; .. > method virtual m : 'b end # let o = object (s :'a) inherit ['a] c method m = 42 end;; val o : 'a c as 'a = ... # o#m;; - : 'a = <poly> It seems that the typing of instance o is incorrect, and should rather be something like 'a c as 'a constraint 'a = < m : int; .. >. I did not find any previous report of this problem. The behaviour is the same on ocaml 3.10.2. BTW: thanks for your excellent work on ocaml, and all the very instructive messages sent by the caml dev team on caml-list. | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0004920) garrigue (manager) 2009-04-10 08:33 |
The real problem was in the way abbreviations were simplified in Ctype.normalize_type. Concretely, ('a c as 'a) does not accurately define a type, since it can describe any instance of itself too... |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-04-09 16:12 | pveber | New Issue | |
| 2009-04-10 08:33 | garrigue | Note Added: 0004920 | |
| 2009-04-10 08:33 | garrigue | Status | new => closed |
| 2009-04-10 08:33 | garrigue | Resolution | open => fixed |
| 2009-04-10 08:33 | garrigue | Fixed in Version | => 3.11.1+dev |
| Copyright © 2000 - 2011 MantisBT Group |