New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
message d'erreur douteux #3032
Comments
Comment author: administrator
Effectivement, ce message est assez peu intuitif.
Array.iter Sys.argv (fun arg -> print_string (arg ^ " "));;
This expression has type string array but is here used with type 'a -> unit Array.init (fun x -> 2*x) 3;;
This expression should not be a function Array.iter (fun x y -> x + y);;
This function expects too many arguments On pourrait aussi vouloir afficher le type de la non-fonction, qu'en Jacques Garrigue |
Comment author: administrator Change error message according to context (JG, 2001-11-16) |
Comment author: administrator
Pourquoi ne pas afficher le type attendu pour cette expression, puis Cordialement, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ |
Original bug ID: 633
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Ça se produit en 3.00 et en 3.03-alpha:
Array.iter;;
Array.iter Sys.argv (fun arg -> print_string (arg ^ " "));;
This function expects too many arguments
Ouch! Je suis étonné, vu la qualité et la précision habituelles des
messages d'erreurs, qu'Ocaml ne me signale pas que cette fun devrait
être un 'a array, ou Sys.argv une fun, comme (me souffle perfidement
Pierre :-) camllight:
#do_list [| |] (fun arg -> print_string (arg ^ " "));;
Toplevel input:
Bon, j'ai trouvé mon erreur quand même, finalement. Mais plus d'un
débutant serait troublé.
Bruno.
The text was updated successfully, but these errors were encountered: