Commit Graph

98312 Commits

Author SHA1 Message Date
Mikhail Glukhikh 5fc0aa769b FE: add more tests around KT-56061 2023-01-31 22:05:16 +00:00
Marco Pennekamp 17500b225d [LL FIR] Remove FIR_IDE_IGNORE test directive
^KT-50732 fixed
2023-01-31 20:28:46 +00:00
Sebastian Sellmair 06a2069d6b Bump Kotlin/Native version to 1.9.0-dev-886
^KT-56205 Verification Pending
2023-01-31 16:15:20 +00:00
Sebastian Sellmair b6ea04d789 [K/N] Don't add linkDependencies when serializing a metadata klib
^KT-56205 Verification Pending
2023-01-31 16:15:19 +00:00
Sebastian Sellmair 1978566fee [K/N] SearchPathResolver: Do not emit warning for LenientUnresolvedLibrary
^KT-56205 Verification Pending
2023-01-31 16:15:19 +00:00
Anna Kozlova 48b1456290 [CLI] create ArgumentParseErrors instances on request
spare memory for projects with big number of modules
currently 500kb for IJ monorepo of mostly empty errors
2023-01-31 16:08:23 +00:00
Kirill Rakhman f7f50ca842 [FIR2IR] Use cached IrEnumEntry when available in Fir2IrConverter
Calling createIrEnumEntry lead to "IllegalStateException:
Fir2IrEnumEntrySymbol for [declaration] is already bound" when the
IrEnumEntry was already created previously, e.g. by an annotation call
referencing it.

^KT-54079 Fixed
2023-01-31 15:40:25 +00:00
Kirill Rakhman feb6fd0e0d Revert "[FIR2IR] Temporary fix of createIrEnumEntry"
This reverts commit c9a8f433fb.

KT-54079
2023-01-31 15:40:24 +00:00
Vsevolod Tolstopyatov 79f6d4b590 Address classloader leak in a recently-introduced ClassValueCache
Root cause:
Cached in ClassValue values are prohibited to reference any java.lang.Class or ClassValue instances as they are considered as strong roots that prevent Class and ClassValue garbage collection,
creating effectively unloadable cycle.
This problem is also known as JDK-8136353.

Actions taken:
* Extract anonymous ClassValue instance into a separate static class that does not capture anything implicitly
* Wrap cached values in ClassValue into SoftReference to avoid unloadable cycles

^KT-56093 Fixed
2023-01-31 16:22:03 +01:00
Yahor Berdnikau 752de6c622 Don't override compilation freeCompilerArgs in link task
Calling '.addAll()' was replacing convention value leading for inability
to add/modify Kotlin/Native link task freeCompilerArgs via
KotlinCompilation.options.freeCompilerArgs. For now convention
was replaced by normal value.

^KT-56280 Fixed
2023-01-31 15:01:10 +00:00
Vyacheslav Gerasimov ff2db23c11 Build: Set kotlin.daemon.jvmargs in buildSrc to the same value as in the root project
#KTI-915

Merge-request: KT-MR-8589
Merged-by: Vyacheslav Gerasimov <Vyacheslav.Gerasimov@jetbrains.com>
2023-01-31 13:57:27 +00:00
Alexander Udalov 2849e45111 Kapt tests: change _ir.txt to .ir.txt
To be consistent with test data of other compiler tests.
2023-01-31 13:49:44 +00:00
Mikhail Glukhikh f0ea8ab81b FIR2IR: make IrGetValue type consistent with IrVariable type
#KT-55458 Fixed
2023-01-31 13:43:26 +00:00
Mikhail Glukhikh 1c4d9175e7 FIR2IR: add test for KT-55458 2023-01-31 13:43:26 +00:00
Mikhail Glukhikh 9378da6f27 FirElementSerializer: drop no longer necessary code for accessor annotations 2023-01-31 13:16:13 +00:00
Svyatoslav Kuzmich bebb9b1392 [Wasm] Move compiler tests to :wasm:wasm.tests module
They don't belong in K/JS test module.
2023-01-31 13:12:12 +00:00
Ilya Chernikov 46c8cbe1bb FastJarFS: fix behavior on invalid zip files
"emulate" the ZipHandler - log error and ignore invalid file
#KT-55712 fixed
2023-01-31 12:50:29 +00:00
Anna Kozlova b415aa7446 [FIR] take ready implicit unit type instead of return type calculation
and assert that symbol is not a substitution/intersection override
in the `compute` method otherwise.

Because `fakeOverrideSubstitution` should be calculated for all real
implicit types, no call to this method should actually happen.

Otherwise, it can be problematic to create a session
which would contain the full designation path:
`provider.getFirCallableContainerFile(symbol)`
returns `firFile` of a super class which might be from module `a`,
when declaration and its outer classes are from module `b`.

^KTIJ-24105
2023-01-31 11:21:17 +00:00
aleksandrina-streltsova f3cbc1b2d4 [Analysis API] Add API for obtaining scope with synthetic properties
^KTIJ-22359 Fixed
2023-01-31 11:02:18 +00:00
Svyatoslav Kuzmich e517df1533 [Wasm] Mark JsAllowImplementingFunctionInterface with OTHER kind
This fixes test failures when advancing bootstrap.

When a language feature has UNSTABLE_FEATURE kind, enabling it causes
the compiler to mark the compiled library with the pre-release flag.

JsAllowImplementingFunctionInterface feature is enabled by default in
Wasm backend. So effectively, all Wasm klibs are marked with the
pre-release flag, including the standard library.

Pre-release checks were enabled recently and cause compiler errors.

To fix the problem, this commit changes the feature kind to OTHER, which
doesn't enforce the pre-release flag.

