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/Compilation.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/Compilation.dfy')
-rw-r--r-- | Test/dafny0/Compilation.dfy | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Test/dafny0/Compilation.dfy b/Test/dafny0/Compilation.dfy index d8ff3989..d515e559 100644 --- a/Test/dafny0/Compilation.dfy +++ b/Test/dafny0/Compilation.dfy @@ -79,7 +79,7 @@ module A { import X as S default T;
import Y as S default T;
import Z = T;
- static method run() {
+ method run() {
var x := new X.C;
x.m();
var y := new Y.C;
@@ -96,17 +96,17 @@ method NotMain() { abstract module S1 {
import B as S default T;
- static method do()
+ method do()
}
module T1 refines S1 {
- static method do() {
+ method do() {
var x := 3;
}
}
module A1 {
import X as S1 default T1;
- static method run() {
+ method run() {
X.do();
var x := new X.B.C;
x.m();
|