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

Matching boolean tuples bug #8358

Closed
vicuna opened this issue Nov 4, 2003 · 1 comment
Closed

Matching boolean tuples bug #8358

vicuna opened this issue Nov 4, 2003 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 4, 2003

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

Bug description

Full_Name: Lukasz Lew
Version: 3.02 - 3.07
OS: Win / Lin
Submission from: fw-gw-atm.mimuw.edu.pl (193.0.96.15)

Just run code below:
let s a = match a with
| false, false, false -> "1"
| false, false, true-> "2"
| false, true, fasle -> "3"
| false, true, true -> "4"
| true, false, fasle -> "5"
| true, fasle, true -> "6"
| true, true, fasle -> "7"
| true, true, true -> "8"
| _ -> "none"
;;
let f = false;;
let t = true;;
let all = [(f,f,f); (f,f,t); (f,t,f); (f,t,t);
(t,f,f); (t,f,t); (t,t,f); (t,t,t)]
;;
List.iter (fun tri -> print_endline (s tri)) all;;

Compilation output:
File "t.ml", line 5, characters 4-22:
Warning: this match case is unused.
File "t.ml", line 9, characters 4-22:
Warning: this match case is unused.
File "t.ml", line 10, characters 4-5:
Warning: this match case is unused.

Program output :
1
2
3
3
5
5
7
6

Is it a know bug?
Regards
Lukasz Lew

@vicuna
Copy link
Author

vicuna commented Nov 4, 2003

Comment author: administrator

Rewriting "fasle" into "false" should correct your problem.

-- Michel Mauny

l.lew@zodiac.mimuw.edu.pl wrote/écrivait (Tue, Nov 04, 2003 at 03:20:18PM +0100):

Full_Name: Lukasz Lew
Version: 3.02 - 3.07
OS: Win / Lin
Submission from: fw-gw-atm.mimuw.edu.pl (193.0.96.15)

Just run code below:
let s a = match a with
| false, false, false -> "1"
| false, false, true-> "2"
| false, true, fasle -> "3"
| false, true, true -> "4"
| true, false, fasle -> "5"
| true, fasle, true -> "6"
| true, true, fasle -> "7"
| true, true, true -> "8"
| _ -> "none"
;;
let f = false;;
let t = true;;
let all = [(f,f,f); (f,f,t); (f,t,f); (f,t,t);
(t,f,f); (t,f,t); (t,t,f); (t,t,t)]
;;
List.iter (fun tri -> print_endline (s tri)) all;;

Compilation output:
File "t.ml", line 5, characters 4-22:
Warning: this match case is unused.
File "t.ml", line 9, characters 4-22:
Warning: this match case is unused.
File "t.ml", line 10, characters 4-5:
Warning: this match case is unused.

Program output :
1
2
3
3
5
5
7
6

Is it a know bug?
Regards
Lukasz Lew

@vicuna vicuna closed this as completed Nov 12, 2003
@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