Skip to content

[red-knot] Incorrect syntax error persistent in playground #17276

@sharkdp

Description

@sharkdp

This is something that happened to me a few times. It's always the same situation. I add a return type annotation by typing -> … after a function definition, and then I'm left with a syntax error that shouldn't be there:

Image

How to reproduce:

Seems to be related to there being another diagnostic as well. If you type -> int, it works fine. If you do random other changes to that file, the error often goes away. For example, if you select all text, cut it, and paste it back in, the error is gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplaygroundA playground-specific issuetyMulti-file analysis & type inference

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions