```
do {
X
if (B) break;
} while (A)
```
to
```
do {
X
} while (!B && A)
```
Add inversion that takes boolean expression and applies negation to it, simplifying if possible (like !!a => a).
```
do {
guard: {
// do something
break guard;
// do something
}
} while (condition)
```
to
```
do {
// do something
continue;
// do something
} while (condition)
```
- move source vs binary equivalent call filtering hack to
ResolutionResultsHandler (see c4778bfe5a for
the original commit introducing this behavior)
- rewrite the algorithm so that it doesn't need noDuplicates in the beginning:
modulo the hack above whish is only needed in ResolutionResultsHandler,
descriptor equivalence is checked anyway in OverrideResolver#overrides
It was not needed because overridability in both ways is already checked in
DescriptorEquivalenceForOverrides, which is called in
OverrideResolver#overrides
As well as for other kinds of expressions
Within attached test they were generated twice in case of last expression of coroutine block,
because coroutine related codegen part is built upon assumption that all expressions should be generated lazily
Also add a test about unary postfix increment/decrement
#KT-13156 Fixed
It's valid situation when user in Gradle project had created ordinal Java module and wants to configure
it with Kotlin. We should add Gradle library to dependency but there's no need to configure sources for it.
Confirmed reproduction steps:
1. Open Kotlin gradle project (or do the sync) - it will be considered unconfigured until synchronisation is finished
2. Click configure and see Choose Configuration popup
3. Wait sync is finished
4. Click proposed configurator in popup
As all projects are considered configured now, single module selection will be empty
Following the TODO in CallableReferencesResolutionUtils.kt, delete the
suspicious scope and use the new resolution process with the qualifier which
was obtained after the resolution of LHS. However, by default the tower
resolution algorithm also considers each qualifier as a class value as well,
which would be wrong here because resolution of LHS as a "value" happens
earlier in DoubleColonExpressionResolver and with slightly different rules. To
avoid that, do not mix in the "explicit receiver" scope tower processor when
creating processors for callable reference resolution.
Also delete unused functions and classes related to deleted scope, refactor
Scopes.kt
#KT-8596 Fixed
Try resolving the LHS only when it looks (PSI-wise) like it could represent a
type element. This, for example, allows "illegal selector" error to be reported
on weird expressions like '""?.""::class'.
Also remove expression text from the "illegal selector" diagnostic, it's not
needed and can screw up the error message if the text is too big