diff options
author | leino <unknown> | 2014-12-12 20:46:48 -0800 |
---|---|---|
committer | leino <unknown> | 2014-12-12 20:46:48 -0800 |
commit | 91c4d57eb84d5d15e011902a1da1b70131e5a222 (patch) | |
tree | 6794bafdc71f6bc31c8d09496c3435658bbfc144 /Test/dafny0/ComputationsNeg.dfy | |
parent | 62a3e97eb61cbee0d523297ccad1f2d3bcf871c3 (diff) |
Language change: All functions and methods declared lexically outside any class are now
automatically static, and fields are no longer allowed to be declared there. Stated
differently, all heap state must now be declared inside an explicitly declared class,
and functions and methods declared outside any class can be viewed as belonging to
the module. The motivating benefit of this change is to no longer need the 'static'
keyword when declaring a module of functions and methods.
Diffstat (limited to 'Test/dafny0/ComputationsNeg.dfy')
-rw-r--r-- | Test/dafny0/ComputationsNeg.dfy | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Test/dafny0/ComputationsNeg.dfy b/Test/dafny0/ComputationsNeg.dfy index 12a4353d..0c539117 100644 --- a/Test/dafny0/ComputationsNeg.dfy +++ b/Test/dafny0/ComputationsNeg.dfy @@ -25,12 +25,12 @@ ghost method test_ThProperty() }
// The following is a test that well-typedness antecednets are included in the literal axioms
-static function StaticFact(n: nat): nat
+function StaticFact(n: nat): nat
ensures 0 < StaticFact(n);
{
if n == 0 then 1 else n * StaticFact(n - 1)
}
-static method test_StaticFact()
+method test_StaticFact()
{
assert StaticFact(0) == 1;
assert 42 != 42; // error: this should fail
|