Commit Graph

98267 Commits

Author SHA1 Message Date
Marco Pennekamp d6cb75ca91 [LL FIR] KT-55329 Support transitive dependsOn dependencies in LL FIR
- In contrast to other kinds of dependencies, `dependsOn` dependencies
  must be followed transitively.
- Add `transitiveDependsOnDependencies` to `KtModule`. These
  dependencies are calculated lazily with a topological sort. They are
  added to the dependency provider when it's built in
  `LLFirSessionFactory`.

^KT-55329 fixed
2023-01-30 17:17:58 +00:00
Marco Pennekamp 1803bd36cc [FIR] Fix IncDecOperatorsInExpectClass for FIR, add multi-module test
- `IncDecOperatorsInExpectClass.kt` should produce an
  `ACTUAL_WITHOUT_EXPECT` in K2 (see KT-55177). This went unnoticed
  because of KT-55570.
- A similar multi-module test for K1 and K2 has been added, called:
  `multiplatform/incDecOperatorsInExpectClass.kt`.
2023-01-30 17:17:57 +00:00
Marco Pennekamp 2faa247075 [FIR] KT-55570 Fix ACTUAL_WITHOUT_EXPECT reporting for empty classes
- FirExpectActualMatcherTransformer: Instead of returning,
  `transformMemberDeclaration` must assign an empty map to
  `expectForActualData` so that `FirExpectActualDeclarationChecker`
  doesn't assume that the member declaration needs no expect-actual
  checking.

^KT-55570 fixed
2023-01-30 17:17:57 +00:00
Marco Pennekamp 7c96124a38 [LL FIR] KT-55329 Rename refinementDependency to dependsOnDependency
- The new Kotlin MPP name for `refinementDependency` is
  `dependsOnDependency`.
2023-01-30 17:17:57 +00:00
Svyatoslav Scherbina fa352fd20e Bump Kotlin/Native version to 1.9.0-dev-764 2023-01-30 16:46:51 +00:00
Nikolay Lunyak 5994a99dbb [FIR] KT-54507: Report redundant for abstract interfaces
^KT-54507 Fixed

Merge-request: KT-MR-8490
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-01-30 16:45:20 +00:00
Svyatoslav Scherbina 7ef7d0e062 Native: fix Deprecation ObjCExport test after updating version to 1.9
Starting from language version 1.9, deprecation is not propagated
through overrides (see KT-47902 for more details).
As a result, after updating langauge version to 1.9 in 66544a4,
testObjCExport started to fail, because it expected the old behaviour.
This commit updates the test correspondingly.
2023-01-30 15:45:18 +00:00
Mikhail Glukhikh bf090cdc6d Add different black box tests around KT-52338 2023-01-30 14:55:41 +00:00
Mikhail Glukhikh f6bd4d5e15 Diagnostic tests: create fieldRename subDir and use it for related tests
Related to: KT-55846, KT-50082, KT-55436, KT-55017
2023-01-30 14:55:40 +00:00
Sebastian Sellmair 35c0a3d391 [Gradle] Keep stdlib-common for shared native source sets
^KT-56278 Verification Pending
2023-01-30 14:50:50 +00:00
Aleksei.Cherepanov 090a58ccc4 Change allConstants test
Currently, FIR compilation of `const val b: Byte = 50 + 50` shows an error, but old compiler doesn't (it shows only warning). Since this is an incremental test, it should not be affected by compiler errors, but should only test for .kt usage without recompilation.

#KT-54991 In Progress
2023-01-30 13:45:39 +00:00
Aleksei.Cherepanov a0fa438735 Revert "FIR IC: fix test with behavior different from non-tight cycle variants"
This reverts commit c4a29651 as it is no longer needed after IC fix: `5ba3053e` "[IC] Do not report recompilation of non-existing files", because now fix-ic-build.log duplicates the main build.log

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 67f308dbdb Add dummy test data
Gradle IC with enabled FIR compilation adds some extra files to the compilation scope compared to the previous compiler(KT-55576). Adding dummy files to such tests with expanded compilation scope will prevent green Aggregate build if some changes in IC will lead to full module compilation as there were such precedents with JS IC because otherwise, all files in the module are present in the build log.

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 848e1001f8 Add test for IC issue with typealias
If typealias is defined in a separate file, then after changing some base types, an incremental compilation of Kotlin could not find all affected files, because of lack of information, which it can not get on the class file analyzing phase. FIR provides a new approach to IC compilation: now we can run the frontend several times, which allows us to obtain all necessary information and use it to mark all affected files for recompilation.
Relates to KT-54991

#KT-28233 Fixed
2023-01-30 13:45:37 +00:00
Pavel Kirpichenkov 25668ddd01 [MPP] Do not postpone warning reporting for HMPP props to afterEvaluate
The check itself happens during application time, remove the health
check wrapper for reporting to make the code more clear. One downside is
that the warning could be reported on misconfigured projects, but it's
a minor inconvenience.

KT-55891
2023-01-30 13:21:00 +00:00
Pavel Kirpichenkov a03db78ed2 [MPP] Fix warning reports for subprojects
Properly report warnings for projects that don't apply multiplatform
plugin in the root project, but declare the obsolete properties

KT-55891
2023-01-30 13:21:00 +00:00
Pavel Kirpichenkov b0c360b1b6 [MPP] Change the deprecation message for HMPP properties
KT-55891
2023-01-30 13:21:00 +00:00
Pavel Kirpichenkov 37c87b0a84 [MPP] Don't report HMPP deprecation warnings on subprojects
MPP plugin applied to a root project leads to false positive reports
in its subprojects. Also, granular metadata flag is not supposed to be
set in subprojects. Reporting only for the root project should cover
most of the cases.

KT-55891
2023-01-30 13:20:59 +00:00
Mads Sig Ager 7c3cc1d5c1 [JVM_IR] Limit inner class attributes to types in class file (#5081)
* [JVM_IR] Limit inner class attributes to types in class file

Inner class attributes should only be recorded for types that
are materialized in the result class file. In particular, we
should not emit inner classes attributes for types that appear
only in fake overrides. We do map these types to track the
fake overrides for JVM signature clashes but they are not
materialized in the class file.

^KT-56104 Fixed

* [JVM_IR] Consistently pass around materialized boolean in mapType.
2023-01-30 14:11:07 +01:00
Pavel Punegov c9aeadd31f [K/N] Remove old Compiler and Meta Version ^KT-55677 Fixed
* Replace it with KotlinCompilerVersion
* K/N version should be set now with `deployVersion`.
* Cleanup deprecated functions in older versions
 of the Gradle plugin
* Cleanup tests for older versions of compiler downloader

Merge-request: KT-MR-8436
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-30 13:10:08 +00:00
Roman Golyshev 5ec626b29d [Analysis API] KTIJ-24453 Handle TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM error in KtFe10CallResolver.kt
It makes call with such type of errors completely unresolvable in
Analysis API

^KTIJ-24453 Fixed
2023-01-30 12:45:19 +00:00
Yahor Berdnikau 137e4b0422 Update duckduckgo benchmark
It is still not working due to koltin-androidx-extensions plugin usage.
2023-01-30 12:43:13 +00:00
Yahor Berdnikau 09ab70473d Update kvision benchmark 2023-01-30 12:43:13 +00:00
Yahor Berdnikau ff2de0e2b9 Also clean newly added files.
Some patches could add new file and after hard reset they are not
deleted. This leads to patch apply failure.

Updated JGit otherwise clean command was not working properly.
2023-01-30 12:43:12 +00:00
Yahor Berdnikau 5541d1d8a2 Update graphql-kotlin benchmark. 2023-01-30 12:43:12 +00:00
Yahor Berdnikau 3f4c824a23 Run benchmarks in the same suite
This should reduce variation in results, especially when overall time is
 quite low.
2023-01-30 12:43:12 +00:00
Sebastian Sellmair ace1bc76a1 [Gradle] IdeProjectToProjectCInteropDependencyResolver: Ensure lenient resolution
^KT-56285 Verification Pending
2023-01-30 12:42:05 +00:00
Marco Pennekamp 2f876a2094 [LL FIR] Pass correct session invalidators to LLFirSessionFactory 2023-01-30 12:39:42 +00:00
Yan Zhulanow fdf515baff [LL API] Add more logging to collectDesignationPathWithContainingClass() 2023-01-30 11:11:27 +00:00
Yan Zhulanow 699f96284a [FE] Add missing 'lazyResolveToPhase()' before recursive bound check
^KTIJ-24087 Fixed
2023-01-30 11:09:42 +00:00
Svyatoslav Scherbina 322a8a443b Native: add included forward declarations into cinterop klib manifest
This allows the compiler to limit imports from "magic" packages like
cnames.structs to forward declarations actually present in dependent
cinterop klibs.

The manifest already had `exportForwardDeclarations` field, but
- it didn't include Objective-C forward declarations (@class, @protocol)
- it has a slightly different meaning (the export list enables importing
  the listed declarations through the interop package of the library,
  while the include list shouldn't do that), so we better avoid mixing
  them.
2023-01-30 11:00:33 +00:00
Svyatoslav Scherbina 86a29a7b07 Native: correct ObjCExport test for forward declarations
The test relies on the fact that any name can be imported from a "magic"
package like `objcnames.classes`.
This was the case for K1, but likely won't be for K2: the compiler
should allow importing only those names that are actually
forward-declared in a cinterop library.

This commit changes the test that way. In particular, moves it to a
different task that has a cinterop dependency.
2023-01-30 11:00:32 +00:00
Svyatoslav Scherbina 445d44b79a K2/Native: simplify forward declarations test to make it work with K2 2023-01-30 11:00:32 +00:00
Svyatoslav Scherbina f3ed006ed9 Native: add a test for forward declarations with two cinterop libs 2023-01-30 11:00:31 +00:00
Svyatoslav Scherbina d4f5d5297f K2/Native: simplify forward declarations test to make it work with K2 2023-01-30 11:00:31 +00:00
Svyatoslav Scherbina 46a85d9729 Native: add a test for cinterop forward declarations 2023-01-30 11:00:30 +00:00
Leonid Startsev 26330133ab Support intrinsifying of serializer() function when it is seen inside multifile class part
It's needed to be able to correctly compile kotlinx-serialization-core itself,
as compiler sees real function, not one from a facade.

#KT-56244 Fixed
2023-01-30 10:49:46 +00:00
Dmitriy Novozhilov 993695a7d0 [Commonizer] Mute tests due to KT-56207 2023-01-30 09:30:00 +00:00
Alexander Udalov 25c600c556 Fix incorrect check for major version in core:metadata
It affected the changed test in the following way: "strict metadata
version semantics" is a flag which is written to the .kotlin_module file
between the version and the protobuf data, see `ModuleMapping:73`. But
flags are written only for Kotlin 1.4+, i.e. if `isKotlin1Dot4OrLater`
returns true. So in the test, the flag was not written, thus we did not
detect that the module actually has incompatible metadata, and thus
incorrectly did not report an error.

It also has an effect that version requirements for nested classes will
now be written correctly to protobuf with metadata version 2.0+.
2023-01-30 09:30:00 +00:00
Dmitriy Novozhilov 71f8cfa193 [Maven] Fix running scripts from maven 2023-01-30 09:29:59 +00:00
Artem Kobzar d58d9a5c77 fix runing legacy js maven tests in integration tests. 2023-01-30 09:29:59 +00:00
Yahor Berdnikau 861563fdb0 [KGP] Fix test fails with LV 1.3
Kotlin compiler now throws error with LV 1.3 meaning KGP could not be
used with Gradle 6.x.
2023-01-30 09:29:59 +00:00
Dmitriy Novozhilov 2988d671f7 [Test] Update CompileKotlinAgainstCustomBinariesTest
We have several tests which tests how compiler with LV = LATEST_STABLE
  can consume binaries compiled with LV = LATEST_STABLE + 1 with
  different CLI flags. For LV = 2.0 we have special rules for those flags,
  so testdata was changed

After switching LV in repository to 2.0 this testdata should be rolled back
2023-01-30 09:29:58 +00:00
Dmitriy Novozhilov e942e87feb [JS CLI] Fix == on strings with equals call 2023-01-30 09:29:58 +00:00
Dmitriy Novozhilov 2fddb15539 [Test] Move some builder inference tests from codegen to diagnostics
^KT-56169
2023-01-30 09:29:58 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Dmitriy Novozhilov 66544a4e00 Switch kotlin version to 1.9
with appropriate fixes in testdata, tests and other
places.
2023-01-30 09:29:55 +00:00
Nikolay Lunyak e2403c801f [FIR] KT-55747: Report error for operator fun mod
^KT-55747 Fixed

Merge-request: KT-MR-8522
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-01-30 08:48:33 +00:00
Ilya Chernikov 37a7044e74 FIR LT: fix line offsets calculations for text files with crlf
#KT-55886 fixed
2023-01-30 08:47:40 +00:00
Kirill Rakhman 836c4fcefd FIR: Report missing cases of TYPE_PARAMETER_IS_NOT_AN_EXPRESSION
^KT-55699 Fixed
2023-01-30 08:24:20 +00:00