Commit Graph

62124 Commits

Author SHA1 Message Date
Mikhail Glukhikh 17b473fcb6 FirTowerResolver: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh f1a418373c RawFirBuilder: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh e66d6a8954 [FIR] ClassWrapper: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh bbf448b39d [FIR] Change visibility of default sealed class constructor to private 2020-02-19 22:41:23 +03:00
Mikhail Glukhikh 14fd1d3c9f [FIR] Check visibility correctly for sealed class in file 2020-02-19 22:41:23 +03:00
Mikhail Glukhikh ace259314b Use 'symbol' instead of 'classId' in FirResolvedQualifier
This commit solves problem with resolved qualifier of local class
#KT-36758 Fixed
2020-02-19 22:41:23 +03:00
Mark Punzalan 3d51af2935 [JVM IR] Fix issue with suspend functions with @JvmOverloads. 2020-02-19 16:48:53 +01:00
Mikhail Glukhikh c289612e57 [FIR] Remove debugging println in tree generator 2020-02-19 18:14:45 +03:00
Mikhail Glukhikh a4c4b2650c FIR2IR: remove hacky & redundant resolve of delegating constructor calls 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh 82c8b5f368 [FIR] Eliminate isNotSAM optimization as ineffective (see dc4f332c) 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh 9017654b9d [FIR] Handle default parameters when checking callable reference type
#KT-36759 Fixed
2020-02-19 18:09:06 +03:00
Mikhail Glukhikh 04e6c63cc9 FirSymbolProvider: minor cleanup 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh 1376dbf9cf Remove unused 'dispatchReceiverValue()' from FIR tower levels 2020-02-19 18:09:05 +03:00
Mikhail Glukhikh e051251b27 FIR: set isOperator only for Java methods with appropriate names
#KT-35133 Fixed
2020-02-19 18:09:04 +03:00
Mikhail Zarechenskiy cbbbf40b90 [NI] Fix isSuccessful property for member with LowPriority resolution
The problem was introduced in e40ba73950
2020-02-19 18:06:22 +03:00
simon.ogorodnik 8ca2aa47f8 [FIR] Remove duplicated code 2020-02-19 17:53:44 +03:00
simon.ogorodnik c29c140a9c [FIR] Qualifier resolve 2020-02-19 17:53:44 +03:00
Sergey Igushkin 723ebb4f57 Fix compileOnly dependencies in HMPP (KT-36469)
The `compileOnly` configuration of a source set was not included in the
granular dependency transformation, which led to the dependencies from
the configuration being excluded as unrequested during dependency
processing.

Fix this by properly including the compileOnly scope into the
dependencies transformation.

Issue #KT-36469 Fixed
2020-02-19 17:30:46 +03:00
Sergey Igushkin 9b861739cd Include the production artifacts in friend paths (KT-35942)
In some setups, the friendArtifacts that we had in addition to direct
associate compilations' output classes were insufficient. For example:

1. When an Android module's tests depend on another module which
   transitively depends on the module containing tests: then the AGP
   API doesn't tell us that there are artifacts from the tested
   variant, but instead there's just the module's artifact.

2. Similar case but without Android, and if the classes are read from
   the module's artifact rather than the production output classes dir,
   then they are definitely not on the friend paths (which include the
   production classes dirs and not the the production artifact).

In both cases, the friendArtifacts mechanism allows us to add those
potential sources of the friend classes to the friend paths.

Issue #KT-35942 Fixed
2020-02-19 17:30:45 +03:00
Vladimir Dolzhenko 4eb04af01e Add checkStability to perf tests 2020-02-19 15:26:19 +01:00
Denis Zharkov a6cf16ddfc FIR: Fix test data for FirMultiModuleResolveTestGenerated 2020-02-19 17:21:11 +03:00
Roman Golyshev 46ae6136cb Rewrite RedundantSamConstructorInspection to support more cases
- Now inspection does not rely on synthetic descriptors at all, instead
it uses `SamConversionOracle` and `SamConversionResolver` to detect
if the argument type support SAM conversion
- This transparently considers all language features like
`SAM conversions for kotlin functions`, `Functional interfaces` etc.
- In case of multiple SAM arguments, part of them can be converted only
when `SAM conversion per argument` is enabled
- Fix inspection and nj2k tests that were failing because of better
working inspection
- Rewrite automatically fixes multiple bugs that were present
- ^KT-36367 ^KT-36368 ^KT-36296 ^KT-36395 Fixed
2020-02-19 17:16:17 +03:00
Roman Golyshev 9b5110b9f3 Refactor RedundantSamConstructorInspection
- Does not change the behaviour
2020-02-19 17:16:17 +03:00
Roman Golyshev 3122760c49 Add more tests for RedundantSamConstructorInspection
- All those tests already pass, they are needed to fix the behaviour of the inspection before the changes
2020-02-19 17:16:17 +03:00
Victor Petukhov e8524137c3 NI: exclude not fixed type variables from types on which null checks should be generated
^KT-36371 Fixed
2020-02-19 15:58:08 +03:00
Victor Petukhov f10696da5e Fix formatting of RuntimeAssertion.kt 2020-02-19 15:58:08 +03:00
Denis Zharkov 6793b27330 FIR: Optimize Java types mapping
- Avoid duplicated computations for arguments
- Do not recreate types if they weren't enhanced
2020-02-19 15:53:34 +03:00
Denis Zharkov c8269baa92 FIR: Fix NI handling flexible type bounds 2020-02-19 15:53:34 +03:00
Denis Zharkov 2ad8488e6a FIR: Rewrite Java type mapping
Previoisly, there were two places where mapping had happened:
- toConeKotlinTypeWithNullability
- enhancePossiblyFlexible

The first one was used for supertypes and bounds and the second one
was used for other signature parts

The main idea is to perform type mapping once to a flexible type,
and then use it as it's needed (it's lower bound, or for the further ehnancement)

Also, this commit fixes flexibility for type arguments, see the tests
2020-02-19 15:53:34 +03:00
Victor Petukhov 748a326104 NI: Discard definitely not-null types inside invariant positions during inference process
^KT-36816 Fixed
2020-02-19 15:32:12 +03:00
Roman Golyshev 36f4b6daf3 Update completion-ranking-kotlin dependency 2020-02-19 14:16:48 +03:00
pyos 3080b4c435 JVM_IR: remove a suspend-related hack from BridgeLowering
`invoke` in suspend lambdas overrides FunctionN.invoke, so the
refactored BridgeLowering already generates correct bridges there.
All the hack does is break overrides of interface suspend methods.
2020-02-19 11:26:45 +01:00
Steven Schäfer ba90e87756 JVM, JVM IR: Fix assertion status for regenerated anonymous objects
We always set the $assertionsDisabled field based on the top-level
enclosing class. This means that for anonymous objects we have to
rewrite the call to Class.desiredAssertionStatus.
2020-02-19 11:23:24 +01:00
Steven Schäfer 272f6abe69 JVM IR: Fix suspend lambda generic signatures 2020-02-19 11:18:27 +01:00
pyos e6efb81014 JVM_IR: inline findSuspendAndInlineLambdas 2020-02-19 10:47:27 +01:00
pyos 5d603a8be4 JVM_IR: detect lambdas capturing crossinline through fields 2020-02-19 10:47:27 +01:00
Ilya Kirillov 285aa123b7 New J2K: fix testdata 2020-02-19 12:02:32 +03:00
Ilya Kirillov 17a0e3a078 New J2K: do not call custom diagnostic fixes in EDT as they may have resolve inside 2020-02-19 12:02:31 +03:00
Ilya Kirillov 810966e408 New J2K: call reformat code & shorten references processings only single time 2020-02-19 12:02:30 +03:00
Ilya Kirillov ee0ec421ce New J2K: do not print Unit types 2020-02-19 12:02:29 +03:00
Ilya Kirillov 6c1e2cc196 New J2K: disable additional post-formatting for J2K
As there is a formatting processing, it's not needed but takes some time
2020-02-19 12:02:28 +03:00
Ilya Kirillov 85be0450ba Fix invalidated element access exception in ObjectLiteralToLambdaIntention
#KT-36149 fixed
#KT-36152 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov 6b913da698 New J2K: Fix super call to Kotlin class with implicit constructor
#KT-36159 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov 7c586ce736 New J2K: Fix converting recursive types
#KT-36088 fixed
2020-02-19 12:02:26 +03:00
Pavel Semyonov 6982db7d02 chore: improved UI texts for new project wizard 2020-02-19 12:00:30 +03:00
Dmitry Petrov 0b9b1b6945 Update bytecode text tests for JVM_IR 2020-02-18 22:51:29 +03:00
Denis Zharkov aac72871e7 Fix UI freezes caused by calls with a huge number overloads
While we have an overload resolution algorithm working for O(n^2),
call resolution for the single particular call may work more then just
a second.
Thus, we need to call ProgressManager.checkCanceled() with more granularity

^KT-35135 Fixed
2020-02-18 20:07:14 +03:00
Denis Zharkov 842e2dc02f Optimize retaining most specific methods in LazyJavaScope
See 62a55b7b00
Previously, it was working for O(n^2)
Now, we first group it by jvm descriptor,
then for each groups of size g_i finding the most specific for O(g_i^2)

It should help for the cases when we have a lot of overloads with
different JVM descriptors (modulo return type)
NB: Having the same JVM descriptors is rather rare, because
in Java one cannot generate such a class.

Looks like it's only possible for Scala or some other JVM languages (KT-17560)

It should help a lot for KT-35135
2020-02-18 20:07:13 +03:00
Denis Zharkov d06e35b061 Minor. Reformat overridingUtils.kt 2020-02-18 19:59:56 +03:00
Pavel Kirpichenkov a50911156d [NI] Add regression tests for builder inference
Actual fix is c02dd720
^KT-33542 Fixed
^KT-33544 Fixed
^KT-36446 Fixed
2020-02-18 19:12:53 +03:00