summaryrefslogtreecommitdiff
path: root/Test/dafny0/CompilationErrors.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-11-14 17:17:14 -0800
committerGravatar Rustan Leino <unknown>2013-11-14 17:17:14 -0800
commitefb6efa4fa204c46b4d8ca5e989eb2a088b5a710 (patch)
tree7b0bf8a27693060d7766639b503fac64432973c3 /Test/dafny0/CompilationErrors.dfy
parent0975663860053e1ed568b971abb1e0d25cc48f3a (diff)
Let compiler complain about body-less functions and methods, even if these are ghost
Diffstat (limited to 'Test/dafny0/CompilationErrors.dfy')
-rw-r--r--Test/dafny0/CompilationErrors.dfy14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/dafny0/CompilationErrors.dfy b/Test/dafny0/CompilationErrors.dfy
new file mode 100644
index 00000000..7d21933a
--- /dev/null
+++ b/Test/dafny0/CompilationErrors.dfy
@@ -0,0 +1,14 @@
+type MyType // compile error: arbitrary type
+iterator Iter() // compile error: body-less iterator
+ghost method M() // compile error: body-less ghost method
+method P() // compile error: body-less method
+method Q()
+{
+ if g == 0 {
+ assume true; // compile error: assume
+ }
+}
+ghost var g: int;
+
+function F(): int // compile error: body-less ghost function
+function method H(): int // compile error: body-less function method