Commit Graph

101224 Commits

Author SHA1 Message Date
Sebastian Sellmair dbfa8d4c29 [Gradle] Defer .awaitSourceSets to 'AfterFinaliseRefinesEdges' and awaitFinalValue to 'AfterFinaliseDsl'
KT-58710
2023-05-16 13:19:42 +00:00
Nikolay Lunyak 27e9732f98 [FIR] KT-58686: Warn about the use of global counters 2023-05-16 12:11:47 +00:00
Nikolay Lunyak c57d9097c2 [FIR] Add the syntax tree suffix to buildResolveAndCheckFir 2023-05-16 12:11:47 +00:00
Nikolay Lunyak 51b8e400d9 [FIR] Sort KtSourceFiles analogously to KtFiles
The
`IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerate
.testSerializedSubClassAndChangedInterfaces`
test fail because the checksums of
the `manifest` files don't match
after the full recompilation.
It happens, because the `b.kt` file may be passed
to the compiler before `a.kt`, in which case while
generating the data class members the compiler
will generate a call to `Any::hashCode` when
accessing the hashcode of the `a` property instead
of generating a call to the fake override
`A::hashCode`.
When working with PSI, the compiler sorts the
input files to at `KotlinCoreEnvironment.kt:200`.

This change removes the flaky
behavior by sorting the input files.
2023-05-16 12:11:46 +00:00
Nikolay Lunyak 90651c5851 [FIR] KT-58065: Support LT in K2Native 2023-05-16 12:11:46 +00:00
Nikolay Lunyak d72a50b3f5 [FIR] KT-58065: Support LT in K2JsIrCompiler 2023-05-16 12:11:46 +00:00
Ilya Gorbunov bbb36ce501 KT-58046 Promote time sources, time marks, measureTime to stable 2023-05-16 11:42:32 +00:00
Nikolay Lunyak fd54706e1a [FIR] KT-58674: Set expected type for loop conditions
^KT-58674 Fixed
2023-05-16 10:40:25 +00:00
Nikolay Lunyak 737c8c20f6 [FIR] KT-58674: Ensure loop conditions have no expected type in K2 2023-05-16 10:40:25 +00:00
Kirill Rakhman a50ae9db9d [FIR] Revert workaround for IC issue surfaced by KT-58335
#KT-28233
2023-05-16 09:20:57 +00:00
Kirill Rakhman 878dd67d92 [FIR] Implement workaround for IC issue surfaced by KT-58335
#KT-28233
2023-05-16 09:20:57 +00:00
Kirill Rakhman 3c22b1ce53 [AA] Deserialize reference to typealias from stubs as fully expanded
#KT-58335
2023-05-16 09:20:57 +00:00
Kirill Rakhman 80d68fc908 [FIR] Deserialize reference to typealias from metadata as fully expanded
#KT-58335 Fixed
2023-05-16 09:20:57 +00:00
Stanislav Erokhin 17ad4ceec9 [KT-58666] Publish kotlin-dom-api-compat among IDE artifacts
This artifact is used in the MPP import tests in IDE

#KT-58666 Fixed
2023-05-16 08:58:55 +00:00
Dmitrii Gridin d68cb73930 [FIR] add debug info instead of CCE to some FirBasedSymbol 2023-05-16 08:51:09 +00:00
Yan Zhulanow c6d8876f9f [LL API] Pass the project instance to ProjectStructureProvider
Eliminate unnecessary PSI tree traversal by providing the 'Project'
instance explicitly.
2023-05-16 08:42:57 +00:00
Yan Zhulanow bb37a959d4 [LL API] Move composite declaration provider to be used in IntelliJ 2023-05-16 08:42:57 +00:00
Yan Zhulanow a93e9c3c19 [LL API] Remove incorrect ways to get modules/sessions
^KT-57559 Fixed
2023-05-16 08:42:57 +00:00
Yan Zhulanow d3cb41cbab [LL API] Pass contextual modules to 'KotlinDeclarationProvider' factory
^KT-57559 Fixed
2023-05-16 08:42:57 +00:00
Yan Zhulanow e9c077220f [LL API] Migrate 'getKtModule()' usages to 'ProjectStructureProvider'
Ensure the contextual module is passed wherever possible.

^KT-57559 Fixed
2023-05-16 08:42:57 +00:00
Yan Zhulanow c90d094af6 [LL API] Pass a contextual module to ProjectStructureProvider
In certain cases, it's impossible to determine which module owns a
particular file without knowing the analysis context. For instance,
the file might be a part of a physical module, and be also included into
a virtual ad-hoc module (to be analyzed in separate, e.g. a VCS diff).

The new API allows to pass a contextual module. Basically it means
"give me a module for this element, implying that we are now analyzing a
contextual module".

^KT-57559 Fixed
2023-05-16 08:42:57 +00:00
Yan Zhulanow 5e04c0d4f7 [LL API] Move 'FileBasedKotlinDeclarationProvider' to be used in IDE 2023-05-16 08:42:57 +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
Dmitriy Dolovov 2b913d7c47 [Native] Don't produce broken @Deprecated annotations in c-interop
#KT-58651
2023-05-16 08:30:29 +00:00
Dmitriy Dolovov 706a4e9919 [PL] Fix: Remove annotations containing unlinked arguments
Both explicitly specified and default argument expressions are considered.

In case an argument expression is considered as 'unlinked' the whole annotation
is removed from the declaration. An appropriate compiler warning logged for each
such case.
2023-05-16 08:30:29 +00:00
Sergej Jaskiewicz 6e8283a6fe [IR] Dump IdSignatures and mangled names in irText tests
The reason #1 for this feature is that we want to test IdSignatures
generated for declarations. Currently, there is no (easy) way to ensure
that a change in the signature building logic doesn't cause any breaking
changes wrt klibs.

Now, most IdSignatures include hashed mangled names in them, so even if
we catch a regression where the included hash changes, there would be no
way of knowing immediately what caused it, unless we'd also have mangled
names in the expectations.

The reason #2 is to test the manglers themselves. Currently, there are
no tests for them. They heavily duplicate each other, this is already
causing issues (see KT-57427) that would be very hard to catch without
these tests.

^KT-58238 Fixed
2023-05-15 18:20:45 +00:00
Sergej Jaskiewicz bccf69910d [test] Make test muting logic more generic 2023-05-15 18:20:45 +00:00
Jinseong Jeon b42d2e56a4 AA: use nameFilter of KtFileScope#get*Symbols 2023-05-15 19:25:05 +02:00
Nataliya.Valtman f87fdb43fa KT-57224: Add kotlin language version to file report 2023-05-15 16:23:59 +00:00
Sergej Jaskiewicz 3deea96b53 [IR] Introduce DumpIrTreeOptions for customizing IR dump
We plan to add more options => using a data class is better
than multiple function parameters
2023-05-15 15:47:34 +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
Nikolay Lunyak 200fb1e5ce [FIR] KT-54874: Ensure this code is red
^KT-54874 Fixed
2023-05-15 14:44:10 +00:00
Mads Ager 6117f76a8c Discourage the use of LANGUAGE_VERSION directive.
Pinning the language version is rarely the right thing to do.
This changes makes it harder to do so by requiring an additional
directive with a name that indicates to developers that they are
likely doing something dangerous.
2023-05-15 14:29:48 +00:00
Icyrockton df8e9206d2 remove duplicate import scope create 2023-05-15 17:18:36 +03:00
Vladimir Dolzhenko 8ad781987e Optimize file extensions usage
#KTIJ-25470

Merge-request: KT-MR-10135
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-05-15 13:59:24 +00:00
Jinseong Jeon 41473a948d SLC: implement PsiAnnotation#find(Declared)AttributeValue
^KT-58448 Fixed
2023-05-15 14:16:14 +02:00
Sebastian Sellmair 08f3d56d9b [Gradle] KotlinCompilationAssociator: Restore 1.8.10 behaviour for KotlinWithJavaTarget
^KT-58280 Verification Pending
2023-05-15 12:11:00 +00:00
Sebastian Sellmair 3196981799 [Gradle] Implement KT58280JvmWithJavaTestCompileClasspath to cover KT-58280 2023-05-15 12:10:59 +00:00
Svyatoslav Scherbina 1a1cc224a8 Bump Kotlin/Native version to 1.9.20-dev-1523 2023-05-15 12:07:53 +00:00
Yahor Berdnikau a2c874572a [Gradle] Fix adding additional res dirs to KotlinSourceSet does not work
In case of "org.jetbrains.kotlin.jvm" plugin Java SourceSet will create
ProcessResources task copying all registered resources.

^KT-36904  Fixed
2023-05-15 11:59:57 +00:00
Dmitrii Krasnov 958b0e6ebc refactored CommandLineArguments assertions functions
#KT-51553 In Progress
2023-05-15 11:02:20 +00:00
Denis.Zharkov c3ac2e44a0 Adjust test data for enabling ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
^KT-55388 Fixed
2023-05-15 10:43:19 +00:00
Denis.Zharkov fa85cbfe74 Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated in 1.9
^KT-36770 Related
^KT-53041 Fixed
^KT-55388 In Progress
2023-05-15 10:43:19 +00:00
Svyatoslav Scherbina 43b4791fd2 Native: mark -no-endorsed-libs compiler flag as deprecated
It no longer has any effect, and there is no intention to change that.
2023-05-15 10:10:57 +00:00
Svyatoslav Scherbina 16acb72521 Native: don't pack endorsed libraries (namely kotlinx.cli) into dist
The overall concept of "endorsed" libraries is currently unmaintained
and non-reviewed.
kotlinx-cli is in its alpha, and is available from Maven.

See also KT-54098.
2023-05-15 10:10:56 +00:00
Nikolay Lunyak 7b45f75213 [FIR] KT-58523: Check the companion presence when resolving type-aliases
The change in `QualifiedNameResolution.kt` is
backed by `starImportOnTypeAlias.fir.kt` and
`javaStaticMembersViaTypeAlias.fir.kt`.
Note that referencing inner classes via type-aliases is
prohibited, but referencing enum entries is not.

^KT-58523 Fixed
2023-05-15 10:03:19 +00:00
Nikolay Lunyak 99ff36c77a [FIR] KT-58523: Ensure the compiler resolves to the typealias 2023-05-15 10:03:18 +00:00
Ilya Goncharov 1b9ed568bb [Gradle, JS] Default stdOutput and errOutput on dry run with JS tests 2023-05-15 09:29:42 +00:00
Ivan Kylchik 3d4f3d2f57 [IR] Visit file annotations in IR interpreter
#KT-55866 Fixed
2023-05-15 08:32:37 +00:00
Mikhail Glukhikh 1ba900be44 FIR2IR: change origin & operator flag in data classes making them closer to K1
Related to KT-54887
2023-05-15 08:16:24 +00:00