Commit Graph

60148 Commits

Author SHA1 Message Date
Dmitry Petrov cdf9ef63ba Remove nullability assertions from special bridge call arguments 2019-12-24 12:50:06 +03:00
Toshiaki Kameyama fabeca5955 Redundant curly braces in string template: do not report labeled 'this'
#KT-35475 Fixed
2019-12-24 14:46:46 +07:00
Mikhail Glukhikh 80d29cdad1 FIR resolve: soften processBlock limitation during inference completion
This allows us to enter some lambdas unentered before
2019-12-24 10:42:55 +03:00
Mikhail Glukhikh fd73f5af20 FIR: simplify problematic test 2019-12-24 10:42:49 +03:00
Toshiaki Kameyama 03ec76b570 Redundant visibility modifier: do not report for 'internal' inside 'private'
#KT-35639 Fixed
2019-12-24 14:41:10 +07:00
Toshiaki Kameyama 49e5f170d1 "Replace 'when' with 'if'" intention: do not suggest if 'when' subject is variable declaration
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Toshiaki Kameyama 1cdcef3b08 "Split property declaration" intention: do not suggest in 'when' subject
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Ivan Gavrilovic eab6864269 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.
2019-12-24 15:14:47 +09:00
Ivan Gavrilovic 62924ddcd4 KT-35472: Detect when content of annotation processor changes
Even if annotation processor classpath is the same, in case
individual entries change (e.g. bulding annotationo processor
from source), KATP should run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testUnchangedAnnotationProcessorClasspathButContentChanged
2019-12-24 15:14:47 +09:00
Stéphane Nicolas 7b227f3113 Remove Redundant Project
Just some syntax cleanup when visting the file.
Note: I was trying to understand why the output folders of kapt are creating so eagerly in a build, during configuration time indeed...(they should be created later, during execution).
2019-12-24 15:14:47 +09:00
Georgy Bronnikov d4b0151f51 JVM_IR: fix name of received field for suspend lambdas
$ at the start caused AnonymousObjectTransformer to skip the field.
2019-12-23 18:03:46 +01:00
Ilmir Usmanov 068d3f4beb JVM_IR: Use IrInlineReferenceLocator to find inline suspend lambdas and lambdas, which capture crossinline 2019-12-23 18:03:45 +01:00
Ilmir Usmanov 1ea89ce28e JVM_IR: Minor. Unmute tests 2019-12-23 18:03:44 +01:00
Ilmir Usmanov 5c92da3f35 JVM_IR: Do not generate parameter annotations for continuation constructors
The idea is the same as in case of anonymous objects: they are created only
from Kotlin code, so we are sure, that the parameters are valid.
Also, the inliner complains on their transformations.
2019-12-23 18:03:43 +01:00
Ilmir Usmanov 9292022f88 JVM_IR: Support inner lambdas which capture crossinline 2019-12-23 18:03:42 +01:00
Ilmir Usmanov daa76cbf1e JVM_IR: Support inner objects with multiple suspend functions
Do not clean `functionsToAdd`
2019-12-23 18:03:41 +01:00
Ilmir Usmanov a1448ebb37 JVM_IR: Support crossinline suspend lambdas
The main idea is the following: since we need to generate
(fake)continuations before inlining, we move IrClasses of suspend
lambdas and continuation classes of named functions into the functions.
Thus, it allows the codegen to generate them prior to inlining and
the inliner will happily transform them for us.
Because of that, lowerings which transform call-site function are likely
to change reference to lowered suspend lambdas or functions.
Hence, do not rely on references to lowered suspend lambdas or
functions, instead, rely on attributes.

Do not generate continuation for inline suspend lambdas.
Previously, inline suspend lambdas were treated like suspend functions,
thus we generated continuations for them. Now we just do not treat them
as suspend functions or lambdas during AddContinuationLowering.
We should add continuation parameter to them, however.

Do not generate secondary constructor for suspend lambdas, otherwise,
the inliner is unable to transform them (it requires only one
constructor to be present).

Generate continuation classes for suspend functions as first statement
inside the function.
This enables suspend functions in local object inside inline functions.
Since we already have attributes inside suspend named functions, we
just reuse them to generate continuation class names. This allows us
to close the gap between code generated by old back-end and the new
one.

If a suspend named function captures crossinline lambda, we should
generate a template for inliner: a copy of the function without
state-machine and a continuation constructor call. The call is needed
so the inliner transforms the continuation as well.

Refactor CoroutineTransformerMethodVisitor, so it no longer depends on
PSI.
2019-12-23 18:03:40 +01:00
Ilmir Usmanov 3b37f6bd32 JVM_IR: Add attributes to named suspend functions
This is a prerequisite to moving continuation classes inside said
functions, which is needed to support crossinline suspend lambdas.
The logic of whether to copy attributes on lowerings or not is simple:
  - if the lowering moves function body to a new place, it should copy
  the attributes.
  - if the lowering just generates new declarations (i.e. bridges), it
  should leave attributes as is.
2019-12-23 18:03:39 +01:00
Igor Yakovlev 0f1592b023 Remove deprecated method usage 2019-12-23 16:32:43 +03:00
Igor Yakovlev 6fb788d446 Fix move refactoring for several class files
Fixed #KT-35235
(also fixed #KT-35427)
2019-12-23 16:32:43 +03:00
Mads Ager 51f726be9b JVM_IR: Fix check for whether classes are from Java.
This allows us to not generate redundant immutable collection
stubs. The code to generate the immutable collection stubs does
not deal well with thinking that all external declarations
come from Java.
2019-12-23 14:24:48 +01:00
Steven Schäfer e261b1e2de JVM IR: Fix line numbers in callable reference classes 2019-12-23 14:03:34 +01:00
pyos 59f2aa7add JVM_IR: remove constructors of nested annotations 2019-12-23 13:59:42 +01:00
pyos 17d2fda946 JVM_IR: keep nullability when remapping type parameters 2019-12-23 14:28:05 +03:00
Igor Chevdar 1b95040934 [kotlin-native-plugin] Two fixes:
* Added property to select the cache kind (none, dynamic, static)
* Fixed the check if the cache needs to be rebuilt
2019-12-23 12:37:38 +03:00
Mikhail Zarechenskiy e078282767 Fix ambiguity between Java and Kotlin SAM candidates
Because of incorrect flag we generated synthetic SAM candidates and got ambiguity when feature `SamConversionPerArgument` was enabled (Gradle case) because candidates for Java were duplicated

 #KT-35579 Fixed
2019-12-23 12:22:20 +03:00
Mikhail Glukhikh 99e02665b5 Add forgotten FIR test data for old FE test 2019-12-23 12:11:07 +03:00
Mikhail Glukhikh 81ac46d35d Fix FIR test data for old FE test 2019-12-23 12:02:54 +03:00
Ilya Goncharov 74889ef3ad [Gradle, JS] Actualize node and yarn version
#KT-35599 fixed
2019-12-23 11:31:15 +03:00
Ilya Goncharov 24e3310393 [Gradle, JS] Add check on run and dist task
- Check existence of compile output file to prevent fail in case of NO-SOURCE

#KT-31894 fixed
2019-12-23 11:29:17 +03:00
Dmitry Petrov fefdce0406 KT-35550 Generate type parameters for delegating property accessors 2019-12-23 10:10:16 +03:00
Igor Yakovlev 4efab51751 Fix allopen call from UL methods
Fixed #KT-35577
2019-12-20 16:57:53 +03:00
Igor Chevdar 8d02d00f22 [IR Serialization] Removed native-specific hack in mangler 2019-12-20 16:13:11 +03:00
pyos 1f55b59fa3 Unmute a fixed Fir2IrText test 2019-12-20 15:12:37 +03:00
pyos 26822a0cde Minor: IGNORE_BACKEND: ANY_FIR -> IGNORE_BACKEND_FIR: ANY
for consistency with blackbox tests.
2019-12-20 15:12:36 +03:00
Mikhail Glukhikh 38a3797325 Unmute FIR2IR test (due to fixed bug in FIR) 2019-12-20 14:44:46 +03:00
Ilya Kirillov 69e9ae94c6 Use snakeyaml from maven instead of from intellij
As new-project-wizard-cli module is not bundled into the plugin jar
2019-12-20 14:13:29 +03:00
pyos 2adcb5dec4 Add the ANY_FIR target for muting Fir2IrText tests 2019-12-20 13:03:39 +03:00
pyos a4b005fd5d PSI2IR: generate field writes for all val property assignments
Assuming the frontend is correct, and it hopefully is, all of them are
initializations even if not done in the owner class directly.
2019-12-20 13:03:39 +03:00
Ilya Kirillov 92f8432b1e New J2K: Fix not converted jetbrains nullability annotations for types
it became broken after annotation started to be assigned to type elements
instead of declarations after 4da7d11

#KT-34987 fixed
2019-12-20 13:02:51 +03:00
Mikhail Zarechenskiy 3840294f44 Add tests for obsolete issues
#KT-11979 Obsolete
 #KT-12898 Obsolete
 #KT-30657 Obsolete
 #KT-28446 Obsolete
2019-12-20 12:06:20 +03:00
Mikhail Zarechenskiy c3ffef1840 Fix incorrect use of language feature
See #KT-34889 for details
2019-12-20 12:06:17 +03:00
Dmitriy Novozhilov c94dd2939e [NI] Add test for KT-32429
#KT-32429 Can't Reproduce
2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov e730965bc5 [NI] Approximate intersection type in type argument to star if it's necessary
#KT-32196 Fixed
2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov 26f7bf1c21 Regenerate tests 2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov e466fd5196 [NI] Infer type variable to Nothing if all upper constraints are from upper bounds
#KT-32196 Fixed
2019-12-20 11:17:47 +03:00
Dmitriy Novozhilov 7fed7a840b [NI] Update some testdata broken in NI 2019-12-20 11:17:47 +03:00
Ilya Kirillov c311a66e5e Fix 191 & as35 compilation 2019-12-20 04:15:26 +03:00
Ilya Kirillov d6daaf14f8 Fix "Protected function call from public-API inline function is prohibited" error 2019-12-20 04:12:49 +03:00
Nikolay Krasko 2dcc617774 Minor: reformat 2019-12-20 02:39:05 +03:00