Commit Graph

61278 Commits

Author SHA1 Message Date
Jinseong Jeon 451fa245b8 JVM_IR: Change name for (dispatch|extension) receiver of inline class according to naming convention. 2020-02-04 11:52:56 +01:00
Alexander Udalov 19b516cbf4 JVM IR: do not erase static fields in annotation classes 2020-02-04 11:43:24 +01:00
Alexander Udalov 00de5dae32 JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering
This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
2020-02-04 11:43:24 +01:00
Alexander Udalov e42a4b2fac IR: extract JvmPropertiesLowering out of PropertiesLowering 2020-02-04 11:43:23 +01:00
Ilya Goncharov 60da37404e [Gradle, JS] Distribution and distributeResources 2020-02-04 13:07:10 +03:00
Dmitriy Dolovov e302818e26 Refactor KotlinNativeToolRunner to make it extendable
Now, it's possible to add new tool runners independent of Kotlin/Native
distribution. Ex: Upcoming KotlinNativeKlibCommonizerToolRunner
2020-02-04 15:49:49 +07:00
Mikhail Zarechenskiy cb07c9172f [NI] Record substituted generic signature for SAM arguments
#KT-36297 Fixed
2020-02-04 10:26:48 +03:00
Dmitry Petrov 8ef79f932c JVM_IR: Implement some BE diagnostics
TODO proper diagnostics tests with BE diagnostics
2020-02-04 00:04:22 +03:00
Georgy Bronnikov c9df17f2f1 Handle type arguments in IrType.eraseTypeParameters 2020-02-03 19:14:22 +03:00
Mikhail Glukhikh 22068dd6ad [FIR TEST] Update test data due to hardened receiver check (NB: broken)
In particular, nullable invoke extension call and some smart casts
are broken here
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh 7dca4d2fee [FIR TEST] Update test data for purely implements case (NB: broken)
In this case Java super type arguments should be not null, not flexible
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh b25d99c1e5 [FIR TEST] Add test with some problematic smart casts 2020-02-03 16:45:20 +03:00
simon.ogorodnik ca5fee77d4 [FIR] Fix generation of raw FIR for delegate with receiver 2020-02-03 16:45:20 +03:00
simon.ogorodnik ef5aab374b [FIR] Fix implicit this aliasing in DFA 2020-02-03 16:45:20 +03:00
simon.ogorodnik 645602b675 [FIR] Fix data-flow after while loops 2020-02-03 16:45:20 +03:00
Mikhail Glukhikh 91b432b4a1 [FIR] Java super-type arguments are now handled as flexible 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh aeb6f35571 Support nullable callable references in FIR resolve 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh a584589665 Support nullable callable references in raw FIR 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh 95122f1d0b Add two more FIR problematic tests 2020-02-03 16:45:18 +03:00
Mikhail Glukhikh 0b377c103a Add FIR problematic test (safe extension invoke) 2020-02-03 16:45:18 +03:00
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00
Roman Golyshev fe779bf7bd KT-34795 Fix failing NewMultiplatformIT#testLibAndApp test
- Revert back `maven(...)` to `maven { setUrl(...) }`, because in this test this syntax is used intentionally to be valid both for `.gradle` and `.gradle.kts`
2020-02-03 15:55:28 +03:00
Vladimir Ilmov c804190f36 [COROUTINE] NPE exception fix if no DebugMetadata in target jvm exists 2020-02-03 09:16:50 +01:00
Vladimir Ilmov 7175e5a927 [COROUTINE] Extra logging removed, bug in method signature fix
Relates to #KT-34906
2020-02-03 09:16:50 +01:00
Dmitriy Novozhilov 2174556505 [FIR-TEST] Update incorrect testdata 2020-02-03 10:38:01 +03:00
Vladimir Dolzhenko cf9ceb4e99 Add more diagnostic context to LightClassUtil#findClass
Relates to #EA-5389872
2020-02-03 00:00:45 +01:00
Dmitriy Dolovov 80eb148092 IDE: Fix ToolingSingleFileKlibResolveStrategy to recongnize klib archives
Issue #KT-36213
2020-02-01 17:07:18 +07:00
Dmitriy Dolovov ef199f8e45 Mark obsolete createKotlinLibrary() call as @Deprecated 2020-02-01 17:07:18 +07:00
Dmitriy Dolovov acc3395ca5 IDE: Don't analyze incompatible KLIBs with components
Issue #KT-36213
2020-02-01 17:07:13 +07:00
Dmitriy Dolovov 623b554297 IDE: Fix friendly displaying of K/N KLIBs with components
Issue #KT-36213
2020-02-01 17:07:09 +07:00
Dmitriy Dolovov 4336096775 Use "tooling" KLIB resolve strategy in IDE and commonizer
Issue #KT-36213
2020-02-01 17:07:02 +07:00
Dmitriy Dolovov 1196044df7 Introduce 2 KLIB resolve strategies: "compiler" & "tooling"
Issue #KT-36213
2020-02-01 17:06:42 +07:00
Dmitriy Dolovov 1053428ee4 Minor: Formatted 2020-02-01 17:04:00 +07:00
Dmitriy Dolovov 8028a3f55b Minor: Clean-up in konan File 2020-02-01 17:03:51 +07:00
Mikhail Zarechenskiy 60a2d0f037 [NI] Approximate receivers for callable reference candidates
#KT-36221 Fixed
2020-01-31 18:26:32 +03:00
Pavel Kirpichenkov 517688e163 [NI] Revise variance calculation method for completion mode
Before fix only one level of type arguments was used to determine variance of type variable to find out direction requirements.
This incorrect in general case, because outer variance affects subtyping deductions, for example:
Inv<Out<A>> <: Inv<Out<B>> => A <: B; B <: A, despite A and B are in covariant position if only one level is considered

^KT-36233 Fixed
2020-01-31 17:59:11 +03:00
Will Boyd e27b2990e3 Update message on KotlinReflectionInternalError to reflect that typealiases are also unsupported 2020-01-31 15:58:30 +01:00
Pavel Kirpichenkov 3819b2ce59 Change unsupported 1.0 version in maven plugin tests
KT-36146
2020-01-31 16:58:51 +03:00
Juan Chen 188abc243a [FIR] add vararg arguments support, improve vararg parameters support 2020-01-31 16:41:25 +03:00
Mikhail Zarechenskiy 069fbffaa3 Regenerate tests: fix LightAnalysisModeTestGenerated 2020-01-31 15:39:52 +03:00
pyos bda5b0d5a9 JVM_IR: further refine synthetic accessor generation
References to protected members from crossinline lambdas in the same
package do not need accessors.
2020-01-31 13:20:30 +01:00
Mikhael Bogdanov 21d3adf084 Minor. Fix android test compilation 2020-01-31 11:39:55 +01:00
Mikhael Bogdanov 9e26491631 Beatify names for enum name and ordinal local variables 2020-01-31 11:39:54 +01:00
Mikhael Bogdanov cd0c45c832 JVM_IR. Generate proper suffix for companion backing field accessor and parameter name 2020-01-31 11:39:53 +01:00
Mark Punzalan 3ee344b836 ForLoopsLowering: Fix issue with break/continue in loop over withIndex. 2020-01-31 10:37:03 +01:00
Pavel Kirpichenkov 724eda8fdb Advance explicit Kotlin versions in gradle integration tests
1.0 and 1.1 are no longer supported starting from 1.4, new errors break tests
See KT-36146
2020-01-31 11:47:25 +03:00
Alexander Udalov 9f25fdcedc Minor, skip mustBeDocumented.kt for JDK 6 codegen tests
Class.getDeclaredAnnotation is not available before JDK 8
2020-01-31 09:36:17 +01:00
Mads Ager e8a640851a FIR: Change the Fir2Ir handling of smart casts.
Generate the expression with the original type and then insert
an implicit conversion. That matches the behavior of psi2ir
better and therefore avoids breaking backend assumptions.

In particular, IrGetValue expects the type of the underlying
symbol and the type of the IrGetValue to be the same.
2020-01-31 09:31:52 +01:00
Mads Ager d68a1898d0 JVM_IR: Use direct field access instead of calling certain accessors.
Final default properties accessors that access a backing field
on the same class can be replaced by direct field use.

Perform the optimization late in the pipeline to allow lowerings
to expose more opportunities for optimizations.
2020-01-31 09:31:52 +01:00
Nikolay Krasko 09057c485b Update to a newer idea to fix bad initialization of PsiSubstitutor (KT-36039)
PsiSubstitutor instantiation doesn't need EmptySubstitutor service anymore.
Remove hack with interface field reassign that doesn't work with JDK >= 12.

Leave hack for PsiSubstitutor in AS40 as KotlinCoreApplicationEnvironment
is not expected to be triggered from the plugin.

#KT-36039 Fixed
2020-01-31 01:59:58 +03:00