Commit Graph

42768 Commits

Author SHA1 Message Date
Mikhail Glukhikh 07ec4ecd7f Add tests for KT-19511 and KT-21192 (with void -> boolean) 2017-11-30 16:43:53 +03:00
Sergey Igushkin bf2e3decaa Add :kotlin-annotation-processing-gradle:install dependency to Gradle IT 2017-11-30 15:42:42 +03:00
Sergey Igushkin 98e8e73810 Fix kotlin-reflect dependency IDE import after API separation.
(cherry picked from commit 19967a2)
2017-11-30 15:42:42 +03:00
Alexey Andreev af6adc61ae Update bootstrap to 1.2.20-dev-524 2017-11-30 15:27:41 +03:00
Alexey Andreev acb058f328 JS: fix bootstrap build error related to updates in source maps 2017-11-30 14:26:05 +03:00
Nikolay Krasko f46a8e0b16 Restore iml files for jps tests 2017-11-30 13:24:08 +03:00
Nikolay Krasko cfa70dbe26 Don't ignore iml files in testData 2017-11-30 13:24:07 +03:00
Nikolay Krasko 170b352185 Deprecate 'configureAs' method and stop using it in js decompiled tests
This commit fixes tests in 173 branch, avoid exception:

com.intellij.openapi.util.TraceableDisposable$DisposalException:
Virtual pointer 'jar:///mnt/agent/work/bd0f559856a14a82/dist/kotlinc/lib/kotlin-stdlib-js.jar!/'
hasn't been disposed: --------------Creation trace:
java.lang.Throwable
    at com.intellij.openapi.util.TraceableDisposable.<init>(TraceableDisposable.java:45)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerImpl.<init>(VirtualFilePointerImpl.java:41)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl.getOrCreate(VirtualFilePointerManagerImpl.java:266)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl.create(VirtualFilePointerManagerImpl.java:205)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl.create(VirtualFilePointerManagerImpl.java:136)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerContainerImpl.create(VirtualFilePointerContainerImpl.java:359)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerContainerImpl.add(VirtualFilePointerContainerImpl.java:169)
    at com.intellij.openapi.roots.impl.libraries.LibraryImpl.addRoot(LibraryImpl.java:505)
    at com.intellij.openapi.roots.ui.configuration.libraryEditor.NewLibraryEditor.exportRoots(NewLibraryEditor.java:247)
    at com.intellij.openapi.roots.ui.configuration.libraryEditor.NewLibraryEditor.applyTo(NewLibraryEditor.java:218)
    at org.jetbrains.kotlin.idea.test.ConfigLibraryUtil.addLibrary(ConfigLibraryUtil.kt:113)
    at org.jetbrains.kotlin.idea.test.KotlinStdJSProjectDescriptor.configureModule(KotlinStdJSProjectDescriptor.kt:38)
    at org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor.configureModule(KotlinLightProjectDescriptor.java:46)
    at org.jetbrains.kotlin.idea.test.TestUtilsKt$configureAs$1.consume(testUtils.kt:59)
    at org.jetbrains.kotlin.idea.test.TestUtilsKt$configureAs$1.consume(testUtils.kt)
    at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:143)
    at org.jetbrains.kotlin.idea.test.TestUtilsKt.configureAs(testUtils.kt:50)
    at org.jetbrains.kotlin.idea.test.TestUtilsKt.configureAs(testUtils.kt:69)
    at org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractDecompiledTextFromJsMetadataTest.setUp(AbstractDecompiledTextFromJsMetadataTest.kt:38)
    ...
2017-11-30 13:24:07 +03:00
Nikolay Krasko a45fa9a33f Configure JdkAndMockLibrary with JS stdlib if jsLib flag is set 2017-11-30 13:24:06 +03:00
Nikolay Krasko 1bc8ad7852 Don't mess up with configuring project descriptors in PullPush tests
This commit fixes tests in 173 branch.
2017-11-30 13:24:05 +03:00
Alexey Sedunov 6a9317fc57 Misc: Drop utilities for checking nullability/mutability annotations
Types annotated by them are already loaded as inflexible
2017-11-30 12:49:25 +03:00
Alexey Sedunov 84c6f9bf45 Create from Usage: Fix choosing superclass for abstract member
This applies to cases when non-existing member is called without
explicit receiver

 #KT-21332 Fixed
2017-11-30 12:49:25 +03:00
Alexey Sedunov 7e3ca4734d Create from Usage: Add val to data class parameter
Also place new parameters on the new line if previous ones have line breaks

 #KT-21162 Fixed
2017-11-30 12:49:25 +03:00
Alexey Sedunov c54b934383 Configuration: Fix deserialization of immutable freeArgs collection
#KT-21363 Fixed
2017-11-30 12:49:24 +03:00
Alexey Sedunov 998c312ad2 Unifier: Fix matching of callable references with expression receivers
#KT-21334 Fixed
2017-11-30 12:49:24 +03:00
Alexey Sedunov 354a6cbfd9 Change Signature: Keep parameter 'val'/'var' when invoked from Java
#KT-20901 Fixed
 #KT-21159 Fixed
2017-11-30 12:49:24 +03:00
Alexey Sedunov 820ade41ed Create from Usage: Do not add bodies to expect class members
#KT-21122 Fixed
2017-11-30 12:49:24 +03:00
Alexey Andreev 063b4b6c18 Remove unused 'json-org' dependency (fix build) 2017-11-30 11:43:44 +03:00
Alexey Andreev 1d48442a5d Change default output dir in JS DCE Gradle plugin
See KT-21328

Compiler removes all files from its output directory.
Due to this reason (and some other reasons) it't not a good idea
to put DCE output to `classes` dir.
Therefore we changed output dir to `$buildDir/kotlin-js-min`.
Additionally, we now allow to customize output dir.
In particular, this fixes issues with webpack in multi-project build +
continuous Gradle build.
2017-11-29 20:08:30 +03:00
Alexey Andreev 5672e1f56e JS: add DCE devmode. Fix mapping paths in source maps
See KT-20210, KT-21307
2017-11-29 20:08:30 +03:00
Alexey Andreev ffdebfab45 JS: change the way how DCE resolves input paths 2017-11-29 20:08:29 +03:00
Alexey Andreev 8514a7706f Remove json.org library, use own JSON parser to parse source maps 2017-11-29 20:08:29 +03:00
Alexey Andreev 729715ec62 Add simple JSON parser 2017-11-29 19:43:28 +03:00
Ilya Gorbunov c6b957f457 Force LF line delimiters for bash scripts and CRLF for .bat scripts in compiler/cli 2017-11-29 19:03:28 +03:00
Alexander Udalov 4f70983735 Update Proguard to 5.3.3 2017-11-29 11:58:38 +01:00
Alexander Udalov d4b5032810 Add JDK roots to the beginning of the roots list
This behavior was used until 6a1b6d10d8, where the JDK has
unintentionally started to be added to the end of the list, breaking
code which depended on libraries which bundle something from the JDK

 #KT-21299 Fixed
2017-11-29 11:49:48 +01:00
Dmitry Petrov d976eeabf7 Refactor GenerationState creation 2017-11-29 12:17:06 +03:00
Alexey Sedunov d6d6cef10d Gradle: Use copyable user data to retain intermediate model
#KT-21418 Fixed
2017-11-29 12:00:25 +03:00
Alexey Sedunov c8d9f9ac50 Refactoring: Rename copyable property delegates for PsiElement 2017-11-29 12:00:25 +03:00
Alexey Sedunov b956363d6f Minor: Drop unused class 2017-11-29 12:00:25 +03:00
Alexey Andreev 19438a3a07 JS: fix losing lambda in inline function after incremental compilation
See KT-21493

It's hard to maintain staticRef in cached AST. In fact, we don't need
it in this optimization. We'll get excessive names in used set,
which is ok: non-function names don't matter, they'll be simply ignored.
One possible concern: there's more chance to get name same to
some function's name and it won't be removed. First, it's not fatal,
it won't break the code (but put some excessive code that will likely
be removed by DCE). Second, there's same chance of two functions
having same names, and we manage to avoid this (otherwise we'll get
many problems).
2017-11-29 11:53:35 +03:00
Alexey Andreev 29b494cdac JS: don't optimize when over external enum
See KT-21468
2017-11-29 11:52:36 +03:00
Dmitry Petrov 5b8c0d4c3e Optimize for-in-string loops
For-in-string loop can be generated using specialized 'length' and
'charAt' method calls, and with cached string length.
Note that update of the string variable in loop body doesn't affect
loop execution semantics.

 #KT-21322 Fixed Target versions 1.2.20
2017-11-29 10:15:38 +03:00
Dmitry Petrov e2fa613b70 Cache array length in for-in-array loop if possible
If the range expression is not a local variable (which can be updated in
the loop body affecting loop behavior, see KT-21354), we can cache the
array length, thus turning a for-in-array loop into a simple optimizable
counter loop.

 #KT-21321 In Progress
2017-11-29 10:15:32 +03:00
Mikhail Zarechenskiy 328c67b9e8 Add separate diagnostic renderer results for tests with NI 2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Mikhail Zarechenskiy 81b3fefa58 Improve test framework for diagnostic tests with NI
Mark with `NI;` or `OI;` only diagnostics that are specific for concrete inference
2017-11-29 02:49:31 +03:00
Ilya Gorbunov bd4d847943 Fix unresolved references in the api docs
These were mostly incorrect parameter names and external api links.
2017-11-28 18:41:17 +03:00
Ilya Gorbunov 3f26fd3f7f Provide summary for kotlin.math package 2017-11-28 18:41:15 +03:00
Ilya Gorbunov 5e85f71e48 Improve cover documentation page of kotlin.test library 2017-11-28 18:41:12 +03:00
Ilya Gorbunov cf076f3d25 Unify docs wording of 'trim*' functions 2017-11-28 17:59:05 +03:00
Ilya Gorbunov 4f76cdfc34 Use new annotations in mutability tests instead of old ones 2017-11-28 17:45:10 +03:00
Ilya Gorbunov 9995a31c46 Add ReadOnly and Mutable into kotlin.annotations.jvm
Originally provided in org.jetbrains.annotations package as a part of stdlib.
2017-11-28 17:45:10 +03:00
Alexander Udalov f80c9a4692 Drop TypeMappingConfiguration.innerClassNameFactory, use default implementation
After 57d209f599, non-default behavior is no longer used.

 #KT-21453 Fixed
2017-11-28 14:15:03 +01:00
Alexander Udalov 79e399942d Use "sourcesJar" task builder for kotlin-reflect sources 2017-11-28 12:46:10 +01:00
Alexander Udalov 9f3577dc70 Minor, use firstFromJavaHomeThatExists for JDK for Proguard
Similarly to "proguard" task in prepare/compiler/build.gradle.kts
2017-11-28 12:45:57 +01:00
Alexander Udalov 3d3ece72d2 Do not add task dependency from "sourcesJar" on "classes"
There doesn't seem to be any problem with collecting sources of the
project separately from compiling the project
2017-11-28 12:45:56 +01:00
Alexander Udalov 200c62b574 Use JvmPackageTable from bootstrap compiler in KotlinModuleShadowTransformer
Instead of generating another copy of it into buildSrc. Also move
KotlinModuleShadowTransformer to kotlin-reflect's build script, to its
only usage
2017-11-28 12:45:56 +01:00
Alexander Udalov a1f895bb1f Rewrite kotlin-reflect build script from Groovy to Kotlin 2017-11-28 12:45:53 +01:00