Commit Graph

56782 Commits

Author SHA1 Message Date
Yan Zhulanow e301ddde9e Pill: Ignore KotlinPlugin artifact in Git 2019-08-07 01:15:30 +09:00
Yan Zhulanow 52a958256d Debugger: Disable exception on 'variable not found' event (EA-138365)
The error message is still visible to the user, so it doesn't make much sense to duplicate it as an exception.
2019-08-07 01:15:30 +09:00
Yan Zhulanow e0c4a1c6f1 Debugger: Improve error diagnostics in FUS 2019-08-07 01:15:29 +09:00
Yan Zhulanow a20014a7e6 Reformat eval4j 2019-08-07 01:15:29 +09:00
Yan Zhulanow eb173893b0 Debugger: Minor, check evaluator preconditions as in Java evaluator 2019-08-07 01:15:29 +09:00
Yan Zhulanow d6487e89ad Debugger: Prohibit 'suspend fun' calls in evaluated expressions
Currently, it's impossible to call suspend functions in evaluated code fragments (see KT-31701).
This commit officially prohibits such calls, so users will see a semi-friendly error message.
2019-08-07 01:15:29 +09:00
Yan Zhulanow 910133dbfb Debugger: Fix line numbers on String literal 'when' condition checks
Before this commit, line numbers were only available on 'when' clause bodies.
So, if a clause condition check didn't succeed, the entirely clause could be ignored.
2019-08-07 01:15:28 +09:00
Yan Zhulanow 3d3bde5483 Debugger: Do not ignore duplicated locations for line breakpoints 2019-08-07 01:15:28 +09:00
Yan Zhulanow de361f0b6c Minor: Add 'kotlinc' to the project dictionary 2019-08-07 01:15:28 +09:00
Yan Zhulanow 780c0518e5 Debugger: Disallow breakpoints for @InlineOnly function bodies (KT-32687, KT-24408)
Kotlin compiler strips all debug information for @InlineOnly functions, making them non-debuggable.
This commit disables breakpoints inside @InlineOnly functions to prevent false expectations.
2019-08-07 01:15:28 +09:00
Yan Zhulanow 25fb77e7ad Debugger: Add breakpoint applicability tests
This commit adds a number of tests that check breakpoint placing behavior, and an inline action that work the same way as tests.
2019-08-07 01:15:28 +09:00
Yan Zhulanow a8d08815a6 Simplify call: Fix false positive in "filter {}" detection (KT-32468)
"Simplify filter {}" conversion changes semantics when the casted type is not a subtype if an initial collection element type.
This commit limits a replacement suggestion to subtype cases.
2019-08-07 01:15:28 +09:00
Yan Zhulanow b1f132d750 Debugger: Add stepping tests for function breakpoints 2019-08-07 01:15:27 +09:00
Yan Zhulanow 023baf6233 Debugger: Ask for light class generation in background 2019-08-07 01:15:27 +09:00
Yan Zhulanow 129ca7f2d8 Debugger: Fix breakpoint applicability (KT-10984)
Ensure that breakpoints of each type can be placed only on lines where it makes sense to place a breakpoint.

Here is a quick summary of the rules:
1. Method breakpoints are available for functions, property accessors, constructors;
2. Line breakpoints are available on any line with an expression, excluding some cases like 'const' property initializers or annotations;
3. Line breakpoints should be available on a '}' in functions and lambdas;
4. Line breakpoints are not suggested for one-liners;
5. Lambda breakpoints should be shown for single-line lambdas.
2019-08-07 01:15:27 +09:00
Yan Zhulanow 22c18ffaa9 Debugger: Add Kotlin Function breakpoints (KT-22116)
Now it's possible to put a function breakpoint.
In JVM, function breakpoints behave as JVM method breakpoints. Normally, they're triggered twice – once on enter, and once on exit.
2019-08-07 01:15:27 +09:00
Yan Zhulanow 55ea0840b1 Debugger: Keep continuation and spilled variables until the whole trace is processed (EA-208000) 2019-08-07 01:15:27 +09:00
Vyacheslav Gerasimov 89b152809f Build: Make dependencies on builtins compileOnly
for kotlin-annotations-android & kotlin-annotations-jvm, to prevent
builtins from occurring in maven pom compile scope.

 #KT-33140
2019-08-06 18:09:20 +03:00
Mikhail Zarechenskiy 80acc56c10 Don't lost type parameters for members of inline classes in the bytecode
#KT-33157 Fixed
2019-08-06 17:53:08 +03:00
Sergey Igushkin a874f4f5c3 Don't use addIfNotNull core util in the JS Gradle plugin
The function was placed in a package whose another top-level function
used coroutines. This led to a NCDFE kotlin.coroutines.Continuation
with Gradle versions that bundle Kotlin pre-1.3 stdlib.

Instead, use the existing util function `lowerCamelCaseName` which also
filters nulls.
2019-08-06 16:55:46 +03:00
Mikhael Bogdanov 47bee6a6c5 JVM_IR. Support reified parameters in anonymous object super constructor call 2019-08-06 14:48:16 +02:00
Mikhael Bogdanov 645736f167 JVM_IR. Support anonymous object/lambda reification 2019-08-06 14:48:16 +02:00
Vyacheslav Gerasimov 0571f90762 Build: Add kotlin.build.jar.compression property
Is `true` on teamcity and `false` locally by default

 #KT-32573
2019-08-06 15:40:40 +03:00
Vyacheslav Gerasimov 659c399d30 Build: Add kotlin.build.dependencies.dir property
To specify directory downloaded dependencies stored in

 #KT-30310
2019-08-06 15:40:40 +03:00
Dmitry Petrov 1d0ba4edd4 IR: IrTypeAlias: update testData after rebase on master 2019-08-06 12:42:44 +03:00
Dmitry Petrov f590d4da9e IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations.
Implement WrappedTypeAliasDescriptor.
2019-08-06 12:42:43 +03:00
Dmitry Petrov b3525b077c IR: IrTypeAlias: isActual 2019-08-06 12:42:02 +03:00
Dmitry Petrov 2b43b09444 IR: IrTypeAlias: Strip 'typealias' declarations in back-ends 2019-08-06 12:42:02 +03:00
Dmitry Petrov 6abb0ffe28 IR: IrTypeAlias: Update FIR2IR testData
NB a lot of FIR2IR tests actually don't pass, and we don't care much at
the moment.
2019-08-06 12:42:02 +03:00
Dmitry Petrov 48ae76ac28 IR: Introduce IrTypeAlias element 2019-08-06 12:42:02 +03:00
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