-
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: Expect that subset-type base type can be a non-reference trait
- Loading branch information
1 parent
6fd41c7
commit 58921cc
Showing
5 changed files
with
25 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946b.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,7 @@ | ||
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --general-traits=legacy | ||
|
||
trait GeneralTrait { } | ||
trait ReferenceTrait extends object { } | ||
|
||
type SubsetType = x: GeneralTrait | true // error: cannot find witness (tried null) | ||
type Reference = x: ReferenceTrait | true // error: cannot find witness (tried null) |
4 changes: 4 additions & 0 deletions
4
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946b.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,4 @@ | ||
git-issue-4946b.dfy(6,5): Error: trying witness null: value of expression (of type 'GeneralTrait?') is not known to be an instance of type 'GeneralTrait', because it might be null | ||
git-issue-4946b.dfy(7,5): Error: trying witness null: value of expression (of type 'ReferenceTrait?') is not known to be an instance of type 'ReferenceTrait', because it might be null | ||
|
||
Dafny program verifier finished with 0 verified, 2 errors |
7 changes: 7 additions & 0 deletions
7
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946c.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,7 @@ | ||
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --general-traits=datatype | ||
|
||
trait GeneralTrait { } | ||
trait ReferenceTrait extends object { } | ||
|
||
type SubsetType = x: GeneralTrait | true // error: cannot find witness (didn't try anything) | ||
type Reference = x: ReferenceTrait | true // error: cannot find witness (tried null) |
4 changes: 4 additions & 0 deletions
4
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946c.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,4 @@ | ||
git-issue-4946c.dfy(6,5): Error: cannot find witness that shows type is inhabited; try giving a hint through a 'witness' or 'ghost witness' clause, or use 'witness *' to treat as a possibly empty type | ||
git-issue-4946c.dfy(7,5): Error: trying witness null: value of expression (of type 'ReferenceTrait?') is not known to be an instance of type 'ReferenceTrait', because it might be null | ||
|
||
Dafny program verifier finished with 0 verified, 2 errors |