Otherwise this brings incompatibility between kotlin-reflect 1.3.70+ and
kotlin-stdlib 1.3.60-.
This commit reverts the relevant parts of c164745301, 5c89f2fa54 and
896512f7cd.
We still had backup way to recalculate things for the case when fix
is not available. So if error is not importable, or we have second
error, which will be outdated after adding first import, we could get
freezes. 2019.2 and 2019.1 have different APIs, so it's implemented in
different way.
#KT-30863 Fixed
Top-level initializers must be deserialized in the same order they
where in the original source file. Before this patch this rule might
be violated. Consider the following case:
// lib1.kt
val a = 5
val b = a * 5
// lib2.kt
fun foo() = println(b)
Compile both files into libraries and then link an application
against them. During deserialization of lib2 'b' will be added
to the deserialization queue of lib1. After that we will add 'a'
to this queue too. Thus 'b' and 'a' will be in a wrong order
in this queue resulting in a wrong order of corresponding
top-level initializers in a final executable.
This patch fixes this issue by adding all top-level initializers
to a deserialization queue before all other declarations.
- `invokeLater` is bad here, since `AnAction::update` must update action look immediately, not later in the future
- Because of `invokeLater`, `RunScratchAction` wasn't properly rendered in the context menu
- `invokeLater` was added in the a24da280ca to fix EA-210180
- EA-210180 is not reproducible; however, the main reason of the exception is that `AnAction::update` was called not from EDT, but from regular thread updating "Run From Here" (>>) gutter actions
- all exception under EA-210180 are from 1.3.50; my guess is that those exceptions were caused by changes in scratch editor implementation details and will not appear again; if they will, we will need to investigate them
- ^KT-34692 Fixed
- completion-ranking-kotlin jar used to be in the IDEA itself; thanks to new extension it can reside in the plugin from now on
- ML completion is turned off by default
- use `implementation` dependency because `completion-ranking-kotlin` is required during runtime
Consider a call like `select(1, "")`, the resulting type for it is
Comparable<Int & String> & Serializable.
After variable fixation, the compiler incorporates this type into the
constraint system to check for a contradiction, so it checks
applicability of argument to the resulting type.
In other words, for the above call it checks is
`Comparable<Int & String> & Serializable` subtype of `IntegerLiteralType`?
Which ends up in checking is `IntegerLiteralType` subtype of `Int & String`.
Before this commit, such check was leading to the false result, but
because of losing diagnostic (which was fixed in the previous commit:
29f591b1), there was no error
These changes allow us to accurately distinguish between statements and
expressions in the IR.
This also fixes the types of non-exhaustive conditional statements.
We should only insert a return statement at the end of a lambda or
function if the final statement is used as an expression (slice
USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).