diff options
author | Rustan Leino <unknown> | 2015-07-07 15:27:58 -0700 |
---|---|---|
committer | Rustan Leino <unknown> | 2015-07-07 15:27:58 -0700 |
commit | f235dfbc792bb885f3c76e4267658c1a9ef838d8 (patch) | |
tree | 3bab8cd7af82026d47a2b113497766db5b080545 /Test/dafny0/Trait/TraitsDecreases.dfy | |
parent | f177d7dc96b27f5ca3b777d31fcd9bad26be6ce5 (diff) |
Fixed crashes in overrides checking of function decreases clauses, and improved the error message reported to users
Diffstat (limited to 'Test/dafny0/Trait/TraitsDecreases.dfy')
-rw-r--r-- | Test/dafny0/Trait/TraitsDecreases.dfy | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Test/dafny0/Trait/TraitsDecreases.dfy b/Test/dafny0/Trait/TraitsDecreases.dfy index 53ce28be..8ab3672a 100644 --- a/Test/dafny0/Trait/TraitsDecreases.dfy +++ b/Test/dafny0/Trait/TraitsDecreases.dfy @@ -106,3 +106,49 @@ class CC extends TT { decreases *
{ }
}
+
+
+// The following module contains various regression tests
+module More {
+ trait A0 {
+ predicate P() decreases 5
+ }
+ class B0 extends A0 {
+ predicate P() // error: rank is not lower
+ }
+
+ trait A1 {
+ predicate P() decreases 5
+ }
+ class B1 extends A1 {
+ predicate P() reads this // error: rank is not lower
+ }
+
+ trait A2 {
+ predicate P(x: int)
+ }
+ class B2 extends A2 {
+ predicate P(x: int) reads this // error: rank is not lower
+ }
+
+ trait A3 {
+ predicate P() reads this
+ }
+ class B3 extends A3 {
+ predicate P() // error: rank is not lower
+ }
+
+ trait A4 {
+ predicate P(x: int) decreases 5
+ }
+ class B4 extends A4 {
+ predicate P(x: int) // error: rank is not lower
+ }
+
+ trait A5 {
+ method M(x: int) decreases 5
+ }
+ class B5 extends A5 {
+ method M(x: int) // error: rank is not lower
+ }
+}
|