forked from dafny-lang/dafny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test and fix bug for 3797 (dafny-lang#3800)
Fixes dafny-lang#3797 <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
- Loading branch information
1 parent
c2a2dfc
commit 768e7c2
Showing
4 changed files
with
17 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
git-issue-283g.dfy(20,21): Error: the type of the pattern (int) does not agree with the match expression (string) | ||
git-issue-283g.dfy(35,7): Error: incorrect argument type for datatype constructor parameter 'value' (expected int, found real) | ||
git-issue-283g.dfy(32,14): Error: the type of the pattern (int) does not agree with the match expression (real) | ||
git-issue-283g.dfy(41,14): Error: the type of the pattern (int) does not agree with the match expression (real) | ||
3 resolution/type errors detected in git-issue-283g.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,14 @@ | ||
// RUN: %verify "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
newtype uint16 = x | 0 <= x < 0x1_0000 | ||
datatype D = A | B | ||
|
||
method M(x: D, u: uint16) returns (r: uint16) { | ||
var v := 5; | ||
match x { | ||
case A => r := 12; | ||
case B => r := 13; | ||
} | ||
r := v; | ||
} |
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 2 verified, 0 errors |