Commit Graph

60606 Commits

Author SHA1 Message Date
Ilya Gorbunov d87fb0ece0 Introduce expect KFunction in common 2020-01-16 15:33:14 +03:00
Ilya Gorbunov 427e34fe5a Do not serialize JVM kotlin.reflect to builtins
Serialize common types from kotlin-reflect as builtins instead.
2020-01-16 15:32:29 +03:00
Mikhail Glukhikh f27611939e Raw FIR builder: fix situation with explicit type of for parameter
Before this commit we omitted for parameter type,
even if it was stated explicitly. This also fixes PSI consistency test
2020-01-16 14:46:50 +03:00
Alexander Udalov 621936e951 Do not generate Throws attribute for delegated members from Kotlin interfaces
#KT-31763 Fixed
 #KT-35834
2020-01-16 12:43:09 +01:00
Alexander Udalov 79d7335b8d JVM IR: minor, add toString for FunctionHandleForIrFunction
Useful for debugging problems in BridgeLowering.
2020-01-16 12:38:16 +01:00
Alexander Udalov 86996bf546 IR: workaround exceptions in IrElement.dump
Fallback to IrElement.render if exception happens in DumpIrTreeVisitor
(due, for example, to invalid IR structure).
2020-01-16 12:38:03 +01:00
Alexander Udalov c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01:00
Vladimir Ilmov af71955fde Flaky ConcurrentModificationException in NewMultiplatformProjectImportingTest.testFileCollectionDependency fixed 2020-01-16 11:38:54 +01:00
Pavel Kirpichenkov fd1305c369 [NI] Refactor OnlyInputType annotation check
Hold position consumed during incorporation in Constraint instead of ConstraintPosition.
2020-01-16 12:01:07 +03:00
Pavel Kirpichenkov 0d393e3fd7 [NI] Update filtering of constraints with equal types
Make check for synthetic nullability constraint status before skipping
new constraint with nonunique type.
2020-01-16 12:01:06 +03:00
Pavel Kirpichenkov 2896642f94 [NI] Consider synthetic lower nullability constraint non-proper 2020-01-16 12:01:06 +03:00
Sergey Rostov 07041574da AbstractScriptConfigurationLoadingTest: add asserting messages 2020-01-16 11:45:51 +03:00
Sergey Rostov 40914e79ee .gralde.kts: optimize getAffectedGradleProjectFiles (EA-220597 fixed) 2020-01-16 11:45:50 +03:00
Denis Zharkov 676c99b933 NI: Fix exception during callable references overload resolution
^KT-35847 Fixed
2020-01-16 10:49:49 +03:00
Mikhail Zarechenskiy 588259a034 Add feature that allows references to synthetic properties with warning
See KT-35933 for details
2020-01-16 09:37:34 +03:00
Sergey Bogolepov 595362b99f [kotlinx-metadata-klib] Proper support for enum entries 2020-01-16 11:38:39 +07:00
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