-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Termination override check for certain non-reference trait imple…
…mentations (#5087)
- Loading branch information
1 parent
5cf477a
commit 73fcdf3
Showing
5 changed files
with
75 additions
and
8 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
55 changes: 55 additions & 0 deletions
55
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4982.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,55 @@ | ||
// RUN: %testDafnyForEachResolver "%s" -- --general-traits:datatype | ||
|
||
trait Tr1 { | ||
function Decrease(): nat { | ||
0 | ||
} | ||
|
||
function F(): nat | ||
decreases Decrease() | ||
} | ||
|
||
datatype Dt1 extends Tr1 = Dt { | ||
function F(): nat | ||
decreases 0 | ||
{ | ||
0 | ||
} | ||
} | ||
|
||
trait Tr2<A> { | ||
function Decrease(): nat { | ||
0 | ||
} | ||
|
||
function F(): A | ||
decreases Decrease() | ||
} | ||
|
||
datatype Dt2 extends Tr2<nat> = Dt { | ||
function F(): nat | ||
decreases 0 | ||
{ | ||
0 | ||
} | ||
} | ||
|
||
trait ProgramTrait { | ||
function Rank(): nat | ||
|
||
method Compute() returns (r: Result) | ||
decreases Rank() | ||
} | ||
|
||
datatype Result = Bounce(next: ProgramTrait) | Done | ||
|
||
datatype Trivial extends ProgramTrait = Trivial | ||
{ | ||
function Rank(): nat { 0 } | ||
|
||
method Compute() returns (r: Result) | ||
decreases Rank() | ||
{ | ||
return Done(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4982.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 @@ | ||
|
||
Dafny program verifier finished with 10 verified, 0 errors |
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 @@ | ||
Termination override check for certain non-reference trait implementations |