Commit Graph

91647 Commits

Author SHA1 Message Date
Mikhail Glukhikh 6b53ac8367 FIR: forbid top-level destructuring declarations #KT-50468 Fixed 2022-03-15 13:08:18 +00:00
Mikhail Glukhikh 6ecc97575d FIR: make deeper recursive type alias expansion check (see KT-37000) 2022-03-15 13:08:18 +00:00
Ilya Goncharov c8237cb5e2 rra/ilgonmic/mocha-fail
[Gradle, JS] Use empty adapter to just dry run

[Gradle, JS] Not dry run, but full run

[Gradle, JS] Fix test to be failed without dry run

[Gradle, JS] Not use client twice

[Gradle, JS] Add test on mocha failing

[Gradle, JS] Fail mocha in case of infrastructure problems

Merge-request: KT-MR-5802
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51623 fixed
2022-03-15 11:18:35 +00:00
Mikhael Bogdanov 41a54241bb Update testdata 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov 15c3dd527c KAPT+IR: Support data classes 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov ceedad40f3 KAPT+IR: Support secondary constructors 2022-03-15 11:38:03 +01:00
Alexander Shabalin 3b2a318c7d [K/N] Generalize Mark queue handling ^KT-51436
Merge-request: KT-MR-5904
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-03-15 10:36:16 +00:00
Alexander Korepanov 69295f2cf0 [JS IR] IC invalidation refactoring
- Huge refactoring for IC
  - Update hash combination logic
  - Introduce value class for IC hashes
  - Calc md5 directly by function IR
  - Split IC logic by classes
  - Move JsIrLinkerLoader into separate file
  - CacheUpdateStatus is a sealed class
  - Render TYPE_PARAMETER reified flag

^KT-51081 Fixed
^KT-51084 Fixed
2022-03-15 05:34:19 +00:00
nataliya.valtman c38dd1c004 Fix unstable testIncrementalCompilationAfterCacheHit test 2022-03-14 20:08:14 +03:00
Ilya Goncharov 0463b5ec3c rra/ilgonmic/duplicated-import-names
[JS IR] Add tests with external funs and global vals

[JS IR] Non module cases are exceptions for naming

[JS IR] Use fqn for jsModule on declaration

[JS IR] Add test on same external names

Merge-request: KT-MR-5901
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51438 fixed
2022-03-14 14:04:27 +00:00
Nikita Bobko a471ddf059 Kotlin JPS: Inject KOTLIN_BUNDLED macro into JPS
KTIJ-21292
2022-03-14 13:53:15 +00:00
Elena Lepilkina f5bd210c08 [K/N] Remove outdated gradlew wrapper 2022-03-14 13:27:46 +00:00
Alexander Shabalin 53de23200d [K/N] Make GC scheduler parametrized by Clock. ^KT-48537 2022-03-14 13:21:40 +00:00
Alexander Shabalin e014e6b154 [K/N] Handle clock wrapping in RepeatedTimer. ^KT-48537 2022-03-14 13:21:39 +00:00
Alexander Shabalin eae9d05f50 [K/N] Add mockable clock. ^KT-48537 2022-03-14 13:21:39 +00:00
Alexander Shabalin e6b7a142b2 [K/N] Implicit constructors for saturating. ^KT-48537 2022-03-14 13:21:38 +00:00
Alexander Shabalin 03b09346a5 [K/N] Intrusive single linked list ^KT-51436
Merge-request: KT-MR-5854
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-03-14 13:20:41 +00:00
Ilya Chernikov 6ae55a98cd FIR2IR: fix annotations conversion for precompiled functions
fixes the case then the function being inlined is taken
from the binaries compiled on the previous iteration, and therefore
should be treated similarly to a fun from a library.
2022-03-14 13:37:50 +03:00
Ilya Chernikov aa0386276d Fix FIR incremental compilation failure with inlines and lambdas
#KT-51546 fixed
2022-03-14 13:37:50 +03:00
Yan Zhulanow 8f1a2f4612 Improve heuristic for filtering synthetic enum methods out
It's not possible to check the exact method signature, as it is
unavailable in dumb stubs for Kotlin's light classes. Yet, it's still
possible to check more things, such as parameter count and access flags.
2022-03-14 17:53:55 +09:00
Yan Zhulanow c334a44e02 Preserve synthetic enum methods in stub-based 'ClsClassImpl'
'ClsClassImpl' instances created by the platform contain synthetic
enum methods (added by 'ClassInnerStuffCache.calcMethods()'). Such
convention is common in IntelliJ (see KT-36095 and
'9a8b345adaded83fe13980a28db5d9f9acc7450d' in the IntelliJ repository).

This commit makes Kotlin's stub-based classes consistent with the
convention. Instead, a filter is added in place of 'ClsClassImpl' usage.

See also the following commits:
- 7c86911f44
- 43468c6d55
2022-03-14 17:53:55 +09:00
Yan Zhulanow fa4dadf9b7 Update KotlinClassInnerStuffCache implementation
'KotlinClassInnerStuffCache' was copy-pasted from the platform's
'ClassInnerStuffCache' several years ago. After J2K and other changes,
it became quite dirty.

Besides cleaning things up, enum synthetic method handling have
significantly improved. Before, such methods were handled only in
'processDeclarationsInEnum', and 'getMethods()' didn't return them.
This led to inconsistent behavior and was reason for providing special
ad-hoc support in '1b6ded600518176b21cc308ed3e032ef8d04cc90'.
2022-03-14 17:53:55 +09:00
Yan Zhulanow 955d0841bd Remove unused modification tracker in KotlinClassInnerStuffCache
'dropCaches()' is not used anywhere both in the compiler and in the IDE.
2022-03-14 17:53:55 +09:00
Yan Zhulanow f237631f05 Revert "FIR/LC: create synthetic members of enum class"
This reverts commit 1b6ded60
2022-03-14 17:53:55 +09:00
Yan Zhulanow 736c6c4d29 Pill: Import Java toolchain configuration correctly
Before, all project modules used 'inheritedJdk'. However, some Kotlin
modules now require JDK 8, while others depend on new API in JDK 11.
2022-03-14 17:53:54 +09:00
Mikhael Bogdanov 6b00b51e6d Generate fake variables for default lambdas during inline
#KT-51557 Fixed
2022-03-14 08:48:26 +00:00
Vyacheslav Gerasimov 5e09c3176f Build: Set kotlin.build.cache.push to false by default
#KTI-793
2022-03-13 20:29:12 +00:00
Xin Wang 4277827506 Don't transform irBranch if tableswitch can't be generated
#KT-34466 Fixed
2022-03-12 14:30:00 +03:00
Hung Nguyen 5f1cf34c79 KT-45777: Take coarse-grained snapshots of external libraries
to reduce the size of the snapshots.

- Track metrics for Gradle classpath snapshot artifact transform
- Format size metrics so it's more readable

^KT-45777 In Progress
2022-03-11 17:44:25 +01:00
Svyatoslav Scherbina 54fb4d9b70 Native: make forward declarations expect in metadata compilations
If we are compiling metadata, make synthetic forward declarations
`expect`, because otherwise `getFirstClassifierDiscriminateHeaders`
would prefer it over a "real" `expect` declaration from a commonized
interop library, which would ruin the whole idea of using synthetic
forward declarations only when no proper definitions are found.

^KT-51377 Fixed
2022-03-11 15:09:38 +00:00
Yahor Berdnikau 76fc4328d1 Migrate KotlinGradlePluginIT to new test dsl
Moved some tests to another test suites

^KT-45745 In Progress
2022-03-11 16:27:09 +03:00
Yahor Berdnikau f11ae83a3d Add method to include other project as included build
^KT-45745 In Progress
2022-03-11 16:27:09 +03:00
Yahor Berdnikau ca76c00b6c Also provide BuildResult in assert block
^KT-45745 In Progress
2022-03-11 16:27:08 +03:00
Yahor Berdnikau 8844f81a92 Move PublishingIT tests to use JVM tag
^KT-45745 In Progress
2022-03-11 16:27:08 +03:00
Yahor Berdnikau 8ef0bbb279 Rename KpmCompilerPluginIT
Make name of test suite to be considered as MPP test.

^KT-45745 In Progress
2022-03-11 16:27:07 +03:00
Yahor Berdnikau 4c2c7d9e5e Rename VariantAwareDependenciesIT
Make name of test suite to be considered as MPP test.

^KT-45745 In Progress
2022-03-11 16:27:06 +03:00
Jinseong Jeon 46707b0426 AA: test evaluation mode with same test inputs 2022-03-11 13:51:16 +01:00
Jinseong Jeon a7fcbfb717 AA: move logic to evaluate constant property initializer
so as to handle composite expressions w/ constant property
2022-03-11 13:51:16 +01:00
Jinseong Jeon 606033e1e6 AA: introduce KtConstantEvaluationMode 2022-03-11 13:51:15 +01:00
Jinseong Jeon ee23a52e54 AA: avoid conversions to KtInitializerValue in constant evaluator 2022-03-11 13:51:15 +01:00
Jinseong Jeon 1f93630a9c AA: evaluate constant property initializers 2022-03-11 13:51:14 +01:00
Jinseong Jeon 7ec7cc47a9 AA: ignore evaluating named reference (to avoid exceptions) 2022-03-11 13:51:14 +01:00
Jinseong Jeon e36bf55807 AA: avoid NPE while evaluating operations with non-numbers 2022-03-11 13:51:13 +01:00
Dmitriy Novozhilov 6f64aedaf0 [FIR] Fix FindReferencePositioningStrategy for light tree
There was a problem which causes to lookup for assign token inside
  functions from arguments of call
2022-03-11 15:36:05 +03:00
Dmitriy Novozhilov ade2307345 [FIR] Fix exponential analysis of augmented array access calls
^KT-50861 Fixed
2022-03-11 15:36:05 +03:00
wrongwrong c4735f9f29 Add tests for KFunction involving value classes
See KT-31141.
2022-03-10 23:28:40 +01:00
Mikhail Glukhikh c8453ec8b4 FIR: report ambiguity-like errors in type resolve 2022-03-10 20:42:42 +00:00
Mikhail Glukhikh f073e86c93 Update FIR Analysis API test data 2022-03-10 20:42:42 +00:00
Mikhail Glukhikh 59a1c68081 FIR LL: add predicate based provider to library resolvable session 2022-03-10 20:42:42 +00:00
Mikhail Glukhikh 34998473f5 FIR: Move deprecation resolve earlier 2022-03-10 20:42:41 +00:00