Commit Graph

60590 Commits

Author SHA1 Message Date
Sergey Igushkin ffa2f97d2c Deprecate 1.2.x MPP Gradle plugins
Issue #KT-31570 Fixed
2020-01-16 00:02:47 +03:00
Sergey Igushkin f9acc0ab88 Support Gradle instant execution for Kapt tasks
* In the Kotlin/JVM tasks, move the compiler arguments setup logic to
  a separate class, so that it can be reused by the Kapt tasks without
  directly referencing the Kotlin/JVM tasks

* In the Kapt tasks, carefully capture the values using the Provider API
  so that the task can be serialized for Instant Execution and then
  deserialized and executed without relying on the project model

Issue #KT-35181 Fixed
2020-01-15 23:53:49 +03:00
Dmitriy Novozhilov 5111d1721a [TEST] Add js runtime to failing box test 2020-01-15 22:12:29 +03:00
Dmitriy Novozhilov a3037a081e [NI] Fix resolve of lambdas with expected function type with receiver
#KT-30245
2020-01-15 22:12:29 +03:00
Dmitriy Novozhilov 7733611c47 [TEST] Replace Experimental with OptIn in testdata 2020-01-15 22:12:28 +03:00
Dmitriy Novozhilov 04ce10b6c1 [NI] Improve completing callable references with type variable as expected type
#KT-32462 Fixed
2020-01-15 22:12:28 +03:00
Alexander Udalov 6fe214d825 JVM IR: fix handling of suspend extension lambdas with captured receiver
The problem in the added test was that a suspend lambda was represented
by a function reference with a bound argument for the ObjectRef value,
and the corresponding parameter was not the first parameter of the
referenced local function. This happens because
LocalDeclarationsLowering lifts the local function up and adds a
new parameter for the captured ObjectRef (which is bound at the call
site), but the original receiver parameter remains the first unbound
parameter. So, it's no longer correct to rely on the fact that all bound
parameters of a function reference are located in the beginning of the
parameter list, which was kind of assumed in the `withIndex` call in
`AddContinuationLowering.addCreate`.
2020-01-15 19:42:13 +01:00
Alexander Udalov f45ca7acd3 Add -Xno-use-ir to override useIR flag for custom-built compiler 2020-01-15 19:39:07 +01:00
Ilmir Usmanov 4fa8266606 Unconditionally remove $$forInline suffix from enclosing method
when transforming objects with suspend functions/lambdas, which
capture crossinline suspend lambdas. Since functions with the
suffix have a counterpart without the suffix, for java interop
and reflection call purposes, it is safe change.
 #KT-31242 Fixed
2020-01-15 15:12:26 +01:00
Mikhail Glukhikh 7bcd3c4c13 [FIR] Introduce & use FirScopeProvider.getStaticMemberScopeForCallables 2020-01-15 16:52:13 +03:00
Mikhail Glukhikh aaace40912 [FIR] Split Receiver/ReceiverValue, QualifierReceiver/ExpressionReceiver 2020-01-15 16:52:13 +03:00
Mikhail Glukhikh 42ba54fffd [FIR] Add test for qualifier resolve priority 2020-01-15 16:52:12 +03:00
Mikhail Glukhikh cef71b0349 [FIR] Add static / companion ambiguity to test data
This is temporary test data change until we prioritize this properly
2020-01-15 16:52:12 +03:00
Mikhail Glukhikh f0ced642d9 [FIR] Use static & qualified scopes to access qualified callables
This commit provides more correct logic for creating scopes based
on FirResolvedQualifier & eliminates QualifiedReceiverTowerDataConsumer
2020-01-15 16:52:12 +03:00
Dmitry Petrov 6bbfb2ffe9 JVM: add tests for companion object accessor generation 2020-01-15 16:40:06 +03:00
Dmitry Petrov 3d85e5da5f Enable ProperVisibilityForCompanionObjectInstanceField in 1.4 2020-01-15 16:40:06 +03:00
pyos 02722e0238 JVM_IR: mark the exception local as live only after the store
Otherwise, should the local coincide with another one, the incorrect
range causes D8 to generate invalid bytecode in debug mode.
2020-01-15 14:35:15 +01:00
Denis Zharkov bcad6aeda6 Fix project compilation after fix for KT-35920
See KT-35931 for a feature request allowing to write IrConstImpl::int
2020-01-15 16:10:34 +03:00
Denis Zharkov d4c34afb94 NI: Do not resolve static callable references on generic types
As they weren't resolved in old inference

^KT-35920 Fixed
2020-01-15 16:10:34 +03:00
Denis Zharkov c48539feb3 NI: Fix callable references resolution when LHS is generic nested class
In case of null qualifier, we should not look into any static scope
NB: factory::createCallableProcessor returns NoExplicitReceiver processor
in case of null-receiver, that makes resolving the call in the test as
`property(::key)` that matches to the property itself, thus leading to
overload resolution ambiguity

