Commit Graph

104286 Commits

Author SHA1 Message Date
Yan Zhulanow 0fbf648971 [LL API] Pull smart casts from the CFG in 'ContextCollector'
^KT-61599 Fixed
2023-09-04 15:47:56 +00:00
Yan Zhulanow 1247ef750f [LL API] Refactoring, compute PsiElement inside 'dumpContext()' 2023-09-04 15:47:56 +00:00
Yahor Berdnikau f866883871 [Gradle] Also configure JsIrLink tasks with target compiler options
This should synchronize options between JS compile and link tasks
configured with target compiler options DSL.

^KT-61253 Fixed
2023-09-04 14:29:00 +00:00
Yahor Berdnikau 38e7bf6afa [Gradle] Add compilerOptions() methods to KotlinCompilation implementations
This should help to avoid user mistakes in configuring options when they
 are trying to use KotlinCompilation.

^KT-61636 Fixed
2023-09-04 14:29:00 +00:00
Yahor Berdnikau 55a0c86508 [Gradle] Fix JS module name and freeCompilerArgs config is not propagated to the task
Task was not using configured module name correctly.

In case of using "browser()" DSL freeCompilerArgs could be overwritten.

^KT-61194 Fixed
2023-09-04 14:28:59 +00:00
Yahor Berdnikau 4c60dd3f38 [Gradle] Fix JVM and Android targets moduleName change is not propagated in the multiplatform project
Missed existing logic where 'moduleName' was specifically configured
from 'moduleName' task input for MPP projects.

^KT-61303 Fixed
2023-09-04 14:28:59 +00:00
Dmitrii Gridin c095b60fe8 [LL FIR] drop outdated LazyBodyIsNotTouchedTest
We have our own transformers and tests against compiler test data,
so separate test with compiler transformers is redundant
2023-09-04 12:37:12 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline

Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated

Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
2023-09-04 12:21:37 +00:00
Alexander Shabalin 6a19c4ce96 [K/N] Remove legacy executors. 2023-09-04 11:38:47 +00:00
Ilya Gorbunov 78ef58f59d [Generator] Do not use explicit final modifier in Native primitive classes
'final' is the default modality, safe to omit
2023-09-04 11:32:39 +00:00
Ilya Gorbunov 8ae21c0e1b [Generator] Do not omit public visibility of methods in wasm 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 918b935e22 [Generator] Write the body of Boolean.hashCode in one place 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 1c149925b7 [Generator] Always put expression body on a new line 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 68a9b9c312 [Generator] Reference generator class in generated code files 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 74ac48851a [Generator] Canonical order of modifiers 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 60bbd08569 [Generator] Rename additionalDoc, put its content before annotations 2023-09-04 11:32:39 +00:00
Nikolay Lunyak cd392ebe69 [FIR] Don't miss RETURN_NOT_ALLOWED
^KT-59914 Fixed
2023-09-04 10:19:11 +00:00
Vyacheslav Gerasimov 009cda0c60 Build: Make robolectric tests run offline without downloading artifacts
#KTI-1367
2023-09-04 08:57:19 +00:00
Nikolay Lunyak bb8d3a0f80 [FIR] Don't recalculate argumentVariables for the same node
`knownVariables` can't be moved to the outer
function, because it's specific to the current
path: we want to check that the contract
condition is approved along the current path.

For example, in the
`FirPsiDiagnosticTestGenerated.testPropertyGetter`
test when analyzing the function, we want
 to check if we can derive the `d1 == Any`
 type statement (where `d1` is the receiver).
 If we can't, the flow won't contain `d1`
 among `knownVariables`
2023-09-04 08:13:00 +00:00
Kirill Rakhman 1c446151e7 [FIR] Skip resolvable package names in front of UNRESOLVED_REFERENCE
#KT-55471
2023-09-04 08:05:08 +00:00
Kirill Rakhman 10f7989af6 [FIR] Report UNRESOLVED_REFERENCE on the first unresolved qualifier
#KT-55471 Fixed
2023-09-04 08:05:07 +00:00
Kirill Rakhman 40fadac060 [FIR] Remove incorrect code generation comment 2023-09-04 08:05:07 +00:00
Dmitrii Gridin 420b6d48c3 [LL FIR] FileStructure: avoid redundant bodies visiting
We shouldn't try to find structure elements inside non-local declarations
Only classes and scripts can have an inner structure

^KT-60611
2023-09-03 11:44:00 +00:00
Dmitrii Gridin 8832865e9a [LL FIR] simplify FileStructureElement invalidation
We can avoid complex reanalyze-base logic and just directly
drop outdated data from FileStructureCache

^KT-60611
2023-09-03 11:44:00 +00:00
Dmitrii Gridin 89c186c496 [LL FIR] move part of in-block modification logic into service
^KT-60611
2023-09-03 11:44:00 +00:00
Marco Pennekamp 6b0333d74c [FIR] Avoid AST loading in KtPrimaryConstructor.toFirConstructor
- `getConstructorKeyword` forces an AST load due to a child search. In
  most cases, we don't need to check the constructor keyword in primary
  constructors at all (e.g. `class ABC()` with an implicit primary
  constructor). The keyword check is only needed when there are primary
  constructor modifiers (e.g. `class ABC constructor()`).

Thanks to Dima Gridin for the suggested fix.

^KT-61635 fixed
2023-09-02 12:59:24 +02:00
Alexander Udalov 761221904c K2 kapt: add kapt.use.k2 Gradle property
... and `-Kapt-use-k2` CLI flag to enable K2 kapt.

 #KT-61114 Fixed
2023-09-01 22:51:19 +00:00
Iaroslav Postovalov 059046a2b1 [JVM] Micro-optimize method signature mapping
This commit optimizes functions related to method signature mapping on
the JVM backend. The most significant change is avoiding re-allocations
in StringBuilder when building internal names. The commit also includes
minor optimizations, such as removing redundant allocations of strings
and other objects.
2023-09-01 20:26:17 +00:00
Alexander Shabalin 70996035fc [K/N] Move AllocatorImpl.hpp into alloc/ ^KT-60928
- Hide allocator-specific data into Allocator::*::Impl
  like with gc and gcScheduler modules.
- These *::Impl are still owned by specific GCs
- Additionally moved "stateless" allocator APIs into Allocator.hpp
2023-09-01 17:00:59 +00:00
Nikolay Krasko 3d4afb8994 Be more precise in the trusted section with using '.' in regex
KTI-1359
2023-09-01 16:52:07 +00:00
Nikolay Krasko b781ba77d0 Remove too wide ranges for kotlin trusted libraries
Leave only bootstrap range again

This commits reverts da267ba2c8. It looks
like JPS import is possible without additional regular expressions. Also,
origin commit added too wide range of trusted versions.

KTI-1359
2023-09-01 16:52:07 +00:00
Nikolay Krasko 405fb1085a Don't trust any native prebuilt version
KTI-1359
2023-09-01 16:52:06 +00:00
Nikolay Krasko 4396505c8c Remove strange exclusions from verification-metadata
KTI-1359
2023-09-01 16:52:06 +00:00
Nikolay Krasko 49c2bc18f2 Remove old intellij ivy exclusions in trust artifacts
KTI-1359
2023-09-01 16:52:06 +00:00
Dmitrii Krasnov e1c770eecb Remove checking userHomeDir/.konan/dependencie in NativeDownloadAndPlatformLibsIT. In teamcity someone creates this dir. 2023-09-01 16:04:59 +00:00
Egor Kulikov 2f893017ee [FIR] Fix incorrect psi provided to checker
^KT-60343 fixed
2023-09-01 16:00:06 +00:00
Alexander Shabalin cb25ef80a9 [K/N] Reenable disabled FirStdlibTest 2023-09-01 14:45:05 +00:00
Nataliya.Valtman f46245621f Log created error file in debug log
KT-59451 Fixed
2023-09-01 14:26:09 +00:00
Roman Golyshev 496e4dd0e3 KTIJ-26867 [AA] Allow resolve from write action in KtFirReferenceResolver
`KtReference` might be resolved from anywhere, even
from the write action - the call site might not know
anything about Kotlin, and might not be able to
somehow prevent the `inaccessible analysis session`
exception from being thrown. That's why we
have to be permissive here.

^KTIJ-26867 Fixed
2023-09-01 14:20:03 +02:00
Ilya Goncharov 0f40b2adce [Gradle, wasm] Hack for mixed mode with js, wasmJs and wasmWasi
^KT-61623 fixed
2023-09-01 11:53:04 +00:00
strangepleasures cc60618e86 KGP IT: do not run a failing test with class loader cache 2023-09-01 11:26:17 +00:00
Alexander Shabalin 958d613911 [K/N] Remove code for deprecated targets from runtime ^KT-59008 2023-09-01 10:48:07 +00:00
Dmitriy Novozhilov e4a51dfa1b [Serialization] Don't report errors on properties from supertypes
^KT-53926 Fixed
2023-09-01 09:35:43 +00:00
Dmitriy Novozhilov b4bc659008 [FIR] Update documentation of AbstractPredicate about matching local declarations
^KT-52449 Obsolete
2023-09-01 09:35:43 +00:00
Nikolay Lunyak b25a67a50e [FIR] Prohibit statement-like expressions in expression context
^KT-61067 Fixed
2023-09-01 09:30:28 +03:00
Alexander Udalov 5c19cb3fcb [KAPT4] KT-51982 Implement Kapt4AnalysisHandlerExtension, add KAPT CLI and Gradle IT
Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-08-31 22:19:13 +00:00
Alexander Udalov d50d36f16c Kapt+JVM_IR: add regression test for KT-61212
#KT-61212
2023-08-31 17:58:04 +00:00
Dmitrii Krasnov 1af7aba26e Bump Kotlin/Native version in KGP to 1.9.30-dev-1903 2023-08-31 17:39:47 +00:00
Dmitrii Krasnov 0191a15d96 migrated NativeDownloadAndPlatformLibsIT to junit 5 and gradle TestKit 2023-08-31 17:39:47 +00:00
Ilmir Usmanov 168076766f Minor. Fix test 2023-08-31 15:55:06 +00:00