diff options
author | rustanleino <unknown> | 2011-03-27 18:00:28 +0000 |
---|---|---|
committer | rustanleino <unknown> | 2011-03-27 18:00:28 +0000 |
commit | 4f0a7156a61ae3d16b8f716a23ac3f3dd596ab86 (patch) | |
tree | f2a3317d19001575441f6208c29e04b4ea05c714 /Test/dafny0/TypeTests.dfy | |
parent | d06300cc9bc9f9c7002fb8e555cf172053cdfa5c (diff) |
Dafny: Added support for an initializing call as part of the new-allocation syntax. What you previously would have written like:
c := new C;
call c.Init(x, y);
you can now write as:
c := new C.Init(x, y);
Diffstat (limited to 'Test/dafny0/TypeTests.dfy')
-rw-r--r-- | Test/dafny0/TypeTests.dfy | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Test/dafny0/TypeTests.dfy b/Test/dafny0/TypeTests.dfy index 6e8e2b72..cbab53bf 100644 --- a/Test/dafny0/TypeTests.dfy +++ b/Test/dafny0/TypeTests.dfy @@ -72,3 +72,11 @@ method DuplicateVarName(x: int) returns (y: int) var y := y; // error: redeclaration of an out-parameter is not allowed (it is
// treated like an outermost-scoped local in this regard)
}
+
+// ---------------------
+
+method InitCalls() {
+ var c := new C.F(null, null); // error: F is not a method
+ var d := new C.M(8); // error: M has out parameters
+ var e := new C.Caller();
+}
|