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: 1374 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
bonjour,
le code suivant est accepté :
class c = object (self)
method m : 'a. ([> `A of 'a] as 'a) -> unit
= fun x -> self#m x
end
alors que si l'on passe par une déclaration de type
type 'a t = [ `A of 'a] , on obtient des résultats variables...
paros[11:05]%ocaml
Objective Caml version 3.06
type 'a t= [`A of 'a]
;;
type 'a t = [ `A of 'a]
class c = object (self)
method m : 'a. ([> 'a t] as 'a) -> unit
= fun x -> self#m x
end
;; (* boucle *)
Interrupted.
class c = object (self)
method m : 'a. ([> 'a t] as 'a) -> unit
= fun x -> match x with
| `A x' -> self#m x'
| _ -> failwith "c#m"
end
;; (* refusé alors que devrait être OK *)
This method has type ([> 'a t] as 'a) -> unit which is less general than
'b. ([> 'b t] as 'b) -> unit
class c = object (self)
method m : 'a. ([> 'a t] as 'a) -> 'a
= fun x -> self#m x
end
;; (* crash *)
Fatal error: exception Stack_overflow
paros[11:07]%
The text was updated successfully, but these errors were encountered:
class c = object (self)
method m : 'a. ([> `A of 'a] as 'a) -> unit
= fun x -> self#m x
end
alors que si l'on passe par une declaration de type
type 'a t = [ `A of 'a] , on obtient des resultats variables...
Effectivement, le code de 3.06 est incorrect quand un alias de rangee
universel est passe' en argument a un autre type avant ou a
l'interieur de l'alias, et casse de nombreux invariants. Merci pour
ce rapport.
Original bug ID: 1374
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
bonjour,
le code suivant est accepté :
class c = object (self)
method m : 'a. ([> `A of 'a] as 'a) -> unit
= fun x -> self#m x
end
alors que si l'on passe par une déclaration de type
type 'a t = [ `A of 'a] , on obtient des résultats variables...
paros[11:05]%ocaml
Objective Caml version 3.06
type 'a t= [`A of 'a]
;;
type 'a t = [ `A of 'a]
class c = object (self)
method m : 'a. ([> 'a t] as 'a) -> unit
= fun x -> self#m x
end
;; (* boucle *)
Interrupted.
class c = object (self)
end
;; (* refusé alors que devrait être OK *)
This method has type ([> 'a t] as 'a) -> unit which is less general than
'b. ([> 'b t] as 'b) -> unit
class c = object (self)
method m : 'a. ([> 'a t] as 'a) -> 'a
= fun x -> self#m x
end
;; (* crash *)
Fatal error: exception Stack_overflow
paros[11:07]%
The text was updated successfully, but these errors were encountered: