Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation records should not include options for empty models #5459

Closed
robin-aws opened this issue May 17, 2024 · 0 comments · Fixed by #5475
Closed

Translation records should not include options for empty models #5459

robin-aws opened this issue May 17, 2024 · 0 comments · Fixed by #5475
Assignees
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny release-blocker Must be resolved before the next release

Comments

@robin-aws
Copy link
Member

When loading .dtr files, there is a check that a module does not appear more than once in any such file. But it is possible for a prefix module to appear in multiple libraries without any actual conflict (i.e. the module A.B in the snippet module A.B.C { ... }. The error you get when something like A.B appears multiple times is spurious.

The best deeper fix seems to be to not translate empty modules at all, since emitting a declaration of a target language module/package/etc will likely cause target language tooling errors as well.

@robin-aws robin-aws added the kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny label May 17, 2024
@robin-aws robin-aws self-assigned this May 17, 2024
@robin-aws robin-aws added the release-blocker Must be resolved before the next release label May 17, 2024
keyboardDrummer pushed a commit that referenced this issue May 22, 2024
### Description
Fixes #5459

Omits modules that only contain other modules from translation records,
since they can appear in multiple different separately-compiled
libraries when they are prefix modules (i.e. a module `A.B` that only
appears in a `module A.B.C { ... }` declaration).

I attempted to omit such modules from translation entirely at first, but
hit issues in the Go backend. It may be possible to do so in the future
with more care.

### How has this been tested?
Updated `DuplicateModules.dfy` to include parent modules.

<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny release-blocker Must be resolved before the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant