Commit Graph

3845 Commits

Author SHA1 Message Date
Alexander Korepanov e4d7897071 [JS IR] Check fir compilation errors after checking IC next round 2023-05-23 10:13:26 +00:00
Sergej Jaskiewicz 973adb6a38 [test] Remove TARGET_BACKEND: JVM_IR for non JVM-specific irText tests
If they fail on other backends, use the IGNORE_BACKEND directive instead
2023-05-16 18:28:23 +00:00
Nikolay Lunyak d72a50b3f5 [FIR] KT-58065: Support LT in K2JsIrCompiler 2023-05-16 12:11:46 +00:00
Vladimir Sukharev bbe1e708f9 [K2/N] Rewrite mpp tests from old native infra to new
^KT-58543

Merge-request: KT-MR-10065
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-16 08:41:39 +00:00
Sergej Jaskiewicz 1a8d5056bf [test] Mute an irText test on JS_IR instead of making it JVM-only
The test is not in any way JVM-specific, but it fails on the JS BE
because of different fq-names of stdlib symbols on JVM and JS.

The fix is in progress. Mute the test until the fix is ready.
2023-05-15 15:40:25 +00:00
Mikhail Glukhikh 5d35bfd88d Add IR text test for KT-54887 2023-05-15 08:16:24 +00:00
Mikhail Glukhikh a86279b766 IR text: add a test with data object 2023-05-15 08:16:24 +00:00
Ivan Kochurkin d06d3ff467 [FIR2IR] Consider isExpect value of super members during fake-overrides generating
It's important for FIR2IR and IrActualizer

Because `isExpect` is a part of signature, and it's considered during actualization
2023-05-12 14:03:15 +00:00
Alexander Korepanov 1920bbde07 [K/JS] Enable partial linkage tests 2023-05-11 12:37:01 +00:00
Ilmir Usmanov aec78ab2d8 Minor. Add regression test for KT-42696
#KT-42696 Fixed
2023-05-11 11:15:06 +02:00
Ivan Kylchik d26e3871ba [K2] Support interpretation of values in type annotations
#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kochurkin 31424e38ac [FIR] Consider the isExpect value of the receiver class for intersection overrides
It's critical for signature calculation in FIR2IR because `isExpect` is a part of signature
2023-05-10 14:17:53 +00:00
Artem Kobzar c7853c61b6 [K/JS] Make TS tests generating faster 2023-05-10 13:27:46 +00:00
Alexander Udalov 987e8c25dc K2: do not generate line numbers for delegated members
Psi2ir does not generate them, see
https://github.com/JetBrains/kotlin/blob/1.8.20/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt#L319.

Besides influencing debugger and coverage behavior, it also affects how
conflicting JVM signature diagnostics are reported because they
use offsets to determine which element to report the error on. So after
this change, K1 and K2 behavior is the same in that regard as well.

 #KT-58215 Fixed
2023-05-10 10:32:07 +00:00
Ivan Kochurkin 988927154e [Tests] Extract common dependentIrModuleFragments and diagnosticReporter for IrBackendInput 2023-05-09 20:50:01 +00:00
Alexander Udalov 45bf70c9f9 Minor, add debug stepping test for KT-44745 2023-05-09 12:44:47 +00:00
Mikhail Glukhikh aec0def5ca FE: add test for KT-58332 (K2 fails with ARGUMENT_TYPE_MISMATCH) 2023-05-09 09:19:37 +00:00
Mikhail Zarechenskiy 6d7dc45ce6 K1: Add test for compatibility check of Enum.entries
Basically, the test checks that adding Enum.entries feature doesn't
break the existing code where it clashes with the user-defined "entries"
declaration; it's better to have a black-box test to be sure
that the compiler doesn't invoke something different at runtime

 The test covers KT-53153 and KT-56587

Merge-request: KT-MR-9798
Merged-by: Michail Zarečenskij <Mikhail.Zarechenskiy@jetbrains.com>
2023-05-08 15:35:25 +00:00
Xin Wang 7b4e6bae0e JVM: ensure the $ENTRIES field is initialized before use
#KT-57784 Fixed
2023-05-04 23:11:39 +02:00
Pavel Kunyavskiy af318fdfb0 [K/N] Fix default arguments in suspend functions
AddContinuationToFunctionsLowering was rewritten in way the order
of this lowering and defaults lowering doesn't matter.

^KT-58214
2023-05-03 12:14:53 +00:00
Dmitriy Novozhilov e9c8be3b64 [FIR] Don't generated fake-overrides for private declarations of actualized super classes
^KT-58252 Fixed
2023-05-02 10:24:53 +00:00
Sergej Jaskiewicz ac79f0c456 [test] Don't run JVM-specific irText test against other backends 2023-05-02 09:53:57 +00:00
Alexander Korepanov 2aea5822b2 [JS IR] Unmute all fir invalidation tests 2023-05-01 12:56:12 +00:00
Alexander Korepanov 9da9c95105 [JS IR] Add IC test for interface with default implementation 2023-05-01 12:49:07 +00:00
Dmitriy Novozhilov f7733e819d [FIR] Approximate captured types during approximation of local types
^KT-57222 Fixed
2023-04-30 15:58:32 +00:00
Alexander Udalov cd9209a7ee JVM: enable -Xlambdas=class in some codegen tests
Most of these tests check the specific structure of lambdas when they
are generated as classes, and they start to fail once invokedynamic
lambdas are enabled by default.
2023-04-28 21:34:19 +00:00
Alexander Udalov 163afc94bc JVM: prepare asmLike tests for indy lambdas by default
Use -Xlambdas=class in tests which were checking specific things related
to how anonymous classes for lambdas work (such as receiver mangling,
function arity etc.)
2023-04-28 21:34:19 +00:00
Alexander Udalov fc0ce415d7 JVM: remove source code from not null assertion message text
This is implemented under a LanguageFeature which will be enabled later,
when behavior change described in KT-57570 is approved.

 #KT-57570
2023-04-28 10:26:15 +00:00
Mikhail Glukhikh 70c5978add K2: Approximate ILT in vararg expressions properly #KT-57487 Fixed 2023-04-27 12:19:38 +00:00
Ilya Chernikov a045a0a81c FIR: use default getter in serializer if fir contains none
since we generate the default getter in this case in
Fir2IrDeclarationStorage.createIrProperty, so the serialized metadata
should follow the same behavior.
#KT-57373 fixed
2023-04-27 09:14:20 +00:00
Mikhail Glukhikh 4172ce1018 K2: reproduce KT-58008 2023-04-25 16:42:59 +00:00
Artem Kobzar 27b103e2ca [K/JS] Eliminate duplication of init block inside exported ES-classes ^KT-58246 Fixed 2023-04-25 16:21:08 +00:00
Alexander Korepanov 81b591ed21 [JS IR IC] Interface default implementations affect IC hash
Adding or removing a method or property with
a default implementation to an interface should
invalidate all children: we must regenerate JS code for them

^KT-56237 Fixed
2023-04-25 15:34:22 +00:00
Alexander Udalov 3120a35a88 JvmDefault: remove most tests on @JvmDefault
The tests are removed because JvmDefault is going to be deprecated with
error in KT-54746 and removed later in KT-57696.

Many of the removed tests already had existing counterparts with the new
modes `all` and `all-compatibility`. In this change, I've added such
tests where they were missing, and removed tests which were testing
behavior specific to the JvmDefault annotation, such as some
diagnostics.

 #KT-54746
2023-04-25 14:33:00 +00:00
Nikolay Lunyak 931894ab3c [FIR] KT-57655: Add the missing condition
^KT-57655 Fixed
2023-04-25 10:57:08 +00:00
Nikolay Lunyak c4d5332251 [FIR] KT-57655: Ensure the current IR is incorrect
The
`FirPsiBlackBoxCodegenTestGenerated.testImplicitIntegerCoercionNamedArg`
test fails in K2 with "java.lang.Integer
cannot be cast to kotlin.UInt".
2023-04-25 10:57:07 +00:00
Kirill Rakhman d96c33e080 [FIR] Add dynamic stages to callable reference resolution
This fixes an overload resolution ambiguity on callable references
in the presence of a dynamic extension receiver.

#KT-58143 Fixed
2023-04-25 10:03:40 +00:00
Dmitriy Novozhilov 903e969598 [FIR2IR] Correctly calculate offsets for implicit toLong() calls during constant evaluation
^KT-58132 Fixed
2023-04-25 09:36:17 +00:00
Dmitriy Dolovov e85406b561 [PL][tests] Learn PL test infra to work with JS files
^KT-57378
2023-04-25 08:00:14 +00:00
Dmitriy Dolovov b5ad5edc08 [PL][JS] Add test for handling external declarations
^KT-57378
2023-04-25 08:00:14 +00:00
Artem Kobzar 9bcfd093c5 [K/JS] Remove super keyword insertion if the body of method was moved into another place (private methods, lambdas, coroutines) ^KT-57990 Fixed 2023-04-24 13:54:36 +00:00
Anton Bannykh c839fdca3e [JS IR] initial support for KLIB incremental compilation with K2 2023-04-23 14:47:48 +02:00
Ivan Kochurkin b72dcf8b37 [K2, MPP] Fix actualization of nullability-based overloads
^KT-58043 Fixed
2023-04-20 17:22:45 +00:00
Artem Kobzar c5b60a16bb [K/JS TESTS] Remove .ts files genereting from generateTests command to enable Gradle execution optimizations
Warning Context:
> Task :js:js.tests:generate-ts-for-regular-classes-in-exported-file
Execution optimizations have been disabled for task ':js:js.tests:generate-ts-for-regular-classes-in-exported-file' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: './js/js.translator/testData/typescript-export/regular-classes-in-exported-file'. Reason: Task ':js:js.tests:generate-ts-for-regular-classes-in-exported-file' uses this output of task ':js:js.tests:generate-js-export-on-file-for-regular-classes' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.6.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

> generateTypeScriptTests
> tsc --build ./typescript-export/regular-classes-in-exported-file/tsconfig.json
2023-04-20 16:13:40 +00:00
Dmitriy Dolovov 7da05d66e3 [PL][tests] Run JS tests with enabled PL with ERROR log level
#KT-57378
2023-04-20 10:23:47 +00:00
Kirill Rakhman 6972391185 [FE] Make dynamic a suitable resulted type
This fixes a FIR-specific issue where a type variable is inferred to
Any instead of dynamic. K1 wasn't affected because of a FIR-specific
condition in ResultTypeResolver.

#KT-57962 Fixed
2023-04-20 08:45:42 +00:00
Kirill Rakhman e80b4c530d [FIR2IR] Properly handle intersection types in interface delegation
The changes to the irText test data result in the fact that we
now unconditionally unwrap substitution overrides of delegation targets
whereas before we built an unsubstituted scope of the type we delegate
to. If we delegate to a class A : B<C>, the unsubstituted scope of
A can still contain substitution overrides for inherited generic methods
from B<T> that we didn't unwrap before but do unwrap now.

#KT-57899 Fixed
2023-04-20 08:12:55 +00:00
Kirill Rakhman 35c6da1aa7 [FIR2IR] Fix and refactor generation of dynamic call receiver generation
#KT-57988 Fixed
2023-04-20 08:04:07 +00:00
Kirill Rakhman 8b47a4fa48 [FIR] Fix resolution of objects in presence of low-priority candidates
For CallKind.VariableAccess, the condition when to *skip* resolution of
objects was previously collector.isSuccess. This wasn't strict enough
because collector.isSuccess could be true when the best found candidate
has an applicability like RESOLVED_WITH_LOW_PRIORITY (e.g. from dynamic
scope or annotated with @LowPriorityInOverloadResolution). In these
cases, we do want to resolve objects. To fix this, the condition is
changed to collector.shouldStopResolve which is stricter.

#KT-57960 Fixed
2023-04-20 08:04:07 +00:00
Ivan Kylchik 621f5a0fb7 [IR] Reorganize test files in involvesIrInterpreter dir 2023-04-19 13:52:48 +00:00