Skip to content

Crash when triggering completions in unreachable match cases #642

@sharkdp

Description

@sharkdp

I tried to trigger this in the corpus tests and the LSP server, but didn't manage to do so, so reporting as a playground problem for now:

Start with https://play.ty.dev/089aad00-e47d-4076-bc45-c9c9f4293f81 and then type if after the 1 in the match case:

match 0:
    case 1:  # try to add ` if …` after the `1` here
        pass

This crashes with "entered unreachable code: If we have at least one declaration, the scope-start should not be definitely visible".

This seems to be triggered by auto-completions. When starting with https://play.ty.dev/e0c377ca-5e64-4478-86a2-8c6f11f31ee8

match 0:
    case 1 i:
        pass

there is no crash. But when I explicitly trigger the autocompletions using ctrl-space after the i, I get the same crash.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletionsBugs or features relating to autocomplete suggestionsfatala fatal error (panic or crash)serverRelated to the LSP server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions