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

Error when guarding nonexistent this #5523

Closed
fabiomadge opened this issue Jun 4, 2024 · 0 comments · Fixed by #5524
Closed

Error when guarding nonexistent this #5523

fabiomadge opened this issue Jun 4, 2024 · 0 comments · Fixed by #5524
Labels
during 2: compilation of correct program Dafny rejects a valid program during compilation kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label lang: c# Dafny's C# transpiler and its runtime release-blocker Must be resolved before the next release

Comments

@fabiomadge
Copy link
Collaborator

Dafny version

master

Code to produce this issue

function Loop(xs: seq<()>): ()
{
  if |xs| == 0
  then ()
  else
    var _: bool -> bool := e => e;
    Loop(xs[1..])
}

method Main(){
    print Loop([(), ()]), "\n";
}

Command to run and resulting output

dafny -compileTarget:cs -spillTargetCode:3 [file].dfy

What happened?

#5474 introduced a guarding mechanism for this when doing tail call elimination. This change didn't take the case into account when there can be no this, like outside of a class.

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

Mac

@fabiomadge fabiomadge added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label lang: c# Dafny's C# transpiler and its runtime during 2: compilation of correct program Dafny rejects a valid program during compilation labels Jun 4, 2024
@fabiomadge fabiomadge added the release-blocker Must be resolved before the next release label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
during 2: compilation of correct program Dafny rejects a valid program during compilation kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label lang: c# Dafny's C# transpiler and its runtime release-blocker Must be resolved before the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant