Commit Graph

58769 Commits

Author SHA1 Message Date
Andrey Uskov fd2b75e39b Fixed import of MPP project with single Android target
#KT-34639 Fixed
2019-10-31 21:39:18 +03:00
Andrey Uskov 5c3b00cd0c Improve performance of import in Android Studio
Improve performance of dependency tree calculation when module per
source set mode is disabled.
#KT-34663 Fixed
2019-10-31 21:39:16 +03:00
Alexander Udalov e8e04ca98e Do not use new stdlib API in reflection implementation
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.
2019-10-31 17:39:34 +01:00
Kirill Shmakov 72591e34b3 Support android_x64/86 in cinterop definitions 2019-10-31 18:35:06 +03:00
Alexander Podkhalyuzin 4c21b234b1 Fixed compilation in 191 2019-10-31 17:31:09 +03:00
Alexander Podkhalyuzin 7b8fbb5fea Fixed freezes with add unambiguous imports on the fly
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
2019-10-31 17:25:29 +03:00
Alexander Podkhalyuzin 24d620657b Java doesn't have extension methods, so we don't need to look
for imports for qualified references

#KT-26162 Fixed
2019-10-31 16:00:44 +03:00
Vyacheslav Gerasimov 95ac0e328f Build: Extract bootstrap teamcity url to parameter 2019-10-31 15:41:57 +03:00
Dmitry Gridin f641e2a139 RedundantRequireNotNullCallInspection: should use BodyResolveMode.PARTIAL_WITH_CFA instead of BodyResolveMode.PARTIAL
#KT-34672 Fixed
2019-10-31 19:24:37 +07:00
Dmitry Gridin 04c8c888ee KotlinLightCodeInsightFixtureTestCase: remove deprecated call for 193 2019-10-31 19:24:36 +07:00
Dmitry Gridin 17429d333e Create expect/actual should move cursor to target declaration
#KT-34411 Fixed
2019-10-31 19:24:36 +07:00
Mikhael Bogdanov 8e2943ae2a Temporary increase timeout to avoid NPE 2019-10-31 13:15:51 +01:00
Ilya Matveev 7c4033f0bf Deserializer: Fix initialization order
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.
2019-10-31 14:51:56 +03:00
Roman Artemev 78b29349c9 Fix lateinit isInitialized check in multi-file case 2019-10-31 14:45:15 +03:00
Toshiaki Kameyama d75b938089 Formatter: don't format elvis operator in string template
#KT-34049 Fixed
2019-10-31 18:34:42 +07:00
Roman Golyshev bcee8ce04b KT-34692: Invoke ScratchAction::update without invokeLater
- `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
2019-10-31 14:22:06 +03:00
Roman Golyshev 28ec74648e Use ML completion extension point from 193 platform
- 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
2019-10-31 13:37:38 +03:00
Mikhail Zarechenskiy b30a9e1d3e [NI] Remove capturing from supertypes during computation of CST 2019-10-31 11:32:05 +03:00
Mikhail Zarechenskiy e8907c078d [NI] Don't recreate subtyping context every time 2019-10-31 11:32:04 +03:00
Mikhail Zarechenskiy de009a2ff2 [NI] Minor, use singleton instead of creating anonymous object 2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy 77577dfa6f [FIR] Introduce ConeStubType to have subtyping for non-fixed variables
Currently, it's needed after changes in d7b47108f70a107818a04c8b8db33bfbf7c7e590

 Later it'll be also used for builder-inference
2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy 01ad9c47c8 [NI] Fix subtyping between integer literal types and intersection ones
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
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy e0fb586aaf [NI] Don't loose diagnostic after type variable fixation
#KT-24488 Fixed
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy ca8da22569 [NI] Improve CST algorithm to handle non-fixed variables
#KT-32456 Fixed
 #KT-32423 Fixed
 #KT-32818 Fixed
 #KT-33197 Fixed
2019-10-31 11:32:00 +03:00
Mikhail Zarechenskiy ba6648d535 Minor, reformat Annotations.kt file 2019-10-31 11:31:59 +03:00
Dmitry Petrov 2ff36c808e Minor: mute testEa35963 in WASM 2019-10-31 11:13:45 +03:00
Dmitry Petrov 8b2fdca706 FIR2IR: fix testData 2019-10-31 11:13:45 +03:00
Steven Schäfer b1b70e503c JVM IR: Improve codegen for try/catch statements 2019-10-31 11:13:44 +03:00
Steven Schäfer af74fd047a psi2ir: Consistently use type unit for statements
These changes allow us to accurately distinguish between statements and
expressions in the IR.

This also fixes the types of non-exhaustive conditional statements.
2019-10-31 11:13:44 +03:00
Steven Schäfer 0da4b06074 psi2ir: Fix return insertion
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).
2019-10-31 11:13:44 +03:00
Nikolay Krasko b3e733ea4f 193: More mutes in 193 (SurroundWithTestGenerated, KT-34689, KT-34542, KT-34672) 2019-10-31 11:11:50 +03:00
Nikolay Krasko f7c775a080 193: Mute tests for find usages in libraries in 193 (KT-34542) 2019-10-31 11:11:50 +03:00
Nikolay Krasko 7e5316b9f1 Fix completion test for Java in 193
It looks like java completion doesn't use () anymore.
2019-10-31 11:11:50 +03:00
Nikolay Krasko 42312c3060 Fix GradleConfiguratorTest.testProjectWithModule in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko 0d2e790b32 Fix IdeaModuleInfoTest.testSdkForScript in 193
There's automatic jdk 7 registration starting from 193.
2019-10-31 11:11:49 +03:00
Nikolay Krasko c9793e4bf4 Fix IdeaModuleInfo tests in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko 4ef063c656 Log information about failed test 2019-10-31 11:11:49 +03:00
Nikolay Krasko 201859be92 Mute RedundantRequireNotNullCall tests in 193 (KT-34672) 2019-10-31 11:11:49 +03:00
Nikolay Krasko bed2e21a1a Mute CoroutineNonBlockingontextDetectionTest tests in 193 (KT-34659) 2019-10-31 11:11:49 +03:00
Nikolay Krasko 1811b79503 Mute custom navigation tests (KT-34542) 2019-10-31 11:11:48 +03:00
pyos a835f07d51 JVM_IR: don't regenerate objects in lambdas inlined into objects 2019-10-31 09:09:54 +01:00
Ilya Goncharov eeadc95bc1 [Gradle, JS] Remove check on duplicated targets
Useful (for KT-33828), if provider of artifact has changed, but remained only one

#KT-33828 fixed
2019-10-31 10:46:17 +03:00
Kristoffer Andersen 1074a0ef69 JVM_IR: Fix Inline CallableReferences with Varargs
- Added tests to demonstrate broken behaviour: the interaction of inline
  functions and callable references with varargs and defaults in various
  combinations.
- Refactored InlineCallableReferencesToLambdaPhase to look like and use
  some of the infrastructure from CallableReferenceLowering.
- Lifted some of this infrastructure out to be broadly reusable.
2019-10-31 08:15:22 +01:00
Andrey Uskov 5360a7a3fe Fix GradleConfiguratorTest
Fixed naming of jdk platforms in mocks in order to pass IDE validation
2019-10-31 00:40:13 +03:00
Andrey Uskov 33cacb87d3 Fix import tests for IDE 183 2019-10-31 00:40:11 +03:00
Vladimir Dolzhenko 4b2834c4a8 Provide incremental analysis of a file when it is applicable
#KT32868 Fixed
2019-10-30 21:41:29 +01:00
Kirill Shmakov c7bd6d8ede Support watchos and tvos in cinterop definitions 2019-10-30 22:14:38 +03:00
Ilya Goncharov 08f9dd2aea [Gradle, JS] Fix entry for webpack (with Configuration Avoidance broke) 2019-10-30 18:58:56 +03:00
Dmitriy Novozhilov 6f91c0e679 [FIR] Don't check @ExtensionFunction in fir consistency tests 2019-10-30 18:49:12 +03:00
Dmitriy Novozhilov ad9bf62b2f [FIR] Remove adding annotations from bounds to type parameter in lightTree2Fir 2019-10-30 18:49:11 +03:00