summaryrefslogtreecommitdiff
path: root/Test/dafny0/TypeParameters.dfy
diff options
context:
space:
mode:
authorGravatar rustanleino <unknown>2010-06-09 23:02:36 +0000
committerGravatar rustanleino <unknown>2010-06-09 23:02:36 +0000
commit9521767199e98aafb780421b859da3fb8773af42 (patch)
tree930872c273b4072ef18e00d5c05b7ce9652b539b /Test/dafny0/TypeParameters.dfy
parentbcd8949ab6d5bd86dc3e81226b1f936d05babfa4 (diff)
Dafny: Another bug fix in SplitExpr, having to do with generic results of function calls
Diffstat (limited to 'Test/dafny0/TypeParameters.dfy')
-rw-r--r--Test/dafny0/TypeParameters.dfy22
1 files changed, 21 insertions, 1 deletions
diff --git a/Test/dafny0/TypeParameters.dfy b/Test/dafny0/TypeParameters.dfy
index e199a386..61a0019b 100644
--- a/Test/dafny0/TypeParameters.dfy
+++ b/Test/dafny0/TypeParameters.dfy
@@ -103,7 +103,7 @@ static function IsCelebrity<Person>(c: Person, people: set<Person>): bool;
requires c == c || c in people;
method FindCelebrity3(people: set<int>, ghost c: int)
- requires IsCelebrity(c, people);
+ requires IsCelebrity(c, people); // once upon a time, this caused the translator to produce bad Boogie
{
ghost var b: bool;
b := IsCelebrity(c, people);
@@ -112,3 +112,23 @@ method FindCelebrity3(people: set<int>, ghost c: int)
static function F(c: int, people: set<int>): bool;
requires IsCelebrity(c, people);
+
+function RogerThat<G>(g: G): G
+{
+ g
+}
+
+function Cool(b: bool): bool
+{
+ b
+}
+
+method IsRogerCool(n: int)
+ requires RogerThat(true); // once upon a time, this caused the translator to produce bad Boogie
+{
+ if (*) {
+ assert Cool(2 < 3 && n < n && n < n+1); // the error message here will peek into the argument of Cool
+ } else if (*) {
+ assert RogerThat(2 < 3 && n < n && n < n+1); // same here; cool, huh?
+ }
+}