Commit Graph

45631 Commits

Author SHA1 Message Date
Mikhael Bogdanov 655b737a1e Don't use descriptors for static check 2018-04-26 14:28:14 +02:00
Mikhael Bogdanov 096c9e440b Initialize parameters in irFunctions 2018-04-26 14:28:13 +02:00
Mikhael Bogdanov ec4ff2f2b5 Minor. Reformat 2018-04-26 14:28:13 +02:00
Mikhael Bogdanov 6ca55bafdf Properly inline default methods 2018-04-26 14:28:12 +02:00
Mikhael Bogdanov 97ad3f9ddd Generate $default functions for inline ones in JVM-backend 2018-04-26 14:28:11 +02:00
Mikhael Bogdanov e6c88755e9 Minor. Code clean 2018-04-26 14:28:10 +02:00
Mikhael Bogdanov a8dacccdd3 Minor. Reformat 2018-04-26 14:28:09 +02:00
Ilya Gorbunov 579822c114 Regenerate w3c declarations to get new MDN references 2018-04-26 14:09:05 +03:00
Zalim Bashorov 5c40892c57 [JS IR BE] Right support for inc and dec on primitive numbers 2018-04-26 13:46:50 +03:00
Zalim Bashorov 6725f085c7 [JS IR BE] Deprecate Name.toJsName and remove dummyScope 2018-04-25 22:21:25 +03:00
Zalim Bashorov 27988cd2f4 Remove the version of fail.kt that was "hacked" for JS IR BE tests 2018-04-25 22:21:22 +03:00
Zalim Bashorov 34587d9192 [JS IR BE] unmute tests 2018-04-25 22:20:43 +03:00
Zalim Bashorov a6f4594679 [JS IR BE] Intrinsicify kotlin.js.js 2018-04-25 22:20:41 +03:00
Zalim Bashorov 8d89a93c44 [IR JS BE] Add core.kt to list of compiling files for JS IR BE tests 2018-04-25 22:18:58 +03:00
Zalim Bashorov 9c25b21510 Minor: remove useless comments from JsIrBackendContext 2018-04-25 22:18:57 +03:00
Zalim Bashorov 8871cf660c [stdlib-js] Split core.kt in stdlib-js into few files to simplify using part of it in JS IR BE related tests 2018-04-25 22:18:57 +03:00
Jim S cebee7b5e1 Add context to generateSynthetic* in SyntheticResolveExtension 2018-04-25 20:18:10 +03:00
Jim S d63a2462ef Eliminate duplicate call to genSyntheticClassOrObject
As far as I can tell (and admittedly I'm not an expert in the Kotlin compiler code), it looks like the new logic iterates over all contributed descriptors, which renders the old logic (which explicitly invokes getCompanionObjectDescriptor) obsolete.  We ran into this last year when rebasing on top of https://github.com/JetBrains/kotlin/commit/527ccaff16ecebbfbcecabd5fbc8af808a296915 and - after a quick conversation with @sandwwraith (email chain dated December 12, 2017) - we unblocked ourselves by deleting the old code from our local repository.  Now we're looking to upstream our changes, thus this PR.

Old code:
```
         // Generate synthetic (non-declared) companion if needed
         ClassDescriptor companionObjectDescriptor = descriptor.getCompanionObjectDescriptor();
         if (companionObjectDescriptor instanceof SyntheticClassOrObjectDescriptor) {
             genSyntheticClassOrObject((SyntheticClassOrObjectDescriptor) companionObjectDescriptor);
         }
```

New code:
```
        // Generate synthetic nested classes
        Collection<DeclarationDescriptor> classifiers = descriptor
                .getUnsubstitutedMemberScope()
                .getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.Companion.getALL_NAME_FILTER());
        for (DeclarationDescriptor memberDescriptor : classifiers) {
            if (memberDescriptor instanceof SyntheticClassOrObjectDescriptor) {
                genSyntheticClassOrObject((SyntheticClassOrObjectDescriptor) memberDescriptor);
            }
        }
```

Change-Id: Icb51ee6e56b9928108cc121c78fa50c6354a4b31
2018-04-25 20:18:08 +03:00
Sergey Igushkin 1596d7b636 Stop removing JavaCompile tasks from project.tasks in common modules
When the JavaCompile tasks were removed from a common project, some of
the dependencies on them remained. This could lead to an error during
dependencies resolution, such as the one in KT-23092. To an even greater
confusion, the remaining dependencies anyway led to the task being
added to the task graph.

Issue #KT-23092 Fixed
2018-04-25 19:49:19 +03:00
Sergey Igushkin 2b41a0d30e Use archivesBaseName for module names in MPP common modules as well.
Issue #KT-23574 Fixed
2018-04-25 19:43:58 +03:00
Ilmir Usmanov 4396b4259e Minor: Fix compilation of android tests 2018-04-25 19:15:16 +03:00
Alexey Tsvetkov 1778cc6a39 Fix incremental compilation with Java 9+
#KT-23901 fixed
2018-04-25 16:05:48 +03:00
Ilmir Usmanov 31a8f1ce9d Minor: Add missing method in 172 patchset 2018-04-24 21:48:57 +03:00
Nikolay Krasko ac97075020 Check only one class in JS decompiler tests to reuse test data
JVM tests check only single class result, in order to reuse test data
JS tests should do the same. CHECK_PACKAGE is introduced to override
this behaviour explicitly.
2018-04-24 18:51:27 +03:00
Ilmir Usmanov ce40c3fb21 Take coroutinesPackage into account in bunch files
#KT-23362
2018-04-24 18:14:04 +03:00
Raluca Sauciuc 258cba2cf8 More fixes for Android Studio 3.2 compatibility 2018-04-24 16:46:33 +03:00
Mikaël Peltier 76cd20c574 KT-23721 Emit an error when 'tools.jar' is not into plugin classpath
- Since warnings are discarded when there are others errors, replace the
current warning by an error to always display the message and inform the
user that its annotation processor is badly configured.

Fix of https://youtrack.jetbrains.com/issue/KT-23721
2018-04-24 16:10:03 +03:00
Mikhail Zarechenskiy d2d92a2153 [NI] Fix exception, don't try to get parent on root fqName
#EA-119579 Fixed
2018-04-24 15:22:29 +03:00
Roman Artemev 61e051cafa Update test data 2018-04-24 14:04:16 +03:00
Roman Artemev ec57a335f7 Temporally hacked js assert to make depending tests work 2018-04-24 13:52:16 +03:00
Nicolay Mitropolsky efdc5701d9 Uast: removing SimpleKotlinRenderLogTest.kt.181 2018-04-24 12:35:26 +03:00
Toshiaki Kameyama e58d9c5507 Add intention for converting to block comment and vise versa
So #KT-23137 Fixed
2018-04-24 11:57:56 +03:00
Mikhail Glukhikh 3351b00870 SimpleKotlinRenderLogTest: delete identical branch file (AS32) 2018-04-24 10:31:59 +03:00
Mikhail Glukhikh f9858bf597 SimpleKotlinRenderLogTest: add (forgotten) changes into branches 2018-04-24 10:30:10 +03:00
Ilmir Usmanov 39f4a449ad Remove JvmVersion from kotlin-stdlib-coroutines 2018-04-23 22:20:41 +03:00
Ilmir Usmanov 9cad474f5a Update bootstrap compiler to latest green 2018-04-23 21:52:01 +03:00
Ilmir Usmanov 3cceb13d04 Update inliner test after changing bootstrap compiler 2018-04-23 21:52:00 +03:00
Ilmir Usmanov f60787d57c Move coroutines to kotlin.coroutines package: tests
Introduce COMMON_COROUTINES_TEST directive.
Every test with this directive is run twice: one time with
language version 1.2 and kotlin.coroutines.experimental package
and the other time with language version 1.3 and kotlin.coroutines
package. Each run is a separate method: with suffixes _1_2 and _1_3
respectively.
However, since codegen of release coroutines is not supported in JS
backend, we generate only one method: with suffix _1_2.
 #KT-23362
2018-04-23 21:51:59 +03:00
Ilmir Usmanov 30ab1e2b35 Move coroutines to kotlin.coroutines package: stdlib
Copy everything from kotlin.coroutines.experimental to
kotlin.coroutines. The latter is separate source set to be packed into
separate kotlin-stdlib-coroutines.jar
 #KT-23362
2018-04-23 21:51:58 +03:00
Nicolay Mitropolsky ebdee1f24c 182: JvmDeclarationSearcher-implementation for Kotlin based on light-classes
#KT-23764
2018-04-23 21:37:58 +03:00
Mikaël Peltier b1ef670818 KT-23931 Avoid infinite loop into RedundantGotoMethodTransformer
- Follow-up of 9fb0f59813 to avoid
infinite loop during redundant goto otpimization.

Fix of https://youtrack.jetbrains.com/issue/KT-23931
2018-04-23 20:25:43 +03:00
Pavel V. Talanov 7daf44a806 Fix bunch files after mpp changes 2018-04-23 18:56:36 +02:00
Alexander Udalov 3ce9c03249 Minor, ignore build directories when checking copyrights 2018-04-23 18:42:33 +02:00
Alexander Udalov dfd76502ab Minor, move serializeToByteArray to module 'metadata.jvm' 2018-04-23 18:42:33 +02:00
Alexander Udalov 52a9cc06e0 Remove StringTable.serializeTo, add JvmProtoBufUtil.writeData
StringTable.serializeTo was effectively only used for JvmStringTable,
but was declared in StringTable because of the usage in
DescriptorSerializer.serialize (which, in turn, was only used from JVM
codegen)
2018-04-23 18:42:33 +02:00
Alexander Udalov 58b7643065 Render .kjsm files in incremental tests
Otherwise they, being binary files, are displayed as text, which is
unreadable
2018-04-23 18:42:33 +02:00
Alexander Udalov 965e3ebab2 Do not serialize SOURCE-retained annotations
Also, fix the value of "hasAnnotations" flag to reflect if there are any
_non-source_ annotations on a declaration.

Unfortunately, after this change
IncrementalJsCompilerRunnerTestGenerated$PureKotlin.testAnnotations
starts to fail because of the following problem. The problem is that
annotations on property accessors are not serialized yet on JS (see
KT-14529), yet property proto message has setterFlags field which has
the hasAnnotations flag. Upon the full rebuild of the code in that test,
we correctly write hasAnnotations = true, but annotations themselves are
not serialized. After an incremental build, we deserialize property
setter descriptor, observe its Annotations object which happens to be an
instance of NonEmptyDeserializedAnnotationsWithPossibleTargets. Now,
because annotations itself are not serialized, that Annotations object
has no annotations, yet its isEmpty always returns false (see the code).
Everything worked correctly before the change because in
DescriptorSerializer.hasAnnotations, we used Annotations.isEmpty and the
result was the same in the full rebuild and in the incremental scenario.
But now we're actually loading annotations, to determine their
retention, and that's why the setterFlags are becoming different here
and the test fails

 #KT-23360 Fixed
2018-04-23 18:42:33 +02:00
Alexander Udalov 7bac9b62c7 Reformat VersionRequirement and move to 'metadata' 2018-04-23 18:42:33 +02:00
Alexander Udalov 361f686124 Move ModuleMapping and BinaryModuleData to metadata.jvm 2018-04-23 18:42:32 +02:00
Alexander Udalov d0544a148a Minimize dependencies of ModuleMapping
Prepare it to be moved to metadata.jvm
2018-04-23 18:42:32 +02:00