| 1 |
From Corelib Require Program.Wf. |
| 2 |
|
| 3 |
Section Scope. |
| 4 |
|
| 5 |
#[local] Coercion nat_of_bool (b: bool) : nat := |
| 6 |
if b then 0 else 1. |
| 7 |
|
| 8 |
Check (refl_equal : true = 0 :> nat). |
| 9 |
|
| 10 |
End Scope. |
| 11 |
|
| 12 |
Fail Check 0 = true :> nat. |
| 13 |
|
| 14 |
#[universes(polymorphic)] |
| 15 |
Definition ι T (x: T) := x. |
| 16 |
|
| 17 |
Check ι _ ι. |
| 18 |
|
| 19 |
#[universes(polymorphic=no)] |
| 20 |
Definition ιι T (x: T) := x. |
| 21 |
|
| 22 |
Fail Check ιι _ ιι. |
| 23 |
|
| 24 |
#[program] |
| 25 |
Fixpoint f (n: nat) {wf lt n} : nat := _. |
| 26 |
Reset f. |
| 27 |
|
| 28 |
#[program=yes] |
| 29 |
Fixpoint f (n: nat) {wf lt n} : nat := _. |
| 30 |
Reset f. |
| 31 |
|
| 32 |
#[deprecated(since="8.9.0")] |
| 33 |
Ltac foo := foo. |
| 34 |
|
| 35 |
Module M. |
| 36 |
#[local] #[universes(polymorphic)] Definition zed := Type. |
| 37 |
|
| 38 |
#[local, universes(polymorphic)] Definition kats := Type. |
| 39 |
End M. |
| 40 |
Check M.zed@{_}. |
| 41 |
Fail Check zed. |
| 42 |
Check M.kats@{_}. |
| 43 |
Fail Check kats. |
| 44 |
|
| 45 |
Export Set Foo. |
| 46 |
|
| 47 |
#[ export ] Set Foo. |
| 48 |
|
| 49 |
Fail #[ export ] Export Foo. |
| 50 |
(* Attribute for Locality specified twice *) |
| 51 |
|
| 52 |
(* Tests for deprecated attribute syntax *) |
| 53 |
Set Warnings "-deprecated-attribute-syntax". |
| 54 |
|
| 55 |
#[program=yes] |
| 56 |
Fixpoint f (n: nat) {wf lt n} : nat := _. |
| 57 |
Reset f. |
| 58 |
|
| 59 |
#[universes(polymorphic=no)] |
| 60 |
Definition ιιι T (x: T) := x. |
| 61 |
Fail Check ιιι _ ιιι. |