Commit Graph

60494 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 9367c6a762 [NI] Use infered delegate expression type if there is no resolved call in trace
#KT-35707 Fixed
2020-01-14 12:18:24 +03:00
Dmitriy Novozhilov 605ef647e6 Regenerate tests 2020-01-14 12:18:23 +03:00
Vladimir Ilmov cac4a991f5 coroutine debugger toolbar added 2020-01-14 10:14:56 +01:00
Vladimir Ilmov e570450c59 coroutine debugger logic moved to jvm-debugger-coroutine module 2020-01-14 10:14:56 +01:00
Vladimir Ilmov b1b0817336 [coroutine][debugger] implementation basing on X-* approach
XCoroutine view added for direct comparison with Coroutines
2020-01-14 10:14:56 +01:00
Vladimir Ilmov 61c5ef61cc [coroutine][debugger] refactoring being done
X-view approach added for review, thread groups added
2020-01-14 10:14:55 +01:00
Kirill Shmakov 7f0437da68 Update AS version to 4.0 Canary 8 2020-01-14 11:32:55 +03:00
Ilya Gorbunov 0764a065e8 Rewrite UnderMigration and MigrationStatus in Java
to remove dependency on kotlin-stdlib.

#KT-33141
2020-01-13 23:30:32 +03:00
Vyacheslav Gerasimov fa1c6c9697 Build: Add missing com.github.node-gradle.node plugin versions 2020-01-13 19:40:08 +03:00
Vyacheslav Gerasimov b2039a9a13 Build: Specify version explicitly for com.github.node-gradle.node 2020-01-13 18:17:43 +03:00
Vyacheslav Gerasimov bf5bba42ce Build: Upgrade gradle enterprise plugin to 3.1.1 2020-01-13 18:17:43 +03:00
victor.petukhov fc7b836151 Fix isNegated psi method in KtWhenConditionInRange
^KT-34395 Fixed
2020-01-13 15:36:33 +03:00
Ilya Kirillov a10f37dd50 New J2K: fix exception when met PsiLambdaParameterType
#KT-35431 fixed
2020-01-13 14:32:48 +03:00
Ilya Kirillov 5be80be74d New J2K: fix converting multiline comment with /* inside
#KT-18001 fixed
#KT-35081 fixed
2020-01-13 14:32:47 +03:00
Ilya Kirillov a87de01c74 New J2K: add missing line break between property and getter
#KT-35739 fixed
2020-01-13 14:32:46 +03:00
Ilya Kirillov b83a529b77 New J2K: fix incorrectly removed line break before constructor comment
That caused class body brace to be under the comment

#KT-35478 fixed
2020-01-13 14:32:45 +03:00
Ilya Kirillov 7bfad12e6a New J2K: correctly convert compound Java assignment expression
#KT-35476 fixed
2020-01-13 14:32:45 +03:00
Ilya Kirillov 6a8a68a263 New J2K: fix UninitializedPropertyAccessException when calculating type of anonymous class
#KT-35395 fixed
2020-01-13 14:32:44 +03:00
Ilya Kirillov 7882f566be New J2K: Fix SOE in nj2k Java declarations printer 2020-01-13 14:32:44 +03:00
Ilya Kirillov 14a8d3726d New J2K: remove initializer from property without backing field
#KT-33637 fixed
2020-01-13 14:32:43 +03:00
Mikhail Glukhikh 1756857237 Rename: FirMemberScopeProvider -> FirDeclaredMemberScopeProvider 2020-01-13 13:26:19 +03:00
Mikhail Glukhikh 5c6341b4e4 [FIR] Handle fully qualified expressions separately in tower resolver 2020-01-13 13:26:13 +03:00
Mikhail Glukhikh 587430ff90 [FIR] Minor: remove FirSymbolProvider unused functions
buildDefaultUseSiteMemberScope & getSessionForClass were removed
2020-01-13 13:23:51 +03:00
Mikhail Glukhikh c343e5c9b7 [FIR] Refactoring: extract FirTowerResolver.towerDataConsumer() 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh c96e6e9da4 [FIR] Refactoring: store name in CallInfo 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh 9e0db86900 [FIR] Refactoring: create consumer inside tower resolver 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh 30e339a2d7 [FIR] Convert CallKind to enum class 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh f07adf085c [FIR] Minor refactoring: createFunctionConsumer 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh 02a57aab7d [FIR] Code refactoring: InvokeReceiverCandidateCollector 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh 5dbb98a5c8 [FIR] Code cleanup: CandidateCollector 2020-01-13 13:23:50 +03:00
Toshiaki Kameyama 6b2e58cc0b Inline function: fix it works correctly for callable reference receiver
#KT-26248 Fixed
2020-01-13 11:59:42 +03:00
Vladimir Dolzhenko 272ca002d7 Drop UNREACHABLE_CODE eager text range calculation
#KT-35242 Fixed
2020-01-12 17:23:30 +01:00
Ilya Gorbunov 9e4d7df86e Revert "[JS IR] stdlib: switch between artifacts rather than artifact content"
The default Jar task is disabled, but its archive file is still
configured as an artifact to be published in the 'archives' configuration.
Thus, neither 'install', nor 'publish' tasks could not find this file
when `libraryJarWithIr` isn't triggered and does not build it.
Removing that artifact from the 'archives' configuration artifacts makes
'install' task publish nothing.

Therefore it's better to revert the change so that 'libraryJarWithIr' task
always runs and produces an artifact with the default name.

This reverts commit a9fec211
2020-01-11 02:27:05 +03:00
Igor Yakovlev e2bb602271 Fix invalid test data file names 2020-01-11 00:03:48 +03:00
Igor Yakovlev 0c4134470d Fix exception of rename readonly overridden methods 2020-01-10 21:37:12 +03:00
Igor Yakovlev 3a2704d956 Remove usage of deprecated method 2020-01-10 21:22:51 +03:00
Igor Yakovlev df2a0e1087 Add MPP warning message for move refactoring 2020-01-10 21:22:51 +03:00
Alexander Udalov 2b4dc1199a JVM IR: fix monitorEnterMonitorExit.kt
After an inaccurate merge of 31936890 and d6ed93b2, this test was now
failing with the newly added assertion. It seems that currently the best
way to handle it would be to special-case these two methods in
SyntheticAccessorLowering.kt.
2020-01-10 18:07:27 +01:00
Mads Ager b2f8a4e82a JVM_IR: Put continuation parameter before default mask and handler.
This is important for calls using reflection as the reflect
library assumes this ordering of arguments.

It would be nice if this could be handled in the lowerings.
Currently AddContinuationLowering is after
DefaultArgumentStubGenerator. If we could add the continuation
first and then do default stub generation maybe we could avoid
the reshuffling introduced in coroutine codegen in this change.
2020-01-10 17:52:46 +01:00
Alexander Udalov c948459ed5 Minor, add comment to synthetic accessor generation for super calls
Also fix "useless elvis" warning in SyntheticAccessorLowering.
2020-01-10 14:09:00 +01:00
Alexander Udalov b48d7f4ba7 JVM IR: fix InterfaceLowering for $default methods from base interfaces
The first change here is swapping the isCompatibility and hasJvmDefault
checks. Otherwise behavior could be different depending on -Xjvm-default
mode even for non-JvmDefault declarations, which makes little sense.

Another change is avoiding generating $default stubs for fake overrides
in interfaces, which replicates the behavior of the current backend.
(Note that this change also fixes the first problem on the newly added
tests, but the first change seems useful anyway.)
2020-01-10 14:05:27 +01:00
Alexander Udalov 3848ac9cac JVM IR: never produce "$s<hash>" suffix for accessors in interfaces
Not sure if this affects real code, but this could happen in erroneous
cases such as in the subsequent commit, where it was a bit weird to see
this suffix without any supercalls involved.
2020-01-10 14:05:26 +01:00
Alexander Udalov 3193689086 JVM IR: do not add suffix for accessors to top level functions
This only reproduced when compiling (technically incorrect) code in the
standard library, where private functions monitorEnter/monitorExit are
accessed from another file, and their names with suffixes are not
recognized as intrinsics which should be replaced by
monitorenter/monitorexit JVM bytecode instructions.
2020-01-10 14:05:25 +01:00
Alexander Udalov d6ed93b2b8 JVM IR: fail when SyntheticAccessorLowering adds accessor to other files
This would help for example in debugging the issue fixed in the previous
commit.

The only problem by now where this lowering tried to add accessors to
foreign files was reproduced for interfaces inheriting from Cloneable.
There, we generate a DefaultImpls bridge that calls protected method
`clone` from java.lang.Cloneable.DefaultImpls. This makes no sense, but
the old backend behaves the same. Instead of generating accessor for it
in JVM IR, we now see all DefaultImpls bridges as public as a
workaround. (The fact that assertion no longer fails here is checked
e.g. by box/reflection/mapping/methodsFromObject.kt.)
2020-01-10 13:53:11 +01:00
Alexander Udalov 957b100cd1 JVM IR: do not generate hidden constructor for inline classes more than once
SyntheticAccessorLowering was initially implemented under the assumption
that any access to an invisible declaration will cause an accessor to be
generated _in the same file_. Moreover, it's declared in the group of
phases that are performed by file.

But this assumption is incorrect for constructors which need to be
hidden (those which take parameters of inline class types), since such
constructor is public and can be called from anywhere. In this case,
SyntheticAccessorLowering actually generated a new accessor for the
hidden constructor for each (!) source file where that constructor is
called, which led to ClassFormatError because of the class file having
multiple methods with the same signature. The internal `functionMap`
cache didn't help because it's not shared among phase instances for
different files (well, it helped to generate not more than one accessor
per usage-file).

In this change, we use the global cache, stored in JvmBackendContext,
for accessors to hidden constructors. Note that after this change, calls
to hidden constructors are always transformed to the corresponding
accessor in SyntheticAccessorLowering right away, but that accessor
might be orphaned for a while (not declared in any parent's
declarations). Only when SyntheticAccessorLowering encounters the
original constructor which needs to be hidden, it adds the accessor
beside it.

The test is sensitive to the file order, so both variants are added.
2020-01-10 13:49:05 +01:00
Sergey Rostov a339e7af19 build.gradle.kts: tests and docs for LastModifiedFiles collection 2020-01-10 15:41:23 +03:00
Dmitry Petrov 4cf8203ce7 PSI2IR: Unify behavior for lambda return values with old back-end
See KT-35849.

1. When expected lambda return type is a type parameter, don't generate
introduce implicit casts (even if the corresponding type parameter has
an upper bound that would otherwise require such cast).

2. Do not generate implicit null check for lambda return value of
@EnhancedNullability type.
2020-01-10 15:23:33 +03:00
Mads Ager c47e04ac8d JVM_IR: handle suspend functions for signatures in callable references. 2020-01-10 11:24:27 +01:00
anastasiia.spaseeva 3253907317 [Spec tests] Hotfix for not-null-assertion-expression test 2020-01-10 13:12:01 +03:00
Pavel Kirpichenkov 2a4e235e34 [NI] Decrease only input types check diagnostic level to warning 2020-01-10 13:05:40 +03:00