-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Optimize datatype wrappers only in the absence of trait parents (#…
…5234) This PR makes two changes to when the "erase datatype wrapper" optimization is engaged. * The optimization is disabled if the datatype implements any traits. (Previously, the optimization was still allowed under this condition, which had caused malformed code, see issue #5233.) * Allow the optimization in the presence of ghost fields. (Previously, the optimization was disabled if the datatype contained _any_ fields. But ghost fields pose no problems for compilation.) Fixes #5233 ### How has this been tested? The tests (including the test case from the bug report) were added to `comp/ErasableTypeWrappers.dfy`. <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
09f8292
commit ece9b76
Showing
4 changed files
with
43 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: Disable the "erase datatype wrappers" optimization if the datatype implements any traits. | ||
feat: Allow the "erase datatype wrappers" optimization if the only fields in the datatype are ghost fields. |