Commit Graph

551 Commits

Author SHA1 Message Date
Victor Petukhov b3943f5ab6 [FE 1.0] Process builder inference stub types with different nullability properly
^KT-49887 Fixed
2021-12-15 22:23:18 +03:00
Evgeniy.Zhelenskiy ec2e96f3e4 Regenerate inline class tests as 1 arg value classes 2021-12-15 17:14:22 +00:00
Dmitry Petrov e47871f98b JVM_IR KT-50215 KT-50076 extra test 2021-12-13 20:34:57 +03:00
Ilya Goncharov 6adcbe081e [JS IR] Consider erasing type parameters in return type in js signatures 2021-12-13 16:16:59 +00:00
Dmitry Petrov df460a842b JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-13 14:13:34 +00:00
Dmitry Petrov 81c805a754 JVM_IR KT-50171 add missing parent to temporary vals for proxy fun 2021-12-11 15:51:12 +00:00
Evgeniy.Zhelenskiy b1d1f87318 [Tests] Introduce reversible source file preprocessor 2021-12-10 18:19:17 +03:00
Evgeniy.Zhelenskiy cb4ec932d7 [Tests] Introduce replacing source transformer 2021-12-10 18:19:17 +03:00
Evgeniy.Zhelenskiy 2874462e3a [Tests] Introduce transformers functions object 2021-12-10 18:19:16 +03:00
Evgeniy.Zhelenskiy af73034235 [Tests] Introduce runTest with transformer to old testing framework 2021-12-10 18:19:16 +03:00
Evgeniy.Zhelenskiy e62c6e3eac [Tests] All tests correct generation 2021-12-10 18:19:16 +03:00
Dmitry Petrov 3017397960 JVM_IR fix string concatenation performance issues
KT-50080 KT-50084 KT-50140
2021-12-09 15:32:13 +03:00
Mikhael Bogdanov 29afd674d2 JvmDefaultWithoutCompatibility. Add test with Kotlin Java mixed inheritance 2021-12-08 12:25:02 +01:00
Dmitry Petrov 93713a9ad4 JVM_IR KT-47939 use FunInterfaceConstructorReference as base class 2021-12-08 14:12:41 +03:00
Dmitry Petrov 0ccd7a7e0c KT-47939 fun interface constructor reference should throw NPE for null 2021-12-08 14:12:41 +03:00
Dmitry Petrov e179598457 JVM_IR KT-47939 equality for fun interface constructor references 2021-12-08 14:12:38 +03:00
Dmitry Petrov 58f1504aaf KT-47939 basic fun interface constructor reference box test 2021-12-08 14:12:37 +03:00
Mikhael Bogdanov bdeae7668e JvmDefault. Support 'JvmDefaultWithCompatibility' annotation in old backend
#KT-48217
2021-12-08 06:27:57 +00:00
Alexander Udalov 1471602c9f JVM IR: do not optimize properties with -Xno-optimized-callable-references
#KT-50019 Fixed
2021-12-08 03:15:49 +01:00
Ilmir Usmanov bb53ba4a2e Enable delegation by interface for inline classes in old FE
#KT-27435
2021-12-08 00:11:54 +01:00
Victor Petukhov ce2c6f5d1f [FE 1.0] Don't mark type variable as READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES if it has complex dependency to other type variables
^KT-49838 Fixed
2021-12-07 11:41:13 +03:00
Victor Petukhov 61d40403e7 [FE 1.0] Create captured star projection for self types by replacing type arguments deeply
^KT-49752 Fixed
2021-12-07 11:38:45 +03:00
Mads Ager 529944fe9c [JVM_IR] Fix inline class default method codegen.
Do not coroutine transform static inline class replacements that
forward to a default interface suspend method. No boxing has to
take place on return (as the default interface method always
boxes) so we can simply forward the call.

^KT-49645 Fixed
2021-12-06 17:29:59 +01:00
Dmitry Petrov 7206c06d26 IR KT-50039 don't initialize outer 'this' in delegating constructor 2021-12-06 17:31:37 +03:00
Mikhael Bogdanov ea58c858d1 JvmDefault. Support @JvmDefaultWithCompatibility annotation
#KT-48217 Fixed
2021-12-06 14:20:24 +01:00
Anastasiya Shadrina d8faa9686d [Tests] Test samples from KEEP 2021-12-02 20:24:14 +03:00
Anastasiya Shadrina aaabf5e1ca [PSI2IR] Support context receivers on classes 2021-12-02 20:23:38 +03:00
Anastasiya Shadrina 307f318c9e [PSI2IR] Generate IR for functions and calls with context receivers 2021-12-02 20:23:27 +03:00
Ilmir Usmanov b26a81435f Do not add continuation parameter for super interface bridges
If there is superinterface (more specifically, fun interface) in one
file with default suspend function, we lower the function, adding
continuation parameter. Then, when we compile another file with a child,
we generate a bridge to the default suspend function, which is already
lowered. So, we do not need to add the continuation parameter.

If the child is in the same file, then we add continuation parameter
after we create a bridge, so, AddContinuationLowering can encounter
bridges to suspend default functions in superinterfaces with
continuation parameter only in multifile examples.

 #KT-47549 Fixed
2021-12-02 10:09:22 +00:00
Alexander Udalov be6409f0af Fix property lookup in data class component generation
#KT-49812 Fixed
 #KT-49936 Fixed
2021-12-02 01:43:39 +01:00
Ilmir Usmanov 8e8a6e6108 Do not count receivers in default parameters mask
If we implement default function with default parameters in inline
class, the receivers will be added to parameter list
(see ac7538a269). But since they
are not present in source parameters, we should not count them when we
compute mask for default parameters.

 #KT-49977 Fixed
2021-11-30 15:09:16 +00:00
Mads Ager 09da67767e [JVM_IR] Fix mangling of inline class inherited interface methods.
^KT-49864 Fixed
2021-11-30 03:33:56 +03:00
Alexander Udalov 3f47725eb9 Add regression test for coroutines issue KT-49294 2021-11-29 22:09:59 +01:00
Alexander Udalov 4df937ff7f JVM IR: keep property for $receiver field of optimized delegated properties
For properties which delegate to other property via the getValue
operator from stdlib (see KT-39054), we generate `$receiver` field which
stores the receiver of the property reference used in the delegate. The
problem was that this backing field was missing `correspondingProperty`.
It's needed because it is used as a map key to store static fields in
`JvmCachedDeclarations.getStaticBackingField`. If it's null, accesses to
the static $receiver fields are not remapped correctly in
`RemapObjectFieldAccesses` and
`MoveOrCopyCompanionObjectFieldsLowering`, which led to ICCE or NSFE.

 #KT-49793 Fixed
2021-11-26 19:21:16 +01:00
Alexander Udalov 29c1fe1be1 Minor, move tests on KT-39054 into a subdirectory 2021-11-26 19:18:25 +01:00
Denis.Zharkov a7859e0332 FIR: Fix wrong ACCIDENTAL_OVERRIDE on fake override property with JvmName 2021-11-26 19:39:36 +03:00
Dmitry Petrov 88f41d006a FIR2IR don't generate delegates for default interface members 2021-11-25 13:25:36 +03:00
Mikhail Glukhikh 0058d7e3d6 Add BB test for problem fixed with c2ab91d0 2021-11-24 15:30:33 +03:00
Mads Ager 8255118204 [JVM] Do not extend local ranges across control-flow merges.
The coroutine method transformer extends the range of locals
across code where the local is not live when it is safe to do
so. However, it only bailed out for one case of control-flow
merging, namely backwards branches for loops. That is not
sufficient as there can be control flow merges without loops
where the local is only defined on one control-flow path.

This change generalizes the bailout to any control-flow merge.

^KT-49834 Fixed
2021-11-23 13:49:45 +01:00
Dmitry Petrov 55d1fdfbc2 JVM_IR prevent clash of unsubstituted special bridges 2021-11-23 12:05:13 +00:00
Dmitry Petrov 2179987de7 FIR2IR fix enum special methods generation 2021-11-23 06:34:33 +00:00
Roman Artemev 3bef04cf5e Fix test and unmute it for JVM 2021-11-22 19:00:43 +03:00
Victor Petukhov a6fd14d4e6 [FE 1.0] Eliminate resolution ambiguity on inherited SAM-interfaces
^KT-17765 Fixed
2021-11-22 14:18:30 +03:00
Victor Petukhov a5c6d370dd [FE 1.0] Eliminate resolution ambiguity with external type parameters
^KT-10926 Fixed
2021-11-22 14:18:29 +03:00
Dmitry Petrov e525e25518 JVM KT-47851 fix redundant checkcast elimination 2021-11-20 23:29:19 +03:00
Dmitry Petrov 8b066fd345 JVM add tests for KT-49615 2021-11-20 23:29:18 +03:00
Dmitry Petrov 30ceb49442 JVM_IR KT-48945 generate special bridge with unsubstituted signature 2021-11-17 17:44:01 +03:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Steven Schäfer a6dae0b37b JVM IR: Fix value class mangling in SAM wrappers from different modules
KT-49659
2021-11-14 21:52:39 +01:00
Alexander Udalov 27cfcb9b3d IR: fix thisReceiver parameter type for function classes
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.

Avoid creating types manually completely to simplify this code and fix
the bug.

 #KT-49168 Fixed
2021-11-10 21:58:41 +01:00