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/Modules2.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/Modules2.dfy')
-rw-r--r-- | Test/dafny0/Modules2.dfy | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Test/dafny0/Modules2.dfy b/Test/dafny0/Modules2.dfy index 8b2ff570..6a68c38e 100644 --- a/Test/dafny0/Modules2.dfy +++ b/Test/dafny0/Modules2.dfy @@ -6,14 +6,14 @@ module A { var f: int;
}
datatype D = E(int) | F(int);
- static function f(n:nat): nat
+ function f(n:nat): nat
}
module B {
class C {
var f: int;
}
datatype D = E(int) | F(int);
- static function f(n:nat): nat
+ function f(n:nat): nat
}
module Test {
import opened A; // nice shorthand for import opened A = A; (see below)
@@ -49,7 +49,7 @@ module Test3 { var d := E(i); // bad, as both A and B give a definition of E
var d' := D.E(i); // bad, as D is still itself ambiguous.
var d'':= B.D.E(i); // good, just use the B version
- assert f(3) >= 0; // bad because A and be both define f statically.
+ assert f(3) >= 0; // bad because A and B both define f statically.
}
}
|