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: 4185 Reporter: jm Status: closed (set by @garrigue on 2007-01-30T01:51:01Z) Resolution: not a bug Priority: normal Severity: minor Version: 3.09.3 Category: ~DO NOT USE (was: OCaml general)
Bug description
Avec un ocamlc 3.09.3 linuxien, ceci compile parfaitement :
class cla_good (o: cla_good) =
object (self)
method test arg () =
(o#test 42 ()) + arg;
end
mais cela échoue :
class cla_bad (o: cla_bad) =
object (self)
method test ?(arg = 42) () =
(o#test ~arg: 42 ()) + arg;
end
« File "test_bad.ml", line 1, characters 5-108:
The abbreviation cla_bad expands to type < test : ?arg:int -> unit -> int >
but is used with type < test : arg:int -> unit -> int; .. > »
À mon humble avis, cela est anormal.
`arg' passe de label optionnel à label non-optionnel :s
The text was updated successfully, but these errors were encountered:
Ce comportement correspond a la section 4.1.2 du manuel: labels optionels et inference. Pendant la definition de cla_tmp, le type cla_tmp n'est connu que comme une variable. Par contre, le type de self est mis a jour, on peut donc ecrire:
Original bug ID: 4185
Reporter: jm
Status: closed (set by @garrigue on 2007-01-30T01:51:01Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.09.3
Category: ~DO NOT USE (was: OCaml general)
Bug description
Avec un ocamlc 3.09.3 linuxien, ceci compile parfaitement :
class cla_good (o: cla_good) =
object (self)
method test arg () =
(o#test 42 ()) + arg;
end
mais cela échoue :
class cla_bad (o: cla_bad) =
object (self)
method test ?(arg = 42) () =
(o#test ~arg: 42 ()) + arg;
end
« File "test_bad.ml", line 1, characters 5-108:
The abbreviation cla_bad expands to type < test : ?arg:int -> unit -> int >
but is used with type < test : arg:int -> unit -> int; .. > »
À mon humble avis, cela est anormal.
`arg' passe de label optionnel à label non-optionnel :s
The text was updated successfully, but these errors were encountered: