Commit Graph

87934 Commits

Author SHA1 Message Date
Anastasiya Shadrina 37a981cc29 [Tests] Add missing tests 2021-12-02 20:23:55 +03:00
Anastasiya Shadrina 875f4ea31c [FE] Support local contextual declarations 2021-12-02 20:23:54 +03:00
Anastasiya Shadrina 43d11c7c4b [K/N] Fix K/N Sanity test 2021-12-02 20:23:53 +03:00
Anastasiya Shadrina 1a0aab4a44 [FE] Inline classes cannot have context receivers 2021-12-02 20:23:52 +03:00
Anastasiya Shadrina d704862582 [FE] Prohibit property initializers with context receivers 2021-12-02 20:23:51 +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 5e426d5c16 [Parser] Continue parsing if context receiver is not parsed correctly 2021-12-02 20:23:48 +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 dcb3fc5508 [Tests] Add missing tests 2021-12-02 20:23:43 +03:00
Anastasiya Shadrina 08e68e1887 [PSI] Fix parse tree node 2021-12-02 20:23:42 +03:00
Anastasiya Shadrina 3de1566f11 [Compiler plugins] Fix usage of descriptor API 2021-12-02 20:23:41 +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
Anastasiya Shadrina f4ddf66ac4 [FE] Support context receivers on classes 2021-12-02 20:23:25 +03:00
Anastasiya Shadrina c34fe8d547 [FE] Implement temporary resolution algorithm 2021-12-02 20:23:24 +03:00
Anastasiya Shadrina d923c95671 [FE] Add context receivers to scope 2021-12-02 20:23:22 +03:00
Anastasiya Shadrina c5687e080d [FE] Pass context receiver parameters where necessary 2021-12-02 20:23:18 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Anastasiya Shadrina 7de8380ddf [FE] Add context receivers getter to KtCallableDeclaration interface 2021-12-02 20:23:16 +03:00
Anastasiya Shadrina d1fdc4d787 [PSI] Introduce "context" soft keyword and parse context receivers 2021-12-02 20:23:11 +03:00
soywiz f6298ed1d5 Explain how to use -dev and -SNAPSHOT versions 2021-12-02 18:23:16 +03:00
Sergej Jaskiewicz 86cabf3bb7 [JS IR] Use Uint16Array as CharArray's storage 2021-12-02 12:39:41 +00:00
Sergej Jaskiewicz 67dfe7bed1 [JS IR] Make Char a value class (again)
#KT-35100 Fixed
2021-12-02 12:39:40 +00:00
Sergej Jaskiewicz 599f705842 [stdlib] Make @LowPriorityInOverloadResolution applicable to ctors 2021-12-02 12:39:40 +00:00
Yahor Berdnikau 2aa1c187d9 Revert "Set minimal supported Gradle version to 6.7.1."
Temporary until 1.6.20 release branching.

This reverts commit 4c3404888a.

^KT-49733 Open
2021-12-02 15:05:54 +03:00
Alexander Korepanov 2ae10f4378 [JS IR] Optimize equals call for inline class instances.
Remove implicit boxing of inline class instances in equals call.
2021-12-02 11:00:02 +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
Alexander Udalov 2fbd2e2a15 Minor, move irText tests on data classes to a subdirectory 2021-12-02 01:43:39 +01:00
Steven Schäfer a5fa69b8ee jvm-abi-gen: use kotlinx-metadata 0.4.0 from maven
(cherry picked from commit f5e95444f82bb8e4be72dcef18da3a92277911e0)
2021-12-02 01:41:57 +01:00
Ilya Muradyan 7283ea86af [scripting] Fix Kotlin reflection metadata for script constructors 2021-12-02 01:49:58 +03:00
Ian Lynagh 176803689a Add js/js.tests/build as exclusions for CodeConformanceTest
If the "jsCompilerTest"s are run before this, then we get spurious
failures due to e.g. js/js.tests/build/node_modules/mocha/mocha.js
2021-12-02 00:40:02 +03:00
Mikhail Glukhikh f09fc9a473 Optimize FirImportsChecker using lazy evaluation 2021-12-01 23:45:20 +03:00
Tianyu Geng 18f7a760bb FIR checker: report unresolved reference in imports
Compared to FE1.0, instead of using UNRESOLVED_REFERENCE, a new
UNRESOLVED_IMPORT diagnostic is introduced. This is so that we can use a
different positioning strategy to highlight the last part of the import
if the entire import is passed.

Also, this change fixed some incorrectly rejected imports in FIR. Such
cases are covered the newly added test file staticFunAndPropertyImport.kt
2021-12-01 23:45:18 +03:00
Tianyu Geng f51b108821 FIR: fix PsiElementFinderByType
Current implementation would return the input node if the type matches.
This is clear wrong since the method is supposed to return children.
2021-12-01 23:45:17 +03:00
mvicsokolova 93561a1a55 kotlinx.atomicfu compiler plugin for JS_IR backend (#4581)
* kotlinx.atomicfu compiler plugin for JS_IR

Support transformations of atomic operations introduced by the kotlinx.atomicfu library for the JS_IR backend. Compiler plugin is applied externally by the kotlinx.atomicfu gradle plugin.

* Apply compiler plugin for JS platform only

* New plugin test structure

* testGroupOutputDirPrefix changed
2021-12-01 22:33:13 +03:00
Steven Schäfer 05695761ec jvm-abi-gen: Add test to check the declaration order in interface jars 2021-12-01 19:20:47 +01:00
Steven Schäfer b8625cd233 jvm-abi-gen: Do not sort stripped methods and fields
The order is visible to annotation processors and should be considered
part of the ABI of a class.
2021-12-01 19:20:47 +01:00
Viacheslav Kormushkin 077d10edef [KMM] Fixed project import failure in case of cocoapods integration
#KT-49931
2021-12-01 16:30:35 +00:00
Mads Ager d89680b30d [FIR] Serialize annotations for type parameters properly 2021-12-01 18:25:06 +03:00
Alexander Anisimov 76b332b635 Update ReadMe.md
Add a link to the Kotlin YouTube channel
2021-12-01 17:22:34 +03:00
Leonid Startsev de128a5406 kotlinx.serialization: Support @Serializable on sealed interfaces.
Interfaces (regular and sealed) are by default polymorphic. To benefit
from sealing (i.e. knowledge of all inheritors in compile-time), @Serializable
annotation may be added on sealed interface, generating the same serializer
that can be used for sealed classes.

Synthetic nested classes are not generated in DEFAULT_IMPLS mode because
it causes problems when adding a synthetic companion to an interface.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1576
2021-12-01 14:14:47 +00:00
Anton Bannykh e6a5614321 [JS IR] don't hash module names 2021-12-01 16:50:30 +03:00
Anton Bannykh 9122304acb [JS IR] shorten lib name to fit 255 path total length on Windows 2021-12-01 16:50:29 +03:00
Anton Bannykh 5a3c8336ca [JS IR] import Bar from its module 2021-12-01 16:50:28 +03:00
Anton Bannykh a76425a7ee [JS IR] update JS AST diagnostics 2021-12-01 16:50:28 +03:00
Anton Bannykh e90ad8b53b [JS IR] fix cross-module reference of interface default methods 2021-12-01 16:50:24 +03:00
Anton Bannykh a9b99a8eea [JS TESTS] fix moduleDescriptor dependency configuration
The dependency list doesn't get copied in the `setDependencies` API
which leads to all modules depending on each other.
2021-12-01 16:50:23 +03:00