aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/bugs/opened/3388.v
blob: d0ea72e1fdc2c558b61540e5fad75623b3aba1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Inductive test : bool -> bool -> Type :=
| test00 : test false false
| test01 : test false true
| test10 : test true false
.

(* This does not work *)
Fail Definition test_a (t : test true false) : test true false :=
  match t with
    | test10 => test10
  end.

(* The following definition shows that test_a SHOULD work *)
Definition test_a_workaround (t : test true false) : test true false :=
  match t with
    | test10 => test10
    | _ => tt
  end.

(* Surprisingly, this works *)
Definition test_b (t : test false true) : test false true :=
  match t with
    | test01 => test01
  end.


(* This, too, works *)
Definition test_c x (t : test false x) : test false x :=
  match t with
    | test00 => test00
    | test01 => test01
  end.

Inductive test2 : bool -> bool -> Type :=
| test201 : test2 false true
| test210 : test2 true false
| test211 : test2 true true
.

(* Now this works *)
Definition test2_a (t : test2 true false) : test2 true false :=
  match t with
    | test210 => test210
  end.

(* Accordingly, this now fails *)
Fail Definition test2_b (t : test2 false true) : test2 false true :=
  match t with
    | test201 => test201
  end.


(* This, too, fails *)
Fail Definition test2_c x (t : test2 false x) : test2 false x :=
  match t with
    | test201 => test201
  end.