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: 957 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
module Elements = Set.Make(struct type t = string let compare = compare end)
type t = {
dtd_name : string;
contents : (string, Elements.t) Hashtbl.t;
(* for each element, give the set of included elements )
mutable open_omitted : Elements.t;
( set of elements for which opening tag may be omitted )
mutable close_omitted : Elements.t
( set of elements for which closing tag may be omitted *)
}
let table = (Hashtbl.create 11 : (string, t) Hashtbl.t)
let names () =
let names = ref [] in
Hashtbl.iter (fun name _ -> names := name :: !names) table;
!names
$ ocamlc -c -pp camlp4o /tmp/x.ml
File "/tmp/x.ml", line 18, characters 31-54:
The record field label contents is not mutable
It does compile with regular ocamlc
The text was updated successfully, but these errors were encountered:
type t = {
[...]
contents : (string, Elements.t) Hashtbl.t;
[...]
}
$ ocamlc -c -pp camlp4o /tmp/x.ml
File "/tmp/x.ml", line 18, characters 31-54:
The record field label contents is not mutable
You should avoid redefining the record field label "contents". It is
pretty much reserved by the std library for implementing 'a ref.
Maybe we should change its name to something less likely to cause clashes.
For example _contents or _ref_contents.
Original bug ID: 957
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Francois Rouaix
Version: 3.04
OS: Linux
Submission from: ca-redbch-u1-c3b-189.stmnca.adelphia.net (24.54.194.189)
Consider the following .ml file
module Elements = Set.Make(struct type t = string let compare = compare end)
type t = {
dtd_name : string;
contents : (string, Elements.t) Hashtbl.t;
(* for each element, give the set of included elements )
mutable open_omitted : Elements.t;
( set of elements for which opening tag may be omitted )
mutable close_omitted : Elements.t
( set of elements for which closing tag may be omitted *)
}
let table = (Hashtbl.create 11 : (string, t) Hashtbl.t)
let names () =
let names = ref [] in
Hashtbl.iter (fun name _ -> names := name :: !names) table;
!names
$ ocamlc -c -pp camlp4o /tmp/x.ml
File "/tmp/x.ml", line 18, characters 31-54:
The record field label contents is not mutable
It does compile with regular ocamlc
The text was updated successfully, but these errors were encountered: