-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug related to abstract imports and match expressions (#5811)
Fixes #5808 ### Description - Add a call to `new MatchFlattener(reporter).PostResolve(module);` after cloning elements for abstract imports, so `.Flattened` is set. - Fix the behavior of the `afterChildren` parameter in `Node.Visit`, so that closure is actually only called after the children are visited. ### How has this been tested? Added a CLI test <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
c538717
commit cde4a05
Showing
6 changed files
with
80 additions
and
37 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
14 changes: 14 additions & 0 deletions
14
...IntegrationTests/TestFiles/LitTests/LitTest/patterns/abstractModuleAndMatchFlattening.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" | ||
abstract module FooM { | ||
|
||
method Foo(x: int) returns (r: int) modifies match x { case 0 => {} case _ => {} } ensures r == 3 | ||
} | ||
|
||
abstract module Bla { | ||
import Operations : FooM | ||
|
||
method Foo(x: int) returns (r: int) { | ||
r := Operations.Foo(3); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...tionTests/TestFiles/LitTests/LitTest/patterns/abstractModuleAndMatchFlattening.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 1 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 @@ | ||
Enable abstract imports to work well with match expression that occur in specifications |