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: 1191 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
OCaml refuse ça:
class c =
(
object method f : 'a. ([< A] as 'a) -> unit = fun _ -> () end : object method f : [< A] -> unit end
)
The class type object method f : [ A] -> unit end is not matched by the class type object method f : [< A] -> unit end
The method f has type 'a. ([ A] as 'a) -> unit but is expected to have type 'b. ([< A] as 'b) -> unit
C'est le cas avec 3.04+11 et 3.04+13. J'ai une vieille version "3.04+6
polymorphic methods (2002-02-16)" qui acceptait ça.
-- Alain
The text was updated successfully, but these errors were encountered:
class c =
(
object method f : 'a. ([< A] as 'a) -> unit = fun _ -> () end : object method f : [< A] -> unit end
)
The class type object method f : [ A] -> unit end is not matched by the class type object method f : [< A] -> unit end
The method f has type 'a. ([ A] as 'a) -> unit but is expected to have type 'b. ([< A] as 'b) -> unit
C'est le cas avec 3.04+11 et 3.04+13. J'ai une vieille version "3.04+6
polymorphic methods (2002-02-16)" qui acceptait ca.
Le probleme est subtil: j'ai recemment modifie' le compilateur pour
qu'il force la presence dans tous les variants a un seul champs. D'ou l'apparition de ce [ A]. Clairement, ca pose probleme quand ils sont introduits a la main:
soit l'implementation doit etre refusee (la variable quantifiee n'en
est pas une), soit l'interface doit etre acceptee. Je vais voir quoi
faire.
Sur le fond, distinguer [< A] n'a pas de sens: la seule instance possible de ce type est [ A].
Original bug ID: 1191
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
OCaml refuse ça:
class c =
(
object method f : 'a. ([<
A] as 'a) -> unit = fun _ -> () end : object method f : [<
A] -> unit end)
The class type object method f : [
A] -> unit end is not matched by the class type object method f : [<
A] -> unit endThe method f has type 'a. ([
A] as 'a) -> unit but is expected to have type 'b. ([<
A] as 'b) -> unitC'est le cas avec 3.04+11 et 3.04+13. J'ai une vieille version "3.04+6
polymorphic methods (2002-02-16)" qui acceptait ça.
-- Alain
The text was updated successfully, but these errors were encountered: