Commit Graph

105684 Commits

Author SHA1 Message Date
Roman Golyshev ef31eeae52 KTIJ-26423 [AA] Get rid of the old testdata for KtImportOptimizer
This testdata is some form will be transferred to the `intellij` repo
2023-10-25 20:53:14 +00:00
Roman Golyshev 4e4f3075bd KTIJ-26423 [AA] Get rid of FE10 implementation of KtImportOptimizer
As of now, this implementation is not supposed to be used at all

If (for some reason) it becomes relevant again, please refer
to the 7fd441f1 commit which contained a FE10 implementation
of this service (copied from the old FE10 implementation of
import optimizer)
2023-10-25 20:53:14 +00:00
Roman Golyshev a6668919b0 KTIJ-26423 [AA] Remove FE10 tests for KtImportOptimizer
We don't plan to seriously support the FE10 implementation of
`KtImportsOptimizer` service, since it's not going to be used in IDE
(it has its own old version of import optimization logic)
2023-10-25 20:53:13 +00:00
Roman Golyshev 306f404a69 KTIJ-26423 [AA] Get rid of local declarations in KtFirImportOptimizer
Adjust `computeImportableName` to return null for when passed symbol
is local
2023-10-25 20:53:13 +00:00
Roman Golyshev 421793673b KTIJ-26423 [AA] Extend KtImportOptimizer testdata with imports usage information
`KtImportOptimizerResult.unusedImports` should be removed soon, and
part of the testdata for the import optimizer service should go
to `intellij` repository
2023-10-25 20:53:12 +00:00
Mikhail Glukhikh f90831398c K2: temporarily comment unstable part of FlagDelegatesTest.testDelegation
Related to KT-62581
2023-10-25 20:19:39 +00:00
Mikhail Glukhikh d42ae35624 K2: support DELEGATION member kind for properties #KT-62581 Fixed 2023-10-25 20:19:39 +00:00
Mikhail Glukhikh 19bf11f041 FlagDelegatesTest: accept K2 behavior for KT-62582 2023-10-25 20:19:39 +00:00
Dmitrii Gridin ab393d0340 [LL FIR] add more lazy resolution tests on property from constructor
^KTIJ-26215
2023-10-25 19:54:56 +00:00
Dmitrii Gridin f66bb1bcb7 [FIR] FirScriptConfiguratorExtensionImpl: avoid creation of dummy elements
This will reduce memory and CPU consumption

^KT-61186
2023-10-25 19:00:20 +02:00
Ivan Kylchik e827f260e7 [IR] Simplify IrProperty?.isConst check in interpreter 2023-10-25 16:43:25 +00:00
Ivan Kylchik a97c0bab0b [IR] Simplify access to IrProperty from IrCall and IrField in interpreter 2023-10-25 16:43:25 +00:00
Vladimir Sukharev 604c8edd1c [K/N] Fix kt53261_* tests to be dummy in debug mode
^KT-62157 Fixed


Merge-request: KT-MR-12720
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-25 16:07:01 +00:00
Ilya Goncharov 065733e87c [FIR] Add UNINITIALIZED_ENUM_ENTRY on access qualifier of local enum
^KT-59967 fixed
2023-10-25 15:36:11 +00:00
Jinseong Jeon 1ccb085e68 SLC: use fully expanded type when computing nullability
^KT-62757 fixed
2023-10-25 14:59:50 +00:00
Ilya Goncharov 573bc34b56 [JS] Invoke processing separately for suspend and non-suspend function
^KT-62771 fixed
2023-10-25 13:28:58 +00:00
Alejandro Serrano Mena f227447837 [K2] Disallow named functions as expressions
^KT-62573 Fixed
^KT-59945 Fixed
2023-10-25 13:24:30 +00:00
Sergej Jaskiewicz aaf7ccbebd [util] Introduce IndentingPrinter interface
This interface is more convenient to pass around so that it's easier
to replace different printer implementations.
2023-10-25 13:04:15 +00:00
Sergej Jaskiewicz 895d107ac5 [util] Convert Printer from Java to Kotlin 2023-10-25 13:04:14 +00:00
Sergej Jaskiewicz c442d0e159 [util] Rename Printer.java to Printer.kt before converting it to Kotlin
This is to preserve the Git history of the file.
2023-10-25 13:04:14 +00:00
Christoph Loy cf8b41970e [Gradle, Kapt] Run kapt even when all dependencies are indirect
Previously, kapt skipped the execution, if the "kapt" configuration had
no direct dependencies (via `kapt.dependencies.isEmpty()`).
This lead to kapt not working, if all
annotation processors are declared in a super-configuration of kapt.

With this change, we also consider super-configurations
(via `kapt.allDependencies.isEmpty`) and fix the described bug.

^KT-62518 Fixed
2023-10-25 12:25:41 +00:00
Dmitriy Novozhilov fb8bf19091 [IR] Rename IrSymbolInternals to UnsafeDuringIrConstructionAPI
The new name more precisely describes the meaning of this opt-int
2023-10-25 11:32:46 +00:00
Marco Pennekamp 38ebe60e9f [FIR] Refactoring: Move set utility functions to setUtils.kt 2023-10-25 11:04:36 +00:00
Marco Pennekamp 8d2bf8828c [LL FIR] Remove LLFirProviderHelper.getTopLevelClassNamesInPackage
- We shouldn't bypass the symbol names cache, as the IDE declaration
  provider doesn't cache name sets.

^KT-57314
2023-10-25 11:04:36 +00:00
Marco Pennekamp efe587691b [FIR] Type "top-level classifier names in package" as Name
- This is more consistent with "top-level callable names in package" and
  simplifies the set construction quite a bit, as we can avoid a lot of
  `asString` conversions.
2023-10-25 11:04:36 +00:00
Marco Pennekamp 8034d522b9 [LL FIR] Respect allowKotlinPackage in LLFirKotlinSymbolNamesProvider
- `LLFirProviderHelper` is guarded by `allowKotlinPackage` and the
  symbol names provider should reflect that in the name sets.
- Note that this does not apply to stub-based deserialized symbol
  providers, because they do not pass any value to `allowKotlinPackage`.

^KT-57314
2023-10-25 11:04:36 +00:00
Anna Kozlova e79bc5bb59 [AA] KtExpressionInfoProvider.getMissingCases: fix no subject case
return missing else branch (even if it's present, see kdoc)

^ KT-62875 fixed
2023-10-25 09:41:38 +00:00
Hung Nguyen 19104f73bf Fix casting of extraProperties in PropertiesBuildService
`project.extraProperties` may contain values that are not `String`s. To
avoid failing on those values, we should cast the value with
`as? String` instead of `as String?`.

Test: New PropertiesBuildServiceTest
^KT-62496 Fixed
2023-10-25 09:17:34 +00:00
Dmitrii Gridin 3941b05909 [FIR] do not transform annotations on delegated property accessors during implicit type phase
^KT-62874 Fixed
2023-10-25 08:59:15 +00:00
Dmitrii Gridin 1b636bf450 [FIR] add tests on annotations for delegated getter during implicit type phase
^KT-62874
2023-10-25 08:59:15 +00:00
Ilya Kirillov 11e7500d9e [native] remove usage of experimental asUByteArray() stdlib function
^KT-62510
2023-10-25 08:38:08 +00:00
Ilya Kirillov 633c2d11e5 [native] remove obsolete experimental stdlib api usage annotations
^KT-62510
2023-10-25 08:38:08 +00:00
Ilya Kirillov a65c735feb [build] add checks to ensure that no modules which are part of the IDE plugin do not use experimental stdlib API
to ensure binary compatibility with stdlib inside IntelliJ.

This includes using the latest stable kotlin API version and
forbidding using experimental declarations from stdlib.

^KT-62510
2023-10-25 08:38:07 +00:00
Sebastian Sellmair ded5cf2caa [Gradle] Replace 'configureArchivesAndComponent' with KotlinTargetArtifact
KT-61634
2023-10-25 08:34:48 +00:00
Sebastian Sellmair eb4daa4482 [Gradle] Implement CreateTargetConfigurationsSideEffect and NativeForwardImplementationToApiElementsSideEffect
KT-61634
2023-10-25 08:34:48 +00:00
Sebastian Sellmair 787420cc21 [Gradle] Introduce KotlinTargetSideEffect and KotlinCompilationSideEffect
KT-61634
2023-10-25 08:34:48 +00:00
Sebastian Sellmair f89a46710a [Gradle] Implement KotlinTargetSideEffect.extensionPoint
KT-61634
2023-10-25 08:34:47 +00:00
Ivan Kochurkin 1827df82c4 Removed useless as casts from compiler code
It allows compiling code with K2 and enabled `-Werror`
2023-10-24 20:59:56 +00:00
Ivan Kochurkin d50c6f1b6d [FIR] Fix missing USELESS_CAST
`FirUselessTypeOperationCallChecker` always checks exact types matching for `as` operator

Simplify code of cast checker and utils

^KT-56629 Fixed
^KT-56615 Fixed
^KT-59820 Fixed
2023-10-24 20:59:56 +00:00
Dmitrii Gridin 2f8026f335 [LL FIR] add missed diagnostic tests for scripts
^KT-62840
^KT-62841
^KT-62861
2023-10-24 19:32:54 +00:00
Dmitrii Gridin 8e623ee73a [LL FIR] support script tests 2023-10-24 19:32:54 +00:00
Mikhail Glukhikh cba9f1c559 AA: fix PSI finding for FIR callable fake overrides 2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 5bd9b282a0 K2/JS: fix JS_NAME_CLASH positioning as source was changed for callable copies 2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 30c35d79f4 LL API: unwrap callable copies while determining their sources
In previous commit (K2: prefer derived class sources...)
we changed default source for callable copy (e.g. substitution override)
to its owner class. This can create an unexpected situation in LL API,
because normally KtCallableDeclaration is expected to be a source.
This commit introduces "compensation" on analysis API side.
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 3cb9396b20 K2: prefer derived class sources for callable copies (e.g. fake overrides) 2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 4b2a122f80 FIR2IR: make delegate field/accessors sources closer to PSI2IR
#KT-59864 Fixed
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 47fec1a113 K2: use similar sources for if branches (PSI/LT)
Related to KT-59584
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 21b4ce050c K2: add source range test to ensure #KT-59584 Fixed 2023-10-24 17:08:40 +00:00
Mikhail Glukhikh 920b0bfe63 FIR2IR: use SYNTHETIC_OFFSET for data class generated members 2023-10-24 17:08:40 +00:00
Mikhail Glukhikh a9894b1842 K2: use derived class sources for callable copies if base callables have no sources
Related to KT-60155
2023-10-24 17:08:40 +00:00