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: 2562 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Andreas Hauser
Version: 3.07 and cvs 8. May 2004
OS: DragonFly, FreeBSD and Linux
Submission from: pd9e97d1e.dip.t-dialin.net (217.233.125.30)
(* The following code produces: )
( Fatal error: exception Assert_failure("typing/ctype.ml", 252, 30) *)
class node s =
object(self:'node)
val mutable symbol = s
method symbol = symbol
val mutable leaf = false
method leaf = leaf
method set_leaf b = leaf <- b
val mutable transitions = []
method transitions = transitions
method get_transition key = List.assoc key transitions
method add_transition (key,node) =
transitions <- (key, node) :: transitions
val mutable id = 0
method id = id
method set_id i = id <- i
method private insert_suffix_tree root s suffix_chain =
if String.length s > 0 then
let key = Str.first_chars s 1 in
let f acc current_node =
try
(current_node#get_transition key) :: acc
with Not_found ->
let new_node : #node = new node key in
current_node#add_transition (key, new_node);
new_node :: acc
in
root#print_digraph;
self#insert_suffix_tree root (Str.string_after s 1)
(List.fold_left f [root] suffix_chain)
else
(* the suffix_chain will contain all essential nodes (leafs)
*)
List.iter (fun n -> if n != root then n#set_leaf true)
suffix_chain;
(* without the coercions a bug seems to be triggered in ocaml *)
(* self#insert_suffix_tree (self :> node> s [(self :> node)] *)
method suffix_tree s =
self#insert_suffix_tree self s [self]
end;;
The text was updated successfully, but these errors were encountered:
Original bug ID: 2562
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Andreas Hauser
Version: 3.07 and cvs 8. May 2004
OS: DragonFly, FreeBSD and Linux
Submission from: pd9e97d1e.dip.t-dialin.net (217.233.125.30)
(* The following code produces: )
( Fatal error: exception Assert_failure("typing/ctype.ml", 252, 30) *)
(List.fold_left f [root] suffix_chain)
else
(* the suffix_chain will contain all essential nodes (leafs)
*)
List.iter (fun n -> if n != root then n#set_leaf true)
suffix_chain;
end;;
The text was updated successfully, but these errors were encountered: