Commit Graph

99742 Commits

Author SHA1 Message Date
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
Sebastian Sellmair 89df0ed213 [Gradle] KotlinNativeTasks: buildDependencies: Filter constraint dependencies
^KT-57531 Verification Pending
2023-03-23 20:56:41 +00:00
Sebastian Sellmair 3f4b37693f [Gradle] Implement test Kotlin Native Link with cycle in dependency constraints
... to cover KT-57531
2023-03-23 20:56:41 +00:00
Pavel Mikhailovskii 0e6da53af8 KT-57491 Prefix context receivers with $context_receiver_ 2023-03-23 16:23:09 +00:00
nataliya.valtman f3592088fe Temporary Ignore flaky test 2023-03-23 16:05:01 +00:00
Sergej Jaskiewicz 691d9abde6 [test] Unmute irText tests that don't fail on K2 anymore 2023-03-23 15:24:32 +00:00
Abduqodiri Qurbonzoda 9076e5b112 [K/N] Mark BitSet usages in stdlib with @ObsoleteNativeApi 2023-03-23 14:48:23 +00:00
Abduqodiri Qurbonzoda 9ff863ced7 [K/N] Mark BitSet with @ObsoleteNativeApi #KT-57088 2023-03-23 14:48:23 +00:00
Abduqodiri Qurbonzoda 3ffbfba1d6 [K/N] Introduce ObsoleteNativeApi annotation
An opt-in annotation to mark the Kotlin/Native standard library API
that is considered obsolete and is being phased out.
2023-03-23 14:48:22 +00:00
Mikhail Glukhikh 9af944669a FIR2IR: bind fake overrides for classes on the fly right after member processing
#KT-57441 Fixed
2023-03-23 13:12:18 +00:00
Mikhail Glukhikh d3f1571d35 FIR2IR: add repro for KT-57441 2023-03-23 13:12:17 +00:00
nataliya.valtman d6a9bca5ec Create plugin for test to set language and api kotlin versions 2023-03-23 12:34:01 +00:00
Pavel Kunyavskiy 1c2f34ab4e [K/N] Add test for Annotations on type parameters and update doc
^KT-57404
2023-03-23 10:27:23 +00:00
Dmitriy Dolovov 66c278ff8d [JS][IC][test] Remove testBreakKlibBinaryCompatibilityWithVariance test
#KT-57078 Fixed
2023-03-23 10:24:28 +00:00