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:

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.
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:How to reproduce:
-> strExpected ':', found '-' (invalid-syntax)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.