6850 Commits

Author SHA1 Message Date
Mikhail Glukhikh f6af5e6d03 LV 2.0: unmute/fix/delete some FirCompileKotlinAgainstCustomBinaries tests 2023-09-19 15:46:29 +00:00
Ilya Chernikov 3dc1b26d83 Fix cli testdata for changed diagnostics in K2 2023-09-19 15:46:28 +00:00
Ilya Chernikov 0883b4468b LV20 mute test related to main function detection
related to #KT-44557
2023-09-19 15:46:27 +00:00
Ilya Chernikov 137dfbaca4 LV20: fix LauncherScriptTest testdata
note: the follow-up ussue for one of the changes - KT-60865
2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 2a8b655294 Update tests after switching to LV 2.0
Related to KT-59171
2023-09-19 15:46:27 +00:00
Pavel Kunyavskiy 9a9598c16b [Klib] Run prerelease checker in all backends
The checker also checks the metadata version, which
would be handled separately. Now it would never
emmit this error for klib-based backends.

^KT-61773
^KT-61596
^KT-55809
2023-09-15 09:48:42 +00:00
Alexander Udalov fec2d063c1 K2: report PRE_RELEASE_CLASS on JVM
Note that 3 tests are still muted, but for another reason: for FIR
versions of the tests, we need to compile the "pre-release library" with
the next language version which is 2.1. But since currently
LanguageVersion.LATEST_STABLE is 1.9, the compiler refuses to read
metadata of version 2.1, regardless of its own language version. Which
is correct, but it leads to irrelevant errors in the test output -- the
ones about the incompatible metadata version, NOT about the
prereleaseness.

These 3 tests can be unmuted once the default language version is
switched to 2.0.

 #KT-60780 Fixed
2023-09-06 08:05:34 +00:00
Alexander Udalov 8738ffb84f K2: suppress exception when reading unsupported metadata
Before the change, the compiler threw exception in the unmuted tests,
because it tried to load metadata even though it had an unsupported
version. Use the same approach as in K1 (see
DeserializedDescriptorResolver).

Now the tests are unmuted, but note that test data differs from K1. K1
does not report errors related to the class `a.A` because it loads this
class as a _Java class_, so calling its constructor and methods somehow
works. This behavior is questionable since the compiler surely knows
that it is a Kotlin class, but with an unsupported metadata version.
Trying to interpret it as a Java class may lead to subtle problems. So
it's safer for now to avoid loading Kotlin classes with unsupported
metadata versions in K2.

 #KT-60795 Fixed
2023-09-06 08:05:34 +00:00
Alexander Udalov 8f720ad24b K2: support -Xskip-metadata-version-check
#KT-60795
2023-09-06 08:05:34 +00:00
Alexander Udalov 7d60b5df43 K2: report INCOMPATIBLE_CLASS in JVM
#KT-60795
2023-09-06 08:05:34 +00:00
Artem Kobzar 9d00dfd76e [K/JS] Unmute custom binaries tests for JS because of fixed KT-54905 2023-08-29 09:17:17 +00:00
Kirill Rakhman c30ce4aabe [FIR] Print operator keyword and token to unresolved diagnostic message
#KT-55672 Fixed
2023-08-28 08:12:25 +00:00
Mikhail Glukhikh 4f5a00ac2a Use language version 1.9 in (JsIr)AnalysisHandlerExtensionTest 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh f9c7a88175 Add -Xuse-fir-lt=false to some scripting tests
make them compatible with K2
2023-08-25 08:57:53 +00:00
Alexander Udalov fdab636a1b Tests: add missing language version in a Java modules test
The main function in this test class to compile a bunch of sources is
`module`, which was changed to test different language versions in
4e706ba93e. But this test uses `compileLibrary` directly, so we need to
pass LV manually.

 #KT-60797
2023-08-22 08:34:18 +00:00
Kirill Rakhman fa77e3952d [FIR] Bring equivalent call behavior closer to K1
#KT-61159 Fixed
2023-08-21 12:11:58 +00:00
Alexander Udalov d81c79b3bc Tests: fix language version in tests about PRE_RELEASE_CLASS
Do not force language version to be LATEST_STABLE. There are now two
versions of this test, one for K1 (LV <= 1.9) and another for K2 (LV >=
2.0), and language version is chosen automatically in `compileKotlin`.
2023-08-18 10:49:48 +00:00
Dmitriy Dolovov 033bb385b9 [IR] Drop expectDescriptorToSymbol completely
^KT-61136
2023-08-16 19:17:17 +00:00
Alexander Udalov bddc18e463 K2: do not run compilation if Java module graph setup failed
#KT-61156 Fixed
2023-08-14 16:32:15 +00:00
Alexander Udalov 4e706ba93e K2: add JavaModulesIntegrationTest
#KT-60797
2023-08-14 16:32:15 +00:00
Alexander Udalov b1fb5bdde1 Minor, rename JavaModulesIntegrationTest and move to separate package 2023-08-14 16:32:15 +00:00
Ilya Chernikov 0c35e97a8d Tests: fix testLightTreeReadLineEndings
- it is now depends on the propery configured environment
2023-08-09 23:58:51 +00:00
Mikhail Glukhikh 0abf17201f K2: fix implementation of EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT
This commit fixes
`FirCompileKotlinAgainstCustomBinariesTest.testUnreachableExtensionVarPropertyDeclaration`.
2023-08-09 23:58:51 +00:00
Alexander Udalov 54c7466074 Tests: add CompileKotlinAgainstCustomBinariesTest for K2
This is needed because after changing default language version to 2.0,
we still need to test many scenarios from this test in K1.

Move K1-specific tests to OldCompileKotlinAgainstCustomBinariesTest, and
K2-specific tests to FirCompileKotlinAgainstCustomBinariesTest.

Mute failing K2 tests via `muteForK2`. It will throw exception if the
muted test will suddenly start passing.
2023-08-09 23:58:51 +00:00
Alexander Udalov 21c7325dbe Tests: remove actualTypealiasToCompiledInlineClass test
This test uses multiple features which are obsolete and will be
discontinued soon:
- Language version 1.4
- Expect/actual declarations in the same module
- Declaring inline classes via "inline class"
2023-08-09 23:58:51 +00:00
Alexander Udalov bad7fa597b Tests: move some tests to diagnostics 2023-08-09 23:58:51 +00:00
Alexander Udalov b3b9ffaea9 Tests: remove obsolete txt dumps in CompileKotlin...Test
Check that the client code compiles against the "broken" classpath
instead. Descriptor text dump is a part of the obsolete test
infrastructure and should not be used anymore.
2023-08-09 23:58:50 +00:00
Alexander Udalov 19abb66886 Tests: minor cleanup in CompileKotlinAgainstCustomBinariesTest
Fix inspections, formatting
2023-08-09 23:58:50 +00:00
Ilya Gorbunov 69a87efdd9 js.tests: change paths to kotlin-stdlib-js.klib
Change the expected klib name of stdlib

KT-56106
2023-08-03 14:47:20 +00:00
Alexander Udalov 9c03dcd230 Do not write version requirements for suspend functions
Previous attempt was at 6807ed6642, but it was reverted in 7771e5914d
(see that commit for the explanation). Now it should be fine to remove
these version requirements.

No issue reported because it's mostly not a user-visible change. The
main effect is that it reduces differences in metadata between K1 and
K2, namely it fixes the ValueClass.kt kotlinp test.
2023-07-31 13:05:29 +00:00
Alexander Udalov afd35accd8 Do not write version requirements for InlineClasses
Language feature InlineClasses is enabled since 1.3. The current lowest
supported language version is 1.4, so any compiler that can read
binaries produced by the current compiler also supports inline classes,
which means that the version requirement is not needed anymore.

No issue reported because it's mostly not a user-visible change. The
main effect is that it reduces differences in metadata between K1 and
K2, because K2 never supported writing this version requirement properly
due to the TODO in `hasInlineClassTypesInSignature`.
2023-07-31 13:05:29 +00:00
Alexander Udalov eeef70b2c8 Tests: remove TargetBackend.JVM_OLD
TargetBackend.JVM is equivalent to it at this point.
2023-07-17 16:55:24 +00:00
Jinseong Jeon 6fc02c3408 SLC: ROOT package exists no matter what
^KT-59843 Fixed
2023-07-11 11:47:23 +02:00
Ilya Goncharov 9ef5ce2af4 [JS] Migrate JsVersionRequirementTest 2023-07-06 08:08:56 +00:00
Ilya Goncharov 3bdb8b6d11 [JS] Migrate multiplatform integration compiler test 2023-07-06 08:08:55 +00:00
Ilya Goncharov a6d461dbe8 [JS] Fix compile kotlin against custom binaries 2023-07-06 08:08:55 +00:00
Ilya Goncharov 148d8c9246 [Gradle, JS] Migrate JS cli tests to ir backend 2023-07-05 07:10:06 +00:00
Dmitriy Dolovov 4c0583e415 [IR] Two modes of signature rendering
^KT-59486
2023-06-26 15:59:31 +00:00
Jinseong Jeon 7f1424737e LC: rework modality of enum class
It is abstract if it has abstract member.
It is final if it doesn't have enum entries that need subclass.
Otherwise, it is open (i.e., no modifier)

^KT-57567 Fixed
2023-06-23 16:19:06 +02:00
Ilya Chernikov 6f8049ffd3 CLI: support -language-version option in cli runner 2023-06-20 16:38:32 +00:00
Nikolay Lunyak 70605c84df [FIR Native] KT-58549: Get rid of the builtin provider
According to
`FirNativeCodegenBoxTestGenerated.testNestedClassesInAnnotations`,
the annotation
`kotlin.internal.PlatformDependent` is
unresolved reference.

^KT-58549 Fixed
2023-06-01 10:27:54 +00:00
Ilya Kirillov c114cb67cb [Java resolution] make it possible to provide custom source element for JavaElement
This is needed to allow using PSI pointers in IDE in JavaElement.
`JavaElement`s are reused between read actions,
so underlying PSI elements might be invalidated when using hard PSI references

^KT-58194
2023-05-31 13:01:19 +00:00
Alexander Udalov 2951e0b955 Rename/remove some compileKotlinAgainstCustomBinaries tests
"oldJvm*" tests are no longer testing the old JVM backend, so remove
that prefix from them. Also, remove the test "firAgainstOldJvm" because
it is now checking something that cannot NOT work.
2023-05-30 14:46:09 +00:00
Alexander Udalov bb4bb58453 Remove tests on -Xuse-ir compiler flag
This flag is going to be removed because old backend is not supported
anymore, therefore there's no need to test it.
2023-05-30 14:46:09 +00:00
Alexander Udalov fb900d2e2a JVM: remove most usages of JvmTarget.JVM_1_6 2023-05-19 13:24:00 +00:00
Kirill Rakhman 3c66ae0f8b [FIR, LT] Report syntax error by traversing LT after parsing
#KT-57756 Fixed
2023-05-05 09:34:24 +00:00
Kirill Rakhman a818c543a9 [FIR] Verify diagnostic messages don't reference non-existent parameters 2023-04-27 12:54:31 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Nikolay Lunyak 20786bb35a [FIR] Refactor the default messages presence checking
Forbid calling `checkMissingMessages` accidentally
outside tests.

Checking Parcelize default messages inside a test.
2023-04-14 13:07:03 +00:00
Ilya Chernikov df35e5431c FIR: fix libs filtering for abs/rel paths combinations
Some of the incoming paths "absoluteness" may not match the
one of the corresponding library path, and that leaded to incorrect
filtering out some items in the deserialized symbol providers.
Fix the filtering to account for the mismatch.
#KT-57535 fixed
2023-04-13 11:18:38 +00:00