Commit Graph

2484 Commits

Author SHA1 Message Date
Sergey Shanshin 91f1cb88c1 Support serialization of java enum classes in IR
Fixes Kotlin/kotlinx.serialization#1334
2021-02-17 20:24:31 +03:00
Sergey Shanshin de06a69b12 Added external serializers in serialization plugin for IR backend
- added fallback support of external serializers in IR
- implemented calculations of properties default values in IR
- swapped check of shouldEncodeElementDefault and comparing the property with default value in IR. Now default value calculated only of shouldEncodeElementDefault returns false
2021-02-17 20:16:34 +03:00
Victor Petukhov baeee8988e [all-open] Don't affect private declarations to change their modality to open 2021-02-16 17:18:08 +03:00
Victor Petukhov ec41775d7e [all-open] Fix formatting 2021-02-16 17:18:07 +03:00
Hung Nguyen 592c285198 Kapt: Don't create KDocCommentKeeper when not needed
Previously, even if `keepKdocComments=false`, we would still create the
KDocCommentKeeper object unnecessarily.

This commit makes sure we create the object only if
`keepKdocComments=true`.

Bug: Clean-up after commit e252171 for KT-43593
Test: Existing tests
2021-02-16 11:53:49 +03:00
Andrey Zinovyev cc51869a2a [KAPT] Take function argument names from original descriptor
#KT-43804 Fixed
2021-02-14 10:45:00 +03:00
Andrey Zinovyev 4a0437a507 [KAPT] Fix field type correction for delegates (#4107)
#KT-37586 Fixes
2021-02-14 10:38:38 +03:00
Andrey Zinovyev 6eaf0a95ca [KAPT] Fix expected resolve errors in tests (#4105) 2021-02-10 19:40:28 +03:00
Andrey Zinovyev 48ec227aaf [KAPT] Suppress resolve error in annotation procssing
#KT-33223
2021-02-10 10:59:46 +03:00
Ilya Chernikov 79b4b18e25 [minor] fix warnings in the script compiler and tests 2021-02-10 08:32:11 +01:00
Ilya Kirillov cf56c59ca2 Fix binary incompatibility of createRemoveModifierFromListOwnerFactory 2021-02-09 17:15:35 +01:00
Ilya Chernikov ef4fa3381d Pass provided script configuration to refining code
when script compilation configuration refinement
happening during parsing, the updated configuration
passed to the script compiler/REPL compile function
is now used.
#KT-44580 fixed
2021-02-09 15:22:55 +00:00
Andrey Zinovyev 10cc86c975 [KAPT] Warn about usage of types from default package
Java doesn't support import from default package. 
We can't fix it, so we warn about it.
#KT-36743
2021-02-09 13:32:27 +03:00
Andrey Zinovyev c75d2c05f0 [KAPT] Correct type for property with accessor
^KT-39060 Fixed
2021-02-08 10:11:50 +03:00
Andrey Zinovyev 08111031ec [KAPT] Keep annotations from kotlin.jvm. in stubs
^KT-35104 Fixed
2021-02-05 13:41:46 +03:00
Andrey Zinovyev dacf012a78 [KAPT] Add newline after each java compiler log (#4087)
^KT-27123 Fixed
2021-02-04 17:29:13 +03:00
Andrey Zinovyev 95140f35f8 [parcelize] Fix codegen for generic classes
Replace type arguments with star projection in static methods
Fix IR function generation

^KT-42652  Fixed
2021-02-04 15:11:51 +03:00
Dmitriy Novozhilov 459a2886a0 [FIR] Add CheckerContext to DiagnosticReporter and refactor diagnostic reporting
Refactoring includes replacing `Diagnostic.report` extensions in
  checkers with `DiagnosticReporter.reportOn` extension declared
  in DiagnosticReporter.kt
2021-02-03 18:10:48 +03:00
Andrey Zinovyev 923a4427c5 [KAPT] Fix stub generation for anonymous delegates
Replace anonymous classes with superclass in delegate properties
#KT-34838 Fixed
2021-02-03 17:27:41 +03:00
Alexander Udalov e0b6d4d917 Add -Xsuppress-deprecated-jvm-target-warning to modules compiled with 1.6
Currently this leads to an unknown argument warning, but it'll be
removed automatically on the next bootstrap.
2021-02-03 12:51:39 +01:00
Dmitriy Novozhilov 09ec3f6eaf [Test] Support various jdk targets in test infrastructure 2021-02-02 17:54:51 +03:00
Roman Artemev bf67308cc2 [KLIB] Use IrMessageLogger in klib linker to report errors 2021-02-02 12:05:35 +03:00
Roman Artemev ba5193870e [IR] Drop unused language version settings parameters from DependenciesGenerator 2021-02-02 12:05:34 +03:00
Vladimir Dolzhenko 913c298be8 Kotlin highlight passes are reworked
#KT-37702 Fixed
2021-02-01 13:18:38 +00:00
Vladimir Dolzhenko 558338f997 Lazy diagnostics API in frontend
Relates to #KT-37702
2021-02-01 13:18:37 +00:00
Alexander Udalov adfa8c788c Light classes: use JVM target from the module
Using "JVM_1_8" always resulted in incorrect mapping of Kotlin
annotation targets to Java element types.

The change in AbstractKotlinRenderLogTest is needed because while
CliTraceHolder.module is technically a descriptor leak, it was never
detected by this test accidentally, because of the depth cutoff equal to
10, which started to not be enough after the minor refactoring of
replacing `Delegates.notNull` with `lateinit`.
2021-02-01 11:54:05 +01:00
Dmitriy Novozhilov 0a47b1c32b Remove incorrectly added dependency on experimental coroutines 2021-01-29 14:57:08 +03:00
Dmitriy Novozhilov 0769157a16 Revert "Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules""
This reverts commit 1300ec3e
2021-01-29 14:57:08 +03:00
Denis.Zharkov 7e6abffb62 FIR: Fix incorrectly serialized type
See the test added: there's a non-denotable T!! type inside flexible type
that wasn't handled before.

ConeKotlinType::contains handles flexible types content and some other cases
Also, it has better asymptotics
2021-01-29 10:50:23 +03:00
Dmitriy Novozhilov 71d8b842fd Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl
This is needed to keep compatibility with old gradle versions which
  are steel using kotlin 1.2 with experimental coroutines
2021-01-28 13:19:34 +03:00
Dmitriy Novozhilov 1300ec3e45 Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules"
This reverts commit 3be62dfc
2021-01-28 13:19:34 +03:00
Dmitriy Novozhilov cd93b2f39b Use old backend in script compilation context 2021-01-28 13:19:30 +03:00
Dmitriy Novozhilov 7632c11745 Enforce using old backend in JvmCliReplShellExtension 2021-01-28 13:19:28 +03:00
Dmitriy Novozhilov c6039d76d3 Enforce using old backend in JvmAbiAnalysisHandlerExtension 2021-01-28 13:19:27 +03:00
Roman Artemev cd9e341fa9 [JS IR] Support additional repositories in CLI (compiler part) 2021-01-26 19:23:22 +03:00
Hung Nguyen e2521718dd Kapt: Add flag to keep KDoc comments in stubs
Currently, KaptGenerateStubsTask may not generate KDoc comments
correctly. See KT-43593 for more details.

This commit provides a Kapt flag called
`kapt.keep.kdoc.comments.in.stubs`
to control whether KDoc comments will be included in the generated
stubs.

This flag is currently enabled by default to keep the existing behavior
and avoid breaking existing users.

Users who don't need KDoc comments in stubs but are hitting KT-43593 can
disable the flag.

Whether this flag will be disabled by default later is to be determined.

Bug: https://youtrack.jetbrains.com/issue/KT-43593
     (Note that this commit only provides a workaround, it doesn't
     actually fix the bug.)
Test: (Ir)ClassFileToSourceStubConverterTestGenerated#testCommentsRemoved
2021-01-26 15:28:52 +03:00
Sergey Shanshin 122d04b9fa Returned support for generic serializers in @UseSerializers (#4055)
Fixes Kotlin/kotlinx.serialization#1305
2021-01-26 14:57:40 +03:00
Dmitriy Novozhilov f61a318c9d [Test] Migrate AbstractBytecodeTextTest to new test infrastructure 2021-01-25 17:11:21 +03:00
Mads Ager ef36b81c67 [JVM_IR] Reduce the amount of super suffixes on accesibility bridges.
The super suffix was used for any static field/method that needed
an accessor. We should only use it when that field or method is
inherited.
2021-01-22 13:20:25 +01:00
Sergey Shanshin 10d9259df5 Returned support for nullable types by not null serializers
Fixes Kotlin/kotlinx.serialization#1265
2021-01-19 20:44:47 +03:00
Kevin Bierhoff c1360c5a7a Uast: resolve reified callees from classpath (#4013, KT-41279) 2021-01-14 20:29:03 +03:00
Alexander Udalov 3be62dfc89 Build: enable -Werror in stdlib/core/compiler/plugins modules
Exclude modules where there are still warnings in an explicitly declared
variable `tasksWithWarnings`.

Also remove "-progressive" from compiler arguments in modules which are
built with non-latest language version, as the warning about that leads
to an error with -Werror.
2021-01-13 19:34:24 +01:00
Alexander Udalov 2a7a297399 Suppress "runtime JAR files version mismatch" warnings in some plugins 2021-01-13 19:34:24 +01:00
Alexander Udalov 0d8f909bda Use ObsoleteTestInfrastructure instead of Deprecated in black box tests 2021-01-13 19:34:24 +01:00
Alexander Udalov 221f44da5f Fix warnings in stdlib/compiler/plugins/test code 2021-01-13 19:18:20 +01:00
Alexander Udalov b3d85e656e Fix warnings after update to 202 platform
#KT-44069 Fixed
2021-01-13 19:17:22 +01:00
Alexander Udalov d101f1b3a6 Minor, fix compiler warnings in kotlin-serialization-compiler 2021-01-13 19:17:21 +01:00
Ivan Gavrilovic dfdd107fc0 Update KAPT stubs for tests
Update expected outputs so they match
the new sorting rules.
2021-01-13 22:49:09 +09:00
Ivan Gavrilovic 3b2986f069 Apply consistent sorting for elements from the same position
There could be multiple elements originating from the same
position in the source file, so make sure to use name+desc to
sort those.
2021-01-13 22:49:09 +09:00
Ivan Gavrilovic ecc0eee3cf KT-44130: Sort fields and methods in generated stubs
Use the position in the source file if possible, and
only if the members are coming from other source files,
use their name and descriptor. This is necessary in order
to ensure deterministic output in clean and incremental
runs, while preserving the order of members in the sources.
2021-01-13 22:49:09 +09:00