Commit Graph

40629 Commits

Author SHA1 Message Date
Leonid Startsev 6f6342dafc Prototype of kotlinx.serialization FIR plugin:
Implement basic non-parameterized case
2022-08-17 11:43:33 +00:00
Andrey Uskov 339868305e Fixed handling of special symbols in paths when reporting errors
#KT-53246 Fixed
2022-08-17 10:38:28 +04:00
Aleksei.Cherepanov df017ea187 Clean JavaClassesTracker and LookupTracker on call RetryWithAdditionalRoots
#KT-38576 Fixed
2022-08-16 14:38:01 +00:00
Iven Krall ec8da2033c KT-8263: Conditional operators are not parsed correctly 2022-08-16 10:00:54 +00:00
Iven Krall 2053363def KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing 2022-08-16 10:00:53 +00:00
Simon Ogorodnik 513af2dfbc FIR. Refactor smart-cast representation in FIR tree
Make smart-casts non-transparent expression without delegation
to underlying FirQualifiedAccessExpression, as children delegation in
fir tree has unclear semantics
Remove two different kinds of tree nodes for smart-casts
2022-08-15 21:46:11 +00:00
Abduqodiri Qurbonzoda 983c7adb1e Remove :libraries:tools:stdlib-compiler-classpath project
It was used as a workaround to allow jvmTarget=1.6 in stdlib.
2022-08-13 01:42:43 +03:00
Abduqodiri Qurbonzoda 0942a414c8 Fix typeAnnotationTarget6.kt codegen box test 2022-08-13 01:33:48 +03:00
Abduqodiri Qurbonzoda cf44753aed Remove :compiler:tests-common-jvm6 project and JvmTarget6OnBaseJvm tests 2022-08-13 01:33:48 +03:00
Abduqodiri Qurbonzoda de775ad728 Remove unsignedIntCompare_before.kt test data 2022-08-13 01:33:47 +03:00
Abduqodiri Qurbonzoda 34e50649e8 Switch JVM target of the standard libraries to 1.8 #KT-51907 2022-08-13 01:33:45 +03:00
Vsevolod Tolstopyatov e32e5c26a4 [reflect] Fix flaky tests that depend on Reflection.clearCaches()
* Use ReflectionFactoryImpl as single point of synchronization
* Synchronize all cache-sensitive tests on it in order to be robust in parallel test runners
* Remove redundant cache clear after each test

Merge-request: KT-MR-6842
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-12 14:10:08 +00:00
Jiaxiang Chen 94abeb64c5 use top level classId for looking up java classes in KotlinCliJavaFileManagerImpl 2022-08-12 14:24:13 +02:00
Vsevolod Tolstopyatov 22e26d0756 Move EnumEntries LVS to 1.9
* Also cleanup tests to avoid using obsolete WITH_RUNTIME
2022-08-12 09:35:32 +00:00
Mikhail Glukhikh d7c0b1b620 PSI2IR: don't create Enum.entries in IR without the corresponding feature 2022-08-12 09:35:29 +00:00
Mikhail Glukhikh 2ba22b9165 FIR2IR: don't create Enum.entries in IR without the corresponding feature 2022-08-12 09:35:28 +00:00
Mikhail Glukhikh 3079be75d4 K2: don't filter Enum.entries depending on language settings 2022-08-12 09:35:28 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Vsevolod Tolstopyatov 0a5b3f1e13 [JVM IR] Adjust testData to address new static Enum.entries member 2022-08-12 09:35:26 +00:00
Vsevolod Tolstopyatov 2fcef7af89 [FIR] Fix IrInlineBodiesHandler
Validate that inline function actually is present in at least on of the
modules, not in all of them. That enables support of MODULE directive
in boxInline tests for FIR.

Also, hide a few minor style fixes in this commit
2022-08-12 09:35:26 +00:00
Mikhail Glukhikh 3a2d69225c K1: add support for Enum.entries in Java scopes 2022-08-12 09:35:25 +00:00
Mikhail Glukhikh 12e8b1d844 K1: add support for Enum.entries synthetic property (see KT-48872)
#KT-53270 Fixed
2022-08-12 09:35:24 +00:00
Vsevolod Tolstopyatov c0f81cbc45 [JVM] Improve code coverage of EntriesMapping
Ensure that when .entries is accessed from an inline function body
or lambda argument, EntriesMapping are properly generated and used
without excessive mappings and duplicated fields

#KT-53236
2022-08-12 09:35:24 +00:00
Vsevolod Tolstopyatov 8a181cf2bd [FIR] Create stub language settings for FIR-related test to keep relying on it
#KT-48872
2022-08-12 09:35:23 +00:00
Vsevolod Tolstopyatov e3bff290bd [JVM] Lower .entries calls on Kotlin enums
Leveraging the same mechanism with $EntriesMapping as Java enums.
Old (compiled with LV/AV < 1.8) enums are detected by looking for
static special <get-entries> method that cannot be introduced on
Kotlin enums otherwise

#KT-53236
2022-08-12 09:35:22 +00:00
Vsevolod Tolstopyatov a12a31ce68 [JVM] Lower .entries calls on Java enums
#KT-53236
2022-08-12 09:35:21 +00:00
Vsevolod Tolstopyatov e708809e55 [JVM] Support Enum.entries for enums being compiled with Kotlin 1.8+
#KT-53236
2022-08-12 09:35:20 +00:00
Vsevolod Tolstopyatov 1b6a43ba69 Update IR serialization to reflect changes in IrSyntheticBodyKind for enum entries
#KT-48872
2022-08-12 09:35:19 +00:00
Vsevolod Tolstopyatov 93f17a2b86 [FIR] Support static getters along with fake Enum.entries declaration in FIR
#KT-48872
2022-08-12 09:35:18 +00:00
Ivan Kylchik 45b89de9f4 Optimize ir interpretation of Enum.name
There is no need to create honest object in case of such simple
calculation. Furthermore, it can be harmful if enum class has
non-constant initializer or property.

#KT-53480 Fixed
2022-08-11 18:55:30 +03:00
Mikhail Glukhikh cb1123cccd OptInUsageChecker: restore public API isOptInAllowed method 2022-08-11 14:05:10 +00:00
Mikhail Glukhikh 81e1131441 SubclassOptInRequired: add extra test about inheritance and superseding 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh 80a9f22052 Add applicability checks & tests for SubclassOptInRequired 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh 76aaecbdf0 Add/fix extra cases for #KT-41886 Fixed 2022-08-11 14:05:08 +00:00
Mikhail Glukhikh 7d3368da58 K2: report errors related to SubClassOptInRequired annotation
Related to KT-41886
2022-08-11 14:05:08 +00:00
Mikhail Glukhikh c67c5cad27 K1: report errors related to SubClassOptInRequired annotation
Related to KT-41886
2022-08-11 14:05:07 +00:00
Mikhail Glukhikh 84291181af K1: drop redundant OptIn check for expanded type 2022-08-11 14:05:07 +00:00
Hung Nguyen bd085495bd New IC: Add tests for constants-in-companion-objects impact computation
^KT-53266 Fixed
2022-08-11 16:01:26 +02:00
Hung Nguyen 2ad047340f New IC: Add constants-in-companion-objects impact computation
When computing impacted symbols of changed symbols, previously we
considered only the supertypes-inheritors type of impact, which is the
most common type. This commit adds the constants-in-companion-objects
type of impact to address KT-53266.

We've also cleaned up impact computation to make it easier to add new
types of impact in the future.

^KT-53266 In progress
2022-08-11 16:01:25 +02:00
Hung Nguyen 3f0a93d6dd New IC: Reorganize test data directories
to make it easier to add new tests

^KT-53266 In progress
2022-08-11 16:01:24 +02:00
Dmitriy Novozhilov fd4aafdb75 [Lombok K2] Support @Builder and @Singular annotations
^KT-46959 Fixed
2022-08-11 15:22:36 +03:00
Dmitriy Novozhilov 1f2f6f4067 Reformat treeBasedTypes.kt 2022-08-11 15:22:35 +03:00
Pavel Mikhailovskii 8ba80b4b7b KT-1436 Allow break/continue in inlined lambdas 2022-08-11 10:38:23 +00:00
pyos 4aad666d3c JVM: do not assume presence of default method handle arguments (#4915)
I believe Jetpack Compose is not generating them, and that's what's
causing KT-52843. Adding them is obviously an ABI-breaking change.
2022-08-11 00:37:00 +02:00
Ilya Kirillov 531236ce16 [FIR] generate testdata for RawFirBuilderLazyBodiesTestCase for newly added tests 2022-08-10 22:49:23 +02:00
Ilya Kirillov da9cf1468c [FIR] add KDoc to lazy resolution functions 2022-08-10 22:49:19 +02:00
Ilya Kirillov 0748f28efe [FIR] rename ensureResolve -> lazyResolveToPhase as it better describes function semantics 2022-08-10 22:49:18 +02:00
Ilya Kirillov 28b159ef85 [LL FIR] fix lazy resolve of accessors with implicit types
Before the change, such accessors would have implicit types event if the corresponding property had a resolved one
2022-08-10 22:49:17 +02:00
Ilya Kirillov 97853016d5 [LL FIR] fix lazy resolve of accessors generated by delegation
Before the change, such accessors would have implicit types event if the corresponding property had a resolved one
2022-08-10 22:49:16 +02:00
Ilya Kirillov e12a800b2d [LL FIR] fix lazy resolve of FirDefaultPropertyAccessor
FirDefaultPropertyAccessor was hardcoded and thus lazy resolution was not able to update it after resolution
2022-08-10 22:49:16 +02:00