| Anonymous | Login | Signup for a new account | 2013-05-18 21:22 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 | |||
| 0004776 | OCaml | OCaml general | public | 2009-04-27 11:52 | 2009-04-28 07:26 | |||
| Reporter | frisch | |||||||
| 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 | 0004776: Bad interaction between exceptions and classes | |||||||
| Description | The code generator for classes behaves badly w.r.t. exceptions, as demonstrated by the code below: ============================================================================ module F(X : sig end) = struct exception A let a = A let () = let o = object method test = match a with A -> print_endline "OK" | _ -> assert false end in o # test end module X = F(struct end) module Y = F(struct end) (* fails!!! *) ============================================================================ The reason, I believe, is that Env.diff does not take exception constructors into account. As a consequence, the new_ids variable in Translclass.transl_class does not include such constructors and the classes are not closed over them, as they should (as far as I understand compilation of classes). | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0004925) frisch (developer) 2009-04-27 12:00 |
I confirm that if one extends Env.t with a new field that keep tracks of all exceptions (one only needs to change the store_exception function and the empty value) and if we use this in Env.diff, the bug is fixed. |
|
(0004928) garrigue (manager) 2009-04-28 07:26 |
Fixed by tracking (local) exceptions in Env.diff. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-04-27 11:52 | frisch | New Issue | |
| 2009-04-27 12:00 | frisch | Note Added: 0004925 | |
| 2009-04-28 07:26 | garrigue | Note Added: 0004928 | |
| 2009-04-28 07:26 | garrigue | Status | new => closed |
| 2009-04-28 07:26 | garrigue | Resolution | open => fixed |
| 2009-04-28 07:26 | garrigue | Fixed in Version | => 3.11.1+dev |
| Copyright © 2000 - 2011 MantisBT Group |