Commit Graph

3662 Commits

Author SHA1 Message Date
Dmitriy Novozhilov aa829c2321 [FIR2IR] Fix using default values of annotation arguments 2021-03-05 13:00:12 +03:00
Dmitriy Novozhilov 8324f499cd [FIR] Fix serializing annotation metadata on setters value parameters 2021-03-05 13:00:11 +03:00
Dmitriy Novozhilov a6d1d47918 [FIR] Fix clearing info about DF variable after reassignment 2021-03-04 17:09:17 +03:00
Mads Ager 8e9dfc23b6 FIR: Take targeted annotations into account for metadata
Getter/setter targeted annotations were not correctly reflected
in the kotlin metadata which made them not work with
kotlin-reflect.
2021-03-03 08:48:28 +03:00
Dmitriy Novozhilov 714c2a8f93 [FIR] Bind return expression to function symbol instead of function itself 2021-03-02 19:11:27 +03:00
Dmitriy Novozhilov 245bc7c8e2 [FIR2IR] Fix interpreting constants from const properties from other module 2021-03-02 19:11:26 +03:00
Dmitriy Novozhilov a7e6667648 [FIR] Properly deserialize annotations of properties in interfaces 2021-03-02 19:11:24 +03:00
Dmitriy Novozhilov da0fd7cc15 [FIR2IR] Approximate non-denotable types when converting ConeType to IrType 2021-03-02 19:11:21 +03:00
Dmitriy Novozhilov af79265f42 [FIR] Fix creating overrides for functions with name same as renamed in JVM builtins 2021-03-02 19:11:15 +03:00
Mikhael Bogdanov 77559e8299 Temporary mute reflection test on Android 2021-03-01 18:05:27 +01:00
Mikhael Bogdanov 49aa36b70d Generate local delegated properties in interface in jvm-default all modes 2021-03-01 16:20:20 +01:00
Mikhael Bogdanov c25a694b6b Generate private suspend functions as private (not synthetic package-private)
#KT-26592 Fixed
2021-03-01 16:20:19 +01:00
Mikhael Bogdanov ad8eddac99 Add test for private suspend and JVM defaults 2021-03-01 16:20:19 +01:00
Mikhael Bogdanov 8764bb09f2 Generate synthetic annotation method in interface if -Xjvm-default is on 2021-03-01 16:20:19 +01:00
Stanislav Erokhin f77ba914c7 [MERGE] Kotlin/Native history merged into kotlin/master 2021-02-26 15:30:58 +01:00
Alexander Udalov 417eb60ed3 Revert "Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern."
This reverts commit 073a500370.

(cherry picked from commit eec98314c8)
2021-02-26 12:51:53 +01:00
Mikhail Glukhikh 2bf3abcb29 FIR: cache accessor symbols in JavaClassUseSiteMemberScope 2021-02-26 12:27:07 +03:00
Alexander Udalov acc2256de9 IR: support smart cast values in RangeContainsLowering
#KT-44878 Fixed
2021-02-25 21:00:09 +01:00
Victor Petukhov 94e6ec7dfd Fix test after 27846f4532 2021-02-25 22:29:45 +03:00
Denis.Zharkov 4fffe7b9c8 FIR: Fix VerifyError caused by private delegates
^KT-45048 Fixed
2021-02-25 19:30:15 +03:00
Victor Petukhov 27846f4532 Add tests for obsolete issues (KT-42722, KT-39880) 2021-02-25 15:30:29 +03:00
Dmitriy Novozhilov 4222bb9af2 [FE] Make whens on expect sealed classes and enums not exhaustive 2021-02-25 14:56:08 +03:00
Vasily Levchenko 0324ee508e [testData][compiler] disable tests KT4282{4,5} for native backend 2021-02-24 11:07:16 +01:00
Igor Chevdar 9d8abca195 [box-tests] Disabled a test for K/N 2021-02-24 11:00:27 +05:00
Mads Ager 8852323a76 [PSI2IR] Do not generate property reference setter if inaccessible.
Fixes KT-45064.
2021-02-23 19:33:49 +01:00
Ilmir Usmanov d44799fa78 JVM IR: Use INVOKESPECIAL instead of INVOKEVIRTUAL for default private
suspend functions.

 #KT-26592
2021-02-23 18:49:10 +01:00
Ilmir Usmanov 3ee62cb1b2 JVM IR: Do not generate private suspend functions as synthetic package-private
#KT-26592
2021-02-23 18:49:06 +01:00
Alexander Udalov e6476c39ca JVM IR: fix isMarkedNullable for nullability-flexible types
Since nullability-flexible types in IR are represented by an annotation
on an IrSimpleType, not a special instance, the common implementation of
`KotlinTypeMarker.isMarkedNullable` in `TypeSystemContext` doesn't work.

This method is used for example to generate `typeOf` in JVM IR, in
`TypeSystemCommonBackendContext.generateTypeOf`, and this issue led to a
difference in behavior of `typeOf` for nullability-flexible types.

 #KT-44726 Fixed
2021-02-22 12:52:48 +01:00
Alexander Udalov eec98314c8 Revert "Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern."
This reverts commit 073a500370.
2021-02-22 10:14:32 +01:00
Pavel Punegov 073a500370 Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern. 2021-02-21 11:12:33 +03:00
Pavel Punegov 95a8c60a9c Ignore test in Native backend. Test overrides kotlin.Result 2021-02-21 11:11:46 +03:00
Pavel Punegov 4643f12a5f Ignore JVM test in Native backend 2021-02-21 11:11:46 +03:00
Dmitriy Novozhilov ea2783eace [FIR] Fix generating this reference in delegated accessors
There was a problem with delegated extension property with dispatch
  receiver that `this` in `getValue` call was set to dispatch receiver
  instead of extension one
2021-02-20 18:27:43 +03:00
Dmitry Petrov 387d84f826 JVM_IR indy-SAM: KT-45069 box lambda 'Unit' return type if needed 2021-02-20 15:07:24 +03:00
Denis.Zharkov 1fe0a1f160 FIR: Fix interface delegation case via type alias 2021-02-20 10:59:23 +03:00
Denis.Zharkov e4c851e3ce FIR2IR: Fix case of @JvmOverloads with subclass
Avoid generating synthetic overrides in subclass
It has been already working for PSI2IR because fake overrides there don't
inherit default values for parameters, while they do it in FIR
2021-02-20 10:59:22 +03:00
Denis.Zharkov 377a0aa237 FIR2IR: Adjust test data for updated overridden structure 2021-02-20 10:59:22 +03:00
Denis.Zharkov a750d9466e FIR2IR: Rework resulted overridden-relation structure
The difference is how we deal with intermediate fake overrides
E.g., in case

interface A { /* $1 */ fun foo() }
interface B : A {
     /* $2 */ fake_override fun foo()
}
interface C : B {
   /* $3 */ override fun foo()
}

We've got FIR declarations only for $1 and $3, but we've got
a fake override for $2 in IR.

Previously, override $3 had $1 as its overridden IR symbol, just because
FIR declaration of $3 doesn't know anything about $2.

Now, when generating IR for $2, we save the necessary information
and using it for $3, so it has $2 as overridden.

So, it's consistent with the overridden structure of FE 1.0 and this
structure is necessary prerequisite for proper building of bridges
for special built-ins.
2021-02-20 10:59:22 +03:00
Denis.Zharkov fd146e3eed FIR2IR: Copy annotations from original declarations to fake overrides 2021-02-20 10:59:22 +03:00
Mikhail Glukhikh 1a0be3ee40 Fix FirAnnotationArgumentChecker (String + ... case) #KT-44995 Fixed 2021-02-20 10:31:26 +03:00
Dmitriy Novozhilov 1c0d862e40 [FIR] Don't smartcast variables to invisible types
#KT-44802 Fixed
2021-02-20 10:23:33 +03:00
Mikhail Glukhikh 73616107b4 Unmute passing FIR BB test 2021-02-19 12:19:42 +03:00
Dmitry Petrov c629ba5a3c JVM_IR indy-SAM: function reference to Java interface 2021-02-19 12:04:30 +03:00
Mikhail Glukhikh 357a7907a3 FIR: fix type approximation by visibility 2021-02-19 10:39:57 +03:00
Ilmir Usmanov cacd84390e Use erased upper bound instead of checking for inline type 2021-02-18 18:31:50 +01:00
Ilmir Usmanov 741c1a864f JVM_IR: IC: Unbox inline class argument of callable reference
if it is unbound and the underlying type is reference type.
If the underlying type is primitive, it is boxed and unboxed
correctly, otherwise, it is simply casted and not unboxed.
Additionally, generate functions for inliner with inline classes
in signature, so unboxing works.
The unboxing is removed after inlining.
 #KT-44722 Fixed
2021-02-18 18:31:48 +01:00
Dmitry Petrov 744a0fcd25 PSI2IR KT-45022 object in LHS of compound assignment 2021-02-18 20:24:16 +03:00
Dmitriy Novozhilov 7b7b8fbea7 [Test] Filter dependent modules by source kind in creating FirModuleInfo 2021-02-18 14:44:44 +03:00
Alexander Udalov adb05ab076 JVM IR: write inherited multifile parts flag to kotlin.Metadata
This flag is unused at the moment, but might be used one day to support
proper incremental compilation for multifile classes.
2021-02-17 21:56:18 +01:00
Dmitry Petrov 6d019d9544 JVM_IR indy-SAM on functional expression 2021-02-17 22:18:06 +03:00