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

parent modules break verification when included through project files #5650

Closed
erniecohen opened this issue Jul 28, 2024 · 2 comments · Fixed by #5651
Closed

parent modules break verification when included through project files #5650

erniecohen opened this issue Jul 28, 2024 · 2 comments · Fixed by #5651
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@erniecohen
Copy link

erniecohen commented Jul 28, 2024

Dafny version

4.6.0 (nightly 4/17)

Code to produce this issue

With the following files (all in the same directory), the dafny server fails on b.dfy.
(building the dfyconfig file works)

a.dfy: a {}
b.dfy: module a.b { method test() { assert true; }}
dfyconfig.toml: includes = ["*.dfy"]

Command to run and resulting output

No response

What happened?

verification should succeed.
more generally, there should be uniformity between the CLI and the Dafny server.

What type of operating system are you experiencing the problem on?

Mac

@erniecohen erniecohen added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Jul 28, 2024
@keyboardDrummer
Copy link
Member

A workaround for this problem is to declare nested modules in the same file as their parent module

keyboardDrummer added a commit that referenced this issue Jul 29, 2024
#5651)

Fixes #5650

### Description
Verification in the IDE now works correctly when declaring nested module
in a different file than their parent.

### How has this been tested?
Added an IDE 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>
@erniecohen
Copy link
Author

That workaround doesn't work so well when you have lots of nested modules (e.g., when they represent various implementations of an interface).

The workaround I've been using for module foo is to keep foo.dfy in the same folder, and to also add into the foo directory a dfyconfig.toml file of the form

base = "../dfyconfig.toml"
excludes = ["foo.dfy"]

This hides foo.dfy when building files under foo, while allowing foo.dfy (and all of the other files in the foo hierarchy) to be used by all modules that do not descend from foo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants