summaryrefslogtreecommitdiff
path: root/Test/dafny0/ResolutionErrors.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-01-03 17:49:32 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2012-01-03 17:49:32 -0800
commitc7324d3b97252a60aba60cf77bdb64ebb206c6c3 (patch)
tree170a2140a88794e28609e20c2b904615c42ad3ac /Test/dafny0/ResolutionErrors.dfy
parent8ea7e9e82fef906f1a4727c48a292b8f93e51760 (diff)
Dafny: don't allow ghost expressions in print statements
Diffstat (limited to 'Test/dafny0/ResolutionErrors.dfy')
-rw-r--r--Test/dafny0/ResolutionErrors.dfy8
1 files changed, 8 insertions, 0 deletions
diff --git a/Test/dafny0/ResolutionErrors.dfy b/Test/dafny0/ResolutionErrors.dfy
index e5e56d03..34cfc762 100644
--- a/Test/dafny0/ResolutionErrors.dfy
+++ b/Test/dafny0/ResolutionErrors.dfy
@@ -309,3 +309,11 @@ method DatatypeDestructors(d: DTD_List) {
var g1 := d.g; // error: cannot use ghost member in non-ghost code
}
}
+
+// ------------------- print statements ---------------------------------------
+
+method PrintOnlyNonGhosts(a: int, ghost b: int)
+{
+ print "a: ", a, "\n";
+ print "b: ", b, "\n"; // error: print statement cannot take ghosts
+}