Commit Graph

2501 Commits

Author SHA1 Message Date
Sergey Shanshin bf6dda2d99 Lazy delegate for serializer in objects, sealed and abstract classes
Fixes Kotlin/kotlinx.serialization#585
2021-03-03 21:41:37 +03:00
Andrey Zinovyev b128577508 [KAPT] Some optimizations for stubs generation
* Add index to resolve compiled class by name
* Disable full property resolution
2021-03-03 12:05:49 +03:00
Anton Bannykh b0e0e62c0b Propagate isExternal flag in Psi2Ir and deserializer 2021-03-02 14:30:16 +03:00
Mikhael Bogdanov 373d0ac660 Fix ultra light class generation for private suspend methods 2021-03-01 16:20:20 +01:00
Dmitry Savvinov 42345b9c49 Minor: use more clear and specific naming for LazyClassContext.typeChecker (relevant for MPP with type refinement) 2021-02-26 12:37:02 +03:00
Alexander Udalov 0ebdf7c3c4 IR: add getPrimitiveType, optimize some usages of isInt/isByte/... 2021-02-25 21:00:09 +01:00
Ilya Kirillov 83f8650e80 Move CallableId from fir module to compiler.common to use in IDE 2021-02-24 20:13:41 +01:00
Alexander Udalov 7e149a3a44 IR: remove unneeded dependencies on psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov addabae8d2 IR: move frontend-dependent code into implementations in psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov d991a3e40f IR: simplify initialization cycle of TypeTranslator/ConstantValueGenerator 2021-02-24 19:07:38 +01:00
Pavel Semyonov 7669d8ff26 Add README.md for the kotlin-parcelize plugin 2021-02-25 02:59:50 +09:00
Alexander Udalov ca5a35b4b3 Move CompilerEnvironment from 'frontend' to 'cli'
This is needed in order to have a single convenient place where to
register frontend services implemented _outside_ of the 'frontend'
module, such as the control flow analysis, extracted to a separate
module in a subsequent commit.
2021-02-24 17:17:03 +01:00
Tianyu Geng 56854a8b1a FIR IDE: register quickfix for the following
1. NON_ABSTRACT_FUNCTION_WITH_NO_BODY
  2. ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS
  3. ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS
2021-02-19 13:16:42 +01:00
Sergey Shanshin 8c20c655fe Updated bytecode of serialization for IR
`shouldEncodeElementDefault` now checked before evaluating default value
2021-02-18 15:03:35 +03:00
Alexander Udalov dbadd5846a Add test for script flag in kotlin.Metadata
It passes at the moment because the test uses old backend, but the
required behavior is not yet supported in JVM IR, and it'll need to be
fixed.
2021-02-18 12:36:54 +01:00
Alexander Udalov 1d6b198915 Build: suppress version and JVM target warnings
To further reduce the output on each build.
2021-02-18 12:17:17 +01:00
Alexander Udalov 49fc1b9e3e Build: enable -Werror for several modules 2021-02-18 12:14:09 +01:00
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