Commit Graph

95966 Commits

Author SHA1 Message Date
Leonid Startsev 3d679b76bc Use Metadata directly instead of KotlinClassHeader; rewrite latter to Java
so Java clients can obtain Metadata instance from it.
2022-11-10 13:30:09 +00:00
Leonid Startsev 471882b743 Introduce @DeprecatedVisitor; mark up visitor-related declarations with it.
Provide convenient JVM writing API.

Get rid of ExperimentalUnsignedTypes.
2022-11-10 13:30:09 +00:00
Leonid Startsev dd985d8209 Add Binary Compatibility Validator to kotlinx-metadata projects
Initiate API dumps
2022-11-10 13:30:08 +00:00
pyos e7b4927b6c FIR: don't emit SENSELESS_NULL_IN_WHEN when value is always null
This case (value is always null) contradicts the error message which says
"Expression under 'when' is never equal to null".
2022-11-10 13:10:58 +00:00
pyos fbb54f0300 FIR: fix Clonable detection condition in inline checker 2022-11-10 11:34:53 +01:00
Hung Nguyen cdbbead157 Handle changes to inline functions/property accessors with @JvmNames
If we detect a change in an inline function `foo` with @JvmName
`fooJvmName`, we have two options:
   1. Report that function `foo` has changed
   2. Report that method `fooJvmName` has changed

Similarly, if we detect a change in an inline property accessor with
JvmName `getFoo` of property `foo`, we have two options:
   1. Report that property `foo` has changed
   2. Report that property accessor `getFoo` has changed

The compiler is guaranteed to generate `LookupSymbol`s corresponding to
option 1 when referencing inline functions/property accessors, but it is
not guaranteed to generate `LookupSymbol`s corresponding to option 2.
(Currently the compiler seems to support option 2 for *inline*
functions/property accessors, but that may change.)

Therefore, we will choose option 1 as it is cleaner and safer.

^KT-54144 In progress

Small cleanup in IncrementalCompilerRunner

 - Add comment for closing caches
 - Rename providedChangedFiles to changedFiles
 - Tiny clean up in `performWorkBeforeCompilation`
 - Count directories to delete in debug logs

^KT-53015 In progress

Extract KotlinClassInfo to a separate class

to reduce the size of IncrementalJvmCache and prepare for the next
change.

^KT-54144 In progress

Ignore inline functions that are not found in the bytecode

^KT-54144 In progress

Add unit test for handling `@JvmName`s

Test: KotlinOnlyClasspathChangesComputerTest
             #testFunctionsAndPropertyAccessorsWithJvmNames
^KT-54144 Fixed

Update unit tests for handling `@JvmName`s

In a previous commit, we made a behavior change for inline property
accessors: The existing behavior is that if the implementation of an
inline getter has changed, only usages of the getter will be impacted
but not usages of the setter (and vice versa).

After that previous commit, usages of *both* the getter and setter will
now be impacted (i.e., we might compile slightly more files). This is
because a change to either the getter or the setter will now be
considered a change to the property, which will help simplify our change
analysis.

This commit updates the relevant unit tests to reflect the new behavior.

Test: Updated Incremental*TestGenerated.PureKotlin#testInlinePropertyInClass
      and Incremental*TestGenerated.PureKotlin#testInlinePropertyOnTopLevel

^KT-54144 Fixed
2022-11-10 10:03:55 +01:00
nataliya.valtman e1e07d2094 KT-54492 Add kotlin plugin version into error file 2022-11-10 08:57:10 +00:00
Dmitrii Gridin 871fd09e3f [AA FIR] KtFirClassLikeSymbolPointer: replace lambda with regular class check
^KT-54311
2022-11-10 06:39:25 +00:00
Dmitrii Gridin ab2edd40d4 [AA FIR] KtFirClassLikeSymbolPointer: mark as internal
^KT-54311
2022-11-10 06:39:25 +00:00
Dmitrii Gridin 41ebf5ed53 [AA] KtPsiBasedSymbolPointer: simplify test logic
^KT-54311
2022-11-10 06:39:24 +00:00
Dmitrii Gridin b151ed3e65 [AA K2] drop redundant nested pointers for class like symbols
^KT-54311
2022-11-10 06:39:24 +00:00
Dmitrii Gridin deafb75d0e [AA K2] KtFirFunctionSymbol: cleanup code
^KT-54311
2022-11-10 06:39:24 +00:00
Dmitrii Gridin 638eccac16 [AA K2] add missing resolve for signature creation
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 202a022b49 [AA K2] implement symbol pointers for value parameters
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 043e3e6840 [AA K2] implement symbol pointers for receiver parameter
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 48f7cdfaa1 [AA K2] implement symbol pointers for property accessors
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 32c38c0ae4 [AA K2] cleanup CanNotCreateSymbolPointerForLocalLibraryDeclarationException usages
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 731545573a [AA K2] add more tests on java members
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 5e31c0b9b0 [AA K2] KtFirJavaSyntheticPropertySymbolPointer: cleanup code
^KT-54311
2022-11-10 06:39:21 +00:00
Dmitrii Gridin 864650c1c2 [AA K2] KtFirJavaFieldSymbolPointer: cleanup code
^KT-54311
2022-11-10 06:39:21 +00:00
Dmitrii Gridin 42f8e6fbe6 [AA] add more tests on java field symbols
^KT-54311
2022-11-10 06:39:20 +00:00
Dmitrii Gridin 137deadee5 [AA K2] KtFirConstructorSymbolPointer: cleanup code
^KT-54311
2022-11-10 06:39:20 +00:00
Dmitrii Gridin 5986a0d7b2 [AA K2] KtFirBackingFieldSymbolPointer: cleanup code
^KT-54311
2022-11-10 06:39:20 +00:00
Dmitrii Gridin 897a5b085d [AA K2] implement symbol pointers for enum entry members without psi
^KT-54311
2022-11-10 06:39:19 +00:00
Dmitrii Gridin 1dfca7aca9 [FIR2IR] add option to allow IdSignature for members of local classes
^KT-54311
2022-11-10 06:39:19 +00:00
Dmitrii Gridin c6a3ca86eb [AA K2] symbol pointers: add tests on enum entry
^KT-54311
2022-11-10 06:39:19 +00:00
Dmitrii Gridin 03fed7a47f [AA K2] KtFirMemberSymbolPointer: drop redundant cast
to support KtEnumEntrySymbol

^KT-54311
2022-11-10 06:39:18 +00:00
Dmitrii Gridin 9a418a7533 [AA K2] KtFirAnonymousObjectSymbol: cleanup code
^KT-54311
2022-11-10 06:39:18 +00:00
Dmitrii Gridin bc3fcf22c4 [AA K2] reimplement symbol pointers for enum entry
^KT-54311
2022-11-10 06:39:18 +00:00
Dmitrii Gridin 9b6e9e2dd1 [AA K2] implement symbol pointers for type parameters
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 7d1ac0ac97 [AA] AbstractSymbolTest: fix race
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 47c9618b79 [AA K2] implement symbol pointers for type aliases
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 0808f4e233 [AA K2] implement symbol pointers for classes and objects
^KT-54311
2022-11-10 06:39:16 +00:00
Dmitrii Gridin 85072b0c96 [AA K2] KtFirMemberSymbolPointer: migrate owner to pointer
^KT-54311
2022-11-10 06:39:16 +00:00
Dmitrii Gridin 2ac85b96e5 [AA K2] KtFirKotlinPropertySymbol: cleanup code
^KT-54311
2022-11-10 06:39:15 +00:00
Dmitrii Gridin f86c9be733 [AA K2] implement symbol pointer for top level properties
^KT-54311
2022-11-10 06:39:15 +00:00
Dmitrii Gridin 01e1fc042c [AA] KtFirKotlinPropertySymbol: cleanup code
^KT-54311
2022-11-10 06:39:15 +00:00
Dmitrii Gridin 2888a3c2d2 [AA] KtFirFileSymbol: cleanup code
^KT-54311
2022-11-10 06:39:14 +00:00
Dmitrii Gridin 5eb0bfc180 [AA] SymbolPointerExceptions: cleanup code
^KT-54311
2022-11-10 06:39:14 +00:00
Dmitrii Gridin 4bd604f2ed [AA] check symbol pointer restoring without psi anchor
^KT-54311
2022-11-10 06:39:14 +00:00
Mads Ager 636024f676 [JVM] Retain deprecated status for interface companion const property.
Create the field directly and maintain the fact that its corresponding
property is the companion object property. That property has the
deprecated annotation which puts the deprecated marker on the field
when code generating the field.

^KT-54840 Fixed
2022-11-09 23:15:31 +01:00
Xin Wang 7b3ce35613 JVM_IR: Prevent writing output after an error is reported
#KT-53825 Fixed
2022-11-09 23:14:11 +01:00
Pavel Mikhailovskii 252e97663b KT-54784 Fix function inlining in init sections 2022-11-09 17:15:37 +00:00
Sergey.Shanshin af4308e634 Fixed replacing serializer origin for generated classes
Do not use plugin origin for user-written classes that have @Serializer annotation for some reason. Plugin origin makes them synthetic which is incorrect because they're available in source code. Example of such class: @Serializer(JsonElement::class) class JsonElementSerializer

Merge-request: KT-MR-7627
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2022-11-09 17:11:40 +00:00
Vyacheslav Karpukhin a69ac69de1 KMM: fix multiplatform libraries import for Android (when running without an Android IDE plugin) 2022-11-09 16:01:02 +00:00
Vladimir Sukharev 574d78efce [K/N] Remove remains of jcenter from kotlin-native/
Revert two special entries

Use proper mavenCentral()

Remove remains of jcenter from kotlin-native/

Merge-request: KT-MR-7610
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-11-09 13:23:09 +00:00
Zalim Bashorov d4e0d07b5b [Wasm] Update Binaryen version in gradle plugin: 109 -> 110 2022-11-09 13:44:39 +01:00
Zalim Bashorov d29010807a [Wasm] Apply recent changes in TFR proposal and update v8
Type index immediate was added to call_ref and return_call_ref instructions.
More details here https://github.com/WebAssembly/function-references/pull/76
2022-11-09 13:44:38 +01:00
Zalim Bashorov 9ed94b25fa [Wasm] Cleanup instructions list
* Split by proposal, at least for work-in-progress ones
* Add a link to the repo for WIP proposals
* Move some instructions to right group
2022-11-09 13:44:38 +01:00
Zalim Bashorov ff2d3d0bdb [Wasm] Remove unnecessary --experimental-wasm-eh option while running d8 and nodejs
The support for Exception Handling proposal is turned on by default everywhere.
2022-11-09 13:44:38 +01:00