Commit Graph

56752 Commits

Author SHA1 Message Date
Ilya Matveev 499f9330d2 Gradle: Don't use the deprecated "layout" method for Ivy repos
Issue #KT-30258 fixed
2019-08-06 14:13:27 +07:00
Roman Golyshev b8bdef0005 Refactoring: introduce isKotlinScratch function 2019-08-06 09:31:17 +03:00
Roman Golyshev f35ce1e9f6 Refactoring: remove duplicate of kotlin script extension constant 2019-08-06 09:29:45 +03:00
Alexander Udalov 49b534e894 JVM IR: move non-private const properties from multifile part to facade 2019-08-05 21:27:22 +02:00
Alexander Udalov f01b0f6467 JVM IR: generate correct metadata for multi-file classes 2019-08-05 21:27:21 +02:00
Alexander Udalov 4be0e00071 JVM IR: support multi-file classes
Without the `-Xmultifile-parts-inherit` mode for now.

This is implemented as follows: FileClassLowering collects information
about multifile parts and the corresponding facades, which a later
GenerateMultifileFacades phase uses to generate new IrFile instances and
add it to the module fragment that's being compiled.

Note that GenerateMultifileFacades is in the end of lowering phases
because delegates in the facade should be generated for all additional
functions generated by certain lowerings (default arguments,
JvmOverloads, etc.). If GenerateMultifileFacades was right after
FileClassLowering, they would still be generated, but we'd then process
them in lowerings mentioned above, which would result in duplicated
logic in the bytecode. There's a new bytecode text test which checks
that this doesn't happen for functions with default arguments.
2019-08-05 21:27:21 +02:00
Alexander Udalov 73a671af7c JVM IR: generate tests on incremental compilation 2019-08-05 21:27:21 +02:00
Alexander Udalov e1fc2c57cb JVM IR: introduce global serialization bindings for convenience
In the old JVM backend, JvmSerializationBindings are created per
ClassBuilder, and special care must be taken to make sure that
JVM-specific metadata ends up in the correct bindings. This is
especially relevant for declarations whose metadata is moved to other
classes away from the place where the original declaration lies, for
example properties moved from companion object to the outer class, or
synthetic methods for annotation properties in interfaces moved to
DefaultImpls, or const properties in multifile parts moved to the
facade.

In the JVM IR backend, this seems not necessary and actually it's
complicated to ensure that we use the correct ClassBuilder for bindings
(see the code simplification in ClassCodegen). Therefore, in case we
don't have an easy way to retrieve the correct ClassBuilder instance, we
now write all JVM-specific metadata to the new _global_ bindings map in
GenerationState, which is used by JvmSerializerExtension as a fallback
if the ClassBuilder's local map has no relevant key.
2019-08-05 21:27:21 +02:00
Alexander Udalov babbbd0ff6 JVM IR: generate facade class for property accessors from dependencies 2019-08-05 21:27:20 +02:00
Alexander Udalov 28e2fd63ca IR: introduce WrappedProperty{G,S}etterDescriptor
This is needed in order to support wrapped properties properly in
KotlinTypeMapper (see the `is PropertyAccessorDescriptor` call in
`mapFunctionName`) which is still being used when mapping function call
signatures
2019-08-05 21:27:20 +02:00
Alexander Udalov cfd3d974d1 JVM IR: perform substitution in IrTypeSystemContext.getSubstitutedUnderlyingType 2019-08-05 21:27:20 +02:00
Alexander Udalov 908498a560 JVM IR: deduplicate exception message text in FunctionCodegen
See 37002748c8
2019-08-05 21:27:20 +02:00
Alexander Udalov 5f06c9e86c JVM IR: do not generate generic signature for $delegate field
See ee7bbbf530
2019-08-05 21:27:20 +02:00
Alexander Udalov 45f93521d9 JVM IR: add IrWriteSignatureTestGenerated 2019-08-05 21:27:20 +02:00
Alexander Udalov 26346d88cc JVM IR: take IrFunction in IrTypeMapper.mapFunctionName/mapReturnType 2019-08-05 21:27:20 +02:00
Alexander Udalov 8c1b2a7f20 JVM IR: record DELEGATED_PROPERTIES slice for correct metadata serialization
This is needed in order to get rid of CodegenAnnotatingVisitor in JVM IR
2019-08-05 21:27:19 +02:00
Ilmir Usmanov d9caeca249 JVM_IR: Copy suspend lambda's attributes 2019-08-05 20:25:31 +03:00
Sergey Igushkin 88e5d2bc70 Fix unrelated tasks being configured at execution time, KT-31666
Replace iteration over all tasks with `.matching { ... }` with `
.configureEach { if (...) ... }`, so that the check iterates
just over those tasks which are triggered to configure from
somewhere else.

Issue #KT-31666 Fixed
2019-08-05 17:08:22 +03:00
Steven Schäfer 9182fe887e Fix inline class handling in DefaultParameterInjector 2019-08-05 16:48:18 +03:00
Steven Schäfer 79f71f61d5 JVM BE: Add more tests for default arguments
- Inline class parameters should not be boxed.
- Empty vararg parameters should not allocate an empty array.
2019-08-05 16:48:18 +03:00
Roman Golyshev 9d7de8e9ec KT-32791: Avoid EDT when acquiring editor for setting line mark in scratches
^KT-32791 Fixed
2019-08-05 16:28:56 +03:00
Mikhael Bogdanov 971d36837a JVM_IR. Don't generate annotations and signature on synthetic methods 2019-08-05 15:00:51 +02:00
Ilya Kirillov 2dabb91a1f J2K, minor: clean copy-paste conversion code 2019-08-05 15:14:28 +03:00
Ilya Kirillov f1482177b4 Fix NPE in J2K copy-paste handler for invalid offset 2019-08-05 15:14:28 +03:00
Ilya Kirillov 838582c926 Fix "Assertion failed: Write access is allowed inside write-action only" in Kotlin refactoring dialog
#KT-33059 fixed
2019-08-05 15:14:28 +03:00
Ilya Kirillov b4a0436aba Show occurrences chooser in EDT thread in KotlinIntroduceVariableHandler 2019-08-05 15:14:27 +03:00
Ilya Kirillov 02f2009f2a Do not show "Replace overloaded operator with function call" intention on incomplete expressions
#KT-33115 fixed
2019-08-05 15:14:27 +03:00
Toshiaki Kameyama 892135ae23 Unused symbol: don't report for enum entry when enum builtin function is used
#KT-31133 Fixed
2019-08-05 12:50:28 +03:00
Toshiaki Kameyama 776cccf57c FunctionWithLambdaExpressionBodyInspection: fix ClassCastException for "Remove braces" quick fix
#KT-32580 Fixed
2019-08-05 12:35:23 +03:00
Louis CAD e5e5e9084e Improve error message (#2505)
Fore the case where a target has been created or configured twice with different presets,
avoid showing "null" inside the error message if existing target has not preset,
and append a point.
2019-08-05 10:35:10 +03:00
Ilya Gorbunov b2753a22a2 Advance bootstrap to 1.3.60-dev-607 2019-08-04 06:01:56 +03:00
Ilya Gorbunov 103e16c40f kotlin-maven-plugin: avoid adding sourceroots to read-only freeArgs list 2019-08-04 03:15:54 +03:00
Georgy Bronnikov 5d12603d73 JVM_IR: remove unused code 2019-08-04 01:35:05 +03:00
Georgy Bronnikov ce6e2621cf Unmute working tests 2019-08-04 01:35:05 +03:00
Georgy Bronnikov f9391ec790 Remove handling of default arguments from codegen 2019-08-04 01:35:05 +03:00
Georgy Bronnikov 4d50086d35 JVM_IR: reorder lowerings
Some lowerings have to come before DefaultParameterInjector.
2019-08-04 01:35:05 +03:00
Georgy Bronnikov 924fa6f9d3 JVM_IR: use DefaultParameterInjector 2019-08-04 01:35:05 +03:00
Dmitry Gridin 52c00ba2a1 Extract JvmStartupActivity class 2019-08-02 19:23:23 +03:00
Dmitry Gridin 77a630ce34 UnsupportedAbiVersionNotificationPanelProvider: fix project leak 2019-08-02 19:19:47 +03:00
Dmitry Gridin 584b42d9f9 Add missing EP for StartupActivity 2019-08-02 19:19:47 +03:00
Dmitry Gridin 832c8e0e20 Fix "Non default constructors for extension class" 2019-08-02 19:19:47 +03:00
Dmitry Gridin 9ea2446ec0 KotlinLanguageInjector: cleanup code 2019-08-02 19:19:47 +03:00
Dmitry Gridin 49aa4aba71 UnsupportedAbiVersionNotificationPanelProvider: cleanup code 2019-08-02 19:19:47 +03:00
Simon Ogorodnik 7c24ad39ea Remove fir:lightTree test on kotlinx.coroutines as it caused problems in IDEA 2019-08-02 17:33:29 +03:00
Ilya Kirillov be7b228cf6 Fix "Attempt to modify PSI for non-committed document" for some cases
It can be thrown after an action when optimize imports is called
2019-08-02 12:03:59 +03:00
Ilya Kirillov 1981e8b9bf New J2K: Add better error reporting in AST builder 2019-08-02 12:03:59 +03:00
Ilya Kirillov 6b0c1da42c Do not use methods which may show UI dialog in write action in refactorings
#KT-33082 fixed
2019-08-02 12:03:59 +03:00
Ilya Kirillov 474a8850b3 Do not show error message in decompiler in write action
#EA-209667 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov 3205b25f80 Fix code completion for the injected Kotlin code
Allow completion of physical files as it is the case for injected Kotlin code.
Also, fix function completion for that case as `document.charsSequence` for injected code document is not dynamically updated as for usual document.
So, we should to do it manually

#KT-31117 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov 84498513f6 Do not allow optimize imports for uncommitted document
Optimize imports may be called after executing command, and document can be uncommitted after command is finished. In that case we will get ISE: Attempt to modify PSI for non-committed Document

#EA-209693 fixed
2019-08-02 12:03:58 +03:00