Commit Graph

99755 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda 9dd778bc89 [K/N] Deprecate initRuntimeIfNeeded() with WARNING
As a part of stabilizing Native stdlib.
2023-03-27 14:52:26 +03:00
Abduqodiri Qurbonzoda 33053405e0 [K/N] Mark Any?.identityHashCode() as experimental
As part of stabilizing Native stdlib.
2023-03-27 14:51:39 +03:00
mcpiroman 25bcd86552 Simplify and optimize BridgeLowering 2023-03-27 13:49:07 +02:00
Abduqodiri Qurbonzoda 0d53e11851 [K/N] Internalize all annotations in kotlin.native.internal package
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-03-27 11:47:25 +00:00
Dmitriy Novozhilov 62ad784b73 [FIR] Fix matching annotated predicate for java and binary declarations
^KT-57400 Fixed
2023-03-27 10:54:27 +00:00
Dmitriy Novozhilov 1ac7d13c96 [FE] Add regression test for KT-57036 2023-03-27 10:54:27 +00:00
Alexander Udalov e56e058b7b JVM IR: replace unoverridden Number.toChar with toInt().toChar()
This fixes failing tests for JVM_IR in
`box/primitiveTypes/numberToChar`.

 #KT-23447 Fixed
 #KT-46465
2023-03-27 10:46:15 +00:00
Alexander Udalov a962ec4553 Rework tests on Number.toChar with custom Number subclass
Simplify them, move to a subfolder, add a couple of new tests.
2023-03-27 10:46:15 +00:00
Dmitriy Novozhilov a64d8e8a31 [Stdlib] Deprecate and make open Number.toChar()
^KT-46465 Fixed
2023-03-27 10:46:13 +00:00
Dmitriy Novozhilov 90ec84d7b7 [Stdlib] Update copyrighting in generated stdlib sources 2023-03-27 10:46:11 +00:00
Dmitriy Novozhilov 336b6ba9f0 [FIR] Extract extension functional type from an annotated functional type during deserialization
^KT-57140 Fixed
2023-03-27 10:44:51 +00:00
Dmitriy Novozhilov 8ca7b32577 [FIR] Register type related extensions in libraries sessions
^KT-57140
2023-03-27 10:44:50 +00:00
Dmitriy Novozhilov 01fc84ee3a [FIR] Add tests for plugins compatibility
^KT-57140
2023-03-27 10:44:50 +00:00
Dmitriy Novozhilov a705bfe2cd [Test] Add regression test for KT-57477 2023-03-27 10:44:50 +00:00
Marco Pennekamp f9785c1050 [LL FIR] KT-57455 Avoid creating optional annotation class providers
- An `OptionalAnnotationClassesProvider` only needs to be created if the
  package part provider may even have optional annotation classes.
- In the IDE case, the package part provider never provides optional
  annotation classes, so especially in the IDE, we can avoid a lot of
  useless symbol providers with this.
2023-03-27 10:38:50 +00:00
Alexander Udalov d3be38476a Merge K2 box tests to main box tests 2023-03-27 10:32:19 +00:00
Alexander Udalov 14c2030595 Merge K2 bytecodeListing tests to main bytecodeListing tests 2023-03-27 10:32:17 +00:00
Ilya Goncharov 68dd89c593 [Gradle, JS] Fix binaryen registering tasks
^KT-57203 fixed
2023-03-27 09:32:09 +00:00
Vladimir Sukharev 5d3ab8371f Enabled fixed tests in FirStdlibTest
Merge-request: KT-MR-9289
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-27 08:56:25 +00:00
Kirill Rakhman 60b227c519 [FIR] Sort HMPP dependencies topologically for symbol providers
This fixes an issue where an actual class from an intermediate module
has more supertypes than its expect declaration which leads to a
false-positive resolution error because a type reference resolves to the
expect class. The fix is to sort the dependencies topologically from
"most actual" to "most expect" when creating the list of symbol
providers.

#KT-57369 Fixed
2023-03-27 07:41:05 +00:00
Dmitriy Dolovov 6fe0849402 [IR] Unify usages of isArrayOrPrimitiveArray() && isInlineArrayConstructor() 2023-03-24 19:12:17 +01:00
Dmitriy Dolovov 0f17191e0e [PL] Fix: Allow IrEnumConstructorCall with constructed class with kind=ENUM_ENTRY 2023-03-24 18:09:37 +00:00
Dmitriy Dolovov 66532d714e [PL] Fix: Respect inlined array constructor lambdas 2023-03-24 18:09:37 +00:00
Alexander.Likhachev 5baeae3bfd [Gradle] Set the useK2 option in AbstractKotlinCompileConfig
It's a common compiler argument and may be applied to any compile task, there's no reason to set it separately for K/JS and K/JVM, and now it sets the compiler argument for metadata compilation tasks as well
2023-03-24 18:08:10 +00:00
Yahor Berdnikau b5e36a3c1b Allow to force values in kotlin-compiler-arguments-plugin
Added readme how to use with external projects
2023-03-24 16:40:30 +00:00
Alexander.Likhachev ca59092318 [Gradle] Read the kotlin.useK2 gradle property value for K/N tasks 2023-03-24 16:07:23 +00:00
Ivan Kylchik f44d82ce6d Add test to check that name field in Java enum is not constant 2023-03-24 15:55:07 +00:00
Ivan Kylchik 63b340651d Add possibility to interpret and fold IrStringConcatenation expression 2023-03-24 15:55:06 +00:00
Ivan Kylchik 7cf9dda8dc [JS] Support evaluation of const intrinsics for K2
#KT-56023 Fixed
#KT-51582 Fixed
2023-03-24 15:55:04 +00:00
Ivan Kylchik e981b1f958 [Native] Support evaluation of const intrinsics for K2
#KT-56023
#KT-55469 Fixed
2023-03-24 15:55:03 +00:00
Ivan Kylchik 5d5582d201 Move ignoreConstOptimizationErrors compiler key from jvm to common
#KT-56023
2023-03-24 15:55:03 +00:00
Ivan Kylchik b58de2f8da Move ConstEvaluationLowering into folder for common lowerings
#KT-56023
2023-03-24 15:55:03 +00:00
Ivan Kochurkin c14dcfce4f [K2, MPP, JS] Fix a compiler crash on transitive common dependencies
^KT-57431 Fixed
2023-03-24 14:48:28 +00:00
Ivan Kochurkin 4e67d82cd3 [K2, MPP] Make MPP tests from k2/basic target-wide
^KT-57349
2023-03-24 14:48:27 +00:00
Ivan Kochurkin ee73e4774b [K2, MPP] Remove redundant expect declarations from klib metadata
^KT-57250 Fixed

Introduce flat Fir2IrActualizedResult

It contains output from Fir2Ir and IrActualizer
2023-03-24 14:48:26 +00:00
Ivan Kochurkin d91efb212d [K2, MPP] Rename jvm.kt to platform.kt in JS tests 2023-03-24 14:48:24 +00:00
Ivan Kochurkin 227018624e [K2, MPP] Add common constructorCache to Fir2IrCommonMemberStorage
Use it in Fir2IrDeclarationStorage

^KT-56660 Fixed
2023-03-24 14:48:24 +00:00
Mikhail Glukhikh 930237b60e K1: report swallowed diagnostic about upper bound violation
#KT-55055 Fixed
2023-03-24 14:27:03 +00:00
Denis.Zharkov b148df15a9 Fix project compilation
Compilation was broken becaise of the combination of
706ff6b61f and
9c2c11f7e9
2023-03-24 14:53:14 +01:00
Alexander Udalov 562b27db4e JVM IR: initialize enum entries without invokedynamic
#KT-57316 Fixed
2023-03-24 13:38:32 +00:00
Denis.Zharkov 9c2c11f7e9 FIR2IR: Fix "expected FirResolvedTypeRef but was FirJavaTypeRef" crash
The problem was that we were using unenhanced constructors that still
might contain java type refs.
Basically, most of the `firClass.declarations` usages are unsafe in that
meaning.

The test is very complicated because to reproduce the exception there
should be some conditions met:
- MyClass should be compiled with K1, so it has `@EnhancedNullability`
annotation serialized (that is unnecessary, but don't do any harm)
- `@Nls` scope should be properly resolved, so enum entries are converted
to resolved type refs
- That leads to attempt to check if null-check might be needed to be
inserted and to failure at FirTypeUtilsKt.getCanBeNull

While this quite controversial to have this check being performed for
freshly created annotations calls, the problem with improper constructor
lookup anyway existed and fixed correctly.

^KT-57213 Fixed
2023-03-24 13:07:42 +00:00
Dmitrii Gridin a643dfbe83 [FIR][tree] introduce lazy expression to simplify code
^KT-56543
2023-03-24 09:58:38 +00:00
Dmitrii Gridin bc5c1b2a6c [LL FIR] add test on lazy resolve annotation with type argument
^KT-56543
2023-03-24 09:58:11 +00:00
Dmitrii Gridin 8c599a84af [FIR][renderer] add phase renderer for file and file annotations container
^KT-56543
2023-03-24 09:58:11 +00:00
Dmitrii Gridin 706ff6b61f [FIR] pre-resolve some scope callables before creating a scope
In a lot of cases, when we want to process the
declaration in scope, it should be resolved to at least TYPES phase.

To avoid doing it manually in all our variety of scopes, we do it when the scope it created.
It was implicitly working manually before as lazy resolve did a lot of extra work
on resolving a declaration it was not supposed to resolve.
Now it's not the case, and we have to explicitly resolve all the declarations we need.

^KT-56543

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2023-03-24 09:57:46 +00:00
Ilya Kirillov 23e40693a3 [LL FIR] add api to FirLazyDeclarationResolver to resolve class with callable members
^KT-56543
2023-03-24 09:57:45 +00:00
Mikhail Glukhikh 25cb03b707 Add test ensuring the case of KT-57022 is fixed 2023-03-24 09:12:16 +00:00
aleksandrina-streltsova b23dbd359f [AA] Flatten composite scopes when building scope context for position
^KTIJ-25048 Fixed
2023-03-24 07:42:58 +00:00
Artem Daugel-Dauge 1c72ce173f [Gradle] Remove workarounds for KT-55751 in cocoapods tests 2023-03-23 21:02:20 +00:00
Sebastian Sellmair c45a9d6510 [Gradle] KotlinNativeTasks: buildDependencies: Add naive dependency loop protection
^KT-57531 Verification Pending
2023-03-23 20:56:41 +00:00