-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Completing in front of the opaque type definition will cause the REPL to crash #5895
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
Labels
Comments
anatoliykmetyuk
added a commit
that referenced
this issue
May 1, 2019
The crashes happen due to the fact that in certain cases, certain trees get mispositioned during code completion. E.g. this happens with `opaque type T = Int` or `object Foo { type T = Int`. The tree spans are set incorrectly because repl doesn't set the sources of these trees correctly. Precisely, when typechecking on code completion, a virtual source is used. However, when parsing for autocompletion, a line source is used which is created by the parsing logic. This commit makes sure that REPL is consistent in its source choices when computing code completions.
anatoliykmetyuk
added a commit
that referenced
this issue
May 1, 2019
anatoliykmetyuk
added a commit
to dotty-staging/dotty
that referenced
this issue
May 1, 2019
The crashes happen due to the fact that in certain cases, certain trees get mispositioned during code completion. E.g. this happens with `opaque type T = Int` or `object Foo { type T = Int`. The tree spans are set incorrectly because repl doesn't set the sources of these trees correctly. Precisely, when typechecking on code completion, a virtual source is used. However, when parsing for autocompletion, a line source is used which is created by the parsing logic. This commit makes sure that REPL is consistent in its source choices when computing code completions.
anatoliykmetyuk
added a commit
to dotty-staging/dotty
that referenced
this issue
May 1, 2019
The crashes happen due to the fact that in certain cases, certain trees get mispositioned during code completion. E.g. this happens with `opaque type T = Int` or `object Foo { type T = Int`. The tree spans are set incorrectly because repl doesn't set the sources of these trees correctly. Precisely, when typechecking on code completion, a virtual source is used. However, when parsing for autocompletion, a line source is used which is created by the parsing logic. This commit makes sure that REPL is consistent in its source choices when computing code completions.
anatoliykmetyuk
added a commit
to dotty-staging/dotty
that referenced
this issue
May 1, 2019
The crashes happen due to the fact that in certain cases, certain trees get mispositioned during code completion. E.g. this happens with `opaque type T = Int` or `object Foo { type T = Int`. The tree spans are set incorrectly because repl doesn't set the sources of these trees correctly. Precisely, when typechecking on code completion, a virtual source is used. However, when parsing for autocompletion, a line source is used which is created by the parsing logic. This commit makes sure that REPL is consistent in its source choices when computing code completions.
anatoliykmetyuk
added a commit
that referenced
this issue
May 3, 2019
Fix #5895: REPL autocompletion crashes in certain cases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I press the
<TAB>
key in front ofopaque type
, the REPL crashes:Trying to complete in front of other definitions won't crash the REPL.
The text was updated successfully, but these errors were encountered: