| 1 |
(* Test the nonuniform attribute to silence warnings on coercions |
| 2 |
not satisfying the non uniform inheritance condition. *) |
| 3 |
|
| 4 |
Module Test0. |
| 5 |
|
| 6 |
Parameter C : nat -> bool -> Type. |
| 7 |
Parameter D : Type. |
| 8 |
Parameter f : forall (n : nat) (b : bool), C n b -> D. |
| 9 |
|
| 10 |
(* uniform inheritance satisfied, no warning *) |
| 11 |
Coercion f : C >-> D. |
| 12 |
|
| 13 |
End Test0. |
| 14 |
|
| 15 |
Module Test1. |
| 16 |
|
| 17 |
Parameter C : nat -> bool -> Type. |
| 18 |
Parameter D : Type. |
| 19 |
Parameter f : forall (b : bool) (n : nat), C n b -> D. |
| 20 |
|
| 21 |
(* uniform inheritance not satisfied, warning *) |
| 22 |
Coercion f : C >-> D. |
| 23 |
|
| 24 |
End Test1. |
| 25 |
|
| 26 |
Module Test2. |
| 27 |
|
| 28 |
Parameter C : nat -> bool -> Type. |
| 29 |
Parameter D : Type. |
| 30 |
Parameter f : forall (b : bool) (n : nat), C n b -> D. |
| 31 |
|
| 32 |
(* uniform inheritance not satisfied but attribute, no warning *) |
| 33 |
#[warning="-uniform-inheritance"] Coercion f : C >-> D. |
| 34 |
|
| 35 |
End Test2. |
| 36 |
|
| 37 |
Module Test3. |
| 38 |
|
| 39 |
Parameter C : nat -> bool -> Type. |
| 40 |
Parameter D : Type. |
| 41 |
Parameter f : forall (n : nat) (b : bool), C n b -> D. |
| 42 |
|
| 43 |
(* uniform inheritance satisfied, no warning *) |
| 44 |
Coercion f' := f. |
| 45 |
|
| 46 |
End Test3. |
| 47 |
|
| 48 |
Module Test4. |
| 49 |
|
| 50 |
Parameter C : nat -> bool -> Type. |
| 51 |
Parameter D : Type. |
| 52 |
Parameter f : forall (b : bool) (n : nat), C n b -> D. |
| 53 |
|
| 54 |
(* uniform inheritance not satisfied, warning *) |
| 55 |
Coercion f' := f. |
| 56 |
|
| 57 |
End Test4. |
| 58 |
|
| 59 |
Module Test5. |
| 60 |
|
| 61 |
Parameter C : nat -> bool -> Type. |
| 62 |
Parameter D : Type. |
| 63 |
Parameter f : forall (b : bool) (n : nat), C n b -> D. |
| 64 |
|
| 65 |
(* uniform inheritance not satisfied but attribute, no warning *) |
| 66 |
#[warning="-uniform-inheritance"] Coercion f' := f. |
| 67 |
|
| 68 |
End Test5. |