Merge-request: KT-MR-8582
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-01-31 10:18:08 +00:00
Nikita Nazarov fe5a8f664a Add debug information for inline function parameters (#5050)
Add debug information for inline function parameters

Previously during debugging Kotlin/Native applications you couldn't inspect the inline function or inline lambda parameters. This happened because the debug information for them wasn't generated at all. To fix this issue we have to store the information about which expressions were inlined instead of which parameters. This commit adds a new mapping, which allows storing the required information during the inlining phase. The mapping is then reused during the bitcode generation phase to add the debug information for inline function parameters.

^KT-55440
2023-01-31 11:02:48 +01:00
Vladimir Dolzhenko edf9c3a2f5 Add more diagnostic info
Resolver could be GCed if there is no any valid hard reference to it.
Some impl of PackageFragmentProvider (like DelegatingPackageFragmentProvider)
keep hard ref to resolver.
For the sake of investigation it is worth to know what kind of PFP is there.

#EA-725255

Merge-request: KT-MR-8581
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-01-31 09:09:28 +00:00
Kirill Rakhman 5e56845ce0 Analysis API: Add tests for KT-54648 2023-01-31 08:39:43 +00:00
Kirill Rakhman 63a908cff8 FIR, Assign plugin: Update for KT-54648 2023-01-31 08:39:43 +00:00
Kirill Rakhman 1eb18f13bd FIR: Fix test data after making LHS of assignment an expression
KT-54648
2023-01-31 08:39:43 +00:00
Kirill Rakhman ace47c06a5 FIR: Make LHS of FirVariableAssignment a FirExpression
This way references can even be resolved for erroneous assignments
(e.g. function call, if expression, ... on LHS)

^KT-54648 Fixed
2023-01-31 08:39:42 +00:00
Kirill Rakhman e9b8d6db80 Add words to dictionary 2023-01-31 08:39:41 +00:00
Kirill Rakhman 4e9ae3b5e3 Reformat FirExpressionsResolveTransformer 2023-01-31 08:39:41 +00:00
Dmitriy Novozhilov a084bcbbb5 [FIR] Expand expected types before ILT approximation
^KT-56176 Fixed
2023-01-31 07:53:12 +00:00
Dmitriy Novozhilov 4941fcd10e [FIR] Report PRIVATE_CLASS_MEMBER_FROM_INLINE on qualifiers of companions
^KT-56172 Fixed
^KT-55179
2023-01-31 07:53:12 +00:00
Dmitriy Novozhilov 522eec8c51 [FIR] Fix reporting PRIVATE_CLASS_MEMBER_FROM_INLINE on members of companion
^KT-56172
^KT-55179
2023-01-31 07:53:12 +00:00
Dmitriy Novozhilov d856ae1f35 [FIR] Move common members in symbols up in the hierarchy 2023-01-31 07:53:11 +00:00
Dmitriy Novozhilov a83caec94f [FE 1.0] Implement deprecation PRIVATE_CLASS_MEMBER_FROM_INLINE_WARNING warning
^KT-55179
^KT-56171 Fixed
2023-01-31 07:53:11 +00:00
Dmitriy Novozhilov d01a2c7271 [Test] Add test for KT-45814
^KT-45814 Can't reproduce
2023-01-31 07:53:10 +00:00
Dmitriy Novozhilov a1a9a55e1a [Test] Add test for KT-41952
^KT-41952 Obsolete
2023-01-31 07:53:09 +00:00
Dmitriy Novozhilov 4c96495eef [FIR] Put new contract syntax under feauture flag
^KT-55171 Fixed
2023-01-31 07:53:09 +00:00
Dmitriy Novozhilov 2783aa13f5 [Backend] Restore isMostPreciseContravariantArgument method for binary compatibility
^KT-56033 Fixed
2023-01-31 07:53:08 +00:00
Dmitriy Novozhilov 36bb418049 [Parcelize] Add test for KT-47074 2023-01-31 07:53:08 +00:00
Anton Lakotka 37007a28ac [Gradle] Report deprecated source set layouts outside after evaluate
^KT-55730 Verification Pending
2023-01-31 07:43:15 +00:00
Anton Lakotka 3c343543e9 [Gradle] Legacy metadata compilation should contain all source sets from
depends on closure of its default source set.

With HMPP it is no longer needed, since each source compiles
independently and sees its parent declarations via klib dependencies

^KT-55730 Verification Pending
2023-01-31 07:43:15 +00:00
Anton Lakotka 23f10a1d38 [Gradle] Deprecate case when commonMain depends on another source set
^KT-55824 Verification Pending
2023-01-31 07:43:14 +00:00
Artem Vasilev ccc3f52acf [FIR] Rename FirSyntheticPropertiesStorage, extract property creation 2023-01-30 20:05:51 +00:00
Artem Vasilev 075a80613b [FIR] Introduce cache for not-yet-enhanced synthetic properties
The original synthetic properties from Java were not cached anywhere and
created anew for every session. However, the enhanced properties are
(along with their originals) saved inside the session's cache, causing
inconsistency with newly created symbols via referential equality.
2023-01-30 20:05:50 +00:00
Pavel Kunyavskiy cb655d2d37 [K/N] Fix work with adapted function references
Their parsing was totally incorrect for K2, and sometimes incorrect for
K1. After this commit it uses same code as for JVM.

^KT-55462
2023-01-30 19:44:49 +00:00
Marco Pennekamp 9a693fa967 [FIR] Update backend tests with actual/expect in same module
- The fix for KT-55570 caused some backend tests to fail, because errors
  are now correctly reported for simple classes and actual/expect in
  the same module is not supported in FIR. See KT-55177.
- The commit also adds separate tests for K2. Unfortunately, these have
  to be disabled for K1 because K1 then reports "expect without actual"
  errors.
2023-01-30 17:17:58 +00:00
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