Skip to content
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

Re: expression evaluation #2598

Closed
vicuna opened this issue Oct 25, 2000 · 2 comments
Closed

Re: expression evaluation #2598

vicuna opened this issue Oct 25, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 25, 2000

Original bug ID: 212
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Bonjour,

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 stringintint.
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

@vicuna
Copy link
Author

vicuna commented Oct 26, 2000

Comment author: administrator

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 stringintint.
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

@vicuna
Copy link
Author

vicuna commented Oct 26, 2000

Comment author: administrator

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

@vicuna vicuna closed this as completed Oct 26, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant