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

Spurious Cyclic Datatype Dependency Warning #5356

Open
whonore opened this issue Apr 24, 2024 · 1 comment
Open

Spurious Cyclic Datatype Dependency Warning #5356

whonore opened this issue Apr 24, 2024 · 1 comment
Labels
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking priority: not yet Will reconsider working on this when we're looking for work

Comments

@whonore
Copy link

whonore commented Apr 24, 2024

Dafny version

4.6.0

Code to produce this issue

datatype Box<T> = Box(T)
datatype A = A(Box<int>)
datatype B = B(Box<A>)
const b: B := B(Box(A(Box(0))))

Command to run and resulting output

$ dafny verify test.dfy

test.dfy(3,9): Warning: because of cyclic dependencies among constructor argument types, no instances of datatype 'B' can be constructed
  |
3 | datatype B = B(Box<A>)
  |          ^

What happened?

Dafny warns that B has cyclic dependencies and can't be constructed, but there are no actual cycles and it can be constructed.

Possibly related to #4793 and #4819.

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

Mac

@whonore whonore added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Apr 24, 2024
@keyboardDrummer keyboardDrummer added during 2: compilation of correct program Dafny rejects a valid program during compilation priority: not yet Will reconsider working on this when we're looking for work priority: next Will consider working on this after in progress work is done part: resolver Resolution and typechecking and removed priority: not yet Will reconsider working on this when we're looking for work labels Apr 24, 2024
@keyboardDrummer
Copy link
Member

keyboardDrummer commented Apr 29, 2024

Marking this as broken documentation with regards to severity, since the code was not designed to accept this. However, I think it would be a better use of time to enable Dafny to accept this than to update the documentation.

@keyboardDrummer keyboardDrummer added during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program priority: not yet Will reconsider working on this when we're looking for work and removed during 2: compilation of correct program Dafny rejects a valid program during compilation priority: next Will consider working on this after in progress work is done labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking priority: not yet Will reconsider working on this when we're looking for work
Projects
None yet
Development

No branches or pull requests

2 participants