Commit Graph

99209 Commits

Author SHA1 Message Date
Yan Zhulanow 07fdbeca19 [LL API] Search declarations in dependencies as a fallback
'JvmClassFileBasedSymbolProvider' works incorrectly for some cases,
such as built-in classes. Moreover, the whole declaration binding logic
looks over-complicated and redundant, as we get a 'ClassId'/'CallableId'
from a 'KtDeclaration', and look for it again in indices.

This commit fixes a bunch of failing completion tests:
- HighLevelJvmBasicCompletionTestGenerated
- HighLevelMultiFileJvmBasicCompletionTestGenerated
- FirKeywordCompletionHandlerTestGenerated
2023-03-06 17:49:16 +00:00
Yan Zhulanow 342488e66e [LL API] Restrict accepted declarations for on-air resolution
After 1cfd2ae7ff, all non-local
declarations became targets for on-air resolution. However, some of
them, including secondary constructors, are not supposed to be used
in that way. The commit restores the previous behavior.

This commits fixes failing tests in the following groups:
- FirIdeDependentAnalysisSourceModuleIsUsedAsExpressionTestGenerated
- FirIdeDependentAnalysisSourceModuleReferenceResolveTestGenerated
- FirOnAirResolveTestGenerated
2023-03-06 17:49:16 +00:00
Artem Kobzar 26f6661d1e [K/JS] Remove the possibility to have negative lines and columns in Source Maps 2023-03-06 16:55:26 +00:00
Pavel Kunyavskiy f2c1145462 [K/N] Disable failing test on mips, target is deprecated 2023-03-06 11:56:10 +00:00
Kirill Rakhman b80970b09f [FIR] Fix references to generic synthetic properties
When synthetic properties are built from a substitution override,
set originalForSubstitutionOverride, too.

^KT-56251 Fixed
2023-03-06 09:45:02 +00:00
Yan Zhulanow 37760d1f2a [Analysis API] Support script declarations (KTIJ-21108) 2023-03-05 19:18:21 +00:00
Yan Zhulanow e5e0575ab0 [LL API] Avoid dependencies in compiled element searcher
Library modules depend on all other project modules. Such a
simplification is useful for cross-library analysis. However, this
seems to be rather harmful for PSI->FIR binding as there might be
several versions of the same library in a project.
2023-03-05 19:18:20 +00:00
Yan Zhulanow 2d8c3c5aaf [LL API] Fix vararg parameter matching in PSI-FIR comparison 2023-03-05 19:18:20 +00:00
Yan Zhulanow 8b1be89507 [LL API] Check raw expect/actual modifiers in PSI-FIR comparison
There might be both common and JVM artifacts of the same library
in dependencies.
2023-03-05 19:18:20 +00:00
Yan Zhulanow 1cfd2ae7ff [LL API] Fix on-air analysis for scripts (KTIJ-21108)
The implementation is rather limited. Advanced cases, such as
replacing a script with another one with different import directives,
won't work because of non-trivial relationship between 'FirFile' and
'FirScript'.
2023-03-05 19:18:19 +00:00
Yan Zhulanow ae40ddcf03 [LL API] Provide basic support for scripts in K2 (KTIJ-21108) 2023-03-05 19:18:19 +00:00
Sergey Bogolepov ca7d1d0194 [K/N] Minor -Xcompile-from-bitcode enhancements 2023-03-04 16:13:43 +00:00
Johan Bay 349a6b6e82 Introduce flag for bitcode to native compilation
This enables splitting the compilation pipeline into multiple
invocations of the compiler.
2023-03-04 16:13:42 +00:00
vladislav.grechko 7033d78641 Fix SAM conversion generation condition
Remove check if array is passed to vararg parameter as it's not
relevant anymore and leads to ^KT-51821.

^KT-51821: Fixed
2023-03-04 12:53:48 +00:00
Yan Zhulanow c604577132 Embed DefaultErrorMessages extension list (KT-57102)
Normally, 'DefaultErrorMessages' extensions should only be loaded
from the main compiler JAR. However, in the in-process JPS build,
there are two versions of the compiler classes in the process, and
'ClassLoader's there are not fully isolated.

'ServiceManager' loads extensions from both 'META-INF' locations. If
the JPS plugin bundles newer compiler components, newly appeared
'DefaultErrorMessages' extensions will be loaded from the JPS (parent)
'ClassLoader', causing an exception.

Such a problem appeared with 'DefaultErrorMessagesWasm':

- - - - -
java.util.ServiceConfigurationError:
org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages$Extension: org.jetbrains.kotlin.wasm.resolve.diagnostics.DefaultErrorMessagesWasm not a subtype
- - - - -
2023-03-04 06:38:34 +00:00
Sergej Jaskiewicz f40278c036 An option to allow out-of-scope type parameters in IrManglerComputer
In the lowered IR there are often references to type parameters whose
containers are not in the current scope. This is incorrect semantically,
but it works in practice due to erasure, so when the mangler is used on
the lowered IR, we don't want to crash the compiler.
2023-03-03 22:08:57 +00:00
Sergej Jaskiewicz e3a4d6fa56 Use star-projected types for building ScriptProvidedPropertyDescriptors
Otherwise, the type parameters of the `kotlin.script.state` property
of type `AggregatedReplStageState` were undefined, which led to
building an ill-formed signature for the script class constructor.
2023-03-03 22:08:57 +00:00
Sergej Jaskiewicz 27adfa8370 [FIR] Provide the correct type parameters when building arrayOf function 2023-03-03 22:08:56 +00:00
Sergej Jaskiewicz 88e244c1cf [IR] Remove JS-specific manglers, as they don't customize any behavior 2023-03-03 22:08:56 +00:00
Sergej Jaskiewicz 1651199ed8 [IR] Add doc comments for KotlinMangleComputer and its inheritors 2023-03-03 22:08:56 +00:00
Sergej Jaskiewicz c447b91101 [IR] Factor out duplicated code in KotlinMangleComputer into base class 2023-03-03 22:08:55 +00:00
Ivan Kochurkin de5b475f7a [FIR] Use KlibBasedSymbolProvider in FirCommonSessionFactory
Unify logic of KLib resolving (Common and JS)

^KT-56354 Fixed
2023-03-03 20:58:24 +00:00
Ivan Kochurkin d829f8b684 [FIR] Drop using of JavaSymbolProvider and OptionalAnnotationClassesProvider in FirCommonSessionFactory
Drop using of all Java stuff inside FirCommonSessionFactory

^KT-56063
2023-03-03 20:58:24 +00:00
Svyatoslav Kuzmich 4be359ba02 [Wasm] Add @SinceKotlin("1.9") to js(code) 2023-03-03 19:39:12 +00:00
Svyatoslav Kuzmich c9c0b9fd10 [Wasm] Add more jsCode diagnostic tests with String properties 2023-03-03 19:39:11 +00:00
Svyatoslav Kuzmich 3566d918d2 [Wasm] Deprecate @JsFun with warning
kotlin.js.js("code") should be used instead
2023-03-03 19:39:11 +00:00
Svyatoslav Kuzmich 01fcc84d73 [Wasm] Refactor callingWasmDirectly.kt test from @JsFun to @WasmImport 2023-03-03 19:39:11 +00:00
Svyatoslav Kuzmich 7175b9f31c [Wasm] Migrate usages of @JsFun to js("code") 2023-03-03 19:39:10 +00:00
Svyatoslav Kuzmich 7a04999e4a [Wasm] Add K1 compiler diagnostics for js(code) calls (KT-56955)
This function is handled as intrinsics and supported in limited context
2023-03-03 19:39:10 +00:00
Svyatoslav Kuzmich 60ef7fcb49 [Wasm] Suppress unused parameters warning for functions with JS body
These parameters can be used in js(code)
2023-03-03 19:39:09 +00:00
Svyatoslav Kuzmich 71e6b19760 [Wasm] Support restricted version of js("code") (KT-56955) 2023-03-03 19:39:09 +00:00
Svyatoslav Kuzmich eb8c47343a [Wasm] Don't use js("code") in browser API
Use internal newJsObject to create new objects instead.

This is a preparation for restricted js("code") support (KT-56955)
2023-03-03 19:39:09 +00:00
Pavel Mikhailovskii 086d914f64 Regenerate tests 2023-03-03 19:27:24 +01:00
Pavel Mikhailovskii a6e1826bbc Reimplement the fix for KtSuperTypeList.findEntry 2023-03-03 15:38:12 +00:00
Vyacheslav Gerasimov 499ab48d30 Revert "[Build] Fix compilation of kotlinx-atomicfu-runtime in 1.9.0"
This reverts commit 4ab39b908e.
2023-03-03 15:06:23 +00:00
Vyacheslav Gerasimov 34fcbb32ff Revert "[Build] Fix compilation of kotlin-js(-ir) libraries in 1.9.0 (stdlib and test)"
This reverts commit d39fd9416a.
2023-03-03 15:06:23 +00:00
Andrei Klunnyi 661a2626f3 KT-56632 Script configuration isn't loaded for embedded code snippets
From now on we load script configurations for embedded Kotlin code
snippets. Potentially this might lead to an extra load during a file
analysis.

IDEA side test for the change is here:
`HighlightingTestGenerated.Uncategorized#testKotlinInJavaInjection`

^KT-56632 fixed
2023-03-03 12:49:38 +00:00
Svyatoslav Kuzmich 3c35328c09 [Wasm] Fix overriding external fun with default parameters (Fix KT-56976) 2023-03-03 12:33:53 +00:00
Artem Vasilev 564d44b16d [FIR] Test for duplicate filtering for overrides from Java 2023-03-03 11:06:19 +00:00
Artem Vasilev f7dea5bd70 [FIR] Filter duplicates in KtSymbolDeclarationOverridesProvider's output
^KT-54430
2023-03-03 11:06:18 +00:00
Artem Vasilev cac612f967 [FIR] Use symbol's FirSession in KtFirSymbolDeclarationOverridesProvider
^KT-54430 Fixed
2023-03-03 11:06:18 +00:00
Artem Kobzar 4eb5af68f4 [K/JS] Add @deprecated commentary if @Deprecated annotation exists on a declaration.
^KT-56405 Fixed
2023-03-03 10:18:11 +00:00
Vladimir Sukharev 31a16ba72c [K2/N] KT-56579 Enable fixed test mpp_optional_expectation
Merge-request: KT-MR-9063
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-03 08:41:19 +00:00
aleksandrina-streltsova 1a10e0fdb6 [Analysis API] Render annotations of type parameters 2023-03-03 06:43:08 +00:00
Vladimir Sukharev 0c2e3d2d48 Rename K2 test tasks
Merge-request: KT-MR-9069
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-02 20:58:31 +00:00
Yahor Berdnikau 8f07a9cc61 Cleanup unused Kotlin daemon dependencies 2023-03-02 16:24:54 +01:00
Dmitrii Gridin 60a8bb9a73 move kotlin-build-common to common artifact instead of fe10
^KTIJ-24819
2023-03-02 14:16:03 +00:00
Dmitriy Novozhilov 8c6d4a6f4b [FIR] Create intersection overrides for fields in intersection type scope
^KT-56820 Fixed
2023-03-02 13:40:59 +00:00
Sergey.Shanshin 4e56079c59 [KxSerialization] Fix "SyntheticAccessorLowering should not attempt to modify other files"
Added additional check for generated serializer to use cached child serializers

Fixes #KT-56990

Merge-request: KT-MR-9057
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-03-02 13:34:48 +00:00
Steven Schäfer 669ac1ae30 Parcelize: Handle nullable sparse arrays
Fixes https://issuetracker.google.com/269956252
2023-03-02 12:47:17 +01:00