You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4776 Reporter:@alainfrisch Status: closed (set by @garrigue on 2009-04-28T05:26:46Z) Resolution: fixed Priority: normal Severity: major Fixed in version: 3.11.1+dev Category: ~DO NOT USE (was: OCaml general) Monitored by:@yakobowski
Bug 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).
The text was updated successfully, but these errors were encountered:
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.
Original bug ID: 4776
Reporter: @alainfrisch
Status: closed (set by @garrigue on 2009-04-28T05:26:46Z)
Resolution: fixed
Priority: normal
Severity: major
Fixed in version: 3.11.1+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @yakobowski
Bug 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).
The text was updated successfully, but these errors were encountered: