summaryrefslogtreecommitdiff
path: root/Test/dafny0/AutoReq.dfy
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/dafny0/AutoReq.dfy
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/dafny0/AutoReq.dfy')
-rw-r--r--Test/dafny0/AutoReq.dfy19
1 files changed, 19 insertions, 0 deletions
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