Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000212OCamlOCaml generalpublic2000-10-25 21:072000-10-26 15:24
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000212: Re: expression evaluation
DescriptionBonjour,

Merci de votre message à la tribune de discussion de Caml. Toutefois
votre message semble être un rapport d'erreur et donc mal orienté: je
l'envoie à la bonne adresse

caml-bugs@inria.fr

Merci encore pour votre intérêt à notre langage.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/ [^]
> While preparing Ocaml courses, I have tried this example :
>
> # try (function 1 -> 0) 0 with Match_failure x -> x;;
> 0
> This expression has type string * int * int but is here used with type
> int
>
> I understand the type error : (function 1 -> 0) 0 is of type int but x
> is of type string*int*int.
> But why the warning "this pattern-matching is not exhaustive" is not
> printed ? and why the example not
> matched (0) is printed ?
>
> Thank you for an explanation of this behavior.
> --
> Michel Levy
> D106 - L.S.R. B.P.72 - 38042 SAINT MARTIN D'HERES CEDEX - France
> e.mail : Michel.Levy@imag.fr tel :(33)476827246
> http://www-lsr.imag.fr/Les.Personnes/Michel.Levy [^]


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000458)
administrator (administrator)
2000-10-26 11:56

> While preparing Ocaml courses, I have tried this example :
>
> # try (function 1 -> 0) 0 with Match_failure x -> x;;
> 0
> This expression has type string * int * int but is here used with type
> int
>
> I understand the type error : (function 1 -> 0) 0 is of type int but x
> is of type string*int*int.
> But why the warning "this pattern-matching is not exhaustive" is not
> printed ? and why the example not
> matched (0) is printed ?
>
> Thank you for an explanation of this behavior.
> --
> Michel Levy
> D106 - L.S.R. B.P.72 - 38042 SAINT MARTIN D'HERES CEDEX - France
> e.mail : Michel.Levy@imag.fr tel :(33)476827246
> http://www-lsr.imag.fr/Les.Personnes/Michel.Levy [^]
>


Hello, I do not think this is a bug.

The explanation is quite simple, compilation fails on a typing error
before exhaustiveness analysis is performed.



--Luc Maranget


(0000459)
administrator (administrator)
2000-10-26 15:24

> # try (function 1 -> 0) 0 with Match_failure x -> x;;
> 0
> This expression has type string * int * int but is here used with type
> int

This is a cosmetic bug in the display of warning and error messages.
You can see it better if you set the TERM environment variable to "dumb"
before launching the toplevel.

This will be mostly fixed in the next release. Thanks for the bug report.

-- Damien

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker