-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into decreasesto
- Loading branch information
Showing
14 changed files
with
148 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3320.dfy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" | ||
|
||
datatype Dt = A | B(b: set<nat>) | ||
|
||
function SetComprehension(s: seq<Dt>): set<nat> { | ||
set i, b | 0 <= i < |s| && s[i].B? && b in s[i].b && 1 != 2 :: b | ||
} | ||
|
||
function MapComprehension(s: seq<Dt>): map<int, int> { | ||
map i, b | 0 <= i < |s| && s[i].B? && b in s[i].b && 1 != 2 :: b := b | ||
} | ||
|
||
method Main() { | ||
var s := [A, B({0})]; | ||
print SetComprehension(s), "\n"; | ||
print MapComprehension(s), "\n"; | ||
} |
2 changes: 2 additions & 0 deletions
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3320.dfy.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{0} | ||
map[0 := 0] |
1 change: 1 addition & 0 deletions
1
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3320.dfy.rs.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHECK: error: expected identifier, found `<` |
44 changes: 44 additions & 0 deletions
44
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4684.dfy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" | ||
|
||
class C { | ||
var data: nat | ||
var next: C? | ||
|
||
constructor (n: nat) { | ||
data := n; | ||
if n == 0 { | ||
next := null; | ||
} else { | ||
next := new C(n - 1); | ||
} | ||
} | ||
|
||
function FWithoutTailRecursion(n: nat, g: () ~> int): int | ||
requires g.requires() | ||
reads * | ||
{ | ||
if n == 0 || next == null then | ||
g() | ||
else | ||
var h := () reads this => this.data; | ||
var r := next.FWithoutTailRecursion(n - 1, if n < 20 then g else h); | ||
r | ||
} | ||
|
||
function F(n: nat, g: () ~> int): int | ||
requires g.requires() | ||
reads * | ||
{ | ||
if n == 0 || next == null then | ||
g() | ||
else | ||
var h := () reads this => this.data; | ||
next.F(n - 1, if n < 20 then g else h) | ||
} | ||
} | ||
|
||
method Main() { | ||
var c := new C(25); | ||
print c.FWithoutTailRecursion(25, () => -1), "\n"; // 20 | ||
print c.F(25, () => -1), "\n"; // 20 | ||
} |
2 changes: 2 additions & 0 deletions
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4684.dfy.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
20 | ||
20 |
1 change: 1 addition & 0 deletions
1
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4684.dfy.rs.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHECK: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Unguarded enumeration of bound variables in set and map comprehensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Reference the correct `this` after removing the tail call of a function or method |