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 ranges include non-relevant places #3176

Open
MikaelMayer opened this issue Dec 11, 2022 · 0 comments
Open

Error ranges include non-relevant places #3176

MikaelMayer opened this issue Dec 11, 2022 · 0 comments
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: language server Support for LSP in Dafny (server part; client is in ide-vscode repo)

Comments

@MikaelMayer
Copy link
Member

MikaelMayer commented Dec 11, 2022

Dafny version

3.10.0

Code to produce this issue

datatype Option<T> = Some(T) | None

function orElse(t: Option<nat>, replacement: Option<nat> := None): Option<nat> {
  match t {
    case Some(x) => t
    case None => replacement
  }
}

function test(t: Option<Option<nat>>): Option<nat> {
  match t {
    case Some(x) =>
      assert None == orElse(x);
      orElse(x, Some(0))
    case None => Some(0)
  }
}

Command to run and resulting output

Just run in the latest VSCode

What happened?

The "None" seems to be part of the reported error, which creates an underline that spans way before the actual error.
image

The error goes away if I explicit the parameter:
image

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

Windows but it's likely not relevant

@MikaelMayer MikaelMayer added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) labels Dec 11, 2022
@keyboardDrummer keyboardDrummer added the during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program label Feb 7, 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: language server Support for LSP in Dafny (server part; client is in ide-vscode repo)
Projects
None yet
Development

No branches or pull requests

2 participants