^KT-35887 Fixed
2020-01-15 16:10:34 +03:00
Vladimir Ilmov 4ff8acf5d7 POC coroutine panel removed 2020-01-15 14:02:05 +01:00
Vladimir Ilmov c8c0f3383d [debug] coroutine's stack frame locations pre-calculated on initialization 2020-01-15 14:02:05 +01:00
Sebastian Schuberth 4191d1d699 Make NodeJsSetupTask and YarnSetupTask cacheable
For users that have Gradle's build cache [1] enabled, make NodeJsSetupTask
and YarnSetupTask cacheable to avoid the distribution archives being
downloaded again if they have been downloaded before by other builds of
other projects that apply the Kotlin plugin.

[1] https://docs.gradle.org/current/userguide/build_cache.html
2020-01-15 12:51:37 +01:00
Sebastian Schuberth 2760034281 NodeJsSetupTask: Check for the node executable instead of its directory
We want NodeJs to be downloaded again if nodeBinDir exists but the node
binary is missing.

Fixes https://youtrack.jetbrains.com/issue/KT-34989.
2020-01-15 12:51:37 +01:00
Pavel Kirpichenkov 3fcf3d6fea Add regression tests
KT-32358
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov d36dd12f58 [NI] Restore old behaviour of AbstractPartialBodyResolveTest
Smartcasts between partial and full resolution mode should almost never match,
comparing smartcasted types in test runner is incorrect in general case.
Mute failing test until decision about correct behaviour (KT-35922).
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov b9a1fc294c [minor] Move quickFixUtil to util package 2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov 69e800c695 Remove dependencies on data flow aware expression type in BindingContext
`BindingContext.getType`'s behaviour on argument expression has been different for OI and NI for some time.
New inference used to rewrite argument's type after smartcast, which led to missing subsequent smartcasts in some cases.
This commit makes retrieval of smartcasted argument type explicit.
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov 4d11fac365 [NI] Add restored smart casts to spec tests
KT-35668 Fixed
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov 396b226462 [NI] Restore missing smart casts after another smart cast in call
Expression type serves as a part of a key for retrieving smart cast info.
Rewriting expression type with SmartCastManager leads to incorrect processing of following smartcasts for same expression, therefore it was removed.

KT-32507 Fixed
KT-32358 Fixed
2020-01-15 14:39:40 +03:00
Mikhail Glukhikh d3de2d419b FIR2IR: fix failing enum entry test 2020-01-15 14:30:15 +03:00
Dmitriy Novozhilov 88a1cb5a17 [NI] Use new type substitutor instead of old in completion of callable references
It's necessary because of new type substitutor is eager than odl, so
  if there is a substitution of type parameter deep inside type arguments
  then second substitutor wins against first

#KT-35896 Fixed
2020-01-15 14:01:25 +03:00
Dmitriy Novozhilov 3428a17759 [NI] Postpone calls with not enough information in builder inference 2020-01-15 14:01:25 +03:00
Mikhail Glukhikh f4b3e9b4b2 [FIR] Fix qualifier handling by FirQualifierNameResolver 2020-01-15 13:20:27 +03:00
Mikhail Glukhikh ae774a0ab9 [FIR] Add test for qualified access to base class member case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh c129714bf9 [FIR] Add test for inner class based qualifier case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh 33104a3ef8 [FIR] Add accidentally missed JvmMappedScope.processClassifiersByName 2020-01-15 13:20:26 +03:00
Igor Yakovlev fb56e14654 Fix UAST method NPE for incomplete method PSI
Fixed #KT-35871
2020-01-15 13:14:41 +03:00
Leonid Startsev 9bd966c123 Supply correct Native platform for module descriptor while compiling from CLI 2020-01-15 12:48:49 +03:00
Leonid Startsev f2026a49bb Support .decodeSequentially call on JVM and Native and remove READ_ALL handling from all platforms
Fix codegen test

Ignore JVM IR codegen test for a while since it requires updated kotlinx-serialization-runtime in classpath
2020-01-15 12:46:25 +03:00
Steven Schäfer cb98588202 Psi2Ir: Add an IrTextTest for enums with multiple constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer 1b5109b6ee JVM IR: Refactor EnumClassLowering 2020-01-15 10:18:09 +01:00
Steven Schäfer b0e61ab470 JVM IR: Remove IrEnumValueOf intrinsic 2020-01-15 10:18:09 +01:00
Steven Schäfer f8779ddf9d Psi2Ir: Create instance initializer calls in enum class constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer 83edc7fa73 IR: Remove unused argument from DeclarationFactor.getFieldForEnumEntry 2020-01-15 10:18:09 +01:00
Nicolay Mitropolsky ed57a53ad6 191: Uast: fix compilation for 191 2020-01-15 11:40:47 +03:00
Alexander Udalov b5afdc7553 Keep annotation FQ name in experimental API diagnostics
This fixes compilation of ExperimentalFixesFactory where this FQ name
is used to construct a correct quick fix instance.
2020-01-15 00:32:19 +01:00
Alexander Udalov 514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov 9187a85aaf Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests 2020-01-14 21:04:43 +01:00