Commit Graph

55377 Commits

Author SHA1 Message Date
Ilya Kirillov f75a7cbfc9 New J2K: fix test data for java8MapForEachWithFullJdk test 2019-06-05 23:33:12 +03:00
Ilya Kirillov a56155ca73 New J2K: correctly handle vararg annotation parameter of external Java class
#KT-31726 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov 58611ec417 New J2K: add test data for #KT-16662, #KT-15991, #KT-12050 2019-06-05 23:33:12 +03:00
Ilya Kirillov c1e24d818b New J2K: fix NPEs in nullability analysis
#KT-31817 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov 1a9deed5d8 New J2K: add conversion progress bar
Relates to #KT-31812
2019-06-05 23:33:11 +03:00
Ilya Kirillov f51e28ea68 New J2K: commit file after each post-processing
#KT-31809 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov 0623fa4349 New J2K: reformat JavaToKotlinAction.kt 2019-06-05 23:33:11 +03:00
Ilya Kirillov aaab1fe134 New J2K: suggest user to configure Kotlin in a project before nj2k conversion 2019-06-05 23:33:11 +03:00
Leonid Startsev 3792c44378 Make short path for non-serializable classes and other improvements:
Adjust some error messages
Add 'fallbackElement' to report on when property is implicitly typed
Split findTypeSerializerOrContext into checked and unchecked versions
2019-06-05 19:13:03 +03:00
Leonid Startsev dc79b99dd2 Implement inspection about no-arg constructor in non-serializable supertype 2019-06-05 19:11:18 +03:00
Leonid Startsev 8f77b55ada Retrieve serializable properties from binding context in most of the places
Remove unused record 'SERIALIZER_FOR_PROPERTY'
2019-06-05 19:11:18 +03:00
Leonid Startsev fe1f36bc02 Report an error on @Serializable inline classes and missing @Transient initializers 2019-06-05 19:12:34 +03:00
Leonid Startsev e6d96f1de9 Implement diagnostic about nullable serializer for non-nullable type 2019-06-05 19:12:00 +03:00
Leonid Startsev 6895184b84 Implement basics diagnostics reporting from the serialization plugin similarly to noArg and allOpen plugins 2019-06-05 19:11:20 +03:00
Leonid Startsev d3a596e3c2 Correctly copy init blocks code to deserialization constructor
Fixes https://github.com/JetBrains/kotlin-native/issues/3019

Workaround problem with proguard and inline reified functions
2019-06-05 17:44:34 +03:00
Leonid Startsev 6370f0b3be Correctly reference deserialization constructor added by plugin
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/472
2019-06-05 17:43:46 +03:00
Alexander Udalov 43cb17cdd5 Check expected type of annotation parameter correctly in AnnotationDeserializer
The main idea of this refactoring is to separate two usages of
`AnnotationDeserializer.resolveValue`: the one where we load annotation
argument values, and the one where we load constant values of properties
for JS/Native/Common
(`AnnotationAndConstantLoaderImpl.loadPropertyConstant`).

In the latter case, `expectedType` is the type of the property and it
can be a supertype of the actual value (e.g. see `arrayConst` in
compiler/testData/serialization/builtinsSerializer/compileTimeConstants.kt).
But in the former case, we need to check that the value conforms to the
expected type and disregard it if it's not the case, which is possible
if the annotation was recompiled separately.

 #KT-28927
2019-06-05 14:44:15 +02:00
Alexander Udalov c666b60ca3 Support arrays of class literals in AnnotationDeserializer
#KT-28927 Fixed
2019-06-05 14:44:14 +02:00
Dmitry Gridin 52ec9e0fa8 Extract resolve from write action & cleanup AddOperatorModifierInspection
Relates to #KT-31533
2019-06-05 19:27:52 +07:00
Toshiaki Kameyama 4c62788c3e Make "Add operator modifier" an inspection instead of intention
#KT-31533 Fixed
2019-06-05 19:27:52 +07:00
Mikhael Bogdanov 5123e1f078 Add project property for workers count 2019-06-05 14:24:26 +02:00
Ivan Gavrilovic 7a2332fe36 KT-31714: Close files after analysis in incremental KAPT
Artifact transform used to analyze classpath was not closing files, which
caused java.nio.file.FileSystemException. This commit fixes that, and all
input streams are closed after use.

Fixes: KT-31714
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 695f202e46 KT-31127: add only generated Java sources to JavaCompile inputs
This commit changes how generated sources are added to the Gradle JavaCompile
task. Previously, directory was added to sources which caused issues with
annotation processors that only generate Kotlin sources. I.e. JavaCompile task
was executed but no java sources existed.

Now, only generated Java sources are added to the JavaCompile task. This
means that if only Kotlin sources are generated JavaCompile task will be
skipped.

Fixes: KT-31127
Test: Kapt3IT.testKotlinProcessorUsingFiler
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 55ba985cd2 KAPT: do not discover incremental APs only if cache is not set
KaptFlag.INCREMENTAL_APT is used to indicate that KAPT run
should try to be incremental because changes to input files and
classpath have been detected. However, first run of the Gradle
task will set this flag to false, which means that all APs will be
detected as non-incremental in the first run. Further on, this means
that the dependency caches will be invalid, and all subsequent runs
will be non-incremental as well.

This commit uses existence of dependency cache to determine if incremental
APs should be discovered. The regression was introduced in
72fdc648ff.

Test: ./gradlew :kotlin-gradle-plugin-integration-tests:testAdvanceGradleVersion --tests *KaptIncrementalWith*\
 && ./gradlew :kotlin-gradle-plugin-integration-tests:test --tests *KaptIncrementalWith*
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 1fa990b063 Support isolating APs that report multiple originating elements from the same file
It is possible for isolating annotation processor to report two or more
originating elements from the same source file when generating
sources/classes/resources. This commit makes sure the source file are
de-duped, so assertion that there is a single source file does not fail.

Test: IsolatingIncrementalProcessorsTest.testIsolatingWithMultipleOriginatingElements

This is improvement to https://youtrack.jetbrains.com/issue/KT-23880
2019-06-05 18:19:49 +09:00
Ivan Gavrilovic 76f62da6ae Improve constants analysis in KAPT
When analyzing source files in KAPT for incremental annotation processing,
avoid creating TreePath instances for initializers that are literals. E.g.
if it is just a boolean/int literal, we do not need to visit the tree nor
create expensive TreePath instance.

For classes that contain only constants (such as R.java for Android projects)
this is a significant improvement. Class that contains 16000 constants took
more than 10 seconds to analyze, now it is 70ms.
2019-06-05 18:19:49 +09:00
Yan Zhulanow 84c048ca81 Do not run task verification in NMPP tests on 183 platform as well 2019-06-05 18:17:45 +09:00
Ting-Yuan Huang 1b4d26e490 psi2ir: keep the type of when when possible
Ideally, the type of `IrWhen` should be provided by type inference for
a consistent behavior. `USED_AS_EXPRESSION` from CFG isn't always
consistent with type inference, unfortunately.

The behavior is now aligned with `if`. The type of `when` is kept when
it *can* be an expression, instead of whether it is used or not.
2019-06-05 10:23:44 +02:00
Svyatoslav Kuzmich cd651be461 [JS IR BE] Migrate JS BE to common klib utils 2019-06-05 11:15:45 +03:00
Mads Ager 0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Dmitry Gridin bf9dde5c32 Fix assert from createExpression in RemoveRedundantQualifierNameInspection 2019-06-05 13:17:12 +07:00
Yan Zhulanow 09ff9a65a5 Fix 182 bunch tests, do not perform task tests on older platform versions 2019-06-05 13:27:38 +09:00
Yan Zhulanow a575c7e5b5 Minor: Fix NPE in BinaryModuleInfo, handle empty scopes 2019-06-05 13:27:38 +09:00
Mikhail Glukhikh 71590b6735 Introduce Kotlin language substitutor to fix exceptions in velocity files
Related to KT-31470 (should fix the problem or at least soften it)
May be related also to KT-30977
#KT-30886 Fixed
2019-06-04 23:30:02 +03:00
Abduqodiri Qurbonzoda 37dfbb3eba Workaround unpaired surrogates replacement with ? (KT-31614) 2019-06-04 21:25:41 +03:00
Sergey Rostov 1c0519b0a2 Gradle, js, npm: fix resolving transitive npm dependencies using yarn.lock
- already visited transitive npm dependencies should be stored in parent dependencies
- child NpmDependency should search resolved project data in parent NpmDependencies
2019-06-04 19:32:10 +03:00
Sergey Rostov 465a47a194 Gradle, js, npm: fix idea gradle sync for multiproject builds
npm resolver ProjectData stored per project (not in root project)
2019-06-04 19:32:10 +03:00
Sergey Rostov b5080bda75 Gradle, js, npm: fix reading package.json files
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
Sergey Rostov 32a0bb9f0e Gradle, js, npm: fix npm aggregated configuration attributes
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
ilgonmic 16200181cc KT-31645 Fix yarn downloading on Windows 2019-06-04 17:38:24 +03:00
Vyacheslav Gerasimov 7d38977f5e 192: Update since & until versions for 192 plugin 2019-06-04 16:34:33 +03:00
Mikhael Bogdanov 79074a7650 Specify JVM target for inline tests 2019-06-04 14:56:14 +02:00
Mikhael Bogdanov 81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Mikhael Bogdanov 3c093f321d Support unbound callable function references in inliner 2019-06-04 14:56:12 +02:00
Sergey Igushkin 0b59d0b416 Fix testAndroidMppProductionDependenciesInTests Gradle version too low
The required Gradle version for AGP 3.3 is 4.10.1+. Use 5.0.
2019-06-04 15:36:22 +03:00
Dmitriy Dolovov ef680cf332 KLIB reader: Add missed JARs to IDEA plugin 2019-06-04 12:40:56 +03:00
Yan Zhulanow bc6f01805e Fix JVM test running in MPP projects (KT-30814) 2019-06-04 17:56:05 +09:00
Mikhail Zarechenskiy 6d3a7102d5 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 11:07:50 +03:00
Sergey Rostov 8dabf24b41 Gradle: provide descriptions for JS tasks
#KT-31560 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov fbefa17337 Gradle, NPM, windows: creating symlink without administrator privilege
#KT-31694 Fixed
2019-06-04 10:00:59 +03:00