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

Maybe/else pattern erroneously triggering 'bound variable in pattern' error #1527

Open
eproxus opened this issue Jun 19, 2024 · 1 comment · May be fixed by #1531
Open

Maybe/else pattern erroneously triggering 'bound variable in pattern' error #1527

eproxus opened this issue Jun 19, 2024 · 1 comment · May be fixed by #1531
Labels
bug Something isn't working

Comments

@eproxus
Copy link

eproxus commented Jun 19, 2024

Describe the bug
A Bound variable in pattern: Var error is generated for maybe expressions that bind a variable in their else patterns:

foo() ->
    maybe
        foo ?= bar()
    else
        e = Error -> Error
          % ^- Bound variable in pattern: Error
    end.

To Reproduce
Use the code above.

Expected behavior
No 'bound variable in pattern' hint is generated.

Actual behavior
A 'bound variable in pattern' hint is generated even though the variable is not already bound.

Context

  • erlang_ls version (tag/sha): Version: 0.52.0+build.1987.ref8700e96
  • Editor used: Zed v0.139.3
  • LSP client used: Zed v0.139.3
@eproxus eproxus added the bug Something isn't working label Jun 19, 2024
@MarkoMin
Copy link
Contributor

Can confirm it on the same version, but in nvim v0.9.4 editor and coc 0.0.82 LSP client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants