Commit Graph

7804 Commits

Author SHA1 Message Date
Anastasiya Shadrina add2ca1d11 [Tests] Try structured concurrency with context receivers 2021-12-02 20:24:28 +03:00
Anastasiya Shadrina 6cd50bc438 [Tests] Add bytecodeListing tests 2021-12-02 20:24:26 +03:00
Anastasiya Shadrina c148a12e4b [IR] Fix functional type sample 2021-12-02 20:24:24 +03:00
Anastasiya Shadrina a091b345a0 [FE] Provide overloadability for candidates with different CR 2021-12-02 20:24:19 +03:00
Anastasiya Shadrina 155e7b211b [PSI2IR, IR] Support functional types and literals for IR 2021-12-02 20:24:17 +03:00
Anastasiya Shadrina 910660a083 [FE] Add language feature for context receivers 2021-12-02 20:24:16 +03:00
Anastasiya Shadrina d8faa9686d [Tests] Test samples from KEEP 2021-12-02 20:24:14 +03:00
Anastasiya Shadrina 403ec7a5b1 [BE] Mangle context receiver params 2021-12-02 20:24:09 +03:00
Anastasiya Shadrina f9e6365461 [Tests] Make build green again 2021-12-02 20:24:07 +03:00
Anastasiya Shadrina a2403c470f [BE] Put context receivers before an extension receiver 2021-12-02 20:24:00 +03:00
Anastasiya Shadrina 875f4ea31c [FE] Support local contextual declarations 2021-12-02 20:23:54 +03:00
Anastasiya Shadrina daa54734e5 [PSI2IR] Pass context receiver values in PropertyLValue 2021-12-02 20:23:50 +03:00
Anastasiya Shadrina 766e6bca75 [PSI2IR] Generate value arguments for context receivers in getter/setter 2021-12-02 20:23:49 +03:00
Anastasiya Shadrina 837f3b98fa [FE] Allow to infer generic property type from a context receiver type 2021-12-02 20:23:46 +03:00
Anastasiya Shadrina 1bcaeabd84 [PSI, FE, PSI2IR] Use labels for referencing specific receiver 2021-12-02 20:23:40 +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
Sergej Jaskiewicz 599f705842 [stdlib] Make @LowPriorityInOverloadResolution applicable to ctors 2021-12-02 12:39:40 +00: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
Mads Ager d89680b30d [FIR] Serialize annotations for type parameters properly 2021-12-01 18:25:06 +03:00
Anton Bannykh 9c4c798fe7 [JS IR] mute tests with wrong linkage 2021-12-01 16:50:16 +03:00
Sergej Jaskiewicz e13b6b2a90 [JS IR] [runtime] Remove valueOf method from Long
This method was used for coercing `Long` values to JavaScript
`number`. However, it caused issues when `Long` values were
concatenated to a string (see KT-8666, KT-26706).
2021-12-01 12:36:34 +00:00
Dmitry Petrov de3203ee48 JVM KT-49903 prohibit reordering of 'getstatic System.out' 2021-12-01 12:13:13 +03: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 f220e4a5ed [FIR] Fix a couple of issues in annotation serialization. 2021-11-30 18:00:00 +03: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
Mikhail Glukhikh c15c7f7dc8 FE: fix visibility check in LazyImportScope #KT-23727 Fixed 2021-11-28 11:32:07 +03: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
Dmitriy Novozhilov 330574cab6 [FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
2021-11-26 11:26:21 +03:00
Mikhail Glukhikh 4a8f00bc7c FIR2IR: support reading of isNewPlaceForBodyGeneration in lazy class 2021-11-26 09:18:11 +03:00
Dmitry Petrov 88f41d006a FIR2IR don't generate delegates for default interface members 2021-11-25 13:25:36 +03:00
Mads Ager 261482904c [FIR] Give external package fragments different module descriptors.
The inliner uses module descriptors to figure out if it needs to
regenerate objects.

We should avoid the use of descriptors in the inliner, but this
works as a first quick fix.
2021-11-25 13:20:31 +03:00
Ivan Kochurkin b83ed7a6ed [FIR] Fix KtExpression.usedAsExpression for labeled expression 2021-11-24 23:13:37 +03:00
Dmitry Petrov 91b1814b02 FIR2IR insert implicit cast on elvis RHS 2021-11-24 16:19:11 +00:00
Dmitry Petrov badfade2fd FIR2IR strip FlexibleNullability on IMPLICIT_NOTNULL 2021-11-24 16:19:10 +00: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
Dmitry Petrov 2a263eca65 FIR2IR strip annotations from IrConst type 2021-11-23 06:34:03 +00:00
Roman Artemev 3bef04cf5e Fix test and unmute it for JVM 2021-11-22 19:00:43 +03:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00: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