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: 3745 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Original bug ID: 3745
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Anatoly Zaretsky
Version: Objective Caml 3.08.3
OS: Debian GNU/Linux 3.1
Submission from: zaretsky.apex.dp.ua (212.3.110.34)
Hello!
Compilation of the following code causes compiler fatal error:
% ocamlc -c test.ml
myself/77
% ocamlopt -c test.ml
However, "ocamlc -i test.ml" succeeds.
When I do not use let binding for 'myself' and substitute it manually,
everything compiles fine.
(* test.ml *)
class virtual enterprise =
object (self)
val categories : category list = []
method online =
let myself = (self :> enterprise) in
List.iter
(fun cat ->
cat#add_ent myself;
List.iter
(fun client -> client#inform cat myself)
cat#get_clients)
categories
method virtual inform : category -> client -> unit
end
and virtual client =
object (self)
val categories : category list = []
method online =
let myself = (self :> client) in
List.iter
(fun cat ->
cat#add_client myself;
List.iter
(fun ent ->
self#inform cat ent;
ent#inform cat myself)
cat#get_ents)
categories;
method virtual inform : category -> enterprise -> unit
end
and virtual category =
object
method virtual add_ent : enterprise -> unit
method virtual get_ents : enterprise list
method virtual add_client : client -> unit
method virtual get_clients : client list
end
The text was updated successfully, but these errors were encountered: