summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorGravatar Bryan Parno <parno@microsoft.com>2014-01-08 16:59:22 -0800
committerGravatar Bryan Parno <parno@microsoft.com>2014-01-08 16:59:22 -0800
commit709f460287dac7b6646fe770d3e01ed7cf26c9eb (patch)
tree41a6b4fd1f59b411cb6b84be871a36969f73c6b0 /Test
parent2dab50557b2584a82ffc7be8759d6a8a4720d1f9 (diff)
:autoReq now works with static functions.
This required fixing a small bug in how StaticReceiverExpr's were being handled
Diffstat (limited to 'Test')
-rw-r--r--Test/dafny0/Answer2
-rw-r--r--Test/dafny0/AutoReq.dfy19
2 files changed, 20 insertions, 1 deletions
diff --git a/Test/dafny0/Answer b/Test/dafny0/Answer
index c46f780c..424fe0bd 100644
--- a/Test/dafny0/Answer
+++ b/Test/dafny0/Answer
@@ -2083,7 +2083,7 @@ Execution trace:
(0,0): anon0
(0,0): anon11_Then
-Dafny program verifier finished with 43 verified, 8 errors
+Dafny program verifier finished with 46 verified, 8 errors
-------------------- Superposition.dfy --------------------
diff --git a/Test/dafny0/AutoReq.dfy b/Test/dafny0/AutoReq.dfy
index 00c74f50..684de262 100644
--- a/Test/dafny0/AutoReq.dfy
+++ b/Test/dafny0/AutoReq.dfy
@@ -266,4 +266,23 @@ module Matches {
}
}
+// Make sure :autoReq works with static functions
+module StaticTest {
+ static function f(x:int) : bool
+ requires x > 3;
+ {
+ x > 7
+ }
+ static function {:autoReq} g(z:int) : bool
+ requires f(z);
+ {
+ true
+ }
+
+ // Should succeed thanks to auto-generation based on f's requirements
+ static function {:autoReq} h(y:int) : bool
+ {
+ g(y)
+ }
+} \ No newline at end of file