-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-4939
# Conflicts: # Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeTests.dfy.expect # Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2139.dfy.expect
- Loading branch information
Showing
21 changed files
with
117 additions
and
32 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
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
8 changes: 4 additions & 4 deletions
8
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2134.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
9 changes: 6 additions & 3 deletions
9
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2303.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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
// RUN: %exits-with 2 %verify "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" | ||
|
||
|
||
module A { | ||
newtype int0 = x | true // newtype's base type is not fully determined; add an explicit type for 'x' | ||
} | ||
|
||
module B { | ||
newtype int0 = x | true | ||
newtype int0 = y | true | ||
const x: int0 := 0 // type for constant 'x' is 'int0', but its initialization value type is 'int' | ||
} | ||
|
||
module C { | ||
type int0 = x | true // subset type's base type is not fully determined; add an explicit type for 'x' | ||
} |
5 changes: 3 additions & 2 deletions
5
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2303.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
git-issue-2303.dfy(5,10): Error: newtype's base type is not fully determined; add an explicit type for 'x' | ||
git-issue-2303.dfy(5,10): Error: newtype's base type is not fully determined; add an explicit type for bound variable 'x' | ||
git-issue-2303.dfy(10,8): Error: type for constant 'x' is 'int0', but its initialization value type is 'int' | ||
2 resolution/type errors detected in git-issue-2303.dfy | ||
git-issue-2303.dfy(14,7): Error: subset type's base type is not fully determined; add an explicit type for bound variable 'x' | ||
3 resolution/type errors detected in git-issue-2303.dfy |
5 changes: 5 additions & 0 deletions
5
.../IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2303.dfy.refresh.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,5 @@ | ||
git-issue-2303.dfy(5,10): Error: newtype's base type is not fully determined; add an explicit type for bound variable 'x' | ||
git-issue-2303.dfy(9,10): Error: newtype's base type is not fully determined; add an explicit type for bound variable 'y' | ||
git-issue-2303.dfy(10,19): Error: integer literal used as if it had type int0 | ||
git-issue-2303.dfy(14,7): Error: subset type's base type is not fully determined; add an explicit type for bound variable 'x' | ||
4 resolution/type errors detected in git-issue-2303.dfy |
20 changes: 20 additions & 0 deletions
20
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946a.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,20 @@ | ||
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits=datatype | ||
|
||
trait ProgramTrait { | ||
method Compute() returns (r: Result) | ||
} | ||
|
||
type Program = ProgramTrait | true // error: 'ProgramTrait' is a bound variable here, and its type is undetermined | ||
|
||
datatype Result = | ||
| Bounce(next: Program) | ||
| Done() | ||
|
||
datatype Trivial extends ProgramTrait = | ||
Trivial() | ||
{ | ||
method Compute() returns (r: Result) | ||
{ | ||
return Done(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946a.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 @@ | ||
git-issue-4946a.dfy(7,5): Error: subset type's base type is not fully determined; add an explicit type for bound variable 'ProgramTrait' | ||
1 resolution/type errors detected in git-issue-4946a.dfy |
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 |
9 changes: 9 additions & 0 deletions
9
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946d.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,9 @@ | ||
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --general-traits=datatype --general-newtypes | ||
|
||
type Small = x: int | 0 <= x < 10 | ||
|
||
newtype NewProgram = Small | true // error: 'Small' is a bound variable here, and its type is undetermined | ||
|
||
datatype Result = | ||
| NewBounce(newNext: NewProgram) | ||
| Done() |
2 changes: 2 additions & 0 deletions
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4946d.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 @@ | ||
git-issue-4946d.dfy(5,8): Error: newtype's base type is not fully determined; add an explicit type for bound variable 'Small' | ||
1 resolution/type errors detected in git-issue-4946d.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,3 @@ | ||
Fix: check that subset-type variable's type is determined (resolver refresh). | ||
Fix crash in verifier when there was a previous error in determining subset-type/newtype base type. | ||
Fix crash in verifier when a subset type has no explicit `witness` clause and has a non-reference trait as its base type. |