Compare commits

...

6566 Commits

Author SHA1 Message Date
Alexander Podkhalyuzin
f5d8479635 Kotlin SDK auto-creation is disabled now #KT-23059 Fixed 2018-02-28 12:25:43 +03:00
Alexey Sedunov
2619dc5e0d Minor: Fix NPE
#KT-22724 Fixed

(cherry picked from commit 1bc6f5c)
2018-02-26 12:14:00 +03:00
Ilya Gorbunov
97848dd194 Update paths of the moved sources for building the documentation 2018-02-26 11:25:58 +03:00
Stanislav Erokhin
814858a2b7 Move runtime.jvm sources to stdlib/jvm/runtime
Update path in kotlin-runtime
Update path in kotlin-mock-runtime-for-tests
2018-02-26 11:25:57 +03:00
Simon Ogorodnik
8acc3c0b97 Propose convert to string template as inspection more frequent 2018-02-22 20:06:20 +03:00
Zalim Bashorov
0a829be3db Add missed references to license/README.md 2018-02-22 20:06:19 +03:00
Denis Zharkov
5a0d10464a Convert SwitchCodegen to Kotlin, prettify and optimize codegen 2018-02-22 11:47:41 +03:00
Mikhail Glukhikh
559e0848d8 Downgrade LoopToCallChainInspection to INFORMATION level
(cherry picked from commit fda4072)
2018-02-21 14:30:24 +03:00
Dmitry Jemerov
44d21c0db5 Fix ISE in KotlinPairMatcher.getCodeConstructStart()
(cherry picked from commit 9e30ede)
2018-02-21 10:59:38 +01:00
Yan Zhulanow
e50c18bbd6 Evaluator: Send class bytecode array in loop with a limited chunk size (#KT-22967)
JDI in Android has a limited byte buffer size (8192), and we must not exceed it.
2018-02-20 23:17:18 +03:00
Yan Zhulanow
8719796d97 Use thread-safe WeakHashMap implementation in annotation-based IDE plugins (#KT-22514) 2018-02-20 23:17:17 +03:00
Nicolay Mitropolsky
d2ff212b43 LightAnnotations: wrapping all PsiLiterals (not only Strings)
(cherry picked from commit bc543b4)
2018-02-20 18:02:59 +03:00
Denis Zharkov
fbaf90bc60 Add @SinceKotlin("1.2") to kotlin.suspend 2018-02-20 12:00:32 +03:00
Dmitry Petrov
88f8102bed Turn off intrinsics for 'withIndex' in 1.2.3x 2018-02-20 08:49:52 +03:00
Ilya Chernikov
c7533b91f9 Add missing reflect dependency to the gradle plugin
fixes #KT-22895
2018-02-19 17:19:16 +01:00
Denis Zharkov
f4c2f5d164 Prohibit labeled returns inside kotlin.suspend argument lambdas
Probably, it would be more correct to skip such lambdas when resolving
the returns' references, but it'd be more complicated and still useless
since non-local returns are impossible in such lambdas
(relevant parameter is noinline)

 #KT-22900 Fixed
2018-02-19 17:31:38 +03:00
Mikhail Zarechenskiy
fb940cec71 Improve message for exception about absence of common supertype
Relates to #KT-16253
2018-02-19 17:18:23 +03:00
Mikhael Bogdanov
25a136aeb2 Revert "Don't generate hash in sam wrapper class name"
This reverts commit 08f7829
2018-02-19 14:13:24 +01:00
Nikolay Krasko
9a00dc3355 Expression can be parenthesized on replace with if (KT-22874, EA-91186)
#KT-22874 Fixed
2018-02-19 13:00:33 +03:00
Nikolay Krasko
fbc01468dc Fix class cast exception in KotlinFunctionParameterInfoHandler (EA-91186) 2018-02-19 13:00:22 +03:00
Nikolay Krasko
fc43cb4767 Disable outdate runtime check for developers builds
We can't update them properly anyway.
2018-02-19 13:00:12 +03:00
Nikolay Krasko
7ffb405968 Fix isModified check in Kotlin compiler tab (KT-22851)
outputPostfix and outputPrefix is saved with nullize in apply, but
modification check was without it.

 #KT-22851 Fixed
2018-02-19 13:00:01 +03:00
Denis Zharkov
cd95e7ae16 Fix CCE caused by KotlinPackageSourcesMemberNamesIndex
FileContentImpl::getPsiFile is not-nullable and at the same time
it contains an explicit case of its fileType to LanguageFileType
that leads to the following exception in case when kt-file is marked as plain text:

java.lang.ClassCastException: com.intellij.openapi.file.exclude.EnforcedPlainTextFileTypeFactory$1 cannot be cast to com.intellij.openapi.fileTypes.LanguageFileType
	at com.intellij.util.indexing.FileContentImpl.createFileFromText(FileContentImpl.java:135)
	at com.intellij.util.indexing.FileContentImpl.getPsiFile(FileContentImpl.java:104)

 #EA-114338 Fixed
2018-02-19 10:32:25 +03:00
Ilya Gorbunov
cb0d27ca0d kotlin-test-testng: change actual package name for test annotation typealiases
to avoid potential split package situation

(cherry picked from commit 8c8caa4)
2018-02-14 23:52:32 +03:00
Alexey Tsvetkov
f75a5ff905 Avoid removing target/classes dir during IC in Maven
#KT-21581 fixed
2018-02-14 18:17:19 +03:00
Dmitry Savvinov
fee60f4f40 Update changelog for 1.2.30 2018-02-14 13:10:03 +03:00
Vyacheslav Karpukhin
64c1e9d345 Do not use hardcoded plugin ID for update checks
When Kotlin plugin is bundled into another plugin, there won't be a plugin with ID org.jetbrains.kotlin registered in PluginManager, which leads to runtime exceptions. To fix that let's determine the plugin ID dynamically instead.
2018-02-12 17:53:23 +03:00
Nikolay Krasko
3c61760a70 Collect statistics of used defaults set in formatting (KT-22252)
^KT-22252 In Progress
2018-02-12 17:53:22 +03:00
Anton Bannykh
9a8f283d6b JS: fix corner case in when translation (fix crash in KT-22544)
(cherry picked from commit cd3a797f2a)
2018-02-12 17:18:53 +03:00
Ilya Gorbunov
e089919ab8 Remove configureDist call not yet available in this branch 2018-02-12 15:36:55 +03:00
Alexey Sedunov
73eb07b6c4 Gradle: Fix dependency import when "module per sourceset" is disabled
#KT-22360 Fixed

(cherry picked from commit b315e0c)
2018-02-12 15:22:56 +03:00
Alexey Sedunov
8abc113f14 Configuration: Set up Kotlin SDK (if necessary) on plugin startup
#KT-22590 Fixed

(cherry picked from commit e1aec46)
2018-02-12 15:22:19 +03:00
Ilya Gorbunov
66177fb184 Add documentation for kotlin-test-testng artifact
(cherry picked from commit 0f130a0)
2018-02-12 08:27:32 +03:00
Ilya Gorbunov
6875bb4628 Select the asserter based on test framework presence in classpath
Simplify asserter lookup: enumerate all AsserterContributors when
the file class with lookupAsserter function is initialized.

It's assumed that AsserterContributor initialization should be fast.

#KT-21154 Fixed

(cherry picked from commit 5e3edf4)
2018-02-12 08:27:32 +03:00
Ilya Gorbunov
30945b8081 Include kotlin-test-testng into dist, setup JDK 7 required to run tests
(cherry picked from commit 9dfa54e)
2018-02-12 08:27:32 +03:00
Ilya Gorbunov
5a0dced10f Minor: kotlin-test reformat sources, fix test package names
(cherry picked from commit d1f00a9)
2018-02-12 08:27:32 +03:00
Valeriy Zhirnov
a2a340dd74 TestNG support in kotlin.test #KT-22620
(cherry picked from commit ad77019)
2018-02-12 08:27:32 +03:00
Nikolay Krasko
b42592c947 Store selected set of defaults in code style settings (KT-22252)
#KT-22252 In Progress

(cherry picked from commit 1e56743)
2018-02-11 22:18:53 +03:00
Nikolay Krasko
c903ce5d00 Control serialize/deserialize of CommonCodeStyleSettings
(cherry picked from commit 5d25b8b)
2018-02-11 22:17:35 +03:00
Nikolay Krasko
ce09e4cbbb Collect statistics about used Kotlin formatter
(cherry picked from commit 5a9ea89)
2018-02-11 22:16:54 +03:00
Nikolay Krasko
682c8723a6 Fix testInGlobalPropertyWithGetter test in 173 branch
Workaround for IDEA-185462. It was introduced in 173 idea and
fixed in 181.

(cherry picked from commit d1e6a61)
2018-02-11 22:13:42 +03:00
Mikhail Zarechenskiy
18bdede561 Fix type parameters indexes of MockClassDescriptor
Exception was thrown during mapping of arguments to parameters in `computeSupertypeProjections`

 #KT-18522 Fixed
2018-02-11 16:31:29 +03:00
Yan Zhulanow
d8b400a725 REPL, minor: Ignore empty lines (#KT-21611)
(cherry picked from commit 310ee67c35)
2018-02-09 19:26:41 +03:00
Yan Zhulanow
7c6641ae8c Kapt: Allow Kotlin @Repeatable annotations (KT-22451)
We don't generate a wrapper for repeatable annotations, and Javac complains to it.

(cherry picked from commit edcf0aef53)
2018-02-09 19:11:49 +03:00
Alexey Sedunov
233b0627c5 Configuration: Show Koltin plugin path as "home path" of Kotlin SDK
#KT-22640 Fixed

(cherry picked from commit e5e583e)
2018-02-09 15:07:30 +03:00
Alexey Sedunov
b5fc34be29 Create from Usage: Support target directory selection for "Create class"
#KT-22152 Fixed

(cherry picked from commit 84fed80)
2018-02-09 15:07:30 +03:00
Alexey Sedunov
592dc00fb4 Rename: Support retargeting/shadowing conflict checking for functions
#KT-22564 Fixed

(cherry picked from commit 695a2a4)
2018-02-09 15:07:29 +03:00
Alexey Sedunov
71bb9326b6 Rename: Fix qualified expression replacement for the case 'invoke' <-> 'get'
#KT-22705 Fixed

(cherry picked from commit 5c6bba9)
2018-02-09 15:07:29 +03:00
Alexey Sedunov
68fac8bc2d Refactor: Move canMoveLambdaOutsideParentheses() function to idea-core module
(cherry picked from commit fffd74f)
2018-02-09 15:07:29 +03:00
Alexey Sedunov
594fa29d0f J2K: KtArrayAccessReference
(cherry picked from commit 4870586)
2018-02-09 15:07:29 +03:00
Alexey Sedunov
556dcc53b6 J2K: KtArrayAccessReference (rename to .kt)
(cherry picked from commit 9150322)
2018-02-09 15:07:28 +03:00
Alexey Sedunov
e4eabfa961 Rename: Add quotes to declaration name if necessary
#KT-22708 Fixed

(cherry picked from commit e88f146)
2018-02-09 15:07:28 +03:00
Alexey Sedunov
d16ad96a41 Refactor: Move 'isIdentifier' and 'quoteIfNeeded' functions to frontend
(cherry picked from commit 428b086)
2018-02-09 15:07:28 +03:00
kenji tomita
62dc54b449 Inspection to get rid of unnecessary ticks in references #KT-18124 Fixed
(cherry picked from commit 1875d12)
2018-02-09 15:07:27 +03:00
Alexey Sedunov
6465536491 Change Signature: Support implicit calls of 'invoke' and 'get'
Also drop 'operator' keyword when necessary

 #KT-22718 Fixed

(cherry picked from commit fddfbf2)
2018-02-09 15:07:27 +03:00
Alexey Sedunov
e37f801aeb Slicer: Sort tree nodes to produce stable test data
(cherry picked from commit c602c51)
2018-02-09 15:07:27 +03:00
Alexey Sedunov
5bb938331b Rename: Substitute synthetic expression parent before analysis
This fixes rename conflicts test

(cherry picked from commit adca8eb)
2018-02-09 15:07:26 +03:00
Alexey Sedunov
4221ca0f8a Rename: Update test data (follow-up for unnecessary reformatting fix)
(cherry picked from commit 049439c)
2018-02-09 15:07:26 +03:00
Alexey Sedunov
e4cabda82d Rename: Make improvements for "by-convention" calls
- Convert between conventions call for 'get' and 'invoke'
- Drop 'operator' when converting 'get'/'invoke' to something other than
  'invoke'/'get' respectively

 #KT-12365 Fixed

(cherry picked from commit f35af11)
2018-02-09 15:07:25 +03:00
Alexey Sedunov
f3d9c09340 Rename: Replace name identifiers via AST to prevent unwanted reformatting
#KT-8563 Fixed

(cherry picked from commit caeb594)
2018-02-09 15:07:25 +03:00
Alexey Sedunov
4e41040dd7 Rename: Support KtTypeAlias in RenameKotlinClassProcessor
#KT-21719 Fixed

(cherry picked from commit 58bf42c)
2018-02-09 15:07:25 +03:00
Alexey Sedunov
6785341ab1 Loop to Call Chain: Do not generate lambda with double wrapping block
#KT-22476 Fixed

(cherry picked from commit 90392a8)
2018-02-09 15:07:24 +03:00
Alexey Sedunov
17b17ed90e Move Class to Top Leve: Suggest file name based on new class name
#KT-17977 Fixed

(cherry picked from commit 8c9c160)
2018-02-09 15:07:24 +03:00
Alexey Sedunov
73c0ee4035 Kotlin Ultimate: Support NodeJS CLI run configuration
#KT-16710 Fixed

(cherry picked from commit 4d52bf0)
2018-02-09 15:07:24 +03:00
Alexey Sedunov
4da7a0b3b1 Gradle: Import production output path for JavaScript modules
(cherry picked from commit 1f7fab8)
2018-02-09 15:07:24 +03:00
Alexey Sedunov
b09803c65e Kotlin Ultimate: Add "Build" action to JS run configurations
#KT-20522 Fixed

(cherry picked from commit 80887a8)
2018-02-09 15:07:23 +03:00
Alexey Sedunov
1d36a4601a Kotlin Ultimate: Support Jest run configurations for Kotlin sources
#KT-21531 Fixed

(cherry picked from commit 82a997e)
2018-02-09 15:07:23 +03:00
Alexey Sedunov
e6126e399e JS: Drop obsolete "Kotlin (JavaScript)" run configuration
#KT-21312 Fixed

(cherry picked from commit 2c0af79)
2018-02-09 15:07:23 +03:00
Sergey Igushkin
e04c32ca4d Delay kapt dependencies resolution from configuration phase
Store kapt configurations instead of classpath files in the tasks
Delay wrapping kapt subplugin options to task execution (when the
classpath can be safely resovled)

Issue #KT-18821 Fixed

(cherry picked from commit e8cd8b5)
2018-02-09 14:56:34 +03:00
Ilya Chernikov
5b4844b11e Pass previous dependencies to the legacy script dependency resolvers
fixes #KT-22753

(cherry picked from commit e38d539)
2018-02-09 11:06:45 +01:00
Rodrigo B. de Oliveira
e12052d6eb Make Kotlin Idea plugin aware of the Gradle initscript template
See gradle/kotlin-dsl#662

(cherry picked from commit de57951)
2018-02-09 11:06:24 +01:00
Dmitry Jemerov
df53bee809 Indent default parameter values
#KT-22508 Fixed

(cherry picked from commit 3aaad0c)
2018-02-09 10:51:15 +01:00
Dmitry Jemerov
8923464bb6 No space between label and lambda in labeled expressions
#KT-22301 Fixed

(cherry picked from commit 5bb195d)
2018-02-09 10:51:04 +01:00
Dmitry Jemerov
a9124635aa Do not indent closing bracket of array access expression
#KT-22641 Fixed

(cherry picked from commit 8f9b818)
2018-02-09 10:50:53 +01:00
Dmitry Jemerov
55f35404e1 Call chain indentation logic that actually makes sense
#KT-22346 Fixed

(cherry picked from commit 36f5525)
2018-02-09 10:50:43 +01:00
Dmitry Jemerov
15129e6e0b Group all call chain-related tests in a single directory
(cherry picked from commit 2c88b26)
2018-02-09 10:50:26 +01:00
Mikhail Glukhikh
e7eec55da0 Redundant object type check: fix problem highlighting #KT-22484 Fixed
(cherry picked from commit d554a42)
2018-02-09 11:08:29 +03:00
Mikhail Glukhikh
65f5c6d8ef Redundant object type check: use referential equality, forbid for when
So #KT-22538 Fixed

(cherry picked from commit 901ae08)
2018-02-09 11:08:11 +03:00
Mikhail Glukhikh
3874facce0 Reformat: RedundantObjectTypeCheckInspection
(cherry picked from commit fbe6929)
2018-02-09 11:07:55 +03:00
Mikhail Glukhikh
5f4943fd6b Detect library kind in Gradle if name looks like non-JVM
Related to KT-20971

(cherry picked from commit 198b054)
2018-02-09 11:07:40 +03:00
Mikhail Glukhikh
c690b8d9db Search for source of platform binary also in common sources
So #KT-20971 Fixed

(cherry picked from commit dcbb29e)
2018-02-09 11:07:23 +03:00
Mikhail Glukhikh
b7f87cf76e SourceNavigationHelper: reformat + style fix
(cherry picked from commit 76976f7)
2018-02-09 11:07:07 +03:00
Denis Zharkov
35c1d06dbc Minor. Remove irrelevant JAVAC_EXPECTED_FILE directive in tests
This change fixes these tests
2018-02-09 10:55:52 +03:00
Yan Zhulanow
620fdf3881 REPL: Fix crash on trying to :load with incorrect filename (KT-12037)
(cherry picked from commit 0238575a36)
2018-02-08 20:46:10 +03:00
Yan Zhulanow
e39e8632ac Debugger: (EA-112731) Do not crash miserably if we don't know the anonymous class name
Continue to log the exception, avoid breaking UX

(cherry picked from commit a25e93d82a)
2018-02-08 19:39:04 +03:00
Yan Zhulanow
2c3a3bd5c4 Kapt: Register additional source directories without modifying the raw Gradle model
Unfortunately, this works only for the newer Android Studio versions, so we need to keep the old code until IDEA will migrate at least to AS 3.1.

(cherry picked from commit 2a3bab0a0f)
2018-02-08 19:39:04 +03:00
Yan Zhulanow
5e65b6eca1 Kapt: Enums inside enum values should be forbidden (KT-22582)
(cherry picked from commit 6c4a2db34b)
2018-02-08 19:39:03 +03:00
Yan Zhulanow
447f796066 Android Extensions: Support '.', '-' and ':' in View identifiers (KT-22700)
(cherry picked from commit 510d5ece0f)
2018-02-08 19:39:03 +03:00
Yan Zhulanow
82ba00112b Kapt: Forbid using the deprecated (original) kapt
(cherry picked from commit ba61a93dc7)
2018-02-08 19:39:03 +03:00
Yan Zhulanow
6542559311 Kapt: Mute Java 9 tests temporarily on Windows
(cherry picked from commit bdd7ab3a09)
2018-02-08 19:39:03 +03:00
Yan Zhulanow
1e0589299a Uast: Fix an exception while converting type alias KotlinType to PsiType (KT-21874)
(cherry picked from commit 03a20384ef)
2018-02-08 19:39:03 +03:00
Yan Zhulanow
0493f3c864 Kapt: Map URLs to absolute file paths properly, also add some logging 2018-02-08 19:39:03 +03:00
Alexander Udalov
5cd5b83d05 Add test on experimental const val in annotation argument
This test checks that a usage inside an annotation argument is a
signature usage, which may be too restricting but easier to support at
the moment (and the restriction can be lifted in the future)
2018-02-08 17:38:05 +01:00
Alexander Udalov
978003eadf Always consider container's experimentality in ExperimentalUsageChecker
This results in more diagnostics usually, but allows library authors to
avoid annotating everything in each experimental class with the marker
(only the class needs to be annotated now)

 #KT-22759
2018-02-08 17:38:05 +01:00
Alexander Udalov
100e148db8 Add getExtensionOrNull utility for protobuf messages 2018-02-08 17:38:05 +01:00
Alexander Udalov
8da4550f95 Add test on Experimental in scripts 2018-02-08 17:38:05 +01:00
Alexander Udalov
d5a49d7c7d Load module annotations in IDE
#KT-22759 Fixed
2018-02-08 17:38:05 +01:00
Alexander Udalov
2d589dec43 Load module annotations for JVM and JS modules in compiler
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
be1439f5fe JS: write/read module annotation FQ names to/from metadata
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
3f3c6a9f71 Write/read module annotation FQ names to/from metadata on JVM
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
005669a935 Add packageProto/nameResolver to JvmPackagePartSource
May be useful for loading platform-specific protobuf extensions (such as
package_module_name on JVM) when analyzing deserialized top level
members
2018-02-08 17:38:04 +01:00
Alexander Udalov
0a66b5c4de Check experimental API markers for deprecation
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
af8f232bbf Support -Xexperimental/-Xuse-experimental in ExperimentalUsageChecker
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
e5f2c2580c Support -Xexperimental and -Xuse-experimental, validate their values
#KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
3463d5a0d1 Report diagnostic on overrides of experimental members
Unless they're experimental themselves

 #KT-22759 In Progress
2018-02-08 17:38:04 +01:00
Alexander Udalov
e6bb1610ec Do not require experimental propagation for body usages in same module
Unless it's a usage inside the body of an effectively public inline
function

 #KT-22759 In Progress
2018-02-08 17:38:03 +01:00
Alexander Udalov
1471f08731 Add some validation for Experimental/UseExperimental usages
#KT-22759 In Progress
2018-02-08 17:38:03 +01:00
Alexander Udalov
af7bb3f36b Introduce Experimental and UseExperimental annotations
#KT-22759 In Progress
2018-02-08 17:38:03 +01:00
Alexander Udalov
2dbae78a6c Remove unneeded constructor parameters in CallCheckerContext
(cherry picked from commit 0ad3872d1b)
2018-02-08 17:38:03 +01:00
Ilmir Usmanov
14561feada Take coroutineContext into account in RedundantSuspendModifierInspection
#KT-22651: Fixed
2018-02-08 19:34:55 +03:00
Alexander Podkhalyuzin
12f1f521d0 Ask just extensions, not in some area #KT-21978 Fixed
(cherry picked from commit 09d167e)
2018-02-08 19:15:04 +03:00
Denis Zharkov
8778433836 Add @RequireKotlin(1.2.30) for kotlin.suspend
#KT-22562 Fixed
2018-02-08 17:53:27 +03:00
Alexander Udalov
dada8a4207 Support patch versions in RequireKotlin with kind=COMPILER_VERSION 2018-02-08 17:53:27 +03:00
Denis Zharkov
82ce8649c8 Highlight callees resolved to kotlin.suspend as a keywords
#KT-22562 In Progress
2018-02-08 17:53:27 +03:00
Denis Zharkov
9620eb928f Add call checks related to suspend lambda modifier's introduction
- Prohibit non-modifier-like calls on kotlin.suspend
- Add warning on modifier-like calls to anything but kotlin.suspend

 #KT-22766 In Progress
 #KT-22562 In Progress
2018-02-08 17:49:34 +03:00
Denis Zharkov
2ead25467c Imitate support for suspend modifier on parameterless lambdas
#KT-22766 In Progress
2018-02-08 17:48:47 +03:00
Denis Zharkov
99892f352f Minor. Make function private 2018-02-08 17:48:47 +03:00
Denis Zharkov
fba0ababb4 Minor. Inline parameters 2018-02-08 17:48:47 +03:00
Denis Zharkov
c65e3e33cb Ignore @Nullable annotation for vararg parameter
See the comment in code for clarification

 #KT-19786 Fixed
2018-02-08 13:37:06 +03:00
Denis Zharkov
e2e6b1af85 Minor. Reformat signatureEnhancement.kt 2018-02-08 13:36:55 +03:00
Denis Zharkov
68d8c65242 Use extension registry when unpacking serialized type alias
It's funny here that "extension" here means protobuf extensions
while initial issue is about extension function types

 #Fixed KT-22728
2018-02-08 12:39:54 +03:00
Alexander Udalov
047dc8e8cc Update bootstrap to 1.2.40-dev-165
(cherry picked from commit bb013ec2bf)
2018-02-08 10:19:28 +01:00
Alexander Udalov
852a0a07e0 Rename JvmPackageTable -> JvmModuleProtoBuf, PackageTable -> Module
This protobuf message is going to contain more information about the
module than just the table of package parts

(cherry picked from commit ba5cc65792)
2018-02-08 10:19:27 +01:00
Mikhael Bogdanov
08f78291f3 Don't generate hash in sam wrapper class name
#KT-17091 Fixed

(cherry picked from commit 0954d1a)
2018-02-08 10:14:11 +01:00
Nicolay Mitropolsky
cfbb13f4c2 Uast: KotlinUNestedAnnotation with light annotation (IDEA-185890)
(cherry picked from commit 91a4bbe)
2018-02-07 12:56:35 +03:00
Nicolay Mitropolsky
c107ead158 LightAnnotations: wrapping nested annotations with KtLightAnnotationForSourceEntry
(cherry picked from commit cb05baa)
2018-02-07 12:53:39 +03:00
Nicolay Mitropolsky
0061312f8e Uast: KotlinUNestedAnnotation for processing nested annotations (IDEA-185890)
(cherry picked from commit 48ea52d)
2018-02-07 12:51:02 +03:00
Nicolay Mitropolsky
b5987627c7 Uast: support for Kotlin array literals
(cherry picked from commit 8ac95b5)
2018-02-07 12:48:17 +03:00
Mikhail Glukhikh
4020ee6a85 Fix a pack of broken IDE action tests
Related to KT-20281.
For Java resolve we can use also resolve with 'null' platform,
which is possible situation in tests.

(cherry picked from commit 81122ed)
2018-02-07 10:52:27 +03:00
Mikhail Glukhikh
b37a44ca07 Introduce inspection for redundant not-null extension receiver of inline
Related to KT-22303

(cherry picked from commit 7995ae0)
2018-02-07 10:52:00 +03:00
Yan Zhulanow
5c681d6cb5 Kapt: Fix compilation errors when the referenced class has '$' in the beginning of its name (KT-22493) 2018-02-06 22:25:18 +03:00
Yan Zhulanow
196acfb6fe Kapt: Escape nested comments in doc comments (KT-22469) 2018-02-06 22:25:08 +03:00
Yan Zhulanow
db9bbc8202 Kapt: Remove comments inside enum values (KT-22350) 2018-02-06 22:24:57 +03:00
Yan Zhulanow
5e80e1721b Fix "Illegal Android Identifier" inspection reports non-instrumentation unit tests (KT-22168) 2018-02-06 22:24:48 +03:00
Yan Zhulanow
fcdbe482e2 Kapt: Fix array of anonymous type handling (KT-22468) 2018-02-06 22:24:38 +03:00
Yan Zhulanow
90ce7369e8 Minor: Get rid of duplicating option descriptions in Kapt plugin 2018-02-06 22:24:27 +03:00
Yan Zhulanow
aa8a6b1936 Evaluate: Fix compiling evaluator issues led to improper expression caching
1. Do not save a ClassLoader reference inside the context, as we don't use it anyway after evaluation.
This is to avoid custom ClassLoader nesting.

2. Do not use 'findClass()' as it caches the loaded classes and always returns the first evaluated class if it's in cache.
2018-02-06 22:24:17 +03:00
Yan Zhulanow
4eb6071140 Evaluate: Support dex in newer Android build tools 2018-02-06 22:23:23 +03:00
Yan Zhulanow
eea6fa5f19 Kapt: Disable location mapping by default, allow to enable it manually 2018-02-06 22:23:13 +03:00
Yan Zhulanow
8e1222df83 Kapt: Replace original Javac diagnostic messages with those with Kotlin location mapped
There is no Messages dialog in newer versions of IDEA/Android Studio in which the error messages were mapped before. The new Build window shows only the original locations, so now we need to replace Java file diagnostics with ones mapped to Kotlin source files.

The side effect is that diagnostics on the same locations are automatically merged.
2018-02-06 22:23:02 +03:00
Yan Zhulanow
b36a0e6ea8 Kapt: Move line metadata to .kaptMetadata external files (KT-22386)
Placing location table inside .java file triggers annotation processor to run on each line table modification (even when the stub declarations themselves are the same). So we move it to the separate file.
2018-02-06 22:22:52 +03:00
Yan Zhulanow
3960dacde9 Parcelable: Fix 'Simple' test (new boolean serializer) 2018-02-06 22:22:40 +03:00
Yan Zhulanow
cb6a7b556a Parcelable: Add CREATOR field (and other generated declarations) in light classes (KT-19300, KT-19853) 2018-02-06 22:22:30 +03:00
Ilmir Usmanov
1aa9766ae1 Fix continuaion retrieval on generated coroutineContext intrinsic code
Use fake continuation instead on real one in JVM BE.
Pass continuation parameter to closure generator in JS BE.

 #KT-22577: Fixed
2018-02-06 21:19:10 +03:00
Ilmir Usmanov
7a94dadf17 Reformat coroutineContext related code 2018-02-06 21:19:01 +03:00
Mikhail Glukhikh
304d21be91 Show expect / actual gutter even for incomplete compatibility
So #KT-18445 Fixed
So #KT-21115 Fixed

(cherry picked from commit 3ba6b70)
2018-02-06 10:19:36 +03:00
Mikhail Glukhikh
1ba5a7e733 JVM facade: for Java resolve, always use JvmPlatform resolver
So #KT-20281 Fixed

(cherry picked from commit 19beaf5)
2018-02-06 10:16:38 +03:00
Mikhail Glukhikh
d4e5052bfc Introduce inspection for nullable extension receiver of inline function
So #KT-22303 Fixed

(cherry picked from commit c90056f)
2018-02-06 10:16:17 +03:00
Denis Zharkov
6a43ff2a9d Make precise java classes tracking in Gradle enabled by default
#KT-22192 Fixed
2018-02-05 11:56:37 +03:00
Anton Bannykh
0824ea9ad5 JS: fix callable reference with implicit extension receiver (KT-22638 fixed)
(cherry picked from commit 3ead464671)
2018-02-02 14:39:00 +03:00
Ilmir Usmanov
f42c282f90 Move coroutineContext to correct package
from kotlin.coroutines.experimental.instrinsics to kotlin.coroutines.experimental

 #KT-22400
2018-02-01 20:49:24 +03:00
Pavel V. Talanov
8c1dee41e8 JavaResolveExtension: create facade by original element
Fixes semantic difference erroneously introduced in c030a047aa
 #KT-22593 Fixed
2018-01-31 20:23:04 +03:00
Nicolay Mitropolsky
3ddeec6f3b Revert "Light annotations made strictly non-physical (KT-22565)"
This reverts commit 99746b5
It looks like it could bring some issues in IDEA 173, so moving to 181 only
2018-01-31 20:07:18 +03:00
Nicolay Mitropolsky
99746b5094 Light annotations made strictly non-physical (KT-22565)
(cherry picked from commit cf6e21d)
2018-01-31 16:55:15 +03:00
Mikhail Glukhikh
34e8a720df Fix completion test (companion object is allowed in annotation scope)
(cherry picked from commit babcea9)
2018-01-31 14:48:00 +03:00
Mikhail Glukhikh
17d4e92e6c Fix "create enum constant" test (create type alias is no longer here)
(cherry picked from commit 00ceac5)
2018-01-31 14:01:21 +03:00
Nikolay Krasko
5871a5e8e7 Set better defaults on Imports tab in Code Style -> Kotlin (KT-22575)
"Top level symbols" and "Java Statics and Enum Members" are always
returned to 2 after saving to not-number option

 #KT-22575 Fixed
2018-01-31 13:56:24 +03:00
Nikolay Krasko
f99907977e Can't add import for using with '*' in settings (KT-22570)
#KT-22570 Fixed
2018-01-31 13:56:23 +03:00
Nikolay Krasko
1e0b0aa5ce Fix modification check for Kotlin import settings (KT-22557)
#KT-22557 Fixed
2018-01-31 13:56:22 +03:00
Nikolay Krasko
93d8b2b9dc Lost IF_RPAREN_ON_NEW_LINE settings from Kotlin code style 2018-01-31 13:56:21 +03:00
Nikolay Krasko
8cdababa48 Add ability to customize and save IF_RPAREN_ON_NEW_LINE setting 2018-01-31 13:56:20 +03:00
Ilya Chernikov
50f34dbad0 Detect new activity after delayed shutdown correctly
fixes #KT-22549, test
2018-01-31 10:12:32 +01:00
Mikhail Glukhikh
026df68206 Fix two psi checker tests (related to annotation diagnostic / parsing)
(cherry picked from commit f46fa26)
2018-01-31 12:00:06 +03:00
Mikhail Glukhikh
6e75ff5b6b KtVisitor: delegate constructors to KtNamedDeclaration
In particular, enables back "Unused symbol" on constructors

(cherry picked from commit 86f25bf)
2018-01-31 11:59:34 +03:00
Mikhail Glukhikh
0fa5bf7e58 Fix testAnnotation in "member visibility can be private"
(cherry picked from commit 899da99)
2018-01-31 11:58:50 +03:00
Mikhail Glukhikh
6045110e94 Fix parcelize delete creator field test (companion is retained now)
(cherry picked from commit 98b0f91)
2018-01-31 11:58:22 +03:00
Mikhail Glukhikh
f0141571b1 Fix J2K 'testAnnotationInterface3' (annotation diagnostic changed)
(cherry picked from commit 294dcf3)
2018-01-31 11:58:02 +03:00
Mikhail Glukhikh
b5b355eac7 Fix testAnnotationInterface3 in J2K (error message)
(cherry picked from commit 4606885)
2018-01-31 11:57:39 +03:00
Toshiaki Kameyama
08536661bd KT-22167 "Add annotation target" quick fix does nothing and disappears from menu
(cherry picked from commit 677b05c)
2018-01-31 11:56:35 +03:00
Mikhail Glukhikh
05183068c2 Delete companion manually during pull up
(cherry picked from commit d88b574)
2018-01-30 16:35:20 +03:00
Mikhail Glukhikh
1abf134c8f Delete companion manually during callable inlining
(cherry picked from commit 6181ba4)
2018-01-30 16:34:22 +03:00
Mikhail Glukhikh
c462a74d35 Retain empty companion in KtNamedDeclarationStub.remove
(cherry picked from commit 9b1f323)
2018-01-30 16:34:12 +03:00
Mikhail Glukhikh
36f796dfb9 Create actual fix: handle companions correctly #KT-21114 Fixed
(cherry picked from commit 5abb9dd)
2018-01-30 16:34:01 +03:00
Dmitry Savvinov
d2833ccae1 Add changelog for 1.2.30 2018-01-30 11:21:02 +03:00
Mikhail Glukhikh
05849b0ea3 Redundant Unit expression: simplify code a bit
(cherry picked from commit 1298ef7)
2018-01-30 11:19:59 +03:00
Mikhail Glukhikh
a4d7488391 getParentOfTypesAndPredicate: Class<T> -> Class<out T>
(cherry picked from commit cd9e298)
2018-01-30 11:19:48 +03:00
Toshiaki Kameyama
a21fb3f2e0 Redundant Unit inspection: fix false positive for single expression
So #KT-22097 Fixed

(cherry picked from commit 18de0f7)
2018-01-30 11:19:34 +03:00
Toshiaki Kameyama
074429ff50 Correct report of "redundant setter" for override & empty block cases
So #KT-22364 Fixed

(cherry picked from commit 69f3f04)
2018-01-30 10:00:53 +03:00
Toshiaki Kameyama
28123eaf7b Add intention for changing setter accessibility #KT-22409 Fixed 2018-01-29 19:09:19 +03:00
Alexey Sedunov
7f97d58970 Type Hierarchy: Do not use JVM class mapping in non-JVM modules
#KT-21424 In Progress
2018-01-29 18:56:29 +03:00
Alexey Sedunov
089b34a8a9 Minor: Regenerate tests 2018-01-29 18:56:28 +03:00
Mikhail Glukhikh
1f8e2a1057 Reformat: unfold return to ... 2018-01-29 18:01:10 +03:00
Toshiaki Kameyama
3a81be6cfb Do not insert returns before Nothing in "Replace return with 'if'"
So #KT-22159 Fixed
2018-01-29 17:56:26 +03:00
Mikhail Glukhikh
f28bec0db1 Reformat: if-then utilities 2018-01-29 17:49:34 +03:00
Mikhail Glukhikh
3b8f5bce41 Reformat: "if then to safe access" inspection 2018-01-29 17:44:19 +03:00
Toshiaki Kameyama
fad7818bf0 Fix "if to safe access" false positive for check on incorrect type
So #KT-21881 Fixed
2018-01-29 17:43:01 +03:00
Mikhail Glukhikh
5798595206 Cleanup: IntentionDescriptionTest 2018-01-29 16:28:45 +03:00
kenji tomita
a28bc830f5 Add Intention for single character substring #KT-22171 Fixed 2018-01-29 16:23:01 +03:00
Mikhail Glukhikh
29eb594309 Inspection to replace Java Collections methods: simplify type check
Related to KT-22038
2018-01-29 15:52:45 +03:00
Mikhail Glukhikh
068f520c01 Inspection to replace Java Collections methods: fix formatting 2018-01-29 15:52:45 +03:00
Toshiaki Kameyama
be4739e65e Inspection to replace Java Collections methods: extend set of types
So #KT-22038 Fixed
2018-01-29 15:52:44 +03:00
Alexey Sedunov
bd8a4d78fa Line Markers: Don't show test run line markers for top-level functions
#KT-13509 Fixed
2018-01-29 14:48:41 +03:00
Mikhail Glukhikh
8cbf364457 Remove braces: add parentheses to if-else in more general case
Related to KT-18308
2018-01-29 14:32:36 +03:00
Toshiaki Kameyama
44c15d8311 Remove braces: add parentheses to if-else inside expression
So #KT-18308 Fixed
2018-01-29 14:32:36 +03:00
Alexander Udalov
19e38bbc72 Do not run annotation checkers for every non-annotated element 2018-01-29 12:22:41 +01:00
Alexander Udalov
46b8deedf7 Run classifier usage checkers on constructor calls
In some cases, REFERENCE_TARGET for annotation entries is the annotation
class descriptor, and in others -- the constructor of that class
2018-01-29 12:22:41 +01:00
Alexander Udalov
8cd7686535 Introduce DeclarationCheckerContext, remove SimpleDeclarationChecker 2018-01-29 12:22:40 +01:00
Alexander Udalov
4cb5483c13 Introduce CheckerContext and ClassifierUsageCheckerContext
To reduce the number of parameters in classifier usage checker
implementations, and to unify the API with call checkers
2018-01-29 12:20:36 +01:00
Alexander Udalov
e2def0c60e Do not report "invalid type of annotation member" on error types
In case the referred type is actually an enum that is not found in
dependencies due to a configuration problem, this usage could be valid.
So we can avoid reporting an error here, to reduce the number of
diagnostics.

Also do not report "default value of annotation parameter must be a
compile-time constant" in the same case for the same reason
2018-01-29 12:20:36 +01:00
Natalia Selezneva
c251386fc3 Rearrange script templates in GradleScriptTemplateProvider
#KT-22473 Fixed
2018-01-29 11:16:29 +03:00
Alexey Sedunov
b091500adc Rename: Wrap facade class when renaming file
This prevents assertion error (introduced in IDEA 181)
caused by facade light class invalidation
and fixes failing test
2018-01-29 01:34:48 +03:00
Alexey Sedunov
80643c5603 Rename: Fix processing of functions without light methods
#KT-22461 Fixed
2018-01-29 01:34:48 +03:00
Alexander Udalov
245d1de2a2 Remove runtime dependency on projectDist(":kotlin-compiler")
This dependency makes IDEA reindex kotlin-compiler.jar after every
Gradle build, which takes time and breaks some key IDE features
2018-01-28 10:14:24 +01:00
Dmitry Savvinov
4d951de616 Propagate nullability changes to enhancement for JSR-305 types
Fix TypeUtils.makeNullableAsSpecified for SimpleTypeWithEnhancement and
FlexibleTypeWithEnhancement: change nullability of enhancement too. This
fixes several false-positive warnings, like in KT-20855 and KT-20466.

Note that it removes warning in some cases (see testdata change for
uselessElvisRightIsNull.kt). However, this removes warning about
*unnecessary* elvis, i.e. this fixed introduces weak false-negatives, which
is acceptable for the moment.

#KT-20855 Fixed Target versions 1.2.30
#KT-20466 Fixed Target versions 1.2.30
#KT-21238 Fixed Target versions 1.2.30
2018-01-26 12:49:14 +03:00
Nikolay Krasko
4c76dc7287 Forbid modification for KtLambdaExpression in JavaCodeBlockModificationListener
See IDEA-185462 for details
2018-01-26 12:42:17 +03:00
Nikolay Krasko
4d2061d836 Minor: reformat coverage 2018-01-26 12:42:17 +03:00
Nikolay Krasko
6d7c779df2 Better diagnostic for file absence in updateJar (KT-22272)
#EA-96117 Fixed
 #KT-22272 Fixed
2018-01-26 12:42:16 +03:00
Toshiaki Kameyama
7e417272b2 "Join lines" works incorrectly in case of line containing more than one string literal (KT-22374)
#KT-22374 Fixed
2018-01-26 12:42:16 +03:00
Mikhael Bogdanov
cc346aef64 Support @JvmStatic for interface companion objects in backend 2018-01-26 10:09:21 +01:00
Mikhael Bogdanov
8bfd6d7404 Support JVM_TARGET in diagnostic tests 2018-01-26 10:09:20 +01:00
Mikhael Bogdanov
c4da370b0b Allow to use @JvmStatic in interface companion object 2018-01-26 10:09:20 +01:00
Mikhael Bogdanov
2340756b88 Minor. Reformat 2018-01-26 10:09:20 +01:00
Dmitry Savvinov
253cd3871b Support effect system-related args in platform 2018-01-26 11:30:44 +03:00
Dmitry Savvinov
b29a6e48fb Refactor language features, which control effect system
- Introduce new language feature 'ReadDeserializedContracts', which
allows to deserialize contracts from metadata.

- Introduce new language feature 'AllowContractsForCustomFunctions',
which allows reading contracts from sources.

- Use new features instead of combination 'CallsInPlaceEffect ||
ReturnsEffect'

- Rename 'CallsInPlaceEffect' -> 'UseCallsInPlaceEffect',
'ReturnsEffect' -> 'UseReturnsEffect'. As names suggest, they control
if it is allowed to use corresponding effect in analysis.

We have to introduce separate 'ReadDeserializedContracts' to enable
contracts only in some modules of the project, because libraries are
read with project-wide settings (see KT-20692).
2018-01-26 11:30:44 +03:00
Dmitry Savvinov
78850087be Revert reformatting for OperationsMapGenerated.kt 2018-01-26 11:00:28 +03:00
Dmitry Petrov
5e34f290ce Reified 'as?' produces nullable result
Previously, this was treated as a regular CHECKCAST, causing KT-22410.

 #Fixed KT-22410 Target versions 1.2.30
2018-01-26 10:22:59 +03:00
Dmitry Petrov
bd25bf14df Minor: reformat code in org.jetbrains.kotlin.codegen.optimization 2018-01-26 10:18:17 +03:00
Yan Zhulanow
e12deb54d6 Android Extensions: Fix "Inconsistent file tree" exception on Activity creation (KT-22349) 2018-01-25 22:03:30 +03:00
Yan Zhulanow
7b055c2172 Kapt: Prefer non-aliased imports over aliased. Make sure the imported short names are unique (KT-22083) 2018-01-25 22:03:29 +03:00
Ilya Gorbunov
233376eef0 Improve min/max specialization for longs and 3-arg overloads in JS 2018-01-25 21:41:18 +03:00
Ilya Gorbunov
2da9f12bc5 Inline findAnyOf(chars) into indexOfAny/lastIndexOfAny
This helps to reduce allocation count

#KT-22042
2018-01-25 21:37:22 +03:00
Cuihtlauac ALVARADO
923d9f03fc Update test results
Separated issue reported: KT-22522

#KT-22369 Fixed
2018-01-25 21:15:08 +03:00
Denis Zharkov
31e73e90d6 Explicitly state that PluginDeclarationProviderFactory is source-only
Before this change `filesScope` was effectively empty in cases when
module info is a library, thus looking
into PackageIndexUtil.packageExists(name, indexedFilesScope, project)
was kind of redundant since it always returns false for empty scopes

The initial motivation was run by 1716720604
that made PackageIndexUtil::packageExists calls much more frequent
2018-01-25 14:41:28 +03:00
Denis Zharkov
2224f95294 Minor. Avoid wrapping GlobalSearchScope.EMPTY_SCOPE 2018-01-25 14:41:28 +03:00
Denis Zharkov
4d378912bf Minor. Reformat JVM/JS analyzer facades 2018-01-25 14:41:28 +03:00
Toshiaki Kameyama
4232ad8dfe "Join lines" works incorrectly in case of line with more than one string literal (KT-22374)
#KT-22374 Fixed
2018-01-24 20:09:32 +03:00
Toshiaki Kameyama
c06aaf6128 Some Live Templates should probably be enabled also for "expressions" not only "statements" (KT-19194)
Consider if-then, if-else, do-while, while positions without block as
statement position.

 #KT-19194 Fixed
2018-01-24 20:09:32 +03:00
Alexander Udalov
543db380d2 Use isJvmInterface in JVM back-end instead of isInterface
To support const vals and proper initialization order for companions of
annotations (since 1.3+) as well as interfaces

 #KT-16962 Fixed
2018-01-24 15:54:35 +01:00
Alexander Udalov
a46a2b9b1c Support nested classes in annotation classes
#KT-16962 In Progress
2018-01-24 15:54:35 +01:00
Alexey Sedunov
5947b4eb8e Minor: Fix Maven server url 2018-01-24 17:52:41 +03:00
Alexey Sedunov
c96eb8df85 Minor: Fix test data for ConvertFunctionTypeParameterToReceiverIntention 2018-01-24 17:28:34 +03:00
Sergey Igushkin
a59fd3bc85 Remove the usage of repository.jetbrains.com 2018-01-24 17:12:45 +03:00
Ilya Gorbunov
32b68ae1d5 Rearrange platform specialized functions
Place them according to their operation to ArrayOps and Filtering.
2018-01-24 02:10:05 +03:00
Ilya Gorbunov
eda8bbacb3 Remove obsolete JvmVersion annotation from generated functions
These functions are already generated in jvm-only file
2018-01-24 02:10:01 +03:00
Sergey Igushkin
20c4775da0 Remove repository.jetbrains.com mirror of Maven Central in libraries. 2018-01-23 23:41:39 +03:00
Sergey Igushkin
0c78a2c026 Remove some of the remaining mentions of repository.jetbrains.com 2018-01-23 23:35:50 +03:00
Alexander Udalov
f516667640 Exclude META-INF/services from kotlin-reflect-sources.jar 2018-01-23 17:11:20 +01:00
Alexander Udalov
3bf5f44b9d Exclude .proto files from kotlin-reflect.jar
#KT-22459 Fixed
2018-01-23 17:11:09 +01:00
Vyacheslav Gerasimov
399282234e Add changelog for 1.2.21 2018-01-23 17:47:17 +03:00
Ilya Gorbunov
6b9520ec73 KT-16661 Simplify String.split a bit more
Check that limit is reached only once in a loop, move nextIndex check to the end of loop.
2018-01-23 13:29:35 +03:00
Vsevolod
510e17246f KT-16661 Simplify Strings#split
Do not search for next occurrence if limit is reached.
2018-01-23 13:29:29 +03:00
Vsevolod
2805371bdc KT-16661 Provide fast-path for Strings#split with single delimiter
Optimize single delimiter split when no matches is found:
Return listOf() of single element instead of adding 'this' to result
because underlying array in ArrayList is created lazily and
by default its size is 16.

Pre-size resulting list in split when limit is known.
2018-01-23 13:29:05 +03:00
Dmitry Petrov
72ffbb9825 Add test for array modification within for-in-array-withIndex loop body 2018-01-23 10:55:24 +03:00
Dmitry Petrov
40d1925e19 Provide optimized code generation for for-in-withIndex for sequences
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov
2399a39414 Provide optimized code generation for for-in-withIndex for CharSequences
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov
9c9e507172 Provide optimized code generation for for-in-withIndex for iterables
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov
08622b0953 Provide optimized code generation for for-in-withIndex for arrays
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov
e07e9c0ea5 Refactor RangeCodegenUtil: introduce isTopLevelExtensionOnType 2018-01-23 10:55:24 +03:00
Dmitry Petrov
fb487b31ba Minor: format code in RangeCodegenUtil 2018-01-23 10:55:24 +03:00
Dmitry Petrov
5c1321a29f Minor: format code in org.jetbrains.kotlin.codegen.range 2018-01-23 10:55:24 +03:00
Alexey Tsvetkov
f77586574f Always sort files in K2JSCompiler
Previously files were sorted only when IncrementalDataProvider
was not null to normalize js output in case of incremental compilation.
Because of that an output js file could be different after rebuild
in IC tests.
The issue could be reproduced anywhere, but the tests failed only on
Windows, and it seems tests were not run on Windows for some time.
2018-01-22 18:34:17 +03:00
Alexey Tsvetkov
21f2b68357 Fix BuildLogParserParametrizedTest on Windows: normalize line separators 2018-01-22 18:34:17 +03:00
Alexey Tsvetkov
6fc5c3325c Minor: rename file to match class name 2018-01-22 18:34:17 +03:00
Alexey Sedunov
737d7dcc2f Kotlin Facet: Use Kotlin SDK for non-JVM imported modules 2018-01-22 12:21:13 +03:00
Alexey Sedunov
70cb08bfdb Misc: Update test data (new 'allopen' Spring annotations added) 2018-01-22 12:21:12 +03:00
Denis Zharkov
2e933a165a Avoid retaining all protobuf objects in DeserializedMemberScope
Object model for deserialized protobuf isn't very cheap, so
loading just our stdlib's packages several times (as we do in the IDE)
might lead to ~ 96 MB of retained memory just by these objects.

While in fact many of them remain unused

 #KT-21517 Fixed
2018-01-22 10:48:25 +03:00
Nikolay Krasko
b701117ffb Minor: reformat, and warning fixes in outdated notification subsystem 2018-01-19 22:41:52 +03:00
Nikolay Krasko
2386cfbd07 Do not spell check overridden declaration names (KT-15000)
#KT-15000 Fixed
2018-01-19 22:41:51 +03:00
Anton Bannykh
ff00831109 JS: minor fixes in kotlin-test-js-it
Jasmine version 2.6.0 doesn't support Promise-based
asynchronous tests.
Also the error message for an unexpected test result was incorrect.
2018-01-19 20:16:31 +03:00
Ilmir Usmanov
f4ad5182b8 Fix OOM error in ReturnUnitMethodTransformer
#KT-22345: Fixed
2018-01-19 20:13:23 +03:00
Ilya Gorbunov
40aa2280a5 Replace .. with until or indices where appropriate
Replace indices.reversed() with lastIndex..0 as it is not optimized in JS yet
2018-01-19 19:53:09 +03:00
Alexander Udalov
513f50785e Use processResources task to copy compiler.xml to IDEA plugin
This fixes tests broken in 4b2d281bba and 95f9884799
2018-01-19 17:26:33 +01:00
Alexander Udalov
4b2d281bba Include META-INF/extensions/compiler.xml into IDEA plugin
This fixes tests and IDEA run configurations broken in 95f9884799
2018-01-19 15:13:40 +01:00
Mikhail Glukhikh
577c6cde82 KtInvokeFunctionReference: protect from KNPE in getLambdaExpression
So EA-114887 Fixed
2018-01-19 16:16:33 +03:00
Mikhail Glukhikh
26c1673da0 J2K: KtInvokeFunctionReference 2018-01-19 16:16:31 +03:00
Mikhail Glukhikh
117c5a29fb KtInvokeFunctionReference.java -> kt 2018-01-19 16:16:22 +03:00
Mikhail Glukhikh
b1bff24cde Move lambda inside: protect from KNPE in getLambdaExpression
So EA-114888 Fixed
2018-01-19 16:16:21 +03:00
Mikhail Glukhikh
f675d9fd81 Convert reference to lambda: protect from root fq name EA-114907 Fixed 2018-01-19 16:16:19 +03:00
Mikhail Glukhikh
3c19af3645 Convert reference to lambda: reformat 2018-01-19 16:16:18 +03:00
Mikhail Glukhikh
9d9b2b2a58 Fix stub inconsistency in "inline type parameter fix"
Fixes one quick-fix test
2018-01-19 16:16:17 +03:00
Mikhail Glukhikh
1924172189 Inline type parameter fix: reformat 2018-01-19 16:16:16 +03:00
Mikhail Glukhikh
ee3f89df87 Remove unused function parameter: delete empty constructor accurately
So #KT-22221 Fixed
Fixes also some quick-fix tests
2018-01-19 16:16:15 +03:00
Mikhail Glukhikh
c4ef95dbf7 Remove empty primary constructor: reformat 2018-01-19 16:16:13 +03:00
Mikhail Glukhikh
ac1c40c0e6 Add function to supertype fix: get rid of incorrect type comparator
So EA-100297 Fixed
2018-01-19 16:16:12 +03:00
Mikhail Glukhikh
7f947bed1e Add function to supertype fix: reformat 2018-01-19 16:16:11 +03:00
Mikhail Glukhikh
925e4e0a67 KotlinUnusedImportInspection: use LocalQuickFixOnPsiElement 2018-01-19 16:16:10 +03:00
Mikhail Glukhikh
a3dda258c8 KotlinUnusedImportInspection (minor): specify platform type 2018-01-19 16:16:09 +03:00
Mikhail Glukhikh
dade8deea6 KotlinUnusedImportInspection: reformat 2018-01-19 16:16:07 +03:00
Mikhail Glukhikh
c54dd6385c KotlinUnusedImportInspection: check for disposal of progress indicator
So #KT-22335 Fixed
2018-01-19 16:16:06 +03:00
Mikhail Glukhikh
c52fcdde70 Remove explicit type: reformat 2018-01-19 16:16:05 +03:00
Mikhail Glukhikh
512e287f3a Remove setter parameter type: do not suggest if type is empty
So #KT-22339 Fixed
2018-01-19 16:16:04 +03:00
Mikhail Glukhikh
f0b172ca35 Remove setter parameter type: reformat 2018-01-19 16:16:02 +03:00
Sergey Igushkin
c8900d672f Update Gradle plugins build instructions 2018-01-19 12:58:39 +03:00
Mikhael Bogdanov
4c1eb21805 Minor. Add assertion message 2018-01-19 10:42:02 +01:00
Nicolay Mitropolsky
2623ae714c Uast: consistency updates for ULambdaExpression 2018-01-19 10:45:58 +03:00
Nicolay Mitropolsky
25cd54713b Uast: consistency for imports-expressions 2018-01-19 10:45:58 +03:00
Nicolay Mitropolsky
d5d49c65b4 Uast: tests for UClass.uastSuperTypes 2018-01-19 10:45:58 +03:00
Mikhael Bogdanov
7b212c5650 Add support for android MPP
#KT-18462 Fixed
2018-01-18 15:21:19 +01:00
Toshiaki Kameyama
2a10d8e837 KT-15176 Remove "Create type alias" intention when called on java class 2018-01-18 16:23:40 +03:00
Dmitry Savvinov
44920f42d8 [NI] Fix unit coercion
Consider following case:

fun foo(): Unit = run { "hello" }

Previously, NI would analyze lambda body without expected type, because
it is a type variable 'R' from 'run', which hasn't been fixed yet. This
leads to treating "hello" as lambda-return argument and adding bogus
'String' constraint on 'R', and, consequently, type mismatch.

Now, we peek into current constraint system and check if return-type of
lambda is type variable with upper-Unit constraint (which is exactly
condition for its body to be Unit-coerced). If so, then we provide
expected Unit-type for body explicitly, and the rest will be done
automatically (in particular, in aforementioned example "hello" wouldn't
be treated as lambda return argument).
2018-01-18 15:13:45 +03:00
Alexander Udalov
b3eeb2f735 Remove unneeded members of ConstantValueFactory 2018-01-18 12:49:38 +01:00
Alexander Udalov
82574cb570 Do not store ClassDescriptor in EnumValue
Only store the ClassId of the enum class and the Name of the entry, and
resolve the needed descriptor in getType() instead, which now takes the
module instance where that descriptor should be resolved
2018-01-18 12:49:38 +01:00
Alexander Udalov
9290d58ed0 Improve "firstArgumentValue" and "argumentValue" extension functions
Using the argument value, which is of type "Any?", is more implicit and
thus difficult to read than using the ConstantValue instance and casting
it to the needed constant value implementation before taking the value
2018-01-18 12:49:38 +01:00
Alexander Udalov
899002b681 Refactor JavaEnumValueAnnotationArgument and implementations
Only require implementations to be able to compute the enum class name
and the corresponding entry name. Only this should be necessary to
correctly resolve the argument; the resolvers will find the
corresponding class descriptor if necessary
2018-01-18 12:49:38 +01:00
Alexander Udalov
907f53e539 Refactor ConstantValue implementations
Remove KotlinBuiltIns and take a ModuleDescriptor instance in getType
instead. This will allow to create constant values in contexts where
there's no module or built-ins accessible (such as, deserialization of
module annotations during indexing of .kotlin_module files in IDE).

Note that some values (KClassValue, EnumValue, AnnotationValue) still
take module-dependent objects (KotlinType, ClassDescriptor and
AnnotationDescriptor respectively). This is to be refactored later
2018-01-18 12:49:38 +01:00
Alexander Udalov
5e97517c8b Fix bug in StringValue.equals
Also simplify equals() implementations of other constant values
2018-01-18 12:49:38 +01:00
Alexander Udalov
95f9884799 Move META-INF/extensions/compiler.xml to module 'cli' 2018-01-18 12:48:04 +01:00
Alexander Udalov
02857dbfdb JS: support "LANGUAGE" directives in box tests 2018-01-18 12:46:27 +01:00
Alexander Udalov
8b3d439d5b JS: minor, simplify code locating default argument values
At the only call site of getDefaultArgument it is checked that the
parameter actually _declares_ default value, so it's not necessary to
try to load that value from supertypes
2018-01-18 12:46:27 +01:00
Nikolay Krasko
ae2d67a5b1 Update "Kotlin configured but no stdlib" status on file update (KT-22356)
Provide feedback before project re-import is finished.

 #KT-22356 Fixed
2018-01-18 12:13:54 +03:00
Nikolay Krasko
2637a36e22 Inspection doesn't suggest Maven Plugin for kotlin-stdlib-jre8 (KT-18007)
#KT-18007 Fixed
2018-01-18 12:13:53 +03:00
Nikolay Krasko
4a2440ea0f Reformat and cleanup idea-maven_main module 2018-01-18 12:13:53 +03:00
Mikhael Bogdanov
7f1cc81d39 Support test directives in android tests 2018-01-18 10:08:58 +01:00
Mikhael Bogdanov
ef1a3ec32d Convert CodegenTestsOnAndroidGenerator to Kotlin 2018-01-18 10:08:58 +01:00
Mikhael Bogdanov
7e6542b8c8 Renema CodegenTestsOnAndroidGenerator.java to CodegenTestsOnAndroidGenerator.kt 2018-01-18 10:08:57 +01:00
Denis Zharkov
1716720604 Optimize declaration providers for case of non-existing packages
Avoid creating memoized function nodes when the value is obviously null
Otherwise, it may lead to about 25M retained by empty concurrent hashmap
nodes
2018-01-18 11:40:26 +03:00
Denis Zharkov
0f74bb4a7a Get rid of compile dependency to 'compiler-embeddable' from :idea
Previously, it's been added transitively from :kotlin-compiler-runner
as a compile dependency instead of runtime as it's declared in compiler-runner
2018-01-18 11:39:34 +03:00
Alexey Tsvetkov
72f2406083 Turn IC on by default for MPP projects 2018-01-17 21:23:43 +03:00
Sergey Igushkin
5deb20543f Get rid of gradle-api artifacts uploaded to and used from JB repo
Remove redundant Maven dependency to `gradle-api` scoped as provided
2018-01-17 18:45:26 +03:00
Vyacheslav Gerasimov
d16883deaa Build: Clean previous output before instrumentation
Otherwise it may lead to unnecessary classes (left from previous plugin build) being packed to plugin
2018-01-17 16:57:56 +03:00
Dmitry Savvinov
c704f2de9a Reformat 'resolution' module according to new codestyle 2018-01-17 16:47:45 +03:00
Vyacheslav Gerasimov
e2b83aecd7 Fix publishing to Gradle plugin portal 2018-01-17 15:33:15 +03:00
Anton Bannykh
7b0070ea62 Promise-based async integration test for kotlin-test-js 2018-01-17 14:46:13 +03:00
Dmitry Jemerov
ca57309374 Temp revert fix for KT-10591 as it causes non-obvious test breakage 2018-01-17 11:39:35 +01:00
Alexey Sedunov
a752f3f38e Misc: Rename class 2018-01-17 12:54:39 +03:00
Alexey Sedunov
62580a47dc Misc: Add test for KT-7316
#KT-7316 Fixed
2018-01-17 12:53:57 +03:00
Alexey Sedunov
54f4f5ff24 Configuration: Add Kotlin SDK for non-JVM projects
#KT-16976 Fixed
2018-01-17 12:52:51 +03:00
Alexey Sedunov
af1d6124ce JS: Do not specify NodeJS path in Gradle projects
We rely on node_modules directory content which must be populated
by the build script itself
2018-01-17 12:45:45 +03:00
Alexey Sedunov
c6a9c36275 Analyze Data Flow: Support cross-language analysis
#KT-16833 Fixed
2018-01-17 12:40:34 +03:00
Dmitry Petrov
6cb68531ae Minor: add missing "'" 2018-01-17 12:31:07 +03:00
Dmitry Petrov
bba8168150 Add test for extension properties declaration in IR 2018-01-17 12:31:07 +03:00
Dmitry Petrov
1f841e35bc Formatting: psi2ir 2018-01-17 12:31:07 +03:00
Dmitry Petrov
432c743771 Formatting: ir.tree and some common code 2018-01-17 12:31:07 +03:00
Dmitry Petrov
fdd000c94f Update testData to new format 2018-01-17 12:31:07 +03:00
Dmitry Petrov
4d54036d21 Use declaration properties in RenderIrElementVisitor 2018-01-17 12:31:07 +03:00
Dmitry Petrov
7dc15b15bb Add basic properties to IR declarations 2018-01-17 12:31:07 +03:00
Dmitry Petrov
2f09c51dca Formatting: IR test classes 2018-01-17 12:31:07 +03:00
Nikolay Krasko
704ce121bc Use other property name in Java with Kotlin static import tests 2018-01-17 12:05:06 +03:00
Nikolay Krasko
1c7e42f1d4 Collapsed comments containing * get removed in the summary line (KT-21994)
#KT-21994 Fixed
2018-01-17 12:05:05 +03:00
Nikolay Krasko
a1b20535b2 Search same place for it usages in rainbow highlighter (KT-22242)
Reuse KotlinTargetElementEvaluator for getting same declaration
context for implicit 'it' parameter.

 #KT-22242 Fixed
2018-01-17 12:05:04 +03:00
Vyacheslav Gerasimov
f86b77083f Add sources and javadoc to kotlin-annotations-android 2018-01-16 21:19:46 +03:00
Alexey Tsvetkov
d1d786dffa Fix lookup tracking in JPS with enabled daemon
#KT-21962 fixed
2018-01-16 21:09:57 +03:00
Alexey Tsvetkov
220fab0d3f Test JPS with Daemon and IC 2018-01-16 21:09:57 +03:00
Alexey Tsvetkov
ca09be1411 Minor: move 'KotlinJpsBuildTestIncremental' to separate file 2018-01-16 21:09:57 +03:00
Nicolay Mitropolsky
b4db744a9b Uast: KotlinStringULiteralExpression.getExpressionType() made always return String 2018-01-16 20:38:00 +03:00
Dmitry Jemerov
e46f69bb36 Disable "Decompile" button if bytecode generation threw exception
#KT-13791 Fixed
2018-01-16 17:54:49 +01:00
Dmitry Jemerov
404f9cc7d8 KotlinBytecodeToolWindow: convert to .kt 2018-01-16 17:54:48 +01:00
Dmitry Jemerov
bad76eb5c2 KotlinBytecodeToolWindow: rename to .kt 2018-01-16 17:54:47 +01:00
Dmitry Jemerov
5b3ab97b4e Highlight 'var' primary constructor parameters as mutable
#KT-11467 Fixed
2018-01-16 17:54:45 +01:00
Dmitry Jemerov
571b424b33 Use DescriptorToSourceUtilsIde.getAnyDeclaration in super navigation
#KT-16333 Fixed
2018-01-16 17:54:44 +01:00
Dmitry Jemerov
cc90dfa65b GotoSuperActionHandler: convert to .kt 2018-01-16 17:54:43 +01:00
Dmitry Jemerov
690c3433d6 GotoSuperActionHandler: rename to .kt 2018-01-16 17:54:42 +01:00
Dmitry Jemerov
106e1b8661 Don't include unindented comments preceding a function into its text range
#KT-10591 Fixed
2018-01-16 17:54:29 +01:00
Dmitry Jemerov
075541da21 Show location info for members defined in object literals
#KT-22179 Fixed
2018-01-16 17:54:27 +01:00
Dmitry Jemerov
564490c9d4 Don't require presence of PropertiesComponent
#KT-22214 Fixed
2018-01-16 17:54:19 +01:00
Dmitry Jemerov
1b6f6e8bf7 Don't indent block comments of typealiases
#KT-22230 Fixed
2018-01-16 17:54:16 +01:00
Dmitry Savvinov
c2b532b167 Reformat the rest of 'frontend'-module according to new codestyle 2018-01-16 18:26:21 +03:00
Dmitry Savvinov
e5f0ffb0c2 Reformat 'frontend' module according to new codestyle 2018-01-16 17:51:51 +03:00
Kirill Rakhman
b567817d1f Make completion for overriding functions respect suspend modifier
Fixes #KT-22200
2018-01-16 15:42:03 +01:00
Kirill Rakhman
8bc020f31b Fix modifier order in generated overriden functions
Fixes #KT-21600
2018-01-16 15:42:02 +01:00
Alexey Sedunov
99be75cbfc Refactoring: Use modifier list in CallableInfo where possible 2018-01-16 17:06:53 +03:00
Alexey Sedunov
ba0a91d74c Quick Fixes: Drop deprecated KotlinCommonIntentionActionsFactory
Also update relevant test to use new action factory API
2018-01-16 17:06:53 +03:00
Alexey Sedunov
908bf71ae6 Quick Fixes: Support cross-language "Create from Usage" with Kotlin target 2018-01-16 17:06:53 +03:00
Alexey Sedunov
d44313876c Create from Usage: Support primary constructor insertion 2018-01-16 17:06:52 +03:00
Alexey Sedunov
877874978f Misc: Add action text assertions to CommonIntentionActionsTest 2018-01-16 17:06:52 +03:00
Toshiaki Kameyama
113e9f496e Add quickfix for UnsafeCastFromDynamicInspection #KT-20915 Fixed 2018-01-16 17:06:51 +03:00
Vyacheslav Gerasimov
f709a382ae Update changelog for 1.2.20 2018-01-16 16:13:54 +03:00
Alexey Sedunov
05b618eec8 Gradle: Use copyable user data for compiler plugin options
#KT-22227 Fixed
2018-01-16 16:09:18 +03:00
Alexey Sedunov
5892944bfc Convert Enum to Sealed Class: Support expect/actual classes 2018-01-16 16:09:17 +03:00
Alexey Sedunov
9d5d85a1c5 Convert Sealed Class to Enum: Support expect/actual classes
#KT-18912 Fixed
2018-01-16 16:09:17 +03:00
Natalia Selezneva
dbd7ceb5fd Fix Evaluate Expression for inline functions from multifile package class.
Find main class generated for debugger by its name instead of relativePath length.
 #KT-22311 Fixed
2018-01-16 16:00:32 +03:00
Cuihtlauac Alvarado
c5982e7ff5 Avoid pick environement variables test failures (#1467)
Remove all lines containing a "Picked up <ENVIRONMENT_VARIALBE>: ..."

Remove empty ERR: section

FIX: KT-22241
2018-01-16 12:33:19 +01:00
Mikhael Bogdanov
b539adf105 Support simple capturing in IR inliner 2018-01-16 11:53:25 +01:00
Mikhael Bogdanov
ca22bc57fd Don't capture primary constructor variables 2018-01-16 11:53:25 +01:00
Mikhael Bogdanov
28f4cc5b18 Generate parameter name in assertion for lateinit properties 2018-01-16 11:53:24 +01:00
Mikhael Bogdanov
e58558dffd Support mapped companions 2018-01-16 11:53:24 +01:00
Mikhael Bogdanov
e57efc7233 Support external functions 2018-01-16 11:53:23 +01:00
Mikhael Bogdanov
c1a1a7f9fb Code clean 2018-01-16 11:53:22 +01:00
Mikhael Bogdanov
9d7eca1376 Support throwNpe intrinsic 2018-01-16 11:53:22 +01:00
Mikhael Bogdanov
d62a7cc9d1 Unwrap fake override on field access 2018-01-16 11:53:21 +01:00
Mikhael Bogdanov
dfbe92344f Skip setter accessors for val 2018-01-16 11:53:21 +01:00
Mikhael Bogdanov
2b95e6bc0d Generate proper vararg array 2018-01-16 11:53:20 +01:00
Mikhael Bogdanov
724f3bf714 Return proper type after coercion 2018-01-16 11:53:20 +01:00
Mikhael Bogdanov
77b93ab7ad Add classType property in IrClassReference, support class references in codegen 2018-01-16 11:53:19 +01:00
Mikhael Bogdanov
b2970ef771 Skip noinline lambdas during inline 2018-01-16 11:53:19 +01:00
Mikhael Bogdanov
ab96e0102a Support IrGetClass 2018-01-16 11:53:18 +01:00
Mikhael Bogdanov
9a1f484771 Fix equals 2018-01-16 11:53:18 +01:00
Nicolay Mitropolsky
d7f0695a51 Uast: KotlinNullabilityUAnnotation.javaPsi type set to PsiAnnotation? 2018-01-16 13:26:22 +03:00
Ilya Chernikov
c7f8312e1b Shade kotlinx.coroutines in embeddable artefacts
fixes #KT-22196
2018-01-16 09:03:53 +01:00
Sergey Igushkin
3ed7df506b Bump bootstrap to 1.2.30-dev-441 2018-01-15 22:38:28 +03:00
Nicolay Mitropolsky
9ce9b434fe Uast: testdata fix for KotlinUastTypesTest.testEa101715 2018-01-15 20:58:18 +03:00
Denis Zharkov
886d3ef3a6 Optimize KotlinScriptDefinitionFromAnnotatedTemplate::isScript
Avoid multiple pattern compilation for script file regex
2018-01-15 18:20:27 +03:00
Denis Zharkov
b4e5f8cf1c Optimize collecting module info in IDE
The problem was that there is no special entity for libraries
in the IntelliJ model, and when we have an element for a library
we have to search through all of its dependencies
(see getOrderEntriesForFile call in collectInfosByVirtualFile)

But for popular library there could be quite a lot of dependencies,
while in most cases we need only the first one to obtain module
info for library itself (see changed usage in resolverForElement).

So it's worth replacing List with Sequence here
2018-01-15 18:20:27 +03:00
Denis Zharkov
d848238a46 Add cache for Module::languageVersionSettings
It might be useful because getExtraLanguageFeatures might be
rather expensive to compute

 #KT-21450 Fixed
2018-01-15 18:20:27 +03:00
Dmitry Jemerov
60874f29fe Inspection for scope functions conversion
#KT-17047 Fixed
2018-01-15 15:37:36 +01:00
Dmitry Jemerov
0b24be9460 Don't enclose 'this' in braces inside string templates 2018-01-15 15:03:39 +01:00
Dmitry Jemerov
560dc920e4 Don't increase nesting level if we aren't processing current expression 2018-01-15 15:03:39 +01:00
Dmitry Jemerov
3a7e4acf22 Reformat and cleanup 2018-01-15 15:03:39 +01:00
Dmitry Jemerov
d15fa83749 API for building visitors from lambdas 2018-01-15 15:03:39 +01:00
Nikolay Krasko
46ac14198c Don't try to cast light element to KtElement (EA-114820) 2018-01-15 14:05:51 +03:00
Nikolay Krasko
adf6ad6283 Check file before cast in KotlinCompletionContributor (EA-101984) 2018-01-15 14:05:50 +03:00
Nikolay Krasko
eae79e96ee Fix NPE in PlainTextPasteImportResolver.tryResolveReferences (EA-10589) 2018-01-15 14:05:50 +03:00
Nikolay Krasko
93d40b0492 Fix NPE in SourceNavigationHelper.findFirstMatchingInIndex (EA-91517) 2018-01-15 14:05:50 +03:00
Nikolay Krasko
2ca7045228 Rewrite KotlinNameSuggesterTest test with KotlinLightCodeInsightFixtureTestCase
Use proper project descriptors and avoid reconfigure for test project.
2018-01-15 14:05:50 +03:00
Ilmir Usmanov
ed11528664 Ignore unreachable code on tail call optimization
#KT-21759: Fixed
2018-01-15 12:57:10 +03:00
Ilmir Usmanov
25998c1f9b Reformat tail call optimization related code 2018-01-15 12:56:54 +03:00
Yan Zhulanow
2ee23ddd02 EA-101715: Handle also case with IntegerValueTypeConstructor 2018-01-15 12:39:35 +09:00
Yan Zhulanow
108e91f2a2 Kapt: Be less strict when it's impossible to add a generated Kotlin source directory for Android project (KT-22056, EA-114271) 2018-01-15 12:39:34 +09:00
Yan Zhulanow
283c762b8b Kapt: Remove laziness from diagnosticFactory and javacMessages, use factory from supertype (KT-22189)
writeDiagnostic() may be invoked after the 'context' is cleared, and lazy implementations will fail.
2018-01-15 12:39:34 +09:00
Yan Zhulanow
192489ae66 Minor: Remove bulk class added by mistake 2018-01-15 12:39:33 +09:00
Yan Zhulanow
1c5cd1b3a0 Minor: Fix problem in IDE with @TestOnly annotation resolution 2018-01-15 12:39:32 +09:00
Yan Zhulanow
81aae03b57 Use Gradle API to import annotations from compiler plugins instead of nasty data storage tasks
Tasks itself will be left for some time until all users migrate to the newer IDE plugin versions.
2018-01-15 12:39:31 +09:00
Yan Zhulanow
e7c1d94c0f Minor: Fix red code in IDE 2018-01-15 12:39:30 +09:00
Yan Zhulanow
e978c42e52 SamWithReceiver: Add Maven/Gradle importers for SamWithReceiver 2018-01-15 12:39:30 +09:00
Yan Zhulanow
0a3a493f25 AllOpen: Fix incorrect 'accessing non-final property in constructor' warning (KT-16619) 2018-01-15 12:39:29 +09:00
Yan Zhulanow
df19162c8c Kapt: Store line information in a file doc comment, instead of annotations (KT-21936) 2018-01-15 12:39:28 +09:00
Yan Zhulanow
c66947ba40 NoArg: Parse 'invokeInitializers' option in Maven importer (KT-19900) 2018-01-15 12:39:27 +09:00
Yan Zhulanow
3512675d96 Compiler plugins: Refactor Maven import handlers in order to support other plugin options 2018-01-15 12:39:26 +09:00
Yan Zhulanow
a85b4ddb0f Kapt: Clear stubs directory on non-incremental stub generation (KT-21735) 2018-01-15 12:39:25 +09:00
Nicolay Mitropolsky
f4a7ecc1bb Uast: Fix for missing local variables in ctor-s bodies
similar to how it is done in `KotlinUBlockExpression`
2018-01-12 22:32:52 +03:00
Dmitry Jemerov
322ac6340a Fix GradleConfigureProjectByChangingFileTestGenerated 2018-01-12 18:58:04 +01:00
Anton Bannykh
c6d7ffb3eb JS DCE: drop unknown file report severity to WARNING
*.kjsm and other files might be received when FileCollection is
used in Gradle as a dependency.

Example: `testCompile project(":$coroutines_core").sourceSets.test.output`
(a popular-ish solution to introduce dependencies between tests)
2018-01-12 20:00:34 +03:00
Anton Bannykh
5d6d321fb2 Reformat K2JSDce.kt 2018-01-12 20:00:34 +03:00
Dmitry Jemerov
ce5b1acfa7 Regenerate tests 2018-01-12 16:59:31 +01:00
Alexander Podkhalyuzin
b8dded2685 Simple implementation for kt paste into project view #KT-8352 Fixed 2018-01-12 15:57:34 +03:00
Alexander Udalov
b925b6ef9f Add test for obsolete issue
#KT-10494
2018-01-12 12:50:38 +01:00
Nikolay Krasko
aee7329b89 Modify incremental test in 173 branch - files are not created anymore 2018-01-12 13:54:45 +03:00
Nikolay Krasko
5a6d58a799 Update to 2017.3.2 (173.4127.27) 2018-01-12 13:54:43 +03:00
Nikolay Krasko
4c09a6cf06 Allow different diagnostics in Javac tests - workaround for IDEA-184289 2018-01-12 13:54:42 +03:00
Nicolay Mitropolsky
27b3cdf1fa Uast: KotlinAccessorCallExpression made implement JvmDeclarationUElement 2018-01-12 13:54:41 +03:00
Nicolay Mitropolsky
254caef0e6 Idea version set to 173.3942.27 2018-01-12 13:54:39 +03:00
Nicolay Mitropolsky
f8601479de Uast: handling @receiver annotations 2018-01-12 13:54:38 +03:00
Nicolay Mitropolsky
f91f42c253 Uast: Constructors.kt testdata fixes 2018-01-12 13:54:36 +03:00
Nicolay Mitropolsky
2c81362ce1 Uast: uastParent made final in KotlinAbstractUElement 2018-01-12 13:54:35 +03:00
Nicolay Mitropolsky
e7200d16c3 Uast: no more need to exclude UIdentifier from JvmDeclarationUElement check 2018-01-12 13:54:33 +03:00
Nicolay Mitropolsky
e22e466485 Uast: making AbstractKotlinUClass not inherit from AbstractJavaUClass 2018-01-12 13:54:32 +03:00
Nicolay Mitropolsky
084da3665a Uast: removing java-uast usage from KotlinUastLanguagePlugin and KotlinEnumConstantClassReference 2018-01-12 13:54:31 +03:00
Nicolay Mitropolsky
260c549cd7 Uast: AbstractKotlinUVariable annotations now are retrieved from Kotlin Psi, not from compiled (KT-21025)
and `KotlinNullabilityUAnnotation` now is created for every `AbstractKotlinUVariable`
2018-01-12 13:54:29 +03:00
Nicolay Mitropolsky
f0723a5c07 Uast: WrappedUAnnotation as replacement for usage of JavaUAnnotation (KT-21025) 2018-01-12 13:54:28 +03:00
Vyacheslav Gerasimov
53d6c17417 Set correct until-build for Idea 173 plugin 2018-01-12 13:54:26 +03:00
Nicolay Mitropolsky
a278e4ccef Fixing non-running tests, that used MockApplication environment 2018-01-12 13:54:25 +03:00
Alexey Sedunov
c1cf03d89c Data Inflow: Support grouping by expression nullability 2018-01-12 13:54:23 +03:00
Nicolay Mitropolsky
0a1580159f Uast: Constructors.kt testData fixes 2018-01-12 13:54:22 +03:00
Alexey Sedunov
683bbe396d Data Inflow: Support grouping by leaf expressions 2018-01-12 13:54:20 +03:00
Alexey Sedunov
b46784ab86 Safe Delete: Suppress walking through light field initializer
This fixes some tests failing in 173 branch

 #KT-21508 Fixed
2018-01-12 13:54:19 +03:00
Nikolay Krasko
cbfd7088bf Fix inAnnotation test in 173 branch 2018-01-12 13:54:17 +03:00
Nikolay Krasko
c0582ed732 Update file name replace in QuickFix tests 2018-01-12 13:54:16 +03:00
Nicolay Mitropolsky
502a6fa9f1 Uast: SuperCalls.render.txt testdata fix 2018-01-12 13:54:14 +03:00
Nicolay Mitropolsky
5f6e5c5779 Uast: AbstractKotlinUClass compilation fix 2018-01-12 13:54:13 +03:00
Nicolay Mitropolsky
b51a7c6957 Spring: fix for package-completion tests
because otherwise `java` package name interfere with `java` directory name completion from somewhere
2018-01-12 13:54:12 +03:00
Nicolay Mitropolsky
1fd8abb0bb Spring: removing needless EP-s because they ported to UAST in platform 2018-01-12 13:54:10 +03:00
Nicolay Mitropolsky
79abc8743e KotlinSpringComponentScanInspection made to support platform JamReferenceContributor 2018-01-12 13:54:09 +03:00
Vyacheslav Gerasimov
0cad41bb0c Drop missing gradle extensions from gradle.xml 2018-01-12 13:54:07 +03:00
Nikolay Krasko
23bd0b3db5 Update test data because of changed action name in 173 2018-01-12 13:54:06 +03:00
Nicolay Mitropolsky
29fd34d1de Idea version set to 173.3727.22(RC1) 2018-01-12 13:54:05 +03:00
Nicolay Mitropolsky
8c27bf98f4 UAST: StringTemplateComplex testdata fix 2018-01-12 13:54:03 +03:00
Alexey Sedunov
f3dad53ad4 Line Markers: Respect subclass module when filtering out duplicates
#KT-21010 Fixed
2018-01-12 13:54:02 +03:00
Alexey Sedunov
d37c8397f5 Move: Fix applicability check in IDEA 173 2018-01-12 13:54:00 +03:00
Vyacheslav Gerasimov
ab50ccf995 Fix formatting for new kotlin dsl gradle project build script 2018-01-12 13:53:59 +03:00
Vyacheslav Gerasimov
560e2d1ced Drop new Kotlin Dsl gradle project wizard which has been merged to idea 2018-01-12 13:53:58 +03:00
Nicolay Mitropolsky
aa43bebbf1 SpringTestFixtureExtension: option to forbid facet autoconfigure added 2018-01-12 13:53:56 +03:00
Nicolay Mitropolsky
3a06b8fe3b SpringKotlinAutowiringInspection: getting rid of SpringJavaInjectionPointsAutowiringInspection 2018-01-12 13:53:55 +03:00
Nicolay Mitropolsky
bef100b46e AbstractIntentionTest: isApplicableOnPooled made run under ProgressIndicator 2018-01-12 13:53:53 +03:00
Vyacheslav Gerasimov
09f31076e6 Update ideaVersion to 173.3415.22 2018-01-12 13:53:52 +03:00
Nicolay Mitropolsky
2f30ca3fac Ultimate-plugin: UAST added as dependency 2018-01-12 13:53:51 +03:00
Nicolay Mitropolsky
f4a8a98157 Ultimate-plugin: multiplePropertiesAnnotationConfig.kt test data fixes
`@Qualifier` should not be there. It was a bug in platform
2018-01-12 13:53:49 +03:00
Nicolay Mitropolsky
6cb556dd6b AbstractQuickFixTest: FORCE_PACKAGE_FOLDER directive added
It was added as workaround for IDEA-176033 (IDEA-176032 in particular)
2018-01-12 13:53:48 +03:00
Nicolay Mitropolsky
ab0c081897 AbstractExtractionTest: fix for invalid files
`configureByFile` should be run after other configurations (like `configureKotlinRuntimeAndSdk`) because they could make configured file invalid
2018-01-12 13:53:46 +03:00
Nicolay Mitropolsky
dd45780de9 RecursiveMethodCallMarkerInfo and SuspendCallMarkerInfo forced to target Leaf-elements
because of restriction added in IDEA 173
2018-01-12 13:53:45 +03:00
Nicolay Mitropolsky
34bdc04fbe AbstractNavigateToLibraryTest: fix for invalid files
otherwise current file is invalidated by `configureAs` and `additionalConfig`
2018-01-12 13:53:44 +03:00
Nicolay Mitropolsky
7758875955 EdtTestUtil.runInEdtAndWait fix for proper user action emulation
changed because `com.intellij.ide.IdeEventQueue` doesn't consider events from `SwingUtilities.invokeAndWait` as user interaction
2018-01-12 13:53:42 +03:00
Nicolay Mitropolsky
0acfce55a8 KotlinCoreEnvironment: set ideaCompatibleBuildNumber = "173.1" 2018-01-12 13:53:41 +03:00
Nicolay Mitropolsky
6bfe168dd7 UAST: SimpleKotlinRenderLogTest.testWhenAndDestructing testdata fix 2018-01-12 13:53:39 +03:00
Nicolay Mitropolsky
8a23a62c90 AbstractJavaToKotlinConverterForWebDemoTest: setup fix: JvmElementProvider and JavaModuleSystem added 2018-01-12 13:53:38 +03:00
Mikhail Glukhikh
8810e15f08 ExpressionOfTypeProcessor: get member name in read action 2018-01-12 13:53:36 +03:00
Mikhail Glukhikh
3f9054b28b Fix find usages tests in 173 (run via ProgressIndicator) 2018-01-12 13:53:35 +03:00
Nicolay Mitropolsky
cfcee0a1fe Workaround for CoreEnvironment initialization: explicitly setting versions for extensions 2018-01-12 13:53:34 +03:00
Nicolay Mitropolsky
6b656d4da5 Spring gutter icons SpringApiIcons -> SpringApiIcons.Gutter fix.
Following the patch in idea https://upsource.jetbrains.com/IDEA/revision/ultimate-527b9189219f191b62eed59d699f57acccda05c3
2018-01-12 13:53:32 +03:00
Nicolay Mitropolsky
099c1a84ec Idea version set to 173.3302.8 2018-01-12 13:53:31 +03:00
Nikolay Krasko
60149e3021 Update file structure tests as FileStructurePopup api was changed in 173 2018-01-12 13:53:29 +03:00
Nicolay Mitropolsky
f5e3a5faa4 Spring-Kotlin: Gutter repaired (KT-20550, KT-20566)
Platform now allows Gutter to be placed only on leafs elements, this patch fixes it for `KotlinSpringClassAnnotator`.
2018-01-12 13:53:28 +03:00
Ilya Gorbunov
9e21744bf5 streamex version was changed in 173-snapshot to 0.6.5 2018-01-12 13:53:27 +03:00
Nicolay Mitropolsky
208a986eab UAST: support for JvmDeclarationUElement 2018-01-12 13:53:25 +03:00
Nicolay Mitropolsky
f1579d01af UAST test data fixes: LocalVariableWithAnnotationKt fix for variable type
it is not clear for me why it was not `String`
2018-01-12 13:53:24 +03:00
Nicolay Mitropolsky
7c3c59de00 UAST test data fixes: @null in render
as a "nullability" annotation for primitive types
2018-01-12 13:53:22 +03:00
Nicolay Mitropolsky
9fed8f1d24 idea-version set to since-build="173.1" until-build="181.*" 2018-01-12 13:53:21 +03:00
Vyacheslav Gerasimov
ceaa34201e Fix GradleNoduleBuilder use qualified names check 2018-01-12 13:53:19 +03:00
Nicolay Mitropolsky
4c775a9516 JvmFacade-related tests repair 2018-01-12 13:53:18 +03:00
Simon Ogorodnik
7da9268e10 Fix proguard settings for 173 (ignore com.intellij.util.io.TarUtil) 2018-01-12 13:53:16 +03:00
Simon Ogorodnik
f940c0b86f Fix compilation in 173 (GradleModuleBuilder.java) 2018-01-12 13:53:15 +03:00
Anton Bannykh
4f97040ce5 Fix compilation (MockParameterInfoUIContext.java)
(cherry picked from commit 21b0956)
2018-01-12 13:53:14 +03:00
Nicolay Mitropolsky
7eb2d0d185 KotlinLanguageInjector using Registry to enable annotation injections
(cherry picked from commit 8bdfeb7)
2018-01-12 13:53:12 +03:00
Simon Ogorodnik
12daf4389e Fix compilation in 173 (MockParameterInfoUIContext.java) 2018-01-12 13:53:11 +03:00
Dmitry Jemerov
53a3d08a0e Fix compatibility with BuildScriptDataBuilder API changes 2018-01-12 13:53:09 +03:00
Nicolay Mitropolsky
d7fcc69315 KotlinLanguageInjector#injectInAnnotationCall optimization: using PsiClassNamePatternCondition to avoid calling getResolvedCall 2018-01-12 13:53:08 +03:00
Nicolay Mitropolsky
81b6a61edf KotlinLanguageInjector can inject into files modified for autocompletion 2018-01-12 13:53:07 +03:00
Nicolay Mitropolsky
1435911437 KotlinLanguageInjector understands patterns-injections into Java annotations 2018-01-12 13:53:05 +03:00
xiexed
743dc80b4d KtLightAbstractAnnotation build fix for 173 (#1283) 2018-01-12 13:53:04 +03:00
Dmitry Jemerov
70caae4c6f Register new service and EPs added in 173 2018-01-12 13:53:02 +03:00
xiexed
defb5a9d10 Fixes for 173 after 28.08.17 changes in IDEA (#1271)
* `JarFileSystem.getJarRootForLocalFile` now is nullable in IDEA

* Spring-related renamings following ones in IDEA
2018-01-12 13:53:01 +03:00
Nicolay Mitropolsky
6690f9f1da Build fix for KotlinSpringClassAnnotator after collectNavigationMarkers nullability changes in IDEA 173 2018-01-12 13:52:59 +03:00
Vyacheslav Gerasimov
3f15f7a394 UAST: Fix testPropertyWithAnnotation 2018-01-12 13:52:58 +03:00
Vyacheslav Gerasimov
e6efaaf752 UAST: Add testConvertTypeInAnnotation 2018-01-12 13:52:56 +03:00
Vyacheslav Gerasimov
92c23aa0ed UAST: override getFunctionalInterfaceType + test 2018-01-12 13:52:55 +03:00
Vyacheslav Gerasimov
8eddb10870 UAST: Properly handle annotations on local variables 2018-01-12 13:52:54 +03:00
Vyacheslav Gerasimov
35fa8efbf3 Fix compilation after moving to idea 173 2018-01-12 13:52:52 +03:00
Vyacheslav Gerasimov
8f7a354592 Download IDEA 173.3188.16 2018-01-12 13:52:51 +03:00
Nikolay Krasko
2a0b7e293f Minor: KotlinCodeFragmentFactory.kt cleanup 2018-01-11 22:08:18 +03:00
Natalia Selezneva
4d6c83b5b9 Debugger: do not fail if j2k couldn't convert expression creating codeFragment from text 2018-01-11 22:08:17 +03:00
Ilmir Usmanov
c023831a00 Ignore open modifier on top-level suspend function when generating light classes
#KT-21642: Fixed
2018-01-11 19:33:47 +03:00
Nikolay Krasko
5da156e93c Setup modules before test configuration in NavigateToStdlibSourceTest.kt 2018-01-11 15:03:03 +03:00
Nikolay Krasko
91a9d3cf80 Search class after full test configuration in AbstractHierarchyWithLibTest 2018-01-11 15:02:14 +03:00
Nikolay Krasko
2f817662d5 Process only project scope in AbstractHierarchyWithLibTest 2018-01-11 15:01:47 +03:00
Nikolay Krasko
8ade03ac0b Avoid using mock JDK because of bad cast in ProjectJdkTableImpl.getState
com.intellij.openapi.projectRoots.impl.MockSdk cannot be cast to com.intellij.openapi.projectRoots.impl.ProjectJdkImpl
2018-01-11 15:00:57 +03:00
Nikolay Krasko
e710cbb0bb Don't fail during error reporting on invalid elements 2018-01-11 14:56:32 +03:00
Alexander Udalov
2593ce73f1 Update copyright in generated sources
To fix tests that are checking that the generated data is up to date
2018-01-11 12:45:36 +01:00
Nicolay Mitropolsky
9cb62d66cb KtLightAnnotation: handling vararg with single arg (EA-114679)
It is deprecated but yet possible form of usage
2018-01-11 14:05:15 +03:00
Ilya Gorbunov
6197c5bf7f Add sample for coerceIn with floating point range
#KT-20357
2018-01-11 09:05:28 +03:00
Ilya Gorbunov
8fc83e3ff5 Add samples for coerceIn, coerceAtLeast, coerceAtMost for comparable types
#KT-20357
2018-01-11 09:05:28 +03:00
shiraji
17573a3c21 Add samples for coerceIn
#KT-20357
2018-01-11 09:05:28 +03:00
shiraji
4559da9848 Add samples for coerceAtMost
#KT-20357
2018-01-11 09:05:28 +03:00
shiraji
db607e231c Add samples for coerceAtLeast
#KT-20357
2018-01-11 09:05:27 +03:00
kenji tomita
1db0e5c23e Add samples for reversed list views
#KT-20357
2018-01-11 09:05:27 +03:00
AdamMc331
2fc26ba08f Added samples for property delegates as part of KT-20357. 2018-01-11 09:05:27 +03:00
Vyacheslav Gerasimov
892e901f35 Update changelog for 1.2.20 2018-01-10 20:32:05 +03:00
Ilmir Usmanov
32a94c70e9 Use tail call optimization if ARETURN has multiple sources
#KT-21977: Fixed
2018-01-10 20:14:32 +03:00
Ilmir Usmanov
5dbab2f907 Disable tail call optimization, if the call is inside try block
#KT-21165: Fixed
2018-01-10 20:13:55 +03:00
Denis Zharkov
3cfe43f83a Add -Xsupport-compatqual-checker-framework-annotations flag
It's implemented through Jsr305State while it's not related
to jsr-305 becasue currently it's the most convenient way
to introduce the flag.

Probably, it's worth renaming Jsr305State to something more abstract
like NullabilityAnnotationsConfiguration

 #KT-21982 Fixed
2018-01-10 17:02:46 +03:00
Simon Ogorodnik
40706de3db Add ability to resolve kdoc links from package view 2018-01-10 16:37:07 +03:00
Alexey Sedunov
75ce68197f Configuration: Fix API version UI update on language version change
#KT-21979 Fixed
 #KT-21980 Fixed
2018-01-10 16:24:30 +03:00
Alexey Sedunov
9d1fbbd1c6 Move: Correctly determine target module for deferred files 2018-01-10 16:24:28 +03:00
Alexey Sedunov
253c5f2d9b Gradle: Compile Gradle models/model builders for plugins under JVM 1.6
This prevents imports failure in projects using older versions of Gradle
2018-01-10 16:24:27 +03:00
Alexey Sedunov
258bd1e8c0 Maven: Fix <args> parsing on import to the Kotlin facet
#KT-22153 Fixed
2018-01-10 16:24:25 +03:00
Ilya Chernikov
6f135e89d7 Make daemon starting more tolerant to the failures - retry
(cherry picked from commit 386cfec)
2018-01-10 13:38:20 +01:00
Ilya Gorbunov
c8bd623d69 Samples: add some operations to do with the constructed ranges 2018-01-10 15:32:51 +03:00
kenji tomita
4cb2b12f01 Add samples for range construction operators 2018-01-10 15:32:50 +03:00
Andre Perkins
31d650a041 Add sample for emptySet 2018-01-10 15:32:50 +03:00
Jake Wharton
11696ac4c0 Implement String.toBoolean() for JS.
#KT-16348
2018-01-10 15:32:49 +03:00
Dmitry Jemerov
86c10b635a Initial implementation of method separators
#KT-13029 Fixed
2018-01-10 13:17:33 +01:00
Dmitry Jemerov
fd01351740 Implement display of code construct start for Kotlin
#KT-20470 Fixed
2018-01-10 13:17:33 +01:00
Dmitry Jemerov
968e6ecde4 KotlinPairMatcher: convert to .kt
(cherry picked from commit 0bc4f26)
2018-01-10 13:17:33 +01:00
Dmitry Jemerov
0c429857de KotlinPairMatcher: rename to .kt
(cherry picked from commit e386c35)
2018-01-10 13:17:33 +01:00
Nicolay Mitropolsky
4a4bf5635d Uast: KtLightAnnotation converting support (KT-21702) 2018-01-10 15:12:12 +03:00
Dmitry Jemerov
99a9634609 Don't generate references to eap-1.1 and eap-1.2 repositories
Now all Kotlin EAP releases are published only to kotlin-eap on Bintray
2018-01-10 12:13:02 +01:00
Dmitry Petrov
5ffd6a737e Closures in scripts have outer expression
#KT-22029 Fixed Target versions 1.2.30
2018-01-10 14:08:56 +03:00
Dmitry Petrov
d25ebadf53 Minor: formatting 2018-01-10 14:08:56 +03:00
Dmitry Jemerov
e80dae1802 Update copyright in generated tests 2018-01-10 11:55:28 +01:00
Dmitry Jemerov
5ec5807399 TestGenerator: J2K 2018-01-10 11:20:57 +01:00
Dmitry Jemerov
993db696ec TestGenerator: rename to .kt 2018-01-10 11:19:25 +01:00
Dmitry Jemerov
da678a4be2 Use new JRE chooser in Kotlin script run configuration 2018-01-09 18:43:21 +01:00
Dmitry Jemerov
ebc9c217c1 Get rid of PluginJetFilesProvider, use a more sane impl instead 2018-01-09 18:43:20 +01:00
Dmitry Jemerov
685d38218d Extension point for detecting build system type used in project
Now we use a non-deprecated way to detect Maven modules
2018-01-09 18:43:19 +01:00
Dmitry Jemerov
0ca2117ac7 Remove the usages of some of the deprecated APIs 2018-01-09 18:43:11 +01:00
Dmitry Jemerov
361824e170 Fix HighlightingTestGenerated and LambdaImplicitHintsTest 2018-01-09 18:04:39 +01:00
Dmitry Jemerov
8c7f57ca83 Honor "Use continuation indent in argument lists" for indent by Enter
#KT-22121 Fixed
2018-01-09 15:41:21 +01:00
Dmitry Jemerov
d79ac58340 Refactoring: replace WrappingStrategy interface with lambda 2018-01-09 15:41:20 +01:00
Dmitry Jemerov
67897d9b3d Don't wrap argument list containing anonymous functions
Just like for objects and lambdas, don't consider line breaks inside
anonymous functions as line breaks inside argument list
2018-01-09 15:41:18 +01:00
Dmitry Jemerov
a5cc9809ac Improved logic for chained lambda indentation
#KT-22071 Fixed
2018-01-09 15:41:17 +01:00
Dmitry Jemerov
54c262c505 Use receiver type of extension members as qualifier in Goto Symbol
#KT-17217 Fixed
2018-01-09 15:41:15 +01:00
Dmitry Jemerov
0104ed7d44 Show line marker navigation actions in Alt-Enter menu
#KT-14951 Fixed
2018-01-09 15:41:09 +01:00
Dmitry Jemerov
63af3c8e03 Delegate Ctrl-Shift-Enter to plain handler if needed
#KT-11503 Fixed
2018-01-09 15:32:22 +01:00
Dmitry Jemerov
f36f85f55c Don't require documentation in test sources
#KT-21837 Fixed
2018-01-09 13:54:56 +01:00
Dmitry Jemerov
165ac97c4b SortModifiersInspection detects modifiers before annotations
#KT-22013 Fixed
2018-01-09 13:54:56 +01:00
Dmitry Jemerov
408c753837 Check that a file with .kt extension is actually a KtFile
#KT-22111 Fixed
2018-01-09 13:54:56 +01:00
Dmitry Jemerov
69c8da7403 Cleanup: apply all inspection quickfixes 2018-01-09 13:54:56 +01:00
Dmitry Jemerov
6f722d647f Reformat 2018-01-09 13:54:56 +01:00
Dmitry Jemerov
6299e0e941 Check correct element to determine if 'if' rbrace needs wrapping
#KT-22093 Fixed
2018-01-09 13:54:56 +01:00
Dmitry Jemerov
e9ca6a6038 Call arguments should not affect parameter names returned in MethodInfo
The parameter names are only used for blacklist filtering, and should
correspond only to the function being called; the order and number of
actually provided arguments does not matter.
2018-01-09 13:49:03 +01:00
Dmitry Jemerov
599bb878f1 Rename test to correspond to the name of code under test 2018-01-09 13:49:02 +01:00
Dmitry Jemerov
78682ac493 Respect imports when rendering class names in type hints
#KT-19524 Fixed
2018-01-09 13:49:01 +01:00
Dmitry Jemerov
45282af38b Prototype of inlay hints for suspending calls (KT-20187) 2018-01-09 13:48:31 +01:00
Dmitry Jemerov
d060203896 Don't show type hints for SAM constructors
#KT-22050 Fixed
2018-01-09 13:34:11 +01:00
Dmitry Jemerov
0991dba626 Better position of argument name hint for multiline varargs
#KT-20614 Fixed
2018-01-09 13:34:10 +01:00
Dmitry Jemerov
6c23d3a220 Show inlay hints for implicit parameters and receivers of lambdas
#KT-20533 Fixed
2018-01-09 13:34:09 +01:00
Dmitry Jemerov
da157fafdc Add inlay hints for values returned from lambdas
#KT-20067 Fixed
2018-01-09 13:34:01 +01:00
Dmitry Jemerov
e558837214 Cleanup: better function name 2018-01-08 14:41:49 +01:00
Toshiaki Kameyama
3b212558e2 KT-21949 Please add a separate Color Scheme settings for properties synthesized from Java accessors (#1458) 2018-01-08 13:04:43 +01:00
Toshiaki Kameyama
19c35ef48c KT-21213 multiline kdoc - intellij joins lines together without space (#1459)
* KT-21213 multiline kdoc - intellij joins lines together without space

* Use \n directly as a line separator #KT-21213

* Remove unused import #KT-21213
2018-01-05 15:29:11 +01:00
Dmitry Jemerov
d51dd97156 Avoid exception from DocumentImpl.setInBulkUpdate in reformat inspection
#KT-21036 Fixed
2018-01-04 19:03:55 +01:00
Toshiaki Kameyama
266b40b654 KT-21974 Editor color scheme option for Kotlin typealias names (#1457) 2018-01-04 17:39:39 +01:00
Sergey Igushkin
06903f803b (minor) Separate the Gradle annotations from CompilerArgumentAware 2018-01-03 22:14:23 +03:00
Sergey Igushkin
d881efdeb1 Improve disambiguation of subplugin option inputs
The original approach required evaluating the existing input properties
of the task. This led to evaluation of the property values, and could
execute incorrectly if the task was not properly initialized at that
moment.
The new approach fixes that by first grouping options from each
subplugin by key and then adding disambiguating index suffixes.
2018-01-03 22:14:23 +03:00
Sergey Igushkin
1be9e04797 Move conditional task caching setup into the task constructors;
Add 'kotlin.caching.enabled' flag to switch the caching for all tasks;
Rename and change semantics of cache support checks: make two instead
    of one, `isBuildCacheSupported` and `isBuildCacheEnabledForKotlin`;
Remove FileOptionKind entries that are redundant at the moment;
Improvements in BuildCacheIT.kt and other refactoring  suggestions from
    the review
    https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-1647
2018-01-03 22:14:22 +03:00
Sergey Igushkin
fd066ea4d5 Fix top-level property of an API-level-dependent class: move to the body 2018-01-03 22:14:22 +03:00
Sergey Igushkin
c5a88c5fb7 Add BuildCacheRelocationIT, remove same files testing as redundant. 2018-01-03 22:14:22 +03:00
Sergey Igushkin
6bea643176 Fix JS DCE classpath duplicated in two input properties
* Do not add the classpath elements to source to avoid them being
  treated as task inputs without proper classpath normalization
* Move resolution of the classpath configuration to execution time
2018-01-03 22:14:22 +03:00
Sergey Igushkin
67b5527c68 Fix Kotlin destination dir added to Java task without normalization.
Issue #KT-20604 Fixed
2018-01-03 22:14:22 +03:00
Sergey Igushkin
97edda44c8 Turn on relocatable build cache -- change PathSensitivity to RELATIVE 2018-01-03 22:14:22 +03:00
Sergey Igushkin
c852d0b6cb Subplugin options refactoring & Gradle input improvements
Introduce FilesSubpluginOption Special kind of SubpluginOption that
holds a list of files together with the kind of these files with respect
to the task.

Add a logic for handling such options and converting them into
task inputs.

Refactor CompilerPluginOptions: make it store subplugin options to be
able to add options from KotlinCompile to the kapt tasks.

Introduce WrapperSubpluginOption for encoded and complex options.

Remove pluginOptions from the Gradle inputs built from the
compiler args.

Do not cache Kotlin compilation with kapt1 enabled: since we are going
to drop kapt1 it anyway, there's no point in implementing
proper cache for it, so just disable the caching of the task in case
kapt1 is used.
2018-01-03 22:14:22 +03:00
Sergey Igushkin
93097014a0 Add integration tests for Gralde build cache support.
Add an up-to-date'ness test for subplugin options.
2018-01-03 22:14:21 +03:00
Sergey Igushkin
57f710c931 Explicit opt-in switch for Kapt caching. 2018-01-03 22:14:21 +03:00
Sergey Igushkin
7ee3b81939 Add Kotlin sources output as a separate output directory for kapt. 2018-01-03 22:14:21 +03:00
Sergey Igushkin
4a69d1545b Disable IC when IC cache is missing
Check task build directory for any files
2018-01-03 22:14:21 +03:00
Sergey Igushkin
14c80baec8 Make the tasks cacheable, add logic that decides whether to cache them 2018-01-03 22:14:21 +03:00
Sergey Igushkin
26c158cbae Annotate the properties with @PathSensitive (+ override source) 2018-01-03 22:14:21 +03:00
Sergey Igushkin
e46b56acbc Add @LocalState of buildServicesWorkingDir to KotlinCompile 2018-01-03 22:14:21 +03:00
Sergey Igushkin
627fe52858 Map compiler arguments to Gradle inputs. 2018-01-03 22:14:20 +03:00
Sergey Igushkin
a8ba8fbf77 Make pluginOptions.classpath a separate input in the Gradle tasks
(cherry picked from commit b03e758)
2018-01-03 22:14:20 +03:00
Sergey Igushkin
a752d30f12 Move CompilerArgumentAware to the <...>.internal package. 2018-01-03 22:14:20 +03:00
Sergey Igushkin
62f2876230 Refactor compiler arguments in Gradle tasks:
Pull create/setup args functions up to CompilerArgumentsAware interface
Remove diamond-shaped CompilerArgumentsAware inheritance
Provide the default implementation for serialization in the interface
Make KotlinJsDce implement CompilerArgumentsAware
Implement the compiler args logic for Kapt & GenerateStubs tasks
2018-01-03 22:14:20 +03:00
Toshiaki Kameyama
6b2c22aff1 Add intention to specify all types explicitly in destructuring assignment
#KT-16260 Fixed
2018-01-03 17:23:31 +01:00
Dmitry Jemerov
3529d61a7d Exclude generated test classes from language statistics 2018-01-03 14:57:01 +01:00
Toshiaki Kameyama
eb12cfd444 KT-18674 Join Lines should join strings (#1305)
* Join Lines should join strings #KT-18674 Fixed

* #KT-18674 Fixed
2018-01-03 11:27:16 +01:00
Toshiaki Kameyama
16695c1af5 KT-21929 Inappropriate quick fix for a sealed class instantiation (#1444) 2018-01-03 11:20:58 +01:00
Toshiaki Kameyama
de185b79d0 KT-21780 Wrong redundant setter inspection (#1453) 2018-01-03 11:14:23 +01:00
Toshiaki Kameyama
640c28ceaf KT-14670 Support kotlinPackageName() macro in live templates (#1455)
* KT-14670 Support kotlinPackageName() macro in live templates

* Use context.psiElementAtStartOffset.containingFile #KT-14670
2018-01-03 10:41:28 +01:00
Dmitry Jemerov
84d63051f9 Add a rule for invalid characters in names 2018-01-02 13:17:31 +01:00
Dmitry Jemerov
f83c5344d7 Apply same style for top-level and object properties
#KT-20437 Fixed
2018-01-02 12:46:03 +01:00
Dmitry Jemerov
1c7d97289b Naming convention inspection for test functions
#KT-21547 Fixed
2018-01-02 12:46:02 +01:00
Dmitry Jemerov
37d2ff2d4d Report more friendly messages from naming conventions inspection
#KT-19736 Fixed
2018-01-02 12:46:01 +01:00
Dmitry Jemerov
429bf5bb98 Reformat 2018-01-02 12:46:00 +01:00
Toshiaki Kameyama
79ff36592d KT-15320 Live templates: please add function which returns the "outer" class name 2018-01-02 12:35:20 +01:00
Ilya Gorbunov
e2306ecf94 Keep exception primary constructors for binary compatibility in JS
Resort to a workaround for KT-22053 in direct Throwable inheritors.
2017-12-29 21:21:20 +03:00
Ilya Gorbunov
3825187e93 Update expected reachable node count 2017-12-29 21:20:59 +03:00
Ilya Gorbunov
a1f67e347f Relax nullability of UninitializedPropertyAccessException constructor parameters
To make it consistent with other exception types
2017-12-29 21:16:17 +03:00
Ilya Gorbunov
4e26ca5659 Add missing exception constructors to common and JS declarations
Add test to validate exception properties after calling various constructors.

Make NumberFormatException a descendant of IllegalArgumentException in all platforms.

#KT-21861 Fixed
#KT-21191 Fixed
2017-12-29 21:16:17 +03:00
Ilya Gorbunov
496df371f4 Provide the guide for sample authoring 2017-12-29 20:42:46 +03:00
Pavel V. Talanov
03a8ce63b2 Scripts: fix any file deletion potentially leading to reindex 2017-12-29 20:14:59 +03:00
Dmitry Jemerov
25ea53457e Send source code in exceptions as attachments, not text (common cases)
#KT-17678 In Progress
2017-12-29 15:35:53 +01:00
Toshiaki Kameyama
817dadc120 Specify type: do not suggest nullable type if not null is overridden
So #KT-12814 Fixed
2017-12-29 17:28:44 +03:00
Mikhail Glukhikh
50eaca1ac4 Add modifier fix: improve style a bit 2017-12-29 17:17:38 +03:00
Toshiaki Kameyama
184651d366 Do not suggest "add inner" quick fix for interfaces etc. #KT-18396 Fixed 2017-12-29 16:43:47 +03:00
Toshiaki Kameyama
84a6ef6ac4 Add inspection to detect is checks for object types #KT-21741 Fixed 2017-12-29 16:24:18 +03:00
Dmitry Jemerov
247881baf9 Apply style guide and enable reformat inspection 2017-12-29 13:51:53 +01:00
Mikhail Glukhikh
0df3ffbe36 Build fix: convert reference to lambda
Related to KT-19283 (fixes mistake in 3f005924)
2017-12-29 14:36:10 +03:00
Dmitry Jemerov
896246a7f5 More cleanup after J2K 2017-12-29 10:19:50 +01:00
Dmitry Jemerov
d0e8e176c4 Catch exceptions from decompiler service
EA-108937 - RE: InvocationExprent.toJava
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
9a61abfb9f Don't add null module info to list
EA-113650 - TCE: LazyModuleDependencies.getModulesWhoseInternalsAreVisible
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
2c4180222a Check if containing file is KtFile
EA-109460 - CCE: KtElementImplStub.getContainingKtFile
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
4b6efe3eb0 Take read action in KtLightParameter.isEquivalentTo()
EA-109775 - (OperatorReferencesSearcher) assert: PsiFileImpl.getStubTree
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
7f1dd88600 KtLightParameter: convert to .kt and cleanup 2017-12-29 10:19:50 +01:00
Dmitry Jemerov
98d26ae59f KtLightElementParameter: rename to .kt 2017-12-29 10:19:50 +01:00
Dmitry Jemerov
cde84a7923 Handle I/O exceptions when updating library jars
EA-101940 - FNFE: FileUtil.openOutputStream
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
254f766aaf Take longer read action in forEachKotlinOverride()
EA-114124 - assert: CompositeElement.getChildrenAsPsiElements
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
768fce4722 Check for project disposed when reporting outdated libraries
EA-106858 - assert: ComponentManagerImpl.getPicoContainer
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
cc2faa67f9 Don't pass null element to RefactoringFactory.createRename()
EA-114286 - IAE: RenameProcessor.$$$reportNull$$$
2017-12-29 10:19:50 +01:00
Dmitry Jemerov
9a156541c1 Don't try to read attribute for files with no ID
(EA-114351 - CCE: PersistentFSImpl.getFileId)
2017-12-29 10:19:50 +01:00
Toshiaki Kameyama
5e765c525e Do not suggest quickfix 'Specify type explicitly' with existing type
So #KT-15180 Fixed
2017-12-28 21:06:48 +03:00
Mikhail Glukhikh
5475f99cec Elvis -> if-then: handle case with safe cast separately #KT-17816 Fixed 2017-12-28 20:31:55 +03:00
Mikhail Glukhikh
ec60c92fe9 Lambda -> reference: build bound reference for complex qualified
So #KT-19073 Fixed
2017-12-28 20:31:53 +03:00
Mikhail Glukhikh
73bca21f94 Allow using add modifier quick-fixes in batch mode #KT-21950 Fixed 2017-12-28 20:31:47 +03:00
Mikhail Glukhikh
2e71691ab2 Fix potential leak in "unused lambda expression body" fix 2017-12-28 20:31:45 +03:00
Mikhail Glukhikh
8e23ca597d Add extra tests for KT-20429, simplify code a bit 2017-12-28 20:31:44 +03:00
Toshiaki Kameyama
a65304556c CFG: provide "used as expression" in enum constant constructor
This allows to avoid
"unused return value of a function with lambda expression body"
for such a situation
So #KT-20429 Fixed
2017-12-28 20:31:42 +03:00
Mikhail Glukhikh
e10fa218f5 Extend range of "use expression body" to left brace..end of return
Range is extended iff we are in DO_NOT_SHOW case,
otherwise just return is highlighted to avoid ugly highlighting
So #KT-19771 Fixed
2017-12-28 20:31:41 +03:00
Mikhail Glukhikh
95e7d29743 Minor: improve style in "operator to function" 2017-12-28 20:31:40 +03:00
Toshiaki Kameyama
52df70a576 Do not suggest replacing comparison to null with function call
So #KT-20620 Fixed
2017-12-28 20:31:38 +03:00
Mikhail Glukhikh
d7807b5ae3 Do not report "redundant Unit return type" on expression bodies
So #KT-21983 Fixed
2017-12-28 20:31:37 +03:00
Mikhail Glukhikh
232ec63121 Inline dialog: handle case with unknown occurrence number correctly
So #KT-21963 Fixed
2017-12-28 20:31:36 +03:00
Mikhail Glukhikh
947e853d9e Inline dialog: show "inline all and keep" for occurred once declarations
So #KT-21964 Fixed
2017-12-28 20:31:35 +03:00
Mikhail Glukhikh
d5bb7e457e Inline dialog: unify messages with each other #KT-21965 Fixed 2017-12-28 20:31:33 +03:00
Mikhail Glukhikh
3f00592443 Do not suggest "convert ref to lambda" for reflect types #KT-19283 Fixed 2017-12-28 20:31:27 +03:00
Mikhail Glukhikh
fc93e7a727 Do not report "redundant suspend" on override / open #KT-21938 Fixed 2017-12-28 20:31:24 +03:00
Sergey Igushkin
276a6acc3e Use .withDependencies { ... } to set up default versions with Gradle 4.4
+ Improve the test for omitted Kotlin module versions.

Issues: #KT-21806 Fixed, #KT-21203 Fixed
2017-12-28 19:47:02 +03:00
Vyacheslav Gerasimov
8b7a8f7bef Update changelog for 1.2.20 2017-12-28 16:15:54 +03:00
Dmitry Jemerov
fc51673c83 Update copyright profile 2017-12-28 10:47:43 +01:00
Ilya Chernikov
efc470df2b Reading KOTLIN_HOME only once
may fix #KT-21145, or at least make it less flaky
2017-12-28 09:43:44 +01:00
Ilya Chernikov
945da50b61 Add kotlin-compiler-client-embeddable to the plugin's lib since...
it's used in the `KotlinJsr223JvmScriptEngine4Idea`
Fixes #KT-18613
2017-12-28 09:43:43 +01:00
Vyacheslav Gerasimov
6116b5c497 Update coroutines version to 0.20 2017-12-28 00:35:15 +03:00
Ilya Gorbunov
042f81f23b Fix Volatile usages in common and JS code 2017-12-27 21:55:24 +03:00
Ilya Gorbunov
a33a3867b8 JS: Move declaration to match their packages in JVM and Common stdlib
Mostly internal, but also two public annotations
2017-12-27 21:55:24 +03:00
Ilya Gorbunov
d2eb8b4a3f Do not compile SynchronizedLazyImpl for platforms other than JVM 2017-12-27 21:55:24 +03:00
Ilya Gorbunov
b6595d661d Improve expect declarations in kotlin.text
- Replace overloads with default parameters in expect declarations by suppressing errors
- Remove meaningless inline modifier
2017-12-27 21:55:24 +03:00
Ilya Gorbunov
824b506abe Remove inheritance between LinkedHashSet/Map and HashSet/Map 2017-12-27 21:55:24 +03:00
Ilya Gorbunov
c5c6eed170 Make common ArrayList declaration not open and implementing RandomAccess 2017-12-27 21:55:24 +03:00
Ilya Gorbunov
fb13347864 Extract kotlin.collections expect classes into separate files
Add missing expect declarations for AbstractMutableMap/Set.
2017-12-27 21:55:24 +03:00
Ilya Gorbunov
93ef16deaf Move expect declarations to the appropriate packages
So that they match actual declarations in Kotlin/JVM stdlib.
2017-12-27 21:55:24 +03:00
Pavel V. Talanov
dd32c4e66a Revert minor semantic differences introduced in c030a047aa
Fix 'pull members up' and 'kotlin injected into kotlin' tests
2017-12-27 20:24:26 +03:00
Anton Bannykh
2df85ae4a9 kotlin-test-js: pass test function result to test framework (e.g. Promise) 2017-12-27 19:57:49 +03:00
Anton Bannykh
3e0d83b7d1 Make :js:npm a separate project to avoid calling update_dependencies 2017-12-27 17:35:34 +03:00
Alexander Udalov
129fad6ade Minor, merge two KotlinCoreEnvironment-creating functions 2017-12-27 14:50:04 +01:00
Alexander Udalov
613297ad60 Rename ModuleScriptData -> ModuleChunk and refactor related code
Use the term "build file" instead of the old "module"/"module script"
2017-12-27 14:50:03 +01:00
Alexander Udalov
f3f8db989a Fix test data for annotations on DefaultImpls members
After ea5505f80c, the annotations are now generated correctly
2017-12-27 14:12:14 +01:00
Chris Povirk
ac87ad422d Recognize Checker Framework declaration annotations.
We are migrating Guava to use these annotations rather than jsr305's
@Nullable. We can't use the Checker Framework's _@Nullable_ yet because
we promise compatibility with Java 7, which doesn't support type
annotations. This is related to but distinct from
https://youtrack.jetbrains.com/issue/KT-21408, which is about a
different jsr305 annotation we use, @ParametersAreNonnullByDefault.

I've also updated some docs to mention Kotlin's existing support for the
Checker Framework _@NonNull_.
2017-12-27 13:23:06 +01:00
Anton Bannykh
79359b7bc2 JS: test kotlin-test as box tests, support nested, fix mpp
Support tests inside nested classes and companion objects (KT-21850
fixed).
Don't launch multiplatform tests twice (KT-21567 fixed).
2017-12-27 15:22:26 +03:00
Nikolay Krasko
3bf8436895 Fix licence check after "jetbrains/kotlin/idea/copyright" package move 2017-12-27 13:44:55 +03:00
Nikolay Krasko
b7ff00ec34 Remove author tag from JavaSdkUtil to fix CodeConformanceTest 2017-12-27 13:27:59 +03:00
Nikolay Krasko
419abadcda Search for Kotlin sources in project too in fallback scope
When debugging in Gradle or Maven we may miss debug scope completely,
but still want to be responsible for building source positions for all
Kotlin source files (other PositionManagers may produce unexpected
results).
2017-12-27 01:09:53 +03:00
Ilya Gorbunov
f468990f97 Add racing version of each Lazy test
Run several concurrent accesses to a lazy value
many times and validate invariants.
2017-12-26 23:14:11 +03:00
Ilya Gorbunov
4827aadcfd Improve stability of lazy test, make some tests take less time 2017-12-26 23:14:09 +03:00
Ilya Gorbunov
934b3cc54e Do not read volatile _value field second time it is already initialized 2017-12-26 23:14:07 +03:00
Ilya Gorbunov
5d62277fa5 Make SafePublicationLazyImpl.initializer volatile
This establishes happens-before relation between nulling out the initializer and
checking whether it is null. This will prevent the subsequent _value reads
being reordered before the initializer reads.

#KT-21868 Fixed
2017-12-26 23:13:14 +03:00
Sergey Igushkin
685b138f79 (minor) Fix testAndroidExtensionsIncremental() ambiguous file operation 2017-12-26 21:38:15 +03:00
Sergey Igushkin
01931c2ae6 Fix Kotlin internal files created in 'build/' ignoring custom buildDir
Issue #KT-10537 Fixed
2017-12-26 21:38:15 +03:00
Ilya Chernikov
953a485fe7 Increment repl line generation on compilation error
fixes #KT-17921 and #KT-21141
Tests added to the JSR223 local eval example
2017-12-26 19:27:32 +01:00
Ilya Chernikov
2d8e73f3f6 Make JSR 223 examples compatible with embeddable compiler, strip ...
some dependencies.
Fixes #KT-17561 and related issues
Warning: API changed slightly
2017-12-26 19:27:31 +01:00
Sergey Igushkin
d51b17c1b2 Fix @OutputFile annotation on a String property outputFile. 2017-12-26 20:29:45 +03:00
Sergey Igushkin
9d1091cdaa Add java-gradle-plugin for kotlin-gradle-plugin tasks validation;
Make task properties validation fail on warnings; run it during IT
2017-12-26 20:29:45 +03:00
Sergey Igushkin
7031087a93 Mark Gradle task properties with input/output annotations. 2017-12-26 20:29:45 +03:00
Sergey Igushkin
d62ced3a82 Compile against gradleApi() 2017-12-26 20:29:45 +03:00
Mikhail Glukhikh
72ec55769b Improve wording for "change package" fix for source root case 2017-12-26 18:39:51 +03:00
Mikhail Glukhikh
429c31c010 Improve wording in some inspections 2017-12-26 18:39:51 +03:00
Mikhail Glukhikh
1534488dd1 Test minor: output all available fixes in local inspection tests 2017-12-26 18:39:51 +03:00
Mikhail Glukhikh
2f987f08fa Forbid word 'can' in local inspections with level > INFORMATION
Inspection texts were changed accordingly
2017-12-26 18:39:51 +03:00
Mikhail Glukhikh
56230420f8 AbstractApplicabilityBasedInspection: move visitor inside base class 2017-12-26 18:39:51 +03:00
Mikhail Glukhikh
3268189215 Cache intention inside IntentionBasedInspection
So intention is created only once.
Case with multiple intentions is no more allowed.
So #KT-21137 Fixed
2017-12-26 18:39:50 +03:00
Mikhail Glukhikh
5affb9a25c Refactoring: "package matching directory" is now an inspection 2017-12-26 18:39:50 +03:00
Mikhail Glukhikh
3f1a3dfeb2 Refactoring: make "loop to call chain" AbstractKotlinInspection 2017-12-26 18:39:50 +03:00
Mikhail Glukhikh
f44fba746e Refactoring: make "unnecessary variable" inspection applicability-based 2017-12-26 18:39:50 +03:00
Mikhail Glukhikh
221aac9820 J2K registerInspectionBasedProcessing: use correct target for applyTo 2017-12-26 18:39:50 +03:00
Mikhail Glukhikh
5a1a35bb35 Refactoring: "replace put with assignment" is now applicability-based 2017-12-26 18:39:49 +03:00
Mikhail Glukhikh
9e919829c8 Refactoring: "simplify assert not null" is now an inspection 2017-12-26 18:39:49 +03:00
Mikhail Glukhikh
8ebe16c9b2 Minor: reformat XML 2017-12-26 18:39:49 +03:00
Mikhail Glukhikh
bc361363d5 Refactoring: "simplify negated binary expression" is now an inspection 2017-12-26 18:39:49 +03:00
Mikhail Glukhikh
35d85ddd1f Refactoring: "replace with operator assignment" is now an inspection 2017-12-26 18:39:49 +03:00
Mikhail Glukhikh
c995f70631 J2K processing: simplify (minor) 2017-12-26 18:39:48 +03:00
Mikhail Glukhikh
6b5aeaa9a6 J2K inspection-based processing: use more accurate isApplicable
Information level is taken into account in both base and pre-fix
isApplicable calls
2017-12-26 18:39:48 +03:00
Mikhail Glukhikh
ada7287c66 Refactoring: make "replace call with binary operator" an inspection 2017-12-26 18:39:48 +03:00
Mikhail Glukhikh
6d4b5bc48f Refactoring: "introduce when subject" is now an inspection 2017-12-26 18:39:48 +03:00
Mikhail Glukhikh
a8b01a6b00 Refactoring: make "if-then to safe access" an inspection 2017-12-26 18:39:47 +03:00
Mikhail Glukhikh
91bcfb97c6 Refactoring: make "replace get or set" an inspection 2017-12-26 18:39:47 +03:00
Mikhail Glukhikh
756cb32eaf Refactoring: make "replace array equality ..." an inspection 2017-12-26 18:39:47 +03:00
Mikhail Glukhikh
33d94cd5e1 J2kPostProcessing: add inspection-based processing #KT-21635 Fixed 2017-12-26 18:39:46 +03:00
Mikhail Glukhikh
67b78bce39 Introduce AbstractApplicabilityBasedInspection
Related to KT-21635, KT-21137
2017-12-26 18:39:46 +03:00
Nikolay Krasko
bf393505a9 More nullability update in selectors for compatibility in 181 2017-12-26 17:37:38 +03:00
Nikolay Krasko
e66e8bcd07 Use platform types to prepare for nullability check in 181 2017-12-26 17:08:11 +03:00
Joscha Alisch
809cc220ed Select lambda after other args when it's outside argument list (KT-21214)
#KT-21214 Fixed
2017-12-26 13:09:17 +03:00
Nikolay Krasko
976a158ce1 Support alternative source popup for Kotlin files (KT-21958)
#KT-21958 Fixed
2017-12-26 12:49:27 +03:00
Nikolay Krasko
449fee74e8 Skip all same line locations when stepping over inline call (KT-20351)
#KT-20351
2017-12-26 12:46:45 +03:00
Nikolay Krasko
f39250c9a2 Fix irrelevant additional stops on breakpoint on line with inlines (KT-21945)
#KT-21945 Fixed
2017-12-26 12:46:45 +03:00
Nikolay Krasko
f38a4f509d Minor: code rearrange 2017-12-26 12:46:45 +03:00
Nikolay Krasko
c5886bc7a2 Remove sleep() from soSuspendableCallInEndOfFun and guarantee suspending 2017-12-26 12:46:45 +03:00
Ilya Gorbunov
10639eaf6a Add pattern and options properties to common Regex
And add a test that accesses them and checks they work as expected.
2017-12-26 05:40:37 +03:00
Ilya Gorbunov
d9edc5f221 Replace Regex constructor-like functions with secondary constructors
Historically secondary constructors were not supported in Kotlin/JS, so they had to
be emulated with constructor-like top level functions, now they can be rewritten
as true secondary constructors.

#KT-22003 Fixed
2017-12-26 05:40:35 +03:00
Ilya Gorbunov
053f3b6ac0 Tests: use helper function to assert compile-time and run-time type check
To cleanup warnings about useless cast or type check that is always true.
2017-12-26 04:55:44 +03:00
Ilya Gorbunov
ecd42f14b3 Compile common stdlib tests against common stdlib
Declare platform-specific test utilities as expect.
2017-12-26 04:55:40 +03:00
Pavel V. Talanov
c030a047aa Fix getting ModuleResolver by element for script files
Fixes EA-105435 (some isntances)
JavaResolveExtension: refactor API
2017-12-25 20:12:51 +03:00
Pavel V. Talanov
2af0bf4c71 Drop JsProjectDetector
It leads to undesired behaviour
    such as returning library source when only binaries are queried
It is redundant since js libraries do not include kotlin source files
    (real binary format is used for this purpose for along time now)
2017-12-25 20:12:48 +03:00
Pavel V. Talanov
6551ee5403 Test completion in script files
Test for 'JavaResolutionUtils.getJavaDescriptorResolver' failing with AE
Tests ebd3ac6dc8
See EA-105435
2017-12-25 20:12:46 +03:00
Sergey Igushkin
149b197b24 Fix unconditional warning in JS compilation with sourceMap disabled. 2017-12-25 15:30:01 +03:00
Sergey Igushkin
66d3c94193 Fix both moduleFile and destination passed to the compiler
when it is run not in daemon from Gradle; don't pass the destination in
such case.

Issue #KT-21637 Fixed
2017-12-25 15:29:34 +03:00
Sergey Igushkin
00d7150944 Fix warning check in tests:
* Fix the regex that could not actually find warnings
* Suppress an unused parameter warning in the test project
* Add allWarningsAsErrors to ExecutionStrategyIT
2017-12-25 15:28:33 +03:00
Sergey Igushkin
41086f26ae Fix duplicate classpath entry in JS Gradle compilation causing warnings
Issue #KT-21943 Fixed
2017-12-25 15:15:54 +03:00
Nikolay Krasko
93e7e9b28c Minor: regenerate tests 2017-12-22 17:06:12 +03:00
Alexey Tsvetkov
d7edbb8dfc Track changes in inline function when friend paths are disabled in JS 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
a4d122478b Replace testCancelLongKotlinCompilation with less flaky test 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
ee94a64718 Explicitly request rebuild when untracked java file is removed
Previously a rebuild was happenning because FileNotFoundException
was thrown when getting psiFile of removed file.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
61cb39a600 Include tests from incremental-compilation-impl in compiler tests 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
50bf74b909 Turn off class redeclaration test for JS IC temporarily
So the tests could be run on TC.
Turn on after KT-19846 is fixed.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
5b646ba4fa Generate source maps in JS IC tests
#KT-21700 fixed
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
0fee7883ed Recompile only files from last iteration after compile error 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
3914c1b0e9 Allow to edit non-JPS build logs in "Show difference" window for non-JPS IC tests 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
ff2e3ecfc4 Add JS specific IC build log in test
JS IC compares proto using a source file path as a key,
so moving file causes recompilation of its usages
unlike JVM IC that uses a class file path as a key.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
7712044146 Fix IC test build log diverged from JPS
JPS marks dirty direct usages of removed classes since 172.* before a build.
Generic IC also marks dirty all subclasses and their usages.
That is necessary because a method from a removed class could be used
through a subclass.
JPS and generic IC logs diverged in 172 branch, but non-JPS tests
were not run on CI.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
ad1978940b Recompile inline function usages in JS when offset is changed
Otherwise source maps would differ after rebuild
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov
a31f503fa5 Recompile all subclasses of removed classes 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
e8162cd99d Unify processing of removed files for JS and JVM IC 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
d0ca0dca2b Avoid processing incremental changes after first build for JVM 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
91bb57c5a3 Make general IC logs similar to JPS IC logs 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
fec2d08d22 Compile actual and expected declarations together
#KT-20840 fixed
2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
123fd64a34 Fix stdlib usages in IC tests
* Use stdlib from dist
* Check that stdlib exists
* Don't add stdlib for JS, because compiler adds one by default
(stdlib would be read twice which is slow)
2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
e3a9ad5a74 Minor: remove unused variable 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov
dfe176efca Avoid computing source files changes in IC for Gradle 2017-12-22 16:12:19 +03:00
Nikolay Krasko
5a8c0f8f42 Minor: fix compile error in test data 2017-12-22 15:27:11 +03:00
Toshiaki Kameyama
9fad40b586 KT-21928 Structure view doesn't show default constructor 2017-12-22 15:27:10 +03:00
Dmitry Jemerov
3178dee759 Insert line break before elvis when converting if to elvis
This ensures correct indentation
2017-12-22 10:35:23 +01:00
Dmitry Jemerov
6208c69c72 Add option for wrapping closing paren in multiline if conditions 2017-12-22 10:35:23 +01:00
Dmitry Jemerov
7711f8e3a7 Add predefined code style for Kotlin style guide 2017-12-22 10:35:23 +01:00
Dmitry Jemerov
d69382f129 Don't apply indent on Enter after modifier list
#KT-9562 Fixed
2017-12-22 10:35:23 +01:00
Dmitry Jemerov
43ef113b7a Correctly apply annotation wrap before modifier keyword
#KT-20314 Fixed
2017-12-22 10:35:22 +01:00
Dmitry Jemerov
fa19bd6d9b Apply indent of continuation call start to its children
#KT-15099 Fixed
2017-12-22 10:35:22 +01:00
Dmitry Jemerov
5652fa762f Force no line break after dot in chained calls
#KT-20362 Fixed
2017-12-22 10:35:22 +01:00
Dmitry Jemerov
06fa61bb6f Line breaks in objects and lambdas don't trigger call paren wrapping
#KT-19727 Fixed
2017-12-22 10:35:22 +01:00
Dmitry Jemerov
79a509df7b Option to apply normal indent to children of 'if' expressions 2017-12-22 10:35:21 +01:00
Dmitry Jemerov
640bf22e4f Refactoring: extract 'continuationIf' method 2017-12-22 10:35:21 +01:00
Dmitry Jemerov
44ee228ac9 Don't wrap parentheses in long argument list containing only object 2017-12-22 10:35:21 +01:00
Dmitry Jemerov
a2175c2ef5 KotlinFormattingModelBuilder: J2K 2017-12-22 10:35:21 +01:00
Dmitry Jemerov
57844968b0 KotlinFormattingModelBuilder: rename to .kt 2017-12-22 10:35:20 +01:00
Mikhael Bogdanov
ea5505f80c Generate annotations in proper order in DefaultImpls 2017-12-22 10:02:04 +01:00
Mikhael Bogdanov
c9d0ab38cf Generate proper java parameter names for DefaultImpls
#KT-21919 Fixed
2017-12-22 10:02:04 +01:00
Alexander Podkhalyuzin
12a8048bf7 Fixed exception reporting in Kotlin plugin and IDEA releases 2017-12-22 11:33:36 +03:00
Sergey Igushkin
a88206c5ea (minor) Fix platform-dependent line separators in source maps test 2017-12-21 20:49:58 +03:00
Ilya Gorbunov
94a0e508d9 Use empty array instead of presized for Collection.toArray
#KT-21918
2017-12-21 20:10:28 +03:00
Alexander Podkhalyuzin
8203d1c3fe Extracted Kotlin.JVM IDE into separate module
This change is required to have possibility to build plugin against
minor IDEs, which don't have Java. So we want to extract idea-jvm
2017-12-21 18:34:02 +03:00
Alexander Podkhalyuzin
2bb02beb84 Do not report exceptions/errors in very specific case
In IDEA special property can be used for that, Kotlin plugin should honor that
2017-12-21 18:34:00 +03:00
Alexander Podkhalyuzin
5e21dc5560 Removed non ASCII char to reduce pain in compilation. 2017-12-21 18:34:00 +03:00
Ilmir Usmanov
c8904b1c7c Replace POP with ARETURN if it pops Unit and ARETURN shall return Unit
#KT-16880: Fixed
2017-12-21 18:08:39 +03:00
Toshiaki Kameyama
2cdc246a27 Inspection to highlight usages of Collections.sort() and replace them with .sort() method from Kotlin stdlib
#KT-11023 Fixed
2017-12-21 15:05:48 +01:00
Alexey Sedunov
4ac870500f Minor: Fix test data 2017-12-21 16:01:29 +03:00
Emmanuel Duchastenier
a8ddf03b53 README: IntelliJ IDEA 2017.3 is not early access anymore
update README.md with direct download link to IntelliJ IDEA latest version
2017-12-21 13:51:24 +01:00
Nikolay Krasko
e6aeb66875 Sort files according to given scope in debugger (KT-21931)
#KT-21931 Fixed
2017-12-21 15:46:28 +03:00
Nikolay Krasko
7c73356893 Early exit from getSourcePosition() for non-kotlin source files 2017-12-21 15:46:28 +03:00
Mikhael Bogdanov
50608d0844 Don't delete nested default lambda classes during inline transformation 2017-12-21 12:52:29 +01:00
Mikhael Bogdanov
b65dcf27ee Provide test source mapping data for separate and non-separate compilation
Compilation in same module or in separate ones
2017-12-21 12:52:28 +01:00
Mikhael Bogdanov
f4f7c83eeb Copy nested objects of default lambda during inline 2017-12-21 12:52:28 +01:00
Mikhael Bogdanov
3513f1a86a Properly process default lambda source mapping
#KT-21827 Fixed
2017-12-21 12:52:27 +01:00
Nicolay Mitropolsky
657123f2c0 LightClassUtil.extractPropertyAccessors refactoring to fix KotlinShortNamesCacheTest.testGetMethodsByNameWithCustomPropertyAccessors test
After light classes caching the test started to fail.
 Also refer Simon Ogorodnik.
2017-12-21 12:25:51 +03:00
Sergey Igushkin
710c726c9a Improve kapt arguments & javac options usability with Kotlin DSL
Issue #KT-21596 Fixed
2017-12-20 20:49:30 +03:00
Toshiaki Kameyama
411feab9ae KT-21698 Create interface shouldn't suggest to declare it inside a class which implements it 2017-12-20 18:14:55 +01:00
Vyacheslav Gerasimov
1deed28464 Add missing changelog for [1.2.20 - 1.1.60] versions 2017-12-20 19:10:26 +03:00
Pavel V. Talanov
aec893180e Minor, JvmAnalyzerFacade: drop logging
Prevent log spam
2017-12-20 17:19:09 +03:00
Dmitry Jemerov
78a87ac0cf Regenerate test 2017-12-20 15:03:25 +01:00
Mikhail Glukhikh
484bf0115f Fix "fake JVM field" inspection test XML 2017-12-20 16:31:10 +03:00
Kirill
7842fa4796 Support callable references in "implicit this" inspection
Second part of #KT-21510
2017-12-20 14:16:39 +03:00
Kirill
74e5a9425a Support callable references in "explicit this" inspection
So #KT-21510 Fixed
2017-12-20 14:16:33 +03:00
Dmitry Jemerov
d3adf57145 Don't apply highlighting to zero-length elements
#KT-19820 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
52ccfcecfc Fix highlighting of TODO calls in lambdas
#KT-19915 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
0159d19539 Apply rainbow highlighting in anonymous initializers
#KT-18839 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
94a7673c2d Don't show type hints for destructuring declarations with explicit type
#KT-21833 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
b0b69b2ad0 Put argument name hint before spread element
#KT-21645 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
c336159b2b Don't show argument name hints for dynamic calls.
Mark function descriptors created for dynamic calls as having
synthesized parameter names.

 #KT-21275 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
3e7e01dc4d Add mapOf() to default parameter name hints blacklist
#KT-18829 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
fd7aaa1579 Add single-arg 'assert' method to parameter name hints blacklist
#KT-17965 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
cf6b71aa05 Don't show type hint for local variable initialized with object
#KT-17964 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
77c186442a Don't show parameter name hints when calling Java methods with unknown
parameter names

 #KT-17843 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
6d63dd9d83 Enable "Configure Kotlin plugin updates" with no open project
#KT-20380 Fixed
2017-12-20 12:02:04 +01:00
Dmitry Jemerov
1a9d2ab4ee Fix name of inspection description file 2017-12-20 11:56:04 +01:00
kenji tomita
3cd4d90bf8 Use BodyResolveMode.PARTIAL and ProblemHighlightType.GENERIC_ERROR_OR_WARNING 2017-12-20 11:56:04 +01:00
kenji tomita
37351c344f code style inspection: to -> Pair function used not in infix form 2017-12-20 11:56:04 +01:00
Mikhail Glukhikh
41739602bc Inline handler: fix reference detection for properties 2017-12-20 13:54:36 +03:00
Mikhail Glukhikh
ce441e2163 Extract common class from two KotlinInline<...>Dialogs #KT-17212 Fixed 2017-12-20 13:54:30 +03:00
Mikhael Bogdanov
3e1f471121 Rollback change in 'usesDefaultArguments' 2017-12-20 10:58:35 +01:00
Mikhael Bogdanov
32b90a1cae Generate type checker barriers in bridges 2017-12-20 10:48:52 +01:00
Mikhael Bogdanov
be18cb9b16 Fix default methods visibility 2017-12-20 10:48:51 +01:00
Mikhael Bogdanov
9365d1d859 Remove redundant extra default mask for function with N*32 parameters 2017-12-20 10:48:51 +01:00
Mikhael Bogdanov
ef5c3512cd Skip FAKE_OVERRIDE fields 2017-12-20 10:48:50 +01:00
Mikhael Bogdanov
aeb74f7e70 Skip bridge generation for non real declaration on first step they would be processed later
~

~
2017-12-20 10:48:50 +01:00
Mikhael Bogdanov
4657ae06f4 Don't cast receiver to super type on super calls 2017-12-20 10:48:49 +01:00
Mikhael Bogdanov
a936f75423 Fix empty vararg processing in intrinsics 2017-12-20 10:48:49 +01:00
Mikhael Bogdanov
420b9fdaa9 Support interface companion object lowering 2017-12-20 10:48:48 +01:00
Mikhael Bogdanov
24336113a2 Support class companion object lowering 2017-12-20 10:48:48 +01:00
Mikhael Bogdanov
224adfabc5 Support synthetic accessors for constructors 2017-12-20 10:48:47 +01:00
Mikhael Bogdanov
5cbfdf6024 SyntheticAccessorLowering refactoring 2017-12-20 10:48:47 +01:00
Mikhael Bogdanov
7da847e943 Fix coercion after call 2017-12-20 10:48:46 +01:00
Mikhael Bogdanov
4df0a1bb1f Fix parameter indices on lowering 2017-12-20 10:48:46 +01:00
Mikhael Bogdanov
0729566458 Support javaClass for Void type 2017-12-20 10:48:45 +01:00
Mikhael Bogdanov
f7968e1b61 Fix inner class lowering: don't try to process nested classes on processing outer 2017-12-20 10:48:45 +01:00
Mikhael Bogdanov
dde0535c5a Fix cast for IMPLICIT_NOTNULL 2017-12-20 10:48:44 +01:00
Mikhael Bogdanov
05b56b0c4a Update ArrayConstructor to support inline 2017-12-20 10:48:44 +01:00
Mikhael Bogdanov
665a697093 Support simple function inlining in ir 2017-12-20 10:48:43 +01:00
Mikhael Bogdanov
54dc828c8e Rename ExpressionLambda to PsiExpressionLambda 2017-12-20 10:48:43 +01:00
Mikhael Bogdanov
0e2bd46124 Remove cycle check and resolvedCall from 'preformInline' method 2017-12-20 10:48:42 +01:00
Mikhael Bogdanov
4711e2f9da Don't use kind for static check
Lowers should perform proper transformations
2017-12-20 10:48:42 +01:00
Mikhael Bogdanov
3432014971 Add 'generateModule' method to CodegenFactory 2017-12-20 10:48:41 +01:00
Mikhael Bogdanov
06fd996266 Switch LocalFunctionLowering to LocalDeclarationLowering 2017-12-20 10:48:41 +01:00
Mikhael Bogdanov
1f053be289 Support default function lowering 2017-12-20 10:48:40 +01:00
Mikhael Bogdanov
83710a8ed6 HACK: process unbound symbols 2017-12-20 10:48:40 +01:00
Mikhael Bogdanov
5032064bf0 Enable tailrec lower 2017-12-20 10:48:39 +01:00
Mikhael Bogdanov
84e960b3a4 Enable lateinit lowering 2017-12-20 10:48:39 +01:00
Mikhael Bogdanov
039e036e22 Support IrExpressionBody in codegen 2017-12-20 10:48:38 +01:00
Mikhael Bogdanov
4017195ff1 Always include stdlib in IrTests 2017-12-20 10:48:38 +01:00
Mikhael Bogdanov
e16bdd4287 Switch JvmBackendContext to CommonBackendContext
(cherry picked from commit 5d4736c)
2017-12-20 10:48:37 +01:00
Nikolay Krasko
f963b8bd42 Fix QuickFixTestGenerated$DeprecatedSymbolUsage$TypeAliases
Revert asking super isAvailable in DeprecatedSymbolUsageInWholeProjectFix
2017-12-20 12:27:36 +03:00
Nikolay Krasko
b80403cf13 Consistency for replace string quick fix message
https://youtrack.jetbrains.com/issue/KT-21746#comment=27-2634335
2017-12-20 12:27:36 +03:00
Vyacheslav Gerasimov
95cc3fe1b7 Fix availability of AddFunctionParametersFix
fixes RenameTestGenerated.testAutomaticVariableRenamerWithQuotation_AutomaticVariableRenamerWithQuotation
2017-12-19 21:23:38 +03:00
Nicolay Mitropolsky
bb4d6d1059 LightClassEqualsTest fix by creating lightclasses with createNoCache 2017-12-19 20:03:59 +03:00
Nicolay Mitropolsky
4c5cf0f7e7 *kapt3-idea* added to test-dependencies in *uast-kotlin* 2017-12-19 18:22:14 +03:00
Mikhael Bogdanov
ef433d163e Apply common header directives to second file in AbstractCompileKotlinAgainstKotlinTest 2017-12-19 16:11:39 +01:00
Mikhael Bogdanov
819a3a95b3 Add support for contract feature in inliner 2017-12-19 16:11:39 +01:00
Pavel V. Talanov
4890979476 ScriptDefinitionsManager: ignore reloadDefinitionsBy calls
If definitions are not loaded yet
2017-12-19 17:15:39 +03:00
Pavel V. Talanov
106f571814 scriptTemplatesFromCompilerSettings: fix ScriptDefinitionsManager access
#KT-21545 Fixed
2017-12-19 17:15:36 +03:00
Mikhail Glukhikh
4bff0fb338 Unused symbol: revert entry point check optimization to fix regression
E.g. JUnit 3 tests was highlighted as unused after it
2017-12-19 15:59:30 +03:00
Mikhail Zarechenskiy
9eca8cd451 [NI] Fix hierarchy of resolution atoms for lambda with non-local return 2017-12-19 15:11:04 +03:00
Mikhail Zarechenskiy
c6d8b39b4f [NI] Prioritize type variables related to output type for fixation 2017-12-19 15:11:04 +03:00
Mikhail Zarechenskiy
d818af5287 [NI] Don't forget to analyze whole block for last postponed expression 2017-12-19 15:11:03 +03:00
Anton Bannykh
8ed8e05a68 JS: honor ignoreTestFailures flag and report failures to TC (KT-20735
fixed)
2017-12-19 14:38:15 +03:00
Alexey Sedunov
0ab924a298 Change Signature: Fix overrider search for suspend functions
#KT-21288 Fixed
2017-12-19 13:47:02 +03:00
Alexey Sedunov
b5bd5942e7 Kotlin Facet: Do not auto-advance version in imported projects
#KT-21879 Fixed
2017-12-19 13:47:02 +03:00
Alexey Sedunov
88540360b4 Misc: Fix NPE on external project import 2017-12-19 13:47:02 +03:00
Nicolay Mitropolsky
4a6cc3913d Fix for "safe delete" after caching added to light elements 2017-12-19 13:32:23 +03:00
Alexey Tsvetkov
18fae9e16d Allow override removing temporary module files after build
For debug purposes
2017-12-18 21:19:15 +03:00
Alexey Tsvetkov
5bffef6de7 Allow customizing directory for temporary module files 2017-12-18 21:19:15 +03:00
Alexey Tsvetkov
37b00b91fc Avoid generating too long path for temp module file
#KT-21841 fixed
2017-12-18 21:19:15 +03:00
Toshiaki Kameyama
a4fbe95112 KT-21770 Pasting into an interpolated string shouldn't escape $ 2017-12-18 18:25:43 +01:00
Toshiaki Kameyama
eb25ac44e6 KT-17928 Support code folding for primary constructors 2017-12-18 18:14:27 +01:00
Dmitry Jemerov
18cb9593c8 Add 'reformat' flag to DeprecatedSymbolUsageFixBase 2017-12-18 18:10:36 +01:00
Dmitry Jemerov
48021ce5a1 Disallow formatting in KotlinQuickFix.isAvailable() 2017-12-18 18:10:34 +01:00
Dmitry Jemerov
64f01e53af Check that add() method is in fact MutableCollection.add()
#KT-18881 Fixed
2017-12-18 18:10:33 +01:00
Dmitry Jemerov
94b8614fb8 Don't suggest mapTo() transformation over range literals
#KT-18816 Fixed
2017-12-18 18:10:32 +01:00
Dmitry Jemerov
09d27ca61c Don't generate .forEach { return } when converting loop to call chain
#KT-17161 Fixed
2017-12-18 18:10:31 +01:00
Dmitry Jemerov
b775b901cc Fix incorrect replacement with 'any' instead of 'all'
#KT-17730 Fixed
2017-12-18 18:10:24 +01:00
Dmitry Jemerov
ba4cf4dcc6 Delete unused class 2017-12-18 18:10:21 +01:00
Dmitry Jemerov
d0a8dd7dc8 Update EAP channel names in plugin update check dialog 2017-12-18 18:10:14 +01:00
Ilya Chernikov
3e2003e60d Do not log daemon connection errors as exceptions - may reduce number of ...
redundant report if the problem is corrected on retry

(cherry picked from commit 260fe36)
2017-12-18 17:08:15 +01:00
Ilya Chernikov
f83dc0a067 Make daemon session retrieval more robust to the daemon failures 2017-12-18 16:49:53 +01:00
Ilya Chernikov
1101bb7fb4 Treat "daemon is dying" state as a case for fallback compilation strategy in jps 2017-12-18 16:49:52 +01:00
Ilya Chernikov
6e34f57acf Retry socket connection on connection errors, number of retries and...
retry interval are configurable via the system props
2017-12-18 16:49:51 +01:00
Ilya Chernikov
1cd14f00eb Ignore connection error on the (optional) daemon.clearJarCache call
May fix issues with NoSuchObjectException and UnmarshalException - the
stacktraces often point to this place
2017-12-18 16:49:50 +01:00
Mikhail Glukhikh
0d64ab4846 Fix corner cases (override/script/null/etc.) in "might be const"
Related to KT-20644
2017-12-18 17:23:41 +03:00
Alexey Tsvetkov
3f082346ae Do not set api version to language version when language version is null
#KT-21852 fixed
    #KT-21574 fixed
2017-12-18 16:22:07 +03:00
Dmitry Petrov
17b4d4a973 Differentiate accessors by FieldAccessorKind
Otherwise accessors for backing fields (as in '{ field }') clash with
accessors for properties (as in '{ prop }').

 #KT-21258 Fixed Target versions 1.2.30
2017-12-18 16:15:52 +03:00
Ilya Gorbunov
d8cd926a8c Do not leak primitiveness of an array wrapped with asList
A primitive array wrapped in a List with asList had incorrect implementation of toArray method:
while it declares that an object array is returned, it returned a primitive array.
Therefore the methods such as `Collection.toTypedArray()` and its dependents
`ArrayList(collection)`, `Collection + Iterable` might behave incorrectly
having relied on `toTypedArray` returned an object array.

#KT-21828 Fixed
2017-12-18 15:50:15 +03:00
Sergey Igushkin
c55f08a166 Optimize embeddable JARs
Exclude the compiler dummy JAR from the resulting shadow JAR
2017-12-18 15:46:23 +03:00
Alexander Udalov
3a807cb39b Support Void.TYPE as underlying Class object for KClass
#KT-20875 Fixed
2017-12-18 11:57:05 +01:00
Anton Bannykh
46a631a654 Ignore license in the downloaded node_modules and nodejs 2017-12-18 13:46:25 +03:00
Yan Zhulanow
1692d1a087 Kapt: Add missing 'flush()', otherwise the serialized data can be empty 2017-12-18 18:57:38 +09:00
Nikolay Krasko
f67eb90dfb Don't show file root if it's same as the only declaration (KT-21200)
#KT-21200 Fixed
2017-12-18 11:50:50 +03:00
Nikolay Krasko
a3028beca9 Fix smart step into to Kotlin SAM adapter (KT-21538)
#KT-21538 Fixed
2017-12-18 11:50:49 +03:00
Denis Zharkov
adfee2086a Update bootstrap to 1.2.20-dev-814 2017-12-16 18:56:26 +03:00
Yan Zhulanow
d4be55df0e Kapt, Minor: Fix empty option parsing 2017-12-16 02:17:24 +09:00
Simon Ogorodnik
7c5897c1ab Skip deprecated for org.junit package in kotlin.test 2017-12-15 20:09:51 +03:00
Simon Ogorodnik
c2e706db6c Enable generation of docs for deprecated declarations 2017-12-15 20:09:49 +03:00
Simon Ogorodnik
c5c52dbda5 Fix annotations docs for kotlin.test 2017-12-15 20:09:48 +03:00
Simon Ogorodnik
430aad3651 Set LV = 1.2 in Dokka for generating stdlib docs 2017-12-15 20:09:47 +03:00
Simon Ogorodnik
3c78156f0f Suppress kotlin.reflect.jvm.internal 2017-12-15 20:09:46 +03:00
Simon Ogorodnik
fb3cf212ce Suppress docs for org.junit.Test header in kotlin.test 2017-12-15 20:09:45 +03:00
Simon Ogorodnik
99951db7e3 Add module docs for kotlin.test 2017-12-15 20:09:44 +03:00
Simon Ogorodnik
978a7fdfaa Add stdlib to kotlin.test docs classpath 2017-12-15 20:09:43 +03:00
Simon Ogorodnik
773fca5245 Use correct task to build builtins.jar 2017-12-15 20:09:42 +03:00
Simon Ogorodnik
640ce213cf Compile stdlib builtins ant pass it to Dokka
We need builtins to allow linking to type-aliased classes
such as Exception
2017-12-15 20:09:41 +03:00
Simon Ogorodnik
697b358293 Make local dokka run easier 2017-12-15 20:09:40 +03:00
Simon Ogorodnik
9ab48d8374 Suppress whole org.w3c 2017-12-15 20:09:38 +03:00
Simon Ogorodnik
99af2372c3 Suppress undocumented warnings for third-party js packages 2017-12-15 20:09:37 +03:00
Simon Ogorodnik
17106d6546 Use makeurl to create package-list URL in ant 2017-12-15 20:09:36 +03:00
Ilya Gorbunov
cc139856c8 List all source folders instead of project folder 2017-12-15 20:09:34 +03:00
Ilya Gorbunov
9b1867ce64 Docs: run gradle project and wrapper from the root dir
Build docs for kotlin-stdlib-jdk7/8 instead of jre7/8.
2017-12-15 20:09:33 +03:00
Simon Ogorodnik
a19e229a72 Minor: prepare for documentation generation 2017-12-15 20:09:32 +03:00
Ilya Chernikov
775eeb75c9 Treat daemon startup timeout/error exceptions the same way as RMI errors
will result on regular retry cycle on them, hopefully eliminating or
reducing appropriate exception reports
2017-12-15 15:24:38 +01:00
Mikhail Glukhikh
ea5a52f918 Restrict search scope in some inspections to avoid testData search
Affected inspections: can be private, can be parameter, unused symbol.
Related to KT-21756. May fix EA-113712.
2017-12-15 17:07:37 +03:00
Mikhail Glukhikh
2b5bbf0fdd Fix tests for "may be constant" inspection 2017-12-15 17:07:35 +03:00
Sergey Igushkin
3b4f82c9b9 Advance Gradle version -> 4.4
(cherry picked from commit 2fc7628)
2017-12-15 16:59:37 +03:00
Nikolay Krasko
6456f4ed98 Test step into for Java constructor with SAM conversion
Additional test for KT-21538

 #KT-21538 Fixed
2017-12-15 16:14:50 +03:00
Nikolay Krasko
d6cface66f Make isFromJava check work for SAM adapter extension descriptors (KT-21538)
Consider all callable descriptor in JavaClassDescriptor to be from Java.

This is used to check if smart step into should be intercepted by Kotlin
handler or delegated to Java.

 #KT-21538 Fixed
2017-12-15 16:14:50 +03:00
Nikolay Krasko
26413acf33 Refactoring: introduce method for reuse file for single class logic 2017-12-15 16:14:50 +03:00
Nikolay Krasko
5c33e4a32d Minor: remove warnings in KotlinStructureViewFactory 2017-12-15 16:14:49 +03:00
Nikolay Krasko
c79386594d Don't show useless fold icon in structure view (KT-17254, KT-21200)
#KT-21200 In Progress
 #KT-17254 Fixed
2017-12-15 16:14:49 +03:00
Nikolay Krasko
1688f6fdbd Minor: inline method in KotlinStructureViewElement and rewrite with when 2017-12-15 16:14:49 +03:00
Nikolay Krasko
7bf071b69f Precount 'isPublic' property if descriptor available 2017-12-15 16:14:49 +03:00
Nikolay Krasko
c28a7d8f6d Fix structure view auto-update (KT-21733, KT-19519)
- Fixed by subclassing PsiTreeElementBase instead of StructureViewTreeElement
- Warnings cleanup

 #KT-19519 Fixed
 #KT-21733 Fixed
2017-12-15 16:14:48 +03:00
Nikolay Krasko
b133189309 Rename: MyFunctionDescriptor -> SamAdapterExtensionFunctionDescriptorImpl 2017-12-15 16:14:48 +03:00
Toshiaki Kameyama
d719d06020 Don't suggest "convert to array literal" for *arrayOf #KT-21726 Fixed 2017-12-15 15:01:22 +03:00
Anton Bannykh
f68d639c63 Add @Target's to kotlin.test annotations 2017-12-15 14:14:00 +03:00
Toshiaki Kameyama
5680405531 "Redundant spread operator" inspection: support array literal
So #KT-21727 Fixed
2017-12-15 13:50:53 +03:00
Mikhail Glukhikh
df4bf73033 Convert lambda to reference: minor cleanup 2017-12-15 13:37:00 +03:00
Toshiaki Kameyama
0071ca64c7 Convert lambda to reference produces: fix case with qualified this
So #KT-19977 Fixed
2017-12-15 13:36:32 +03:00
Mikhail Glukhikh
50dc9a14a6 May be constant: fix corner case with getter & initializer 2017-12-15 13:31:49 +03:00
Mikhail Glukhikh
7358980cbc Add inspection to detect non-const vals used as Java annotation args
So #KT-20615 Fixed
2017-12-15 13:31:41 +03:00
Mikhail Glukhikh
70b7e5eb68 Introduce inspection to detect vals might be marked as const
So #KT-20644 Fixed
2017-12-15 13:05:50 +03:00
Yan Zhulanow
4ec20ad595 Minor: Fix build, remove inline function usage 2017-12-15 17:39:17 +09:00
Nicolay Mitropolsky
da98b7e07b Uast: type-mapper checks deeper for local classes (KT-21546, EA-100195) 2017-12-15 09:16:46 +03:00
Yan Zhulanow
f9813e3276 Kapt, Minor: Add kapt-runtime to sources for kotlin-annotation-processing-maven 2017-12-15 02:35:17 +09:00
Yan Zhulanow
187182e46f Noarg, Minor: Include IDEA 'testRuntime' dependency as in other compiler plugins 2017-12-15 02:35:16 +09:00
Yan Zhulanow
db4c441573 Kapt, Maven: Fix path for kapt3 compiler plugin sources 2017-12-15 02:35:16 +09:00
Yan Zhulanow
4d067ab9ce Kapt, Maven: Support passing javac/annotation processor options (KT-21565, KT-21566) 2017-12-15 02:35:15 +09:00
Yan Zhulanow
1af93b8342 Kapt: Consider all 'kapt' configuration dependencies as KaptTask dependencies. 2017-12-15 02:35:14 +09:00
Yan Zhulanow
6941065e2c Fix EA-1005833: Try to find a field using also the receiver type (KT-21820) 2017-12-15 02:35:13 +09:00
Yan Zhulanow
d58665b5a8 Kapt: Remove duplicating check, this also removes the senseless warning (KT-21425) 2017-12-15 02:35:12 +09:00
Yan Zhulanow
4c96453a4b Kapt: Annotations on enum constants are not kept on the generated stub (KT-21433) 2017-12-15 02:35:12 +09:00
Yan Zhulanow
c6f922fb64 EA-110813: Resolve the parent directory safely 2017-12-15 02:08:03 +09:00
Yan Zhulanow
e5a2be4f3c EA-96041: Make error message more user-friendly 2017-12-15 02:08:00 +09:00
Denis Zharkov
fa6285d32a Fix NPE in JavaNullabilityChecker when checking equals-calls
This NPE was introduced in ce41b5745a
Prior to the latter change there was a synthetic PSI element for each
equals-related call, thus callOperationNode was not null here.

== are intentionally treated as safe calls, but for nullability checker
it's not relevant, it only should report warnings on real safe-calls
2017-12-14 19:15:41 +03:00
Denis Zharkov
d64e8e3b33 Revert "Update bootstrap to 1.2.20-dev-732"
This reverts commit f7ccc4144c.
2017-12-14 19:15:41 +03:00
Nicolay Mitropolsky
6ac345df51 Caching KtLightClassForSourceDeclaration (KT-21701)
to make their UserData survive for longer, because otherwise a new LightClass with empty UserData comes to Spring every time, but Spring stores a lot of important things in UserData
2017-12-14 18:05:47 +03:00
Anton Bannykh
6bee5699a0 Migrate node_utils.xml to Gradle 2017-12-14 17:41:20 +03:00
Dmitry Jemerov
40184f053e Don't invoke formatter while checking availability of intentions
#KT-21632 Fixed
2017-12-14 12:02:39 +01:00
Dmitry Jemerov
54d626fe7d Change vendor to JetBrains to always enable exception reporting
#KT-17838 Fixed
2017-12-14 12:02:39 +01:00
Dmitry Jemerov
ba21bae653 Get rid of forced index rebuild on version change
#KT-17367 Fixed
2017-12-14 12:02:39 +01:00
Denis Vnukov
52ccd67ec1 Remove duplicate parameter null checks in JvmStatic delegate methods.
Remove unnecessary non-null parameter checks inside static delegate methods
created for @JvmStatic companion object methods. Allows function generation
strategy decide if such checks need to be injected.

 #KT-7188 Fixed
2017-12-14 13:48:50 +03:00
Alexander Udalov
9e82ab38f0 Fix lookup tracker tests after 2be7116b0b
Standard library is no longer automatically added to the classpath when
-Xbuild-file is used. Before 2be7116b0b, these tests worked because no
matter whether -Xbuild-file was used or not, the automatically computed
classpath (which erroneously was used to populate content roots in the
compiler) contained the standard library (see
K2JVMCompiler.configureContentRoots)
2017-12-14 11:37:56 +01:00
Alexander Udalov
46fa5cfae0 Add dependency on compiler dist from jps-tests
Otherwise, because there's no explicit dependency and the JPS plugin
loads the compiler from dist, the compiler jar is not rebuilt between
changes in compiler code and running jps-tests
2017-12-14 11:37:56 +01:00
Yan Zhulanow
5116f598df Kapt: Fix error message when no annotation processors were found (KT-21729)
Error message says "androidProcessor", it should be "annotationProcessor"
2017-12-14 19:28:51 +09:00
Denis Zharkov
f7ccc4144c Update bootstrap to 1.2.20-dev-732 2017-12-14 11:11:23 +03:00
Dmitry Petrov
1aab4e643c Add overflow-related tests for 'reversed' 2017-12-14 10:41:51 +03:00
Dmitry Petrov
65b5cdbb8d Maintain bounds evaluation order in intrinsics for 'reversed'
Makes sense for 'rangeTo', 'downTo', and 'until' with non-const bounds.
2017-12-14 10:41:51 +03:00
Dmitry Petrov
9fa9a8748b Check that qualified const expressions are recognized properly in 'for' 2017-12-14 10:41:51 +03:00
Dmitry Petrov
bf97b332cf Support const-bounded for loop generation for reversed 'until' 2017-12-14 10:41:51 +03:00
Dmitry Petrov
54cceac99b Intrinsics for 'reversed': until 2017-12-14 10:41:51 +03:00
Dmitry Petrov
5f7460a8c7 Support const-bound counter loop generation for 'downTo' 2017-12-14 10:41:51 +03:00
Dmitry Petrov
2f0df832c0 Minor: pull up helper methods for const-bounded for-in-range generation 2017-12-14 10:41:51 +03:00
Dmitry Petrov
a4c29b3587 Support Long and Char in const-bounded counter loop generation
If the loop end value is a compile-time constant (best we can do now),
and it is safe to iterate over a given range using "naive" for loop
(using '<=' or '>=' in loop condition),
generate such loops for Longs and Chars as well Ints (Bytes, Shorts).
2017-12-14 10:41:51 +03:00
Dmitry Petrov
df2b8d01d8 Extract common code in PrimitiveNumberRangeLiteralRangeValue 2017-12-14 10:41:51 +03:00
Dmitry Petrov
455a1c0f53 Intrinsics for 'reversed': downTo
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
64ba811b7f Intrinsics for 'reversed': CharSequence.indices
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
7ba73c1635 Intrinsics for 'reversed': collection.indices
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
5bcbe25469 Intrinsics for 'reversed': array.indices
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
beff4a1b92 Intrinsics for 'reversed': support non-literal range expressions
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
1493805f8e Take into account step sign in pre-condition for simple progression
So far, all non-end-inclusive progressions had step > 0.
With intrinsics for 'reversed' this will change.
2017-12-14 10:41:51 +03:00
Dmitry Petrov
821843e13f Intrinsics for 'reversed': generate in-const-bound ranges as countable
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
1775f294f4 Intrinsics for 'reversed': infrastructure & primitive range support
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Mikhail Glukhikh
83ae34bb29 Fix leak in matchAndConvert (loopToCallChain) 2017-12-14 10:38:28 +03:00
Ilya Gorbunov
479f293edc Expose internal getProgressionLastElement to public api
To be used in compiler loop optimizations.
#KT-18869 Fixed
2017-12-14 07:22:08 +03:00
Ilya Chernikov
c453ff01cd Increase daemon socket queue size, make it controllable via system prop
Hopefully fixes #KT-15562
Also some minor refactoring
2017-12-13 17:34:13 +01:00
Ilya Chernikov
8f42aa1eda Improve parallel daemon start test:
- move asserts to the end to collect all diagnostics before it
  - disable compilation by default for better testing the startup logic
  - minor refactorings
2017-12-13 17:34:12 +01:00
Alexander Udalov
c5c4c9cfcc Support "-module-name" argument for common code compiler
#KT-20892 Fixed
2017-12-13 11:49:58 +01:00
Alexander Udalov
3ede503042 Minor, remove empty K2JSCompilerArguments.java 2017-12-13 11:49:58 +01:00
Alexander Udalov
cc9ebb26de Minor, improve "-module-name" argument description 2017-12-13 11:49:58 +01:00
Alexander Udalov
dc23a53116 Enumerate module roots directly in ModuleHighlightUtil2.getModuleDescriptor
This is faster than going through FilenameIndex which would call
GlobalSearchScope.accept for all "module-info.java" files in the
project, and there can be many of those.

Also see https://github.com/JetBrains/intellij-community/pull/670
2017-12-13 11:49:51 +01:00
Alexey Sedunov
38d3362bcb Configuration: Support selection of "Latest stable" version vs specific one
#KT-21229 Fixed
2017-12-12 20:48:26 +03:00
Mikhail Glukhikh
5252cd4da4 Lift return or assignment: use register...WithoutOfflineInformation 2017-12-12 19:47:52 +03:00
Mikhail Glukhikh
a375500a33 Spelling: MemberVisibilityCanPrivate > MemberVisibilityCanBePrivate 2017-12-12 19:47:46 +03:00
Dmitry Jemerov
db8147bd79 Regenerate test 2017-12-12 17:13:35 +01:00
Denis Zharkov
e24e711208 Avoid rebuilds after changes of layouts xml-files
This commit makes IC react more granularly on these changes
Precisely, it marks dirty only kt-files that having lookups into
synthetic package built upon a changed layout-file

 #KT-21622 Fixed
2017-12-12 16:17:58 +03:00
Denis Zharkov
58123f2103 Enable kotlin.incremental.usePreciseJavaTracking in gradle.properties 2017-12-12 16:17:58 +03:00
Denis Zharkov
a079b92ea0 Add property for precise version of Java tracking in Gradle IC
The flag name is kotlin.incremental.usePreciseJavaTracking
By default precise version is disabled

 #KT-17621 Fixed
2017-12-12 16:17:58 +03:00
Denis Zharkov
a978c6be35 Fix precise Java IC for multi-module projects
The problem may happen in case of multi-module projects:
If a Java class was effectively unused in one module (A),
but it's used in kt-files from the dependent module (B) then
we wouldn't track the changes of the class while compiling A
and don't recompile its usages in B.

It happens because now we track only Java classes that were
resolved by out frontend instead of all classes in the module
that would be more correct but it might be rather slow.

The idea is that whenever we see change in an untracked Java file
we start tracking the classes in it and for the first time we mark
all its content as changed.
2017-12-12 16:17:58 +03:00
Denis Zharkov
d9cfdf2f63 Add assertion to JavaClassesTrackerImpl::onCompletedAnalysis 2017-12-12 16:17:58 +03:00
Denis Zharkov
8dd5c2f895 Avoid serlialization for unrelated Java source-based classes
There is no need to track unknown (not being tracked before)
classes content of which we didn't request

 #KT-17621 Fixed
2017-12-12 16:17:58 +03:00
Denis Zharkov
f33255c990 Add jetbrains annotations to javac classpath in IncrementalJvmCompilerRunnerTest
Before this change some of these tests were failing
2017-12-12 16:17:58 +03:00
Denis Zharkov
df533053f9 Record special name lookup when trying use interface as a SAM
It was already working in JPS, because it see our synthetic classes
as subclasses for SAM's, but with non-JPS build we have to manually
tracking places that should be recompiled after SAM members are changed
2017-12-12 16:17:58 +03:00
Denis Zharkov
ae6421476d Refine dirty files computation in case of Java source changes
#KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Denis Zharkov
26393d738f Drop IncrementalCompilerRunner::markDirty and its override 2017-12-12 16:17:58 +03:00
Denis Zharkov
1702775738 Introduce JavaClassesSerializerExtension
It will be used to track java classes changes for incremental compilation

 #KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Denis Zharkov
c86dc0d7af Add protobuf extensions to serialized Java descriptors
#KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Denis Zharkov
34452f4f4a Introduce JavaClassesTracker interface into java resolution components
It's purpose is passing java classes being used during analysis
to incremental compilation to let it track diffs

Potentially it might be done the other way:
incremental compilation could build a separate container to analyze
necessary classes, but it's rather hard to implement now

 #KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Alexey Sedunov
9ed0b49746 Gradle: Compile Gradle models/model builders under JVM 1.6
This prevents imports failure in projects using older versions of Gradle

 #KT-21610 Fixed
2017-12-12 15:38:40 +03:00
Dmitry Petrov
a1a1972a04 Provide DescriptorUtils.isAnonymousFunction (for IR-based BE) 2017-12-12 15:29:45 +03:00
Anton Bannykh
0566366895 Make project wizards produce kotlin-test-js testDependency in all Kotlin/JS projects 2017-12-12 14:25:24 +03:00
Alexander Udalov
3c98274006 Move -Xjsr-305 argument parsing out of K2JVMCompilerArguments
To simplify K2JVMCompilerArguments, which is mostly a data holder
2017-12-11 18:02:37 +01:00
Alexander Udalov
5092758acb Improve help message on -Xjsr305 CLI argument 2017-12-11 18:02:04 +01:00
Dmitry Jemerov
900ec82614 Fix indent of expressions following elvis operator 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
87d2d16cda "Use continuation indent for expression body" for prop initializers 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
eacd010e7e Option to wrap elvis expressions
#KT-21720 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
d1daca2560 No line break before = in property initializer and function expr body 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
ab99bf843a Implement option for wrapping assignment statements
#KT-21718 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
947833cad6 Add wrap option for expression body functions
#KT-21470 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
3394d675e5 Option to use continuation indent in argument lists 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
3038f87105 Move two continuation indent wrapping options to wrapping page 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
dc4e673fb1 Initial support for chained call wrapping options
#KT-21529 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
1a93d10697 Refactoring: use more specific block type in signatures 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
3233d650c1 Refactoring: cleanup access to code style settings 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
ff99b921b7 Refactoring: work with ASTNodes in functional style 2017-12-11 17:58:02 +01:00
Dmitry Jemerov
389729cc50 Option for normal indent in supertype lists
#KT-21527 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
67cd4ed17a Don't indent closing parenthesis in conditions
#KT-21485 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
26d47a034e Don't indent closing parenthesis of a destructuring declaration
#KT-20758 Fixed
2017-12-11 17:58:02 +01:00
Dmitry Jemerov
4068b3d9b9 Add continuation indent for wrapped type aliases
#KT-21078 Fixed

fixup type alias
2017-12-11 17:58:02 +01:00
Nikolay Krasko
1ada284a03 Better folding for mulitline strings (KT-21441)
#KT-21441 Fixed
2017-12-11 18:28:01 +03:00
Nikolay Krasko
ab7ba3ae46 Add exit point highlighting for accessors (KT-21318)
#KT-21318 Fixed
2017-12-11 18:28:00 +03:00
Alexey Andreev
93f8542fc4 JS: serialize location of JsCase/JsDefault
See KT-21699
2017-12-11 17:20:15 +03:00
Alexey Andreev
25e56874c1 JS: readable error when source maps change in IC tests 2017-12-11 17:20:15 +03:00
Alexey Tsvetkov
c13b2a6bbc Test incremental recompilation of enum usage in JS 2017-12-11 17:20:14 +03:00
Andrey Mischenko
e1dbb90fdd KT-21729 Error message says "androidProcessor" should be "annotationProcessor" 2017-12-11 09:29:06 +08:00
Toshiaki Kameyama
4563cf250d "Add type" quick fix incorrectly processes vararg modifier with primitive type array initializer #KT-21544 Fixed 2017-12-08 15:46:45 +01:00
Dmitry Jemerov
846e50dcaa Wording fix 2017-12-08 15:44:18 +01:00
Toshiaki Kameyama
270b41dc66 KT-13378 Provide ability to configure highlighting for !! in expressions and ? in types 2017-12-08 15:44:18 +01:00
Dmitry Jemerov
ab619c5655 Improve wording; mark inspection as cleanup tool 2017-12-08 15:41:22 +01:00
Toshiaki Kameyama
0e2bdf8995 Add inspection to sort modifiers #KT-21560 Fixed 2017-12-08 15:41:22 +01:00
Alexander Udalov
2be7116b0b Deduplicate classpath roots in compiler when -Xbuild-file is used
In kotlin-gradle-plugin, the compiler is invoked with a
K2JVMCompilerArguments instance where both the classpath is set, and the
buildFile is used (containing the same classpath entries in XML).
Previously, the compiler concatenated those two classpaths, which
resulted in duplicated entries, which could slow down compilation. Now,
if buildFile is used, the classpath passed explicitly is ignored
(exactly as, for example, destination ("-d"), which is also stored in
the XML build file).

No test added because there doesn't seem to be any change in
user-visible behavior
2017-12-08 12:07:22 +01:00
Alexander Udalov
d65b999c2c Minor, rename variable for clarity 2017-12-08 12:07:22 +01:00
Ilya Gorbunov
0b9830248d Restore original accessor signature as deprecated
The deprecated function is not operator because it covers cases where it was used in explicit form.

#KT-18789
2017-12-07 20:26:53 +03:00
Ilya Gorbunov
7efaa7cabc Allow delegating val properties to out-projected MutableMap
Change generic signature of MutableMap.getValue, use 'out @Exact V' and `V1: V` types instead of single `in V`.
Fix affected IR generation tests.

#KT-18789 Fixed
2017-12-07 20:26:53 +03:00
Mikhail Glukhikh
e503c1d411 Suspend call detector: fix delegated properties checking 2017-12-07 15:54:47 +03:00
Mikhail Glukhikh
24bd31457c Has suspend calls: fix suspend iterator case 2017-12-07 15:54:47 +03:00
Mikhail Glukhikh
4404439521 Introduce "redundant suspend" inspection #KT-19103 Fixed 2017-12-07 15:54:47 +03:00
Mikhael Bogdanov
edefb45585 Copy sam wrappers during inline
#KT-21671 Fixed
2017-12-07 12:57:43 +01:00
Mikhael Bogdanov
4eb30b6626 Code clean 2017-12-07 12:57:42 +01:00
Mikhail Zarechenskiy
d47130eff8 [NI] Don't check type for constants too early to avoid mismatch 2017-12-07 14:18:20 +03:00
Mikhail Zarechenskiy
6c27a49114 [NI] Use effective variance for equal approximated type
It's totally safe from the point of type system and reduces extra `out` projections that can add problems with subtyping
2017-12-07 14:18:17 +03:00
Dmitry Savvinov
874267b79d Report cyclic scopes properly
This commit introduces proper handling of recursion in scopes, which
could occur when some of companion object supertypes are members of
that companion owner:

```
class Container {
  open class Base
  companion object : Base()
}
```

To resolve `Base`, we have to build member scope for `Container`.
In the member scope of `Container`, we see all classifiers from
companion and his supertypes
So, we have to resolve companion objects supertype, which happens to be
`Base` again - therefore, we encounter recursion here.

Previously, we created `ThrowingLexicalScope` for such recursive calls,
but didn't checked for loop explicitly, which lead to a wide variety of
bugs (see https://jetbrains.quip.com/dc5aABhZoaQY and KT-10532).

To report such cyclic declarations properly, we first change
`ThrowingLexicalScope` to `ErrorLexicalScope` -- the main difference is
that latter doesn't throws ISE when someone tries to resolve type in it,
allowing us to report error instead of crashing with exception.

Then, we add additional fake edge in supertypes graph (from
host-class to companion object) which allows us to piggyback on existing
supertypes loops detection mechanism, and report such cycles for user.
2017-12-07 14:14:08 +03:00
Dmitry Savvinov
33f9576dd1 [NI] Turn off KnownTypeParameterSubstitutor for NI
The main consequence of it is that TYPE_MISMATCH range for control
structures became wider.

Also, for extra safety, don't change behaviour of OI.
2017-12-07 14:05:42 +03:00
Denis Zharkov
4ed6928e6b Avoid building stubs in KtFile::getClasses for compiled files
In Gradle, JavaPsiFacade finds Kotlin compiled files as KtFile instances
and tries to obtain classes from them.

And while it returns an empty array anyway, it starts building
unnecessary stub when calling `isScript`
2017-12-07 12:53:33 +03:00
Denis Zharkov
6007d244f3 Optimize LazyJavaAnnotations::isEmpty 2017-12-07 12:53:33 +03:00
Denis Zharkov
07df29dfbf Optimize LazyJavaScope::getPropertyType
Avoid running hasConstantNotNullInitializer for non-primitive fields
2017-12-07 12:53:33 +03:00
Denis Zharkov
5e334550eb Optimize entry point check in UnusedSymbolInspection
It helps to avoid return types calculation for light-class element
2017-12-07 12:53:33 +03:00
Denis Zharkov
dd3dbda719 Optimize computation of default excluded import in IDE
Prior to this change, it was rather slow since it would lead
to a ModuleDescriptor::packageFragmentProviderForWholeModuleWithDependencies
computation, that would force the computation of libraries'
dependencies, that actually was the major bottleneck here.

The idea is that we do not need to search through dependencies
of dependencies, but only need contents of one of the modules
direct content.

This commit is made under the assumption that if a module has may see
some runtime parts, than runtime jar should be among its direct
depenencies.
2017-12-07 12:53:33 +03:00
Denis Zharkov
4b96311600 Add faster get*Names overrides in LazyClassMemberScope 2017-12-07 12:53:33 +03:00
Denis Zharkov
ac56965a99 Do not force loading all kt-files inside LazyPackageDescriptor constructor
Effectively it leads to all stubs being built for any once used package

The idea is that they only were used for FILE_TO_PACKAGE_FRAGMENT
that is mostly read in backend and rarely in the IDE, so we can replace
its usages with searching through related package-fragments
2017-12-07 12:53:33 +03:00
Denis Zharkov
d655c4075c Introduce index for the set of top-level names by package
It should help with actual loading of all the stubs for all declarations
in the package on every access when it's implemented through
`getDeclarations()`
2017-12-07 12:53:33 +03:00
Denis Zharkov
ce41b5745a Avoid creating synthetic safe-call nodes when resolving == calls
Each of them leads to a separate synthetic file retained in the memory
2017-12-07 12:53:33 +03:00
Denis Zharkov
cc312bcaa2 Avoid creating a separate synthetic file for each default import 2017-12-07 12:53:33 +03:00
Denis Zharkov
2d82cb936e Fix potential memory leak in light-classes
The problem is that they might indirectly retain a reference to an
obsolete ResolverForProject (it becomes outdated after out of block
modification).

The best solution would be to avoid preserving jvm-related diagnostics
(that are only used once to report them when highlighting, and exactly
they retains an obsolete resolve session)

But it seems that this may lead to a deep light-classes refactoring and
the temporary fix is storing diagnostics themselves in a CachedValue
bound to out of block modification tracker. There're no guarantees that
this would help, since CachedValue anyway is based on soft-reference
that is not the first thing GC collects
2017-12-07 12:53:33 +03:00
Denis Zharkov
a67598e0c1 Minor. Apply intention for "?: false" -> "== true" in light classes 2017-12-07 12:53:33 +03:00
Denis Zharkov
f1cbf21f96 Simplify LazyLightClassDataHolder
- Use only stubs instead of full results in LazyLightClassData
- Store only stubs for inexactStub
2017-12-07 12:53:33 +03:00
Dmitry Savvinov
aaee401240 [NI] Minor renaming
Use words 'returnArgument' instead of 'resultArgument' when talking
about values, which can be possibly returned from lambda.

Correct 'addSubsystemForArgument' -> 'addSubsystemFromArgument'
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
30a51af931 [NI] Minor: rename typo KotlinCallDiagnistics.kt -> KotlinCallDiagnostics.kt 2017-12-07 12:49:56 +03:00
Dmitry Savvinov
1ada52968b [NI] Fix KnownTypeParameterSubstitutor for !! 2017-12-07 12:49:56 +03:00
Dmitry Savvinov
15a595749b [NI] Weird testdata change after fixes in ErrorTypes
The issue here is that OI infers correct types for (k, v) destructing
declaration, while NI infers errors for them. That happens because NI
resolves iterator() on nullable 'm', but rightfully reports it as
unsuccessful, while OI somehow manages to resolve it to success (and
thus getting nice expected type, allowing destructing declaration to be
resolved in a proper types).
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Dmitry Savvinov
957bbe291d [NI] Don't approximate error types
Previously, we did approximation of error types to Any?/Nothing in some
contexts (e.g. non-local declarations).

There are several reasons why it is not desired:
- OI doesn't approximate ErrorType
- This behaviour is inconsistent with ourselves (i.e. sometimes we *do*
  infer errortype for top-level declaration)
- It causes different digressions from OI in reported diagnostics

This commit turns off error type approximation. It causes large testdata
shift, which is deliberately split into several parts and commited in a
separate commits.
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
70a1beeff6 [NI] Use ErrorType in ParseErrorKotlinCallArgument
Previously, there was receiver of type Nothing, which could case result
of the call to be inferred to Nothing too. This could case bogus
UNREACHABLE_CODE diagnostics in cases like this:

```
fun <T> id(x: T) = x
fun test() {
    id(unresolvedReference) // type of statement is 'Nothing'
    // ... everything here is marked as unreachable ...
}
```

This commit changes type of receiver for such calls form Nothing to
ErrorType.
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
eadd1355c2 [NI] Add ErrorType constraint
Previously, constraint wasn't added if bound was ErrorType. That could
cause TypeVariable to be inferred to Any?/Nothing instead of ErrorType,
which could influence other parts of analysis (in particular, inferring
Nothing instead of ErrorType can cause bogus UNREACHABLE_CODE diagnostics)

Because of that fix, intersection type can be added to CS as supertype,
which provokes AssertionError. This commit also relaxes this assertion,
as it seems that it's valid that supertype is an intersection type.
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
8e50a58408 [NI] New failing test after changes in applicabilities 2017-12-07 12:49:56 +03:00
Dmitry Savvinov
816d89e393 [NI] Improved testdata after changes in applicabilities
This commits introduces testdata changes, where NI behaviour strictly
improved, after several previous fixes.

For some tests, just WITH_NEW_INFERENCE directive was added. It
indicates, that some of previous commits first introduced error in that
test, and then some other commit fixed it (netting no overall testdata
change). It is preferrably to keep those annotations until we will
migrate to NI completely, to prevent unexpected regressions.
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
9f63818bd3 [NI] Introduce INAPPLICABLE_ARGUMENTS_MAPPING_ERROR for some NI diagnostics 2017-12-07 12:49:56 +03:00
Dmitry Savvinov
e2d65adc7e [NI] Fix KotlinResolutionCandidate.isSuccessfull
Check if ConstrainSystem has any contradiction in 'isSuccessful'.
Otherwise we may erroneously think that there are some successful
candidates in 'TowerResolver.SuccessfullResultCollector.pushCandidates()'
and clear other unsuccessful ones (while they actually may have higher
applicability).
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
78a526c937 [NI] Support EffectSystem
- During final phase of resolution (i.e. converting NI-results to
OI-results), make call into EffectSystem to record all necessary
effects-related information.

- To be able to enhance resulting dataFlowInfo for call at that stage,
introduce internal method 'updateResultingDataFlowInfo' in
NewResolvedCallImpl.
2017-12-07 12:49:56 +03:00
Toshiaki Kameyama
b23d62c760 Transfer type to parent property in "Remove redundant getter" inspection
So #KT-21612 Fixed
2017-12-07 12:19:35 +03:00
Mikhail Glukhikh
834c3fe62b Do not inline property setter if it's not required (e.g. ReplaceWith)
So #KT-21237 Fixed
2017-12-07 12:14:29 +03:00
Mikhail Glukhikh
bddaab9d48 Inline properties without setter / with default setter correctly
Related to KT-21237
2017-12-07 12:14:29 +03:00
Nikolay Krasko
fba50a8d15 Disable language injection for SpEL language as it cause to many troubles
It's known that there're several inspections that report warnings when
SpEL language is injected not to Java files if IDEA is before 173.
2017-12-07 12:02:39 +03:00
Michal Bendowski
6f350c032d Recognize injections in annotations (KT-13636)
Recognize patterns from both Java (psiMethod) and Kotlin
(kotlinParameter) that match the annotation argument.
2017-12-07 12:02:37 +03:00
Nikolay Krasko
b7ba45c001 Reparse lambda expression after removing parameter comma (KT-21497)
Without the parameter it can become block.

 #KT-21497 Fixed
2017-12-07 12:02:07 +03:00
Nikolay Krasko
273bd55f01 Refactoring: extract methods 2017-12-07 11:49:19 +03:00
Dmitry Petrov
04ab3e1519 Use ForInSimpleProgressionLoopGenerator for most of the loop intrinsics 2017-12-07 11:36:20 +03:00
Dmitry Petrov
6b6ae2f7d7 Minor: formatting 2017-12-07 11:36:20 +03:00
Dmitry Petrov
75315a4edb Replace BoundedValue objects in 'indices' with SimpleBoundedValue 2017-12-07 11:36:20 +03:00
Nicolay Mitropolsky
209ba89a49 Uast: KotlinSecondaryConstructorWithInitializersUMethod introduced as workaround for KT-21617
to be the only constructor which includes `init` block when there is no primary constructors in the class
2017-12-06 22:19:57 +03:00
Nicolay Mitropolsky
b8069b48c5 Uast: returning back secondary constructors bodies (KT-21575)
but secondary constructors without primary constructor will not contain initializers, it is still an issue
2017-12-06 22:19:57 +03:00
Nikita Skvortsov
962c512882 optimize search for modules nodes 2017-12-06 18:55:09 +01:00
Nikita Skvortsov
cc580ca1dc optimize check of module-per-source-set 2017-12-06 18:55:09 +01:00
AJ Alt
8297fee615 Fix typo in File.copyTo KDoc 2017-12-06 18:11:11 +01:00
Yusuke Hosonuma
949f9b9342 gitignore: remove duplicates 2017-12-06 18:09:43 +01:00
Nikolay Krasko
110a9ff600 Fix project configuration: avoid adding test jar as library dependency
For some reason gradle processes "testJar" task differently and collects
artifacts for it during configuration phase. This helps Idea project
configurator understand that there's no need to attach test jar as separate
binary library dependency.

Having compiled module in dependencies results IDEA finds both compiled and
source version of classes. This may cause bad navigation and reindexing.
2017-12-06 19:14:28 +03:00
Mikhail Zarechenskiy
1d736f59b6 [NI] Refine nullability for CST of types with undefined nullability 2017-12-06 18:36:20 +03:00
Mikhail Zarechenskiy
b9d390449c [NI] Refactor constraints transformations, update comments 2017-12-06 18:36:19 +03:00
Mikhail Zarechenskiy
351c592c83 [NI] Drop hack that was used before DefinitelyNotNull types 2017-12-06 18:36:17 +03:00
Mikhail Zarechenskiy
b2299ed19f [NI] Fix testdata after introducing DefinitelyNotNull types 2017-12-06 18:36:16 +03:00
Mikhail Zarechenskiy
9565b56b2a [NI] Render DefinitelyNotNull types with !! postfix 2017-12-06 18:36:14 +03:00
Mikhail Zarechenskiy
7f0cca52ca [NI] Use definitely not-null types for smartcasts 2017-12-06 18:36:13 +03:00
Mikhail Zarechenskiy
64f0688b71 [NI] Introduce DefinitelyNotNullType as type for T!! or {T & Any} 2017-12-06 18:36:11 +03:00
Mikhail Zarechenskiy
8e0171d475 [NI] Don't loose platform types on simplifying lower constraints 2017-12-06 18:08:52 +03:00
Alexey Sedunov
e2743c8f34 Rename: Do not use KotlinDirectoryAsPackageRenameHandler via dispatch handler
#KT-21604 Fixed
2017-12-06 14:17:56 +03:00
Alexey Sedunov
e1ed74008f Rename: Fix exception on attempt to rename KtConstructorDelegationReference
#KT-21536 Fixed
2017-12-06 14:17:56 +03:00
Alexey Sedunov
ec85b708c9 Misc: Use delegate with predefined name for fake light methods
#KT-21414 Fixed
2017-12-06 14:17:56 +03:00
Alexey Sedunov
89352a295d Maven Import: Support compiler arguments specified directly in <args>
#KT-21592 Fixed
2017-12-06 14:17:56 +03:00
Alexey Sedunov
288560eb37 Misc: Fix project configuration test 2017-12-06 14:17:55 +03:00
Alexey Sedunov
4369c6d26c Minor: Update Maven import test data 2017-12-06 14:17:55 +03:00
Mikhael Bogdanov
5c2f5fee39 Make 'addCommonSourceSetToPlatformSourceSet' open to support native specifics 2017-12-06 10:57:08 +01:00
Mikhael Bogdanov
60b812e3dd Increase android emulator startup await 2017-12-06 10:57:08 +01:00
shiraji
5d44037a2b Support 'it op something' case in "redundant let" #KT-21373 Fixed 2017-12-05 19:23:44 +03:00
Ramon Wirsch
f961f33f9d Fix for KT-19188
Fixes nondeterministic Default Method Order under existance of generic
type parameters.
SubstitutingScope did not respect source code method order by not using
a LinkedHashSet
2017-12-05 18:33:22 +03:00
Mikhail Glukhikh
8257e14055 J2K: perform additional isActiveFor check before applying inspections 2017-12-05 18:21:22 +03:00
Mikhail Glukhikh
7eb62b9ca4 Add kapt as test runtime dependency to J2K 2017-12-05 18:18:48 +03:00
Mikhail Glukhikh
a90e3c2e45 Add "replace map.put with assignment" to J2K
Related to KT-21502
2017-12-05 18:18:25 +03:00
Dereck Bridie
8c305a137f Introduce inspection "replace map.put with assignment" #KT-21502 Fixed 2017-12-05 16:57:36 +03:00
Nikolay Krasko
ab28bdf32f Store in test data failure for quotedName name 2017-12-05 16:07:55 +03:00
Nikolay Krasko
57d62eb74a Document error behaviour of evaluate expression lost sometime 2017-12-05 16:07:54 +03:00
Nikolay Krasko
b21fb1a375 Replace assertTrue with assertEquals in AbstractKotlinEvaluateExpressionTest 2017-12-05 16:07:53 +03:00
Nikolay Krasko
04e6aa76cf Fix lint apiCheck lint 2017-12-05 16:07:53 +03:00
Dmitry Petrov
3d473f608e Add more tests for for-in-array
#KT-21354 Fixed Target versions 1.2.20
 #KT-21321 Fixed Target versions 1.2.20
2017-12-05 15:45:20 +03:00
Dmitry Petrov
e4ecc13e13 Generate for-in-array loops with proper semantics in 1.3+
In Kotlin 1.3+, assignment to the for-in-array loop range variable in
the loop body doesn't affect loop execution (as if it was a loop on an
array iterator, or some other container).

 #KT-21354 In Progress
 #KT-21321 In Progress
2017-12-05 15:45:20 +03:00
Dmitry Petrov
7a6f80606b Warn on for-in-array range variable assignment in loop body
According to KT-21354, this should be a warning in 1.2 and before, and
no warning (with changed semantics) in 1.3 and later.
NB there are some false positives in this check.

 #KT-21354 In Progress
 #KT-21321 In Progress
2017-12-05 15:45:20 +03:00
Mikhail Glukhikh
7118a4bf80 Fix KNPE in "introduce variable", add some name conflict introduce tests
So #KT-21530 Fixed
2017-12-05 15:29:45 +03:00
Mikhail Glukhikh
20b48ab90c Fix suggested names in Spring (do not take same parameter into account) 2017-12-05 15:29:45 +03:00
Mikhail Glukhikh
b09465ca0b Unnecessary variable: do not suggest in case of name duplication
So #KT-20300 Fixed
2017-12-05 15:29:45 +03:00
Mikhail Glukhikh
844dd1c43c Refactoring: Unnecessary variable inspection 2017-12-05 15:29:45 +03:00
Mikhail Glukhikh
52053695fe Fix variable name validator (take parameters into account) 2017-12-05 15:29:44 +03:00
Toshiaki Kameyama
e341ec969f "Join declaration and assignment" should remove 'lateinit' for 'var' #KT-21603 Fixed 2017-12-05 11:19:58 +09:00
Ilya Chernikov
075203ad33 Make embedding javaslang into compiler intransitive, as it was before gradle
fixes KT-21537

(cherry picked from commit cc5c1d5)
2017-12-04 14:47:53 +01:00
Mikhail Glukhikh
ac3542c041 Minor cleanup 2017-12-04 15:58:13 +03:00
Toshiaki Kameyama
74d83997c7 Fix false "function is never used" for functions with '@JvmName'
So #KT-20435 Fixed
2017-12-04 15:58:13 +03:00
Denis Zharkov
84282035b0 Set up projectTest.workingDir for incremental-compilation-impl 2017-12-04 15:21:03 +03:00
Mikhail Glukhikh
fb8dc7b590 Minor cleanup 2017-12-04 15:16:04 +03:00
Toshiaki Kameyama
0eec3ef1f8 Add / preserve semicolon after empty companion object #KT-21179 Fixed 2017-12-04 15:15:49 +03:00
Alexey Andreev
45e5cc190f Update DCE limits in JS tests 2017-12-04 11:25:39 +03:00
Dmitry Petrov
0db6e5c3f3 Fix SAM wrapper generation in secondary constructor calls
Should simply invoke 'checkSamCall' in corresponding visitor method to
check if call arguments should be wrapped.
2017-12-04 10:29:33 +03:00
Dmitry Petrov
3431a1445c Fix enum entry class delegating constructor call generation
When the enum entry requires a specific class, its constructor should
invoke proper supertype constructor (from the corresponding enum class).
Corresponding resolved call should be passed from the front-end in
CONSTRUCTOR_RESOLVED_DELEGATION_CALL slice.
In case of enum entries without explicit supertype initializer, this
information was missing.
2017-12-04 10:29:33 +03:00
Ilmir Usmanov
d8c4d19152 Make suspendCoroutineOrReturn ordinary function 2017-12-01 20:18:04 +03:00
Yan Zhulanow
0b37c9e83c Kapt: Report about of time spent in each annotation processor in verbose mode (KT-21542) 2017-12-01 22:53:22 +09:00
Yan Zhulanow
ef6be206d0 Kapt: Clear URL cache after changing annotation processor JAR 2017-12-01 22:53:22 +09:00
Yan Zhulanow
84a766de24 Kapt: Register AP classpath as an input for "generate stubs" and "kapt" tasks
...so if the annotation processor artifact is changed, annotation processing will be relaunched.
2017-12-01 22:53:22 +09:00
Yan Zhulanow
9e43992094 Minor: Update kapt converter test for imports 2017-12-01 22:53:21 +09:00
Yan Zhulanow
3dc7502b0b Kapt, minor: Remove kaptError with location, it doesn't do anything reasonable now anyway 2017-12-01 22:53:21 +09:00
Yan Zhulanow
a4a7db06d2 Kapt: force resolve import references in partial analysis mode (required for import conversion in correctErrorTypes) 2017-12-01 22:53:21 +09:00
Yan Zhulanow
1a3317ae2b Kapt: Attach generated classes directory as library source (KT-19823)
This may seem like a magic, but actually it's deadly simple.

GradleProjectResolver.mergeLibraryAndModuleDependencyData() tries to find a better substitution for the absolute BINARY paths, but actually makes things worse in our case.
GradleProjectResolver checks if the provided path is in the Gradle project output path list, and if the answer is yes, then it replaces our path to a Gradle Project (or a module in JPS terminology) dependency.
2017-12-01 22:53:21 +09:00
Yan Zhulanow
2e17c0b7f1 Kapt: Filter out non-package all-under imports whenever possible in "correctErrorTypes" (KT-21359) 2017-12-01 22:53:21 +09:00
Yan Zhulanow
00bb38fbb1 Kapt: Support import directive with aliases in "correctErrorTypes" mode (KT-21358) 2017-12-01 22:53:21 +09:00
Yan Zhulanow
c7645bcf03 Kapt: Replace error.NonExistentClass usages to Object (as it does not break class hierarchies) 2017-12-01 22:53:21 +09:00
Yan Zhulanow
e46fe9b255 Kapt: Do not add duplicating library entries in project importing 2017-12-01 22:53:20 +09:00
Yan Zhulanow
3d1ca61f9f Kapt: Remove artificial KaptError exception on errors from annotation processor (KT-21262) 2017-12-01 22:53:20 +09:00
Yan Zhulanow
0a0de8da29 Kapt: Fix correctErrorTypes for getters of properties defined in the primary constructor 2017-12-01 22:53:20 +09:00
Yan Zhulanow
182c2e2eeb Kapt: Launch integration tests also under Java 9 2017-12-01 22:53:20 +09:00
Yan Zhulanow
6ccf361942 Kapt: -Xmaxerrs javac option is not propagated properly (KT-21264) 2017-12-01 22:53:20 +09:00
Yan Zhulanow
2819fc718a Parcelable: Migrate to canonical NEW-DUP-INVOKESPECIAL form (KT-20545) 2017-12-01 22:53:20 +09:00
Yan Zhulanow
37543deefa Kapt: Keep KDoc comments in Java stubs (KT-21205) 2017-12-01 22:53:19 +09:00
Yan Zhulanow
af57ab8119 Kapt: Fix remaining issues with Java 9 compatibility in converter, add Java 9 tests 2017-12-01 22:53:19 +09:00
Yan Zhulanow
dde87ae1f9 Attempt to fix Gradle project importing error on older Gradle versions (KT-20967) 2017-12-01 22:53:19 +09:00
Yan Zhulanow
49db1bfe5d Introduce preliminary check for special annotations (allopen/noarg/samWithReceiver) (KT-21194) 2017-12-01 22:53:19 +09:00
Yan Zhulanow
ecfb045790 Android Extensions: Do not generate synthetic components in Kotlin Bytecode tool window when the Gradle plugin is disabled 2017-12-01 22:53:19 +09:00
Yan Zhulanow
8496ff8611 Minor: Add kotlin-android-extensions-runtime dependency to get rid of error messages in IDE 2017-12-01 22:53:19 +09:00
Yan Zhulanow
037caf3a17 Kapt: Prefer Kotlin diagnostic locations over ones from stubs 2017-12-01 22:53:19 +09:00
Yan Zhulanow
861d778530 Kapt: Fix 'correctErrorTypes' for primary constructor properties 2017-12-01 22:53:18 +09:00
Yan Zhulanow
7136bf7e0a Kapt: Add Kotlin location to diagnostics reported in Kapt stubs 2017-12-01 22:53:18 +09:00
Yan Zhulanow
8fba19f269 Kapt: Do not print empty diagnostic messages 2017-12-01 22:53:18 +09:00
Yan Zhulanow
5efdf111f5 Kapt: Support type aliases in correctErrorTypes mode (KT-19402) 2017-12-01 22:53:18 +09:00
Yan Zhulanow
84e5fa38bb Kapt: Exclude all primitive Java constants from inlining (String is still inlined) (KT-20878) 2017-12-01 22:53:18 +09:00
Yan Zhulanow
6ca5787799 Kapt: Allow to ignore specific methods/fields from being put into kapt stubs
Classes can't be ignored yet as it requires to ignore also all type usages which is a non-trivial operation.
2017-12-01 22:53:18 +09:00
Yan Zhulanow
fd84ecda54 Kapt: Add runtime library, move all modules inside the 'kapt3' directory 2017-12-01 22:53:17 +09:00
Yan Zhulanow
b74ef72af7 Kapt: Forbid illegal Java identifiers in Enum value literals 2017-12-01 22:53:17 +09:00
Yan Zhulanow
f52749741b Minor: Remove unused fileManager property 2017-12-01 22:53:17 +09:00
Yan Zhulanow
bdf77ccb65 Kapt: Refactoring, replace getValidIdentifierName() with more appropriate isValidIdentifier() 2017-12-01 22:53:17 +09:00
Yan Zhulanow
f368414328 SamWithReceiver: Pick the right compiler plugin (KT-20813) 2017-12-01 22:53:17 +09:00
Yan Zhulanow
3d7222485d Android Extensions: Add missing documentation, move the hasCache property to the compiler module 2017-12-01 22:53:16 +09:00
Yan Zhulanow
e4f476c09f Kapt, Maven: Fix running with the non-clean build (KT-20816)
Clean target directories for kapt stubs and generated source files.
Filter out the compile destination directory from the classpath.
2017-12-01 22:53:16 +09:00
Yan Zhulanow
381379fb62 Kapt, Maven: Clean directories for generated sources and stubs before AP 2017-12-01 22:53:16 +09:00
Yan Zhulanow
b074c7e22f Minor: Return back the whole test contents 2017-12-01 22:53:16 +09:00
Yan Zhulanow
1f65f8bc97 Encode all compiler plugin arguments for Android Extensions in kapt
Commas in option values breaks the option parsing in daemon (KT-20235).
2017-12-01 22:53:16 +09:00
Yan Zhulanow
425d104255 Parcelable: Convert I to Z explicitly, older Android Dex has strict checks for it (KT-20928) 2017-12-01 22:53:16 +09:00
Yan Zhulanow
e28cffd0ad Parcelable: newArray() result type should be Object[] (KT-20717) 2017-12-01 22:53:15 +09:00
Yan Zhulanow
26005751d8 Parcelable: Fix compatibility with serialization plugin (KT-20742) 2017-12-01 22:53:15 +09:00
Yan Zhulanow
3d155dd757 Kapt: Support Java 9 in Gradle plugin infrastructure 2017-12-01 22:53:15 +09:00
Yan Zhulanow
c6eab6f72e Kapt: Support Java 9 in compiler plugin 2017-12-01 22:53:15 +09:00
Yan Zhulanow
e97b3ed324 Kapt: Get rid of DatatypeConverter in order to support JDK9 (KT-20749) 2017-12-01 22:53:15 +09:00
Yan Zhulanow
fa54a0c642 AllOpen: Add Validated to the list of annotations supported by kotlin-spring plugin (KT-20751) 2017-12-01 22:53:15 +09:00
Yan Zhulanow
eccc3447f6 Infrastructure: move compiler plugin tests back to their modules 2017-12-01 22:53:14 +09:00
Alexander Udalov
7248f2568a Drop USE_NEW_INFERENCE, configure language version settings in KotlinTestUtils
This will only have effect for tests which do not use their own instance
of LanguageVersionSettings though
2017-12-01 13:35:25 +01:00
Alexey Andreev
9c0e049bbe JS: fix boxed char with latest changes in compiler 2017-12-01 15:20:34 +03:00
Nikolay Krasko
2c79481f37 Add IdeaOpenApiClassFinder and BundledGroovyClassFinder to known finder
Fix testKnownNonClasspathFinder for 173 branch
2017-12-01 00:44:05 +03:00
Nikolay Krasko
e2418ec892 Remove custom runtime configure from AbstractParameterInfoTest 2017-12-01 00:44:05 +03:00
Nikolay Krasko
f460104ace Unconfigure library in AbstractLineMarkersTest 2017-12-01 00:44:04 +03:00
Nikolay Krasko
22b0dd91e4 Fix GradleConfiguratorTest: jre8 is expected for 1.1.2 version 2017-12-01 00:44:04 +03:00
Nikolay Krasko
3dc494ed00 Some qualified names might be null for classes 2017-12-01 00:44:04 +03:00
Nikolay Krasko
32da2ccb81 Don't intercept unexpected exceptions in AbstractQuickFixTest.kt 2017-12-01 00:44:04 +03:00
Nicolay Mitropolsky
f67db64dba *kapt3-idea* added to *ultimate* as testRuntime dependency
because of falling tests. It seems that there is not such issue in 1.2.0 branch
2017-11-30 21:27:56 +03:00
Nicolay Mitropolsky
4db5ca66e3 Uast: constructors calls consistency for KtObjectLiteralExpression (KT-21409) 2017-11-30 20:08:16 +03:00
Nicolay Mitropolsky
1dbce18afc Uast: constructors calls consistency except anonymous object literals (KT-21409) 2017-11-30 20:08:16 +03:00
Nicolay Mitropolsky
77be33d433 Uast: KotlinPrimaryConstructorUMethod renamed to KotlinConstructorUMethod (KT-21409) 2017-11-30 20:08:16 +03:00
Nicolay Mitropolsky
1ce21583ad Uast: secondary constructors delegation support (KT-21409) 2017-11-30 20:08:16 +03:00
Nicolay Mitropolsky
3bfa5c4706 Uast: parsing primary constructors superCalls (KT-21409) 2017-11-30 20:08:16 +03:00
Mikhail Glukhikh
a39f2f8271 Downgrade "use expression body" inspection to INFORMATION default level
(cherry picked from commit b6bc8eb)
2017-11-30 17:19:19 +03:00
Mikhail Glukhikh
0d65df4d3e Recursive equals: case with recursive not equals + extra tests 2017-11-30 16:47:27 +03:00
Mikhail Glukhikh
13e0ba0836 Recursive equals: fix false positive with different argument
Related to KT-13702
2017-11-30 16:44:51 +03:00
Mikhail Glukhikh
917be5d271 Support "recursive equals" for direct equals call (related to KT-13702) 2017-11-30 16:44:50 +03:00
Mikhail Glukhikh
e301506460 Simplify and fix "recursive equals" inspection (related to KT-13702) 2017-11-30 16:44:45 +03:00
Toshiaki Kameyama
b8fcdea673 Add inspection for equals which is called recursively within itself
So #KT-13702 Fixed
2017-11-30 16:44:20 +03:00
Mikhail Glukhikh
bd348911af Add "unused equals" for direct calls without receiver
Related to KT-21192
2017-11-30 16:44:16 +03:00
Mikhail Glukhikh
64159a900a Add "unused equals" warning on direct equals call #KT-21192 Fixed 2017-11-30 16:43:54 +03:00
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
Alexander Udalov
885ddc49a2 Move libraries/reflect/{build.gradle -> build.gradle.kts}
To preserve Git history after conversion to Kotlin in the next commit
2017-11-28 12:35:50 +01:00
Alexander Udalov
aca74cef0e Replace dependencies on kotlin-reflect with kotlin-reflect-api
See the previous commit for information on the kotlin-reflect vs
kotlin-reflect-api distinction.

Add kotlin-reflect as an explicit runtime dependency of most of the test
configurations because even though they all depend on tests-common, the
runtime dependency on kotlin-reflect is not exported from tests-common
to other modules because the projectTests dependency is not transitive.
2017-11-28 12:35:49 +01:00
Alexander Udalov
329fbd8fa8 Extract kotlin-reflect-api module out of kotlin-reflect
This is needed only for faster compilation of the Kotlin project itself
and has no effect on the public artifact
org.jetbrains.kotlin:kotlin-reflect.

The problem this is solving is the rebuild of the project once anything
has been changed in modules in 'core' (even inside function bodies, i.e.
a non-API change). Previously, changes in 'core' led to the compilation
of kotlin-reflect, which led to the rebuild of all modules depending on
kotlin-reflect directly or indirectly (which is almost all modules in
the project) because kotlin-reflect's artifacts are custom-built and the
changes can not be picked up incrementally. But 99.9% of the time the
initial changes in 'core' could not have any effect on the usages of
kotlin-reflect, because classes from those modules are moved to an
internal package in kotlin-reflect and thus are an internal
implementation detail.

Now, changes in 'core' still lead to the compilation of kotlin-reflect
and to the process of building the custom jar. But if a module depends
on kotlin-reflect-api, not kotlin-reflect, then the incremental
difference checker will detect that the module does not have to be
recompiled if there hasn't been any changes to the API of
kotlin-reflect-api. Which means that the module will not be rebuilt on
every change in 'core'.

This commit only introduces the new module. The dependencies
(kotlin-reflect -> kotlin-reflect-api) are replaced in the next commit.
2017-11-28 12:35:48 +01:00
Alexander Udalov
3e8b39af90 Move kotlin-reflect Gradle project to libraries/reflect/ 2017-11-28 12:33:21 +01:00
Toshiaki Kameyama
7448042b68 Fix callable code factory (parameter with default value case)
Before we can have end of '<Type>' and '=' joined as '>=' breaking PSI
So #KT-15941 Fixed
2017-11-28 14:11:04 +03:00
Mikhael Bogdanov
21bd10da2e Move generator utils 2017-11-28 11:04:40 +01:00
Mikhael Bogdanov
f529069077 Move common test parts to tests-common. Minify test jar dependencies 2017-11-28 11:04:39 +01:00
Alexey Sedunov
acbf53c42e Move: Make applicable to type aliases
#KT-21071 Fixed
2017-11-27 21:19:23 +03:00
Alexey Sedunov
bcdb46653c Line Markers: Detect recursive calls of companion invoke() member
#KT-21076 Fixed
2017-11-27 21:19:23 +03:00
Alexey Sedunov
169a22226f Rename: Support inplace rename of class via primary constructor
#KT-20146 Fixed
 #KT-21371 Fixed
2017-11-27 21:19:22 +03:00
Alexey Sedunov
2792e0c412 Rename: Introduce dispatching handler
The goal is to filter out KotlinMemberInplaceHandler similar to how
RenameHandlerRegistry does with MemberInplaceHandler
2017-11-27 21:19:22 +03:00
Alexey Sedunov
56746380f7 Data Inflow: Support delegated assignments
#KT-19089 Fixed
2017-11-27 21:19:22 +03:00
Alexey Sedunov
9d482bbbb1 Data Inflow: Show composite assignments
#KT-19112 Fixed
2017-11-27 21:19:22 +03:00
Alexey Sedunov
a333eb917b Data Inflow: Show qualified assignments
#KT-19087 Fixed
2017-11-27 21:19:21 +03:00
Vyacheslav Gerasimov
c06f72b73f Remove invalid toast test case, worked previously due to uast bug 2017-11-27 20:20:40 +03:00
Vyacheslav Gerasimov
26dcd1c706 Add kapt3-idea to test runtime of idea-android 2017-11-27 20:20:40 +03:00
Alexander Udalov
386a3fb5ce Fix tests after f4f5359725 2017-11-27 16:03:38 +01:00
Dmitry Petrov
f586bd4a34 Generate proper visibility for companion object instance field in LV1.3+ 2017-11-27 17:15:16 +03:00
Dmitry Petrov
70d3e6592d Unwrap object member imported by name before determining receivers
Existing code for receiver generation accidentally worked in most cases
for object members imported by name. However, it generated strange
bytecode (such as
    GETFIELD AnObject.INSTANCE
    GETFIELD AnObject.INSTANCE
    POP
), and worked incorrectly for augmented assignments.

 #KT-21343 Fixed Target versions 1.2.20
2017-11-27 17:15:16 +03:00
Alexey Andreev
7bee2ceac7 JS: add boxing/unboxing to default accessors of non-simple properties
See KT-21421
2017-11-27 17:01:19 +03:00
Alexey Andreev
be4e2f96c2 JS: throw error from coroutine marker functions 2017-11-27 17:01:18 +03:00
Alexey Andreev
71b1591044 JS: replace suspend inline metadata after inlining
This fixes some issues on coroutine inlining, see tests
2017-11-27 17:01:18 +03:00
Alexey Andreev
f8e7861ce6 JS: add partial tail-call optimization for suspend functions 2017-11-27 17:01:17 +03:00
Alexey Andreev
7c621488ad Remove unnecessary CONTAINS_NON_TAIL_SUSPEND_CALLS slice 2017-11-27 17:01:17 +03:00
Alexey Andreev
26843509c7 JS: disable suspend function tail-call optimization based on FE data
Partially fixes KT-21026
2017-11-27 17:01:16 +03:00
Alexey Andreev
6ab87ad66a Fix failing JS tests 2017-11-27 17:01:15 +03:00
Toshiaki Kameyama
2dd66225f3 Take into account vararg modifier in "Add type" quick fix
So #KT-20894 Fixed
2017-11-27 16:44:42 +03:00
Toshiaki Kameyama
4d93c08bd0 Do not propose to make local lateinit var immutable #KT-21104 Fixed 2017-11-27 16:44:04 +03:00
Alexander Udalov
938fd1a57e Use ResolvedCall for callable reference in KCallableNameProperty intrinsic
Instead of manually inspecting the DOUBLE_COLON_LHS slice, which is a
bit more error-prone. Note that new tests were passing before this
change
2017-11-27 12:46:56 +01:00
Alexander Udalov
f4f5359725 Fix exception on inlining callable reference with implicit this in LHS
Use ResolvedCall to determine the receiver type in the JVM codegen,
instead of manually inspecting the PSI

 #KT-20821 Fixed
2017-11-27 12:46:55 +01:00
Alexey Sedunov
1ceb751061 Data Outflow: Allow for-loop variables
#KT-19018 Fixed
2017-11-27 14:36:09 +03:00
Alexey Sedunov
fc307da383 Data Outflow: Show all reference expressions as separate steps
#KT-19012 Fixed
 #KT-19017 Fixed
 #KT-19036 Fixed
 #KT-19039 Fixed
 #KT-19104 Fixed
 #KT-19106 Fixed
2017-11-27 14:36:09 +03:00
Alexey Sedunov
0fc1c793fe Kotlin Facet: Support compileKotlinCommon tasks in Gradle importer
#KT-21187 Fixed
2017-11-27 14:36:09 +03:00
Alexey Sedunov
3f66d11624 Kotlin Facet: Fix language/API version initialization
#KT-21180 Fixed
2017-11-27 14:36:09 +03:00
Dmitry Jemerov
200d7f0718 Send API version instead of build number for plugin update checks
#KT-21263 Fixed
2017-11-24 19:39:22 +01:00
Alexey Tsvetkov
a1939c093c Use isolated classloader for in-process compilation
#KT-20233 fixed
2017-11-24 16:17:13 +03:00
Alexey Tsvetkov
0077ab59d6 Remove custom cache version checks from Gradle
#KT-21009 fixed

Cache version could be changed only when compiler is changed.

@InputFiles on `AbstractKotlinCompileTool#computedCompilerClasspath`
ensures that non incremental build is performed when compiler is changed.
2017-11-24 16:17:13 +03:00
Nikolay Krasko
602ac3e816 Refactoring: GradleDependencyInspection -> DeprecatedGradleDependencyInspection 2017-11-24 14:29:03 +03:00
Nikolay Krasko
bfb069b0c5 Warning and quick fix for using jre-artifacts in Maven (KT-20947)
#KT-20947 In Progress
2017-11-24 14:29:03 +03:00
Nikolay Krasko
99f7d605a7 Refactoring: move deprecation information to common place 2017-11-24 14:29:02 +03:00
Nikolay Krasko
0f1e169bd7 Introduce a quick fix for deprecated jre artifact in gradle (KT-20947)
#KT-20947 In Progress
2017-11-24 14:29:02 +03:00
Nikolay Krasko
23afa07e55 Inspection for using deprecated jre artifacts in Gradle (KT-20947)
#KT-20947 In Progress
2017-11-24 14:29:02 +03:00
Nikolay Krasko
4281b5e1b0 Refactoring: extract utility methods to separate class 2017-11-24 14:29:02 +03:00
Nikolay Krasko
64bb40869e Compare testData files with KotlinTestUtils.assertEqualsToFile 2017-11-24 14:29:02 +03:00
Nikolay Krasko
30d8875bdf Check file is valid before search in ScriptDependenciesCache
Otherwise search will fail.
2017-11-24 14:29:02 +03:00
Dmitry Jemerov
7625130b49 SOE protection when enumerating dependencies of common modules
#KT-20937 Fixed
2017-11-23 18:04:28 +01:00
Alexey Tsvetkov
2b708f67ee Add tests for explicit language/api version change in Gradle
Modifying language/api version should cause non-incremental build.
Implicit change (e.g. when versions are not specified, but the compiler
is updated 1.1->1.2) is handled by `AbstractKotlinCompileTool#computedCompilerClasspath`.
Explicit change is handled by `AbstractKotlinCompile#serializedCompilerArguments`.
2017-11-23 14:46:23 +03:00
Alexey Tsvetkov
913a997f24 Rebuild when language/api version is changed (JPS)
#KT-20757 fixed
2017-11-23 14:46:23 +03:00
Alexey Tsvetkov
b1f0f87829 Fix default value for api version string in IC meta info file 2017-11-23 14:46:22 +03:00
Dmitry Savvinov
b8447d6d97 Add test on smartcasts with reified types
This test introduces very special (for current implementation) case,
when we have smartcast indirectly, via some reified type parameter.

It covers recursive call inSmartCastManager.checkAndRecordPossibleCast(),
which wasn't previously covered by any test in testbase.
2017-11-23 12:45:10 +03:00
Dmitry Savvinov
440b6d9934 Add -Xeffect-system CLI argument which enables Effect System 2017-11-23 12:35:51 +03:00
Leonid Startsev
44d232a83c Extension point for synthetic function names contributions 2017-11-23 12:21:47 +03:00
Leonid Startsev
d6e5551237 More entry points for compiler plugins
* In Kotlin/JS JPS compilation
* In kotlin-common CLI compiler
* In kotlin-common gradle build
2017-11-23 12:12:01 +03:00
Nicolay Mitropolsky
07601b2ec4 KtLightAnnotationForSourceEntry: varargs handling improved (KT-21335, EA-107118) 2017-11-23 10:37:24 +03:00
Nicolay Mitropolsky
23344783a5 KtLightAnnotationForSourceEntry: made more verbose with errors in arrays in params (KT-21335, EA-107118) 2017-11-23 10:37:24 +03:00
Alexander Udalov
e43bf90b9c Use CompilerDeserializationConfiguration in JS IC package fragment
This is more correct because it'll allow the incremental package
fragment to be deserialized with the same analysis flags as the changed
sources. Currently it doesn't seem possible to add a reasonable test for
this fix because there are no flags relevant for JS except for
skipMetadataVersionCheck, which is experimental and thus doesn't require
a test
2017-11-22 18:33:04 +01:00
Dmitry Jemerov
fd763bde17 Reorder imports to avoid merge conflict
(cherry picked from commit 4286cce)
2017-11-22 18:30:34 +01:00
Dmitry Jemerov
6586228c15 Logging to catch KT-20937 2017-11-22 16:42:01 +01:00
Mikhail Glukhikh
078c27efa3 Add fallback flag for legacy var smart casts after try #KT-21377 Fixed 2017-11-22 18:31:04 +03:00
Mikhail Glukhikh
8b6e63dc18 Add forgotten new inference to JS 2017-11-22 18:31:03 +03:00
Dmitry Jemerov
dfe5eb65f9 Don't pack any kotlin stdlib classes into kotlin-plugin.jar
#KT-21395 Fixed

(cherry picked from commit 3fbc5ab)
2017-11-22 14:44:01 +01:00
Dmitry Jemerov
e00cc5ab3d Don't crash with old versions of Android Gradle plugin
#KT-21383 Fixed
2017-11-22 14:14:26 +01:00
Simon Ogorodnik
236ba1d2f2 Refactor PerModulePackageCacheService to fix various problems
Original issue here - structure of VfsEvents,
when directory gets deleted, we receive only VFileDeleteEvent
for directory, but not it's content, so we should invalidate
all modules in which sources this directory located, and all
modules that located in such directory

Second problem - When VirtualFile was deleted it is impossible to
get ModuleInfo for it using getModuleInfoByVirtualFile

Third problem - stale references in cache, due cycle dependency

 #KT-20987 Fixed
2017-11-22 16:07:34 +03:00
Mikhail Zarechenskiy
bee7ed1431 [NI] Fix mapping of type arguments to parameters for inner classes 2017-11-22 10:22:41 +03:00
Mikhail Zarechenskiy
e526a87d54 [NI] Make model more robust: remove diagnostics from resolution atoms
Currently there are two major phases in NI that report diagnostics: resolution parts and completion. They connected in method `KotlinCallCompleter.runCompletion` and previously diagnostics were collected in several places, from resolution atoms, partly from constraint system and partly from `CallResolutionResult`, some of them were lost.

 To mitigate this problem, now diagnostics are not bind to the intermediate candidate, only to the result resolution candidate (overloaded or usual one). And all diagnostics are now collected in method `runCompletion`
2017-11-22 10:22:39 +03:00
Nikolay Krasko
6e51c4d5db Disable script dependency updater in AddRequireModuleTest 2017-11-21 18:55:42 +03:00
Nikolay Krasko
a530163074 Add sources for 'reflect' and 'test' libs during JPS config (KT-20956)
#KT-20956 Fixed
2017-11-21 18:55:42 +03:00
Alexey Andreev
ec8adfe7c4 JS: fix referencing outer class from secondary constructor
See KT-21041
2017-11-21 12:22:10 +03:00
Alexey Andreev
88441da131 JS: cache PropertyMetadata objects in property delegates
Also, remove unused PropertyMetadata instances

See KT-20737, KT-20738
2017-11-21 12:21:22 +03:00
Alexey Andreev
7ebfba3722 JS: apply boxing when initializing val parameter of type Char
See KT-20854
2017-11-21 12:20:01 +03:00
Alexey Andreev
32a0221474 JS: refactor code that copies default methods in interfaces to classes
Als fixes KT-21245
2017-11-21 12:18:16 +03:00
Alexey Andreev
38e50e964a JS: fix generation of source map for inline lambda with ignored result
See KT-21309
2017-11-21 12:15:25 +03:00
Nikolay Krasko
d2aabe076d Refactoring: extract jar names in PathUtil and use them in artifacts 2017-11-21 01:11:01 +03:00
Nikolay Krasko
3a90f3618a Don't force configure with kotlin-jdk artifacts for early versions (KT-21028)
#KT-21028 Fixed
2017-11-21 01:11:00 +03:00
Nikolay Krasko
679a460c44 Minor: make sdk version comparison compatible with JDK > 9 2017-11-21 01:10:59 +03:00
Ilya Chernikov
0e5c443894 Move kapt3 embeddable to prepare folder 2017-11-20 22:59:40 +01:00
Ilya Chernikov
6f73e9994b Add kotlin-annotation-processing-embeddable, publish base kapt3 as kotlion-annotation-processing
(cherry picked from commit 148d4e4)
2017-11-20 20:06:43 +01:00
Ilya Chernikov
56542286eb Bring back filtering of jna and shading of jline in embeddable compiler
they were lost during the migration to gradle

(cherry picked from commit 126a6a8)
2017-11-20 19:59:40 +01:00
Alexey Andreev
a9548b1224 JS: fix translation of safe calls to suspend unit functions
See KT-21317
2017-11-20 19:19:24 +03:00
Denis Zharkov
91730e1a9e Do not run search for operator-like names in inspections
It might be rather expensive to search componentN's usages in the whole project
2017-11-20 18:33:46 +03:00
Ilmir Usmanov
0fbbe10143 Support suspendCoroutineUninterceptedOrReturn intrinsic
KT-17336: Fixed
2017-11-20 18:12:41 +03:00
Mikhail Glukhikh
4c583c5a61 Catch InvalidModuleException from getModality() in icon provider
Related to KT-20986
2017-11-18 12:38:25 +03:00
Mikhail Glukhikh
dce7377099 Revert check on module descriptor validness in lookup
Related to KT-20986
2017-11-18 12:35:01 +03:00
Mikhail Glukhikh
e53cedbd6b Throw InvalidModuleException in assertValid() instead of standard ISE 2017-11-18 12:34:59 +03:00
Mikhail Glukhikh
539f8afef3 Style: do not highlight single return when as "Use expresison body" 2017-11-18 12:34:58 +03:00
Nikolay Krasko
c0a3344803 Download jflex from bintray 2017-11-17 17:21:59 +03:00
Mikhael Bogdanov
a547019ed0 Switch DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET according to LL 2017-11-17 13:48:44 +01:00
Alexander Udalov
d386712903 Report pre-release errors if release LV is used
#KT-21267 Fixed
2017-11-17 13:42:36 +01:00
Dmitry Jemerov
64a8008a8a Add icon for multiplatform projects, update JS icon
#KT-19824 Fixed
2017-11-17 13:13:04 +01:00
Mikhail Zarechenskiy
20e1caaab1 [NI] Use refined expected type by smartcasts in CS 2017-11-17 15:04:20 +03:00
Mikhail Zarechenskiy
ca035bc8b8 [NI] Report error from expected type constraint position 2017-11-17 15:04:18 +03:00
Igor Chevdar
d4d3f237ee Fix for package level lateinit properties 2017-11-17 13:48:17 +03:00
Alexey Andreev
89db4dfe79 JS: translate when against enum to JsSwitch when possible 2017-11-17 11:07:41 +03:00
Alexey Andreev
c54c4a6ce8 JS: fix support of JsSwitch in coroutines 2017-11-17 11:07:39 +03:00
Alexey Andreev
678b4c67c1 JS: translate when to JsSwitch when possible
See KT-21160
2017-11-17 11:07:38 +03:00
Alexey Andreev
7b403211dd JS: kotlinize WhenTranslator 2017-11-17 11:07:37 +03:00
Alexey Andreev
b93acb07d2 JS: don't remove debugger statement from coroutine
See KT-19826
2017-11-17 11:07:36 +03:00
Alexey Andreev
21de76f88d JS: fix identifier generation in delegate constructor calls
See KT-21093
2017-11-17 11:07:34 +03:00
Ilya Gorbunov
fdeb916111 Correct exclusions of kotlin-stdlib-js 2017-11-16 20:30:51 +03:00
Ilya Gorbunov
c10771092a Add maven subprojects to the project 2017-11-16 20:30:51 +03:00
Nikolay Krasko
17f0d3b9b3 Revert JetRunConfiguration for compatibility (KT-21296)
#KT-21296 Fixed
2017-11-16 20:14:38 +03:00
Mikhail Zarechenskiy
66064345e9 [NI] Support fallback resolution for refined sams priority feature 2017-11-16 18:07:54 +03:00
Mikhail Zarechenskiy
e42f07b031 [NI] Wait for proper constraints to fix type for callable reference
If expected type is a type variable, then we'll wait for proper constraints, but previously we resolved callable reference as it didn't have expected type at all, because type variable isn't a functional type

 Consider the following example:

 fun foo(i: Int) {}
 fun foo(s: String) {}
 fun <T> id(x: T): T = x

 fun test() {
     val x1: (Int) -> Unit = id(id(::foo))
 }

 Here we shouldn't resolve callable reference until we get constraint from expected type of `x1`
2017-11-16 18:07:51 +03:00
Mikhael Bogdanov
cbfcb74b58 Get rid of cli dependencies from ir 2017-11-16 14:46:53 +01:00
Zalim Bashorov
28e34ac39b Minor: fix IDEA warnings in BasicBoxTest.kt 2017-11-16 15:42:08 +03:00
Zalim Bashorov
291e903ae6 Mark js/js/translator/testData/out-min/ as excluded directory in IDEA
It's required to avoid indexing a lot of js files (> 200MB)
after each run of js tests.
2017-11-16 15:41:45 +03:00
Zalim Bashorov
4849bddde1 KJS: write minification's test results to separate directory
It allows excluding this directory from indexing inside IDEA
and probably simplifies the main workflow.
2017-11-16 15:36:20 +03:00
Alexey Tsvetkov
18261838b6 Avoid deserializing .kotlin_module as class proto
#KT-20184 fixed
2017-11-16 14:47:59 +03:00
Alexander Udalov
c55ac55526 Restore and deprecate JvmFileClassesProvider.getFileClassInternalName
#KT-21270 Fixed
2017-11-16 11:24:11 +01:00
Dmitry Petrov
4193fae9fa Fix floating point comparison generation for range literals 2017-11-16 10:54:25 +03:00
Dmitry Petrov
354d54aef6 Don't generate DUPX instructions for in-range-literal expressions
Store argument into a local variable instead.
2017-11-16 10:54:25 +03:00
Vladimir Kasatkin
9b49e9139c Added samples for map filtering operators (KT-20357)
Fix map transformations sample names.
2017-11-15 23:58:51 +03:00
Ilya Gorbunov
dca23e339a Improve iterator samples, add explanatory comments (KT-20357) 2017-11-15 23:58:49 +03:00
kenji tomita
4d13ea89b2 Add samples for iterator-related extensions (KT-20357) 2017-11-15 23:39:07 +03:00
Ilya Gorbunov
94f77c773c Remove unused function, simplify outdated runtime version tests 2017-11-15 17:53:18 +03:00
Ilya Gorbunov
18611343f2 Do not infer artifact version from build.txt #KT-21150 2017-11-15 17:53:18 +03:00
Ilya Gorbunov
9de6dd814b Docs: clarifications on LazyThreadSafetyMode 2017-11-15 17:41:43 +03:00
Nikolay Krasko
0768e7404b Stop overwriting values with defaults in compiler arguments
'verbose' option was always lost.
2017-11-15 16:12:41 +03:00
Nikolay Krasko
0480042ffd Log incremental options before passing them to kotlin daemon 2017-11-15 16:12:40 +03:00
Nikolay Krasko
643f771c24 Report rebuild reason in rebuild function 2017-11-15 16:12:38 +03:00
Nikolay Krasko
97c1e58149 Minor: reformat too long lines 2017-11-15 16:12:37 +03:00
Alexander Udalov
ad730cedf6 Rename idea/src/META-INF/extensions/{common.xml -> compiler.xml}
To emphasize that this file declares extensions to be registered in the
compiler, not only in the IDE
2017-11-15 11:05:16 +01:00
Alexander Udalov
afc9d3ef8b Remove idea/src/META-INF/extensions/{kotlin2jvm.xml,kotlin2js.xml}
Keep the EnvironmentConfigFiles enum because its values are used in
determining whether the environment is going to be used for JVM or
non-JVM project analysis, but remove the actual files.

Drop EnvironmentConfigFiles.EMPTY and replace its only usage in
preprocessor with JVM_CONFIG_FILES: it's easier and won't affect
anything
2017-11-15 11:05:15 +01:00
Alexander Udalov
7ace303add Fix ambiguity on callable reference for expect members
Expect members should always lose in resolution to non-expect members,
be it simple calls or callable references. Note that there should be
exactly one actual member for each expect member in correct code, so
both ways to check for expect vs non-expect are correct: either before
signature comparison, or after.

 #KT-20903 Fixed
2017-11-15 11:02:29 +01:00
Ilya Gorbunov
27546546fa Minor: specify explicit name for lambda parameter, use also instead of let 2017-11-15 12:01:22 +03:00
Sergey Ryabov
7fe7b6d6e1 Change FileReadWrite to more idiomatic code 2017-11-15 12:01:22 +03:00
Ilya Gorbunov
f4015b48f7 Run configuration for generator: configure-on-demand 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
7c543b6b28 Rewrite array and specialized operations in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
c4ac2548d9 Rewrite Mapping.kt in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
efefa64ac5 Rewrite snapshot and set operations in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
3b6c5880e2 Rewrite range operations in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
c3b894f041 Rewrite Guards, Numeric, SequenceOps, StringJoinOps in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
d2e1baa9d4 Rewrite Ordering.kt in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
ff336cdf84 Rewrite Generators.kt in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
eb2db85c46 Rewrite Filtering.kt in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
d8455ba765 Rewrite Elements.kt in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
012d3804f0 Rewrite Aggregates.kt to the new template DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
dd0e04edd5 Switch production generated stdlib sources to the new DSL and remove old DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
db049c0ab6 Introduce deprecated helpers to ease migration 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
9f57a2c0d5 Make generated code ordered same as before
Allow to fix signature for sorting when overriding it
2017-11-15 09:17:42 +03:00
Ilya Gorbunov
31e00efa8f Legacy mode for non-multiplatform stdlib sources 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
4404257329 Improve new stdlib generator DSL
- Add Kotlin/Native platform.
- Rename classes.
- Introduce TemplateGroup and TemplateGroupBase to group template values.
- MemberBuilder: add support for more properties.
2017-11-15 09:17:42 +03:00
Ilya Gorbunov
e68a6651d2 Prototype new version of stdlib generator template DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
9e34e20338 Refactor stdlib generator: extract common types to be reused in new DSL 2017-11-15 09:17:42 +03:00
Ilya Gorbunov
dcd0a94d76 Minor: fix extra space in return type of chunked and windowed 2017-11-15 09:17:42 +03:00
Pavel V. Talanov
cf2e9c7002 Fix compilation: erroneous import 2017-11-14 20:30:13 +03:00
Pavel V. Talanov
70b22e7f85 Highlighting: never highlight errors for compiled files 2017-11-14 18:29:58 +03:00
Pavel V. Talanov
9db9750e67 Light classes: do not fail when classfile is in src root 2017-11-14 18:29:53 +03:00
Pavel V. Talanov
6667732dd4 Do not hide kotlin class files in source roots
This fixes a problem where file is indexed but querying
    index fails with an exception because file has no PSI

 #KT-21061 Fixed
2017-11-14 18:26:53 +03:00
Pavel V. Talanov
8696b37cdb Minor, tests: make collection synchronized
Attempt to fix flaky test test that use LightClassComputationControl
2017-11-14 17:47:55 +03:00
Denis Zharkov
1f9d56439a Fix KNPE caused by optimizations in control-flow analysis
The problem is that when performing full analysis we do it in
a backward order while result for trivial vals is filled
in a forward one.

It turns out that reversedInstuctions might return a superset of
forward traversed instructions, e.g. in case of dead code in lambda.

At the same time result for trivial vals is constant
for any instruction, thus we can just return its constant value
and use it in the full analysis

 #KT-20895 Fixed
2017-11-14 16:38:28 +03:00
Denis Zharkov
2a0b937aac Revert "Add diagnostic for unexpected KNPE in control-flow analysis"
This reverts commit f24f0017a0.
2017-11-14 16:37:24 +03:00
Denis Zharkov
f24f0017a0 Add diagnostic for unexpected KNPE in control-flow analysis
See KT-20895
2017-11-14 16:32:34 +03:00
Pavel V. Talanov
ae2b0325a3 Restore and deprecate old ScriptTemplatesProvider EP 2017-11-14 16:30:42 +03:00
Pavel V. Talanov
6fed779782 Reload gradle script definitions
Reloading in the following scenarios:
- Successful gradle sync following a failure to load definitions
- Gradle settings changed in IDE (via settings UI)
2017-11-14 16:30:40 +03:00
Pavel V. Talanov
4906c850af Reload script definitions on compiler settings changes
Provide API to track compiler settings changes
2017-11-14 16:30:37 +03:00
Pavel V. Talanov
ef539bd89d Tests: use standard script definition in cli tests by default 2017-11-14 16:30:35 +03:00
Pavel V. Talanov
cdfdc1d19b Refactor script definitions loading
Make ScriptDefinitionProvider an interface
    and provide different implementation for cli and IDEA
Rework ide extension point to a simpler interface (ScriptDefinitionContributor)
Move template loading logic into a top level function
Allow script definitions to be reloaded in IDE
2017-11-14 16:30:33 +03:00
Pavel V. Talanov
f063254cc1 GradleScriptDefaultDependenciesProvider: better name filter 2017-11-14 16:30:30 +03:00
Pavel V. Talanov
df74fb23f8 ScriptDependenciesCache: limit simultaneously cached script count
Do not schedule updates for dependencies of scripts that were not requested
   (opened in the editor or such) for some time
This fixes a problem when vcs updates changing scripts can trigger
   undesired script dependencies updates
   (probable cause of script files never highlighted correctly in some cases)
Refactor: use VirtualFile instead of String and move code from GradleScriptTemplateProvider
2017-11-14 16:30:28 +03:00
Dmitry Jemerov
f67e01db1c Generate 'expectedBy' dependency instead of 'implement' (KT-21006) 2017-11-14 14:09:25 +01:00
Vyacheslav Gerasimov
64f29a7bd5 Move KDsl gradleFrameworkSupport and moduleBuilder to gradle.xml
#KT-21236 Fixed Target versions 1.2.20
2017-11-14 14:52:19 +03:00
Ilmir Usmanov
f4e180556c Fix assignment codegen for suspend operators plus and plusAssign
KT-16079: Fixed
2017-11-14 14:49:26 +03:00
Mikhail Zarechenskiy
fbe274ff09 [NI] Use less specific type for captured type approximation
This is needed to be more compatible with the old NI
2017-11-14 14:40:47 +03:00
Mikhail Zarechenskiy
f3ef961be6 [NI] Report error about non-spread parameter from arguments mapper 2017-11-14 13:55:48 +03:00
Mikhail Zarechenskiy
13ee0f8eda [NI] Don't forget to report error about mixing different kinds of args
Also use more safe way to report errors: only if there is corresponding PSI element. This is not very useful for compiler, but in IDE we can get synthetic calls with null psi arguments
2017-11-14 13:54:58 +03:00
Mikhail Zarechenskiy
2aa8ceb005 [NI] Fix state for named arguments in arguments to parameters mapper 2017-11-14 13:54:51 +03:00
Dmitry Petrov
15ac471626 Treat accessors to JvmStatic methods as having no dispatch receiver
#KT-21246 Fixed
2017-11-14 09:59:16 +03:00
Dmitry Petrov
db2aad1857 Rewrite correctContainerForLambda using uninitializedClasses 2017-11-14 09:33:28 +03:00
Dmitry Petrov
e38bbbfc13 Drop local interfaces support in ExpressionCodegen
Local interfaces are prohibited since 1.0.
2017-11-14 09:33:28 +03:00
Dmitry Petrov
4365084645 Lookup for local variables taking into account uninitialized this
Consider a context with uninitialized this, e.g.:

  fun foo() {
    val x = "..."
    class Local(y: String) : Base(L@{ x + y })
  }

Lambda 'L' is an argument of a super class constructor call.
Here 'this@Local' is not initialized yet. Thus local variables captured
in 'Local' can't be used. Instead, they should be captured by lambda 'L'
itself.

Note that lambda 'L' sees both 'x' and 'y' as local variables that
should be captured.

When in context with uninitialized this (generating arguments for super
type constructor or delegating constructor call), and a variable in
question is not found in the current context, use enclosing local lookup
to determine whether a local variable should be captured by a closure.
2017-11-14 09:33:28 +03:00
Dmitry Petrov
ff0a2562e0 Minor: LocalLookup: lookupLocal -> isLocal 2017-11-14 09:33:28 +03:00
Dmitry Petrov
2d56837409 Minor: answer -> capturedVariable 2017-11-14 09:33:28 +03:00
Dmitry Petrov
47b59496da Minor: CodegenContext.isContextWithUninitializedThis() 2017-11-14 09:33:28 +03:00
Dmitry Petrov
bbb0389c51 Fix determining enclosing class for closure
Enclosing class for closure is a class whose instance is captured by
closure as an outer 'this', and stored in a field 'this$0'.
Usually enclosing class for closure is an immediate outer class,
including classes for nested closures. For example:

  class C {
    fun foo() {}
    val example1 = L1@ { foo() }
    // Enclosing class for lambda 'L1' is 'C'
    val example2 = L2a@ { L2b@ { foo() } }
    // Enclosing class for nested lambda 'L2b'
    // is a closure class for outer lambda 'L2a'
  }

However, if the closure is created in a super type constructor call for
the outer class, corresponding instance is considered "uninitialized",
and can't be used as a proper class instance, and can't be referenced:
corresponding code is rejected by front-end.

  class Outer {
    fun foo() {}
    inner class Inner : Base(L3@ { foo() })
    // Enclosing class for lambda 'L3' is 'Outer',
    // because 'Inner' is uninitialized in super type constructor call.
  }

In CodegenAnnotatingVisitor, we maintain a stack of currently
uninitialized classes, and chose enclosing class for closure
as an inner-most surrounding class with initialized instance.

When generating code for this or outer class instance, we skip
contexts corresponding to classes with uninitialized instances.

This fixes a number of bytecode verification errors caused by incorrect
enclosing class for closure.

 #KT-4174 Fixed Target versions 1.2.20
 #KT-13454 Fixed Target versions 1.2.20
 #KT-14148 Fixed Target versions 1.2.20
2017-11-14 09:33:28 +03:00
Dmitry Petrov
6648657e65 Override accept(...) in KtConstructorDelegationCall 2017-11-14 09:33:28 +03:00
Dmitry Petrov
ac761a03c5 Minor: calleeContainingClass -> thisOrOuterClass 2017-11-14 09:33:28 +03:00
Dmitry Petrov
92e0ea2553 Minor: CodegenContext utils 2017-11-14 09:33:28 +03:00
Mikhael Bogdanov
dff6e943bb Always do stack spilling during inline cause of dex problem
Dex issue: https://issuetracker.google.com/issues/68796377

  #KT-20844 Fixed
2017-11-13 16:50:24 +01:00
Mikhail Zarechenskiy
519e5c33d8 [NI] Support assigning single array elements in named form to varargs 2017-11-13 16:47:05 +03:00
Mikhail Zarechenskiy
fe2499b47f [NI] Approximate flexible types with enhancement as usual ones
This is temporary and should be fixed later
2017-11-13 16:35:24 +03:00
Mikhail Zarechenskiy
82d43c23b6 [NI] Perform full type checking in NI if there is no contradiction
In NI type checking actually performs in constraint system. To be conservative, now we still perform full type cheking but only if there is no contradiction in constraint system
2017-11-13 16:33:20 +03:00
Mikhail Zarechenskiy
f51f7a0fe4 [NI] Report diagnostic about receiver as super expression 2017-11-13 16:33:08 +03:00
Mikhail Zarechenskiy
1d6e9c244b [NI] Report diagnostic about spread argument to non vararg parameter 2017-11-13 16:32:58 +03:00
Mikhail Zarechenskiy
d45f4e71de [NI] Don't try to search methods on undefined integer type 2017-11-13 16:31:22 +03:00
Mikhail Zarechenskiy
4ad885afb0 [NI] Correctly propagate base constraint system of invoke call
Consider the following example:

class A {
  operator fun <T> invoke(): Foo<T> = throw Exception()
}

fun foo(f: Foo<Int>) {}

fun test(a: A) {
  foo(a()) // after resolve of `invoke`, it has non-fixed type variable
}
2017-11-13 16:31:04 +03:00
Mikhail Zarechenskiy
28e539b158 Simplify CompilerTestLanguageVersionSettings: merge two maps into one 2017-11-13 16:27:26 +03:00
Mikhail Zarechenskiy
cd2d32d92a Set up specific LV settings for compiler tests
For example, to configure NI

(cherry picked from commit e0c6aec)
2017-11-13 16:27:25 +03:00
Mikhail Zarechenskiy
91a6591b70 Load compiler language version settings for resolved calls tests 2017-11-13 16:27:24 +03:00
Mikhail Zarechenskiy
20bf238006 Load compiler language version settings for codegen tests 2017-11-13 16:27:23 +03:00
Mikhail Zarechenskiy
85d442133d Load compiler language version settings for foreign annotations tests
To set specific features for compiler tests
2017-11-13 16:27:22 +03:00
Mikhail Zarechenskiy
63b13027df Configure pseudocode tests with !LANGUAGE directive
Except all, it's also useful to use one class of language version settings for compiler tests to configure it specially for tests
2017-11-13 16:27:20 +03:00
Mikhail Zarechenskiy
ef1d1ef946 Enable new inference feature by system property for tests only 2017-11-13 16:27:19 +03:00
Mikhail Zarechenskiy
fbbe396881 Add configuration key to enable new inference for compiler tests 2017-11-13 16:27:18 +03:00
Mikhail Zarechenskiy
0b484771dd Add compiler key to enable new inference 2017-11-13 16:24:34 +03:00
Mikhail Zarechenskiy
84ac5a3e22 Use separate directive to check results of descriptor renderer for NI 2017-11-13 16:24:33 +03:00
Mikhail Zarechenskiy
b6542caf47 Setup system property for NI tests with parameter -PnewInferenceTests 2017-11-13 16:23:05 +03:00
Mikhail Zarechenskiy
0410287cf9 Add flag to force loading old inference diagnostics 2017-11-13 16:23:05 +03:00
Mikhail Zarechenskiy
6486c8dccc Add ability to reuse one diagnostic test file for old and new inference 2017-11-13 16:23:05 +03:00
Mikhail Zarechenskiy
73b4e24d54 Introduce language feature for NI, remove old setting 2017-11-13 16:23:04 +03:00
Toshiaki Kameyama
27e7f13335 Fix AssertionError on completing after template in string literal
#KT-16402 Fixed
2017-11-13 16:01:34 +03:00
Simon Ogorodnik
0560ba7929 KT-19943: Remove redundant type conversions in J2kPostProcessing
Don't remove them in converter itself
2017-11-13 15:54:33 +03:00
a2kaido
083c3d8a5d KT-19943: Remove redundant special type unboxing calls in J2K
#KT-19943 Fixed
2017-11-13 15:54:33 +03:00
Konstantin Bulenkov
65cc5f1589 Change run icon in gutter to standard one from IJ Platform 2017-11-13 13:16:22 +01:00
Alexander Udalov
6f276c623b Do not use IntelliJ extensions for uninitialized variable suppressor in JS 2017-11-13 13:04:54 +01:00
Alexander Udalov
6f90a0545c Do not use IntelliJ extensions for declaration without body suppressor in JS 2017-11-13 13:04:54 +01:00
Alexander Udalov
7f81601123 Do not use IntelliJ extensions for unused parameter suppressor in JS 2017-11-13 13:04:54 +01:00
Alexander Udalov
d782c8a644 Use ServiceLoader instead of IntelliJ extensions for ScriptHelper 2017-11-13 13:04:54 +01:00
Alexander Udalov
20d13411e0 Remove obsolete extension point implementations
- There's no class with FQ name
  org.jetbrains.kotlin.resolve.jvm.AnalyzeCompleteHandlerExtension anymore
- There's no substring classBuilderInterceptorExtension anywhere else in
  the project
2017-11-13 13:04:54 +01:00
Toshiaki Kameyama
2be27d5380 KT-19390: Fix char + String in Java is converted to code with multiple type errors in Kotlin (#1235)
#KT-19390 Fixed
2017-11-13 14:13:34 +03:00
Mikhail Glukhikh
1e940bde01 Lookup element factory: do not use outdated descriptor
Probably #KT-20986 Fixed
2017-11-13 14:10:58 +03:00
Mikhail Glukhikh
f43360177a Minor refactoring of ResolveElementCache #KT-21132 Fixed
Get rid of SoftValueMap.containsKey
2017-11-13 14:10:58 +03:00
Ilya Gorbunov
f51974b271 Minor fix in comparison samples #KT-20357 2017-11-10 23:32:20 +03:00
scache
96e322c7d5 Add samples for Comparisons #KT-20357 2017-11-10 23:32:06 +03:00
Ilya Gorbunov
e16a0ba650 Improve and group samples for operations on Iterables #KT-20357 2017-11-10 23:31:50 +03:00
kenji tomita
75348dd0c0 Add samples for Iterables #KT-20357 2017-11-10 23:31:31 +03:00
Alexey Belkov
5da1b4c566 Minor: fix sample name (KT-20357) 2017-11-10 23:29:39 +03:00
Alexander Udalov
2572d27921 Regenerate tests 2017-11-10 20:01:48 +01:00
Alexander Udalov
b5fa520aa5 Remove obsolete version override mechanism and increment-version.kts 2017-11-10 18:58:32 +01:00
Alexander Udalov
36026d3f16 Minor, remove obsolete jdkPath 2017-11-10 18:58:32 +01:00
Alexander Udalov
208e68a968 Move strip-kotlin-annotations script to buildSrc
... and invoke it directly in kotlin-reflect's build file, instead of
running another instance of compiler to evaluate a script. Also only
strip kotlin.Metadata, since it's the only annotation with heavy
metadata on Kotlin-generated class files
2017-11-10 18:58:32 +01:00
Alexander Udalov
38bee07fd0 Remove obsolete protobuf-lite building scripts
This logic is now present in
custom-dependencies/protobuf-lite/build.gradle
2017-11-10 18:58:31 +01:00
Alexander Udalov
d26486b7df Move JvmRuntimeDescriptorLoaderTest to core/descriptors.runtime/tests
This allows to get rid of the dependency on descriptors.runtime from
compiler/IDE tests which is problematic: classes there clash with the
classes in kotlin-reflect, which reference declarations in shadowed
packages
2017-11-10 18:58:31 +01:00
Alexander Udalov
02981038f3 Split core into descriptors, descriptors.jvm, deserialization, descriptors.runtime 2017-11-10 18:58:31 +01:00
Alexander Udalov
328e906b57 Rename source set "descriptor.loader.java" -> "descriptors.jvm"
The new name is more convenient and precise because this module is no
longer only about loading declarations from Java, it also contains
implementation of loading Kotlin declarations from .class files, as well
as type mapping abstractions, JVM ABI specifications, etc.
2017-11-10 18:58:31 +01:00
Alexander Udalov
51e00eb05e Move descriptors.runtime sources to package kotlin.reflect.jvm.internal
To make it obvious that this is a part of kotlin-reflect and should not
be packed into the compiler jar. Also copy 'classId' utility to
AbstractLocalClassProtoTest to minimize dependencies on
kotlin.reflect.jvm.internal

Note that the module itself is still needed and can't be merged into
kotlin-reflect because of the way it's used in
AbstractJvmRuntimeDescriptorLoaderTest
2017-11-10 18:58:31 +01:00
Alexander Udalov
4cb8a3a6b7 Remove obsolete workaround for jansi clash issue
This was needed to workaround KT-17031 which is now fixed
2017-11-10 18:58:31 +01:00
Alexander Udalov
c519e33a25 Remove ultimate/.idea
kotlin-ultimate is no longer used as a separate project since it's
merged into the main Gradle project
2017-11-10 18:58:31 +01:00
Alexander Udalov
1c2fee8764 Remove obsolete non-compiler-tests.iml 2017-11-10 18:58:31 +01:00
Alexander Udalov
81756150dd Update .idea/codeStyles/Project.xml for latest IDEA 2017-11-10 18:08:10 +01:00
Ilmir Usmanov
0f9a21d429 Add regression test for KT-17640 2017-11-10 19:16:06 +03:00
Mikhael Bogdanov
ad80d1239f Properly process special names for local function in LocalLookup 2017-11-10 13:42:40 +01:00
Mikhael Bogdanov
5250d947e7 Update android emulator images 2017-11-10 13:42:40 +01:00
Toshiaki Kameyama
b8c5d1b852 Fix "add <*>" quick-fix for inner class with generic outer one
So #KT-20763 Fixed
2017-11-10 15:34:17 +03:00
Mikhail Glukhikh
7b2a66c006 Convert 'simplify when' from intention to inspection
Related to KT-20492
2017-11-10 15:34:11 +03:00
Toshiaki Kameyama
df86ff7115 Introduce "Simplify when" intention where one branch is always true
So #KT-20492 Fixed
2017-11-10 15:34:08 +03:00
Denis Zharkov
26ba2ab3db Postpone creating DataFlowValue until they're really needed
Unfortnutately DataFlowValueFactory::createDataFlowValue isn't very cheap,
so it's better to avoid these calls when it's possible
2017-11-10 13:01:13 +03:00
Denis Zharkov
714a057e3b Minor. Drop unused DataFlowExtras::possibleTypes 2017-11-10 13:01:13 +03:00
Denis Zharkov
b4499d52ee Introduce OpenAddressLinearProbingHashTable to be used in binding context
See comments in the implementation for clarification
2017-11-10 13:01:13 +03:00
Mikhael Bogdanov
5d84aec8f7 Clean dependencies in 'tests-java8' module 2017-11-10 09:46:41 +01:00
Mikhael Bogdanov
ce62991c5a Add test-ir-jvm module 2017-11-10 09:46:40 +01:00
Ilya Gorbunov
598dc1af04 Introduce deployRepo parameter to override deploy-repo set by teamcity
Currently it isn't possible to do that from command line.
2017-11-10 00:14:25 +03:00
Simon Ogorodnik
cf9b7d0f42 Set unit test mode to false in production environment 2017-11-09 21:38:47 +03:00
Ilya Gorbunov
e801390c7a Fix intellij-community revision JFlex is downloaded from
Because it was removed in master
2017-11-09 17:58:54 +03:00
Anton Bannykh
4d12426145 JS: use ANT replace task to set $version
Needed make kotlin-test depend on the same version of kotlin
2017-11-09 15:10:12 +03:00
Mikhael Bogdanov
af784dcd47 Update android test dependencies 2017-11-09 11:38:10 +01:00
Ilya Gorbunov
b2627f53a3 Fix resources clashes in ultimate plugin tests
Rollback tests-jar configuration to extend testCompile instead of testRuntime.
Otherwise an unwanted main artifact from the runtime configuration gets added to the
artifacts of tests-jar configuration.

Exclude transitive dependencies of projectTests(":idea")
2017-11-08 19:05:36 +03:00
Ilya Gorbunov
24c982de9b Make project dependency shortcuts return ProjectDependency
to enable further configuration.
2017-11-08 19:03:40 +03:00
Mikhael Bogdanov
416392bb74 Don't propagate reified markers for special enum functions
#KT-18254 Fixed
2017-11-08 15:35:44 +01:00
Mikhael Bogdanov
800cc63347 Remove external finally block interval on splitting during inline
#KT-20433 Fixed
2017-11-08 15:35:43 +01:00
Alexey Andreev
f51709e61c Clean-up application from EncodeSignatureTest
Hopefully, this fixes random failing tests
2017-11-08 16:13:07 +03:00
Alexey Andreev
779af375a7 JS: fix inlining of array constructor expressed via typealias
See KT-20978
2017-11-08 16:12:16 +03:00
Alexey Andreev
ec53f9b254 JS: don't emit short circuit operators for boolean and/or
See KT-21004
2017-11-08 16:10:57 +03:00
Vyacheslav Gerasimov
16b9a376b6 Android Lint: Run AnalysisScope.toSearchScope under read action 2017-11-07 20:11:19 +03:00
Vyacheslav Gerasimov
d6d20a5b5d Android Lint: Don't check files unrelated to Android modules
#KT-21064 Fixed
2017-11-07 20:11:19 +03:00
Alexey Sedunov
ba0b21d1a3 Add @JvmStatic Intention: Support functions/properties in objects
Also eliminate unnecessary object instance references on Java call sites

 #KT-20095 Fixed
2017-11-07 19:25:03 +03:00
Alexey Sedunov
cfad305826 Misc: Fix deserialization of CommonCompilerArguments.freeArgs
#KT-20938 Fixed
2017-11-07 19:25:02 +03:00
Alexey Sedunov
0bd267111e Kotlin Facet: Fix language/API version initialization 2017-11-07 19:25:02 +03:00
Ilya Gorbunov
a005f4804e Strengthen deprecation for CharSequence.size in JS 2017-11-07 18:59:33 +03:00
Ilya Gorbunov
9305903e6c Remove deprecated pairwise function
It was replaced with zipWithNext.
2017-11-07 18:59:33 +03:00
Nikolay Krasko
329322e268 Increase stub version because of change in overload sorting
See commit f197f36e23
2017-11-07 18:00:23 +03:00
Mikhail Glukhikh
6c2eb06351 Do not report "unused receiver" on companion objects
So #KT-19560 Fixed
2017-11-07 17:28:13 +03:00
Nikolay Krasko
84ab397f25 Restrict 172 plugin to 172 ide only 2017-11-07 13:30:00 +03:00
Nicolay Mitropolsky
fab8187574 UAST: Complex test data moved to separate file (KT-20990) 2017-11-06 19:59:50 +03:00
Nicolay Mitropolsky
9730d50e10 UAST: yet another fight with string literals in string literals (KT-20990) 2017-11-06 19:59:50 +03:00
Alexey Andreev
132285ea03 JS: optimize loop over array.withIndex()
See KT-20932
2017-11-03 17:36:05 +03:00
Alexey Andreev
1be86e05ae JS: optimize range check for int and long
See KT-2218

Additionally, fix temporary variable elimination for && and ||
2017-11-03 17:35:17 +03:00
Alexey Andreev
43302ce00c JS: add missing members to kotlin.js.Date
See KT-20694
2017-11-03 17:31:25 +03:00
Alexey Andreev
0a31b4ccc1 JS: improve declarations for JSON object
See KT-20580
2017-11-03 17:31:22 +03:00
Alexey Andreev
bd7129d0d6 JS: fix non-abstract extension properties in interfaces
KT-20994
2017-11-03 17:29:44 +03:00
Pavel V. Talanov
9e061d3bbb Fix light class exception on empty multifile facade
Fix generating multifile facade with all members private (in bytecode)
leading to delegate not being generated for corresponding light class

 #KT-20966 Fixed
2017-11-03 16:44:53 +03:00
Alexey Sedunov
b20ffe76b7 Navigation: Support "Navigate/Related Symbol" for expects/actuals
#KT-20952 Fixed
2017-11-03 16:34:36 +03:00
Alexey Sedunov
b2e5e9dab5 Highlighting: Support implicit 'it' references
#KT-21002 Fixed
2017-11-03 16:34:36 +03:00
Alexey Sedunov
d1eaf444a6 Line markers: Do not show package in "Choose actual for" popup
#KT-20953 Fixed
2017-11-03 16:34:35 +03:00
Alexey Sedunov
327caa086b Gradle: Do not rely on isQualifiedModuleNamesEnabled() to predict module name
IDEA 173 uses resolve-level setting to control naming of imported modules

 #KT-20985 Fixed
2017-11-03 16:34:35 +03:00
Alexander Udalov
3ead2e9cd4 Use KotlinCoreEnvironment.createForTests in test code
createForProduction creates and caches JavaCoreApplicationEnvironment
instance, which can alter behavior of subsequent tests
2017-11-03 14:03:02 +01:00
Alexander Udalov
dddd1cdba5 Use JUnit 3 + KtUsefulTestCase instead of JUnit 4 in compiler tests
This is needed because KtUsefulTestCase performs useful cleanup at the
end of the test (namely, resets ApplicationManager#ourApplication to
null)
2017-11-03 14:03:02 +01:00
Alexander Udalov
3049b5d92f Remove logging in KotlinSuppressCache.isSuppressedByAnnotated
It produces lots of useless output in stderr when tests are run with
Gradle in the terminal
2017-11-02 17:15:59 +01:00
Alexander Udalov
b43b470b8f Move Java 8 tests generator to tests-java8, run it in "Generate Compiler Tests" 2017-11-02 17:13:05 +01:00
Alexander Udalov
f52ba44e90 Move JS tests generator to :js:js.tests, run it in "Generate Compiler Tests"
Also cleanup generateTestDataForReservedWords and make everything there
private
2017-11-02 17:12:46 +01:00
Alexander Udalov
8c6ed3e872 Generate IR tests in GenerateCompilerTests.kt 2017-11-02 17:12:46 +01:00
Ilya Gorbunov
61b78d7eda Make projectTests type of dependency transitive on testRuntime dependencies
`tests-jar` configuration now extends testRuntime instead of testCompile
(note that testRuntime extends testCompile),
and projectTests() dependency shortcut makes it transitive.

This is required to depend on test utility modules producing `-tests` jar instead of default one
without listing all their transitive dependencies.
2017-11-02 18:19:52 +03:00
Ilya Gorbunov
3cfb1fd6a7 Simplify dependency setup for jvm6 codegen test server 2017-11-02 18:18:58 +03:00
Simon Ogorodnik
339d06d040 Improve diagnosticMissingPackageFragment reporting
Single execution path to report missing package fragment problems

Split failures on PluginDeclarationProviderFactory site by
known reasons to improve exception analysis
2017-11-02 16:31:43 +03:00
Alexander Udalov
56a51c1d22 Do not treat annotation classes as interfaces in bridges codegen
From Kotlin's point of view, everything in annotation classes is
non-abstract. A class inheriting from an annotation has a non-abstract
fake override for each property of the annotation class constructor. But
because members of annotation classes themselves were considered as
abstract in the bridge-generating code (see
DescriptorBasedFunctionHandle.isAbstract), there was a situation where a
concrete fake override has only one declaration among overridden
descriptors and it was abstract. This situation is invalid (a concrete
fake override must have exactly one concrete super-declaration),
therefore an exception was thrown.

The fix is to avoid considering annotation class members abstract for
the purposes of bridge generation. It's reasonably safe because no
bridges should be ever generated for annotation subclasses anyway,
because annotations can only have members with simple return types
(final and non-generic).

Note that in KT-19928, the problem is reproducible because of an
incorrect "inexact analysis" in light classes where "Target" is resolved
to an annotation class kotlin.annotation.Target. This behavior of the
analysis in light classes seems to do no harm otherwise, so it's not a
goal of this commit to change anything in that regard

 #KT-19928 Fixed
2017-11-02 14:02:09 +01:00
Mikhail Glukhikh
8f98f00030 Explicit / implicit this: analyzeFully --> analyze 2017-11-02 14:07:57 +03:00
Mikhail Glukhikh
6a7cdc01a6 Fix 'this' case in implicit this inspection 2017-11-02 14:07:55 +03:00
Mikhail Glukhikh
64a51fe0d1 Implicit this inspection: minor cleanup 2017-11-02 14:07:46 +03:00
Kirill
89c4196c06 Add inspections for implicit and explicit 'this' #KT-4580 Fixed 2017-11-02 14:07:45 +03:00
Ilmir Usmanov
817f79520a Implement coroutineContext intrinsic
This intrinsic allows coroutine to access its context without suspention
and, furthermore, disabling tail-call optimization.
KT-17609: Fixed
2017-11-02 12:45:24 +03:00
Toshiaki Kameyama
0fffb9fb17 Introduce inspection for callables with implicit 'Nothing?' type
Inspection is reported only for vars and open callables
So #KT-21023 Fixed
2017-11-02 12:21:14 +03:00
Mikhail Glukhikh
bcbeab00d5 Slightly change IntentionBasedInspection status
Only constructor and not the whole class is now deprecated
2017-11-02 12:21:13 +03:00
Toshiaki Kameyama
9ea9ea1008 Add quick fix to add required target to annotation #KT-20484 Fixed 2017-11-02 11:07:53 +03:00
Toshiaki Kameyama
204d9e3423 Introduce inspection detecting self-assignment of properties
So #KT-20714 Fixed
2017-11-02 11:07:52 +03:00
Vyacheslav Gerasimov
ffa9478d0c Configure Kotlin: add mavenCentral() to repositories
Since kotlin stdlib depends on artifacts from mavenCentral() we should add it
 #KT-18719 Fixed
2017-11-01 23:57:20 +03:00
Ilya Gorbunov
093f796fc7 Write compiler and stdlib versions from gradle build 2017-11-01 17:26:18 +03:00
Ilya Gorbunov
6fe299cd5b Fix core:builtins:serialize task outputs 2017-11-01 17:09:10 +03:00
Ilya Gorbunov
be63f09f8f Remove some workarounds for extra properties and signing,
use new syntax for maven repo definition.
2017-11-01 17:09:10 +03:00
Ilya Gorbunov
4d4285824b Use Gradle 4.3 2017-11-01 17:09:10 +03:00
Dmitry Savvinov
e17610f378 Don't throw on recursion when computing member scope
When recursion is detected while computing
`ClassResolutionScopesSupport.scopeForMemberDeclarationResolution`,
create 'ThrowingLexicalScope' (as with other scopes), instead of
throwing ISE immediately. That allows to report error properly in cases
like in KT-18514

#KT-18514 Fixed
2017-11-01 15:57:56 +03:00
Simon Ogorodnik
d6143e2af6 Fix testData broken after KT-12797 2017-10-31 21:11:19 +03:00
Simon Ogorodnik
0a4860b4d7 Add instrumentation to locate not cleared MockApplication 2017-10-31 20:25:00 +03:00
Mikhail Glukhikh
f6a7327758 Remove ultimate tests from "Generate All Tests" configuration 2017-10-31 18:21:53 +03:00
Mikhail Glukhikh
50ebcfe09e Test generator: return back forgotten convert line separators 2017-10-31 18:05:20 +03:00
Dmitry Petrov
c2b9803933 Generate source information for synthesized data class members
For now, bind such elements to data class declaration.

 #KT-20443 Fixed
2017-10-31 17:34:32 +03:00
Dmitry Jemerov
44260cdc7c Working recognition of JUnit annotation in MP tests
(cherry picked from commit 3a21781)
2017-10-31 14:45:09 +01:00
Alexander Udalov
2ed3e88561 Create descriptors with Kotlin package name in decompiler/cls stub builder
(cherry picked from commit b2620d1)
2017-10-31 14:44:52 +01:00
Dmitry Jemerov
f93f502ebe Read package name in KotlinClassHeader and use it in decompiler
(cherry picked from commit 119d5ab)
2017-10-31 14:44:39 +01:00
Mikhail Glukhikh
d59276671f Related to KT-20631: don't report redundant blank Unit in lambda 2017-10-31 16:38:55 +03:00
Toshiaki Kameyama
0fd4cdb086 Fix false positive for "redundant super" in data class #KT-20981 Fixed 2017-10-31 15:15:19 +03:00
Mikhail Glukhikh
63ad89eeb0 Minor cleanup 2017-10-31 15:03:55 +03:00
Toshiaki Kameyama
ef71f7707d Introduce inspection to detect use of Unit as a standalone expression
So #KT-20631 Fixed
2017-10-31 14:51:06 +03:00
Toshiaki Kameyama
5f4233e4bf Don't suggest "Remove explicit type specification" for an annotated type
So #KT-20622 Fixed
2017-10-31 14:37:36 +03:00
Alexander Udalov
fbda2a4343 Do not use MockLibraryUtil in AbstractTopLevelMembersInvocationTest
MockLibraryUtil runs the compiler in the new class loader, which is
useful for IDE tests to avoid loading KotlinCoreEnvironment, but is not
needed and is suboptimal for compiler tests.

Also use another method in AbstractForeignAnnotationsTest to assert that
there are no files in the compiled libraries
2017-10-31 07:36:46 +01:00
Alexander Udalov
a64fc10e94 Extract compiler-executing code in AbstractCliTest to CompilerTestUtil 2017-10-31 07:36:46 +01:00
Alexander Udalov
8695c6a1e4 Extract GenerateCompilerTests out of GenerateTests
Rename the run configuration "Generate Tests" -> "Generate All Tests"
2017-10-31 07:36:46 +01:00
Alexander Udalov
d0274c3c53 Extract 'test-generator' module out of 'generators'
Also avoid using intellij API where kotlin-stdlib can be used instead
2017-10-31 07:36:45 +01:00
Alexander Udalov
d79b571781 Rename ultimate's GenerateTests -> GenerateUltimateTests, regenerate 2017-10-31 07:36:45 +01:00
Alexander Udalov
8786c951a6 Move compiler/tests-common-jvm6/{src -> tests}, adjust dependencies 2017-10-31 07:36:45 +01:00
Alexander Udalov
33549362cb Move compiler/tests-common/{src -> tests}, adjust dependencies 2017-10-31 07:36:45 +01:00
Alexander Udalov
c2276e2ccb Rename module ':compiler.tests-common' -> ':compiler:tests-common' 2017-10-31 07:36:45 +01:00
Alexander Udalov
ef00807a18 Refactor test class name computation in GenerateTests
Allow to pass the FQ name of the base test class, instead of the Class
object (to avoid dependencies on other modules)
2017-10-31 07:36:45 +01:00
Dmitry Jemerov
c009f94eea Restore task dependency which is needed to run the plugin correctly 2017-10-31 02:48:18 +01:00
Alexander Udalov
959299eeab Use project.findProperty instead of project.property where nullable is fine
findProperty throws MissingPropertyException if there's no such property
2017-10-30 15:53:06 +01:00
Alexander Udalov
ccd7bfa337 Add project property to change port for codegen tests on different JDKs 2017-10-30 15:40:17 +01:00
Alexander Udalov
152bcda2c8 Regenerate gradle/project-schema.json 2017-10-30 15:39:53 +01:00
Alexander Udalov
dfd24d166c Update bootstrap to 1.2.0-dev-439 2017-10-30 15:38:38 +01:00
Simon Ogorodnik
213ce01152 Update testData for completion, broken after KT-13220 2017-10-30 17:31:15 +03:00
Ilya Gorbunov
f878fa69c1 Android codegen tests: fix android SDK path in local.properties
The path should have slashes instead of backslashes even on Windows.
2017-10-30 16:48:39 +03:00
Ilya Gorbunov
1af692c957 Code style settings format changed in IDEA 173 2017-10-30 16:46:24 +03:00
Dmitry Petrov
cbef372e69 Recapture shared variables when calling local class constructor
When a local function or class A creates an instance of a local class B
capturing an outer variable 'x', it should use ref for 'x', but not the
value of 'x'.
2017-10-30 15:19:13 +03:00
Dmitry Petrov
7a156e4407 Give unique names to fields for captured local functions
When a local function is captured, corresponding field accesses are
later transformed by the inliner. It doesn't have enough information to
restore the original semantics completely, so it has to rely on field
names. Local functions can be overloaded or can have names matching
local variable names, in both cases we generated fields with the same
name for captured values.

Now, we use the same '$<local-class-number>' suffix for field names for
local functions as it is present in the corresponding local class name.
This allows to distinguish captured local functions from captured local
variables and between different overloads of a function with the same
name.

 #KT-19827 Fixed
 #KT-18639 Fixed
2017-10-30 15:19:13 +03:00
Dmitry Petrov
da99a100cc Additional constructor call normalization tests 2017-10-30 15:19:13 +03:00
Mikhail Glukhikh
149daa173c Do not report "unused receiver" on operator and infix functions
So #KT-16340 Fixed
2017-10-30 15:07:39 +03:00
Alexander Udalov
54990e16c1 Report error if tools.jar is not found in javac-wrapper 2017-10-30 12:36:55 +01:00
Mikhail Glukhikh
561d7749b1 Choose implementing module correctly in "create actual fix"
Take implements / expectedBy dependency into account
So #KT-20803 Fixed
2017-10-30 14:13:10 +03:00
Mikhail Glukhikh
f0da58531e Enhance AbstractQuickFixMultiModuleTest
Handle same files at different source roots correctly
2017-10-30 14:12:27 +03:00
Mikhail Glukhikh
cfd432614f Cleanup: QuickFixMultiModuleTest 2017-10-30 14:12:25 +03:00
Mikhail Glukhikh
64dbe07fdb Cleanup: UnusedReceiverParameterInspection 2017-10-30 14:12:16 +03:00
Alexey Andreev
1f643ddce8 JS: add test to prove that KT-11910 is not reproducible anymore 2017-10-30 13:12:12 +03:00
Alexey Andreev
6b43465ed8 JS: add tests to check if super.equals/hashCode works properly
See KT-8226
2017-10-30 13:12:10 +03:00
Alexey Andreev
e9e01b70a8 JS: fix super access to simple non-overridable properties
See KT-7653
2017-10-30 13:12:09 +03:00
Alexey Andreev
e488cf13ad JS: fix FE crashing when type argument count less than parameter count
See KT-20908
2017-10-30 13:10:35 +03:00
Alexey Andreev
a6e98c30d7 JS: fix crash when js function contains assignment with bad LHS
Fix KT-20905
2017-10-30 13:08:35 +03:00
Nicolay Mitropolsky
a11cf253df UAST: correct processing of string literals in string literals (KT-20990) 2017-10-30 11:29:51 +03:00
Yoshinori Isogai
11f9c055fd KT-20591: Show annotations in parameter info (#1358)
Show annotations in parameter info

 #KT-20591 Fixed
2017-10-27 22:59:04 +03:00
Alexander Udalov
2c4e023cba Minor, use extracted variable in LateinitIntrinsics.kt 2017-10-27 18:06:43 +02:00
Nikolay Krasko
d75656d571 Additional tests for overloads with type aliases and suspend
Failed attempts to reproduce KT-20782, but still may be useful.
2017-10-27 15:09:52 +03:00
Nikolay Krasko
2d7fe98e55 Don't resort deserialized descriptors based on renderer, preserve proto order
Use only names and types for sorting. Otherwise if deserialized descriptor
is rendered different from origin we might get Psi-Stub mismatch error.

Use the original proto order for declarations with same name and kind.

 #KT-20782 Fixed
 #EA-109887 Fixed
2017-10-27 15:09:04 +03:00
Nikolay Krasko
1408c4bd44 Fix testdata for ParcelQuickFixTestGenerated 2017-10-27 14:56:03 +03:00
Nikolay Krasko
3186c31ba7 Initialize delegate runner before access in filter method 2017-10-27 14:56:02 +03:00
Denis Zharkov
2df4d9496a Fix incorrect UNINITIALIZED_ENUM_COMPANION diagnostic
#KT-20959 Fixed
2017-10-27 09:36:00 +03:00
Sergey Ryabov
b3b08514c5 Use consistent explicit FileTreeWalk named parameters 2017-10-27 05:38:43 +03:00
Artem Zinnatullin
b565b00930 Fix Gradle plugin task name in readme. 2017-10-27 02:55:44 +03:00
Sergey Ryabov
d6504d82b7 Fix the doc for String.format and String.Companion.format 2017-10-27 02:53:09 +03:00
Ilya Zorin
5541634187 Explicitly set utf-8 encoding for JavaCompile tasks 2017-10-26 21:34:50 +03:00
Ilya Gorbunov
e8e09dbbf8 Various improvements in collection samples #KT-20357
Merge some related samples,
add sample for building a sequence from Enumeration similar to building a list from Enumeration.
2017-10-26 21:28:47 +03:00
Alexey Belkov
72354559e5 Provide samples for list, collection and array related functions #KT-20357 2017-10-26 21:28:47 +03:00
Alexey Sedunov
97332aaeea MPP: Support Mocha/Protractor run configuration for common modules
This is useful when they are implemented by JavaScript modules
2017-10-26 20:59:40 +03:00
Alexey Sedunov
3319fdba6d Gradle: Import test output path for JavaScript modules 2017-10-26 20:59:40 +03:00
Nikolay Krasko
ef274ad43b Don't build light classes when usages in Kotlin local scope requested 2017-10-26 17:58:07 +03:00
Nikolay Krasko
189e2506d1 Refactoring: extract isOnlyKotlinSearch function 2017-10-26 17:58:06 +03:00
Nikolay Krasko
55996fa43d Minor: extract scope initialization out of cycle 2017-10-26 17:58:05 +03:00
Dmitry Petrov
28535a57d8 Fix issues with enum entry self-reference
Given a singleton class 'S' with possibly uninitialized static instance
(enum entry, interface companion object).
Such singleton can be referenced by name, or as an explicit or implicit
'this'.
For a given singleton class 'S' we
either use 'this@S' from context (local or captured),
or 'S' as a static instance.

Local or captured 'this@S' should be used if:
  - we are in the constructor for 'S',
    and corresponding instance is initialized
        by super or delegating constructor call;
  - we are in any other member of 'S' or any of its inner classes.

Otherwise, a static instance should be used.
2017-10-26 16:11:58 +03:00
Dmitry Jemerov
dd9f12d2e5 Removed dependencies on removed tasks 2017-10-26 14:23:56 +02:00
Dmitry Jemerov
a1949e1d53 Add formatting rule for array literals
#KT-19599 Fixed
2017-10-26 14:10:12 +02:00
Nikolay Krasko
6420f50f2e Fix accessing nullable location() method 2017-10-26 13:15:51 +03:00
Ilya Gorbunov
3fe2298855 Do not run android codegen tests with plugin, introduce a separate task 2017-10-25 21:37:24 +03:00
Ilya Gorbunov
6c5d78d8d5 Remove deprecated build tasks 2017-10-25 21:37:24 +03:00
Ilya Gorbunov
ace9d0da94 Finalize math function parameter names
#KT-4900
2017-10-25 21:30:03 +03:00
Alexey Andreev
bbcf4f7caf JS: raise metadata version due to incompatible changes in 1.2 runtime 2017-10-25 20:18:04 +03:00
Alexey Andreev
85945e0a6d JS: add getFunctionById intrinsic 2017-10-25 20:18:04 +03:00
Alexey Andreev
aae67e154a JS: add intrinsic for !!. Use it instead of ternary conditionals
See KT-2976
2017-10-25 20:18:03 +03:00
Simon Ogorodnik
8631e898a7 KT-12797: Fix completion to show inner classes from base class
#KT-12797 fixed
2017-10-25 18:07:37 +03:00
Simon Ogorodnik
5778ace6b0 KT-20166: Replace type name when caret is at the end of param name
When caret is at the end ('f<caret>: Foo'), tokenAt was COLON,
not IDENTIFIER

#KT-20166 fixed
2017-10-25 18:07:01 +03:00
Simon Ogorodnik
d12f5c79a1 KT-20506: Fix completion suggests the same value recursively
Check for excludeNonInitializedVariable via PSI, not by
descriptors equality, because of bindingContext caching

#KT-20506 fixed
2017-10-25 18:05:46 +03:00
Simon Ogorodnik
cf160b5a07 Cleaner way to insert whitespace in doc comment 2017-10-25 17:54:48 +03:00
Simon Ogorodnik
98310d3bdb KT-20884: Support receiver reference in KDoc comments
#KT-20884 fixed
2017-10-25 17:54:47 +03:00
Simon Ogorodnik
94e39a4c6c KT-20888: Do not report missing documentation when inherit from lib
Find KDoc using DescriptorToSourceUtilsIde when required

 #KT-20888 fixed
2017-10-25 17:54:46 +03:00
Simon Ogorodnik
fb876e398c Correctly detect visibility in KDocMissingDocumentationInspection
#KT-20887 fixed
 #KT-20889 fixed
2017-10-25 17:54:45 +03:00
Simon Ogorodnik
f21e1c60e0 KT-20883: Add more details to MissingDocumentationInspection message
#KT-20883 fixed
2017-10-25 17:54:43 +03:00
Simon Ogorodnik
d28e9fd22d KT-20880: Fix AddDocumentationFix to add multiline comment
#KT-20880 fixed
2017-10-25 17:54:42 +03:00
Denis Zharkov
be630f93dd Postpone full resolution for a candidate known to be failed
It's necessary for performance, because there are some resolution
parts that actually can be omitted and at the same time they aren't
very cheap (like inference or value arguments types checking)
2017-10-25 16:33:04 +03:00
Nikolay Krasko
6a43743c98 Configure new projects with kotlin-stdlib-jdk7/8 (KT-20286)
No migration for old projects has been added yet.

 #KT-20286 Fixed
2017-10-25 15:01:10 +03:00
Pavel V. Talanov
b7b3caedcc IDELightClassContexts: fix light member mismatch on InlineOnly members 2017-10-25 14:48:32 +03:00
Mikhael Bogdanov
54d1a85430 Disable 'apiVersionAtLeast1.kt' test on Android 2017-10-25 13:43:48 +02:00
Mikhael Bogdanov
33c0e16b83 Disable some test on Android 2017-10-25 12:26:41 +02:00
Alexander Udalov
e73760d4ff Fix test data for empty LHS vs isInitialized
Ignore the "property imported from object" part on JS
2017-10-25 12:10:10 +02:00
Dmitry Petrov
42945d33ee Use !LANGUAGE directive in tests for enhanced nullability 2017-10-25 12:30:32 +03:00
Dmitry Petrov
706a3698ec Add box tests for new nullability assertions 2017-10-25 12:30:32 +03:00
Dmitry Petrov
2a7d555be4 Minor: move nullability assertion tests javaInterop/notNullAssertions 2017-10-25 12:30:32 +03:00
Dmitry Petrov
57602c420d Sanitize declaration return types
On JVM, strip @EnhancedNullability annotation from inferred types for
functions, properties, and local variables, so that these annotations
do not "escape" from Kotlin declarations.
2017-10-25 12:30:32 +03:00
Dmitry Petrov
2b924f44d8 Generate assertions for expressions with enhanced nullability
If an expression with type annotated with @EnhancedNullability is used
as a function expression body, or property initializer, or variable
initializer, and corresponding type can not contain null,
generate nullability assertions for this expression.
2017-10-25 12:30:32 +03:00
Dmitry Petrov
6c47b4a39c Language feature for nullability assertions on enhanced nullability 2017-10-25 12:30:32 +03:00
Alexey Tsvetkov
313cd4f7bc Turn off IC for multiplatform projects by default
Multiplatform IC is enabled when a corresponding platform property is enabled
and 'kotlin.incremental.multiplatform' is set to `true`.

See KT-20840
2017-10-25 01:12:34 +03:00
Ilya Chernikov
caca7c67f4 Fix "base" jar and "public" jar tasks archive name conflict
fixes KT-20877
2017-10-24 20:28:54 +02:00
Ilya Gorbunov
b88d74d29b Remove annotation processor example from maven build
It is already built with gradle and used only in gradle tests
2017-10-24 20:35:53 +03:00
Ilya Gorbunov
f456fa9697 Adjust gradle jvmargs
Remove memory options for gradle daemon and instead give more memory to kotlin compile daemon.
2017-10-24 20:35:50 +03:00
Ilya Gorbunov
97cf09b45a Do not fail build on TC when some tests fail, just report problem
Required to have green builds with failing tests muted.
2017-10-24 20:35:47 +03:00
Ilya Gorbunov
84c0e8dfb4 Enable coroutines in kotlin-stdlib-common 2017-10-24 20:35:43 +03:00
Ilya Gorbunov
40574949c7 Postpone some task configuration to execution phase 2017-10-24 19:59:45 +03:00
Ilya Gorbunov
b1dcab886b Remove deprecated task 2017-10-24 19:59:45 +03:00
Ilya Gorbunov
25988957f7 Remove duplicated string-to-number conversion tests
Actual ones are in StringNumberConversionTest.kt
2017-10-24 19:59:45 +03:00
Vyacheslav Gerasimov
b27334d2a0 Remove GradleProjectImportProvider and GradleProjectOpenProcessor 2017-10-24 19:50:19 +03:00
Nicolay Mitropolsky
1fa5152cb7 UAST: Fix for unsafe cast for class initializer (EA-109918) 2017-10-24 19:39:38 +03:00
Alexander Udalov
1a8be635b9 Use ServiceLoader instead of IntelliJ extensions for DefaultErrorMessages
#KT-10473 Fixed
2017-10-24 18:25:38 +02:00
Alexander Udalov
1c6dce3674 Do not use DefaultErrorMessages.Extension as IntelliJ extension in plugins 2017-10-24 18:22:04 +02:00
Alexander Udalov
58631053c7 Fix project scope "IDE" after migration to Gradle build
See https://www.jetbrains.com/help/idea/scope-language-syntax-reference.html
2017-10-24 18:22:04 +02:00
Alexey Tsvetkov
e83f1b138b Perform non-IC build when JS lib is changed 2017-10-24 16:28:57 +03:00
Mikhael Bogdanov
be6474593d Additionally run android tests with enabled D8 2017-10-24 15:26:21 +02:00
Mikhael Bogdanov
dd24ba6978 Convert CodegenTestsOnAndroidRunner to Kotlin 2017-10-24 15:26:21 +02:00
Mikhael Bogdanov
37300f7486 Rename CodegenTestsOnAndroidRunner.java to CodegenTestsOnAndroidRunner.kt 2017-10-24 15:26:20 +02:00
Mikhael Bogdanov
6f5d459e09 Reorganize build logic in AndroidTestGenerator.kt 2017-10-24 15:26:20 +02:00
Mikhael Bogdanov
e151b8f641 Update Android tests 2017-10-24 15:26:19 +02:00
Dmitry Jemerov
499cfb5772 Show "No SDK configured" notification only in JVM modules 2017-10-24 14:52:12 +02:00
Alexey Sedunov
8a9e28afdc Kotlin Facet: Ensure that API version <= language version after import
#KT-20603 Fixed
2017-10-24 15:43:52 +03:00
Alexey Sedunov
840825704a Misc: Skip duplicates in navigation tests 2017-10-24 15:43:52 +03:00
Alexey Sedunov
4cc1e22a5a Misc: Support light-methodless members in overrider search
In particular, support line markers for expect-class members
and navigation to expect-class members from corresponding base members
2017-10-24 15:43:51 +03:00
Alexey Sedunov
17abce2811 Misc: Support light-classless classes in inheritors search
In particular, support line markers for expect-classes
and navigation to expect-classes from their base class

 #KT-20329 Fixed
2017-10-24 15:43:51 +03:00
Alexey Sedunov
87f3d24f9b Misc: Protect freeArgs with FreezableVar 2017-10-24 15:43:51 +03:00
Alexey Sedunov
fa4e4cbb42 Formatter: Insert new line before/after type alias
#KT-20766 Fixed
2017-10-24 15:43:51 +03:00
Dmitry Petrov
f23dfdc0ac Mark operands of POP2 as don't touch in unused expression elimination
Fixes KT-20879.
2017-10-24 15:38:15 +03:00
Dmitry Jemerov
537600b3b3 Add dependency to kotlin-test-annotations-common to new MP projects
#KT-20833 Fixed
2017-10-24 14:18:34 +02:00
shiraji
d51fa6d87e Add description for MoveMemberToTopLevelIntention 2017-10-24 14:33:55 +03:00
Alexander Udalov
bafc75ade4 Fix isInitialized receiver generation for empty LHS
#KT-20774 Fixed
2017-10-24 11:26:01 +02:00
Mikhail Zarechenskiy
73b3efd628 Remove LANGUAGE_VERSION directive from blackBox codegen tests 2017-10-24 11:44:02 +03:00
Mikhail Zarechenskiy
7a934d74e5 Support !LANGUAGE directive in codegen tests
LANGUAGE_VERSION directive will be removed later, for now it's left for simplicity
2017-10-24 11:44:02 +03:00
Mikhail Glukhikh
1ed8aa1cc5 Drop CheckPartialBodyResolveAction 2017-10-24 10:06:09 +03:00
Mikhail Glukhikh
5a6f22cc95 Make editor in SelfTargetingIntention.invoke nullable
This prevents EA-105844 from happening.
Should fix KT-20899.
2017-10-24 10:05:10 +03:00
Dmitry Petrov
68870a16bb Remove CLI help on 'preserve-class-initialization' mode
See https://youtrack.jetbrains.com/issue/KT-19532#comment=27-2492178
2017-10-24 09:36:56 +03:00
Ilya Gorbunov
75c8b787c2 Fix maven tests
- Add required extra dependencies to install to local repo before test.
- Remove expected warning about runtime bundled into compiler because it is no more.
- Fix basedir reference in kapt-allopen test.
- Fix reflection tests after deprecated members removal.
2017-10-23 21:23:36 +03:00
Ilya Gorbunov
25feb23cfa Update maven-invoker-plugin to deal with missing mvn.bat in maven 3.3 2017-10-23 21:23:13 +03:00
Alexander Udalov
f2be34ca1c Support KClass<*> annotation arguments in serialization/deserialization
#KT-11586 Fixed
2017-10-23 19:16:44 +02:00
Mikhail Glukhikh
d0e8f99d60 ResolveElementCache: script can now be analyzable parent
So #KT-20096 Fixed
2017-10-23 19:19:04 +03:00
Simon Ogorodnik
cace6624e6 EA-105522, KT-20256: Fix TextRange.<init> "Invalid range specified"
Check when caret inside template, and don't try to create invalid
range then

 EA-105522 fixed
 #KT-20256 fixed
2017-10-23 17:32:39 +03:00
shiraji
31a1fb916a Implement an intention action to move a companion object member to top level
#KT-18828 Fixed

(cherry picked from commit 11f8f8b)
2017-10-23 17:29:28 +03:00
shiraji
7044e46756 Refactor common move member methods
(cherry picked from commit 2dd8148)
2017-10-23 17:29:27 +03:00
Alexey Andreev
6adb62f3a2 JS: prohibit declaration names that clash with JS builtin functions
See KT-18095, KT-17475, KT-18105, KT-5259
2017-10-23 17:19:52 +03:00
Alexey Andreev
e0eea15a4c Fix JS tests failing on Windows 2017-10-23 17:19:51 +03:00
Alexey Andreev
e1f8bac4d5 JS: several bugfixes in incremental compilation
1. Fix exported packages sometimes being mixed up
2. Fix metadata losing package fragments sometimes
3. Don't serialize empty packages to .meta.js
4. Preserve order of package fragments in .meta.js
5. In IC tests, compare textual representation of metadata rather
   than binary representation
2017-10-23 17:19:51 +03:00
Alexey Andreev
2fbecfdd9c Support generation of relative path in JS source maps in JPS builder
See KT-20820
2017-10-23 17:19:50 +03:00
Alexey Andreev
cb0482f53e JS: fix crash when js function contains for statement w/o initializer
Fix KT-20898
2017-10-23 17:19:49 +03:00
Alexey Andreev
d9d565d8b0 JS: use 'external' word instead of 'native' in diagnostic messages
See KT-20639
2017-10-23 17:19:48 +03:00
Nicolay Mitropolsky
8a34c48d56 AbstractUastTest: findUElementByTextFromPsi refactored for readability 2017-10-23 16:44:43 +03:00
Nicolay Mitropolsky
8e17bab56f UastKotlinPsiVariable: factory methods reformatting 2017-10-23 16:44:43 +03:00
Dmitry Jemerov
81615fa551 Correctly propagate dependencies in multiplatform projects with Android 2017-10-23 14:59:56 +02:00
Dmitry Jemerov
cc85ac44b3 Rename KotlinPlatformGradleDetector to KotlinGradleModelFacade 2017-10-23 14:59:56 +02:00
Dmitry Jemerov
f589c9baf0 Ignore "module per source set" option in Android projects 2017-10-23 14:59:56 +02:00
Dmitry Jemerov
14a30e09c6 Use binary path instead of name to locate libraries from Android deps 2017-10-23 14:59:56 +02:00
Toshiaki Kameyama
e76d8bc793 "Convert object literal to class" should create inner class if necessary #KT-20091 Fixed 2017-10-23 15:02:51 +03:00
Nicolay Mitropolsky
299a4b7f69 UAST: Fix for unsafe cast for annotation (EA-109738) 2017-10-23 10:57:00 +03:00
Nicolay Mitropolsky
c5fa7fb217 UAST: tests utils for bottom-top finding UElements moved to AbstractUastTest.kt 2017-10-23 10:57:00 +03:00
Zalim Bashorov
f9809d5a73 Minor: replace IGNORE_BACKEND with TARGET_BACKEND for the test what should be run only on JVM
The test was written to check the case for Platform Types which now exists only on JVM.
2017-10-20 21:02:10 +03:00
nickl
6a659f33b5 UastKotlinPsiVariable psiParent made lazy to eliminate recursion when building UAST parents 2017-10-20 19:46:49 +03:00
Anton Bannykh
b2e53644a5 JPS JS: fix friend path detection in projects imported from Gradle (KT-18963 fixed) 2017-10-20 19:16:14 +03:00
Mikhail Glukhikh
739b21f519 Introduce "add missing actual members" quick-fix #KT-18449 Fixed 2017-10-20 17:24:19 +03:00
Mikhail Glukhikh
1b0421d27b Fix search scope during inlining #KT-20251 Fixed
Do not use KotlinSourceFilterScope because build scripts are lost otherwise
2017-10-20 16:00:52 +03:00
Mikhail Glukhikh
26c1aec5df Related to DSGN-4505: change expect / actual icons to the new ones 2017-10-20 15:16:04 +03:00
Mikhail Glukhikh
4b8c04a3d6 Minor: fix typo 2017-10-20 15:16:03 +03:00
Toshiaki Kameyama
fa03632197 Convert lambda to reference: handle named arguments more precisely
For trailing lambda intention inserts parameter names for all arguments
if at least one argument used default value.
Otherwise it just keeps existing named arguments.

So #KT-20349 Fixed
2017-10-20 13:57:58 +03:00
Kirill Rakhman
4c4427c280 Replace return@forEach with continue in ConvertForEachToForLoopIntention
So #KT-17332 Fixed
2017-10-20 13:44:31 +03:00
Denis Zharkov
da52716bfd Fix wrong nullability enhancement for annotated java.lang.Object type
Effectively, this commit drops cached value for j.l.Object type
This cache was introduced when types were immutable, but they
became mutable after starting reading top-level TYPE_USE annotations,
that lead to changing shared JAVA_LANG_OBJECT_CLASSIFIER_TYPE instance

 #KT-20826 Fixed
2017-10-20 09:43:38 +03:00
Alexey Tsvetkov
3c9ef6d319 Compile kotlin-android-extensions-runtime for JDK 1.6 2017-10-20 00:02:46 +03:00
Sergey Igushkin
b921eb5cc9 Fix null returned from listFiles and not handled correctly.
(cherry picked from commit 8147ae8)
2017-10-19 23:30:15 +03:00
Anton Bannykh
e90c914802 JS: add kotlin-test testCompile dependency to JS module generated by multiplatform wizard (KT-20346, KT-20831, KT-20832 fixed) 2017-10-19 18:32:24 +03:00
Dmitry Savvinov
5b9b8778b5 Minor: rename 'mapToPlatformClasses' -> 'mapToPlatformIndependentClasses' 2017-10-19 18:21:56 +03:00
Dmitry Savvinov
58b815d842 Fix false USELESS_CAST in function with expression body
Note that current behaviour is made similar to the case with
properties initializers/accessors, which means that more complex
cases are not covered yet (see KT-20801) #KT-20802 fixed.
2017-10-19 18:21:56 +03:00
Dmitry Savvinov
a1778a7da8 Fix CAST_NEVER_SUCCEEDS when casting Nothing to some type 2017-10-19 18:21:56 +03:00
Nikolay Krasko
bd2fd1758f Use CompilerPathsEx.getOutputPaths for getting the full list of output dirs (KT-20789)
CompilerPathsEx.getOutputPaths isn't using OrderEnumerationHandler extension
so far and works badly when delegating runnners to gradle is enabled.

 #KT-20789 Fixed
2017-10-19 17:43:36 +03:00
Kartik Patodi
dc6c19d7ef Normalize files that are gotten from FileUtil.createTempDirectory
It's required to avoid getting different paths inside tools (compiler, ant etc) and in tests.
2017-10-19 16:12:13 +03:00
Ilya Chernikov
5284db8088 Add compiler proguard rule for keeping ProgressManager used in webdemo 2017-10-19 13:55:00 +02:00
Sergey Mashkov
fd12bd904b KT-20822 Maven: import multiplatform projects properly 2017-10-19 13:29:26 +03:00
Alexey Andreev
b781661279 JS: fix copying functions with default arguments across interfaces
Copy function to super interface first, then copy from interface
to class. Add interface set to JsClassModel for this purpose.

See KT-20625
2017-10-19 13:10:47 +03:00
Alexey Andreev
d4ea4983d8 JS: support integer overflow semantics for unary minus operator
See KT-19290
2017-10-19 12:59:09 +03:00
Dmitry Petrov
f25a5b5177 Use -Xnormalize-constructor-calls=enable for Kotlin/JVM compilation only 2017-10-19 11:17:56 +03:00
Simon Ogorodnik
7a991ddc25 KT-13220: Add completion for variable names
Using parameter name completion

#KT-13220 fixed
2017-10-18 19:11:13 +03:00
Alexey Sedunov
e65adeb029 Misc: Fix quickfix test data 2017-10-18 18:17:50 +03:00
Alexey Sedunov
b8fb002a8f Misc: Update keyword completion test data
It reflects top-level lateinit variables available since 1.2
2017-10-18 18:17:50 +03:00
Alexey Sedunov
d89a946c5a Misc: Update default language version in Maven import test 2017-10-18 18:17:50 +03:00
Alexey Sedunov
d6ee9c9068 Misc: Update member hierarchy test data to include new stdlib classes 2017-10-18 18:17:50 +03:00
Alexey Sedunov
83b10403d7 Misc: Drop test for implementing abstract members in expect-class
The "not implemented" error is not reported for such classes, so
quick fix is not available anymore (see KT-16099)
2017-10-18 18:17:50 +03:00
Alexey Sedunov
997aa12bcc Misc: Update configuration test data 2017-10-18 18:17:50 +03:00
Alexey Sedunov
2883a92b93 Create from Usage: Work around type renaming
This fixes test failure after changes in KotlinTypeFactory
2017-10-18 18:17:49 +03:00
Alexander Udalov
6820509f83 Regenerate gradle/project-schema.json 2017-10-18 12:48:16 +02:00
Alexander Udalov
6e410cb182 Make TypeConstructor.isFinal return false for enums
The reason is that before dc02b2e3ab and 8a0dcca957,
TypeConstructor.isFinal for some class descriptors
(DeserializedClassDescriptor, LazyJavaClassDescriptor,
MutableClassDescriptor) were implemented as `isFinalClass` (which is
`modality == FINAL && kind != ENUM_CLASS`), and all others as
`modality == FINAL` or simply true/false. This led to differences in
behavior depending on the exact instance of the class descriptor.
Now that TypeConstructor.isFinal is always `modality == FINAL`, some
tests (PseudoValueTestGenerated) fail because the finality of some type
constructors changed and these tests render final vs non-final type
constructors differently.

In this commit, TypeConstructor.isFinal is now made to behave safer,
i.e. considering enum class type constructor to be non-final (as was the
case earlier for some ClassDescriptor instances). Some diagnostics might
disappear (e.g. FINAL_UPPER_BOUND) but it doesn't look like a big deal
2017-10-18 12:45:45 +02:00
Alexander Udalov
825aff7ac6 Minor, do not produce trailing spaces in AbstractPseudoValueTest 2017-10-18 12:45:45 +02:00
Pavel V. Talanov
320c5f6f3a Try to approximate "build.gradle.kts" script dependencies on first access
This is a hacky solution to prevent whole file being highlighted as unresolved while we wait for gradle response
2017-10-17 18:49:48 +03:00
Pavel V. Talanov
1cdac78b32 ScriptDependenciesCache, refactor: use delegated properties 2017-10-17 18:49:40 +03:00
Alexey Tsvetkov
896dacc835 Fix android extensions maven dependencies
`kotlin-android-extensions-runtime` and `kotlin-android-extensions-compiler`
had `com.google.android:android` as a provided dependency, but
during transition to Kotlin Gradle build the dependency was declared
as `runtime` instead of `compileOnly`.
2017-10-17 18:35:28 +03:00
Ilya Gorbunov
eaa3b3ccf0 Enable publishing for kotlin-annotations-android 2017-10-17 17:32:22 +03:00
Stanislav Erokhin
0a2421d453 Disable annotation processor for javac by default in whole project 2017-10-17 17:25:25 +03:00
Sergey Igushkin
d453a2fc92 Use runtimeJar configuration instead of default for plugin markers. 2017-10-17 14:37:11 +03:00
Andrey Breslav
a0da37fd41 Fix the description file 2017-10-17 12:13:22 +02:00
Anton Bannykh
f92c4b7704 Fixed indentation 2017-10-17 13:04:35 +03:00
Anton Bannykh
6d6ce7cbab JS: publish to NPM sourcemaps and *.kjsm files 2017-10-17 13:04:35 +03:00
Nikolay Krasko
6804409fc5 Fix idea version to 2017.2.5 (172.4343.14) 2017-10-17 12:33:01 +03:00
Nikolay Krasko
0ce4873312 Extract variable for idea download 2017-10-17 12:33:01 +03:00
Nikolay Krasko
c4e3cc0705 Add read action for getting text
Fix "Read access is allowed... exception"
2017-10-17 12:33:01 +03:00
Nikolay Krasko
339b1a3895 Minor: cleanup 2017-10-17 12:33:01 +03:00
Nikolay Krasko
3fda173ced TypeDeclarationProvider should return null for irrelevant symbols
Otherwise other providers won't be checked.
2017-10-17 12:33:01 +03:00
Alexey Sedunov
9fe0681fb6 MPP: Fix implementing module search in Gradle runner 2017-10-16 23:55:28 +03:00
Alexey Sedunov
db34bae05b Gradle: Support 'expectedBy' configuration 2017-10-16 23:55:28 +03:00
Alexey Sedunov
a2a8335bab Gradle: Add dependencies for indirectly implemented modules
#KT-16926 Fixed
2017-10-16 23:55:28 +03:00
Sergey Igushkin
0a808528b7 Fix missing ReflectUtil, call the ctor through reflection manually. 2017-10-16 21:48:38 +02:00
Sergey Igushkin
e94e62be98 Add android-extensions-compiler content to kotlin-android-extensions 2017-10-16 21:48:36 +02:00
Ilya Chernikov
431d47a605 Fix dependencies rewriting and gradle integration tests after applying rewriting 2017-10-16 21:48:36 +02:00
Ilya Chernikov
050403d15b Use rewriteDeps task on the projects with runtime dependency on embeddable compiler...
which are using shaded dependencies
2017-10-16 21:48:35 +02:00
Ilya Chernikov
fb70227868 Move embeddable compiler shading logic to buildSrc, implement rewriteDeps task
the task takes a jar an a shading task (like the one that creates embeddable
compiler) and rewrites jar's dependencies to the shaded ones according the
the shade task.
2017-10-16 21:48:34 +02:00
Ilya Chernikov
5babf89245 Remove original jar artifact from archives when adding a new one by runtimeJar tasks 2017-10-16 21:48:33 +02:00
Yan Zhulanow
6fb1e269b4 Minor: Fix build, add missing Android library dependency JARs 2017-10-16 22:43:09 +03:00
Yan Zhulanow
43a1162b25 Evaluate: Fix for evaluating local variables captured by an inline function (KT-17514) 2017-10-16 21:25:44 +03:00
Yan Zhulanow
fed5bddde2 Android Extensions: Initial IC support (KT-14125) 2017-10-16 21:25:42 +03:00
Yan Zhulanow
1b5b9f1fbb Kapt: Support 'correctErrorTypes' in annotations (KT-19518) 2017-10-16 21:25:41 +03:00
Yan Zhulanow
91ed130286 Add additional diagnostic for EA-107110 2017-10-16 21:25:40 +03:00
Yan Zhulanow
58571dcf1d Fix KNPE in evaluator (EA-89384) 2017-10-16 21:25:39 +03:00
Yan Zhulanow
8c7f469030 Parcelable: Use @IgnoredOnParcel annotation instead of Transient cause it's inapplicable on properties (KT-20298) 2017-10-16 21:25:37 +03:00
Yan Zhulanow
cafd99660a Minor: Make class abstract to get rid of the warning in tests 2017-10-16 21:25:36 +03:00
Yan Zhulanow
27d3ed76a0 Android Extensions: Support non-latin identifiers (KT-20299) 2017-10-16 21:25:34 +03:00
Yan Zhulanow
eefad896a0 Kapt: Mark 'kapt.kotlin.generated' as a source root automatically in Android projects (KT-20269) 2017-10-16 21:25:33 +03:00
Yan Zhulanow
50ab054883 Kapt: Preserve kapt plugin options if there are also options from compiler plugins (KT-20257) 2017-10-16 21:25:32 +03:00
Yan Zhulanow
d89143e641 Kapt: Report info log messages as warnings
Otherwise the log messages are not visible until the "--info" options is provided in Gradle.
2017-10-16 21:25:31 +03:00
Yan Zhulanow
2034b1f075 Parcelable: Provide quick fixes for custom Parceler support 2017-10-16 21:25:29 +03:00
Yan Zhulanow
a63aca08f2 Parcelable: Support custom Parcelers in compiler plugin 2017-10-16 21:25:27 +03:00
Yan Zhulanow
7dbefc1613 Remove generic bound for Parceler 2017-10-16 21:25:25 +03:00
Yan Zhulanow
a4f06c9fa8 Kapt: Do not inline R.resType.resName constants in annotations (KT-18791) 2017-10-16 21:25:24 +03:00
Mikhail Glukhikh
eba2fdfe89 Fix inline test 2017-10-16 21:06:18 +03:00
Stanislav Erokhin
fde1ac5575 Add test for ExpectedTypeFromCast feature 2017-10-16 20:10:57 +03:00
Mikhail Glukhikh
3fb0354676 Minor: add / fix comments (related to KT-20752) 2017-10-16 20:00:47 +03:00
Alexey Andreev
46526db8f0 JS: fix behaviour of char-returning functions with multiple inheritance
See KT-19772
2017-10-16 18:56:33 +03:00
Ilya Gorbunov
13d6e96c2f Do not pack build.txt into jars, leave it only in artifact zip bundles 2017-10-16 18:48:09 +03:00
Ilya Gorbunov
3bea095618 Remove maven poms that are no longer submodules of the main project 2017-10-16 18:48:09 +03:00
Ilya Gorbunov
ef3b0e0ff0 Add kotlin-test parent project 2017-10-16 18:48:09 +03:00
Ilya Gorbunov
13086b4347 Exclude node_modules dir from kotlin-stdlib-js project
Minor: shorter IdeaModel configuration.
2017-10-16 18:48:09 +03:00
Ilya Gorbunov
65d9b0edb3 Migrate settings and run configurations from the former libraries subproject 2017-10-16 18:48:09 +03:00
Ilya Gorbunov
341edc3f86 Fork java compiler to ensure forkOptions are used 2017-10-16 18:48:09 +03:00
Ilya Gorbunov
93efc51843 Fix the obsolete form of -Xdump-declarations-to argument 2017-10-16 18:48:09 +03:00
Stanislav Erokhin
b9fa8d4d96 Support parenthesized left expression for ExpectedTypeFromCast 2017-10-16 18:28:57 +03:00
Pavel V. Talanov
539e655802 PluginDeclarationProviderFactory: improve diagnostic
Attempting to catch EA-103048
2017-10-16 18:18:36 +03:00
Mikhail Glukhikh
e73e4dcc6a Delay elvis-bound smart casts to version 1.3 2017-10-16 16:21:46 +03:00
Mikhail Glukhikh
a55c6f0c95 Don't register safe cast type info for unstable values
Important: to be removed in 1.3
So #KT-20752 Fixed
2017-10-16 16:21:45 +03:00
Denis Zharkov
8ae3dbdcfc Refine ClassDescriptor::isCommonFinalClass definition
Do not treat annotations as final classes as they are not final in Java

 #KT-20776 Fixed
2017-10-16 16:11:35 +03:00
Alexander Udalov
03baa51f82 Write isPreRelease into JvmBuildMetaInfo for non-stable language version 2017-10-16 15:09:37 +02:00
Alexander Udalov
8b0b334601 Extract shouldWritePreReleaseFlag(), use in JS as well as JVM
Fix the difference in behavior between JS and JVM
2017-10-16 15:09:36 +02:00
Alexander Udalov
0510c553c3 Mark class files as pre-release if language version > LATEST_STABLE
#KT-20547 Fixed
2017-10-16 15:09:36 +02:00
Alexander Udalov
3665255a2b Extract skipPreReleaseCheck out of DeserializationConfiguration.skipMetadataVersionCheck 2017-10-16 15:09:36 +02:00
Alexander Udalov
8a0dcca957 Do not consider 'expect' class type constructors final
Because even a final expected class can be actualized with an open
actual class and thus have subtypes in the platform code
2017-10-16 15:08:50 +02:00
Alexander Udalov
0a861fd4ed Minor, refine return type of AbstractClassTypeConstructor.getDeclarationDescriptor 2017-10-16 15:08:50 +02:00
Alexander Udalov
dc02b2e3ab Fix TypeConstructor.isFinal for synthetic class descriptors
As in LazyClassTypeConstructor.isFinal, check if the class modality is
Modality.FINAL
2017-10-16 15:08:50 +02:00
Alexander Udalov
2682837fd7 Support 'expect final' -> 'actual open' for callables
#KT-17944
2017-10-16 15:08:50 +02:00
Alexey Sedunov
ee9a6ca53e Introduce Type Parameter: Do not show duplicate dialog under write action
#KT-20335 Fixed
2017-10-16 16:04:39 +03:00
Alexey Sedunov
25b6dac7b5 Introduce Type Alias: Don't change non-nullable type to nullable alias
#KT-15840 Fixed
2017-10-16 16:04:39 +03:00
Alexey Sedunov
1c3a3cd651 Introduce Parameter: Forbid inside of default values 2017-10-16 16:04:39 +03:00
Alexey Sedunov
790b615fa1 Introduce Parameter: Fix parameter name validation
Respect existing parameter names and fix some exceptions

 #KT-19439 Fixed
 #KT-20402 Fixed
 #KT-20403 Fixed
2017-10-16 16:04:39 +03:00
Alexey Sedunov
bf3769f37e Introduce Parameter: Forbid inside of annotation entries
#KT-18594 Fixed
2017-10-16 16:04:38 +03:00
Alexey Sedunov
e2fd9a71df Rename: Search text occurrences by declaration FQ name
#KT-17949 Fixed
 #KT-15932 Fixed
2017-10-16 16:04:38 +03:00
Alexey Sedunov
e68f8d6d45 Kotlin Ultimate: Support Protractor run configurations for module directory 2017-10-16 16:04:38 +03:00
Ilya Gorbunov
18d4b91b2d Minor: improve message from future for use and useLines
Annotate RequireKotlin and apiVersionIsAtLeast with SinceKotlin
2017-10-15 21:40:17 +03:00
Ilya Gorbunov
88bb14d0b4 Add kotlin-test-junit dependency to compiler stdlib tests 2017-10-15 21:40:15 +03:00
Ilya Gorbunov
20b122c1dd Use kotlin.test.Test instead of org.junit.Test in common stdlib tests
(and in jvm-only and js-only tests also)
2017-10-15 17:40:53 +03:00
Ilya Gorbunov
f002493218 Multiplatform test annotations
Actual annotations are provided in kotlin-test-junit on JVM side
and in kotlin-test-js on JS side.

#KT-19696
2017-10-15 17:40:53 +03:00
Anton Bannykh
4b1b847f0a Updated the forum link in NPM README.md templates 2017-10-14 02:18:43 +03:00
Anton Bannykh
2d3929ee58 JS: add ant tasks for publishing kotlin-test-js to NPM (KT-19682) 2017-10-14 02:18:43 +03:00
Anton Bannykh
7076fda542 JS: added back integration test for @BeforeTest and @AfterTest annotations
The test was removed in e5cfd198c7 in order
to prevent gradle tests from crashing when running with the old compiler.
2017-10-14 02:16:22 +03:00
Anton Bannykh
b5d32f420d JS: correct Double and Float conversions to Int (KT-8374 fixed) 2017-10-13 20:29:28 +03:00
Alexander Udalov
a52d719943 Fix Java9ModulesIntegrationTest.testDependencyOnReflect
Since javac is invoked on a module-info with a reference to the module
kotlin.reflect, we need to pass kotlin-reflect.jar in the module path
2017-10-13 18:45:45 +02:00
Ilya Gorbunov
863727955f Annotate inline use and useLines with RequireKotlin
Compiler version 1.2 is required to use 'use' and inline functions from stdlib that call it.
2017-10-13 18:56:05 +03:00
Ilya Gorbunov
cc150ca832 Make Closeable.use call addSuppressed
Call addSuppressed when it's provided by the supplementary artifact for jdk7, and only when targeting apiVersion > 1.1

#KT-18961 Fixed
2017-10-13 18:56:05 +03:00
Ilya Gorbunov
3ab7946c4d Introduce apiVersionIsAtLeast function to branch in inlines
#KT-16028
2017-10-13 18:56:05 +03:00
Ilya Gorbunov
485ca10b84 Improve failed assertSame/NotSame messages, correct tests 2017-10-13 18:53:52 +03:00
Jake Wharton
e611b9a9ba Add assertSame and assertNotSame methods. 2017-10-13 18:53:52 +03:00
Dmitry Savvinov
edd3f76e7b Add contract for takeUnless 2017-10-13 18:43:39 +03:00
Dmitry Savvinov
0b88e7cfd0 Annotate contract DSL with @SinceKotlin 2017-10-13 18:43:39 +03:00
Alexander Udalov
5f775497e2 Add Kotlin package FQ name to kotlin.Metadata
It might differ from the JVM package FQ name if the JvmPackageName
annotation is used. This will be useful for faster indexing in the IDE
and for reflection
2017-10-13 16:23:07 +02:00
Dmitry Petrov
16b7bece46 Fix constant expression inlining logic
Constant expressions are inlined if they do not depend on non-inlineable
vals.
Java constants are always inlined.
Kotlin constants are inlined in LV 1.1+.
2017-10-13 17:01:42 +03:00
Yan Zhulanow
5acc992956 Disable uninitialized object copying checks for Parcelable writeToParcel() to createFromParcel() 2017-10-13 16:35:42 +03:00
Yan Zhulanow
824e0a072e Minor: Add dependency to android-extensions-runtime to get rid of compile errors in IDE 2017-10-13 16:35:41 +03:00
Yan Zhulanow
eb39c4c590 Tests: Do not search for android-extensions-runtime in KOTLIN_PATH 2017-10-13 16:35:40 +03:00
Mikhail Zarechenskiy
61d1963ddb Mark incompatibilities related to the declaration signature as STRONG 2017-10-13 16:14:43 +03:00
Mikhail Zarechenskiy
d557c19a88 Test for consistent modality check with implicit and explicit override
Test for KT-20680
2017-10-13 16:14:40 +03:00
Mikhail Zarechenskiy
b2dc82f17e Improve diagnostic for non-actual declaration with weak incompatibility 2017-10-13 16:14:17 +03:00
Mikhail Zarechenskiy
d0cbd73307 Don't report incompatibility expect/actual errors on usual overloads
Divide incompatibility on two groups: strong and weak. Strong incompatibility means that if declaration with such incompatibility has no `actual` modifier then it's considered as usual overload and we'll not report any error on it.

 #KT-20540 Fixed
 #KT-20680 Fixed
2017-10-13 16:14:14 +03:00
Mikhail Zarechenskiy
eb828e3497 Report errors about incompatible constructors of actual class
#KT-20540 In Progress
 #KT-20680 In Progress
2017-10-13 16:13:40 +03:00
Ilya Gorbunov
748dbc382c Advance bootstrap to 1.2.0-dev-92 2017-10-13 15:17:34 +03:00
Sergey Igushkin
9d62bb3561 (minor) Reorder args help in test data after the property was renamed 2017-10-13 14:02:42 +03:00
Dmitry Petrov
08b7578e61 Add -Xnormalize-constructor-calls=enable to stdlib submodules 2017-10-13 10:17:13 +03:00
Pavel V. Talanov
df4b90fcb6 Scripts: Accept objects as DependenciesResolver implementations
Fixes DependenciesResolver.NoDependencies causing "missing constructor without parameters" warning
2017-10-12 19:22:59 +03:00
Simon Ogorodnik
4972dbfc2d KT-17165: Support array literals in annotations in completion
#KT-17165 fixed
2017-10-12 18:15:53 +03:00
Zalim Bashorov
beec788bd4 KJS: improve declaration for JS Promise and add helpers to simplify some usecases
* add `then` with only one parameter to make usages from Kotlin more idiomatic
* add overload static `resolve` which accepts Promise<S> according to the spec
* add helper functions for `then` to simplify chained usages
  when Promise is returned from `then` or `catch` (workaround for KT-19672)
2017-10-12 18:07:09 +03:00
Simon Ogorodnik
30853d5f85 Show missing deps when preloaded deps not found 2017-10-12 17:34:55 +03:00
Alexander Udalov
f46c509b31 Regenerate tests 2017-10-12 16:18:29 +02:00
Anton Bannykh
b839ba5015 JS: correct imports in kotlin.test-js integration test 2017-10-12 15:41:54 +03:00
Sergey Igushkin
260244fa09 (minor) Fix bad file content replacement in a test. 2017-10-12 15:14:07 +03:00
Alexey Andreev
8a8891d7c9 Fix Kotlin/JS compiler under JRE9
See KT-20653, KT-20650
2017-10-12 14:39:47 +03:00
Anton Bannykh
e5cfd198c7 JS: temporarily remove @BeforeTest and @AfterTest checks from integration test until bootstrap compiler supports the annotations. 2017-10-12 14:24:59 +03:00
Anton Bannykh
c57b0b4cbc JS: rename @Before to @BeforeTest and @After to @AfterTest for better JUnit compatibility 2017-10-12 14:24:59 +03:00
Sergey Igushkin
bd75a47a07 Update Android license string for Gradle tests
(cherry picked from commit 2697445)
2017-10-12 14:23:32 +03:00
Stanislav Erokhin
1f546ea1ae Revert "Temporary change default behavior for constructor call normalization"
This reverts commit 2e8cda8103.
2017-10-12 14:01:39 +03:00
Nikolay Krasko
bab79e86d6 Revert old id for run configurations (KT-20621)
Currently there's no way for smooth IDs migration.

 #KT-20621 Fixed
2017-10-12 12:00:35 +03:00
Nikolay Krasko
bc6f2f6659 Request path from URI before construction file 2017-10-12 12:00:35 +03:00
Nikolay Krasko
3c0329b458 Fix tests failure on Windows agents because of wrong slashes 2017-10-12 12:00:35 +03:00
Nikolay Krasko
e31492f96f Always create psi files in tests from text without '\r' 2017-10-12 12:00:35 +03:00
Nikolay Krasko
b64ab10e89 Fix MavenUpdateConfigurationQuickFixTest tests on Windows agents 2017-10-12 12:00:34 +03:00
Dmitry Savvinov
d4d7946e6a Effects: add diagnostic tests on functions from stdlib
==========
Introduction of EffectSystem: 18/18
2017-10-12 11:55:26 +03:00
Dmitry Savvinov
fb03656e99 Effects: annotate functions in stdlib with contracts
build.xml was also changed to incorporate contracts in
mock-runtime-for-tests.jar, because it is using Standard.kt, which, in
turn, has contract-annotated functions.

==========
Introduction of EffectSystem: 17/18
2017-10-12 11:55:26 +03:00
Dmitry Savvinov
4434db4d69 Effects: add diagnostic tests on contracts
- Make AbstractDiagnosticsTest dump function contracts
- Add diagnostics tests on parsing contracts
- Add diagnostics tests on smartcats in presence of functions with
contracts
- Add diagnostics tests on initialization and flow in presence of
in-place called lambdas

==========
Introduction of EffectSystem: 16/18
2017-10-12 11:55:26 +03:00
Dmitry Savvinov
f487525a1d Effects: add cfg-tests on inlined lambdas
==========
Introduction of Effect System: 15/18
2017-10-12 11:55:26 +03:00
Dmitry Savvinov
a986999226 Effects: support cfg tests with stdlib
- Add method "doTestWithStdLib" which launches test with stdlib
- Change GenerateTests.kt to generate cfg tests with stdlib from
folders 'cfgWithStdLib' and 'cfgVariablesWithStdLib'

==========
Introduction of Effect System: 14/18
2017-10-12 11:55:26 +03:00
Dmitry Savvinov
d20c770a25 Effects: add test on (de)serialization of contracts
- Add ContractDescriptorRenderer
- Add option to dump function contracts in DescriptorRendererOptions
- Add parsing of LANGUAGE_VERSION directive in AbstractLoadJava
- Add tests on serialization-deserializaton identity of contracts

==========
Introduction of EffectSystem: 13/18
2017-10-12 11:55:26 +03:00
Dmitry Petrov
75ad20f823 Build compiler, plugin & stdlib with constructor call normalization
Required as a workaround for Proguard bug
https://sourceforge.net/p/proguard/bugs/664/

When processing bytecode generated by Kotlin compiler for constructor
call with stack spilling during arguments evaluation, ProGuard performs
an equivalent transformation for the bytecode, but emits invalid stack
frame information.
In JVM 1.6, such invalid stack frames are ignored and re-evaluated by
JVM during bytecode verification.
In JVM 1.8, such invalid stack frames cause VerifyError.
2017-10-12 10:59:57 +03:00
Leonid Stashevsky
13880b18ea Rename android-annotations -> kotlin-annotations-android
also rewrite it's buildscript in kts and add to compiler tests dependencies
2017-10-12 09:11:33 +03:00
Ilya Gorbunov
781ca6d2b5 Inline swap function, do not use deprecated floor. 2017-10-12 06:06:26 +03:00
Pap Lorinc
e640867238 Provide java.util.Collections#shuffle as extensions for collections in JS
#KT-2460
2017-10-12 06:06:26 +03:00
Ilya Gorbunov
6fc87c532e Restore dependency to build kotlin-runtime before BCV tests 2017-10-12 06:06:12 +03:00
Ilya Gorbunov
aab604d154 Improve math docs
Add links from log to ln, log2, log10.
Format lists in docs so that they are pretty in quick doc window.
2017-10-12 05:58:04 +03:00
Sergey Igushkin
873994545c Clear Java srcDirs in JS and multiplatform projects.
Issue #KT-20217 Fixed

(cherry picked from commit a4f8a5e)
2017-10-11 20:32:59 +03:00
Sergey Igushkin
dff15a3d59 Fix multiplatform projects communication broken if the plugin is loaded
more than once in different class loaders.

Issue #KT-20634 Fixed

(cherry picked from commit c65f210)
2017-10-11 20:32:11 +03:00
Sergey Igushkin
f211985332 Re-generate Gradle options to have allWarningsAsErrors updated.
Issue #KT-20553 Fixed
2017-10-11 20:31:23 +03:00
Sergey Igushkin
5edf8664fb Rename warningsAsErrors -> allWarningsAsErrors in args
(cherry picked from commit 377acf5)
2017-10-11 20:13:25 +03:00
Ilya Gorbunov
71e97e32e0 Regenerate gradle options to include warningsAsErrors 2017-10-11 19:23:57 +03:00
Ilya Gorbunov
345e85974e Bootstrap from intermediate teamcity build 2017-10-11 19:23:55 +03:00
Stanislav Erokhin
4932fa1ddd Support expected type from explicit cast
This commit support the following case.
Suppose we have such declaration:
  fun <T> foo(): T { ... }

Then in code we want to use it like this: `foo() as String`.
But in LV <= 1.1 we have type inference error: "Not enough
information for type parameter `T`". This error happened because we
do not use type from cast as expected type for call.

In this commit we fix this problem and use this type as expected type
in following cases:
 - our function has only one type parameter (this can be relaxed later)
 - function parameter types and extension receiver type not contains `T`

Also this fix problem with `findViewById`.
Already signature was: `fun findViewById(...): View`
and was used like: `findViewById() as MyView`.
New signature is `fun <T : View> findViewById(...): T`
and old usage was broken because of problem described above
2017-10-11 19:23:52 +03:00
Anton Bannykh
ac508a510e JS: Support isInitialized intrisic for lateinit properties 2017-10-11 19:23:49 +03:00
Alexander Udalov
5cbcbe4a9c Support -Werror CLI argument to treat warnings as errors
The option is named "warningsAsErrors" in the Gradle plugin

 #KT-10563 Fixed
2017-10-11 19:23:46 +03:00
Alexander Udalov
897261a8a6 Add test on compiling against kotlin.reflect on JDK 9 2017-10-11 19:23:43 +03:00
Alexander Udalov
d41c1d572b Remove deprecated API from package kotlin.reflect
This is needed to avoid the split package problem on Java 9 (KT-19258):
both kotlin-stdlib.jar and kotlin-reflect.jar export the package
kotlin.reflect
2017-10-11 19:23:40 +03:00
Alexander Udalov
a4f378d04d Decrease resolution priority of declarations from kotlin-stdlib-jre7/8
In order to allow "overload resolution ambiguity" when both
kotlin-stdlib-jre7/8 and kotlin-stdlib-jdk7/8 are in the dependencies
2017-10-11 19:23:38 +03:00
Alexander Udalov
1592555783 Add test on compiling against kotlin.stdlib.jdk7/8 on JDK 9 2017-10-11 19:23:35 +03:00
Alexander Udalov
2a8be2cdb4 Move internal declarations in kotlin-stdlib-jdk7/8 to other packages
- in kotlin-stdlib-jdk7, package kotlin.internal -> kotlin.internal.jdk7
- in kotlin-stdlib-jdk8, package kotlin.internal -> kotlin.internal.jdk8
2017-10-11 19:23:32 +03:00
Alexander Udalov
537a0ce315 Restore kotlin-stdlib-jre7/8 libraries 2017-10-11 19:23:30 +03:00
Alexander Udalov
e253acd5fd Introduce kotlin-stdlib-jdk7/8 libraries, deprecate kotlin-stdlib-jre7/8
The idea is to keep all declarations in the same packages from Kotlin's
point of view, but use JvmPackageName annotation to move them to another
JVM package, to avoid the split package problem which is otherwise
unsolvable when using module path on Java 9 (KT-19258).

In this commit, kotlin-stdlib-jre7/8 are moved to kotlin-stdlib-jdk7/8
and in the subsequent commit, -jre7/8 are restored. This is done in
order to make Git recognize this as a file move to preserve history.

Include new stdlib-jdkN artifacts in manifest version tests.
2017-10-11 19:20:24 +03:00
Alexander Udalov
2fc3f4d07b Update copyrights in kotlin-stdlib-jre7/8 sources 2017-10-11 19:20:24 +03:00
Alexander Udalov
7f8634d9ef Revert "Temporarily remove JvmPackageName and tests, but keep the implementation"
This reverts commit 9ae6feb2c5.
2017-10-11 19:20:24 +03:00
Alexander Udalov
00be512532 Revert "Temporarily remove isInitialized and tests, but keep the implementation"
This reverts commit 234148518e.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
abdcbf1fb2 Refactor: use the same arraybuffer to compute double hashcode 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
0454bd9e28 Detect endianness when reinterpreting Float64 as two Int32
#KT-18264

Use Int32Array instead of Uint32Array since ints are required to be singed.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
aa3bfc55c3 Implement in JS nextUp(), nextDown(), nextTowards() and ulp extensions
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
480d4a0093 Make withSign(NaN) behave as in JVM
#KT-4900

Where only the sign of the result is undefined, but the absolute value is unchanged.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
132f2f88c2 Provide Double and Float bit conversion functions as extensions in JS and Common
Instance extension: Double/Float.toBits/toRawBits
Companion extension: Double/Float.Companion.fromBits

#KT-18264 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
044ccf1532 Introduce inverse hyperbolic functions
#KT-4900

Improve accuracy of JS polyfills of hyperbolic functions and expm1/log1p
2017-10-11 19:20:24 +03:00
Mikhael Bogdanov
232d1bd9ef Switch warning to error for java-default method calls within 1.6 target
#KT-15825 Fixed

(cherry picked from commit 9b29ebb)
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
5bfa9b248e Minor fixes in logarithm functions docs 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
57f5791e70 Annotate new API with SinceKotlin, provide common headers
#KT-4900

Also update binary API dump.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
a69a583c64 Deprecate kotlin.js.Math object, rename kotlin.math.kt to just math.kt 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
86b23ffe49 Integer math functions and tests for them
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
a832db48f6 Float Math API
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
f3ea499d2c JVM-specific math functions and tests
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
7e48f8b180 Provide Double and Float bit conversion functions as extensions
Instance extension: Double/Float.toBits/toRawBits
Companion extension: Double/Float.Companion.fromBits

 #KT-18264 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
6373ac7ef0 Rename log to ln, log1p to ln1p, keep pow only as extension
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
805d1c90b7 Rename sgn to sign, add docs and tests
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
d0b12e3872 Use HALF_EVEN rounding mode for round()
Add docs and tests for rounding.

 #KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
5e9e6d5951 Common math tests and document for trigonometric functions and powers.
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
a375bafa21 Draft common math API with top-level functions and constants in kotlin.math package
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
e59fbc1097 Provide polyfills for missing ES6 math functions
#KT-4900

Rename math.kt to js.math.kt
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
559255f38e windowed function: add default parameters, drop or keep partial windows, KEEP-11
Make step default to 1.
Add partialWindows boolean parameter defaulting to false to control
whether to keep partial windows in the end.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
c04b0072af Rename pairwise to zipWithNext, KEEP-11 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
c2cee2e405 Update binary api dump, rearrage bignumbers tests 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
b89e5b2708 Add missing api: radix overloads, mathContext and scale overloads, orNull overloads
Move string-to-number conversions and their tests near to existing ones

Add documentation and copyrights.
2017-10-11 19:20:24 +03:00
voddan
e86e080088 KEEP-49: extending Kotlin API for BigInteger and BigDecimal 2017-10-11 19:20:24 +03:00
Anton Bannykh
158c03b07f JS: enable TypedArrays by default 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
a8fef3a385 Provide MutableList.fill for JS, annotate new API with @SinceKotlin
#KT-8823 #KT-9010
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
bb22d6647b Introduce MutableList.fill and shuffle/shuffled extensions for JVM only
'shuffle' and 'fill' are inline only, but 'shuffled' is not.

#KT-8823 Fixed
#KT-9010 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
16d3d2f764 Make Regex class serializable on JVM
#KT-16447 Fixed

Refactor helper functions for serialization tests.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
99bd54116e Docs and samples for 'windowed' function 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
b2f2e3537b Docs and samples for 'chunked' function 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
e418f61f0c Docs and samples for 'pairwise' function 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
b94fd36d75 Minor refactoring in RingBuffer 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
3f23742298 Optimize 'windowed' and 'chunked' for char sequences, iterables and sequences 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
18c7a01ab5 Add tests for windowed and chunked, fix precondition checks 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
a3a1c391cc Generate 'chunked' and 'windowed' signatures and delegating implementations
Add implementations of windowed.
2017-10-11 19:20:24 +03:00
Sergey Mashkov
6ae85f5108 Sliding window implementation helper utilities 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
c815ccfd6a Introduce 'pairwise' function, KEEP-11 2017-10-11 19:20:24 +03:00
Mikhael Bogdanov
b73be50e5b Move object initialization from <init> to <clinit>
Codegen generates static backing fields for object properties.
  They are initialized in class constructor but some of them are final static
  and such access is prohibited in specification but it's allowed in
  java bytecode <= 1.8. Such access in 1.9 bytecode cause
  "IllegalAccessError: Update to static final field Object.INSTANCE
  attempted from a different method (<init>) than the initializer method <clinit>"

  Added additional hidden field in interface companion to pass out
  companion instance from <clinit>.

 #KT-15894 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
de004337a2 Pass arguments to bcv tests with system properties rather than env 2017-10-11 19:20:24 +03:00
Ilya Gorbunov
03dcae5010 Attach method counting tasks to check rather than assemble stage 2017-10-11 19:19:08 +03:00
Ilya Gorbunov
2d9c4246bd Add explicit constructor to expect annotation 2017-10-11 19:18:30 +03:00
Alexander Udalov
ecfea9e340 Forbid private 'expect' declarations
#KT-19170 Fixed
2017-10-11 17:21:55 +02:00
Dmitry Savvinov
87b85ce978 Fix testdata for tests which use varargs
Change tests to use new syntax for array literals to prevent deprecation
warnings (see KT-20171).
2017-10-11 18:06:00 +03:00
Alexey Andreev
fd1aa97d0c Enable test that now passes in JS 2017-10-11 17:35:32 +03:00
Alexey Andreev
cddc8df134 Fix Scala code style options 2017-10-11 17:35:32 +03:00
Alexey Andreev
06b1ba7c47 JS: use prototype when checking is against interface
See KT-20527
2017-10-11 17:35:31 +03:00
Ilya Chernikov
279126ad7e Add stdlib to gradle scripts classpath, since it is not included into compiler anymore 2017-10-11 16:24:42 +02:00
Paul Merlin
e911a1e53d Script template provider for settings.gradle.kts files
This commit introduces GradleSettingsKotlinDSLTemplateProvider and
registers it as Kotlin IntelliJ plugin extension.
2017-10-11 16:19:56 +02:00
xiexed
5c2962e195 UAST properly handles string "when conditions" in lazy parent (KT-20709) (#1338) 2017-10-11 15:16:15 +02:00
Mikhail Zarechenskiy
88595e1a58 Don't require to override abstract methods in expect class
#KT-16099 Fixed
2017-10-11 15:27:50 +03:00
Mikhail Zarechenskiy
5695e76a00 Prohibit inheritance by delegation in expect classes
#KT-20431 Fixed
2017-10-11 15:27:46 +03:00
Denis Zharkov
2e8cda8103 Temporary change default behavior for constructor call normalization
It's necessary to perform bootstrap and must be reverted after
2017-10-11 14:21:49 +03:00
Dmitry Jemerov
1d4c2e9223 Don't analyze temporary files created from destructuring declarations
They are known to not contain any synthetic accessor calls.
2017-10-11 13:20:05 +02:00
Dmitry Savvinov
f5d40a1c98 Fix testdata in varargs tests
Testdata have been changed since 1.2. due to KT-20171.
2017-10-11 14:06:54 +03:00
Dmitry Savvinov
eae9923dbe Add allowKotlinPackage AnalysisFlag
This flag is used internally by EffectSystem as a sign of compiling
stdlib. If this flag is present, then EffectSystem will read contracts
on functions and serialize them into metadata even if corresponding
LanguageFeatures are turned off. This is done solely for building
1.2-runtime with contracts in it without the need to turn on
LanguageFeatures manually.

======
This commit finishes a first series of commits related to effect
system. After it, compiler is ready to work with contracts, but it is
impossible to actually annotate anything, because there are no
contracts DSL in stdlib yet.
2017-10-11 13:40:16 +03:00
Dmitry Savvinov
bdbb161cfa Effects: support called-in-place lambdas
Support initialization of local variables in capture, if that capture is
anonymous lambda that was passed to function which explicitly expressed
its intent to call closure "here and now"

Changes:
- LocalFunctionDeclarationInstruction made open

- Introduce InlinedLocalFunctionDeclarationInstruction, which is subtype
of LocalFunctionDeclarationInstruction with additional semantic: it
is statically known that this function will be called in-place and maybe
with some definite amount of invocations.

- Next-instruction of InlinedLocalFunctionDeclarationInstruction depends
on whether flow can exit its body normally, i.e. on wheter EXIT is
reachable. If flow can reach EXIT, then .next is just straight next
instruction, otherwise it's SINK.

- Take non-local instructions into consideration when analyzing
reachability. We didn't it before because no one ever needed proper
analysis. Now we have InlinedLocalFunctionDeclarationInstruction which
cares about proper reachability of EXIT.

- Pull control-flow information from
InlinedLocalFunctionDeclarationInstruction's EXIT into parent's
pseudocode, thus allowing it to participate in initialization/use
analysis.

- Change logic of 'isCapturedWrite' to not report
"CAPTURED_VAL_INITIALIZATION" if value is captured by the inline-lambda.

==========
Introduction of EffectSystem: 12/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
0dd6d1f4c7 Effects: support assert-like contracts
- Support functions that explicitly express relation between successfull
return and passed arguments (e.g., 'check')
- Note that we have to correct resulting data flow for arguments *after*
resoling (because we get contracts only after resolving). To do so, we
have to extend MutableDataFlowInfoForArguments interface with
'updateResultInfo' method.

==========
Introduction of EffectSystem: 11/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
72b0d31329 Effects: support contracts with conditional returns
Support functions which have explicitly expressed relation between
return-value and arguments. If we have observed that function returned
this value, get additional information from effect system.

==========
Effect System introduction: 10/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
87b0bc43d5 Effects: support parsing of functions contracts
Make a fastcheck for a presence of contract-declaration in function
body of FunctionDescriptorResolver. If there's something that looks like
contract and we need resolve to make a final decision, then prepare
LazyContractProvider key in UserDataMap of function's descriptor.

Note that we can't passively wait with contracts resolving until the
function body is analyzed, because we may need it earlier. However, we
can't force body resolve straight during descriptors resolving, because
we can run into recursive problems. That's why we are saving deferred
resolving of functions body via LazyContractProvider.

Also, we have to pass DataFlowInfo into
initializeFunctionDescriptorAndExplicitReturnType, because we save
deferred body resolving inside, which needs DataFlowInfo.

==========
Effect System introduction: 9/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
175d23155e Effects: add (de)serialization of contracts in metadata
- Introduce new definitions in descriptors.proto
- Add new corresponding values in Flags.java
- Introduce ContractSerializer and ContractDeserializer, responsible for
for conversion ContractDescription <-> ProtoBuf.Contract
- Add dependency of 'serialization' module on 'resolution' so that it
could see contracts model.

Note that here we do a lot of seemingly unnecessary hoops, which in fact
necessary to respect existing module system (in particular, to be able
to extract ContractDescription declarations from 'descriptors' module to
make them invisible from reflection)

==========
Effect System introduction: 8/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
2c0ef592e6 Effects: add DSL for declaration of contracts
- Introduce DSL for declaration of contracts. Functions and classes in
this DSL do not bear any computational semantics: in fact, they all do
not exist on runtime. Whole work of extracting semantics from such calls
is done by special parts of compiler

- To make distinguishing those declarations more robust and
convenient, introduce internal annotation @ContractsDSL

- Turn off InlineChecker inside contracts DSL. We do this, because some
functions from DSL should take any possible lambda, so we can't write
any type besides 'Function<R>'. However, InlineChecker will complain if
we will pass inlined lambda in such function -- though, this is false
positive because we know that functions from contracts DSL will never be
executed

- Change testData on HierarchyTestWithLib, where new enum from
kotlin.internal changed expected output

==========
Effect System introduction: 7/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
b347e31fc4 Effects: add facade of EffectSystem
- Add facade of effect system in form of EffectSystem class, as well as
some other utility classes.

- Inject effect system facade classes into ExpressionTypingComponents

- Call to ContractParsingServices in ExpressionTypingVisitor to record
function contract (if any)

- Introduce FilteringTrace

- Create new FilteringTrace for statement in ExpressionTypingServices
that will serve as a cache for EffectSystem, filtering ES-related
slices from committing into parent.

- Extract and expose ConditionalDataFlowInfo

==========
Effect System introduction: 6/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
a46ccdbae1 Effects: add parsing of contracts from PSI
- Introduce part of effect system responsible for parsing
contracts which were expressed in sources using DSL from stdlib

- Add new errors to Errors.java related to contracts and corresponding
messages.

==========
Effect System introduction: 5/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
32d80f322e Effects: add new slices in BindingContext
==========
Effect System introduction: 4/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
d2e582698e Effects: add interpreters of ContractDescription
Interpreters convert declarative representation of contracts
(ContractDescription) in internal representation convenient for usage
inside compiler (Computations, Effects, etc.)

==========
Effect System introduction: 3/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
afc15e9211 Effects: Add inner representation of contracts
Add model of contracts used by compiler during analysis. It should be
thought of as structure which used by the compiler to implement
semantics, expressed by the ContractDescription.

==========
Effect System introduction: 2/18
2017-10-11 13:34:54 +03:00
Dmitry Savvinov
ba84bd3f19 Effects: Add declarations for description of contracts
Add ContractDescription structure which is used for declarative representation
of function's contract.

Also, add corresponding LanguageFeatures.

==========
This is the first commit from a series of 18 commits which gradually
introduce effect system into the compiler. All such commits will be
marked with appropriate comment and index in that series.

While each one of such commits separately shouldn't break compiler (i.e
you can checkout any of them and expect compiler to build and pass
tests successfully, e.g. for bissecting purposes), semantically they
all are one big feature and not entirely independent. Please bear that
in mind while working with/changing only some of them -- some strange
effects can happen.
2017-10-11 13:34:54 +03:00
Dmitry Jemerov
ee72cc268c Fix NSEE if there's no JVM implementation module (KT-20638) 2017-10-11 12:27:01 +02:00
Dmitry Jemerov
dc7ffdcbe4 Add missing read action 2017-10-11 12:26:59 +02:00
Dmitry Jemerov
6c7f558d36 Add missing FileModificationService call (EA-107395) 2017-10-11 12:26:39 +02:00
Dmitry Jemerov
c2efdfe243 Add space before 'where' keyword
#KT-19213 Fixed
2017-10-11 12:25:53 +02:00
Dmitry Jemerov
f2a7e7f238 Show argument name hints for function type calls only for known names
#KT-19216 Fixed
2017-10-11 12:25:52 +02:00
Dmitry Jemerov
af09f5a49f Enable argument name hints for annotations
#KT-19146 Fixed
2017-10-11 12:25:51 +02:00
Nikolay Krasko
8a46968292 Fix JUnit3RunnerWithInners runner for gradle execution (KT-20684)
#KT-20684 Fixed
2017-10-11 12:43:44 +03:00
Nikolay Krasko
aaa3dd8e70 Don't filter out inner classes when running tests (KT-20684)
#KT-20684 In Progress
2017-10-11 12:43:43 +03:00
Ilya Gorbunov
456c26cdae Remove "EXPERIMENTAL" from 1.2 version description in tests and gradle options 2017-10-11 08:50:30 +03:00
Ilya Gorbunov
b901a8946c Set 1.2-SNAPSHOT in maven build 2017-10-11 08:50:30 +03:00
Ilya Gorbunov
cffab8d3ef Set 1.2-SNAPSHOT in gradle build 2017-10-11 08:50:30 +03:00
Ilya Gorbunov
968c9c2034 Set LATEST_STABLE language version and current version of stdlib to 1.2 2017-10-11 08:50:30 +03:00
Sergey Igushkin
17eac133a2 (minor) Make a test running on Gradle 4.0+ check the classes correctly 2017-10-11 02:25:30 +03:00
Mikhail Zarechenskiy
e9aad54664 Add intrinsics to mark and choose special api calls
#KT-20585 Fixed
2017-10-11 01:37:05 +03:00
Mikhail Glukhikh
e37bfa13e3 Related to KT-20713: add test for find usages in script 2017-10-10 22:48:42 +03:00
Mikhail Glukhikh
c5cb45794a Fix CCE in ReplaceAddWithPlusAssignIntention #KT-20183 Fixed 2017-10-10 22:48:39 +03:00
Mikhail Glukhikh
fd95769780 Code cleanup: ReplaceAddWithPlusAssignIntention 2017-10-10 22:48:37 +03:00
Mikhail Glukhikh
45c9be2945 Fix problem with mutable map in "simplifiable call chain"
So #KT-20315 Fixed
2017-10-10 22:48:35 +03:00
Mikhail Glukhikh
8e59d3e379 Handle modifiers correctly in "val to object" #KT-18919 Fixed 2017-10-10 22:48:33 +03:00
Mikhail Glukhikh
0b5b5d8e89 Suggest primitive array type for collection literals in "add type" fix
So #KT-18549 Fixed
2017-10-10 22:48:30 +03:00
Mikhail Glukhikh
e65112fcab Disable "Replace camel-case name with spaces" intention for JS / common
So #KT-18773 Fixed
2017-10-10 22:48:28 +03:00
Ilya Gorbunov
43e6106791 Bootstrap selection: allow to specify teamcity project with a parameter 2017-10-10 21:00:32 +03:00
Ilya Gorbunov
39c8bae134 Minor: move extra property initialization 2017-10-10 21:00:30 +03:00
Ilya Gorbunov
712d0e0777 Remove redundant repositories 2017-10-10 20:50:03 +03:00
Ilya Gorbunov
5f51a293ba Use 'idea' plugin to specify excluded dirs 2017-10-10 20:50:03 +03:00
Ilya Gorbunov
a8766a00c6 Remove unused property jdk16.home 2017-10-10 20:50:03 +03:00
Zalim Bashorov
a4722a4000 Make "js.tests" depends on ":kotlin-test:kotlin-test-js" since it's used on runtime inside JS tests.
Transform dependency on ":kotlin-stdlib-js" to testRuntime since it's required only on runtime.

And remove unnecessary dependency from jsCompilerTest.
2017-10-10 20:19:07 +03:00
Zalim Bashorov
eb1c76ecc4 Make :kotlin-test-js:distJs depends on compileKotlin2Js to avoid running the task too early 2017-10-10 20:19:07 +03:00
Sergey Igushkin
205df7b1f3 ~ Remove debug port 2017-10-10 19:40:18 +03:00
Sergey Igushkin
8e967c9b6b Move existing multiplatform tests to separate class; add options test. 2017-10-10 19:40:18 +03:00
Sergey Igushkin
6fd9eb2711 Add kotlinOptions to KotlinCompileCommon 2017-10-10 19:40:18 +03:00
Sergey Igushkin
8046959017 Refactor existiong *OptionsImpl classes. 2017-10-10 19:40:17 +03:00
Sergey Igushkin
cce7b3cfdf Create KotlinMultiplatformCommonOptionsImpl.kt 2017-10-10 19:40:17 +03:00
Sergey Igushkin
e06d60174d Generate KotlinMultiplatformCommonOptions and <...>OptionsBase. 2017-10-10 19:40:17 +03:00
Alexey Andreev
8cdef4139e Fix JS DCE removing reachable functions 2017-10-10 18:59:18 +03:00
Denis Zharkov
cb7d561c6c Add cache for declaration names in StubBasedPackageMemberDeclarationProvider
#KT-20683 Fixed
2017-10-10 18:34:31 +03:00
Denis Zharkov
082ed62cd5 Optimize ConstraintSystemBuilderImpl::generateNewBound
Do not process the bound if it's just the same
This situation can actually happen in case of adding bound
containing type variable itself
2017-10-10 18:27:00 +03:00
Denis Zharkov
3a9650d0fc Introduce cache for KotlinBuiltins::builtInClassesByName
There are a lot of places requesting nothing/any/.. instances
and just asking the scopes isn't very effecient:
see org.jetbrains.kotlin.builtins.KotlinBuiltIns#createPackage
having ChainedMemberScope and a `map` call
2017-10-10 18:27:00 +03:00
Denis Zharkov
e3b453ada4 Do not create redundant temporary trace
It will be commited after use in any case
2017-10-10 18:27:00 +03:00
Denis Zharkov
00df41ee25 Optimize subtyping for simple cases 2017-10-10 18:27:00 +03:00
Denis Zharkov
d5376fa8ba Drop effectively unused parameter with default value 2017-10-10 18:27:00 +03:00
Denis Zharkov
6e59799b54 Get rid of a couple of usages of simpleTypeWithNonTrivialMemberScope
The simple versions of KotlinTypeFactory::simpleType may lead
to smaller number of KotlinType instances
(defaultType from descriptor are used if there are no arguments)
2017-10-10 18:27:00 +03:00
Denis Zharkov
1c9b454d90 Rename KotlinTypeFactory::simpleType to simpleTypeWithNonTrivialMemberScope
To state it must be used only for limited number of cases
2017-10-10 18:27:00 +03:00
Denis Zharkov
20334a2321 Cache virtualFilePath for KtFile
Because of com.intellij.openapi.vfs.local.CoreLocalVirtualFile#getPath
that has a rather slow implementation calling String::replace on each call

At the same time this method gets called very frequently when
recording lookups
2017-10-10 18:27:00 +03:00
Denis Zharkov
bb6a52c0cc Optimize subtyping for case of objects identity
It may be rather frequent (e.g. in case of types without arguments or
for dispatch receiver parameters)
2017-10-10 18:27:00 +03:00
Denis Zharkov
f81c7a1a47 Add explicit fast path in TypeCheckerContext::anySupertype 2017-10-10 18:27:00 +03:00
Denis Zharkov
b99658b8eb Optimize CandidateResolver::checkReceiver
- Do not calculate smart cast variants unless they're not necessary
- Avoid calling subtyping twice just to know if smart cast is necessary
  (now the needed info is contained in ReceiverSmartCastResult)
2017-10-10 18:27:00 +03:00
Denis Zharkov
9fdb702688 Minor. Drop unused method 2017-10-10 18:27:00 +03:00
Denis Zharkov
457b57ace2 Inline TypeCheckerContext::anySupertype
This method is a hot spot, since it's may be called
several times during one isSubtypeOf call and it contains
two lambdas, so it's worth inlining it
2017-10-10 18:27:00 +03:00
Denis Zharkov
2fa82edd85 Use smaller default deque size for BFS over supertypes
The default value (16) seems to be rather big
2017-10-10 18:27:00 +03:00
Denis Zharkov
df88926ef8 Minor. Get rid of redundant var
The lazyness here is redundant since SmartList doesn't make a lot of
harm, but at the same time `var` here leads to another
kotlin/jvm/internal/Ref$ObjectRef instance
2017-10-10 18:27:00 +03:00
Denis Zharkov
bca53e6c1c Optimize type checking for common cases
- Type equality for simple constructors (no arguments)
- Subtyping on final classes
2017-10-10 18:27:00 +03:00
Denis Zharkov
e519095e9e Minor. Move local functions as a private to class 2017-10-10 18:27:00 +03:00
Denis Zharkov
79a7c01eac Fix obviously wrong !is check in type checker 2017-10-10 18:27:00 +03:00
Simon Ogorodnik
3ca47f5f4a Revert "Add note about automatic dev plugin updates to ReadMe"
This reverts commit c92408e
2017-10-10 18:25:27 +03:00
Simon Ogorodnik
b7e78e6625 Revert "Add note about bootstrap plugin"
This reverts commit 722345d
2017-10-10 18:25:21 +03:00
Simon Ogorodnik
722345d14e Add note about bootstrap plugin 2017-10-10 18:07:51 +03:00
Simon Ogorodnik
c92408eec9 Add note about automatic dev plugin updates to ReadMe 2017-10-10 18:07:51 +03:00
Mikhael Bogdanov
a79c2bf999 Write script descriptor type to ASM_TYPE slice
#KT-20707 Fixed
2017-10-10 17:01:23 +02:00
Nikolay Krasko
eb32f5478a Minor: use special extension 2017-10-10 16:29:22 +03:00
Nikolay Krasko
6664b7759b Configure kotlin.stdlib for gradle projects (KT-19207)
#KT-19207 Fixed
2017-10-10 16:29:22 +03:00
Nikolay Krasko
023067aaf2 Allow to use folders for gradle configuration tests 2017-10-10 16:29:22 +03:00
Nikolay Krasko
cc0a9070b9 Add kotlin.stdlib to module-info when configure Maven project (KT-19207)
#KT-19207 In Progress
2017-10-10 16:29:22 +03:00
Nikolay Krasko
c0e6cb8b92 Log module name when maven project wasn't found in manager 2017-10-10 16:29:21 +03:00
Nikolay Krasko
f05e4c922b Minor: use another method 2017-10-10 16:29:21 +03:00
Nikolay Krasko
65798cdd81 Minor: optimize imports and clean up 2017-10-10 16:29:21 +03:00
Nikolay Krasko
9d122a275a Update module-info only for Java configurator (KT-19207)
#KT-19207 Fixed
2017-10-10 16:29:21 +03:00
Ilya Gorbunov
fe9ef04cae Make a task to count dex methods in kotlin-stdlib and kotlin-reflect 2017-10-10 14:48:20 +03:00
Alexander Udalov
00c846a160 Write patch version for VersionRequirement correctly 2017-10-10 13:21:50 +02:00
Alexander Udalov
6f2e6db131 Check the RequireKotlin annotation value
Similarly to SinceKotlin
2017-10-10 13:21:50 +02:00
Alexander Udalov
a96861c353 Support version kind for RequireKotlin
#KT-20584 Fixed
2017-10-10 13:21:49 +02:00
Alexander Udalov
4532f7556c Introduce internal RequireKotlin annotation 2017-10-10 13:19:18 +02:00
Alexander Udalov
8962911503 Rename SinceKotlinInfo -> VersionRequirement 2017-10-10 13:19:18 +02:00
Alexey Andreev
8f9fc100a3 Fix compilation of JS stdlib
1. Don't import intrinsics when compiling stdlib, use declarations
   from current module instead
2. Add constructor with one argument to SourceFilePathResolver,
   to fix bootstrapping issues.
3. Pass correct source roots to compiler when building
   stdlib, since now we pass module root by default,
   while stdlib source roots are outside of module root.
2017-10-10 14:11:15 +03:00
Alexey Sedunov
ea8f3dcc65 Go to Implementation: Support suspend functions 2017-10-10 13:15:16 +03:00
Alexey Sedunov
21bf4d3f24 Rename: Suspend function support 2017-10-10 13:15:15 +03:00
Toshiaki Kameyama
c5b7d0f0df Remove parentheses after deleting the last unused constructor parameter
So #KT-16636 Fixed
2017-10-10 11:55:27 +03:00
Mikhail Glukhikh
7ade2bb708 Move CreateActualFix to expectactual package 2017-10-10 10:45:12 +03:00
Mikhail Glukhikh
104826e0a9 Line markers: use descriptors in isExpect/ActualDeclaration 2017-10-10 10:45:10 +03:00
Mikhail Glukhikh
1bf0424b1c Set line marker on expect constructor '(' if no constructor keyword 2017-10-10 10:44:51 +03:00
Mikhail Glukhikh
4bfaa46c15 Add correct mapping of module descriptor to implementedDescriptor
Now implements dependency is taken into account here
Old commonModuleOrNull() was deleted
Test (JVM + 2xCommon) was added
2017-10-10 10:44:44 +03:00
Mikhail Glukhikh
b5e2fa5f94 Add line marker test for type aliases #KT-20164 Fixed 2017-10-10 10:44:39 +03:00
Mikhail Glukhikh
eec8be2c21 Add line marker test for primary constructors #KT-20254 Fixed 2017-10-10 10:44:38 +03:00
Mikhail Glukhikh
0ebe9d576a Add line marker test for sealed classes #KT-20043 Fixed 2017-10-10 10:44:36 +03:00
Mikhail Glukhikh
4e56fda439 Introduce isExpect/ActualDeclaration in KotlinLineMarkerProvider
Treat every member of expect declaration as expect declaration itself
So #KT-18455 Fixed
2017-10-10 10:44:35 +03:00
Mikhail Glukhikh
ceab148b09 Expect/actual markers: handle secondary constructors correctly
So #KT-20309 Fixed
2017-10-10 10:44:33 +03:00
Dmitry Petrov
26136cd0fe Check constness of 'apiVersionIsAtLeast' arguments 2017-10-10 09:04:51 +03:00
Dmitry Petrov
23d8b4cefe Do not run CCE if there were no apiVersionIsAtLeast calls 2017-10-10 09:04:51 +03:00
Dmitry Petrov
fd16035bbd API version calls preprocessing, 1st passing test 2017-10-10 09:04:51 +03:00
Dmitry Petrov
4e7c4c3976 Minor: inline single use of 'analyzeMethodNodeBeforeInline' 2017-10-10 09:04:51 +03:00
Dmitry Petrov
a89f978597 Provide configurable constructor call normalization
Three modes:

- 'disable' (default): normalize constructor calls in coroutines only
  (required because uninitialized objects can't be stored in fields),
  don't insert additional code for forced class initialization;

- 'enable': normalize constructor calls,
  don't insert additional code for forced class initialization;

- 'preserve-class-initialization': normalize constructor calls,
  insert additional code for forced class initialization.
2017-10-10 08:49:19 +03:00
Dmitry Petrov
e71090ae4c Spill stack for inline functions only if it's required
Stack should be spilled before inline function call and restored after
call only if one of the following conditions is met:
- inline function is a suspend function
- inline function has try-catch blocks
- inline function has loops (backward jumps)

Note that there're quite some "simple" inline functions in Kotlin stdlib
besides run/let/with/apply. For example, many string operations are
implemented as inline wrappers over Java method calls.
2017-10-10 08:49:19 +03:00
Mikhail Zarechenskiy
1845a87813 Provide no-arg constructors for common expected annotations in stdlib
This is needed because we treat `expect` classes as not having implicit default constructors (see more in KT-15522, f3344ec)
2017-10-09 18:50:38 +03:00
Mikhael Bogdanov
bd9ac65eaf Update stdlib jre8 test jvm-target 2017-10-09 16:38:56 +02:00
Mikhael Bogdanov
3c81430bb9 Update cli module jvm-target
#KT-20671 Fixed
2017-10-09 16:38:56 +02:00
Kirill Rakhman
91c35a6c59 Support listOfNotNull in SimplifiableCallChainInspection #KT-20410 Fixed 2017-10-09 16:38:52 +03:00
Dmitry Petrov
82a9c35194 Fix self-reference to singleton in initializer
Singleton instance is "initialized" by delegating constructor call,
which is superclass constructor call in case of singletons (because
singletons can't have more than one constructor).

Singleton constructor is effectively split into two stages:
- before a super constructor call;
- after a super constructor call.

Before super constructor call, singleton instance can't be used directly
(see KT-20662), because neither 'this' nor static instance is
initialized yet. However, it can be used in closures, in which case a
static instance should be used (escaping uninitialized this is
prohibited by JVM). Actually using this static instance before it is
initialized (e.g., invoking a method that uses this singleton) will
cause a correct ExceptionInInitializerError.

After a super constructor call, static instance of a singleton may be
not initialized yet (in case of enum entries and interface companion
objects). However, we already have an initialized 'this', which we
should use for singleton references.

 #KT-20651 Fixed
2017-10-09 16:27:34 +03:00
Vyacheslav Gerasimov
62d0e4a51a Add name for GradleProjectImportProvider
#KT-20648 Fixed
2017-10-09 14:40:35 +03:00
Alexander Udalov
6d9e8c9414 Add Gradle tasks to generate protobuf, update readme 2017-10-09 12:35:46 +02:00
Alexander Udalov
450bfca41f Move dependency generators->protobufFull up in the list
Otherwise protobufLite (required by compiler modules) wins, and
GenerateProtoBufCompare cannot be run
2017-10-09 12:35:42 +02:00
Alexander Udalov
2699868586 Add "-Duser.country=US" to gradle.properties
To make Gradle daemon which is run from IntelliJ IDEA use the same
environment as the daemon run by the "gradlew" command (the latter is
always using US)
2017-10-09 12:34:02 +02:00
Dmitry Petrov
a4918748a5 Specialize not-null values using information from current analysis pass
Instead of a separate analysis pass to determine variable types at the
point of null checks, use current data flow information and transform
possibly nullable values to definitely non-null values using a special
intrinsic.

This allows to perform a single data flow analysis pass per RNCE
transformation pass (instead of two passes).
2017-10-09 12:20:40 +03:00
Dmitry Petrov
d31efaa7ac Don't analyze method in RNCE if there're no optimizable instructions 2017-10-09 12:20:40 +03:00
Toshiaki Kameyama
0bda2732e5 Fix for KT-19134 IntelliJ Color Scheme editor - allow changing color of colons and double colons (#1314) 2017-10-09 11:02:02 +02:00
Nicolay Mitropolsky
d609579e55 FakeFileForLightClass tries to use ktFile.originalFile.virtualFile 2017-10-06 23:53:33 +03:00
Dmitry Jemerov
703d053157 Additional fixes for consistent parent conversion 2017-10-06 20:51:04 +02:00
Dmitry Jemerov
bde7a657cf Adapt to new equality rules due to lazy parent calculation 2017-10-06 20:51:04 +02:00
Dmitry Jemerov
ada695bd17 Fix loop in parent structure on 'when' condition with expression 2017-10-06 20:51:03 +02:00
Dmitry Jemerov
31fb34d9af Fix and add some required type checks 2017-10-06 20:51:03 +02:00
Vyacheslav Gerasimov
b12f24b41c Fix KtLightClass conversion and testParameterPropertyWithAnnotation 2017-10-06 20:51:03 +02:00
Dmitry Jemerov
fe021afa37 Temp disable UAST caching 2017-10-06 20:51:03 +02:00
Dmitry Jemerov
bab2641bed Don't test parent structure consistency in irrelevant cases 2017-10-06 20:51:03 +02:00
Dmitry Jemerov
61f6db87c4 Use convertOpt() for getting inner classes of script 2017-10-06 20:51:02 +02:00
Dmitry Jemerov
a4f5a1335a Fix convering parents of annotations on primary constructor parameters 2017-10-06 20:51:02 +02:00
Dmitry Jemerov
56168b4a09 Fix destructuring declaration test 2017-10-06 20:51:02 +02:00
Dmitry Jemerov
a7efc4f5da Return correct parent for parts of converted elvis expression 2017-10-06 20:51:02 +02:00
Dmitry Jemerov
e55f4c6e78 Return correct parent element for destructuring declaration initializer 2017-10-06 20:51:02 +02:00
Dmitry Jemerov
a44dff6803 Take into account annotation use site target when converting parent 2017-10-06 20:51:01 +02:00
Dmitry Jemerov
d976c1d594 Correctly convert KtProperty with no backing field to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov
e63838703a Consistently convert local functions to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov
942fe11020 Correctly convert KtParameter to UAST 2017-10-06 20:51:01 +02:00
Dmitry Jemerov
adf1df3eb0 Return correct parent for elements under when expression body 2017-10-06 20:51:01 +02:00
Dmitry Jemerov
c98c3a7033 Work in progress on consistent UAST structure 2017-10-06 20:51:00 +02:00
Dmitry Jemerov
a5a5b37e1e Don't duplicate UAST parent calculation logic 2017-10-06 20:51:00 +02:00
Dmitry Jemerov
b638febc41 Fix conversion of destructuring declarations 2017-10-06 20:51:00 +02:00
Dmitry Jemerov
40daeb13d1 Evaluate parents of UAST elements lazily
Also add tests for UAST consistency in various cases
2017-10-06 20:51:00 +02:00
Dmitry Jemerov
91459bbd6a Enable caching of converted UElements for Kotlin 2017-10-06 20:50:59 +02:00
Ilya Chernikov
cff6d8cf17 Refactor context classpath discovery, share it to idea's jsr223 host...
...from script-util
fix daemon usage in repls
define compiler classpath for script-util tests explicitly
minor refactorings in the build scripts for better import into idea
2017-10-06 20:12:51 +02:00
xiexed
12e35ccf96 KotlinUastBindingContextProviderService moved to plugin.xml (#1303) 2017-10-06 19:17:25 +02:00
Raluca Sauciuc
768710676b AndroidExtensionsReferenceSearchExecutor should also require a read action (#1327)
... just like AndroidReferenceSearchExecutor does. Otherwise, we get
com.intellij.openapi.application.impl.ApplicationImpl$NoReadAccessException
     [java]    [uitest]         at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1070)
     [java]    [uitest]         at com.intellij.psi.impl.source.tree.CompositeElement.textToCharArray(CompositeElement.java:291)
     [java]    [uitest]         at com.intellij.psi.impl.source.tree.CompositeElement.getText(CompositeElement.java:261)
     [java]    [uitest]         at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getValue(XmlAttributeValueImpl.java:72)
     [java]    [uitest]         at org.jetbrains.android.dom.wrappers.ValueResourceElementWrapper.getValue(ValueResourceElementWrapper.java:458)
     [java]    [uitest]         at org.jetbrains.kotlin.AndroidExtensionsReferenceSearchExecutor.processQuery(AndroidExtensionsReferenceSearchExecutor.kt:42)
     [java]    [uitest]         at org.jetbrains.kotlin.AndroidExtensionsReferenceSearchExecutor.processQuery(AndroidExtensionsReferenceSearchExecutor.kt:38)
     [java]    [uitest]         at com.intellij.openapi.application.QueryExecutorBase.execute(QueryExecutorBase.java:87)
     [java]    [uitest]         at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:45)
     [java]    [uitest]         at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:79)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
     [java]    [uitest]         at com.intellij.psi.search.QuerySearchRequest.runQuery(QuerySearchRequest.java:53)
     [java]    [uitest]         at com.intellij.psi.impl.search.PsiSearchHelperImpl.appendCollectorsFromQueryRequests(PsiSearchHelperImpl.java:635)
     [java]    [uitest]         at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:596)
     [java]    [uitest]         at com.intellij.psi.search.SearchRequestQuery.processResults(SearchRequestQuery.java:45)
     [java]    [uitest]         at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:79)
     [java]    [uitest]         at com.intellij.util.MergeQuery.processSubQuery(MergeQuery.java:85)
     [java]    [uitest]         at com.intellij.util.MergeQuery.forEach(MergeQuery.java:57)
     [java]    [uitest]         at com.intellij.util.MergeQuery.findFirst(MergeQuery.java:51)
     [java]    [uitest]         at com.intellij.util.UniqueResultsQuery.findFirst(UniqueResultsQuery.java:51)
     [java]    [uitest]         at com.android.tools.idea.editors.theme.ThemeEditorComponent$19.doInBackground(ThemeEditorComponent.java:895)
     [java]    [uitest]         at com.android.tools.idea.editors.theme.ThemeEditorComponent$19.doInBackground(ThemeEditorComponent.java:891)
     [java]    [uitest]         at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
     [java]    [uitest]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     [java]    [uitest]         at javax.swing.SwingWorker.run(SwingWorker.java:334)
     [java]    [uitest]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
     [java]    [uitest]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
     [java]    [uitest]         at java.lang.Thread.run(Thread.java:745)
     [java]    [uitest] [  72230]  ERROR - plication.impl.ApplicationImpl - Android Studio 3.1 Canary  Build #171.SNAPSHOT
2017-10-06 19:11:59 +02:00
Ilya Gorbunov
8b70767d76 Configure pom signing before deployment
Use groovy where kotlin dsl lacks of typed api
2017-10-06 19:50:22 +03:00
Alexey Andreev
eaa8729259 Fix embedding sources to source maps when compiling JS stdlib 2017-10-06 18:26:15 +03:00
Alexey Andreev
3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00
Anton Bannykh
997aecfcab JS: default to enabled TypedArrays translation when configuration key is not present 2017-10-06 17:14:23 +03:00
Mikhail Glukhikh
e1ccd3afc5 Inspection: do not report anything with manual INFORMATION level offline
So #KT-20369 Fixed
So #KT-20333 Fixed
2017-10-06 16:21:04 +03:00
Toshiaki Kameyama
ec64a7e422 Insert brackets in "Convert reference to lambda" if necessary
So #KT-16394 Fixed
2017-10-06 16:20:45 +03:00
Leonid Stashevsky
0348561cd2 Add annotation for default parameter value 2017-10-06 15:45:38 +03:00
e5l
62e87c873c Add annotation for parameter name in signatures 2017-10-06 15:45:37 +03:00
Dmitry Jemerov
8201ff3006 Fix properties plugin dependency for AS 2.3 2017-10-06 14:43:22 +02:00
Dmitry Jemerov
d79b9c1b51 Allow plugin dependencies to be optional (no Maven in Android Studio) 2017-10-06 14:43:22 +02:00
Dmitry Jemerov
85254838f6 Allow building UAST for in-memory virtual files 2017-10-06 14:43:22 +02:00
Leonid Stashevsky
a54c71eb30 Escape separator in jsr305 CLI tests 2017-10-06 15:34:33 +03:00
Alexey Andreev
9008791a54 JS: generate paths in source maps relative to .map file location
See KT-19818
2017-10-06 15:24:25 +03:00
Alexey Andreev
93a3026c6d JS: improve representation of KClass for primitive types
See KT-17933, KT-17629, KT-17760
2017-10-06 15:21:38 +03:00
Toshiaki Kameyama
bbb571260b Fix 'Redundant override' when delegated member hides super type override
So #KT-20231 Fixed
2017-10-06 14:58:15 +03:00
Dmitry Savvinov
3daee25ce8 Fix tests generators 2017-10-06 13:18:53 +03:00
Mikhail Glukhikh
12ad1b2494 Open created actual class in editor #KT-20135 Fixed 2017-10-06 12:29:00 +03:00
Mikhael Bogdanov
d9df2416a6 Refactor KotlinMultiplatformPlugin to allow Native extend it 2017-10-06 10:56:15 +02:00
Mikhail Glukhikh
8a3fed15f8 Report NO_ACTUAL_FOR_EXPECT etc. on relevant declaration
So #KT-20398 Fixed
2017-10-06 10:48:34 +03:00
Mikhail Glukhikh
472e6f462f Report some actual declaration problems on declaration name
Related to KT-20398
2017-10-06 10:48:24 +03:00
Ilya Gorbunov
5b7c3ee655 Advance bootstrap version to 1.1.60-dev-277 2017-10-05 22:48:12 +03:00
Sergey Igushkin
f4ec8df187 Remove erroneous mavenCentral() from plugins DSL tests 2017-10-05 21:07:46 +03:00
Sergey Igushkin
df99c4fe28 Fix compiler classpath discovery:
* Fix accidental filtering out the stdlib and reflect
* Fix module search in classpath: use moduleId instead of k-c-embeddable
2017-10-05 21:05:06 +03:00
Sergey Igushkin
a2df5c38dd Remove the Kotlin version suffix from PluginsDslIT.kt 2017-10-05 21:05:06 +03:00
Sergey Igushkin
769759d6ce Add jcenter() to testProject repositories where needed. 2017-10-05 21:05:06 +03:00
Sergey Igushkin
ad4fc7363e Install annotation-processor-example for Gradle integration tests. 2017-10-05 21:05:06 +03:00
Sergey Igushkin
feee93186b Replace kotlin-annotation-processing -> (...)-gradle for Kapt 2017-10-05 21:05:06 +03:00
Ilya Gorbunov
ae28af03d1 Add mavenCentral or jcenter to fetch external dependencies of our gradle plugin and stdlib 2017-10-05 21:05:05 +03:00
Ilya Gorbunov
865f2464ab Add aggregation task for gradle integration tests, rename task for gradle tests 2017-10-05 21:05:05 +03:00
Ilya Gorbunov
6a61d22ad3 Correctly setup maven local repository path and kotlin version for gradle integration tests 2017-10-05 21:05:05 +03:00
Sergey Igushkin
7af7696c44 Refactor UpToDatenessIT.kt
(cherry picked from commit 878ec8b)
2017-10-05 20:44:55 +03:00
Sergey Igushkin
5f593ac3f8 Add @Input to compiler args and compiler JAR. Add up-to-date-ness tests.
Issue #KT-20036 Fixed
Issue #KT-3463 Fixed
Issue #KT-16299 Fixed
Issue #KT-16915 Fixed

(cherry picked from commit e6d867f)
2017-10-05 20:24:01 +03:00
Sergey Igushkin
ba649d0869 Fix POM attributes missing form Gradle plugins
(cherry picked from commit bc447e8)
2017-10-05 19:21:04 +03:00
Alexey Sedunov
3df43ccc6a Gradle: Respect 'implement' when collecting transitive dependencies of
IDEA module

This covers the cases when module is transitively reachable via
sequence of "compile"/"implement" dependencies
with at least one "implement" present (cases when module is transitively
reachable via "compile" only are handled automatically)

 #KT-16926 Fixed
2017-10-05 17:30:26 +03:00
Ilya Chernikov
69e5f11889 Fix test generation on some platforms 2017-10-05 16:14:27 +02:00
Ilya Chernikov
f00fcddc76 Fix ide dependencies in gradle-plugin module 2017-10-05 16:14:26 +02:00
Ilya Chernikov
f48d0f4b15 Revert accidental test ignoring 2017-10-05 16:14:26 +02:00
Sergey Igushkin
28567570ea Changes related to the 'expectedBy' Gradle configuration:
* Remove the `extendsFrom` relation;
* Refactor, reword warnings;
* Add the new expectedBy name to `KotlinGradleModelBuilder.kt`.

(cherry picked from commit de198f0)
2017-10-05 15:37:44 +03:00
Sergey Igushkin
ff687131b1 Rename implement to expectedBy in Gradle, deprecate the old name
Issue #KT-20618 Fixed

(cherry picked from commit 6e0d378)
2017-10-05 15:37:43 +03:00
Mikhail Glukhikh
aff689afba Allow "create actual" for function even if partially-compatible exists
So #KT-20163 Fixed
2017-10-05 15:28:37 +03:00
Mikhail Glukhikh
e8321be380 Handle interface / abstract members correctly in "Create actual" fix
So #KT-20243 Fixed
2017-10-05 15:28:33 +03:00
Mikhail Glukhikh
fe786ad7f3 Set primary constructor and its properties actual in "create actual"
So #KT-20044 Fixed
2017-10-05 15:28:30 +03:00
Mikhail Glukhikh
d85c2dbe1f Specify relevant declaration type in "create actual" fix #KT-20325 Fixed 2017-10-05 15:28:28 +03:00
Mikhail Glukhikh
93109c0d0e Generate actual keyword for secondary constructors #KT-20008 Fixed 2017-10-05 15:28:25 +03:00
Mikhail Glukhikh
1e79d9791d Generate actual nested classes for actual owner class #KT-19937 Fixed 2017-10-05 15:28:22 +03:00
Mikhail Glukhikh
e47feaf0b8 Add test for KT-20007 2017-10-05 15:28:21 +03:00
Stanislav Erokhin
4c456983eb Fix javac tests (add separate descriptor rendering) 2017-10-05 15:11:45 +03:00
Stanislav Erokhin
208051b314 Do not run annotation processor in javac integrated tests
Annotation processor can be found in javaslang-2.0.6.jar library.
This jar should be in classpath because it used in compiler
(not as annotation processor of course).
Before migration to GSK this library was also in classpath and it isn't
clear, why it not recognised as an annotation processor.
Anyway, for this tests we should'nt run annotation processors
2017-10-05 15:11:44 +03:00
Toshiaki Kameyama
e92af08c98 Introduce "Assign to property" quick-fix #KT-17204 Fixed 2017-10-05 14:25:28 +03:00
Dmitry Petrov
67a50e92d0 Load annotations for default getter and setter
#KT-14697 Fixed
2017-10-05 10:24:29 +03:00
Mikhail Zarechenskiy
c6a00af2f0 Fix test data after f3344ec 2017-10-05 10:21:26 +03:00
Ilya Gorbunov
3fd1a0f14b Update maven-archetype plugin to 3.0.1
To get the fix for https://issues.apache.org/jira/browse/ARCHETYPE-488
2017-10-05 02:45:01 +03:00
Mikhail Zarechenskiy
a06203512f Minor, rename variable: expected -> actual 2017-10-05 00:10:46 +03:00
Mikhail Zarechenskiy
68a2ba4918 Fix function, expected declaration can be without expect modifier
For example, for nested classes of expected class
2017-10-05 00:10:45 +03:00
Mikhail Zarechenskiy
4b2fc9a325 Don't offer to remove empty primary constructor of expect class 2017-10-05 00:10:44 +03:00
Mikhail Zarechenskiy
f3344ec2b2 Treat expect classes as not having implicit default constructors
#KT-15522 Fixed
2017-10-05 00:10:42 +03:00
Ilya Gorbunov
887e71a7c1 Provide kotlin bootstrap source options 2017-10-04 20:02:26 +03:00
Ilya Gorbunov
5483de276e Specify bootstrap version with gradle props instead of system props
Make bootstrap dependency version explicit
2017-10-04 20:02:12 +03:00
Ilya Gorbunov
b7d21ab4da Use embeddedKotlinVersion to compile buildSrc, but make it possible to override it 2017-10-04 19:27:28 +03:00
Ilya Gorbunov
2627fe8387 Upgrade to gradle 4.2 2017-10-04 19:27:28 +03:00
Ilya Gorbunov
cfdcc9eb03 Minor: fix description typo #KT-20600 Fixed 2017-10-04 19:15:33 +03:00
Ilya Gorbunov
0898897057 Remove crossinline restriction from synchronized in js and common
#KT-20596 Fixed
2017-10-04 19:15:33 +03:00
Ilya Gorbunov
409f361a7c Pass project version as kotlinVersion to archetype integration tests
Verify that the projects created from archetypes can actually be built.
2017-10-04 19:05:31 +03:00
Sergey Igushkin
31c9e0072e Merge pull request #1289 from gildor/KT-18765
Move incremental compilation message from Gradle's warning to info logging level
Issue #KT-18765 Fixed
2017-10-04 16:52:35 +03:00
Simon Ogorodnik
237284d247 Fix ISE already disposed DefaultPicoContainer in Compiler Tests
Some test's won't create their own application, and assumes
that ApplicationManager.getApplication() is null

But CompilerEnvironmentTest had created application
somewhere inside compiler, disposed it, but forgot to reset
variable, causing few tests to fail because of not overridden
application
2017-10-04 15:36:46 +03:00
Yoshinori Isogai
0381b74fed Delete "Running specific generated tests" (#1329)
This section is valid before kotlin is built by gradle. Since there is
no working directory setting in run configuration, we need to delete
this document
2017-10-04 14:15:16 +02:00
Dmitry Petrov
a88de2b0da Ignore testSuspendInTheMiddleOfObjectConstructionEvaluationOrder in JS 2017-10-04 13:57:01 +03:00
Dmitry Petrov
7e808bd3ea Add more tests for constructor call evaluation order
- break in arguments
- continue in arguments
- early return in arguments
- non-local return in arguments
- nested constructor call in arguments
2017-10-04 13:39:48 +03:00
Dmitry Petrov
c3d74bdabb Support jump out of the constructor call in suspend functions
Jump out from expression (e.g., break or continue expression in call
arguments) requires stack normalization, which inserts POP instructions.
POPping an uninitialized value is similar to ASTORE, except that it
doesn't store a value to a local variable. Such POP instructions should
be removed during postprocessing of the uninitialized stores.
2017-10-04 13:39:48 +03:00
Dmitry Petrov
da6841163b Maintain evaluation order for suspend calls in constructor arguments
Insert 'Class.forName(...)' in place of NEW instruction, so that the
corresponding class will be initialized if required.
2017-10-04 13:39:48 +03:00
Dmitry Petrov
533c1d2541 Reject bytecode manipulating with uninitialized values on stack
NB this will break parcel-related tests in android-extensions compiler
plugin
2017-10-04 13:39:48 +03:00
Dmitry Petrov
3405ae30a1 Inner classes of generic classes can't extend Throwable
Do it in the same way as Java: prohibit inner classes (including
anonymous inner classes) capturing type parameters from outer classes
(but not outer methods) extending Throwable.

See KT-17981:
- Deprecated in 1.2
- Error in 1.3
2017-10-04 12:43:50 +03:00
Andrey Mischenko
e4fe9be5e7 Merge branch 'master' into KT-18765 2017-10-04 17:43:11 +08:00
Alexey Andreev
27e319a279 JS: fix parsing of object literals in js() function.
Also, fix generation of source maps of content of js() function.

See KT-19794
2017-10-04 12:01:51 +03:00
Alexey Andreev
c15847a957 JS: support non-local return from secondary constructor
See KT-14549
2017-10-04 12:00:53 +03:00
Alexey Andreev
e323da3c5e Fix compilation of Maven JS plugin 2017-10-03 17:23:02 +03:00
e5l
cbaf38f793 Add CLI test on new jsr305 flag values 2017-10-03 16:44:02 +03:00
e5l
1e157d6480 Use report policy from TypeQualifierDefault annotation if possible 2017-10-03 16:44:02 +03:00
e5l
c512db8e1c Validate -Xjsr305 value in CLI 2017-10-03 16:44:02 +03:00
Leonid Stashevsky
95d32d8d1e Add @UnderMigration annotation and options for report level 2017-10-03 16:44:02 +03:00
Nikolay Krasko
a524bde9b7 Rename: JetRunConfiguration* -> KotlinRunConfiguration* 2017-10-03 16:18:54 +03:00
Nikolay Krasko
0bffd04ef1 Add kotlin.stdlib requirement to module-info on configure (KT-19207)
KotlinAddRequiredModuleFix is almost copy ofAddRequiredModuleFix from
the platform but it moves actual fix method to static with less
parameters and checks directive presence before add.

 #KT-19207 Fixed
2017-10-03 16:18:53 +03:00
Nikolay Krasko
2634ed15fa Configure sdk properly in configure Kotlin tests 2017-10-03 16:10:33 +03:00
Nikolay Krasko
0f61a0f7bd Fix file root access failure in configure tests 2017-10-03 16:10:33 +03:00
Nikolay Krasko
dc86f8c432 Refactoring: extract "kotlin.stdlib" to constant
It will be used in IDE as well.
2017-10-03 16:10:33 +03:00
Nikolay Krasko
3145c096a7 Refactoring: introduce Sdk.version extension
(cherry picked from commit d387e6e)
2017-10-03 16:10:33 +03:00
Nikolay Krasko
4cdd4c04a3 Run configurations with module path for Java 9 named modules (KT-19886)
#KT-19886 Fixed

(cherry picked from commit 1e12828)
2017-10-03 16:10:33 +03:00
Nikolay Krasko
166682937f Copy mock JDK 9 from intellij idea
(cherry picked from commit aef9220)
2017-10-03 16:10:33 +03:00
Nikolay Krasko
8aa4b75e1c Quick fix for module is absent in module-info requirements (KT-20108)
#KT-20108 Fixed
2017-10-03 16:10:32 +03:00
Simon Ogorodnik
228588a87c Fix TestExecutedOnlyOnceTest by properly setting RunWith
When test contains nested test classes
Both root and nested classes should be annotated with
`@RunWith(JUnit3RunnerWithInners.class)`
to avoid running tests twice
2017-10-03 15:45:36 +03:00
Simon Ogorodnik
289b0862a7 Fix MavenTestCase to use Maven mirror only when it available 2017-10-03 15:18:04 +03:00
Alexey Andreev
10f7f61991 Fix compilation of Gradle JS task 2017-10-03 14:50:24 +03:00
Alexey Andreev
21e91c4052 JS: rename -source-map-source-roots to -source-map-base-dirs
See KT-19906
2017-10-03 14:26:37 +03:00
Mikhail Glukhikh
b3fe572447 Minor fix for EA-108087 2017-10-03 11:05:21 +03:00
Mikhail Glukhikh
5c4c77a80a Determine enclosing element correctly inside base constructor
So #KT-17680 Fixed
So #KT-18740 Fixed
So EA-76201 Fixed
2017-10-03 11:05:21 +03:00
Nicolay Mitropolsky
b839081349 Support for collections literals in LightAnnotations (KT-20543) 2017-10-02 18:44:23 +03:00
Alexey Sedunov
b288406e3c Multiplatform: Fix dependencies of implementing module descriptors cache
This fixes some failing tests
2017-10-02 18:14:05 +03:00
Alexey Sedunov
67798d73a1 Minor: Fix multi-module test data
This is required since "implements" dependency is now specified
explicitly in the Kotlin facet configuration
2017-10-02 18:14:04 +03:00
Alexey Sedunov
ea99a2b537 Kotlin Facet: Fix deserialization of "implements" dependency 2017-10-02 18:14:04 +03:00
Alexey Sedunov
9afd2d367b Minor: Fix ReferenceResolveTestGenerated test data 2017-10-02 18:14:04 +03:00
Alexey Sedunov
aabe23d410 Minor: Fix coroutine package name in quick fix tests 2017-10-02 18:14:04 +03:00
Toshiaki Kameyama
2121322665 Fix useless "Remove curly braces" before Chinese character
So #KT-20409 Fixed
2017-10-02 17:46:07 +03:00
Mikhail Glukhikh
912ddfcb2b Build name correctly in ShadowedDeclarationsFilter
So #KT-16383 Fixed
Also should fix EA-104812, EA-99338, EA-107064
2017-10-02 17:41:24 +03:00
Mikhail Glukhikh
9aa25f8af8 Code cleanup: shadowed declarations filter 2017-10-02 17:41:24 +03:00
Denis Zharkov
edbf360852 Do not render trivial variables in DataFlow tests
The reason is that while there are optimizations for them
definition of their state is both rather simple and may be
confusing in testData
2017-10-02 10:04:16 +03:00
Denis Zharkov
477aeef90c Update test data for rendered CFA results after optimizations 2017-10-02 10:04:16 +03:00
Denis Zharkov
a51078fda6 Turn off optimizations in case of do-while presence 2017-10-02 10:04:16 +03:00
Denis Zharkov
c31b5beb9e Remove redundant check for a variable being initialized after write
It's anyway is obvious for write instruction, while effectively
after optimizations we treat val with syntactic initializer
uninitialized until their immediate initiazer
2017-10-02 10:04:16 +03:00
Denis Zharkov
8eb36947ca Minor. Invert and extract condition for checkAssignmentBeforeDeclaration 2017-10-02 10:04:16 +03:00
Denis Zharkov
527daced46 Optimize CFG for cases of simple variables
Parameters/vals with an immediate initializer (which we assume is a
rather common situation) do not require any kind of complicated CFA

- Unused vals can be simply determined by linear traversal of
  the pseudocode
- Definite assignment is a bit more complicated: a read-instruction of val
  can be considered as a safe if it's located *after* the first write in
  the pseudocode. It works almost always beside the case with do/while
  (see the test changed). This case will be fixed in the further commits

The test for kt897.kt will also be fixed further, all other changes
might be considered as minor as they mostly change diagnostics for
already red code
2017-10-02 10:04:16 +03:00
Denis Zharkov
4b79269cec Extract ReadOnly*ControlFlowInfo interfaces from *ControlFlowInfo
It's necessary for further optimizations: not for all cases we actually
need to build a map

The naming is still a subject for discussion
2017-10-02 10:04:16 +03:00
Ilya Gorbunov
791bfde64b Fork ivy download process
Helps to fix download hangs under some circumstances.
2017-10-02 05:24:28 +03:00
Alexey Tsvetkov
72d2e7dd45 Minor: restore accidentally removed import 2017-09-29 21:40:54 +03:00
Alexey Tsvetkov
a8cfe19769 Add option to debug Kotlin daemon in Gradle integration tests 2017-09-29 15:19:36 +03:00
Alexey Tsvetkov
39f49f1449 Ensure dependencies are installed before running Gradle integration tests 2017-09-29 15:19:36 +03:00
Alexander Udalov
5348d2e43a Consider module output as part of the same Java module
This fixes incremental compilation for explicit Java 9 modules

 #KT-20064 Fixed
 #KT-20082 Fixed
2017-09-29 15:10:38 +03:00
Alexander Udalov
0a9c21dbc8 Refactor roots computation in ClasspathRootsResolver 2017-09-29 15:10:37 +03:00
Alexander Udalov
848be226ed Minor, invert JavaModule.isBinary -> isSourceModule 2017-09-29 15:10:37 +03:00
Alexander Udalov
8496944a36 Refactor JavaModule, support several roots in one module
In case of partial/incremental compilation, a module usually consists of
two roots, one of which is source and another is binary. Thus, it's
incorrect to divide modules into "binary" and "non-binary", and only
look for .class files in "binary" modules in
CliJavaModuleResolver.findJavaModule. The more correct way is to think
of a module as a collection of roots, and every root is either binary or
source
2017-09-29 15:10:37 +03:00
Simon Ogorodnik
03f97ff7f1 Revert "Add 1.2-Beta to changelog"
This reverts commit 676e5d2a88.
2017-09-29 14:54:23 +03:00
Sergey Mashkov
49cbb2219c Maven: reduce maven plugin output
#KT-20400 Fixed
2017-09-29 14:49:41 +03:00
Alexey Sedunov
be21a84778 Configuration: Fix modification checking in compiler settings UI
#KT-18996 Fixed
2017-09-29 14:37:04 +03:00
Alexey Sedunov
b4847e69e8 Minor: Fix test data 2017-09-29 14:37:04 +03:00
Alexey Sedunov
f63e33b23d Modules: Support production-on-test dependency
This feature is supported in IDEA project configuration
and can be used in Maven/Gradle-based projects

 #KT-20112 Fixed
2017-09-29 14:37:04 +03:00
Alexey Andreev
0269c3309a JS: fix parsing of wrong delete operation in js function.
See KT-15294
2017-09-29 14:32:49 +03:00
Alexey Andreev
bad50c03a7 JS: support cross-module inlining of suspend functions
See KT-18063
2017-09-29 14:32:49 +03:00
Alexey Andreev
992cc61abc JS: prove that KT-15292 is no more reproducible 2017-09-29 14:32:48 +03:00
Alexey Andreev
bf87826dd1 JS: add test to prove that KT-15622 is no more reproducible 2017-09-29 14:32:47 +03:00
Alexey Andreev
43c6f8b9b1 JS: fix copying fun with default args from interface to abstract class
See KT-20451
2017-09-29 14:32:47 +03:00
Simon Ogorodnik
676e5d2a88 Add 1.2-Beta to changelog 2017-09-29 14:20:26 +03:00
Denis Zharkov
13bf35f48e Make TYPE_USE default qualifiers overriding all other applicabilities
If there is default qualifier with TYPE_USE closer than one with METHOD
then its nullability should be considered even when enhancing return type

 #KT-20016 Fixed
2017-09-29 10:01:04 +03:00
Alexey Tsvetkov
62f293280c Gradle: compile tests incrementally when main is changed
#KT-17674 fixed
2017-09-29 05:11:20 +03:00
Ilya Gorbunov
779b9c6fcc Change TeamCity build status badge to point to the compiler build configuration 2017-09-28 22:02:53 +03:00
Francesco Vasco
9ffd0db4a8 Avoid ISUB in kotlin.repeat 2017-09-28 22:02:53 +03:00
Anton Bannykh
ab615b7d70 Merge pull request #1321 from JetBrains/abannykh/fix-npm-publish
Don't set publish tag in package.json since it overrides the CLI flags
2017-09-28 19:50:11 +03:00
Anton Bannykh
796e0feaa4 Don't set publish tag in package.json since it overrides the CLI flags 2017-09-28 19:45:44 +03:00
Mikhail Glukhikh
e8682fa9b9 Use diagnoseDescriptorNotFound() in findClassDescriptor 2017-09-28 18:43:39 +03:00
Mikhail Glukhikh
5c0bc266b3 Do not use unsafe getClassDescriptor() inside resolveToDescriptor
Introduce getClassDescriptorIfAny / findClassDescriptorIfAny instead
May fix KT-18740 / EA-76201
2017-09-28 18:43:38 +03:00
Mikhail Glukhikh
adf0b25c0b LazyDeclarationResolver.kt: convert to Kotlin 2017-09-28 18:43:38 +03:00
Mikhail Glukhikh
04157c4137 LazyDeclarationResolver.java --> kt 2017-09-28 18:43:38 +03:00
Mikhail Glukhikh
5c5776a6b5 Use resolveToDescriptorIfAny in IDELightClassGenerationSupport 2017-09-28 18:43:38 +03:00
Denis Zharkov
5b7c766a54 Use Jsr305State.DEFAULT instead of IGNORE as a default value 2017-09-28 15:38:27 +03:00
Denis Zharkov
dd2630e5c6 Fix loading additional compiler arguments from facets for libraries 2017-09-28 15:38:11 +03:00
Mikhail Glukhikh
43f1dbeabf Introduce cached ModuleDescriptor.implementingDescriptors
This property is used instead of findImplementingDescriptors,
which is basically too slow
2017-09-28 15:15:03 +03:00
Mikhail Glukhikh
fa23471397 Add test for KT-19222 to fix behaviour
Issue was fixed together with KT-17374
So #KT-19222 Fixed
2017-09-28 15:15:02 +03:00
Mikhail Glukhikh
5687fe6e39 Introduce ModuleDescriptor.findImplementingDescriptor() via facets
This function is now used instead of allImplementingCompatibleModules,
thus allowing it to be deleted together with allImplementingModules

So #KT-17369 Fixed
So #KT-17374 Fixed
May fix also some other MPP issues
2017-09-28 15:15:02 +03:00
Mikhail Glukhikh
c9f11e4bc2 Add implements common dependency for regular multiplatform tests 2017-09-28 15:15:02 +03:00
Mikhail Glukhikh
848a80a266 Add test (with incorrect work yet) for KT-17374 2017-09-28 15:15:01 +03:00
Mikhail Glukhikh
390de737e7 Fix messages in some multi platform highlighting tests 2017-09-28 15:15:01 +03:00
Mikhail Glukhikh
5edeb359c8 Split multi module and multi platform highlighting tests
Now both of them can execute without problems
2017-09-28 15:15:01 +03:00
Dmitry Petrov
3158700500 Add test for generic setValue called via synthetic accessor
Synthetic accessor for 'setValue' was generated incorrectly,
specific case of KT-20491 (Incorrect synthetic accessor generated for a
generic base class function specialized with primitive type).

Make sure there's no equivalent of KT-20387 for delegated properties.
2017-09-28 14:55:11 +03:00
Dmitry Petrov
f4f1ea91d9 Use accessible get/set arguments for collection element receiver
When generating collection element receiver (such as 'a[i]'), accessible
descriptor for get/set operator should be used.
Otherwise, if the corresponding get/set operator fun is called via an
accessor, its argument types may be different in case of generic fun
specialized with primitive types.

 #KT-20387 Fixed
2017-09-28 14:55:11 +03:00
Dmitry Petrov
3994034f46 Keep track of synthetic accessor parameter types
Accessor parameter types may be different from callee parameter types
in case of generic methods specialized by primitive types:

  open class Base<T> {
    protected fun foo(x: T) {}
  }

  // in different package
  class Derived : Base<Long> {
    inner class Inner {
      fun bar() { foo(42L) }
    }
  }

Synthetic accessor for 'Base.foo' in 'Derived' has signature '(J)V'
(not '(Ljava.lang.Object;)V' or '(Ljava.lang.Long;)V'),
and should box its parameter.

Note that in Java the corresponding synthetic accessor has signature
'(Ljava.lang.Long;)V' with auto-boxing at call site.

 #KT-20491 Fixed
2017-09-28 14:55:11 +03:00
Dmitry Petrov
73724bcdc7 Do not copy immediately created arrays in spread arguments
E.g., 'foo(x = *intArrayOf(42))'.

 #KT-20462 Fixed
2017-09-28 14:55:11 +03:00
Denis Zharkov
0d5a2a7e18 Minor. Drop unused class ScopeLevelsAndSkippedForLookups 2017-09-28 14:01:30 +03:00
Denis Zharkov
12b348ae48 Fix incorrectly configured IDE tests
The important changes are in ideaTestUtils.kt:
`configureByFiles` must be called on the relative to testData dir path,
otherwise java files in the project belong to src/idea/testData/.../A.java
instead of src/A.java and can't be found in the root package

New updates in resolution when resolving A() call is now asking whether
<root>.A exists in PsiPackage::getClasses instead of
PsiPackage::findClassByShortName that can find a class even if it's located
in the wrong directory
2017-09-28 14:01:30 +03:00
Denis Zharkov
5b01a32bd3 Extract val isNameForHidesMember 2017-09-28 14:01:30 +03:00
Denis Zharkov
1f23d610a6 Extract TowerResolver.Task::processImplicitReceiver 2017-09-28 14:01:30 +03:00
Denis Zharkov
6b97203979 Move all state from TowerResolver.Task::run to Task class
Also extract local functions from it and introduce
TowerData.ForLookupForNoExplicitReceiver class
2017-09-28 14:01:30 +03:00
Denis Zharkov
c7fda42ccc Introduce TowerResolver.Task class
Its main purpose is code simplification: ImplicitScopeTower::run
contains a lot of local functions that are needed because of
lots of shared state

So, we're moving the state to the Task class instead

NB: This change doesn't change the code of `run`, it will be done
in further commits
2017-09-28 14:01:30 +03:00
Denis Zharkov
b77cc54122 Update lookupTracker testData
Just the order of lookups has been changed
2017-09-28 14:01:30 +03:00
Denis Zharkov
b1387b2ae7 Make call resolution responsible for calling recordLookups
The idea is that all tower levels are partitioned into two groups:
- ones that may contain the target name or INVOKE; they're processed as usual
- ones that can't contain the name; they're simply skipped until
the end of resolution process when it's being passed to scope processors
to allow them record necessary lookups
2017-09-28 14:01:30 +03:00
Denis Zharkov
265794e712 Add necessary ResolutionScope::recordLookup implementations 2017-09-28 14:01:30 +03:00
Denis Zharkov
580a7e3e4d Drop location parameter from ResolutionScope::definitelyDoesNotContainName
definitelyDoesNotContainName is called too eagerly sometimes and it leads
to obviously redundant lookups

The idea is to put responsibility for calling recordLookup to resolution
itself
2017-09-28 14:01:30 +03:00
Denis Zharkov
37440c70e2 Optimize invoke processors
- Avoid creating of empty KnownResultProcessor for variables
- Do not consider definetely inapplicable tower data
2017-09-28 14:01:30 +03:00
Denis Zharkov
860951748f Filter out inapplicable member scopes in resolution 2017-09-28 14:01:30 +03:00
Denis Zharkov
d0bf0f5fb3 Filter out inapplicable non-local levels for implicit receivers 2017-09-28 14:01:30 +03:00
Denis Zharkov
51d3969822 Do not run resolution processors for inapplicable statics 2017-09-28 14:01:30 +03:00
Denis Zharkov
c018a76aaa Use the same default import scopes for all files in module 2017-09-28 14:01:30 +03:00
Denis Zharkov
3322ed6e04 Implement LazyImportResolver::definitelyDoesNotContainName 2017-09-28 14:01:30 +03:00
Denis Zharkov
6e766634c1 Add location parameter to ResolutionScope::definitelyDoesNotContainName
It should be used to record lookups in case of fast paths
in resolution
2017-09-28 14:01:30 +03:00
Denis Zharkov
69f3b01e98 Introduce ImportingScope::computeImportedNames 2017-09-28 14:01:30 +03:00
Denis Zharkov
cd3edfc5b2 Introduce MemberScope::classifierNames and some implementations
It aims to help with further optimizations
2017-09-28 14:01:30 +03:00
Denis Zharkov
1b255b4ed0 Implement LazyPackageMemberScope::getFunctions/VariableNames
It's necessary for future optimizations
Although current implementation is rather conservative,
it should be enough for current needs
2017-09-28 14:01:30 +03:00
Denis Zharkov
688a359985 Avoid running scope processors on hides-member for not-forEach names 2017-09-28 14:01:30 +03:00
Denis Zharkov
fb80e19b88 Filter out inapplicable local scopes in call resolution
The idea is that resolution has an approximate complexity
close to (n + n*m) * 3
Where n is a number of scopes, m is a number of receivers
and 3-constant is used because each of these combinations
runs through 3 processors for functions.

And while call resolver seems to be a hot spot, it should be
useful to decreate the value of n
2017-09-28 14:01:30 +03:00
Denis Zharkov
94356e891b Introduce ResolutionScope::definitelyDoesNotContainName
Also add some obvious implementations

This method might be used in resolution to filter out
inapplicable scopes
2017-09-28 14:01:30 +03:00
Mikhail Glukhikh
7b5842a088 Fix inspection test 2017-09-28 14:00:56 +03:00
Mikhael Bogdanov
e7e28419e4 Migrate CodegenJdkCommonTestSuite.kt to gradle 2017-09-28 12:36:31 +02:00
Stanislav Erokhin
4a0ad54829 Fix Working with the project in IntelliJ IDEA instruction 2017-09-27 21:23:00 +03:00
Alexander Udalov
77765a8064 Do not run proguard by default, unless "kotlin.build.proguard" is "true" 2017-09-27 20:15:31 +03:00
Dmitry Jemerov
16a97a8917 Mark multiplatform projects as experimental in the UI 2017-09-27 17:18:12 +02:00
Alexander Udalov
a7443adb65 Remove obsolete dependency on cli-parser 2017-09-27 15:47:35 +03:00
Alexander Udalov
24b0b75d8e Do not output compiler jar path during configuration of libraries 2017-09-27 15:47:34 +03:00
Alexey Andreev
3b5c2bbcaa Add Gradle task to run JS tests without DCE
This should be helpful when frequently testing changes in JS BE.
2017-09-27 14:22:15 +03:00
Dmitry Petrov
c0a83c3c8a KT-19251 Process uninitialized stores in mandatory bytecode pass
See
https://youtrack.jetbrains.com/issue/KT-19251
https://github.com/puniverse/quasar/issues/280
https://bugs.openjdk.java.net/browse/JDK-8046233

Inline function calls (as well as try/catch expressions) in constructor
arguments produce bytecode that spills stack, and stores uninitialized
objects (created by 'NEW C', but not initialized by 'C.<init>') to
local variables. Such bytecode is valid according to the JVM spec, but
confuses Quasar (and other bytecode postprocessing tools),
and fails to verify under some (buggy) versions of JDK 8.

In order to avoid that, we apply 'processUnitializedStores' already
implemented for coroutines. It moves 'NEW' instructions after the
constructor arguments evaluation, producing code like

<initialize class C using Class.forName>
<evaluate constructor arguments>
<store constructor arguments to variables>
NEW C
DUP
<load constructor arguments from variables>
INVOKESPECIAL C.<init>(...)

NB some other expressions, such as break/continue in the constructor
arguments, also can produce "weird" bytecode: object is created by a
'NEW C' instruction, but later (conditionally) POPped from stack and
left uninitialized. This, as we know, also can screw bytecode
postprocessing. However, it looks like we can get away with it ATM.
Otherwise it looks like we'd have to analyze constructor arguments, see
if the evaluation can "jump out", and perform argument linearization in
codegen.
2017-09-27 12:38:52 +03:00
Andrey Mischenko
3d8486e8a6 Allow to use Gradle property to configure JDK path 2017-09-26 18:14:45 +02:00
Yoshinori Isogai
4428ba0bb7 Add "Generate Tests" run configuration (#1318) 2017-09-26 18:02:03 +02:00
Denis Zharkov
d6ee774243 Load some of the TYPE_USE annotations in fast class reading mode
Only top-level types on fields, methods' return types and
value parameters are supported to catch-up how class-files are loaded
in IntelliJ (see IDEA-153093)

NB: this commit also affects
ForeignJava8AnnotationsNoAnnotationInClasspathWithFastClassReadingTestGenerated
that were failing before

 #KT-20016 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov
08f3dbce67 Fix configuration for FastClassReading foreign-annotations tests
Prior to this change USE_FAST_CLASS_FILES_READING actually
has not worked because the flag is being read in the KotlinCoreEnvironment
constructor 🤦‍♂️
2017-09-26 16:40:47 +03:00
Denis Zharkov
fd9025a4fb Add Java8 foreign-annotations tests without jsr305.jar in the classpath
Some of them are expected to fail since neither IntelliJ class reading
nor our fast class reading can read annotations on type arguments
2017-09-26 16:40:47 +03:00
Denis Zharkov
58a0ca61a9 Minor. Fix java test data to make it actually compilable 2017-09-26 16:40:47 +03:00
Denis Zharkov
fdc6b37264 Obtain default type qualifiers from value parameters too
#KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov
71f85812d6 Improve support for TYPE_USE default qualifiers
- Apply default qualifiers to type arguments if they contain TYPE_USE
in applicability list
- Read TYPE_USE placed default qualifier annotations

 #KT-19592 Fixed
 #KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov
69665e7560 Minor. Convert function to block body, extract val 2017-09-26 16:40:47 +03:00
Denis Zharkov
bd809c872a Minor. Move local functions to file and inline parameter 2017-09-26 16:40:47 +03:00
Denis Zharkov
775d6988e8 Preserve flexibility for Java types annotated with @NonNull(UNKNOWN)
Before this chanhe, these annotations are simply ignored, but they should
preserve flexibility in case of enhanced nullability obtained from
enclosing default qualifier

 #KT-20158 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov
d0e912167e Minor. Simplify handling nullablility for warning 2017-09-26 16:40:47 +03:00
Denis Zharkov
02d3d9785c Move JSR-305 tests to one directory and strip common name prefix 2017-09-26 16:40:47 +03:00
Denis Zharkov
8a66919a5c Support @NonNull(when = NEVER) nullability annotation
#KT-20131 Fixed
2017-09-26 16:40:47 +03:00
Alexey Tsvetkov
1c7b8ec938 Change test data so IC and non IC warnings count match
When IC is on and new Kotlin class is referencing
new Java class, new Kotlin file is compiled twice,
because JPS thinks new Kotlin class is affected by
new Java class (see https://youtrack.jetbrains.com/issue/KT-20318).

This does not happen when IC is off, and KotlinBuilder
requests chunk rebuild (see previous commit).

I decided to remove the reference, because the issue
is now known, and the reference is non critical for the test.
2017-09-26 16:35:24 +03:00
Alexey Tsvetkov
7a5e0e1107 Request CHUNK_REBUILD when IC is off and there are dirty Kotlin files
Otherwise unexpected compile error might happen,
when there are Groovy files, but they are not dirty,
so Groovy builder does not generate source stubs,
and Kotlin builder is filtering out output directory
from classpath (because it may contain outdated Java classes).

Previously the issue was not detected,
because it was not possible to turn off the IC completely (in JPS),
only switch to the legacy IC.

    #KT-20138
2017-09-26 16:35:24 +03:00
Dmitry Jemerov
c290212901 Allow to suppress "Kotlin not configured" notification per-module 2017-09-26 14:52:10 +02:00
Dmitry Jemerov
572ec19c55 SuppressNotificationState: J2K 2017-09-26 14:46:40 +02:00
Dmitry Jemerov
e02d121438 SuppressNotificationState: rename to .kt 2017-09-26 14:46:40 +02:00
Dmitry Jemerov
09f826b68d Enable UI Designer instrumentation in Gradle build 2017-09-26 14:43:01 +02:00
Mikhail Zarechenskiy
8a545f05de Provide quick fix for migration of single elements in named arguments
See more in KT-20171
2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy
8ab7c26cae Provide quick fix for named arguments to varargs in annotations
See more in KT-20171
2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy
66cb8db12a Support LANGUAGE_VERSION directive in quick fix tests 2017-09-26 14:49:43 +03:00
Mikhail Zarechenskiy
69e3dd89f6 Split diagnostic factory for the ease of code evolution and tooling 2017-09-26 14:49:42 +03:00
Alexey Andreev
3b2d634cea JS: optimize variable representation in coroutines
Don't convert local variables to fields of coroutine object
when variable is both used and defined in a single block.
2017-09-26 13:56:20 +03:00
Alexey Andreev
b852f73dd2 JS: make string template optimization more conservative
See KT-18548
2017-09-26 13:56:20 +03:00
Alexey Andreev
ca014468ee JS: improve name clash checker to handle complicated cases
See KT-18010
2017-09-26 13:56:19 +03:00
Alexey Andreev
95566b1374 JS: fix serialization of fileId in case of incremental compilation 2017-09-26 13:56:19 +03:00
Nikolay Krasko
3bbf054f0a Fix memory leak from SpecifyTypeExplicitlyIntention 2017-09-26 13:48:22 +03:00
Sergey Igushkin
40ec513c68 Fix tests compilation: cuplicate compileOnly dependencies to testCompile 2017-09-26 13:11:02 +03:00
Kirill Rakhman
1db365bb59 Insert explicit property type while converting accessor to block body
So #KT-20417 Fixed
2017-09-26 12:16:14 +03:00
Nikolay Krasko
31f5c105f3 Remove "javax.annotation.Nullable" usage and clean up file 2017-09-25 20:41:54 +03:00
Nikolay Krasko
412fb62bbb Fix de-reference nullable virtual file (EA-107980) 2017-09-25 20:41:54 +03:00
Nikolay Krasko
500d192063 Remove null assert (EA-107777) 2017-09-25 20:41:53 +03:00
Nikolay Krasko
98c50d3bfb Do not try to create ExactJavaBreakpointVariant with null position (EA-107577) 2017-09-25 20:41:53 +03:00
Nikolay Krasko
8b1fbc9828 fixHost might be null (EA-107022) 2017-09-25 20:41:53 +03:00
Nikolay Krasko
fc54018313 Don't convert to PropertyDescriptor without check (EA-92870) 2017-09-25 20:41:53 +03:00
Nikolay Krasko
d51f54693f Exist if no identifier found (EA-91332) 2017-09-25 20:41:53 +03:00
Nikolay Krasko
2e7be02d51 Add settings for protobuf plugin 2017-09-25 20:41:53 +03:00
Nikolay Krasko
ed2c7d3a9f Minor: fix warnings in increment-version.kts 2017-09-25 20:41:53 +03:00
Sergey Igushkin
a23532d1ee Replace the compile dependency on the Gradle API with a compileOnly one 2017-09-25 18:42:39 +03:00
Mikhail Glukhikh
e8b95b971d Make parentheses necessary for '(x op return y) op z' #KT-16808 Fixed 2017-09-25 18:16:42 +03:00
Mikhail Glukhikh
426a54c3ab Do not count callable reference as recursive property access
So #KT-20104 Fixed
2017-09-25 18:16:42 +03:00
Dmitry Petrov
8f9ea3e08b Fix const range bounds generation 2017-09-25 17:49:33 +03:00
Kirill Rakhman
e82544ffb0 build.gradle.kts: replace listOf().filterNotNull() with listOfNotNull() 2017-09-25 16:32:08 +03:00
Mikhail Glukhikh
253ae10e5f Array equality: replace Arrays.equals with contentEquals in intention 2017-09-25 16:27:51 +03:00
Mikhail Zarechenskiy
32531b3afc Allow to have all parameters with default values in actual annotation
#KT-19656 In Progress
2017-09-25 16:19:05 +03:00
Toshiaki Kameyama
8b135c12e7 Delete useless assert() after simplify comparison #KT-14695 Fixed 2017-09-25 15:35:11 +03:00
Alexey Sedunov
e87f9633be Copy: Do not check conflicts for cross-project copying
#KT-19949 Fixed
 #KT-19972 Fixed
 #EA-105637 Fixed
2017-09-25 14:40:17 +03:00
Alexey Sedunov
6e59cc2140 Copy: Copy entire file if it contains just a selected declaration 2017-09-25 14:40:17 +03:00
Alexey Sedunov
c8c0ab1647 Copy: Fix import insertion on declaration copying
#KT-19909 Fixed
2017-09-25 14:40:17 +03:00
Alexey Sedunov
0beadddb7f Copy: Improve file copying
- Do not copy individual declarations if entire file is selected
  (keeping original content with comments, formatting, etc.)
- Update package directive when original file packages matches
  its directory

 #KT-20092 Fixed
 #KT-18196 Fixed
2017-09-25 14:40:17 +03:00
Alexey Sedunov
fbf6bd534c Move: Disable MoveDeclarationsCopyPasteProcessor in dumb mode
#KT-20199 Fixed
2017-09-25 14:40:16 +03:00
Alexey Sedunov
963747ce04 Move: Optimize conflict analysis
- Do not process conflicts twice wgen moving a directory
- Check move target before resolving usage context declaration
- Skip visibility check for usages referring to public declarations
- Skip module conflict check for declarations with unchanged module
- Do not report lambdas as usage container (use enclosing declaration)
2017-09-25 14:40:16 +03:00
Alexey Sedunov
fefa2304a0 Move to Separate File: Optimize usage search/processing
- Import optimization is already performed by refactoring helper,
so running optimizer explicitly is unnecessary

- Do not search external usages for declarations with unchaged package
and module

 #KT-18823 Fixed
2017-09-25 14:40:16 +03:00
Alexey Sedunov
0a0457298b Misc: Run MoveKotlinDeclarationsProcessor.findUsages() under progress
#KT-20205 Fixed
2017-09-25 14:40:16 +03:00
Alexey Sedunov
c37489ab8b Kotlin Facet: Do not restrict API version list by stdlib version
#KT-19955 Fixed
2017-09-25 14:40:16 +03:00
Alexey Sedunov
1e82b23321 Minor: Drop unnecessary non-null assertion
#EA-107378 Fixed
2017-09-25 14:40:16 +03:00
Toshiaki Kameyama
1043284afe Add data modifier to a class quickfix #KT-18220 Fixed 2017-09-25 14:17:35 +03:00
Toshiaki Kameyama
f08e9832a6 Show warning also if arrays are compared by '!=' #KT-20259 Fixed 2017-09-25 12:15:17 +03:00
Kirill Rakhman
93252926ba Introduce additional quick-fix for (collection) type mismatch
This fixed inserts conversion .toSequence/Array/Iterable/Collection/List
So #KT-19735 Fixed
2017-09-25 12:10:28 +03:00
Alexander Udalov
7f5b9b1760 Add tests on quick fix that adds 'actual' to platform declaration
#KT-18454
2017-09-25 12:00:18 +03:00
Alexander Udalov
60430828cf Deduplicate code in AbstractQuickFixMulti{File,Module}Test 2017-09-25 12:00:18 +03:00
Alexander Udalov
113c83b47a Minor, cleanup AbstractQuickFixMultiFileTest 2017-09-25 12:00:18 +03:00
Alexander Udalov
23d6690581 Fix codegen for multifile class parts with type aliases only
#KT-20337 Fixed
2017-09-25 11:58:20 +03:00
Alexander Udalov
09f36927a5 Do not try to generate 'expect' declarations in multifile classes
Similarly to PackageCodegenImpl#generateFile

 #KT-15754 Fixed
 #KT-17478 Fixed
2017-09-25 11:58:20 +03:00
Alexander Udalov
3f1ee74475 Minor, refactor compiler-running code in multiplatform integration test
The compiler is run twice and outputs are compared for equality. Thus,
if both runs ended with exceptions, the outputs were never equal because
the compiler was run from different places (stack traces were different
in only one line), which was a bit weird. Now outputs are equal and in
case of an exception, a standard "actual data differs from file content"
message is displayed
2017-09-25 11:58:20 +03:00
Alexander Udalov
2d9f07deec Minor, add test for obsolete issue on "actual missing" error
#KT-20142
2017-09-25 11:58:20 +03:00
Alexander Udalov
2281ac842a Prohibit super constructor call for 'expect' class
#KT-15490 Fixed
2017-09-25 11:58:20 +03:00
Alexander Udalov
8ae7343557 Prohibit 'expect' lateinit member properties
#KT-20319 Fixed
2017-09-25 11:58:20 +03:00
Alexander Udalov
1f992ed845 Improve error on 'expect' delegated property
#KT-15054 Fixed
 #KT-15055 Fixed
2017-09-25 11:58:20 +03:00
Mikhail Glukhikh
258e8f73b6 Expect/actual: add inspection for Suppress("DIAGNOSTIC") migration
So #KT-20328 Fixed
2017-09-25 11:48:15 +03:00
Mikhail Glukhikh
0bce06dc0f Synchronize cleanupTool = true with CleanupLocalInspectionTool
So #KT-20366 Fixed
2017-09-25 11:47:11 +03:00
Mikhail Glukhikh
d6028877e1 Add kapt3-idea dependency to gradle script 2017-09-25 11:47:08 +03:00
Mikhail Glukhikh
f348ee9381 Fix a pair of multi-platform messages #KT-20327 Fixed 2017-09-25 11:47:05 +03:00
Alexey Andreev
ee4d790f43 JS: optimize default arguments in cross-module inliner
This reduces size of circlet UI (of approx 2.5 mb) by about 90 kb
2017-09-25 11:29:05 +03:00
Alexey Andreev
e6ab3dc936 JS: generate aliases for intrinsics.
This makes generated code more friendly to UglifyJS.
For example, uglified circlet loses 15 kb.
2017-09-25 11:29:04 +03:00
Ilya Chernikov
80ac8897ff Fix idea plugin jar name and ultimate build 2017-09-22 17:41:52 +02:00
Sergey Igushkin
25ca079fc5 Fix agp25 source set Kotlin classes not included in kotlin-gradle-plugin 2017-09-22 17:30:01 +03:00
Nikolay Krasko
1d51e5b59b Refactoring: reuse implementation 2017-09-22 16:51:08 +03:00
Nikolay Krasko
5a8c957edc Fix null-pointer template apply (EA-102391) 2017-09-22 16:51:08 +03:00
Nikolay Krasko
a8211a77d4 Fix null-pointer because of nullable elementAt (EA-99963)
#EA-99963 Fixed
2017-09-22 16:51:08 +03:00
Nikolay Krasko
a51a9795ae Fix null-pointer because of nullable elementAt (EA-101762)
#EA-101762 Fixed
2017-09-22 16:51:08 +03:00
Ilya Gorbunov
00fa8ee464 Setup JRE version for codegen tests
Add camelCase task name aliases for codegen tests
2017-09-22 15:37:38 +03:00
Ilya Gorbunov
43e2be26f8 Advance stdlib version to 1.1.60 2017-09-22 15:37:38 +03:00
Dmitry Jemerov
0682f74560 Avoid duplicate file type calculation 2017-09-22 14:30:36 +02:00
Denis Zharkov
c7812beea4 Fix SOE in SignatureEnhancement::extractNullability
The problem was that `resolveTypeQualifierAnnotation` actually doesn't
guarantee that `typeQualifierAnnotation` is javax.annotation.NonNull
with argument

It could be just any type qualifier (see the test)
2017-09-22 14:15:11 +03:00
Ilya Chernikov
1953f8e945 Fix build-common publishing 2017-09-21 20:34:10 +02:00
Ilya Chernikov
0b34dde905 Add android-extensions-runtime to the dist 2017-09-21 20:34:08 +02:00
Ilya Chernikov
b5d68515e8 Fix path to android-extensions-runtime in ParcelBoxTest 2017-09-21 20:34:07 +02:00
Dmitry Jemerov
4549cc7289 Fix CodeConformanceTest for new gradle build 2017-09-21 18:09:25 +02:00
Dmitry Jemerov
65c0e445fd Don't crash when trying to build stubs for files that have been deleted
Fixes EA-97751
2017-09-21 17:48:06 +02:00
Dmitry Jemerov
690eaa95bd Update expected testdata of live templates test 2017-09-21 17:33:55 +02:00
Dmitry Jemerov
4c04eaa29a Don't hard-code dependency versions in Maven import test 2017-09-21 17:17:44 +02:00
Dmitry Jemerov
7821366f6a Add missing runtime dependency on TestNG and coverage plugins 2017-09-21 16:58:28 +02:00
Dmitry Jemerov
459d4f3ee9 Fix EAP detection regexp for double-digit patch releases
#KT-20331 Fixed
2017-09-21 16:17:51 +02:00
Toshiaki Kameyama
0b7055f7c0 Join lines could "convert to expression body" #KT-15769 Fixed (#1304) 2017-09-21 16:15:44 +02:00
Dmitry Jemerov
ab25beeb37 Fix exception in KotlinExpandNodeProjectViewProvider.modify 2017-09-21 15:19:19 +02:00
Mikhail Glukhikh
658ffa6c49 Add deprecated modifier to cleanup diagnostic list 2017-09-21 16:09:57 +03:00
Jonathan Leitschuh
539aed32d2 Improve information regarding running tests that load resources (#1298)
* Improve information regarding running tests that load resources

Figuring out how to run isolated generated tests is not imidiately straightforward.
This clears up confusion by throwing a more helpful error in the tests and
adding a section to the ReadMe.

* Cleanup ReadMe and comments after review feedback
2017-09-21 11:20:49 +02:00
Andrey Mischenko
4a2ea4de4b KT-18765 Move incremental compilation message from Gradle's warning to info logging level 2017-09-21 14:30:09 +08:00
Dmitry Jemerov
9e3f866831 Update README, remove misleading information (#1306) 2017-09-20 18:56:44 +02:00
Dmitry Jemerov
c8d171b543 Don't show "Run tests" gutter icon when there's nothing to run
#KT-20338 Fixed
2017-09-20 18:49:25 +02:00
Ilya Gorbunov
7e0f38e07a Rename run configuration (IDEA insists on it) 2017-09-20 18:47:57 +03:00
Ilya Gorbunov
3708a96d91 Add KEEP issues reference pattern 2017-09-20 18:47:27 +03:00
Simon Ogorodnik
d9b6495f01 Remove obsolete libraries xml's 2017-09-20 18:04:54 +03:00
Simon Ogorodnik
25f0322791 Apply code style settings migration 2017-09-20 18:00:58 +03:00
Simon Ogorodnik
228927f948 Remove obsolete run configurations and artifacts 2017-09-20 18:00:10 +03:00
Ilya Gorbunov
d91cedc0e5 Root project idea module with folder exclusions 2017-09-20 15:51:45 +03:00
Ilya Chernikov
ce18c2bf26 Fix readme - only basic corrections 2017-09-20 14:30:04 +02:00
Ilya Chernikov
d9e0486061 Fix ultimate tests 2017-09-20 11:52:07 +02:00
Ilya Chernikov
0f199835a3 Fix idea-gradle tests 2017-09-20 11:52:07 +02:00
Ilya Gorbunov
83908388db Remove coverage section from run configurations (IDEA 172 insists on it) 2017-09-20 11:52:06 +02:00
Ilya Gorbunov
701f24ead5 Split apply block, so that gradle scripts are imported separately, one after other 2017-09-20 11:52:05 +02:00
Ilya Gorbunov
1c6b858153 Do not hardcode kotlin version into maven plugin smoke test 2017-09-20 11:52:04 +02:00
Ilya Gorbunov
c29e44f057 Correct setup for the mavenDeployer 2017-09-20 11:52:03 +02:00
Ilya Gorbunov
4a3c8286a3 Fix developer organization in pom, make artifact manifests same as in libraries 2017-09-20 11:52:03 +02:00
Ilya Gorbunov
d441f7ad9a Remove unused and duplicate gradle files 2017-09-20 11:52:02 +02:00
Ilya Gorbunov
678caa5676 Setup project versions
Build parameters (with corresponding project properties):
- build.number (buildNumber) - build number from build server, goes into manifest, by default snapshot
- deployVersion (kotlinVersion, project.version) - version of artifacts, by default build.number
- bootstrap.kotlin.version (bootstrapKotlinVersion) - version of bootstrap compiler
2017-09-20 11:52:01 +02:00
Ilya Chernikov
df04efcf14 Rename artifacts, fix dependencies and artifact contents 2017-09-20 11:52:00 +02:00
Ilya Chernikov
d61695be55 Fix embeddable compiler dependencies, fix dist task, use runtimeJar...
dependencies where appropriate, some helpers refactoring
2017-09-20 11:52:00 +02:00
Ilya Chernikov
b7226951b6 introduce ideaPlugin task as a replacement for idea-plugin...
leave idea-plugin as a reference to the new one for compatibility
2017-09-20 11:51:59 +02:00
Ilya Chernikov
372138977d Fix compiler archives config contents - fixes signing, add some utils 2017-09-20 11:51:58 +02:00
Ilya Chernikov
8d0694c129 Rename kotlin-plugin project to idea-plugin 2017-09-20 11:51:57 +02:00
Alexander Udalov
8f5dae8f57 Do not set KOTLIN_HOME env var for tests
Instead, rework the (already suspicious) KotlinPaths-finding code in
PathUtil to support the new model of running tests (the compiler is
split into several jars according to the project structure) instead of
the old one (where class files were not in the jars, but in the out/
directory).

This fixes Java9ModulesIntegrationTest
2017-09-20 11:51:56 +02:00
Ilya Chernikov
630d090103 Fix after rebasing on master 2017-09-20 11:51:56 +02:00
Ilya Chernikov
4073280b50 Comment out obsolete kannotator tests
(cherry picked from commit b318d97)
2017-09-20 11:51:55 +02:00
Ilya Chernikov
51efd717f6 Extract jvm6-specific test utils, add codegen on specific jdk tests 2017-09-20 11:51:54 +02:00
Ilya Chernikov
82690fe6b3 Switch to new bootstrap, fix after rebase 2017-09-20 11:51:53 +02:00
Ilya Chernikov
bb72da7d10 Add kapt3-idea to gradle build 2017-09-20 11:51:53 +02:00
Ilya Chernikov
5e108d8efd Fix stdlib test in compiler in the gradle environment 2017-09-20 11:51:52 +02:00
Ilya Chernikov
dfb0a47260 attempt to fix chained test failures
- commenting out potentially "bad" test
- calculating homedir only once
2017-09-20 11:51:51 +02:00
Ilya Chernikov
e92ef59873 Delete obsolete tests - we have no more iml files in the repo 2017-09-20 11:51:50 +02:00
Ilya Chernikov
c4de5ee6b7 Fix ScriptGen tests 2017-09-20 11:51:50 +02:00
Ilya Chernikov
bcf08c2246 Fix TestExecutedOnlyOnceTest 2017-09-20 11:51:49 +02:00
Ilya Chernikov
099bd2f564 Fix test ProtoBufCompareConsistencyTest.testAlreadyGenerated on ubuntu agents 2017-09-20 11:51:48 +02:00
Ilya Chernikov
fc540b2d63 Fix android tests 2017-09-20 11:51:47 +02:00
Ilya Chernikov
4eb4466314 Fix home dir definition in some compiler tests 2017-09-20 11:51:47 +02:00
Ilya Chernikov
51fc3da2f5 Implement compiler classpath config property in gradle...
instead of compiler jar
And add stdlib/reflect/script_runtime to the classpath on detection
2017-09-20 11:51:46 +02:00
Ilya Chernikov
776f1c8d19 Do not shade com.intellij in embeddable compiler 2017-09-20 11:51:45 +02:00
Ilya Chernikov
1862c78bdc Fix projects for gradle integration tests 2017-09-20 11:51:44 +02:00
Ilya Gorbunov
8ec5cc7d16 Rename composite tasks to use camelCase convention 2017-09-20 11:51:44 +02:00
Ilya Gorbunov
6fc3f269a6 Change logical path of kotlin-test-js-it project, fix paths to outputs
Fix paths to kotlin-test-js and kotlin-test-js-it outputs
2017-09-20 11:51:43 +02:00
Ilya Gorbunov
cf5dcb7b5c Advance bootstrap version 2017-09-20 11:51:42 +02:00
Ilya Gorbunov
99f2cc3d00 Fix paths to stdlib-jre6 test output 2017-09-20 11:51:41 +02:00
Ilya Gorbunov
e3899ff7ee Serialize builtins *before* compiling builtins in stdlib 2017-09-20 11:51:41 +02:00
Ilya Gorbunov
47eedd1941 Add missing dependencies for commit dcd966f7 2017-09-20 11:51:40 +02:00
Ilya Gorbunov
479a8b7578 Add property for plugin artifact dir to zip artifacts from KotlinUltimate
Do not delete artifact dir after packing as we may need them later for tests
2017-09-20 11:51:39 +02:00
Ilya Chernikov
d92cce6e6a Fix build after rebase on master 2017-09-20 11:51:38 +02:00
Ilya Chernikov
46884bec84 Add missing artifact, fix some deps and publishing 2017-09-20 11:51:38 +02:00
Ilya Chernikov
a8c45819a1 Fix sources/javadoc artifactsi in gradle tools, separating android extensions runtime 2017-09-20 11:51:37 +02:00
Ilya Gorbunov
403f2c6f99 Fix dependencies of kotlin-compiler(+embeddable), remove them from kotlin-maven-plugin 2017-09-20 11:51:36 +02:00
Ilya Gorbunov
ec2e7bb43c Fix manifest classpath in kotlin-compiler 2017-09-20 11:51:35 +02:00
Ilya Gorbunov
6e75d44bc3 Declare shared shadow plugin version and use it consistently 2017-09-20 11:51:35 +02:00
Ilya Gorbunov
6d97866a3a Fix module name to avoid changes in binary classes 2017-09-20 11:51:34 +02:00
Ilya Chernikov
0e306ac889 Fix install task config 2017-09-20 11:51:33 +02:00
Ilya Chernikov
fc3dda47c0 Update compiler artifact according to the changes in master 2017-09-20 11:51:32 +02:00
Ilya Chernikov
02ec70e9f1 Fix kotlin-daemon-client project config and publications, fix problem with uploadArchives task 2017-09-20 11:51:32 +02:00
Simon Ogorodnik
5dfcac18b7 Add no process canceled exception configurations 2017-09-20 11:51:31 +02:00
Simon Ogorodnik
bcd31de84a Implement ultimate-runner 2017-09-20 11:51:30 +02:00
Ilya Chernikov
cf7312dea8 Add gradle plugin markers 2017-09-20 11:51:29 +02:00
Ilya Chernikov
9df5d53a9d Add classes dirs artifact helpers, minor cleanup 2017-09-20 11:51:29 +02:00
Ilya Chernikov
4b3936b598 Revert to default build dirs, add missing projects 2017-09-20 11:51:28 +02:00
Simon Ogorodnik
3262ac0129 Fix compileJava not found when running idea:test 2017-09-20 11:51:27 +02:00
Simon Ogorodnik
129dc42a25 Fix JPS classpath 2017-09-20 11:51:26 +02:00
Ilya Chernikov
a63d1a53c3 Reduce memory requirements for gradle and js backend tests 2017-09-20 11:51:25 +02:00
Ilya Chernikov
c428f12d71 Add Idea Ultimate plugin build 2017-09-20 11:51:25 +02:00
Ilya Chernikov
8c44b62d16 Fix recursive task dependency helpers 2017-09-20 11:51:24 +02:00
Ilya Chernikov
95035b3d72 Fix various tests 2017-09-20 11:51:23 +02:00
Simon Ogorodnik
98413f200f Disable test optimization on patterns with wildcards 2017-09-20 11:51:22 +02:00
Simon Ogorodnik
34ac3a818a Optimize run tests 2017-09-20 11:51:21 +02:00
Ilya Chernikov
3aabeca191 Fix maven and android tests after modularizing and rebasing 2017-09-20 11:51:21 +02:00
Ilya Chernikov
3a55ed31a6 Rearrange and add aggregate tests tasks 2017-09-19 23:58:42 +02:00
Simon Ogorodnik
360a692af8 Apply rri/yole/modularize, create gradle run configuration for IDEA 2017-09-19 23:58:41 +02:00
Ilya Chernikov
7cb8a90513 Strip maven build from moved parts 2017-09-19 23:58:40 +02:00
Ilya Chernikov
f7b9ae2556 Add missing dist jars 2017-09-19 23:58:39 +02:00
Ilya Chernikov
aa34c7d32a Fix tests after projects rearrangement 2017-09-19 23:58:39 +02:00
Ilya Chernikov
0676ebd530 Fix after rebase on master 2017-09-19 23:58:38 +02:00
Ilya Chernikov
b4c9422376 Rearrange and rename idea-plugin related and annotation-processing modules 2017-09-19 23:58:37 +02:00
Simon Ogorodnik
e23c26b5d1 Fix j2k tests failing if started after web demo tests 2017-09-19 23:58:36 +02:00
Ilya Chernikov
e7ac8443ee Implement proper artifacts signing, add missing install and publish tasks 2017-09-19 23:58:35 +02:00
Ilya Chernikov
08e2ee0951 Restore legacy kotlin-runtime maven artifact 2017-09-19 23:58:34 +02:00
Ilya Chernikov
19e0cfeb9e Add annotation processing into dist, publish & tests 2017-09-19 23:58:33 +02:00
Ilya Chernikov
c0572aeb34 Refactor mock-runtime build to avoid source roots conflicts 2017-09-19 23:58:33 +02:00
Ilya Chernikov
fd1b677904 Switch reflect to compiled core classes 2017-09-19 23:58:32 +02:00
Ilya Chernikov
d89b53dfea Reorganize builtins built and use in the projects 2017-09-19 23:58:31 +02:00
Ilya Chernikov
d039d191f2 Fix tests in the new build infrastructure 2017-09-19 23:58:30 +02:00
Ilya Chernikov
a61facf3d1 Clean most of the shared source roots conflicts 2017-09-19 23:58:29 +02:00
Ilya Chernikov
e26b421e6c Add JDK detection 2017-09-19 23:58:29 +02:00
Ilya Chernikov
0c085cd0a2 Remove gradle files from obsolete gradle build parts 2017-09-19 23:58:28 +02:00
Alexander Podkhalyuzin
3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov
3e46c59187 Clean unused dependencies, minor refactorings 2017-09-19 21:37:27 +02:00
Ilya Chernikov
27968c8e13 Set proper jvmTarget for projects 2017-09-19 21:37:27 +02:00
Ilya Chernikov
deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov
336e24b837 Fix project structure after rebase on master 2017-09-19 21:37:25 +02:00
Ilya Chernikov
d0b8767536 Enable gradle build-scan 2017-09-19 21:37:24 +02:00
Ilya Chernikov
46c10157d3 Add aggregate tests tasks 2017-09-19 21:37:23 +02:00
Ilya Chernikov
b6c255cea5 Refactor: project renaming, using improved build dsl 2017-09-19 21:37:22 +02:00
Ilya Chernikov
8e24383428 Improve build DSL 2017-09-19 21:37:22 +02:00
Ilya Chernikov
a87396b070 Add scripting projects from libraries 2017-09-19 21:37:21 +02:00
Ilya Chernikov
87726b38b6 Add generated project-schema extensions, example refactoring 2017-09-19 21:37:20 +02:00
Ilya Chernikov
24c192135f Control plugin version and repo from properties 2017-09-19 21:37:19 +02:00
Ilya Chernikov
96d5e0bb21 Refactoring - renaming projects, applying sourceSets DSL 2017-09-19 21:37:18 +02:00
Ilya Chernikov
a6aaee3fe0 Add system property/environment var for -kotlin-home compiler option 2017-09-19 21:37:17 +02:00
Ilya Chernikov
fac2c16999 Fix generators tests compilation 2017-09-19 21:37:16 +02:00
Ilya Chernikov
513ab08edd Refactor and clean preloader project 2017-09-19 21:37:16 +02:00
Ilya Chernikov
1d56730538 Separate j2k and eval4j tests from idea tests 2017-09-19 21:37:15 +02:00
Ilya Chernikov
e18b77af21 Refactor compiler-related published projects
- move preparation into separate projects
- rename projects for publishing
- add compiler plugins
2017-09-19 21:37:14 +02:00
Ilya Chernikov
aa4fdaa713 Implement publishing in the build 2017-09-19 21:37:13 +02:00
Ilya Chernikov
438525dfff Proper import of the gradle part:
- using non-shadowed libs
- stop preshgadowing plugins
- switch to project dependencies
- add annotation processing module
2017-09-19 21:37:12 +02:00
Ilya Chernikov
3caa426b76 Switching library projects to java 8 compilation with exceptions for stdlib/runtime/reflect/test 2017-09-19 21:37:11 +02:00
Ilya Chernikov
fca9478fd8 Tweak dependencies loading and other minor infrastructure changes 2017-09-19 21:37:10 +02:00
Ilya Chernikov
06532cefa2 Fix teamcity build 2017-09-19 21:37:09 +02:00
Ilya Chernikov
628927782a Fix tests in the gradle environment 2017-09-19 21:37:09 +02:00
Ilya Chernikov
f053ed968f Change core env and proguard config for compatibility with new gradle build
(the build.xml should be modified to support the proguard config in this form)
2017-09-19 21:37:08 +02:00
Ilya Chernikov
6b22282ad4 Change previous gradle build for compatibility with the centralized build
incompatible with the main build yet
2017-09-19 21:37:07 +02:00
Ilya Chernikov
61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Ilya Chernikov
f5d6e41993 Update gradle wrapper 2017-09-19 21:37:05 +02:00
Ilya Gorbunov
095aacecac Minor, test: align assertion with the expectation message 2017-09-19 17:57:18 +03:00
Mikhail Glukhikh
38ddc731ea Do not check 'isArrayOfMethod' using BuiltInsPackageFragment
So #KT-18631 Fixed
2017-09-19 17:14:22 +03:00
Mikhail Glukhikh
bf739198aa Fix regular quick-fix test with multi-platforms required 2017-09-19 17:13:58 +03:00
Mikhail Glukhikh
ef6a00f477 Fix completion tests 2017-09-19 17:13:37 +03:00
Valentin Kipyatkov
454c5229f9 Ability to disable caches reset on ProcessCanceledException via internal action 2017-09-19 16:52:20 +03:00
Sergey Igushkin
41b13d25f2 Fix javaOutputDir changed to the JAR, which was breaking unit tests
internal visibility, because they did not get the JAR into classpath

Issue #KT-20212 Fixed

(cherry picked from commit 19e861b)
2017-09-19 15:33:58 +03:00
Sergey Igushkin
5ce514bd42 Changes to configuration of Kotlin source set
* Include the Java source directory set as-is, without iterating over
its srcDirs
* Avoid Java sources duplication with newer Gradle versions.

Issue #KT-16764 Fixed
Issue #KT-17564 Fixed
2017-09-19 15:33:58 +03:00
Alexey Andreev
c5e5a43f68 JS: fix unit materialization in case of null check and elvis operator
See KT-20287
2017-09-19 15:30:55 +03:00
Alexey Andreev
b4c622d433 JS: optimize destructuring declaration when possible
See KT-8285
2017-09-19 15:30:26 +03:00
Alexey Andreev
a2bfaf4fc8 Fix multiplatform test (use expect/actual instead of header/impl) 2017-09-19 15:21:30 +03:00
Nikolay Krasko
1b447a0231 Execute action without writeActionPriority in tests 2017-09-19 11:27:23 +03:00
Dmitry Jemerov
c05c359703 Correctly detect multiplatform modules in run code
LanguageVersionSettings doesn't mean that the module is actually
multiplatform; it only means that it _could_ be one. Use
platform and information from facet instead.

Also fix detection of common stdlib version and add tests for common
run config.
2017-09-18 19:23:22 +02:00
Dmitry Jemerov
dd34c67849 Add missing dependencies 2017-09-18 19:23:22 +02:00
Alexey Sedunov
04a4bef615 Misc: Fix multiplatform test configuration 2017-09-18 19:43:41 +03:00
Vyacheslav Gerasimov
43ee2bd9c4 Add new Gradle with Kotlin DSL project wizard for Kotlin, KotlinJS, Java, Groovy
#KT-20308 Fixed Target Version 1.2
2017-09-18 17:15:54 +03:00
Vyacheslav Gerasimov
3d71fa85be Copy initial new gradle project wizard files from idea gradle plugin 2017-09-18 17:15:50 +03:00
Stanislav Erokhin
e8d42e4dde Increase stub version because we add new soft-keywords: expect and actual 2017-09-18 16:37:36 +03:00
Alexey Sedunov
7c26f87b0c Misc: Fix multiplatform test configuration 2017-09-18 16:30:28 +03:00
Mikhail Glukhikh
9b0f15137f Expect/actual: introduce DEPRECATED_MODIFIER instead of ..._FOR_TARGET 2017-09-18 16:19:41 +03:00
Mikhail Glukhikh
721889600f Expect/actual: fix some error messages 2017-09-18 16:09:18 +03:00
Nikolay Krasko
98e9238763 Force canceling injection search when it's executed without progress (KT-19901)
More accurate fix for KT-19901.
There're cases when injectors are counted without progress indicator but
under read action. In that cases typing can't be started until exit from
the computing that produces lags in typing.

Tested with long spek-like test file.

 #KT-19901 Fixed
2017-09-18 14:56:46 +03:00
Alexey Sedunov
bd3d79d318 Minor: Do not specify platform for project-level language settings 2017-09-18 14:55:16 +03:00
Mikhail Glukhikh
79308287be Minor: rename directory in quick-fix test data 2017-09-18 14:40:14 +03:00
Denis Grachev
0722c5c13a KT-19565: J2K: Determine mutability using iterator
#KT-19565 fixed
2017-09-18 14:07:57 +03:00
Alexey Andreev
d312996f3a JS: generate import statement for COROUTINE_SUSPENDED property
This makes code with lots of corutines more feasible for uglification
2017-09-18 13:13:40 +03:00
Alexey Andreev
9771a3c66e JS: prove that KT-8282 is no more reproducible 2017-09-18 13:13:00 +03:00
Alexey Andreev
aa35d4ed36 JS: prove that KT-8315 is no more reproducible 2017-09-18 13:13:00 +03:00
Alexey Andreev
6ba0ac1238 JS: prove that KT-7011 is no more reproducible 2017-09-18 13:12:59 +03:00
Alexey Andreev
a66cd8b309 Fix name clash in JS implementation of multiplatform extension property
See KT-18756
2017-09-18 13:10:51 +03:00
Toshiaki Kameyama
1c7d66c803 Do not suggest "Redundant Unit return type" for Nothing-typed expression
So #KT-20261 Fixed
2017-09-18 13:02:03 +03:00
Toshiaki Kameyama
d87c0b164f Add quick-fix for CANNOT_CHECK_FOR_ERASED #KT-18742 Fixed 2017-09-18 12:11:15 +03:00
Mikhail Zarechenskiy
6a1b6d10d8 Setup JDK roots and initialize JDK_HOME in common core environment
#KT-20167 Fixed
2017-09-18 08:19:41 +03:00
Stanislav Erokhin
6d26d1fb67 Minor. rename header -> commonModule 2017-09-16 19:47:47 +03:00
Stanislav Erokhin
91a99b4726 Migrate impl to actual in libraries projects 2017-09-16 19:47:46 +03:00
Stanislav Erokhin
481cbd0850 Migrate header to expect in libraries projects 2017-09-16 19:47:45 +03:00
Stanislav Erokhin
7cd5eeb24d Regenerate common stdlib: use 'expect' instead 'header' 2017-09-16 19:47:44 +03:00
Mikhail Glukhikh
e12de11ce9 Fix add modifier for replacement case, add expect/actual order tests 2017-09-16 19:47:43 +03:00
Mikhail Glukhikh
2c521727c3 Add header/impl/expect/actual into modifiers order list 2017-09-16 19:47:42 +03:00
Mikhail Glukhikh
c0dd97b40d Migration to expect/actual: fix CLI tests 2017-09-16 19:47:41 +03:00
Mikhail Glukhikh
a18e9436a1 Migration to expect/actual: change diagnostics rendering 2017-09-16 19:47:40 +03:00
Stanislav Erokhin
7982f3489e Rename compiler key -Xno-check-impl to -Xno-check-actual 2017-09-16 19:47:39 +03:00
Mikhail Glukhikh
2fe7cc5534 Add more tests for KT-20262 2017-09-16 19:47:38 +03:00
Mikhail Glukhikh
77f625bfc8 Include ReplaceModifierFix in cleanup #KT-20262 Fixed 2017-09-16 19:47:37 +03:00
Stanislav Erokhin
7849452b66 Rename ALLOW_HEADER_WITHOUT_IMPLS to ALLOW_EXPECT_WITHOUT_ACTUAL 2017-09-16 19:47:36 +03:00
Vyacheslav Gerasimov
bba2d27e82 UAST: Fix getType and getText for UastKotlinPsiVariable 2017-09-16 13:21:44 +03:00
Vyacheslav Gerasimov
14742a6048 UAST: Fix getContainingFile, should return KtFile instead of FakeFileForLightClass
#KT-20170 Fixed
2017-09-16 13:02:08 +03:00
Vyacheslav Gerasimov
6d7c88a2bc Fix KotlinWithGradleConfigurator, get psi files under read action
EA-106672 Fixed
2017-09-16 13:02:07 +03:00
Alexander Udalov
37a23f0958 Use JVM package name in Java 9 module accessibility checks
This fixes Java9ModuleIntegrationTest.testDependencyOnStdlibJdk78 from
the 1.2 branch
2017-09-15 20:30:29 +03:00
Mikhail Glukhikh
d3082b0e62 Migration to expect/actual: change some comments in compiler 2017-09-15 18:30:32 +03:00
Mikhail Glukhikh
fcc84d00c3 Migration: make header/impl/expect/actual contradictory to each other 2017-09-15 18:30:25 +03:00
Mikhail Glukhikh
fc4ff3b760 Migration to expect/actual: renames in DeclarationResolver 2017-09-15 18:30:18 +03:00
Mikhail Glukhikh
afdd647df1 Migration to expect/actual: renames in DeclarationsChecker 2017-09-15 18:30:11 +03:00
Mikhail Glukhikh
c5c6050baa Migration to expect/actual: renames in ExpectedActualDeclarationChecker 2017-09-15 18:30:04 +03:00
Stanislav Erokhin
88644001d3 Rename heared/impl around highlighter markers 2017-09-15 18:29:57 +03:00
Stanislav Erokhin
8d8f683042 Fix header/impl in LazyClassDescriptor.toString 2017-09-15 18:29:50 +03:00
Stanislav Erokhin
956b0aca92 Rename header/impl in DescriptorRendererModifier 2017-09-15 18:29:43 +03:00
Stanislav Erokhin
194d16176c Rename protobuf header/impl flags 2017-09-15 18:29:36 +03:00
Stanislav Erokhin
2b186909d4 Migrate diagnostic names for header/impl 2017-09-15 18:29:29 +03:00
Mikhail Glukhikh
d20ba5d082 Migration to expect/actual minor: rename icon constants 2017-09-15 18:29:21 +03:00
Mikhail Glukhikh
19b8ecab61 Migration to expect/actual: KotlinSafeDeleteProcessor 2017-09-15 18:29:13 +03:00
Mikhail Glukhikh
6e41bbc2a7 Migration: header->expect & impl->actual in IDEA test data 2017-09-15 18:29:06 +03:00
Mikhail Glukhikh
32cc619f15 Migration to expect/actual: fix multiplatform highlighting tests 2017-09-15 18:28:57 +03:00
Mikhail Glukhikh
85d6a4d1af Migration to expect/actual: fix multiplatform integration tests 2017-09-15 18:28:50 +03:00
Mikhail Glukhikh
27615209ed Migration to expect/actual: remove header/impl from completion, tests 2017-09-15 18:28:43 +03:00
Mikhail Glukhikh
6766196bd8 Migration to expect/actual: correct multi-module QF tests 2017-09-15 18:28:36 +03:00
Mikhail Glukhikh
bc78d672c1 Migration: add quick-fix to replace header->expect & impl->actual 2017-09-15 18:28:28 +03:00
Mikhail Glukhikh
e896a1f5ea Migration: add check for illegal expect on nested in non-expect class 2017-09-15 18:28:21 +03:00
Mikhail Glukhikh
5d25106267 Migration: deprecation tests for header/impl 2017-09-15 18:28:14 +03:00
Mikhail Glukhikh
dd8bed8b46 Migration: expect/actual in diagnostic tests 2017-09-15 18:28:07 +03:00
Mikhail Glukhikh
1a2dc4c96c Migration: expect/actual in descriptor renderer 2017-09-15 18:28:00 +03:00
Mikhail Glukhikh
205272f51b Migration: add expect/actual to hasExpected... / hasActualModifier 2017-09-15 18:27:53 +03:00
Mikhail Glukhikh
0640d5618c Migration: make modifiers HEADER & IMPL deprecated 2017-09-15 18:27:47 +03:00
Mikhail Glukhikh
6650340716 Migration: expect/actual in OverrideMemberChooserObject 2017-09-15 18:27:40 +03:00
Mikhail Glukhikh
b909704bb9 Migration: expect/actual in KotlinSafeDeleteProcessor 2017-09-15 18:27:33 +03:00
Mikhail Glukhikh
31f4f2d0c9 Migration: add actual instead of impl on IMPL_MISSING 2017-09-15 18:27:26 +03:00
Mikhail Glukhikh
89c8ee8614 Migration: hasImpl -> hasExpectedModifier (OverrideMemberChooserObject) 2017-09-15 18:27:19 +03:00
Mikhail Glukhikh
280a60af6f Migration to expect/actual: some intentions 2017-09-15 18:27:12 +03:00
Mikhail Glukhikh
62ec4b5a31 Migration to expect/actual: KeywordCompletion 2017-09-15 18:27:05 +03:00
Mikhail Glukhikh
9f02a8b2a8 Migration: PlatformHeaderAnnotator -> PlatformExpectedAnnotator 2017-09-15 18:26:59 +03:00
Mikhail Glukhikh
74f81f38ba Migration to expect/actual: highlighter markers 2017-09-15 18:26:46 +03:00
Mikhail Glukhikh
2d0ac0011a Migration to expect/actual: ExpectedActualDeclarationChecker 2017-09-15 18:26:23 +03:00
Mikhail Glukhikh
c4fd1a8e5c Migration to expect/actual: ModifierCheckerCore 2017-09-15 18:26:16 +03:00
Mikhail Glukhikh
fba1a2a2db Migration to actual/expect: quick-fix CreateActualFix with tests 2017-09-15 18:26:09 +03:00
Mikhail Glukhikh
810d62bbaf Add expect & actual to MODIFIERS_TO_REPLACE table 2017-09-15 18:26:02 +03:00
Mikhail Glukhikh
eb648e20c6 Add expect & actual modifiers 2017-09-15 18:25:56 +03:00
Stanislav Erokhin
e86d2f00ff Rename isImpl to isActual in descriptors 2017-09-15 18:25:49 +03:00
Stanislav Erokhin
c8ee424f67 Rename isHeader to isExpect in descriptors 2017-09-15 18:25:41 +03:00
Stanislav Erokhin
fd6eab38e5 Regenerate comments in protobuf files for isHeader -> isExpect 2017-09-15 18:25:34 +03:00
Stanislav Erokhin
4dc47c734c Rename has[Header|Impl]Modifier() to has[Expect|Actual]Modifier() 2017-09-15 18:25:27 +03:00
Stanislav Erokhin
0bf7dc3e0c Refactoring. Replace hasModifier(IMPL_KEYWORD) to hasImplModifier() 2017-09-15 18:25:20 +03:00
Stanislav Erokhin
1ebfe1af43 Refactoring. Replace hasModifier(HEADER_KEYWORD) to hasHeaderModifier() 2017-09-15 18:25:13 +03:00
Yan Zhulanow
79b2b40289 Allow access to effectively invisible declarations in evaluator (KT-18775) 2017-09-15 17:54:46 +03:00
Yan Zhulanow
5641909d1d Parcel: Invoke box tests as an external process to prevent class clashes with IntelliJ platform 2017-09-15 17:54:46 +03:00
Mikhail Zarechenskiy
11b6382518 Revert "Setup JDK roots and initialize JDK_HOME in common core environment"
This reverts commit 05dd4714045494dcc648412t 2ea2179a242991639.
2017-09-15 16:47:42 +03:00
Mikhail Zarechenskiy
05dd471404 Setup JDK roots and initialize JDK_HOME in common core environment
#KT-20167 Fixed
2017-09-15 16:34:12 +03:00
Anton Bannykh
373bd5ff17 JS: throw exception on access to an uninitialized local variable (KT-20248 fixed) 2017-09-15 14:46:26 +03:00
Nikolay Krasko
aa442860c2 Run inline usages search in debugger under progress indicator (KT-19974)
#KT-19974 Fixed
2017-09-15 12:27:41 +03:00
Mikhail Zarechenskiy
bbf4c56c06 Update generated tests 2017-09-15 11:47:16 +03:00
Mikhail Glukhikh
faaddacec6 Fix "unexpected error type" exception in constructor conversion
So #KT-20218 Fixed
2017-09-15 11:17:21 +03:00
Mikhail Glukhikh
13fc526695 Fix "unexpected error type" exception in initializer -> getter
So #KT-19674 Fixed
2017-09-15 11:16:51 +03:00
Mikhail Glukhikh
a9ece23e63 Remove BodyResolveMode.FULL from OverrideImplementMembersHandler 2017-09-15 11:15:44 +03:00
Mikhail Zarechenskiy
a63495aa0b Use language version settings of definitely known module 2017-09-15 08:16:25 +03:00
Yan Zhulanow
26af128694 Parcelable: produce error on "CREATOR" companion object 2017-09-14 19:36:48 +03:00
Yan Zhulanow
d9f99971bb Disable old Parcelable quickfixes if @Parcelize annotation is present 2017-09-14 19:36:47 +03:00
Yan Zhulanow
e6171dc4c5 Parcelable: Add quick fixes 2017-09-14 19:36:24 +03:00
Yan Zhulanow
8eeed17b65 Add android-extensions-runtime.jar to CLI libs 2017-09-14 19:29:11 +03:00
Yan Zhulanow
9984b6f9d1 Minor: Refactoring 2017-09-14 19:29:10 +03:00
Yan Zhulanow
2fb2211a4d Kapt: Prevent kaptGenerateStubsTask from being UP-TO-DATE when there is no incremental data generated for some reason 2017-09-14 19:16:55 +03:00
Yan Zhulanow
83bf257666 Kapt: Attach kapt stub location when reporting annotation processor errors 2017-09-14 19:16:55 +03:00
Yan Zhulanow
4ac8a98050 Kapt: Hide fake "Error while annotation processing" error in Android Studio build console 2017-09-14 19:16:54 +03:00
Yan Zhulanow
69051a4764 Simplify KotlinOutputParser, remove old reflection-based logic that didn't work well with the newer versions of Android Studio 2017-09-14 19:16:53 +03:00
Anton Bannykh
74bda80ec2 JS: added forgotten JsLegacyPrimitiveArraysBoxTestGenerated.java 2017-09-14 18:55:12 +03:00
Yan Zhulanow
8e72a1211b Kapt: Add IDEA integration (KT-19097, KT-17923, KT-19823) 2017-09-14 18:40:55 +03:00
Mikhail Zarechenskiy
b574ddfba0 Deprecate syntax for assigning single named arguments to varargs
See more in KT-20171
2017-09-14 18:27:43 +03:00
Mikhail Zarechenskiy
68259f7939 Allow assigning array to vararg in named form in annotations
See more in KT-20171
2017-09-14 18:27:41 +03:00
Mikhail Zarechenskiy
f905d56b38 Don't try to get KtFile on random element as it can throw exception
For example, this can be for copied elements (DummyHolder)
2017-09-14 18:27:40 +03:00
Mikhail Zarechenskiy
b1d9abdf83 Propagate languageVersionSettings to resolution context 2017-09-14 18:27:34 +03:00
Denis Zharkov
6336ad874b Get rid of ParametersAreNonnullByDefault copy in test data 2017-09-14 18:05:32 +03:00
Denis Zharkov
24b1f2ed1f Minor. Update CliTestGenerated.Jvm::testExtraHelp test data 2017-09-14 18:05:32 +03:00
Denis Zharkov
4d95c30360 Restore -Xjsr305-annotations flag as a deprecated 2017-09-14 18:05:32 +03:00
Denis Zharkov
97fed6336b Add cli tests on different options of -Xjsr305 flag 2017-09-14 18:05:32 +03:00
Denis Zharkov
363d345752 Make default value for -Xjsr305 flag to be WARN 2017-09-14 18:05:32 +03:00
Denis Zharkov
2ca220d442 Ignore built-in type qualifier defaults when Jsr305State=IGNORE 2017-09-14 18:05:32 +03:00
Denis Zharkov
b744ed0fd3 Minor. Remove unused properties 2017-09-14 18:05:32 +03:00
Denis Zharkov
943dd96a87 Fix Jsr305State::STRICT description 2017-09-14 18:05:32 +03:00
Alexander Udalov
d32e101802 Support deprecatedName for advanced CLI arguments 2017-09-14 18:05:32 +03:00
Mikhail Glukhikh
92215b41b9 Replace resolveToDescriptor with unsafeResolveToDescriptor
Now unsafeResolveToDescriptor is equivalent to resolveToDescriptorIfAny
but throws exception in case no descriptor is found.
Old version of resolveToDescriptor is kept intact but made deprecated.
Some clarifying comments were added
2017-09-14 17:20:37 +03:00
Toshiaki Kameyama
cd6201c5df Java class with static-only methods can contain 'protected' members (#1257)
#KT-19651 Fixed
2017-09-14 15:47:10 +03:00
Mikhail Glukhikh
0f9d31c9d1 Patch resolveToDescriptorIfAny() for parameter case
Now property descriptor is returned for primary constructor val / var,
otherwise parameter descriptor is returned.
2017-09-14 15:08:06 +03:00
Mikhail Glukhikh
04b8f1db6e Minor: convert to expression body applied (resolutionApi) 2017-09-14 15:08:05 +03:00
Mikhail Glukhikh
71c2489ade Use safe resolveToDescriptorIfAny() when possible (related to EA-105681) 2017-09-14 15:08:04 +03:00
Nikolay Krasko
94e3a51a45 Test no psi stub mismatch for light classes with suspend in overloads
IdeCompiledLightClassTestGenerated is relevant.
2017-09-14 12:28:26 +03:00
Nikolay Krasko
74043089ab Generate modifier list stub under nullable type for suspend functions (KT-20185)
Otherwise there's a PSI and Stub mismatch error produced.

 #KT-20185 Fixed
2017-09-14 12:28:26 +03:00
Nikolay Krasko
b9872b7651 Render annotations in suspend functions in single modifier list (KT-20185)
#KT-20185 Fixed
2017-09-14 12:28:26 +03:00
Dmitry Petrov
d20af1133a Use captured instance in interface companion object initializer
Similar to enum entry initialization, when we have a companion object
in an interface, its constructor (or clinit) initializes its state
before the instance field in corresponding interface is initialized.
So, interface companion object must be accessed via a captured object
reference (#0, or #0.this$0 for inner anonymous objects).
2017-09-14 10:26:35 +03:00
Dmitry Petrov
179e720e4a Provide fallback flag for KT-19174
-Xno-exception-on-explicit-equals-for-boxed-null

Also unify corresponding names.
2017-09-14 10:15:28 +03:00
Dmitry Petrov
773eff1de8 Update IEEE 754 'equals' tests for LV 1.2
NB IEEE 754 doesn't say anything about nulls.
2017-09-14 10:15:01 +03:00
Dmitry Petrov
a3c4850f0d Fail with NPE on explicit 'equals' call for null platform type value 2017-09-14 10:15:01 +03:00
Dmitry Petrov
4c2cfd3ea9 Synthesized 'copy' in data classes cannot override anything since 1.3
Synthesized 'copy' introduces default values for parameters, which is
prohibited for regular overrides.
Report warning in language version 1.2-, error in 1.3+.
2017-09-14 10:13:22 +03:00
Alexander Udalov
9ae6feb2c5 Temporarily remove JvmPackageName and tests, but keep the implementation
This is needed because we want the compiler code to stay as much the
same in master and in 1.2 as possible
2017-09-13 23:23:36 +03:00
Alexander Udalov
e8e38d90ff Validate JvmPackageName annotation value and placement
- do not allow it to be used together with JvmMultifileClass (otherwise
  implementation becomes complex)
- do not allow to declare classes in a JvmPackageName-annotated file
  (similarly, the implementation of this would be much harder in the
  compiler, and there would need to be special support in the IDE)
- check that the value is a valid FQ name
- do not allow root package just in case
2017-09-13 22:59:03 +03:00
Alexander Udalov
2bb437b219 Do not load JvmPackageName-annotated parts on Kotlin < 1.2 2017-09-13 22:59:03 +03:00
Alexander Udalov
70ae1596fb Support JvmPackageName annotation in binary format
The main changes are in jvm_package_table.proto and ModuleMapping.kt.
With JvmPackageName, package parts can now have a JVM package name that
differs from their Kotlin name. So, in addition to the old package parts
which were stored as short names + short name of multifile facade (we
can't change this because of compatibility with old compilers), we now
store separately those package parts, which have a different JVM package
name. The format is optimized to avoid storing any package name more
than once as a string.

Another notable change is in KotlinCliJavaFileManagerImpl, where we now
load .kotlin_module files when determining whether or not a package
exists. Before this change, no PsiPackage (and thus, no JavaPackage and
eventually, no LazyJavaPackageFragment) was created unless there was at
least one file in the corresponding directory. Now we also create
packages if they are "mapped" to other JVM packages, i.e. if all package
parts in them have been annotated with JvmPackageName.

Most of the other changes are refactorings to allow internal names of
package parts/multifile classes where previously there were only short
names.
2017-09-13 22:59:03 +03:00
Alexander Udalov
d07b628e0c Support JvmPackageName annotation in JVM back-end
This annotation is currently internal because we only commit to its
support for our own libraries. It will be used to change JVM package
names of declarations in JDK-specific stdlib additions (now called
kotlin-stdlib-jre7/8), both to preserve source compatibility of the old
Kotlin code and to solve the split package problem (KT-19258)
2017-09-13 22:59:03 +03:00
Alexander Udalov
234148518e Temporarily remove isInitialized and tests, but keep the implementation
This is needed because we want the compiler code to stay as much the
same in master and in 1.2 as possible
2017-09-13 22:51:23 +03:00
Alexander Udalov
7d80afbe63 Avoid getting invisible_fake visibility for properties in ExpressionCodegen
Before this change, we were computing the visibility of an inherited
private property setter, and ISE at AsmUtil.getVisibilityAccessFlag
happened ("invisible_fake is not a valid visibility in backend")
2017-09-13 22:49:26 +03:00
Alexander Udalov
c6263ac8e6 Support isInitialized intrinsic for lateinit properties
See https://github.com/Kotlin/KEEP/pull/73

 #KT-9327 Fixed
2017-09-13 22:49:26 +03:00
Ilya Gorbunov
08052e63e9 Test to ensure fixed typed char array content[Deep]ToString, relates to #KT-16056 2017-09-13 20:53:17 +03:00
Anton Bannykh
2249675e59 JS: throw exception when accessing uninitialized lateinit property (KT-14964) 2017-09-13 20:16:01 +03:00
Anton Bannykh
49bc9249a1 JS: add support for the ::foo syntax (callable reference with empty LHS) 2017-09-13 20:12:48 +03:00
Anton Bannykh
497251a6d7 Revert "JS: use Mocha + NodeJs instead of Karma + PhantomJs to run stdlib tests" so that it wouldn't clash with Gradle Build transition
This reverts commit 11c83ad
2017-09-13 20:11:11 +03:00
Anton Bannykh
11c83ad0fc JS: use Mocha + NodeJs instead of Karma + PhantomJs to run stdlib tests 2017-09-13 19:43:53 +03:00
Anton Bannykh
22dc36a596 JS: enable translation of primitive arrays to TypedArray's by default (KT-17137) 2017-09-13 18:45:19 +03:00
Dmitry Jemerov
cc8fbf6078 Store third-party annotations in a separate directory 2017-09-13 17:25:20 +02:00
Alexander Udalov
296638a7c4 Minor, fix test after 60c735f2fd 2017-09-13 18:13:39 +03:00
Nikolay Krasko
cad6fdb323 Reenable workaround for JVMTI_ERROR_WRONG_PHASE in debugger tests
It was fixed in custom intellij jdk and disabled in DescriptorTestCase.
2017-09-13 16:29:51 +03:00
Nikolay Krasko
75fa982370 Minor: split long line in KotlinDebuggerSettings.kt 2017-09-13 16:29:51 +03:00
Alexander Udalov
1b45e9d517 Minor, fix before vs after in some tests 2017-09-13 15:46:37 +03:00
Alexander Udalov
b01a3eb747 Drop JvmFileClassesProvider and inline implementations
Both of its implementations called the same static function; inline
those and move related utilities to JvmFileClassUtil
2017-09-13 15:46:36 +03:00
Alexander Udalov
16c5fb6f6b Refactor and simplify JvmFileClassUtil 2017-09-13 15:46:35 +03:00
Denis Zharkov
28d785854c Optimize codegen for generic SAM types
Search abstract members in unsubstituted scope to avoid computation
of substituted descriptors for each type (effectively for each SAM call)

 #KT-20055 In progress
2017-09-13 15:34:14 +03:00
Denis Zharkov
97fd72a1e0 Minor. Drop unused function in resolution 2017-09-13 15:34:14 +03:00
Denis Zharkov
b905ddeac9 Memoize deprecations-related computations
It might be helpful for performance as these methods are called
for each resolution candidate and in the same time they scan
the whole overridden tree of a callable member
2017-09-13 15:34:14 +03:00
Denis Zharkov
4eb0f245a6 Avoid creating substitution instances for empty argument list 2017-09-13 15:34:14 +03:00
Denis Zharkov
fbdcf45976 Optimize AbstractClassTypeConstructor::equals 2017-09-13 15:34:14 +03:00
Denis Zharkov
8753baeab6 Optimize DirectoriesScope::contains
Previously its complexity was O(directoriesCount * pathSize),
now it's O(pathSize) in average
2017-09-13 15:34:14 +03:00
e5l
5bb88b659b Rename flag Xjsr305-annotations->Xjsr305 2017-09-13 15:19:54 +06:00
Zalim Bashorov
30c7f633bd KJS: don't load declarations marked by PlatformDependent annotation
#KT-17450 Fixed
2017-09-13 02:18:43 +03:00
Yan Zhulanow
d7ad973843 Kapt, minor: Remove duplicating 'visitInnerClass()' calls (rebase issue) 2017-09-12 22:17:18 +03:00
Vladimir
9a8699a2ab Kapt: kaptGenerateStubs now depends on kapt build dependencies (KT-20001) 2017-09-12 22:07:18 +03:00
Yan Zhulanow
7b4e24a454 Android Extensions: Allow LayoutContainers in inner/local classes and objects 2017-09-12 22:07:18 +03:00
Yan Zhulanow
07be1e9d10 Android Extensions: Generate proper receiver for clearFindViewByIdCache() call (KT-19742) 2017-09-12 22:07:17 +03:00
Yan Zhulanow
f84df6381e NoArg: Support @MappedSuperclass JPA annotation (KT-19692) 2017-09-12 22:07:16 +03:00
Yan Zhulanow
3f4ddb006a Android Extensions: Fix compilation when LayoutContainer is used as an interface (KT-19753) 2017-09-12 22:07:16 +03:00
Yan Zhulanow
eefb490a8a Parcelable: Use efficient serialize strategy for Java/Kotlin Parcelables only from the current source roots (KT-20029) 2017-09-12 22:07:15 +03:00
Yan Zhulanow
1b688182cd Parcelable: Use specialized write/create methods where available (KT-20057) 2017-09-12 22:07:14 +03:00
Yan Zhulanow
f6d7a17227 Parcelable: Remove 'ACC_STATIC' flag from Creator class, Dalvik dex checker hates it, and it's illegal anyway (KT-20034) 2017-09-12 22:07:13 +03:00
Yan Zhulanow
e0509e8c4d Parcelable: Specify declaration origin for the synthetic descriptors 2017-09-12 22:07:13 +03:00
Yan Zhulanow
033386b47d Parcelable: Do not check property types if the Parcelable class has a custom Parceler implementation (KT-20062) 2017-09-12 22:07:12 +03:00
Yan Zhulanow
89c5f78a8e Parcelable: Use Parcel methods for reading-writing primitive types (KT-20020) 2017-09-12 22:07:11 +03:00
Yan Zhulanow
a03c03c427 Parcelable: Handle nullability in Parcelize Parcelable serializer (KT-20032) 2017-09-12 22:07:11 +03:00
Yan Zhulanow
88138fc420 Parcelable: Use java/lang/Enum methods to read/write enum values (KT-20022) 2017-09-12 22:07:10 +03:00
Yan Zhulanow
7b96c9a003 Parcelable: Give priority to Parcelable type over objects and enums (KT-20021) 2017-09-12 22:07:09 +03:00
Yan Zhulanow
be3273a933 Parcelable: Flags argument should be propagated to the nested Parcelable's writeToParcel() (KT-20019) 2017-09-12 22:07:08 +03:00
Yan Zhulanow
3587a2a08e Parcelable: Use ClassLoader from the container class to load Parcelable (KT-20027)
When the parameter type is just "Parcelable", we would not pick the wrong (system) class loader anymore.
2017-09-12 22:07:08 +03:00
Yan Zhulanow
c9ec1a2511 Parcelable: Array serializer should correctly handle wide primitive types – long, double (KT-20002) 2017-09-12 22:07:07 +03:00
Yan Zhulanow
32fc340d62 Parcelable: Parcelize overrides describeContents despite being already implemented (KT-20026) 2017-09-12 22:07:06 +03:00
Yan Zhulanow
e645da64da Parcelable: Use the Parcelable implementation class as a containing declaration for Creator (KT-19899) 2017-09-12 22:07:06 +03:00
Yan Zhulanow
f8ca714c45 Parcelable: Cast types deserialized with Parcel.readValue() (KT-19747) 2017-09-12 22:07:05 +03:00
Yan Zhulanow
eee28d8507 Parcelable: Fix signature for Serializable Parcel serializer (KT-19749) 2017-09-12 22:07:04 +03:00
Nikolay Krasko
32c02161cd Refactoring: improve isApplicable methods in surrounders 2017-09-12 18:27:47 +03:00
Nikolay Krasko
b925df0e14 Minor: remove '\n' from if surrounder 2017-09-12 18:27:47 +03:00
Nikolay Krasko
239f88e5d3 Refactoring: use sealed classes for try-catch expression surrounders 2017-09-12 18:27:47 +03:00
Kirill Rakhman
08103d1cb4 Implement "Surround with try/catch(/finally)" and "Surround with if/else" for expressions
Fixes #KT-14175
Fixes #KT-19782
2017-09-12 18:27:47 +03:00
Mikhail Zarechenskiy
e16d16fdb7 Do not report diagnostic about annotation with receiver target twice 2017-09-12 17:39:24 +03:00
Mikhail Zarechenskiy
2048a74302 Introduce Language Feature for annotations with wrong targets
#KT-9580 Fixed
2017-09-12 17:39:23 +03:00
Mikhail Zarechenskiy
a4766cc293 Report errors on annotations with wrong use site targets
#KT-9580 In Progress
2017-09-12 17:39:22 +03:00
Mikhail Glukhikh
dafb52a44a CodeBlockModification...: count file as changed when no changed elements
It means that root PSI (KtFile itself) is changed

So #KT-19726 Fixed
So #KT-20157 Fixed
2017-09-12 17:28:32 +03:00
Mikhail Glukhikh
dd1ac5bb6b Add a set of tests for internal callables find usages
Related to KT-19811
2017-09-12 16:51:02 +03:00
Mikhail Glukhikh
97233448d0 Enclosing element: do not handle parameters of for as function ones
So #KT-19626 Fixed
2017-09-12 16:13:56 +03:00
Mikhail Glukhikh
7ae722492f Unused symbol: do not use body of function literal as scope for members
So #KT-10546 Fixed
2017-09-12 16:13:34 +03:00
Mikhail Glukhikh
4b25317ecb Minor: KtPsiUtil: extract isNonLocalCallable 2017-09-12 16:13:15 +03:00
Toshiaki Kameyama
5eb69e0ae4 KT-20010 'Replace safe access expression with 'if' expression' IDEA Kotlin plugin intention may failed (#1288)
* 'Replace safe access expression with 'if' expression' IDEA Kotlin plugin intention may failed #KT-20010 Fixed

* #KT-20010 Fixed
2017-09-12 14:54:50 +02:00
Alexander Udalov
60c735f2fd Do not use deprecated kotlin.reflect API 2017-09-12 15:08:21 +03:00
Alexander Udalov
593d6b7a95 Minor, do not use ".java.kotlin" on KClass instances 2017-09-12 15:02:25 +03:00
Alexander Udalov
ac1c7d9a6a Drop Incompatible.NoImpl, fix no "missing impl" on nested class
Header/impl declarations are now considered fully compatible even in the
case when the impl declaration has no "impl" modifier. The error about
no "impl" is now reported separately and only on the impl declaration,
never on the header declaration

 #KT-20087 Fixed
2017-09-12 14:41:11 +03:00
Vyacheslav Gerasimov
b6c32edc43 Implement Kotlin Script support in UAST
#KT-18353 Fixed
2017-09-12 13:10:38 +03:00
Vyacheslav Gerasimov
89257e6397 Implement light classes for Kotlin scripts 2017-09-12 13:10:38 +03:00
Vyacheslav Gerasimov
26cbcfa1ac J2K: AbstractCompilerLightClassTest java -> kt 2017-09-12 13:10:38 +03:00
Kirill Rakhman
7fe1e4f83e Fix grammar in inspection description 2017-09-12 12:05:30 +03:00
Dmitry Petrov
38d1d06e6e Update modifier applicability tests for LV 1.2 2017-09-12 11:54:04 +03:00
Dmitry Petrov
6b6d1e80f8 Fix enum entry reference from enum entry initialization context
Enum entries are "special" kind of singletons that should be
referenced as a captured 'this' instance inside during entry
initialization, because corresponding static fields in enum class
are not initialized yet.

 #KT-7257 Fixed
2017-09-12 11:00:24 +03:00
Anton Bannykh
40e2046e76 Updated ChangeLog.md 2017-09-11 21:06:32 +03:00
Anton Bannykh
ea9f5a7200 Update ChangeLog.md for version 1.1.50 2017-09-11 21:05:36 +03:00
Dmitry Jemerov
b2e27f9172 Add idea-jvm to ultimate classpath 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
cd44131f88 Add impl module roots also when gradle-aware make is enabled 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
0caadcd2f1 Put Kotlin runner on the first place 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
9d2b9df3b4 Correctly run multiplatform modules
When a JVM run configuration requests compiling a common module,
compile the corresponding JVM module instead.
2017-09-11 15:07:51 +02:00
Dmitry Jemerov
1d05e83401 Recognize common tests marked with annotations typealiased to @Test 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
6d30123c21 Add test dependencies when creating multiplatform projects 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
aed01c8475 Consistent naming: common platform is common, not default 2017-09-11 15:07:51 +02:00
Dmitry Jemerov
62b3059425 Support running main() under JVM in multiplatform projects
#KT-20093 In progress
2017-09-11 15:07:51 +02:00
Dmitry Jemerov
0b143e982f Always delegate build/run actions in MPP projects to Gradle 2017-09-11 15:07:51 +02:00
Alexey Andreev
c90c3e4bf5 Add hack to make JS coercion compatible with older versions of stdlib 2017-09-11 14:34:35 +03:00
Alexey Andreev
0acc96c4f3 Translate reference to kotlin.Unit to a shorter JS code 2017-09-11 14:34:35 +03:00
Alexey Andreev
2656a6a513 Eliminate redundant RHS of JS comma expression 2017-09-11 14:34:34 +03:00
Alexey Andreev
37fa45dc34 Add mechanism for type coercion in JS
Use it for char boxing/unboxing and unit materialization.
Possible to use for other purposes, for example, to add type checks
to dynamics.

See KT-18793, KT-17915, KT-19081, KT-18216, KT-12970, KT-17014,
KT-13932, KT-13930
2017-09-11 14:34:34 +03:00
Mikhail Glukhikh
ae509d5980 Unused symbol: add test to fix behaviour #KT-16318 Obsolete 2017-09-11 12:12:20 +03:00
Mikhail Glukhikh
37d2386a0b Unused symbol: handle imports from nested objects correctly
So #KT-17437 Fixed
2017-09-11 12:12:18 +03:00
Mikhail Glukhikh
7e3d3bde74 Unused symbol: never use VALUE_ARGUMENT scope for members
So #KT-10546 Fixed
2017-09-11 12:12:17 +03:00
Mikhail Glukhikh
5c4e034171 Unused symbol: do not search for internal member light methods
Use direct references search instead
So #KT-19811 Fixed
2017-09-11 12:12:16 +03:00
Dmitry Petrov
4428798c61 Change diagnostic message and rename to NESTED_CLASS_DEPRECATED 2017-09-11 09:42:18 +03:00
Dmitry Petrov
66ece54b25 Fix initialization of inner class instances in enum entries
In an inner class of the enum entry class, enum entry reference should
be generated as an outer 'this', not as a enum entry access, because
enum entry itself may be not initialized yet.
2017-09-11 09:42:18 +03:00
Dmitry Petrov
26b2f59b86 Check that resolve works properly with inner classes in enum entries 2017-09-11 09:42:18 +03:00
Dmitry Petrov
ba2c3136bb Prohibit non-inner classes in enum entries since 1.3 2017-09-11 09:42:18 +03:00
Dmitry Petrov
ea91a0794d Allow modifier 'inner' on a class nested in enum entry class 2017-09-11 09:42:18 +03:00
Dmitry Petrov
488a825349 Specialize diagnostic message for nested classes not allowed 2017-09-11 09:42:18 +03:00
Mikhail Zarechenskiy
dd9ffd10b6 Preserve order of types in new type intersector 2017-09-10 22:29:07 +03:00
Dmitry Jemerov
d8b46406ab Delete unused extension point 2017-09-09 10:01:36 +02:00
Alexey Andreev
24c6f5f0f0 JS: add test to prove that KT-19483 is no more reproducible 2017-09-08 18:27:43 +03:00
Alexey Andreev
c65a79bca4 Fix tests for inline cycle diagnostics in JS 2017-09-08 18:27:42 +03:00
Alexey Andreev
c66bc0b0e9 Remap source maps in JS DCE. Improve JS DCE error logging
See KT-19821
2017-09-08 18:27:41 +03:00
Alexey Andreev
1350e3c4ac JS: improve optimization of for loop over range literals
See KT-18329, partial fix for KT-8372
2017-09-08 18:27:40 +03:00
Alexey Andreev
502c51ccff Sanitize names for backing fields and private declarations in JS BE
See KT-1816
2017-09-08 18:27:40 +03:00
Alexey Andreev
206369c088 JS: fix capturing of reified type parameters when used as class literals
See KT-19891
2017-09-08 18:27:39 +03:00
Mikhail Glukhikh
03ce6d859f Disable destructure inspection by default
Now (by default) action is accessible as intention only
So #KT-15422 Fixed
So #KT-18666 Fixed
2017-09-08 17:41:44 +03:00
Mikhail Glukhikh
c149c37ac7 Do not suggest destructuring for invisible properties #KT-18665 Fixed 2017-09-08 17:41:44 +03:00
Mikhail Glukhikh
c4ebfe8e84 Add accessors: determine header properties more correctly
Related to KT-17322
2017-09-08 16:10:55 +03:00
Mikhail Glukhikh
13775f8637 Fix broken quick-fix tests (related to KT-17322) 2017-09-08 16:10:54 +03:00
Alexey Sedunov
bdad58cec6 Kotlin Facet: Support "implements" relation between modules
#KT-17593 Fixed
2017-09-08 15:38:14 +03:00
Alexey Sedunov
8ebc766b5b Kotlin Ultimate: Support Mocha run configurations for module directory
#KT-16814 In Progress
2017-09-08 15:38:14 +03:00
Alexey Sedunov
8b64a4c8ea Override/Implement: Drop 'impl' modifier for non-impl class members
#KT-18469 Fixed
2017-09-08 15:38:14 +03:00
Alexey Sedunov
6f8503a178 Override/Implement: Do not generate bodies for header class members
#KT-15659 Fixed
2017-09-08 15:38:14 +03:00
Alexander Udalov
6c3620f481 Suppress logging from jline
#KT-19243 Fixed
2017-09-08 15:33:30 +03:00
Nikolay Krasko
69176a146e getModuleInfo.kt: refactor 2017-09-08 15:06:03 +03:00
Pavel V. Talanov
deda5e7eee Fix navigation to script dependency sources failing
Specifically in case where some lib is in project and script dependencies at the same time
2017-09-08 15:06:00 +03:00
Pavel V. Talanov
ebd3ac6dc8 Fix script resolver failing
Specifically the case where some lib is in project dependencies and script dependencies at the same time

 #EA-105435 at least partially fixed
 #KT-19458 Fixed
 #KT-19474 Fixed
2017-09-08 15:05:58 +03:00
Pavel V. Talanov
e9ce5bbb37 Infrastructure to test sharing libs by project and scripts
Allow to test scenario where project and scripts share some jar as dependency
Refactor AbstractScriptConfigurationTest
2017-09-08 15:04:20 +03:00
Pavel V. Talanov
53144def10 AbstractScriptConfigurationTest: rewrite script template setup
Allow simpler setup of common scenarios
Do not require to define DependenciesResolver for every test
Drop redundant template files
2017-09-08 15:04:17 +03:00
Pavel V. Talanov
d7149a4083 getModuleInfo.kt: allow go get all module infos for a given psiElement 2017-09-08 15:04:14 +03:00
Pavel V. Talanov
6bec17246c Fix inspections run for script dependency source files in come cases
This filter defines which files inspections are run for
In most cases other platform code prevented inspections from running for
    library source files but this check is needed to prevent KT-19377

 #KT-19377 Fixed
2017-09-08 15:03:30 +03:00
Nikolay Krasko
6b14d15374 Clean state in AbstractKotlinKapt3IntegrationTest 2017-09-08 12:56:28 +03:00
Nikolay Krasko
c479e585ca Clean project in uast tests 2017-09-08 12:56:28 +03:00
Nikolay Krasko
fcab80db96 Add uast-tests files to our project
Copy files from obsolete project https://github.com/JetBrains/uast
2017-09-08 12:56:28 +03:00
Nikolay Krasko
6fd3ce07b3 Force remove JpsModel in BaseKotlinJpsBuildTestCase tests 2017-09-08 12:56:28 +03:00
Nikolay Krasko
eb7a984843 Store descriptor via soft reference to avoid holding project from debugger 2017-09-08 12:56:28 +03:00
Alexander Udalov
2877314313 Support "::foo" as a short-hand for "this::foo"
#KT-15667 Fixed
2017-09-08 10:59:44 +03:00
Alexey Andreev
d2ff821a3b JS: prove that lambdas in inline function compiled correctly
Obsoletes KT-19712
2017-09-08 10:57:42 +03:00
Alexey Andreev
ff0efe59f6 JS: fix error in generation of if/else statements in some cases
See KT-19495
2017-09-08 10:56:49 +03:00
Alexey Andreev
4779f4fefb JS: don't mark access to captured var as pure
See KT-19108
2017-09-08 10:56:06 +03:00
Alexey Sedunov
f2b6644db5 Kotlin Ultimate: Add JS debugger plugin dependency
This fixes tests failure due to unresolved NodeJS dependency
2017-09-08 03:42:22 +03:00
Ilya Gorbunov
980feffffa Improve @PublishedApi annotation docs #KT-19881 2017-09-07 20:07:27 +03:00
Alexey Sedunov
78b1fb2e93 Kotlin Facet: Avoid reparse of additional arguments during analysis 2017-09-07 17:39:18 +03:00
Alexey Sedunov
dcd966f7c2 Kotlin Ultimate: Support Mocha run configurations for Kotlin sources
#KT-16814 In Progress
2017-09-07 17:39:17 +03:00
Alexey Sedunov
4f647e84c9 Line Marking: Respect @Test/@Ignore annotations in test line markers
#KT-16814 In Progress
2017-09-07 17:39:16 +03:00
Toshiaki Kameyama
5a5a27b983 Intentions to generate accessors for a property #KT-17322 Fixed 2017-09-07 17:33:39 +03:00
Toshiaki Kameyama
fe0f44da94 Added "Add remaining branches with import" quick fix #KT-16033 Fixed 2017-09-07 16:24:35 +03:00
Mikhael Bogdanov
2fa4c28e0f Properly reorder arguments in anonymous object super class constructor
#KT-18356 Fixed
2017-09-07 15:18:05 +02:00
Mikhael Bogdanov
44fd8103d4 Convert ObjectSuperCallArgumentGenerator to Kotlin 2017-09-07 15:18:04 +02:00
Mikhael Bogdanov
ddb6e3307e Rename ObjectSuperCallArgumentGenerator.java to ObjectSuperCallArgumentGenerator.kt 2017-09-07 15:18:04 +02:00
Mikhael Bogdanov
529036eb78 Move ObjectSuperCallArgumentGenerator to separate file 2017-09-07 15:18:03 +02:00
Nikolay Krasko
c327118eac Remove PCE throwing as it can cancel background tasks (KT-19901)
Method can be called from the background task and be paused because
the write action is in progress. Throwing the PCE might stop the whole
task, that is wrong.

Explicit read action seems to be unneeded.

#KT-19901 Fixed
2017-09-07 16:10:09 +03:00
Nikolay Krasko
d38fd0fdf8 Need reformat inspection 2017-09-07 16:10:09 +03:00
scache
ba19931aef Keep braces in redundant cascade if #KT-19704 Fixed 2017-09-07 15:23:04 +03:00
Dmitry Jemerov
97e4dbe330 Add 'multiplatform' to spellchecker dictionary 2017-09-07 12:29:24 +02:00
Dmitry Jemerov
e1b79fc316 Show descriptions for Kotlin Gradle frameworks 2017-09-07 12:29:24 +02:00
Dmitry Jemerov
f840d0df41 Wizard for creating multiplatform projects 2017-09-07 12:29:24 +02:00
Dmitry Jemerov
140db74607 Correctly import 'implements' dependencies on root project 2017-09-07 12:29:24 +02:00
Dmitry Jemerov
369f3d6553 Don't break dependency import on invalid 'implement' dependency 2017-09-07 12:29:24 +02:00
Dmitry Jemerov
e392b4a427 Framework providers for modules of Kotlin multiplatform projects 2017-09-07 12:29:24 +02:00
Mikhail Zarechenskiy
088800d82f Report error about val reassignment via backing field since Kotlin 1.3
Also improve message for current warning

 #KT-16681 Fixed
2017-09-07 12:54:31 +03:00
Mikhail Zarechenskiy
03440210ee Introduce language version 1.3 2017-09-07 12:52:32 +03:00
Alexander Udalov
27b8b209e3 Refactor accessors for backing fields in JVM back-end 2017-09-07 12:24:54 +03:00
Alexander Udalov
326111aece Render .kotlin_module files nicely for tests 2017-09-07 12:24:53 +03:00
Mikhael Bogdanov
1cf8ee9433 Don't remove nullability assertions of anonymous object transformation
#KT-19910 Fixed
2017-09-06 17:48:13 +02:00
Ilya Gorbunov
599113b30f Fix internal KotlinVersion representation that caused invalid comparison 2017-09-06 18:45:33 +03:00
Alexey Andreev
5bf4540458 JS: fix inlining of functions derived from other modules
See KT-16408
2017-09-06 17:55:31 +03:00
Alexey Andreev
361d6dfca0 JS: rewrite source map generator to use specialized JSON writer
Fixes problems with string escaping. See KT-20005
2017-09-06 17:55:06 +03:00
Yan Zhulanow
187ca71dc6 NoArg: Fix compatibility with sealed classes with non-zero-parameter constructors (KT-19687)
Also check if a class has a sealed super class properly.
2017-09-06 17:40:20 +03:00
Yan Zhulanow
cea891c754 Kapt: Do not replace '/' with dots before converting to fqName (KT-19680)
getQualifiedName() converts slashes by itself, and it causes the internal name equality check (it.name == classFromSources.name) to fail.
This reproduces only for the pure synthetic classes (for which we don't generate Java light classes).
2017-09-06 17:40:19 +03:00
Yan Zhulanow
fe3413c291 Parcelable: Add INNERCLASS metadata to Creator factory class and its outer class 2017-09-06 17:40:19 +03:00
Yan Zhulanow
04c2e28341 Kapt: Do not use awkward ('$' -> '/') logic for KAPT3 class builder mode
So (for the most often reproduction case) #KT-19433 Fixed

Before this commit, internal names for nested classes were written as test/Foo/Bar (comparing to test/Foo$Bar in the normal mode), as getting qualified names from such internal names was trivial. But, because of IC, we needed to write class files to the disk, so our decompiler could find such "broken" classes and read it in a wrong way.
2017-09-06 17:40:18 +03:00
Yan Zhulanow
c330285fd0 Parcelable: Use innerClassNameFactory to figure out the internal name of the Creator class (KT-19680)
KAPT3 class builder mode in 1.1.4 replaces '$' (inner class name separators) with '/' by providing special innerClassNameFactory.
We should use it to be compatible with kapt.
2017-09-06 17:40:18 +03:00
Yan Zhulanow
84e59601c1 Kapt: Generic arguments in anonymous type should always be mapped to boxed types (KT-19750) 2017-09-06 17:40:17 +03:00
Yan Zhulanow
4d9a612a64 Kapt: Substitute type parameters from the actual type, not from the anonymous one (KT-19700) 2017-09-06 17:40:16 +03:00
Dmitry Jemerov
4e4291c586 Fix formatting of class headers when "blank lines after class
header" is enabled
2017-09-06 15:11:05 +02:00
Anton Bannykh
f4b329a055 JS: support @Before and @After annotations in kotlin.test 2017-09-06 14:36:45 +03:00
Dmitry Petrov
8c5d18c1f2 Tests for boxing optimization on KClass are JVM-specific 2017-09-06 14:20:05 +03:00
Dmitry Petrov
61faa068d4 Do not optimize == for KClasses in redundant boxing elimination
For primitive wrappers such as java.lang.Integer,
  jlc = java.lang.Integer.class
  jlt = java.lang.Integer.TYPE
  !(ljc.equals(ljt))
However, in Kotlin corresponding KClass instances are equal.

 #KT-17748 Fixed Target versions 1.1.50
 #KT-17879 Fixed Target versions 1.1.50
2017-09-06 09:54:36 +03:00
Dmitry Petrov
2b27e64fc8 Improve diagnostics for "not yet supported in inline"
- Tell user what exactly is not supported (e.g., local inline function)
- Reduce diagnostics range to a keyword or an identifier
  where appropriate

 #KT-16223 Fixed Target versions 1.1.50
2017-09-06 09:46:33 +03:00
Mikhael Bogdanov
160ba0c7c0 Destroy state and environment in android test 2017-09-06 08:20:33 +02:00
Mikhael Bogdanov
71663afbfe Update android test configuration 2017-09-06 08:20:33 +02:00
Mikhael Bogdanov
81a1bf3319 Recalculate max stack on method emitting: optimizations could change it 2017-09-06 08:20:32 +02:00
Nikolay Krasko
638cf346aa Add soutf template for printing current position (KT-19709)
#KT-19709 Fixed
2017-09-05 19:49:58 +03:00
Nikolay Krasko
2ce6a0eaee Minor: fix warnings in TypedHandlerTest.kt 2017-09-05 19:49:02 +03:00
Nikolay Krasko
385ff3f4eb Test for smart indent in parameters (KT-17648)
Fixed in IDEA-173208

#KT-17648 Fixed
2017-09-05 19:49:01 +03:00
Nikolay Krasko
80ffc5cd41 Make local file indent feature work for Kotlin files
Revert "Add language to formatting blocks to fetch indent settings propertly"
This reverts commit d717da5
2017-09-05 19:49:01 +03:00
Toshiaki Kameyama
e01371b231 Redundant getter / setter inspection #KT-19514 Fixed (#1282) 2017-09-05 17:27:56 +02:00
Mikhail Zarechenskiy
a3060f1073 Add test on obsolete issue
#KT-9203 Obsolete
2017-09-05 16:15:18 +03:00
Dmitry Petrov
21cdf9dd5b Add cast to expected type in call-based in-expression generation
#KT-20106 Fixed
2017-09-05 15:32:53 +03:00
Mikhail Zarechenskiy
081b732070 Improve diagnostics for lateinit properties with generic type
#KT-11834 Fixed
2017-09-05 14:44:55 +03:00
Mikhail Zarechenskiy
356f903645 Make classes for CLI public to reuse them in other tools
To configure Kotlin environment and use them in plugins for Eclipse or NetBeans
2017-09-05 14:42:48 +03:00
Mikhail Zarechenskiy
0dc29d6d7e Get rid of passing typeChecker from the call hierarchy 2017-09-05 14:41:46 +03:00
Mikhail Zarechenskiy
e7449a3584 Fix referencing inner class constructor on an outer class instance
#KT-12796 Fixed
2017-09-05 14:41:44 +03:00
Mikhail Zarechenskiy
4a6f35b9c2 Fix exception on invalid code, don't resolve uninitialized type
#KT-11963 Fixed
2017-09-05 14:41:42 +03:00
Mikhail Zarechenskiy
6d4bb229ac Fix compilation exception where overload ambiguity should be
#KT-16246 Fixed
2017-09-05 14:41:40 +03:00
Mikhail Zarechenskiy
ec512d1c8a Add tests on obsolete issues
#KT-11236 Obsolete
 #KT-12399 Obsolete
2017-09-05 14:41:34 +03:00
Dmitry Jemerov
cbe79e94a6 Update testdata 2017-09-04 20:39:52 +02:00
scache
e5b290d77f Fix replacedBaseClause for selector which has implicit receiver
#KT-19666 Fixed
2017-09-04 20:36:07 +02:00
Toshiaki Kameyama
a9a52379ee Quickfix for "variable initializer is redundant" (VARIABLE_WITH_REDUNDANT_INITIALIZER) #KT-5878 Fixed (#1281) 2017-09-04 16:58:32 +02:00
Pavel V. Talanov
653314e671 IDE script support: cancel coroutines on project disposal 2017-09-04 16:35:28 +03:00
Pavel V. Talanov
7f361c7579 Add utility for EDT coroutines to be canceled on project disposal 2017-09-04 16:33:31 +03:00
Dmitry Jemerov
7ca1fe0f55 Fix compilation 2017-09-04 14:39:25 +02:00
Alexey Andreev
b8aa2f81a2 Fix delegate property name clash in JS BE
See KT-19542
2017-09-04 15:35:35 +03:00
Alexey Andreev
28c9d274ec JS: prohibit illegal chars on dynamic call site
See KT-19540
2017-09-04 15:35:00 +03:00
Alexey Andreev
5a984a40e6 Fix JS compiler crash when translating external object fun with vararg
See KT-19793
2017-09-04 15:34:10 +03:00
Alexey Andreev
989cebe79e JS: fix bug in temporary variable eliminator
The problem was in considering `a` as trivial in following case:

```
var a = b;
```

However, that's wrong assumption, since `b` can be temporary variable
itself which is further substituted by a non-trivial expression.
2017-09-04 15:33:16 +03:00
Alexey Andreev
abb254297a Properly rename local name aliases when merging JS fragments together 2017-09-04 15:33:16 +03:00
Alexey Andreev
593aa72439 Fix bug in new JS inliner when inlining nested calls 2017-09-04 15:33:15 +03:00
Alexey Andreev
63855af026 Raise JS metadata version due to incompatible changes in inliner 2017-09-04 15:33:14 +03:00
Alexey Andreev
df7d69b5b4 Minor refactoring after improving JS inliner 2017-09-04 15:33:14 +03:00
Alexey Andreev
918ce78c5a Support inlining internal functions to friend modules in JS BE
There's one exception: if an inline internal function calls
private function, this will fail at run time.
2017-09-04 15:33:13 +03:00
Alexey Andreev
41140d00b1 JS: do not copy declarations from inline function wrapper more than once 2017-09-04 15:33:13 +03:00
Alexey Andreev
1260146d25 Use local aliases for char boxing and unboxing in JS BE 2017-09-04 15:33:12 +03:00
Alexey Andreev
7646c2fc72 Use local aliases for Kotlin runtime functions in JS BE 2017-09-04 15:33:11 +03:00
Alexey Andreev
8c256b24dc Avoid duplication of imports introduced during JS inlining 2017-09-04 15:33:10 +03:00
Alexey Andreev
f2b2e20331 Minor cleanup in JS backend 2017-09-04 15:33:10 +03:00
Alexey Andreev
b90885d1cb Support new inline function format in JS DCE tool 2017-09-04 15:33:09 +03:00
Alexey Andreev
901346243d JS: fix inlining of function that calls functions from other modules 2017-09-04 15:33:08 +03:00
Alexey Andreev
6bb5d00700 Fix inlining of default arguments in JS BE 2017-09-04 15:33:07 +03:00
Alexey Andreev
834cd1d93d Fix testdata for new JS inliner 2017-09-04 15:33:07 +03:00
Alexey Andreev
61ba6e528a Fix JS line number tests 2017-09-04 15:33:06 +03:00
Alexey Andreev
df782eaadd Fix incremental compilation to JS with new inliner 2017-09-04 15:33:06 +03:00
Alexey Andreev
eb6186b74d Fix translation of classes to work with new JS inliner 2017-09-04 15:33:05 +03:00
Alexey Andreev
8e6b1da592 Generate less JS inline function wrappers 2017-09-04 15:33:04 +03:00
Alexey Andreev
aaf3380050 Add optimizer for trivial functions with wrappers in JS BE 2017-09-04 15:33:04 +03:00
Alexey Andreev
445a80c755 Support new JS inline function format in multi-module projects 2017-09-04 15:33:03 +03:00
Alexey Andreev
7c421b0b83 Refactor JS translator to generate code for new inliner 2017-09-04 15:33:03 +03:00
Nicolay Mitropolsky
29857e48c8 KtLightAnnotationTest fix for oddly broken annotations getter 2017-09-04 15:20:20 +03:00
Nicolay Mitropolsky
be4b86e3d9 KtLightAnnotationForSourceEntry fix for smart-pointers creating
`LightElementValue` made PsiCompiledElement to make it properly anchorable when creating smartpointers, when still use `kotlinOrigin.containingFile` for it to be able to `registerProblem` on such elements. (refs KT-18054)
2017-09-04 15:20:20 +03:00
Dmitry Jemerov
b0fb3370e3 Correctly get qualified name for properties without backing field
#KT-19903
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
cc6bfcfc7c Attach super line marker to name identifier
#KT-19843 Fixed
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
f008736ef7 Fix package name convention pattern
#KT-19927 Fixed
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
f709bd869a Accept invalid patterns in naming convention settings
#KT-19926 Fixed
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
f74416a151 Cache the result of hasTopLevelCallables() for a KtFile
#KT-19885 Fixed
2017-09-04 13:21:03 +02:00
Dmitry Jemerov
839f197a1e KtFile: J2K and cleanup 2017-09-04 13:21:03 +02:00
Dmitry Jemerov
ebef2dc0cf KtFile: rename to .kt 2017-09-04 13:21:03 +02:00
dzieciolowski
80f1a1bde8 Update gradle.xml - remove typo (#1279) 2017-09-04 13:11:24 +02:00
Alexander Udalov
840fce520c Update KotlinVersion.CURRENT to 1.1.50 2017-09-04 13:09:52 +03:00
Dmitry Jemerov
2d10df1541 Fix red code: mark dependency as exported 2017-09-01 16:59:03 +02:00
Dmitry Jemerov
81d0445775 Fix master-171 build: don't use API introduced in newer IDEA 2017-09-01 16:54:24 +02:00
Dmitry Jemerov
ad37626af3 Fix compilation of KotlinBytecodeToolWindow 2017-09-01 16:41:26 +02:00
Dmitry Jemerov
59976baac2 Fix path to generated test 2017-09-01 15:27:44 +02:00
Dmitry Petrov
76acd23bd7 Revert "Fix synthetic accessor generation for properties"
This reverts commit 2427b2c
2017-09-01 16:09:29 +03:00
Dmitry Jemerov
db840a73a9 Set scope of all plugin module dependencies to provided 2017-09-01 14:06:39 +02:00
Alexander Udalov
05290c3ed2 Fix AssertionError on incompatible scopes with impl typealias
This has been introduced in 9ecd04f628
2017-09-01 14:47:29 +03:00
Pavel V. Talanov
f695ff96e8 IDEKotlinBinaryClassCache: store soft reference in UserData
Storing hard reference leads to binary headers being stored indefinitely
2017-09-01 14:30:27 +03:00
Dmitry Jemerov
0fa4e1cbaf Set scope of plugin dependencies to provided 2017-09-01 13:11:39 +02:00
Vyacheslav Gerasimov
5220dfc0ad Android: Add inspection & quickfix to convert findViewById to api 26
#KT-19940 Fixed Target Version 1.1.5
2017-09-01 13:32:52 +03:00
Vyacheslav Gerasimov
be900a76d8 Android Lint: check for array initializer in SuppressLint 2017-09-01 13:32:08 +03:00
Vyacheslav Gerasimov
f4da6c2cc6 UAST: findAttributeValue returns default value when no declared value found 2017-09-01 13:32:00 +03:00
Vyacheslav Gerasimov
56a075eab6 UAST: Fix annotation arguments processing
multiple unnamed arguments represented as value named expression with array initializer
 call kind for array in annotation argument should be "array initializer" instead of "method call"

 #KT-16600 Fixed Target Versions 1.1.5
2017-09-01 13:31:50 +03:00
Dmitry Jemerov
e0bf438195 Move .xml files back to main idea module 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
895d5fda46 Extract parts of plugin that depend on Java-only plugins to idea-jvn 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
8b0d606ab5 Move Android .xml file to idea-android module 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
9eace7b295 Move Gradle tests to idea-gradle module; remove idea dep on idea-gradle 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
d2972314bc Remove duplicate version detection code from AddKotlinLibQuickFix 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
92103ff393 Add tests for "add kotlin-reflect.jar" quickfix 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
feeacda12b Extract logic of adding a dependency to KotlinProjectConfigurator 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
f5cea51d21 idea no longer depends on idea-maven 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
bf639b1272 Move logic of EnableUnsupportedFeatureFix into KotlinProjectConfigurator 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
6fbb370eae Move coroutine state update logic to KotlinProjectConfigurator 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
e781b70170 Remove unnecessary dependency 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
6f9869ae11 Remove unnecessary dependency 2017-09-01 11:57:37 +02:00
Dmitry Jemerov
d8b6bd5cb3 Decouple idea-analysis from Android
Introduce API for extending syntax highlighting; use it in android
component
2017-09-01 11:57:37 +02:00
Dmitry Jemerov
982461e207 Remove unnecessary dependencies 2017-09-01 11:57:37 +02:00
Dmitry Petrov
5d44e095c8 Nullability assertions for extension receiver
In Kotlin 1.1 and before, there were no nullability assertions on
extension receivers, because receiver is resolved with NO_EXPECTED_TYPE.
So, if an expression of platform type is passed as an extension receiver
to a non-private function, it would fail with IllegalArgumentException.
However, if the function is private, then we generated no parameter
assertions under assumption that such function can be called from Kotlin
only, and all arguments are checked on the call site. Thus 'null' could
propagate indefinitely.

In Kotlin 1.2, we do the following:
- Generate nullability assertions for expression receivers.
NB nullability assertions are stored for ReceiverValue instances, not
for expressions: given expression can act as receiver in different
calls, each with an expected receiver type of its own.
- Generate nullability assertions for extension receivers of private
operator functions.
NB it still can throw NPE for some particular "optimized" cases, but at
least those nulls would not propagate indefinitely.

This behavior is disabled by an "advanced" command-line option
'-Xno-receiver-assertions'.
2017-09-01 09:49:21 +03:00
Dmitry Petrov
2427b2cc6c Fix synthetic accessor generation for properties
Generate synthetic accessors for property accessors only if the
corresponding methods are accessible in the current context.

 #KT-19306 Fixed Target versions 1.1.5
2017-09-01 09:48:26 +03:00
Mikhail Zarechenskiy
dde0efd8ab Refactoring: extract anonymous objects to classes, rename variable 2017-09-01 02:24:35 +03:00
Mikhail Zarechenskiy
f5222600d8 Improve diagnostics for fake calls when type inference failed
#KT-13665 Fixed
2017-09-01 02:05:58 +03:00
Mikhail Zarechenskiy
17b4874c37 Refactor FakeCallResolver, make error reporting simpler 2017-09-01 02:05:50 +03:00
Sergey Igushkin
ff1c5ad793 Merge pull request #1260 from JetBrains/kotlinx.serialization.patches/gradle
Support for gradle subplugins in Kotlin2JS compilation
2017-09-01 01:03:37 +03:00
Leonid Startsev
a0ddef22ef Extension points for serialization plugin in JS translator:
* Plugins for JS CLI compiler now can be loaded via -XPlugin option
* New extension point in project
* JS translator modified to accept synthetic declarations and call
 extension.
* Some functions made public to create a small API
2017-09-01 00:50:46 +03:00
Toshiaki Kameyama
0246b82833 @deprecated with multi-line message in Javadoc converted to @Deprecated("long ugly string") #KT-19644 Fixed (#1253) 2017-08-31 14:15:15 +02:00
Denis Zharkov
4e4bf31016 Fix loading JSR-305 nicknames for @CheckForNull annotation
For sake of working without jsr305.jar in the classpath `resolveTypeQualifierAnnotation`
may return javax.annotation.CheckForNull (although the latter is nickname itself)

 #KT-19985 Fixed
2017-08-31 15:13:26 +03:00
Denis Zharkov
ed79891ee6 Fix type mapping for parameter of Collection<Int>::remove override
In the case the single parameter of override has `Integer` type instead
of `int` type (while in common case it would be just `int`)

See the comment inside forceSingleValueParameterBoxing for clarification

 #KT-19892 Fixed
2017-08-31 12:38:08 +03:00
Denis Zharkov
73c139d250 Minor. Drop unused ExpressionCodegen::expressionJetType 2017-08-31 12:35:41 +03:00
Denis Zharkov
6af91b8c97 Drop redundant tests erroneously added in c8d25c587a 2017-08-31 12:35:05 +03:00
Denis Zharkov
80a90572d6 Fix target for annotations/metadata on open suspend functions
Get rid of rewriting of vars in FunctionCodegen::generateMethod,
just extracted generateMethodBody instead

 #KT-19814 Fixed
2017-08-31 12:27:28 +03:00
Dmitry Petrov
742fecf69c Minor: readability improvements after code review 2017-08-31 11:28:08 +03:00
Dmitry Petrov
21e3051a78 Use Name instead of String for lateinit-related StackValues
to emphasize that this is a descriptor name, not a JVM name
2017-08-31 11:28:08 +03:00
Dmitry Petrov
c8d25c587a Do not use reflection it local/top-level lateinit tests 2017-08-31 11:28:08 +03:00
Dmitry Petrov
638eb28692 Unify code for lateinit properties and local variables checking 2017-08-31 11:28:08 +03:00
Dmitry Petrov
b12e20b2a3 Minor: move local lateinit tests to lateinit/local 2017-08-31 11:28:08 +03:00
Dmitry Petrov
bbf9bf91fc Check language feature support for local and top-level lateinit vars 2017-08-31 11:28:08 +03:00
Dmitry Petrov
01cce59c35 Make sure lateinit top-level properties work in JVM BE 2017-08-31 11:28:08 +03:00
Dmitry Petrov
d951e957ea Support lateinit modifier on top-level properties
Allow lateinit modifier on top-level properties.
Modifiers 'lateinit' and 'header' are incompatible.
2017-08-31 11:28:08 +03:00
Dmitry Petrov
78b69cad77 Support lateinit local vars in redundant null check elimination
Lateinit local vars are guaranteed to be non-null after store.
So we mark such stores as storing non-null value
(could be useful for some other constructs, too),
and optimize null checks accordingly.
2017-08-31 11:28:08 +03:00
Dmitry Petrov
d0b0fdd732 Ignore lateinit local vars tests in JS and Native 2017-08-31 11:28:08 +03:00
Dmitry Petrov
c5b9d500bc Support lateinit local vars in JVM BE 2017-08-31 11:28:08 +03:00
Dmitry Petrov
53961e8df0 Check lateinit applicability for local variables
TODO probably should be refactored together with DeclarationsChecker
2017-08-31 11:28:08 +03:00
Dmitry Petrov
3bae430d49 Resolve lateinit variables
Do not report UNINITIALIZED_VARIABLE on lateinit variables
Provide delegating constructors for descriptors for compatibility.
2017-08-31 11:28:08 +03:00
Dmitry Petrov
f88cd5ed3d Allow 'lateinit' modifier on local variables 2017-08-31 11:28:08 +03:00
Pavel V. Talanov
352071dc4a Avoid creating ModuleSourceInfo instances with empty content
This is overall desirable because it means less ModuleDescriptor
    instances which is good for IDE analysis performance
2017-08-30 19:22:30 +03:00
Dmitry Jemerov
a623fb5312 Cleanup 2017-08-30 15:37:03 +02:00
Toshiaki Kameyama
29d2482b62 J2K RemovePartsFromPropertyFix 2017-08-30 15:36:58 +02:00
Toshiaki Kameyama
350cea7afd move RemovePartsFromPropertyFix.java to RemovePartsFromPropertyFix.kt 2017-08-30 15:36:26 +02:00
Toshiaki Kameyama
be64a6feeb INAPPLICABLE_LATEINIT_MODIFIER should have a quickfix to remove initializer #KT-18826 Fixed 2017-08-30 15:36:25 +02:00
Dmitry Jemerov
a68312379e Update ReadMe.md (#1274) 2017-08-30 15:25:48 +02:00
Denis Zharkov
aef5911c7e Obtain original suspend function view for inline codegen
It's necessary for generic inline suspend as a codegen
for it uses binding slice SUSPEND_FUNCTION_TO_JVM_VIEW
to generate fake continuation parameter, so all the
descriptors that are used for body generation must be
obtained from the SUSPEND_FUNCTION_TO_JVM_VIEW

 #KT-19528 Fixed
2017-08-30 16:19:43 +03:00
Alexander Udalov
abb07ced6d Minor, improve kdoc on JvmStatic 2017-08-30 15:51:30 +03:00
Alexander Udalov
fb4bf4e5b8 Report error if Java 9 module "kotlin.stdlib" is not found in the graph
Use "-Xallow-kotlin-package" to suppress this error

 #KT-19176 Fixed
2017-08-30 15:47:54 +03:00
Alexander Udalov
f47093dc45 Allow to access unexported package of named module in unnamed module in IDE
#KT-19492 Fixed
2017-08-30 15:45:45 +03:00
Alexander Udalov
290deb6ba4 Minor, improve test on Java 9 modules
Test that unnamed module does not read unexported package of a named
module
2017-08-30 15:45:45 +03:00
Alexander Udalov
09c1115ff9 Report errors on usages of unnamed module from named modules in IDE
#KT-19493 Fixed
2017-08-30 15:45:45 +03:00
Denis Zharkov
0d7c0d4e5e Add auto-generated tests after d6fbb084b1 2017-08-30 15:07:31 +03:00
Mikhael Bogdanov
b231bf0207 Switch custom jre path for run configuration from 9-ea to 9 jdk 2017-08-30 13:18:43 +02:00
Mikhael Bogdanov
ce0fb60ff4 Switch custom jre path for run configuration from 9-ea to 9 jdk 2017-08-30 12:52:44 +02:00
Denis Zharkov
d6fbb084b1 Use the same temporary trace for analyzing all candidate calls
Otherwise, when completing all the unsuccessfull candiates,
resolution of each lambda-arguments starts repeatedly for each candidate
that leads to exponential time

NB: Changes in `completeArguments` are necessary because otherwise
nested lambdas will be analyzed twice:
once for the main resolved call, and then for all candidates
that again leads to exponential complexity

 #KT-16672 Fixed
 #KT-19457 Fixed
2017-08-30 12:51:29 +03:00
Mikhael Bogdanov
84c2e01161 Update changelog for 1.1.4-3 2017-08-30 10:43:11 +02:00
Mikhael Bogdanov
68522b9f1e Use lazy logging in lowers 2017-08-30 10:41:55 +02:00
Dmitry Jemerov
dce6cb0cfc Highlight Kotlin files in build output
#KT-12246 Fixed
2017-08-30 10:18:00 +02:00
Pavel V. Talanov
4ada692421 Provide correct resolve scope to binaries in script dependencies
#KT-16760 Fixed
2017-08-29 20:55:20 +03:00
Pavel V. Talanov
a120130069 Workaround NonClasspathClassFinder not supporting inner classes
Explicitly split qualified names, can be removed once platform is fixed

 #KT-19310 Fixed
2017-08-29 20:54:25 +03:00
Toshiaki Kameyama
a6c2135851 Counter loop in Java is transformed to less effective loop in Kotlin #KT-19337 Fixed 2017-08-29 17:37:58 +02:00
Dmitry Jemerov
eefc6ebcc9 Add missing read action in KotlinBuildScriptManipulator 2017-08-29 17:33:42 +02:00
baratynskiy
67fdd9f76e javac-wrapper: fixes after rebase and review 2017-08-29 18:01:36 +03:00
baratynskiy
2dc0c55e76 javac-wrapper: get rid of TreePath because it is slow 2017-08-29 18:01:36 +03:00
baratynskiy
1b0d7ff5be javac-wrapper: constant evaluator 2017-08-29 18:01:36 +03:00
baratynskiy
4f180e1292 javac-wrapper: identifier resolver 2017-08-29 18:01:36 +03:00
baratynskiy
01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
baratynskiy
8494e54608 javac-wrapper: -Xuse-javac -> -Xuse-javac and -Xcompile-java 2017-08-29 18:01:36 +03:00
Nicolay Mitropolsky
2224720a90 findClass is nullable in IDEA 171, so !! added 2017-08-29 17:40:53 +03:00
Nicolay Mitropolsky
108a40261b KtLightAnnotationForSourceEntry fix for reading unnamed java-annotation parameter 2017-08-29 17:32:07 +03:00
Sergey Igushkin
e1924e0d2f (minor) Modify warning logic for separate classes dirs opt-out flag
(cherry picked from commit 0dfe1a1)
2017-08-29 14:39:17 +03:00
Sergey Igushkin
0e28d612e7 Add a test for the opt-out flag for disabling separate classes directory
(cherry picked from commit 393966d)
2017-08-29 14:39:17 +03:00
Sergey Igushkin
0263919dbd Provide an opt-out flag for separate classes dirs with Gradle 4.0+
Issue #KT-19774 Fixed

(cherry picked from commit 2aa6f5a)
2017-08-29 14:39:17 +03:00
Dmitry Jemerov
843a9871b1 Detect library kind field based on type, not name 2017-08-29 10:29:22 +02:00
Dmitry Jemerov
106db13a6a Add missing read action (EA-105188 - assert: FileManagerImpl.findFile) 2017-08-29 10:16:35 +02:00
Dmitry Jemerov
f37cc9c8ef Start read action at correct time (EA-105045) 2017-08-29 10:16:35 +02:00
Dmitry Jemerov
f7f3bacc8e Add missing write action (EA-102929) 2017-08-29 10:16:34 +02:00
Dmitry Jemerov
cc5d23440e Correctly check for project disposed (EA-103064) 2017-08-29 10:16:33 +02:00
Alexey Tsvetkov
ac3beabf43 Update 'idea.plugins.compatible.build' in KotlinCoreEnvironment
When compiler test was run before Intellij tests,
KotlinCoreEnvironment set the 'idea.plugins.compatible.build'
system property to '171.9999', which then prevented
Kotlin plugin from loading in Intellij tests (so all these tests failed),
because Kotlin plugin has 'sinceBuild' set to '172.1'.
2017-08-29 04:28:10 +03:00
Alexey Tsvetkov
cb1ffdccd7 Add test where unused file is removed 2017-08-29 04:28:10 +03:00
Alexey Tsvetkov
10feac9402 Remove CacheVersionChangedIT#testExperimentalCacheVersionChanged
experimental-format-version.txt was removed recently.
See also 534db2d45b
2017-08-29 04:28:09 +03:00
Alexey Tsvetkov
8e10a22aab Use correct task name in KaptIncrementalIT test 2017-08-29 04:28:09 +03:00
Alexey Tsvetkov
66a77c7ec2 Fix Gradle IC cache version checking 2017-08-29 04:28:09 +03:00
Alexey Tsvetkov
cf72b14b34 Fix typo in test name 2017-08-29 04:28:08 +03:00
Alexey Tsvetkov
141c889a84 Make test case more useful 2017-08-29 04:28:08 +03:00
Alexey Tsvetkov
5f9bad5905 Add JS specific build logs to inline properties IC tests
Unlike the JVM target platform, the JS back-end does
not track getters' and setters' usages separately,
so when either accessor of some property is changed,
all usages of that property will be rebuilt.
2017-08-29 04:28:07 +03:00
Alexey Tsvetkov
73b63bb343 Refactor inline properties tests 2017-08-29 04:28:07 +03:00
Alexey Tsvetkov
44e8ae3571 JS IC: detect inline function changes 2017-08-29 04:28:07 +03:00
Alexey Tsvetkov
b73d5cbe1f Mock constant search in JPS tests 2017-08-29 04:28:06 +03:00
Alexey Tsvetkov
2312013c41 Move JVM specific IC tests to separate dir 2017-08-29 04:28:06 +03:00
Alexey Tsvetkov
556c43ae00 Update lookup tracker test "classifierMembers"
Before the change, the initial build has been failing,
so lookups from deserialized descriptors were not tested.
2017-08-29 04:28:06 +03:00
Alexey Tsvetkov
4a591bf5b6 Avoid processing JS IC output when compilation failed 2017-08-29 04:28:05 +03:00
Alexey Tsvetkov
66cb45c202 Minor: replace forEach with filterTo 2017-08-29 04:28:05 +03:00
Alexey Tsvetkov
dbe3baf740 Minor: mark calculateSourcesToCompile abstract 2017-08-29 04:28:04 +03:00
Alexey Tsvetkov
919daefb0e Rename IncrementalCacheImpl->IncrementalJvmCache 2017-08-29 04:28:04 +03:00
Alexey Tsvetkov
093bbc069a Fix typo destonationDir->destinationDir 2017-08-29 04:28:04 +03:00
Alexey Tsvetkov
b28382b8e7 Ignore out directory everywhere
After IDEA-175172 JPS does not use Gradle's output directories
when buildsing imported projects.
Now JPS uses an `out/` directory instead,
which wasn't gitignored anywhere besides the project's root.
2017-08-29 04:28:03 +03:00
Alexey Tsvetkov
1c4ada2008 Fix searching serialized classes package contains multiple fragments 2017-08-29 04:28:03 +03:00
Alexey Tsvetkov
b54414d628 Implement Gradle JS IC support
#KT-19956 fixed

To try the experimental JS IC add
'kotlin.incremental.js = true' to a 'local.properties'
or 'gradle.properties' file in Gradle project's root.
2017-08-29 04:23:02 +03:00
Alexey Tsvetkov
eeb90656dc Exclude generated IC tests from ant build
Generated tests depend on the annotations from the `tests-common` module.
Testing utils from test root of the `incremental-compilation-impl` module
are also used in Gradle tests, so the test root is built in the ant build too.
However building `tests-common` separately from the compiler is complicated,
so I decided to exclude generated tests from 'kotlin-build-common-test.jar'.
2017-08-29 02:24:38 +03:00
Alexey Tsvetkov
7ecf5abdc7 Add class hierarchy tests to JS and JVM IC tests 2017-08-29 02:24:38 +03:00
Alexey Tsvetkov
0a5fe3ef7c Move JVM specific IC tests with class hierarchy changes 2017-08-29 02:24:38 +03:00
Alexey Tsvetkov
e16c5ddb97 Avoid using JVM only APIs in IC tests to reuse with JS 2017-08-29 02:24:38 +03:00
Alexey Tsvetkov
23bc907d3f Move multi-module IC tests to separate dir
At the moment they are used only with JPS
2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
166883d847 Move JVM specific IC test data to separate dir 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
7810da7018 Add IC compiler tests with Java 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
71e8f16906 Generate IC compiler tests instead of using parametrized runner
# Conflicts:
#	compiler/incremental-compilation-impl/incremental-compilation-impl.iml
2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
52b638ddb3 Throw exception if initial build has failed in IC tests 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
c7775b8d11 Write build info only on successful build 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
20551f6c99 Do not report error when JS IC is enabled and no source files is specified 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
bb1cba67b7 Implement JS IC 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
4aea9b349c Refactor incremental services 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
356536d32b Update inputs cache on rebuild 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
20b14d4121 Extract IncrementalJvmCompilerRunnerTest 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
6fedf07f56 Introduce ChangesCollector 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
d4d684a7f0 Introduce IncrementalCompilerRunner#makeServices 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
65529fa866 Introduce IncrementalCompilerRunner#markDirty 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
53d911ab99 Move IncrementalCompilerRunner to separate file 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
5ddc8d83bb Move compileIncrementally to common IC 2017-08-29 02:24:37 +03:00
Alexey Tsvetkov
60f68266dd Continue extracting common IC code 2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
9727ec401b Remove Target parameter from GeneratedFile 2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
af73082fcc Begin extracting common IC code 2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
508d96836c Remove compiledWithErrors param
`updateIncrementalCache` is not called when
code does not compile.
2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
d1fd88fb8e Minimize usage of TargetId in IC 2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
a076b4614e Refactor computeChanges 2017-08-29 02:24:36 +03:00
Alexey Tsvetkov
3ad5e78d77 Extract common caches 2017-08-29 02:24:36 +03:00
Toshiaki Kameyama
367b9f6664 "Redundant setter parameter type" range includes whole parameter declaration #KT-19648 Fixed (#1267) 2017-08-28 17:06:10 +02:00
Pavel V. Talanov
e3b7f6d698 Prevent multiple concurrent 'checkHideNonConfiguredNotifications' calls 2017-08-28 16:18:44 +03:00
Nicolay Mitropolsky
6953ae79e2 Fix for KtLightParameter and KtLightParameterList equality 2017-08-28 15:57:44 +03:00
Nicolay Mitropolsky
f8f5494d79 KotlinLightConstantExpressionEvaluator fix for processing Java-sourced annotation entry value 2017-08-28 15:55:57 +03:00
Dmitry Jemerov
ceae10f451 Update .iml 2017-08-28 12:03:45 +02:00
Dmitry Jemerov
1814f3172a Fix compilation 2017-08-28 11:32:38 +02:00
Dmitry Jemerov
5b8e5fb9aa Compile kotlin-gradle-tooling against JDK 6 2017-08-28 10:50:52 +02:00
Dmitry Jemerov
f07d4901ca Reset kind for incorrectly imported libraries
#KT-19847 Fixed
2017-08-28 10:36:25 +02:00
Alexander Udalov
cdda5d39e5 Use ResolvedCall to generate callable reference receiver
This will be helpful in supporting KT-15667
2017-08-28 10:42:05 +03:00
Alexander Udalov
c420e2bfa5 Refactor FunctionReferenceGenerationStrategy
Draw a clear distinction between the referenced function's parameters
and the anonymous synthetic function's parameters (see the comment).
This will be useful in supporting advanced callable reference features
like KT-8834
2017-08-28 10:22:52 +03:00
Nikolas Havrikov
3d8b15d9db Fixed trailing underscores in numeric literals (#1264)
This change prohibits such illegal numeric literals as 13_37_ or 0xCAFE_BABE_ (note the trailing underscore).
2017-08-26 16:07:35 +03:00
Alexander Udalov
fac207ce7c Minor, improve error message in BuiltInDecompilerConsistencyTest 2017-08-25 15:40:40 +03:00
Alexander Udalov
38849893b6 Temporarily ignore some multiplatform IDE tests 2017-08-25 15:40:39 +03:00
Alexander Udalov
b87abc9f0f Relax rules related to noinline/crossinline/reified in header/impl functions
See the comments in KT-18752 for the current resolution

 #KT-15377 Fixed
 #KT-18752 Fixed
2017-08-25 15:40:38 +03:00
Alexander Udalov
d1cff41ce0 Treat nested class of header class as header
Note that the quick fix to implement header class works incorrectly when
that class has nested classes at the moment; this should be fixed
separately

 #KT-15494 Fixed
 #KT-18573 Fixed
2017-08-25 15:40:37 +03:00
Alexander Udalov
56b507d141 Remove obsolete code from ModifiersChecker
Simplify existing code and move closer to usages
2017-08-25 15:40:37 +03:00
Alexander Udalov
3a2d93f73e Do not report "header with no impl" on incorrect header
Descriptor for a 'header' member in a non-'header' class now has
isHeader = false

 #KT-18442 Fixed
2017-08-25 15:40:36 +03:00
Alexander Udalov
6cb4916dee Refactor and simplify PlatformHeaderAnnotator 2017-08-25 15:40:35 +03:00
Alexander Udalov
59c49675b0 Improve header-impl mismatch diagnostic rendering in IDE
Use HTML instead of text to render line breaks and lists correctly
2017-08-25 15:40:34 +03:00
Alexander Udalov
3bc8ca5913 Report "declaration should be marked with impl" when possible
Also support a quick fix to add 'impl' modifier (KT-18454), although it
doesn't work yet on classes because there's no error on them in the IDE

 #KT-18087 Fixed
 #KT-18452 Fixed
 #KT-18454
2017-08-25 15:35:05 +03:00
Alexander Udalov
9ecd04f628 Improve diagnostics on header/impl classes when scopes don't match
Try to report most of the errors on the actual members of the impl
class. In many cases, there's a 1:1 mapping of header to impl class
members, so the error "some members are not implemented" on the class
declaration itself is redundant. Exceptions include functions/properties
from supertypes (there may be no other place to report a signature
mismatch error in this case), functions/properties not marked with
'impl' (the checker is only run for declarations explicitly marked with
'impl') and default constructors (the checker is not run for them)

 #KT-18447 Fixed
2017-08-25 15:35:05 +03:00
Alexander Udalov
74ba0080b1 Improve header/impl mismatch diagnostic messages
Try to report most mismatch errors on the 'impl' declaration. Only
report a mismatch error on the 'header' declaration if no error would be
otherwise reported on any 'impl' declaration in the compilation unit.
Also render declaration kind in the message

 #KT-18447 In Progress
2017-08-25 15:35:05 +03:00
Alexander Udalov
472959aca1 Improve rendering of modifiers in DescriptorRenderer
* Use bold font to render all modifiers
* Render 'external' according to the style guide, right after modality
2017-08-25 15:35:05 +03:00
Alexander Udalov
f01e0ef335 Minor, rename renderer configuration parameter 2017-08-25 15:35:04 +03:00
Stanislav Erokhin
e65a62c48c Minor. regenerate tests: kt19767_3 in JS muted. 2017-08-25 03:48:55 +03:00
Stanislav Erokhin
2ceb8cef36 [NI] Use same ResolvedCall when run completion
It is necessary, because some clients store this ResolvedCall to other
places, for example for get call it stored to INDEXED_LVALUE_GET
2017-08-25 03:38:49 +03:00
Stanislav Erokhin
98eae4e7ee [NI] Support Exact and NoInfer annotations 2017-08-25 03:38:48 +03:00
Stanislav Erokhin
d1e52e76f9 [NI] Reduced allowed depth in incorporation
We set it to 1 now, because otherwise there is examples where
incorporation work too long. We will fix such cases in the future,
but seems like 1 is also good depth delta for incorporation
2017-08-25 03:38:47 +03:00
Mikhail Zarechenskiy
f31c48017b [NI] Don't process lambda until expected type will be fixed 2017-08-25 02:47:46 +03:00
Simon Ogorodnik
ff4f928420 KT-19896: Fix force parenthesizing of multiline elvis
#KT-19896 fixed
2017-08-25 01:25:58 +03:00
xiexed
c163e71662 Spring testAmbiguousBean formatting fix (#1261) 2017-08-24 19:19:36 +03:00
Dimach
b988fb701d KT-17888 Inspection to warn about suspicious combination of == and === 2017-08-24 18:14:24 +02:00
Dmitry Jemerov
83a1d6e5ca Avoid exception from autoimport fix with misconfigured analyzer 2017-08-24 16:55:01 +02:00
Dmitry Jemerov
8cf7f7a8f3 Don't break entire highlighting if exception is thrown from one quickfix 2017-08-24 16:55:01 +02:00
Leonid Startsev
749a574234 Support for gradle subplugins in Kotlin2JS compilation
Because ServiceLoader can't check generic argument of
KotlinGradleSubplugin in runtime, we have to manually check the type in
`isApplicable`.
2017-08-24 17:26:01 +03:00
Mikhail Zarechenskiy
e666b87545 [NI] Support AllCandidates mode for features in IDE 2017-08-24 13:50:11 +03:00
Mikhail Zarechenskiy
3f8a685ace [NI] Make return type of !! operator definitely not-null 2017-08-24 13:50:11 +03:00
Mikhail Zarechenskiy
d18a14b717 [NI] Eliminate special intersection type from result type 2017-08-24 13:50:10 +03:00
Mikhail Zarechenskiy
51be629e13 [NI] Pass resulting constraint system for error candidate 2017-08-24 13:50:10 +03:00
Mikhail Zarechenskiy
6f397f8512 [NI] Drop useless isEmpty property from NewTypeSubstitutor 2017-08-24 13:50:10 +03:00
Mikhail Zarechenskiy
9f2bf066b9 [NI] Transform anonymous types of expected type for delegation 2017-08-24 13:50:09 +03:00
Mikhael Bogdanov
1a05df204e Properly check expression nullability on attempt to apply == optimizations
#Fix KT-19767
2017-08-24 09:51:55 +02:00
Dimach
f0035a7be0 KT-17379: Fix J2K removal of parentheses in multiline expressions
When there is multiline polyadic expression with some operators
J2K should keep surrounding parentheses, otherwise
operators will be dangling due resolved to prefix variant

 #KT-17379 fixed
2017-08-23 20:47:01 +03:00
Dimach
0920b2574c KT-10375, KT-19523: Fix J2K hex literal number conversion issues.
#KT-10375, #KT-19523 fixed
2017-08-23 20:19:57 +03:00
Alexander Udalov
08e090bf5e Include JDK home path into virtual file paths in CoreJrtFileSystem
The problem in KT-19833 is caused by the fact that the application
environment instance is shared between consecutive runs of the compiler
in one Make action (KotlinCoreEnvironment.ourApplicationEnvironment).
If the JDK 8 module is compiled first, the created application
environment has no JRT file system, and once the JDK 9 module is
compiled later, that environment is not recreated and thus classes from
JDK 9 are unresolved.

To mitigate this, split the CoreJrtFileSystem implementation into the
file system itself which is global per application, and CoreJrtHandler
which is bound to a particular JDK home location. CoreJrtVirtualFile
paths now consist of the path to the JDK home, the "!/" separator, and
the path to the file itself, e.g.
"/usr/lib/jvm/java9!/modules/java.base/java/lang/Object.class". The
implementation is inspired by CoreJarFileSystem & CoreJarHandler.

No tests added because the application environment is _not_ shared in
tests. Also, a JDK 9 module is going to be added to the Kotlin project
soon, and that will serve as a test

 #KT-19833 Fixed
2017-08-23 18:08:30 +03:00
Alexander Udalov
c142db15fa Rename CoreLocalPathVirtualFile -> CoreJrtVirtualFile 2017-08-23 18:08:29 +03:00
Toshiaki Kameyama
46a1c8ca12 Repeated annotation @Deprecated after J2K for method with annotation and javadoc #KT-19351 Fixed (#1251) 2017-08-23 18:05:04 +03:00
Simon Ogorodnik
91f50c99e7 Add benchmark action for highlighting 2017-08-23 17:19:36 +03:00
Pavel V. Talanov
7fecec1141 lightAnnotations: remove several brittle assertions
Add some test cases with "red" code
2017-08-23 17:12:56 +03:00
Nicolay Mitropolsky
a6b446cc4f Correct 'asJava' view of annotations as annotation arguments
Fix light elements for nested arrays/annotations inside annotations

 #KT-18378 Fixed
2017-08-23 17:12:55 +03:00
Stanislav Erokhin
6eb534fca8 [NI] Fix processParts in KotlinResolutionCandidate 2017-08-23 15:53:53 +03:00
Mikhail Zarechenskiy
c45f86a2fc [NI] Resolve function literals in block as lambda expression 2017-08-23 15:53:52 +03:00
Mikhail Zarechenskiy
08964006de [NI] Avoid type capturing for types that can contain type variables 2017-08-23 15:53:51 +03:00
Mikhail Zarechenskiy
e040a317cc [NI] Store setValue with fresh type variables before substitution 2017-08-23 15:53:50 +03:00
Mikhail Zarechenskiy
55d1130dfc [NI] Add getters to avoid inspections about useless boolean expressions 2017-08-23 15:53:49 +03:00
Mikhail Zarechenskiy
f075934697 [NI] Pass candidates with wrong visibility in debugger context
See test 'privateMembersPriority' (KT-10634)
2017-08-23 15:53:48 +03:00
Mikhail Zarechenskiy
963ab7f27f [NI] Fix KNPE, exception occurred when element is synthetic 2017-08-23 15:53:47 +03:00
Mikhail Zarechenskiy
f42be4aea2 [NI] Fix exception explicit qualified receiver and dispatch receiver 2017-08-23 15:53:46 +03:00
Stanislav Erokhin
9f71de5f66 Add test for lambda as last expression in lambda 2017-08-23 15:53:45 +03:00
Stanislav Erokhin
74e07b6580 Add regression test for no resolution recursion 2017-08-23 15:53:44 +03:00
Stanislav Erokhin
d9eef94a8e [NI] Support smartcast info in ResolvedCall on receivers 2017-08-23 15:53:43 +03:00
Stanislav Erokhin
cb1270836c [NI] Introduced ResolutionAtom's
Introduced new model for resolution result: tree of ResolvedAtoms.
Moved all postprocessing for arguments to front-end module.
Do not create freshDescriptor -- use freshTypeSubstitutor directly.
Removed Candidates for variables+invoke.
Add lazy way for argument analysis -- do not analyze all arguments
if we have subtyping error in first argument, but if we want report
all errors, then all arguments checks will be performed.

Future improvements:
  - optimize constraint system usage inside ResolutionCandidate
  - improve constraint system API
  - improve diagnostic handlers
2017-08-23 15:53:42 +03:00
Stanislav Erokhin
76012f6603 Minor. rename ConstraintSystemCompleter
In front-end we have other ConstraintSystemCompleter and because of this
in dist we have ambiguity(because there all src folders compiles inside
same module.
2017-08-23 15:53:41 +03:00
Stanislav Erokhin
e011e443cc [NI] Implement next call completer.
Type inference completer features:
  - type variables depended from result type will be fixed in the end
  - type variables with proper constraints will be fixed first
  - fixation via groups "accessible" via constraints is supported

 TODO:
  - stable order via PSI order
  - argument constraint should rewrite position if constraint is the
      same as upper bound for type parameter
2017-08-23 15:53:40 +03:00
Stanislav Erokhin
3cf240340c [NI] Extract logic about fixation order to separated component 2017-08-23 15:53:39 +03:00
Stanislav Erokhin
ff1e230828 [NI] Use right scope for callable reference resolution
Previously was used scope for top-level call. It isn't correct because
if we have callable reference inside lambda -> scope is different.
2017-08-23 15:53:38 +03:00
Stanislav Erokhin
da003d48ff Support isSuccessful in SuccessfulResultCollector
Since now SuccessfulResultCollector do not run computation of
resultingApplicability for error candidate before
getFinalCandidates(). It is very useful because we can do not run
all checks for error candidates if we have not-error candidate.
2017-08-23 15:53:37 +03:00
Stanislav Erokhin
6b8293ae5b Refactoring. Remove ResolutionCandidateStatus.
Use diagnostics directly.
Also TowerCandidate since now know only about applicability
and not about diagnostics itself.
2017-08-23 15:53:36 +03:00
Stanislav Erokhin
aca21c847d [NI] Fix resolution for callable references to nested class members 2017-08-23 15:53:35 +03:00
Stanislav Erokhin
1ae4ad1598 [NI] Do not take type advice for delegation if type is not fixed 2017-08-23 15:53:34 +03:00
Stanislav Erokhin
cdaa98fb63 [NI] Fixes after review 2017-08-23 15:53:33 +03:00
Stanislav Erokhin
2b01b91315 [NI] Refactoring: KotlinCallContext to stateless component (2) 2017-08-23 15:53:32 +03:00
Stanislav Erokhin
e88c1b4f0a [NI] Refactoring: KotlinCallContext to stateless component (1) 2017-08-23 15:53:31 +03:00
Stanislav Erokhin
9bbfac11b4 [NI] Add common supertype for PSI lambda arguments
Also move initial dataFlowInfo to lambda arguments.
As result, we can not store outer call for postpone call arguments
2017-08-23 15:53:30 +03:00
Vyacheslav Gerasimov
aedb4c0ade Android Lint: Fix constant evaluation in annotation parameter
#KT-17785 Fixed Target Versions 1.1.5
2017-08-23 13:18:56 +03:00
Vyacheslav Gerasimov
2e1edaf3d4 Uast: Fix getExpressionType for elvis expression
#KT-18997 Fixed Target Versions 1.1.5
2017-08-23 13:18:49 +03:00
Vyacheslav Gerasimov
e06cb1ec39 Android Lint: Use Uast to check for SuppressLint annotation
#KT-14800 Fixed Target versions 1.1.5
2017-08-23 13:18:42 +03:00
Vyacheslav Gerasimov
cb3a8d87d0 Android Extensions: Correctly handle namespaces in layout xml
#KT-19451 Fixed Target versions 1.1.5
2017-08-23 13:18:34 +03:00
Simon Ogorodnik
1dfa05fe49 KT-19769: Optimize PerModulePackageCacheService
#KT-19769 fixed
2017-08-22 19:37:22 +03:00
Denis Zharkov
ad9fe53ee2 Avoid local var entry for continuation parameter in suspend function
The primary reason is getting rid of redundant stack spilling, but also
it's not very sensible to have such entry since the parameter
is synthetic
2017-08-22 18:43:31 +03:00
Denis Zharkov
fcd7677a3f Fix compatibility of suspend functions with strict bytecode analyzers
In short, some of the bytecode analyzers assume that there could be
no stores instructions into parameter vars with value of different
types (even when the value type is a subtype)

See the issue for details

 #KT-19713 Fixed
2017-08-22 18:43:26 +03:00
Sergey Igushkin
d5f0607cef Add tests for java-library support. 2017-08-21 17:21:12 +03:00
Sergey Igushkin
1848bc1840 Support java-library plugin: register Kotlin output for consumers
Issue #KT-18497 Fixed
2017-08-21 17:21:03 +03:00
Vyacheslav Gerasimov
f941186f75 UAST: Properly handle annotations on local variables 2017-08-21 15:02:01 +03:00
Vyacheslav Gerasimov
c549c63100 Light Classes: Correctly handle annotations for property parameters
When getting annotations for KtLightParameter which is property parameter we should return annotations for parameter instead of property

#KT-19671 Fixed
2017-08-21 15:01:51 +03:00
Mikhael Bogdanov
1e73921200 Update changelog for 1.1.4-2 2017-08-18 18:23:10 +02:00
Pavel V. Talanov
c132f3b0d1 KT-19276: Drop exception logging on loading script definitions failure
See YT discussion
Have to come up with more meaningful diagnostics on definition loading

#KT-19276 Fixed
2017-08-18 19:11:35 +03:00
Pavel V. Talanov
6424b6760f Remove StorageComponentContainerContributor::onContainerComposed
Rename addDeclarations -> registerModuleComponents
Use it to provide SamWithReceiverResolver extensions instead

Post construction on container composition can be achieved
    but manually inserting injections where it seems appropriate
    is bug prone
This fixes a bug where SamWithReceiverPlugin extension was not registered
    for some containers in IDE which led to incorrect highlighting in IDE
Add IDE test for applying SamWithReceiver plugin

 #KT-18062 Fixed
2017-08-18 19:11:25 +03:00
Yan Zhulanow
6f180416b1 Pass SamConversionResolver explicitly cause it should be call site module-local 2017-08-18 19:11:21 +03:00
Toshiaki Kameyama
f0f6a252a5 Offer to make INVISIBLE_MEMBER protected if referenced from subclass
So #KT-19614 Fixed
2017-08-18 15:53:41 +03:00
Mikhail Glukhikh
0adf1d210f Make KtPureElement.getParent() nullable #KT-19760 Fixed
The reason is KtFile.getParent() is a containing directory which is nullable
2017-08-18 15:36:41 +03:00
Amane Nikaido
0fd5c6f1ca KT-19634: Fix <boxed_value> == <primitive_value> converted to reference equality
#KT-19634 fixed
2017-08-18 15:20:26 +03:00
Mikhail Glukhikh
9dc5354f24 Eliminate some warnings (mostly redundant is checks in whens) 2017-08-18 15:16:59 +03:00
Mikhail Glukhikh
3623f581b8 Eliminate a set of warnings, mostly nullability ones 2017-08-18 15:10:27 +03:00
Toshiaki Kameyama
82fc221470 Add "flip equals" intention for String.equals extension from stdlib
So #KT-19282 Fixed
2017-08-18 14:34:14 +03:00
Alexander Udalov
0efdcb59fa Increase -XX:ReservedCodeCacheSize for other IDEA run configurations
See 4092d754c6
2017-08-18 12:36:21 +03:00
Mikhail Glukhikh
2b90a67bc1 Minor: report "redundant override" only on 'override fun'
Related to KT-19428
2017-08-18 12:23:21 +03:00
takahirom
806aa7d4c1 Add inspection for redundant overrides that only calls the super method
So #KT-19428 Fixed
2017-08-18 12:05:02 +03:00
Mikhael Bogdanov
8af7a25f8e Update maxStack on synthetic instruction insertion
#KT-19723 Fixed
2017-08-17 20:02:29 +02:00
Dmitry Jemerov
39599fc7c9 Don't detect library kind for pure JVM projects
Also require .kjsm to detect JS libraries; don't detect jars containing
only .js files as JS libraries

 #KT-19717 Fixed
2017-08-17 16:55:50 +02:00
Dmitry Jemerov
99a402ee30 Correctly show quick doc for lookup elements that only have descriptors
#KT-19716 Fixed
2017-08-17 16:53:54 +02:00
Alexander Udalov
4d2fbf1801 Fix reflection for local delegated properties inside interface
#KT-19690
2017-08-17 15:35:11 +02:00
Mikhael Bogdanov
97d46e76f5 Use 'DefaultImpls' as owner for interface local delegated properties
#KT-19690 Fixed
2017-08-17 15:35:10 +02:00
Toshiaki Kameyama
905b8cc4e9 long == <int_literal> in Java converted to red code in Kotlin #KT-19393 Fixed 2017-08-17 16:01:48 +03:00
Mikhael Bogdanov
79ecc7fd5c Don't recognize nullable function types as inlinable
#KT-19679 Fixed
2017-08-17 14:24:00 +02:00
Nicolay Mitropolsky
1b2e28d467 SpringKotlinAutowiringInspection: workaround for nameless property (EA-104960) 2017-08-17 14:31:24 +03:00
Nicolay Mitropolsky
f7a1c71b54 Ultimate tests repair: SpringInspectionTestGenerated.testAutowiring_inspectionData_Inspections_test (KT-18847) 2017-08-17 14:31:24 +03:00
Alexander Udalov
770441c212 Merge "diagnostic with Java 8" tests with general diagnostic tests 2017-08-17 13:15:18 +03:00
Alexander Udalov
8db736e2b4 Support FULL_JDK directive in diagnostic tests 2017-08-17 12:35:56 +03:00
Alexander Udalov
7601666ec0 Minor, remove unused AbstractDiagnosticsWithFullJdkTest 2017-08-17 12:35:55 +03:00
André Oriani
a24c9a987f Improve Boolean infix functions' documentation (#1249) 2017-08-17 11:53:39 +03:00
Toshiaki Kameyama
be664e26f7 KT-18232: Kotlin code converter misses annotations
#KT-18232 Fixed
2017-08-17 02:30:06 +03:00
Dmitry Jemerov
4092d754c6 Increase -XX:ReservedCodeCacheSize to avoid warning in debug IDEA 2017-08-16 17:44:44 +02:00
xiexed
12eb4ef37a KotlinUastLanguagePlugin#convertElementWithParent NPE fix when parent is null (#1247) 2017-08-16 17:47:40 +03:00
Dmitry Jemerov
a2a018eadb Pluggable platforms in IDE plugin 2017-08-16 15:51:41 +02:00
Dmitry Jemerov
f7c17d6a64 Naming convention inspections 2017-08-16 15:45:33 +02:00
Anton Bannykh
6a5d8dcc82 JS: reduce HashMap memory footprint 2017-08-16 13:23:36 +03:00
Anton Bannykh
070e35bc15 JS: removed app-module-path dependency from integration tests 2017-08-16 13:21:46 +03:00
Anton Bannykh
a641838368 JS: clean up the unit test intergartion tests build file 2017-08-16 13:21:46 +03:00
Anton Bannykh
226ffb6c7e JS: write integration test outputs to a file to prevent polluting the log with expected test failures 2017-08-16 13:21:46 +03:00
xiexed
6a4ea8b669 toUElement() made work with KtAnnotationEntry (#1240)
* `KotlinUastLanguagePlugin#convertElement` made work with `KtAnnotationEntry`

* `KotlinUastLanguagePlugin#convertElementWithParent` searches for parent `KotlinUNamedExpression`
2017-08-16 13:01:37 +03:00
Mikhail Glukhikh
a12877e51c Add feature support for "smart casts on variables in closures"
So #KT-14486 Fixed
2017-08-16 12:34:04 +03:00
Mikhail Glukhikh
a086863561 Preliminary: support smart casts on variables in closures
No feature support yet
So #KT-14486 In Progress
2017-08-16 12:33:52 +03:00
Mikhail Glukhikh
b2d931fb1f Support smart casts after if (nullable ?: boolean) #KT-8492 Fixed 2017-08-16 12:33:35 +03:00
Mikhail Glukhikh
9be5cf89b4 Minor fix to ensure correct compilation in 1.2
Related to KT-4565
2017-08-16 12:33:23 +03:00
Mikhail Glukhikh
80b6aaa802 Support smart casts to Type after x as? Type null check #KT-4565 Fixed 2017-08-16 12:33:12 +03:00
Dmitry Jemerov
5bd04a6d22 Fix ultimate tests: add idea-gradle to main project classpath 2017-08-16 11:01:12 +02:00
Alexey Sedunov
787bbe9a4c Safe Delete: Support header/impl declarations
#KT-18433 Fixed
2017-08-15 19:08:29 +03:00
Alexey Sedunov
1215b2864b Safe Delete: Use actual usage PSI in UsageInfo instead of declaration
#KT-19161 Fixed
2017-08-15 19:08:28 +03:00
Alexey Sedunov
2f556e1bea Refactorings: Support header/impl functions in member hierarchy transformations
#KT-18904 Fixed
 #KT-18905 Fixed
2017-08-15 19:08:28 +03:00
Alexey Sedunov
537c1fd063 Convert Function Type Parameter to Receiver: Drop redundant arrows 2017-08-15 19:08:28 +03:00
Alexey Sedunov
f80fcc7146 Parameter <-> Receiver Conversion: Support header/impl declarations
#KT-18907 Fixed
2017-08-15 19:08:27 +03:00
Alexey Sedunov
d3a9d122e6 Add 'operator' Intention: Support header/impl functions
#KT-18851 Fixed
2017-08-15 19:08:27 +03:00
Alexey Sedunov
cd5c382179 Convert member to extension: Support members of header/impl classes
#KT-18883 Fixed
2017-08-15 19:08:27 +03:00
Alexey Sedunov
4dbde03c3b Rename: Support parameters of header/impl functions
#KT-18393 Fixed
2017-08-15 19:08:27 +03:00
Alexey Sedunov
f5c7db8270 Change Signature: Support constructors of header/impl classes 2017-08-15 19:08:26 +03:00
Alexey Sedunov
7f9110b4e6 Change Signature: Fix exception on applying to impl declaration 2017-08-15 19:08:26 +03:00
Alexey Sedunov
0b44386800 Change Signature: Fix NPE on rendering empty parameter names 2017-08-15 19:08:26 +03:00
Alexey Sedunov
8439e15c6e Change Signature: Support members of header/impl classes 2017-08-15 19:08:26 +03:00
Alexey Sedunov
e4f70a3568 Rename: Support members of header/impl classes
#KT-18885 Fixed
 #KT-18898 Fixed
 #KT-18899 Fixed
2017-08-15 19:08:26 +03:00
Alexey Sedunov
62ca3bab31 Move: Do not skip usages of declarations without light elements
#KT-18873 Fixed
2017-08-15 19:08:25 +03:00
Alexey Sedunov
f455f06a9e Change Signature: Fix replacement of implicit Unit return type 2017-08-15 19:08:25 +03:00
Alexey Sedunov
386b1fc002 Line Marking: Fix search of overriding methods in platform modules
#KT-19212 Fixed
2017-08-15 19:08:25 +03:00
Alexey Sedunov
98eb990f30 Line Marking: Place header/impl markers after override/inheritance
#KT-19074 Fixed
2017-08-15 19:08:25 +03:00
Dmitry Jemerov
e3963fccf4 Move Gradle-related classes to idea-gradle module 2017-08-15 16:51:42 +02:00
Yan Zhulanow
57d209f599 Kapt: Do not use awkward ('$' -> '/') logic for KAPT3 class builder mode
So (for the most often reproduction case) #KT-19433 Fixed

Before this commit, internal names for nested classes were written as test/Foo/Bar (comparing to test/Foo$Bar in the normal mode), as getting qualified names from such internal names was trivial. But, because of IC, we needed to write class files to the disk, so our decompiler could find such "broken" classes and read it in a wrong way.
2017-08-15 17:48:51 +03:00
Dmitry Jemerov
e5e5b56af0 Add test for parameter hints on invoke() 2017-08-15 16:37:32 +02:00
Dmitry Jemerov
04464024fe Don't try to resolve call if we won't show any hints anyway 2017-08-15 16:37:21 +02:00
Zalim Bashorov
9bb7ed5e02 Use proper property name to get a tag to publish.
Also:
* remove obsolete kotlin.compiler.* properties
* move --tag argument to proper place (from npm to publish-to-npm)
2017-08-15 17:20:42 +03:00
Dmitry Jemerov
34681b1459 Before searching for descriptor of method, check if it can be property 2017-08-15 11:41:25 +02:00
Dmitry Jemerov
1fe3f84071 Don't search twice for the same declaration 2017-08-15 11:39:40 +02:00
Mikhail Glukhikh
5b72159967 Fix of EA-103829 (do not try to get module info for disposed module) 2017-08-15 11:16:31 +03:00
e5l
e315249624 Add tests on jsr305 annotations warnings 2017-08-15 11:01:08 +03:00
e5l
5501cdf049 Add warnings for jsr305 nullable annotations
#KT-19115 Fixed
2017-08-15 11:01:08 +03:00
e5l
746de612ad Move Jsr305State to util.runtime 2017-08-15 11:01:08 +03:00
e5l
5fd8f93b0e Fix a typo: Defaul -> Default 2017-08-15 11:01:08 +03:00
Sergey Igushkin
71bf649b1e Fix compilation error in AbstractLookupTrackerTest.kt 2017-08-14 19:27:50 +03:00
Sergey Igushkin
bf98e26bc2 Fix nullable javaPackagePrefix used as @Input, resulting in build failure 2017-08-14 18:59:17 +03:00
Mikhail Glukhikh
718ee01a48 Fix of EA-105681 in KotlinProximityStatistician 2017-08-14 17:39:44 +03:00
Mikhail Glukhikh
830b543879 Fix of EA-105681 in KotlinRunLineMarkerContributor 2017-08-14 17:37:05 +03:00
Mikhail Glukhikh
165707c46c Fix of EA-101845 in referenceProviders.kt 2017-08-14 17:36:18 +03:00
Mikhail Glukhikh
88bc74551b Fix of EA-91690 (NPE in OverloadReducer via flexible types) 2017-08-14 17:14:03 +03:00
Sergey Igushkin
7986250dbe Add a test for javaPackagePrefix 2017-08-14 16:13:48 +03:00
Sergey Igushkin
192d569e54 Support Java package prefix in Gradle plugin
Issue #KT-17150 Fixed
2017-08-14 16:13:13 +03:00
Vyacheslav Gerasimov
4cf2bf6ca5 UAST: Implement getFunctionalInterfaceType for KotlinULambdaExpression 2017-08-14 15:41:40 +03:00
Sergey Igushkin
3d6622ae1b Fix ExecutionStrategyJsIT failing due to platform-dependent fileTreeWalk 2017-08-14 15:05:55 +03:00
Alexey Tsvetkov
0226d15d29 Normalize paths in AbstractLookupTrackerTest
Otherwise the tests are failing on Windows
2017-08-11 20:51:06 +03:00
Sergey Igushkin
cd40968b72 Fix tests failing due to dev builds bundled into Gradle. Push AGP to beta. 2017-08-11 20:22:41 +03:00
Sergey Igushkin
6cd409d379 Fix tests assuming '_main' in default module names 2017-08-11 19:56:20 +03:00
Sergey Igushkin
80131d8359 Fix generate stubs task not being assigned a source set name 2017-08-11 13:38:22 +03:00
Nikolay Krasko
4b2b5dec75 Download asm-all sources for idea 172 2017-08-11 12:17:39 +03:00
Nikolay Krasko
f8de17b039 Remove guava usage from KotlinCodegenFacade - fix maven build 2017-08-11 12:17:39 +03:00
Dmitry Petrov
a8c82b64a1 Do not check bounds in type alias expansion if checkBounds is false
This happens when we resolve bounds for type parameters, causing wrong
UPPER_BOUND_VIOLATED to be reported on type parameter whose bounds were
not resolved yet.

 #KT-19601 Fixed Target versions 1.1.5
2017-08-11 11:29:59 +03:00
Denis Zharkov
ce37ab81ba Fix types enhancement for properties' getters overrides in Java
Prior to the 1.1.4, nullability related annotations were stored
in types that became hard to maintain at some moment and
we got rid of it (see 57b7b91444)

But enhancement for properties overrides stopped working
because there were effectively no annotations in the
resulting descriptor

 #KT-19409 Fixed

 #KT-19409 Fixed
2017-08-11 10:19:55 +07:00
Denis Zharkov
9962fc88ca Minor. Move type qualifiers computation to their first usage 2017-08-11 10:19:55 +07:00
Denis Zharkov
8898455352 Add tests on foreign annotations without them in classpath
#KT-19419 Fixed
2017-08-11 10:18:41 +07:00
Denis Zharkov
8948023a26 Add built-in support for ParametersAre(Non)nullByDefault annotation
#KT-19419 In Progress
2017-08-11 10:18:41 +07:00
Denis Zharkov
964f60d0a4 Resolve qualifier nicknames to default annotations without JSR305 jar
#KT-19419 In Progress
2017-08-11 10:18:41 +07:00
Denis Zharkov
f8f0c0b6d7 Load enum/array annotation arguments for not found classes
It's necessary to load type qualifier related annotations
without JSR305 annotations being in the classpath

 #KT-19419 In Progress
2017-08-11 10:18:41 +07:00
Denis Zharkov
a82e313d14 Minor. Fix wrong target in test data for foreign annotations 2017-08-11 10:18:41 +07:00
Nikolay Krasko
6d66fb35d6 Fix AbstractGenerateSpringDependencyActionTest.kt in branch 172 2017-08-10 22:05:49 +03:00
Nikolay Krasko
10bf49118a Update spring test data for 172 idea 2017-08-10 22:05:49 +03:00
Nikolay Krasko
46bbf55acd Special value for class literal expression
Starting from Idea 172 evaluator gives non-null value for class literal
expression. Probably behaviour was changed in

65ddb4c454
2017-08-10 22:05:49 +03:00
Nikolay Krasko
eeede71d9d Drop usage of deprecated ProjectDataManager in branch 172 2017-08-10 22:05:49 +03:00
Nikolay Krasko
2cf4da8564 Fix test behaviour in branch 172 2017-08-10 22:05:49 +03:00
Nikolay Krasko
d8c20ed9c0 Fix debugger test in 172 (KT-18848)
#KT-18848 Fixed
2017-08-10 22:05:49 +03:00
Nikolay Krasko
0d6cf19896 Don't pack jps services into compiler 2017-08-10 22:05:49 +03:00
Nikolay Krasko
c2b54c3e8a Ignore absent net.jpountz.lz4.LZ4Factory in proguard 2017-08-10 22:05:48 +03:00
Vyacheslav Gerasimov
bb7521a142 Build against UAST bundled in IDEA 2017-08-10 22:05:48 +03:00
Alexey Tsvetkov
99439620d4 JPS: completely skip chunk containing only dummy targets
Such chunks were added in intellij-community, see
commit fdeae7754c593e78b6748dfa66ce7198c2780d35
(fdeae7754c)
2017-08-10 22:05:48 +03:00
Mikhael Bogdanov
2954c41848 Fix 'isProjectOrWorkspaceFile' import 2017-08-10 22:05:48 +03:00
xiexed
f94569c995 KotlinCommonIntentionActionsFactory is able to remove constructors parameters (EA-104621) (#1187) 2017-08-10 22:05:48 +03:00
Mikhael Bogdanov
4e868c5232 Update AndroidProjectKey package 2017-08-10 22:05:48 +03:00
Nicolay Mitropolsky
62dc3c8da4 A check for AbstractSpringClassAnnotatorTest that ultimate plugin is properly set up 2017-08-10 22:05:48 +03:00
Nicolay Mitropolsky
384ae8d8b5 Ultimate tests repair (KT-18847)
Repaired all except:
GenerateSpringDependencyActionTestGenerated.testAutowiredDependencies_MultiplePropertiesAnnotationConfig - Not a Kotlin issue
SpringClassAnnotatorTestGenerated.testAutowiredBeanCandidates_AutowiredBeanCandidates - Bug with multiple light objects for same PSI element
SpringInspectionTestGenerated.testAutowiring_inspectionData_Inspections_test - Not a Kotlin issue (presumably IDEA-175971)
SpringQuickFixTestGenerated$AddQualifierAnnotation.testAmbiguousBean - Not a Kotlin issue (IDEA-175971)
2017-08-10 22:05:48 +03:00
Nicolay Mitropolsky
532560ef43 Spring dependency-generations actions: runWriteAction moved to the proper place (KT-18385) 2017-08-10 22:05:48 +03:00
Nicolay Mitropolsky
ca19ea8205 KotlinSpringClassAnnotator ignores duplicate gutter handlers (IDEA-173995, KT-18298) 2017-08-10 22:05:47 +03:00
Nicolay Mitropolsky
ce77751349 Spring Constructor Injection falling test 2017-08-10 22:05:47 +03:00
Nicolay Mitropolsky
6ae247ba61 "Final Kotlin class or function with Spring annotation" inspection deprecation and disabling by default (KT-18506) 2017-08-10 22:05:47 +03:00
Ilya Gorbunov
13349086ac Pass required Project parameter to constructor of NullableNotNullManager 2017-08-10 22:05:47 +03:00
xiexed
a36cbad7cd KotlinCommonIntentionActionsFactory extensions for IDEA-85507 and KT-11906 (#1093)
* `KotlinCommonModifications` renamed to `KotlinCommonIntentionActionsFactory`

* IDEA-85507: KotlinCommonIntentionActionsFactory#createAddMethodAction implementation

* KT-11906 `KotlinCommonIntentionActionsFactory#createAddBeanPropertyActions` implementation

* `KotlinCommonIntentionActionsFactory#createAddMethodAction` now uses a `CallableBuilder` for making a function

* `KotlinCommonIntentionActionsFactory#createAddBeanPropertyActions` privides a "TODO" initializer and also suggests a `lateinit` property

* KT-11980 `KotlinCommonIntentionActionsFactory#createAddConstructorActions` implementation

* `KotlinCommonIntentionActionsFactory` upgraded to new `JvmCommonIntentionActionsFactory`-api

* KT-11980 `KotlinCommonIntentionActionsFactory` is able to change primary constructors

* `JvmCommonIntentionActionsFactory` api update
2017-08-10 22:05:47 +03:00
Mikhail Glukhikh
4a15870e59 Make 172 plugin applicable for IDEA 173 2017-08-10 22:05:47 +03:00
Alexey Andreev
e56f9f6040 Fix compilation for IDEA 172 2017-08-10 22:05:47 +03:00
Mikhail Glukhikh
85ecde6ec9 Correct 172 plugin 'since' field (no more compatible with 171) 2017-08-10 22:05:47 +03:00
Alexey Andreev
4d72f0ef66 Add missing implementation of abstract method to MockPsiManager 2017-08-10 22:05:47 +03:00
Alexey Andreev
11086192bc Fix test compilation errors 2017-08-10 22:05:46 +03:00
Ilya Gorbunov
08673bfb0c Fixup for "JvmCommonIntentionActionsFactory in Kotlin"
'forLanguage' now returns explicitly nullable type.
2017-08-10 22:05:46 +03:00
Nicolay Mitropolsky
0694f2d0c5 JvmCommonIntentionActionsFactory in Kotlin 2017-08-10 22:05:46 +03:00
Dmitry Jemerov
548e86285c Fix 'ant dist' build against 172 branch 2017-08-10 22:05:46 +03:00
Dmitry Jemerov
20d0d49cc3 Advance Guava version 2017-08-10 22:05:46 +03:00
Dmitry Jemerov
48d4f5f5c2 Compilation fixes for 172 branch 2017-08-10 22:05:46 +03:00
Vyacheslav Gerasimov
c1cfd70ae7 Fix tests compilation 2017-08-10 22:05:46 +03:00
Vyacheslav Gerasimov
b825a8db43 Fix compilation AndroidResourceReferenceAnnotator 2017-08-10 22:05:46 +03:00
Vyacheslav Gerasimov
23e606d179 Fix compilation MockUpdateParameterInfoContext 2017-08-10 22:05:46 +03:00
Vyacheslav Gerasimov
cf4d0fb977 Fix guava version 2017-08-10 22:05:45 +03:00
Vyacheslav Gerasimov
83a8395287 Fix compilation AbstractKotlinEvaluateExpressionTest 2017-08-10 22:05:45 +03:00
Dmitry Jemerov
282da4cab5 Move Kotlin UAST registration to main plugin.xml
The UAST needs to be available also when the Android plugin is disabled.
2017-08-10 22:05:45 +03:00
Vyacheslav Gerasimov
298d29a962 Android Extensions: Allow to disable IDE support (KT-12741) 2017-08-10 22:05:45 +03:00
Dmitry Jemerov
62e583903e Fix compilation gotoResourceHelper, KotlinAndroidTestCase 2017-08-10 22:05:45 +03:00
Mikhail Glukhikh
c675824c0a Fix compilation PlatformAndroidGradleDetector 2017-08-10 22:05:45 +03:00
Yan Zhulanow
6336c4ee98 Fix compilation androidUtil, MyReferredResourceFieldInfo requires module 2017-08-10 22:05:45 +03:00
Dmitry Jemerov
be1022db2b Fix compilation NewKotlinActivityAction, gradle sync classes moved 2017-08-10 22:05:45 +03:00
Yan Zhulanow
a142c2f8fa Fix compilation IntelliJLintClient, IntelliJLintProject, IDEAndroidLayoutXmlFileManager 2017-08-10 22:05:45 +03:00
Vyacheslav Gerasimov
c07096c9d7 Fix compilation AbstractParameterInfoTest 2017-08-10 22:05:45 +03:00
Vyacheslav Gerasimov
768305adc8 Fix compilation KotlinModuleBuilder 2017-08-10 22:05:44 +03:00
Vyacheslav Gerasimov
e8d2782089 Bump guava to 21.0 in update_dependencies.xml 2017-08-10 22:05:44 +03:00
Dmitry Jemerov
b50d5fb998 Download IDEA from 172 branch 2017-08-10 22:05:44 +03:00
Dmitry Jemerov
7fffb7b553 Remove UAST services registration from Kotlin plugin 2017-08-10 22:05:44 +03:00
Sergey Igushkin
b938206234 Add @Input to moduleName, to incorporate it into the up-to-date checks 2017-08-10 21:23:07 +03:00
Sergey Igushkin
84e1e9f8aa Change default module name from project.name to archivesBaseName;
Get rid of `_main` for the main module.

Issue #KT-17355 Fixed
2017-08-10 21:23:07 +03:00
Alexey Tsvetkov
239943867b Add JS specific proto comparison test 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
0d3b882852 Add proto comparison tests where members annotations are changed 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
6354d9d54f Treat SEALED_SUBCLASS_FQ_NAME_LIST change as a class signature change
#KT-19580
2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
856276328e Treat JS class annotation list change as class signature change 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
e0ef08cf18 Add raw ProtoCompareGenerated output to proto comparison test data 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
642c5414a3 Minor: rename js.result.out->result-js.out
This way result.out and result-js.out are closer in
a list of files (e.g. in Intellij project view).
2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
46a3a59b81 Fix missing lookups from deserialized JS descriptors 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
7e7fcd352c Compare lookups after comparing build logs
This way tests are more informative when
compilation goes wrong.
2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
82c977f2d2 Add JS lookup tracker tests 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
6cfd090b20 Extract JVM lookup tracker tests 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
e2190ea956 Use lookup tracker in JS compiler 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
f3f7ca4b95 Show in lookup tracker log if there is no lookups in file 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
ab90221a93 Minor: reformat AbstractLookupTrackerTest#runCompiler 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
485e2345a9 Decouple lookup tracker tests from JPS 2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
bb2fab5b5d Extract LookupTracker service from IncrementalCompilationComponents
We don't need a `TargetId` to `IncrementalCache` mapping in JS
2017-08-10 21:19:42 +03:00
Alexey Tsvetkov
a4c7dbd693 Remove .touch actions for lookup test cases that fail to compile
It is useless to touch and recompile, because the first compilation
has failed anyway
2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
61b3c1c429 Do not print NONE changes in proto tests
otherwise MainKt: NONE is added in all js tests
2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
c601890151 Fix comparing repeated proto extensions
Previously ProtoCompareGenerated could
go out of bounds when comparing protos
with different number of annotations.

That happend because JsProtoBuf.parameterAnnotation
is a repeated extension, but the generated code for
comparing repeated extensions was incorrect.

JvmProtoBuf does not have repeated extensions (at least for
the class and package descriptors),
so the problem was not detected before.
2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
1cce1ef1f6 Isolate JS compiler in proto tests
Proto tests are still in the 'jps-tests' module
which is included in non-compiler tests.

It is not safe to call the compiler
directly in non-compiler tests
because it might affect IDE tests.
2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
ed5b6e07aa Implement JS proto comparison 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
23afaeec2f Extract TestMessageCollector 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
f5e77c740d Introduce services to pass data between IC and JS compiler 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
8ffd141d17 Minor tweak to proto test data format 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
1921950a1b Extract JVM specific proto comparison test 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
cc24b9f4ad Always print class id in proto comparison test
A name of class file was used for added and removed classes
before the change.
The change is required for reusing the test data in js proto comparison
tests (there is no classfiles in js, so it is hard to
emulate jvm classfiles names for inner/nested classes).
2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
5dd4e4cdd4 Move JVM specific proto comparison tests to separate dir 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
9ab7c92b4b Convert SimpleOutputItem: step 2 2017-08-10 21:19:41 +03:00
Alexey Tsvetkov
8fbab94c5c Convert SimpleOutputItem: step 1 2017-08-10 21:19:41 +03:00
Mikhael Bogdanov
6ca06265cf Rename and disable test on JS 2017-08-10 16:16:28 +02:00
Nikolay Krasko
a41e5fff6b Regenerate ultimate tests - update copyright 2017-08-10 15:58:15 +03:00
Dmitry Petrov
674d30cd76 Report deprecation on typealias companion object for deprecated alias 2017-08-10 15:45:44 +03:00
Dmitry Petrov
c180de563f Support DslMarker on type aliases 2017-08-10 15:45:44 +03:00
Nikolay Krasko
223acbcfeb Clear static application in GenericReplTest 2017-08-10 15:43:54 +03:00
Nikolay Krasko
e35b262827 Clear application in CompilerApiTest 2017-08-10 15:43:54 +03:00
Nikolay Krasko
4e190248cd Add resetApplicationToNull utility with old application 2017-08-10 15:43:54 +03:00
Mikhael Bogdanov
3fd6dd3572 Add test for quoted class name 2017-08-10 12:10:25 +02:00
Dmitry Jemerov
022430cb59 Set correct library kind for transitive dependencies 2017-08-10 11:43:35 +02:00
Mikhail Zarechenskiy
974dad571c [NI] Report errors about inapplicable wrong receiver
Now it's possible because we don't commit trace with inapplicable `provideDelegate` operator (20e105c274)
2017-08-09 17:37:44 +03:00
Vyacheslav Gerasimov
2ac7b6a534 UAST: Fix DeclarationDescriptor.toSource return first found source element
instead of null, when multiple descriptors found

 #KT-18837 Fixed
2017-08-09 15:34:41 +03:00
Vyacheslav Gerasimov
915f47133b UAST: Fix KotlinUMethod annotation handling, properly handle use site targets
#KT-16834 Fixed
 #KT-18893 Fixed
2017-08-09 15:34:34 +03:00
Vyacheslav Gerasimov
f24488915a UAST: Log error when failed to create light class for UObjectLiteralExpression 2017-08-09 15:34:27 +03:00
Vyacheslav Gerasimov
adfc481c7a Add ProjectImportProvider for *.gradle.kts file to import it as module
#KT-19466 Fixed
2017-08-09 15:34:19 +03:00
Vyacheslav Gerasimov
4405021f85 Add ProjectOpenProcessor for *.gradle.kts file to open it as project
#KT-19024 Fixed
2017-08-09 15:34:11 +03:00
Dmitry Jemerov
73a4da6c56 Cache list of dependent modules in modification tracker 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
a7bbf3d1f8 Don't increase OOCB count when a REPL line is modified 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
3415853cac Add ModuleDescriptor.assertValid() for ensuring consistency 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
ac96c31a7d Retrieve module descriptors for implementing modules on demand 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
0b45d25bb1 Fix compilation after rebase 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
bdbe134b60 Recreate module descriptors for affected modules only on a change 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
07794c8188 On-demand creation of ModuleDescriptors 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
dde1f4b8f3 Fix OOCB updates for code fragments 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
36cabf1bfc Move entire logic for ModuleDescriptor setup into ResolverForProjectImpl 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
d6a9a49968 Disable tracking of Kotlin files by Java OOCB listener 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
aafe7e6f1b Refactoring: move createResolverForModule() into ResolverForProjectImpl 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
fcc067435e Refactoring: streamline module resolver setup code 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
194deccd09 Remove one level of indirection from ModuleResolverProvider creation 2017-08-09 13:26:09 +02:00
Dmitry Jemerov
3debca09ea Remove callback hell from LazyModuleDependencies 2017-08-09 13:26:09 +02:00
Mikhail Zarechenskiy
cfbc559a97 [NI] Propagate tracking binding trace into context 2017-08-09 14:01:04 +03:00
Mikhail Zarechenskiy
4a74ca568c [NI] Don't forget to deparenthesize expression before type checking 2017-08-09 14:01:00 +03:00
Mikhail Zarechenskiy
053b02e0df [NI] Fold { Lower | Upper } & Equality constraints if it's possible 2017-08-09 14:00:53 +03:00
Mikhail Zarechenskiy
20e105c274 Don't commit trace with inapplicable provideDelegate operator
This helps in NI as there we have different logic for delegates inference
2017-08-09 13:50:50 +03:00
Mikhael Bogdanov
82c3637d91 Wide visibility in ir common stuff 2017-08-09 12:07:38 +02:00
Mikhail Zarechenskiy
46d0ea3eed Use operation reference as lookup element to preserve old behaviour
See related changes in fb72726f08
2017-08-09 00:59:12 +03:00
Alexey Sedunov
cf3615d279 Kotlin Facet: Fix element ordering in compiler arguments XML
Do not rely on method list as it's ordered differently
2017-08-09 00:03:28 +03:00
Valentin Kipyatkov
e52c3b4c81 Rewritten KDoc-link resolve and completion to work more reasonably 2017-08-08 22:06:04 +03:00
Valentin Kipyatkov
998814b1a1 Support for import aliases in both resolve and completion in KDoc 2017-08-08 22:06:04 +03:00
Valentin Kipyatkov
9361cd895c Support for import aliases in code completion
#KT-8848 Fixed
2017-08-08 22:06:04 +03:00
Mikhail Zarechenskiy
48246e5f34 [NI] Add resolution part to check for abstract super call 2017-08-08 15:44:31 +03:00
Mikhail Zarechenskiy
b6e195128c [NI] Resolution diagnostics don't produce errors as is 2017-08-08 15:44:30 +03:00
Mikhail Zarechenskiy
5486f4e612 [NI] Don't report NI error for recorded info about smartcasts 2017-08-08 15:44:28 +03:00
Mikhail Zarechenskiy
64b722d4f6 Minor, reduce nesting 2017-08-08 15:44:20 +03:00
Nikolay Krasko
9c37d0a007 Disable building dependencies caches in configure GSK tests 2017-08-08 15:26:16 +03:00
Nikolay Krasko
60e330b6f3 Update configure tests after binding comments and spaces to script body 2017-08-08 15:26:16 +03:00
Denis Zharkov
ff0736f09e Fix exception after combination of while (true) + stack-spilling
FixStack transformation divides on phases:
- Fixing stack before break/continue
- Fixing stack for inline markers/try-catch blocks

After the first stage all ALWAYS_TRUE markers are replaced
with simple GOTO's and if we're skipping break/continue edges
we won't reach the code after while (true) statement.

At the same time it's fine to not to skip them in the second phase
as the stack for them is already corrected in the first phase

 #KT-19475 Fixed
2017-08-08 18:52:21 +07:00
Denis Zharkov
45d5f6a950 Add test for obsolete issue
#KT-19467 Obsolete
2017-08-08 18:52:21 +07:00
Mikhael Bogdanov
3ae084b1b3 Get rid of reification from 'deepCopyWithVariables' 2017-08-08 13:33:20 +02:00
Mikhael Bogdanov
49612063dc Wide visibility in ir common stuff 2017-08-08 13:25:49 +02:00
Mikhael Bogdanov
07c5702861 Add missed 'version' in core modules facets 2017-08-08 13:09:48 +02:00
Mikhael Bogdanov
6e4b02a94b Disable 'areEqualByValue' 2017-08-08 13:09:48 +02:00
Mikhael Bogdanov
6305abdf9f Wide visibility in ir common stuff 2017-08-08 13:09:47 +02:00
Valentin Kipyatkov
ca418c727e KT-19278 Optimize imports on the fly should not remove incomplete import while it's being typed
#KT-19278 Fixed
2017-08-08 12:27:16 +03:00
Valentin Kipyatkov
8a17e6c1c9 WIP 2017-08-08 12:27:15 +03:00
Valentin Kipyatkov
e53b1a1e92 KT-19277 Optimize imports on the fly should not work in test data files
#KT-19277 Fixed
2017-08-08 12:27:15 +03:00
Mikhail Glukhikh
5904b7f257 Remove ModalityState.any() from J2kPostProcessor #KT-19453 Fixed 2017-08-08 11:33:32 +03:00
Mikhael Bogdanov
15f401a473 Copy annotation and attributes on class transformation during inline 2017-08-08 09:50:42 +02:00
Mikhael Bogdanov
11ba805181 Convert MethodBodyVisitor to Kotlin 2017-08-08 09:50:41 +02:00
Mikhael Bogdanov
5ecdf2af9e Rename MethodBodyVisitor.java to MethodBodyVisitor.kt 2017-08-08 09:50:41 +02:00
Mikhael Bogdanov
fca1500d48 Clean code 2017-08-08 09:50:40 +02:00
Mikhail Zarechenskiy
e2dcf47b3b Fix highlighting range of diagnostic in test data
Because of ae3497c6ce
2017-08-08 00:29:18 +03:00
Sergey Igushkin
52f923c5ff Fix internals of an android-library not accessible in its androidTest
Issue #KT-19370 Fixed
2017-08-07 20:33:18 +03:00
Mikhail Zarechenskiy
ae3497c6ce Reduce highlighting range for UNCHECKED_CAST
#KT-18985 Fixed
2017-08-07 18:49:58 +03:00
Mikhail Zarechenskiy
8f8143d3ed Fix IAE for wrong use-site @file annotation
#EA-100189 Fixed
2017-08-07 18:49:57 +03:00
Mikhail Zarechenskiy
4d4c39939f Report full package FQ name in compilation errors related to visibility
#KT-18966 Fixed
2017-08-07 18:49:55 +03:00
Mikhail Zarechenskiy
216ab1c6d1 Fix error message for inapplicable operator on getValue function
#KT-11739 Fixed
2017-08-07 18:49:52 +03:00
Mikhail Zarechenskiy
7ba073206d Add test for obsolete issue about SAMs
#KT-11951 Obsolete
2017-08-07 18:36:07 +03:00
Mikhail Zarechenskiy
7693f64dee [NI] Take into account safe call when updating recorded type 2017-08-07 18:01:21 +03:00
Mikhail Zarechenskiy
9e018fa094 [NI] Try to analyze each lambda at least once 2017-08-07 18:01:20 +03:00
Mikhail Zarechenskiy
07a4496054 [NI] Resolve lambda even if there is contradiction in CS
To avoid exceptions about non-recorded lambda
2017-08-07 18:01:19 +03:00
Mikhail Zarechenskiy
a13442b12b [NI] Fix data flow for arguments in special calls 2017-08-07 18:01:18 +03:00
Mikhail Zarechenskiy
dc83e5ca3a Fix test which is correctly work in old inference 2017-08-07 18:01:17 +03:00
Mikhail Zarechenskiy
3fb865e07c Move test for NI to diagnostic tests and add "todo" 2017-08-07 18:01:16 +03:00
Mikhail Zarechenskiy
fb72726f08 Resolve right part of equality with given descriptors 2017-08-07 18:01:15 +03:00
Stanislav Erokhin
6680f01cfe [NI] Fix assertion error at FlexibleTypeImpl
Use KotlinTypeFactory for FlexibleType creation
2017-08-07 18:01:14 +03:00
Mikhail Zarechenskiy
e7cd615450 [NI] Introduce type depth in CS calculator to avoid SOE 2017-08-07 18:01:13 +03:00
Mikhail Zarechenskiy
cf75afba66 [NI] Fix type intersection for equal types 2017-08-07 18:01:12 +03:00
Mikhail Zarechenskiy
ac507e721c [NI] Do not add non-dynamic candidates when there is dynamic extension 2017-08-07 18:01:11 +03:00
Mikhail Zarechenskiy
21c5187c9e [NI] Handle dynamic types in type intersector 2017-08-07 18:01:10 +03:00
Mikhail Zarechenskiy
0d464f06d1 [NI] Consider CS as nullable if one of the types isn't subtype of Any
Note that this isn't fully correct, consider the following situation:

S : T, T : Any?
=> CS(S, T) = T, but for now it will be T?, which is reliable but not so specific as just T
2017-08-07 18:01:09 +03:00
Mikhail Zarechenskiy
39349abd39 [NI] Preserve name of parameters for functional types 2017-08-07 18:01:07 +03:00
Mikhail Zarechenskiy
5ec8d4920f [NI] Translate new resolved call to old one to avoid CCE 2017-08-07 18:01:06 +03:00
Dmitry Petrov
c0d6eff97c [NI] Select variable with proper non-trivial constraint first 2017-08-07 18:01:05 +03:00
Dmitry Petrov
0bf81aeec0 [NI] Extract InferenceStepResolver into a separate component 2017-08-07 18:01:04 +03:00
Dmitry Petrov
258a5aea28 [NI] Minor cleanup in FixationOrderCalculator 2017-08-07 18:01:03 +03:00
Stanislav Erokhin
ab2f99542a [NI] Redo how we take care of postpone arguments
The main change here is the following: before callable reference
resolution starts directly after choosing candidate. Since now we
start resolution before call completion.
2017-08-07 18:01:02 +03:00
Stanislav Erokhin
b344865c15 [NI] Minor. Fixes after review 2017-08-07 18:01:01 +03:00
Stanislav Erokhin
93d80c252f [NI] Refactoring. Move properties from KotlinCall to external component 2017-08-07 18:01:00 +03:00
Stanislav Erokhin
ef93088a42 [NI] Move most of KotlinCallDiagnostic to one file
Now there is 3 kind of KotlinCallDiagnostic:
  - ResolutionDiagnostic
  - ConstraintSystemCallDiagnostic
  - other common diagnostic

Also SpecialResolutionParts were merged into other ResolutionParts
2017-08-07 18:00:59 +03:00
Stanislav Erokhin
9378bff65c [NI] Move irrelevant code from KotlinCallCompleter
Extract code about smart cast diagnostic to new component
AdditionalDiagnosticReporter
2017-08-07 18:00:58 +03:00
Stanislav Erokhin
3450340d7f [NI] Refactoring. Introduced PostponableCallArgument
Also here argument resolution was divided to two parts:
for SimpleCallArguments and for PostponableCallArguments.
Call Resolution for SimpleCallArguments also used for CheckReceivers
and lambda result arguments checks
2017-08-07 18:00:57 +03:00
Stanislav Erokhin
1bc68e073d [NI] Minor. Clarified type for arguments from lambda 2017-08-07 18:00:56 +03:00
Stanislav Erokhin
4848f8e3da [NI] Use correct type in TypeApproximator for Invariant projection 2017-08-07 18:00:56 +03:00
Stanislav Erokhin
85e34163bb [NI] Temporary fix for cases related callable reference and if
For cases like if (..) ::foo else ::bar we didn't write stub resolved
calls for ::foo before call completion. Because of this, and strange
code in if we get null inside type info.
2017-08-07 18:00:54 +03:00
Stanislav Erokhin
455c43afa8 [NI] Some improvements in callable reference resolution 2017-08-07 18:00:53 +03:00
Stanislav Erokhin
f1144c9f01 [NI] Use resolved lhsType as unbound receiver. 2017-08-07 18:00:53 +03:00
Stanislav Erokhin
c752e1580e [NI] Check receivers for callable reference resolution. 2017-08-07 18:00:52 +03:00
Stanislav Erokhin
a5dffafacd [NI] Fix provideDelegate resolution.
For provideDelegate there is no real psi for resolution,
so we write corresponding call via special trace key.
2017-08-07 18:00:51 +03:00
Mikhail Zarechenskiy
7802492b08 [NI] Fix resulting type when there are no proper constraints 2017-08-07 18:00:50 +03:00
Mikhail Zarechenskiy
6be726854f [NI] Preserve type abbreviation during type substitution 2017-08-07 18:00:49 +03:00
Mikhail Zarechenskiy
76d013a33f [NI] Resolve % to mod if candidates have wrong receivers 2017-08-07 18:00:48 +03:00
Dmitry Petrov
4963580f90 [NI] Take into account return without expression in lambdas 2017-08-07 18:00:47 +03:00
Mikhail Zarechenskiy
17cdbcca03 [NI] Approximate substituted type arguments for non-members 2017-08-07 18:00:46 +03:00
Stanislav Erokhin
915ac32bfb [NI] Improve type inference for T vs Captured(in Smt)
If we has Inv<T> <: Inv<Captured(in Foo)> then we should get:
- T <: Captured(in Foo)
- Captured(in Foo) <: T

Before this commit we got: T <: Foo instead first constraint.
2017-08-07 18:00:45 +03:00
Stanislav Erokhin
91241a34d1 [NI] Run checks for captured types only once in NewTypeSubstitutor
Sometimes we can get Enum<Captured(*)> type here, so, supertype for
Captured(*) is Enum<Capture(*)> and we go into SO.
2017-08-07 18:00:44 +03:00
Stanislav Erokhin
d58c6e245f Minor. rename type parameters for debug purposes. 2017-08-07 18:00:43 +03:00
Mikhail Zarechenskiy
e74a02eb94 [NI] Approximate implicit return type for functions 2017-08-07 18:00:42 +03:00
Mikhail Zarechenskiy
ffc130f5fb [NI] Always approximate captured types for property descriptors 2017-08-07 18:00:41 +03:00
Stanislav Erokhin
5f2cc75718 [NI] Support INAPPLICABLE_WRONG_RECEIVER candidate applicability
It is important for provideDelegate resolution, because if scope has
provideDelegate with wrong receiver we shouldn't resolve to it and
report any errors.
2017-08-07 18:00:40 +03:00
Stanislav Erokhin
e4b73fcdbd [NI] Create SubCallArgument for variable in VariableAsFunctionCall
If variable is generic call, then we should complete inference only
after invoke resolution. It means that explicit receiver for invoke
should be SubKotlinCallArgument.
But, if this property has no generics,
for example local property, then this property can have smartcast and
such call has no type arguments -> no completion required.
For such call we should store information about smart casts.
2017-08-07 18:00:39 +03:00
Dmitry Petrov
756f7d6e9c [NI] Fix tests (was a type checker bug, see KT-18380) 2017-08-07 18:00:38 +03:00
Dmitry Petrov
d4e8a30dcf [NI] Fix nullability for captured type in input types approximation 2017-08-07 18:00:37 +03:00
Dmitry Petrov
e5c87fdad7 [NI] Filter out duplicates types in commonSuperTypeForNotNullTypes 2017-08-07 18:00:36 +03:00
Dmitry Petrov
b336919db3 [NI] In NI mode, use return type from special call resolution for '!!' 2017-08-07 18:00:35 +03:00
Dmitry Petrov
397e04f382 [NI] Do not use return type from 'onlyResolvedCall' 2017-08-07 18:00:34 +03:00
Dmitry Petrov
5b2e66f0ca [NI] Invoke checkType for arguments
checkType performs various actions required by BE
(e.g., record nullability assertions information for JVM BE).
2017-08-07 18:00:33 +03:00
Dmitry Petrov
dc453e6d8b [NI] Update lambda argument expression type when return type is known 2017-08-07 18:00:32 +03:00
Dmitry Petrov
ba068c2d65 Use original descriptor for enum constructor symbol 2017-08-07 18:00:31 +03:00
Mikhail Zarechenskiy
def0816095 [NI] Write info about hidden descriptor to candidate 2017-08-07 18:00:30 +03:00
Mikhail Zarechenskiy
38d9123a57 [NI] Use weaker upper constraint for case {T & Any} <: S 2017-08-07 18:00:29 +03:00
Stanislav Erokhin
18961cc5a9 [NI] Analyze lambda in independent context if it isn't call argument 2017-08-07 18:00:28 +03:00
Dmitry Petrov
8599763cb9 Do not perform type checks for function literals in visitor in NI mode
They are type-checked as arguments for the corresponding expressions.
2017-08-07 18:00:27 +03:00
Dmitry Petrov
fbad16567b [NI] Fix number type adjustment for greatest lower bound calculation
Compute common supertype (regardless of whether the given set of
lower bounds contains number types, intersection types, or whatever).

If the result type S is a possibly nullable intersection X1 & ... & Xn,
N = {Xi | Xi is a primitive number type},
R = {Xi | Xi is not a primitive number type},
M = default primitive number type for {Nj},
then adjusted type T* = M & R1 & ... Rm with the same nullability as S.

NB: IntegerValueType(_) = Int & Byte & Short & Long
2017-08-07 18:00:26 +03:00
Dmitry Petrov
1ae4278cfd Minor: fix formatting 2017-08-07 18:00:25 +03:00
Mikhail Zarechenskiy
bc2a8555a3 [NI] Resolve collection literals arguments as postponed ones 2017-08-07 18:00:24 +03:00
Stanislav Erokhin
c0c94910e2 [NI] Fix StackOverflow in TypeApproximator
For cases like Enum<Captured(*)> where Captured(*) has supertype
Enum<Captured(*)> we get SO in TypeApproximator.
To prevent this argument depth was introduced.
2017-08-07 18:00:23 +03:00
Dmitry Petrov
9fa3bce73a [NI] Fix special case of captured type handling in subtyping
Given the subtyping constraint
  X <: CapturedType(in Y)
we should check only
  X <: Y
if X contains type variables.
2017-08-07 18:00:22 +03:00
Dmitry Petrov
26cc08be65 Fix anonymous function literals handling in type checker
- [NI] Create type info directly if the expected type is functional.
- Properly handle suspended function expected type.
2017-08-07 18:00:21 +03:00
Dmitry Petrov
6facdcb7ea Minor: lambda arguments formatting 2017-08-07 18:00:20 +03:00
Mikhail Zarechenskiy
badbf777df [NI] Use data flow info from arguments in parenthesis to resolve lambda
Fixes 'javaObjectType' and 'javaPrimitiveType'
2017-08-07 18:00:19 +03:00
Stanislav Erokhin
5eb56dca60 [NI] Check type compatibility before fixation.
If for type variable we have upper and lower bounds, then sometimes
our approximation before fixation give us incorrect result for type
variable and we should chose other bound as result.

Example: Int & Byte <: T <: Byte. If we run approximation for lower
bound we get Int as result and it isn't subtype of Byte.
2017-08-07 18:00:18 +03:00
Mikhail Zarechenskiy
d1263c5dc3 [NI] Coerce to unit for empty lambda block
Fixes 'kt3903'
2017-08-07 18:00:17 +03:00
Mikhail Zarechenskiy
cf55674109 [NI] Support fallback resolve to operator mod if needed
Fixes:
  - assignmentOperations
  - percentAsModOnBigIntegerWithoutRem
2017-08-07 18:00:16 +03:00
Dmitry Petrov
f578d07b00 [NI] Fix lambda return type when expected type is not functional type
Introduce a fresh type variable for lambda return type.

We can't set expected lambda return type to 'Any?', because we can't
infer the actual type from return expressions in lambda in that case.
2017-08-07 18:00:15 +03:00
Dmitry Petrov
f637ebe9ff Minor: formatting for lambda arguments 2017-08-07 18:00:14 +03:00
Stanislav Erokhin
b7c894a6d3 [NI] Capture types from smart-cast types.
Sometimes we have something like if (a is Foo<*>) a.bar()
where bar declared: fun <T> Foo<T>.bar().
For such case we should create receiver with possible types Capture(*).
2017-08-07 18:00:13 +03:00
Mikhail Zarechenskiy
b6bb171b67 [NI] Extension function wins member if it's infix call
Fixes 'infixFunctionOverBuiltinMember'
2017-08-07 18:00:12 +03:00
Mikhail Zarechenskiy
8670d2abba [NI] Propagate information about safe call to receiver argument 2017-08-07 18:00:11 +03:00
Mikhail Zarechenskiy
72d14bfe0d [NI] Record type of callable reference to trace 2017-08-07 18:00:10 +03:00
Dmitry Petrov
a303888e66 [NI] Fix expected return type for function literals
It should actually be Unit, as told in FunctionExpression comments
(was null, later defaulted to Any?).
2017-08-07 18:00:09 +03:00
Dmitry Petrov
0136be3500 [NI] Fix traversing delegated constructor call chain
Use original descriptor instead of possibly substituted one: even though
the substitution is always trivial here, delegated constructor call is
recorded for the original constructor descriptor. So the code that
traverses the delegated constructor call chain should use original
descriptor, too.
2017-08-07 18:00:08 +03:00
Mikhail Zarechenskiy
0634025229 [NI] Propagate known type substitutor to resolution part
This commit fixes 'functionNtoStringGeneric' and 'superConstructor'
2017-08-07 18:00:07 +03:00
Mikhail Zarechenskiy
c6fcbf6172 [NI] Check for unwrapped descriptor when generating accessible function
In new inference we get copy of sam constructor and therefore should check original descriptor in BE.

 This fixes 'protectedSamConstructor' test
2017-08-07 18:00:06 +03:00
Stanislav Erokhin
e12eb66572 [NI] Fix COERCION_TO_UNIT in NI. 2017-08-07 18:00:05 +03:00
Stanislav Erokhin
de17604fe7 [NI] Bind all new resolved calls before update arguments. 2017-08-07 18:00:04 +03:00
Stanislav Erokhin
42438bd363 [NI] Do not calculate lambda return type in Visitor if NI enabled. 2017-08-07 18:00:03 +03:00
Stanislav Erokhin
85248676d2 [NI] Update lambda result arguments after resolution. 2017-08-07 18:00:02 +03:00
Stanislav Erokhin
b9e9243e9d [NI] Add hacks for property delegation resolution. 2017-08-07 18:00:00 +03:00
Stanislav Erokhin
af138e7403 Minor. Extract object to inner class. 2017-08-07 17:59:59 +03:00
Stanislav Erokhin
5bb61d2d02 [NI] Small improvements in callable reference resolution.
I'm not sure in this commit, but it fix some test -> let it be for now.
And yes, now I do not know correct way for callable reference resolution,
so for now it is just proposals.
2017-08-07 17:59:58 +03:00
Stanislav Erokhin
7eabdeffb3 [NI] Fix variable to proper upper type even if direction is TO_SUBTYPE. 2017-08-07 17:59:57 +03:00
Stanislav Erokhin
b3be21146c [NI] Add more hacks. 2017-08-07 17:59:56 +03:00
Stanislav Erokhin
0f0d834c23 [NI] Minor. Fix IOE. 2017-08-07 17:59:55 +03:00
Stanislav Erokhin
55181541af [NI] Change lambda analysis -- create arguments for return statements. 2017-08-07 17:59:54 +03:00
Stanislav Erokhin
58f73bd82a [NI] Use right DFI for arguments smart-casts. 2017-08-07 17:59:53 +03:00
Stanislav Erokhin
30f7396803 [NI] Substitute lambda return type with current substitutor
We should do this because return type even it still not proper
can contain fixed type variables
2017-08-07 17:59:52 +03:00
Stanislav Erokhin
89ac3bd5cf [NI] Do not add useless constraints to constraint system
Skipped constraints:
 - T <: Any, T >: Nothing
 - T <: T, T <: T?, T >: T, T <: T!, T! <: T
2017-08-07 17:59:51 +03:00
Stanislav Erokhin
3a25405088 [NI] Remove type variables for lambda arguments -- use existing instead. 2017-08-07 17:59:50 +03:00
Stanislav Erokhin
ff6a28b64c Add util method to BuildIns is kotlin.Function type. 2017-08-07 17:59:49 +03:00
Stanislav Erokhin
acc6e48172 [NI] Added isSuspend for lambdas. 2017-08-07 17:59:48 +03:00
Stanislav Erokhin
29e2a26ad6 [NI] Write fake ResolvedCall for callable reference. 2017-08-07 17:59:47 +03:00
Stanislav Erokhin
ee16a79612 [NI] Add pre-resolution callable reference argument check.
If expected type for callable reference argument isn't callable type
then make such candidate unsuccessful.
Sometimes expected type is just `T`, where `T` is type variable.
To support such case we take all supertypes and check them instead.
2017-08-07 17:59:46 +03:00
Stanislav Erokhin
55dc2c11f7 [NI] Support callable reference resolution in NI.
Missing parts:
- report results about callable references into trace
2017-08-07 17:59:46 +03:00
Stanislav Erokhin
02f4558683 Add way to create callable reference processor
Priority of variables and function should be the same.
Because of this we create new CompositeSimpleScopeTowerProcessor,
which merge candidates for properties and function into one candidate group
2017-08-07 17:59:44 +03:00
Stanislav Erokhin
36ea9484a9 [NI] Minor. Extract code to function.
Also make KotlinCall unnecessary for TypeVariableFromCallableDescriptor.
2017-08-07 17:59:43 +03:00
Mikhail Zarechenskiy
0b358fb693 Fix collection literals resolve in gradle-based projects
#KT-19441 Fixed
2017-08-07 17:52:08 +03:00
Daniil Vodopian
b24c1bf06c KT-9669: introduced JoinStatementAddSemicolonHandler; registered the handler in plugin.xml; added test coverage (#1232) 2017-08-07 16:20:40 +02:00
Dimach
d624ed4aff KT-18482: "Move lambda argument to parenthesis" action generate uncompilable code fixed (#1226)
* KT-18482 fixed

* Moved code to separate method and changed code to cover few more cases.

* Code style fixes.
2017-08-07 15:43:44 +02:00
Alexey Andreev
a4551fb0fb Fix infinite loop during continuous Gradle build including JS DCE
It's basically a workaround fox bug in Gradle.
See https://github.com/gradle/gradle/issues/2651
2017-08-07 16:36:57 +03:00
Sergey Igushkin
71878b2218 Merge pull request #1225 from nageshs/master
Close the local.properties file after reading
Issue #KT-19397 Fixed
2017-08-07 16:07:51 +03:00
Sergey Igushkin
13a2de1816 Update libraries/ReadMe.MD, add info about plugin markers required for tests 2017-08-07 15:14:37 +03:00
Sergey Igushkin
0cfac71efe (minor) Improve readability of pluginMarkers.gradle, fix indent in file
(minor) Clarify the comment on the setUpSeparateArtifact block
2017-08-07 14:33:35 +03:00
Sergey Igushkin
94036b7cac Add Gradle license 2017-08-07 14:33:33 +03:00
Sergey Igushkin
999db0bc80 Add a test for plugins DSL 2017-08-07 14:32:41 +03:00
Sergey Igushkin
8fd508566a Add Gradle plugin marker artifacts for the Gradle plugins.
This allows for the Gradle plugins DSL to resolve the plugins from
a custom repository.
https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers
2017-08-07 14:17:43 +03:00
Toshiaki Kameyama
64eeb479aa Take nullability annotations into account in QF correcting override
So Java NotNull annotated is converted to `Type`
and Java Nullable annotated to `Type?` accordingly

So #KT-19299 Fixed
2017-08-07 13:52:25 +03:00
Mikhail Glukhikh
1264ed7c86 Minor cleanup 2017-08-07 13:20:35 +03:00
Andrius Semionovas
666c241479 KT-19126 Add convert property initializer to getter in interfaces (#1224) 2017-08-07 11:53:37 +02:00
Kirill Rakhman
2536615e0e detect valid extension main functions (#1227)
Fixes #KT-18083
2017-08-07 11:39:34 +02:00
Yujin Jung
4c00119f08 Fix incorrect slack link (#1231) 2017-08-07 11:39:02 +02:00
Nikolay Krasko
7d66af6583 Always assign shebang comment to same position before package 2017-08-07 12:17:20 +03:00
Nikolay Krasko
8d226594ff Put comments and whitespaces under body in script files
It's more consistent to normal function body for IDE.
Doc comments in file beginning are now sticks to declarations
correctly.
Moving declarations at the end of scripts is fixed
2017-08-07 12:17:17 +03:00
Nikolay Krasko
8de6017e53 Minor: rename comments and whitespace binders file 2017-08-07 12:17:14 +03:00
Nikolay Krasko
ae6f38e252 Minor: fix comment about AllCommentsBinder 2017-08-07 12:13:58 +03:00
Nikolay Krasko
6194bc10f8 Move statement out of top-level lambda in scripts (KT-19322)
#KT-19322 Fixed
2017-08-07 12:12:41 +03:00
Dmitry Petrov
656f8bb5cf Turn SwitchCodegenUtil into a class 2017-08-07 10:31:02 +03:00
Dmitry Petrov
435cfeea0a SwitchCodegenUtil: convert to Kotlin and cleanup 2017-08-07 10:31:02 +03:00
Dmitry Petrov
c5772e5549 SwitchCodegenUtil: .java -> .kt 2017-08-07 10:31:02 +03:00
Dmitry Petrov
2ed5a5e368 'when' should use intrinsics for '=='
#KT-19029 Fixed Target versions 1.1.5
 #KT-18818 Fixed Target versions 1.1.5
2017-08-07 10:31:02 +03:00
Jonathan Leitschuh
20cd748377 Add download link for JDK6 on MacOS to Readme.md (#1229)
Reduce the barier to entry for working on Kotlin by providing a
download link for the MacOS JDK6 in the ReadMe.
2017-08-04 22:47:14 +02:00
Toshiaki Kameyama
dbaec43e4d Make abstract both member and class while applying "Make abstract"
So #KT-12613 Fixed
2017-08-04 21:34:21 +03:00
Toshiaki Kameyama
0a9e0ddba9 Use back-ticks correctly in "Add remaining branches" action
So #KT-13985 Fixed
2017-08-04 20:58:46 +03:00
Alexey Sedunov
97a3d343f7 Create Class from Usage: Support nested classes
This covers the case when original expression doesn't contains qualifier
Also for local or inner containing classes:
  - forbid nested objects
  - add 'inner' to nested class declaration

 #KT-16404 Fixed
2017-08-04 16:48:36 +03:00
Alexey Sedunov
d30461afc6 Create Class from Usage: Support multiple containers 2017-08-04 16:48:35 +03:00
Alexey Sedunov
78117b3e7b Create from Usage: Infer expected type from base declarations
#KT-17480 Fixed
2017-08-04 16:48:35 +03:00
Alexey Sedunov
3b4891279e Configuration: Update default settings for Kotlin/JS compiler 2017-08-04 16:48:35 +03:00
Mikhael Bogdanov
d738633981 Switch jvm target to 1.8 in Ultimate plugin and missed version to core modules 2017-08-04 15:45:53 +02:00
Dmitry Jemerov
563472e676 Include org.json classes in Kotlin plugin jar 2017-08-04 15:30:12 +02:00
Mikhael Bogdanov
db9f925bb1 Switch default project jvm target to 1.8, keep 1.6 for core modules 2017-08-04 13:14:50 +02:00
Alexey Sedunov
aed9d3899e Misc: Fix compiler argument usages after refactoring 2017-08-03 19:59:53 +03:00
Kirill Rakhman
41e5840298 Implement inspection for redundant lambda arrow
Fixes #KT-11991
2017-08-03 15:37:04 +02:00
Kirill Rakhman
9ac1a0140c Add inspection for when with only else (#1206)
Fixes #KT-12523
2017-08-03 15:30:28 +02:00
Nikolay Krasko
61b10ac330 Make class prepare request pattern more precise (KT-19429)
Do not bother with check for irrelevant classes.

 #KT-19429 Fixed
2017-08-03 13:11:06 +03:00
Nikolay Krasko
1ef5362edc Fix breakpoints from Kotlin file placed in irrelevant class (KT-19429)
State that there're no locations in given file, if all locations for
line were filtered out because of wrong file name. Need this because
if we throw exception, other positions managers may return locations
without explicit check for file type or file name.

See PositionManagerImpl.java

 #KT-19429 Fixed
2017-08-03 13:11:06 +03:00
Nikolay Krasko
3ea4a7fb47 Drop support for JVM 1.4 in debugger
Kotlin can't run on such JVM anyway.
2017-08-03 13:11:06 +03:00
Mikhail Glukhikh
0e4089ef8e Keep coroutines classes in ProGuard #KT-19433 In Progress 2017-08-03 12:25:11 +03:00
Alexey Sedunov
d10fa8f891 Minor: Fix array detection 2017-08-03 01:55:44 +03:00
Alexey Sedunov
e38cf54dac Minor: Fix facet/project settings editor 2017-08-03 01:55:44 +03:00
Alexey Tsvetkov
f0becd0040 Fix IC with daemon
JPS IC with daemon was not working since
the commit 514635e965

Before that change `IncrementalCompilation.isEnabled`
returned `true` when the corresponding system property was not set.
After the change `isEnabled` returns `true` only if
the system property is set and equals to `"true"`.

The property was never set up for the daemon if `CompilerMode.JPS_COMPILER`
was used (the property was set up in a JPS process or in the daemon in case
it was used with Gradle).

     #KT-19414 fixed
2017-08-02 23:02:11 +03:00
Dmitry Jemerov
82c62b4d8e Add missing read action 2017-08-02 17:11:56 +02:00
Dmitry Jemerov
88420311cb Look at library content to detect library kind when importing 2017-08-02 17:10:01 +02:00
Dmitry Jemerov
b423d58a14 Load JSR-305 annotations for libraries if it's enabled for any module
#KT-19303 Fixed
2017-08-02 15:25:34 +02:00
Mikhail Glukhikh
4ca8d3d6cf J2K: use refactorings and runWriteAction more accurately #KT-19371 Fixed
Do not invoke runWriteAction for post-processings
in Convert(Text)JavaCopyPasteProcessor.
Instead each processing can need write action or not,
and J2kPostProcessor takes this into account.
2017-08-02 15:30:18 +03:00
Mikhail Glukhikh
8d5e69b06c Inline variable: do not show dialog / preview from J2K #KT-19332 Fixed 2017-08-02 15:30:17 +03:00
Mikhael Bogdanov
b56f5593ab Update changelog for 1.1.4-eap-54 2017-08-02 14:09:39 +02:00
Alexey Sedunov
53d12e6cf7 Method Hierarchy: Refactoring
- Do not rely on light methods and Java method hierarchy
- Support val/var parameters
- Support built-in member functions

 #KT-14346 Fixed
2017-08-02 13:08:06 +03:00
Alexey Sedunov
10941ae732 Call Hierarchy: Refactoring
Do not rely on light methods to search usages as some elements
don't have them (e.g. local functions)

 #KT-9288 Fixed
 #KT-14428 Fixed
2017-08-02 13:08:06 +03:00
Alexey Sedunov
0c2ea5d799 Light Classes: Fix equivalence check
Do not consider PsiClass equiavent to KtLightClass
if it's not a light class as well

 #KT-16180 Fixed
2017-08-02 13:08:06 +03:00
Alexey Sedunov
e6f1a3ccf3 Minor: Use Kotlin reflection in usage printing and update test data 2017-08-02 13:08:06 +03:00
Alexey Sedunov
3c0a4a0abf Minor: Fix bug introduced by the refactoring 2017-08-02 13:08:05 +03:00
Dmitry Petrov
c5613888eb Look into proper context when generating backing field access
Problem manifests when a class property name matches a companion object
property name, and class property is referenced in closure context.

 #KT-19367 Fixed Target versions 1.1.5
2017-08-02 11:24:35 +03:00
Dmitry Petrov
05eee9c173 Minor: adjust formatting 2017-08-02 11:24:35 +03:00
Yan Zhulanow
3d7d1b20ab Ensure there won't be the same classpath entries in the resulting classpath 2017-08-02 03:36:57 +03:00
Bill Collins
9a40e9b96d Don't overwrite plugin classpaths detected earlier for annotation processing. Fixes #KT-18022 2017-08-02 03:36:56 +03:00
Yan Zhulanow
3770786075 Minor: Fix test data for CLI test (defaultCacheImplementation option was added in Android Extensions) 2017-08-02 03:36:55 +03:00
Yan Zhulanow
13868f89e8 Minor: Change test format to JUnit 3 2017-08-02 03:35:16 +03:00
Yan Zhulanow
45681ed9eb Fix "'Redundant modality' is not reported with all-open" (KT-18195) 2017-08-02 03:35:15 +03:00
Yan Zhulanow
6002281874 Android Extensions: Downgrade to old Android variant processing logic when 'experimental' flag is disabled (KT-19270) 2017-08-02 03:35:14 +03:00
Yan Zhulanow
3bb7febeb8 AllOpen: Make private members open again because of KT-19047 2017-08-02 03:35:13 +03:00
Yan Zhulanow
5ff014f89d Parcelable, minor: Change error message 2017-08-02 03:35:12 +03:00
Yan Zhulanow
448fa8495a Parcelable, Lint: Do not report "CREATOR field missing" warnings on our '@Parselize' Parcelables 2017-08-02 03:35:11 +03:00
Yan Zhulanow
c1600c9841 Report errors from compiler plugins as compiler PLUGIN_ERRORs (KT-19311) 2017-08-02 03:35:10 +03:00
Yan Zhulanow
9a5a003d0a NoArg: Fix IllegalAccessError on instantiating sealed class child via Java reflection (KT-18245) 2017-08-02 03:21:16 +03:00
Yan Zhulanow
53e193d130 AllOpen: Support @SpringBootTest annotation (KT-18262) 2017-08-02 03:21:15 +03:00
Yan Zhulanow
4dddb00aca Kapt: Fix "Anonymous class types are not rendered properly in stubs" (KT-18682) 2017-08-02 03:21:14 +03:00
Yan Zhulanow
bf2bc1fdc7 Android Extensions: Support smart-casted receivers (KT-18545) 2017-08-02 03:21:13 +03:00
Mikhail Glukhikh
9e9c4f79f5 Make MODIFIERS_ORDER consistent with code style document 2017-08-01 20:42:40 +03:00
Nikolay Krasko
65ea9290ea Skip method check for non-relevant positions (KT-19403)
#KT-19403 Fixed
2017-08-01 20:09:54 +03:00
Nikolay Krasko
2ba89b9e68 Fix bad cast on absent descriptor in field breakpoint (EA-101988) 2017-08-01 20:09:54 +03:00
Alexey Tsvetkov
45ec0e364a Remove Gradle plugin dependency on Apache Commons
We have used `commons-lang` to detect
if current OS is a Windows.
`org.apache.commons.lang.SystemUtils` also
tries to parse JDK version in `clinit` and,
as of AC version 2.4, fails on JDK 9.

I preferred to remove the dependency completely
and copy an implementation of `isWindows` from Intellij
platform, because the code is quite simple
and minimizing unnecessary dependencies will help to avoid
compatibility problems in future.

Gradle plugin also declares a dependency on `commons-io`,
but it seems unused, so the dependency is also removed.

    #KT-18832 fixed
2017-08-01 19:43:25 +03:00
Alexey Sedunov
40163868af Support mutable/immutable compiler arguments 2017-08-01 19:40:37 +03:00
Alexey Sedunov
2984a5a19f Fix reflection-based operations on compiler arguments after conversion 2017-08-01 19:40:22 +03:00
Alexey Sedunov
50599c933f J2K: CommonToolArguments and inheritors 2017-08-01 19:36:49 +03:00
Alexey Sedunov
2e49971989 J2K: CommonToolArguments and inheritors (rename) 2017-08-01 19:36:49 +03:00
Yan Zhulanow
2d8f7419eb Parcelable: Temporarily disable box tests because of OOM 2017-08-01 18:37:27 +03:00
Mikhail Glukhikh
87cdc7635a Do not suggest "can be private" for elements with given annotations
So #KT-19272 Fixed
2017-08-01 18:01:29 +03:00
Mikhail Glukhikh
c5a81691fb Partial code cleanup: can be private and some others applied 2017-08-01 17:08:56 +03:00
Mikhael Bogdanov
42f8a3e65b Generify Symbols class to be able support jvm specific implementation 2017-08-01 15:52:29 +02:00
Mikhael Bogdanov
4dbb82a789 Copy ununsed lowers 2017-08-01 15:52:28 +02:00
Mikhael Bogdanov
df56ef5e3f Copy common lowers 2017-08-01 15:52:28 +02:00
Mikhael Bogdanov
27365dc4be Copy common utils from Native 2017-08-01 15:52:27 +02:00
Nikolay Krasko
5fcefa28a7 Test stub trees compatibility on loadJava/compiledKotlin test data 2017-08-01 16:22:40 +03:00
Mikhail Glukhikh
c2617e89c9 Remove unnecessary check from prepareCodeToInline 2017-08-01 12:32:49 +03:00
Mikhail Glukhikh
1ed1751b63 Report "Make <visibility>" for visibility fixes #KT-19274 Fixed
(instead of "Add <visibility> modifier")
2017-08-01 12:06:28 +03:00
Toshiaki Kameyama
29dba9edb3 Do not report "property can be private" in annotations #KT-19273 Fixed 2017-08-01 11:53:42 +03:00
Nagesh Susarla
b9788bbafd Close the local.properties file after reading 2017-07-31 15:36:18 -07:00
Ilya Gorbunov
050744627d Clean stdlib and reflect before rewriting binary API dump
The change in the run configuration "Binary compatibility tests, overwrite results"
is to prevent incremental compilation of these artifacts.
During the incremental compilation only the declarations in the files being
recompiled are dumped to declarations.json.
This results in incomplete dump and affects the public declarations dump.

This clean step enforces stdlib and reflect libraries to be fully recompiled.
This step can be removed as soon as we do not need declarations.json to dump public API.
2017-07-31 23:13:56 +03:00
Alexey Tsvetkov
69b4d213b7 Ensure IC.isEnabled is not modified by tests 2017-07-31 19:34:59 +03:00
Alexey Tsvetkov
514635e965 IC should be enabled explicitly by build systems
The change only affects JPS on TeamCity (in Intellij IC system property
is always set explicitly; the same holds for Gradle, Maven).
Previous changes have effectively enabled the new IC (which is now default)
for TC JPS builds, which is undesirable as more RAM is used.
2017-07-31 19:34:59 +03:00
Alexey Tsvetkov
5ce3a436c7 Avoid marking dirty dependencies from already compiled chunks
#KT-17397 fixed
2017-07-31 19:34:59 +03:00
Alexey Tsvetkov
7cccba3b9a Refactoring: do not check if IC is enabled in cache
There was a bunch of if-else blocks checking if new IC was enabled or not.
These blocks became useless after `IncrementalCompilation.isExperimental`
was replaced with `IncrementalCompilation.isEnabled`, because when IC is not enabled
we don't use caches anyway.
2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
3f471d1ac6 Minor: add dummy.kt to some IC tests
This makes it impossible to pass the tests
by rebuilding everything.
2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
e602903567 Remove old IC: remove experimental tests 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
534db2d45b Remove old IC: remove experimental cache version 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
a4a0335b20 Remove old IC: update KotlinJpsBuildTest 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
62fdd91947 Remove old IC: remove unnecessary caches 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
aea5293288 Remove old IC: fix constant search test
The tests were not run with the new IC before
2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
8143ca158b Remove old IC: update on-off tests 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
e7afb073d9 Remove old IC: remove experimental-expected-kotlin-caches.txt 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
5af9d29cbe Remove old IC: remove experimental-ic-build.log
This commit moves each experimental-ic-build.log
into a corresponding build.log file.
2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
2bd7d12312 Remove old IC: remove IncrementalCompilation.isExperimental 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
50091bfac8 Remove old IC: remove flags from CompilationResult 2017-07-31 19:34:58 +03:00
Alexey Tsvetkov
840f688bbf Refactoring: simplify proto map API 2017-07-31 19:34:58 +03:00
Alexander Udalov
2e82bb5632 Use correct LanguageVersionSettings in MetadataSerializer
Also, require users of K2MetadataCompiler to pass "-Xmulti-platform"
manually. Gradle and Maven plugins already do that, so only users who
invoke kotlinc directly are going to be affected by this

 #KT-19287 Fixed
2017-07-31 08:47:47 -07:00
Sergey Igushkin
4923589b38 Fix testAndroidExtensionsManyVariants not using experimental flag 2017-07-31 16:56:06 +03:00
Sergey Igushkin
23ea1a1a60 Push Android Gradle plugin version used in tests to 3.0.0-alpha8 2017-07-31 16:52:48 +03:00
Andrius Semionovas
f42808af94 Add when support for USELESS_IS_CHECK quick fix, related to KT-18965 2017-07-31 16:10:41 +03:00
Andrius Semionovas
e0aca97f9f Add quick-fix for USELESS_IS_CHECK #KT-18965 Fixed 2017-07-31 16:10:23 +03:00
Dimach
88fa7c2952 Introduce "double negation" inspection #KT-4748 Fixed 2017-07-31 15:57:31 +03:00
Toshiaki Kameyama
be0b01a1e6 Do not report "can be private" on effectively private / local elements
So #KT-18822 Fixed
2017-07-31 11:58:14 +03:00
Pavel V. Talanov
05ea99441f script.runtime 1.1.4: Update test data implementations 2017-07-30 18:21:35 +03:00
Pavel V. Talanov
b0b2c046b2 script.runtime 1.1.4: IDE and compiler use 'kotlin.script.experimental' 2017-07-30 18:15:41 +03:00
Pavel V. Talanov
d7e62937b2 script.runtime 1.1.4: Remove new API from 'kotlin.script' package
Copy of new API is in 'kotlin.script.experimental' package
2017-07-30 17:38:10 +03:00
Pavel V. Talanov
9a004ceda2 script.runtime 1.1.4: Remove copy of ScriptContents class
This class is not new(experimental) API is not supposed to be moved
2017-07-30 17:17:54 +03:00
Simon Ogorodnik
5e032139cb KT-18040: Enable auto popup when typing after $e. in string template
#KT-18040 fixed
2017-07-30 09:15:16 +03:00
Alexander Udalov
4e77897bfd Pass LanguageSettingsProvider to AnalyzerFacade explicitly
This way is more flexible for example for tests, where configuring the
service implementation may be tricky (it's usually done in
KotlinCoreEnvironment in production code)
2017-07-28 20:15:28 +03:00
Pavel V. Talanov
ca06d38c5b script.runtime 1.1.4: Copy new API to kotlin.script.experimental package
Minor: Move Environment type alias to resolvers_deprecated.kt file
2017-07-28 20:13:59 +03:00
Pavel V. Talanov
d59a72ea75 script.runtime 1.1.4: Undeprecate old API 2017-07-28 20:13:57 +03:00
Pavel V. Talanov
9e34437447 script.runtime: add 'kotlin-runtime' dependency
script.runtime is not built by JPS, this just affects highlighting
2017-07-28 20:13:54 +03:00
Alexander Udalov
82502e1a8b Fix compilation of kotlin-script-util
Compilation was broken in 46a01ec
2017-07-28 19:26:35 +03:00
Leonid Startsev
527ccaff16 Changes required for serialization plugin to work:
* Support for generation of synthetic nested classes (for implementations
of user-defined serial annotations):

    1. Compiler extenstion points for contributing names and descriptoprs
of nested classes

    2. Control on synthetic class primary constructor visibility

* Public functions for generating initializing expressions for optional
properties
2017-07-28 07:04:57 -07:00
Dmitry Petrov
9e6b706a03 Unwrap property imported from object on property access
#KT-18982 Fixed Target versions 1.1.5
2017-07-28 17:01:04 +03:00
Sergey Igushkin
05919244bd Fix testLogLevelForceGC 2017-07-28 16:39:10 +03:00
Sergey Igushkin
7906ac9348 Fix unresolved rhino dependency in testDce. 2017-07-28 16:39:10 +03:00
Pavel V. Talanov
c1fd8fc318 Send roots changed iff combined dependencies of all scripts changed
This reduces total number of reindex requests when working with scripts

ScriptDependenciesCache::onChange logic is independent from ScriptDependenciesUpdater::onChange
2017-07-28 15:45:29 +03:00
Pavel V. Talanov
e115c8b373 Filter out invalid files before contributing them for indexing
#EA-104574
2017-07-28 15:45:26 +03:00
Nikolay Krasko
99555fa843 Retrieve receiver annotation to stubs from compiled code (KT-19209)
#KT-19209 Fixed
2017-07-28 15:01:32 +03:00
Alexander Udalov
8b149db0ec Drop deprecated KotlinPaths.getRuntimePath, use getStdlibPath instead 2017-07-28 14:16:48 +03:00
Alexander Udalov
b988582531 Refactor utilities in AbstractKotlinJpsBuildTestCase 2017-07-28 14:16:47 +03:00
Alexander Udalov
1e6850f198 CLI: improve error message if libraries are not found in Kotlin home
Also support the '-kotlin-home' argument in kotlinc-js

 #KT-18859 Fixed
2017-07-28 14:16:46 +03:00
Alexander Udalov
eb673d6ed3 Do not try to compile if incorrect language/API version is passed 2017-07-28 14:11:35 +03:00
Alexander Udalov
4b42f9e071 Move JPS-related kotlin-home detection code to jps-plugin 2017-07-28 14:11:35 +03:00
Alexander Udalov
46a01ec131 J2K PathUtil: convert and prettify 2017-07-28 14:11:35 +03:00
Alexander Udalov
3beb6a86f7 J2K PathUtil: move .java -> .kt 2017-07-28 14:11:35 +03:00
Dmitry Petrov
67336653e0 Generate SAM wrappers only if they are required for a given argument
SAM interface wrapper for an argument is required,
if in the function descriptor for SAM adapter
type for the corresponding value parameter
doesn't match type of the corresponding value parameter
in the original (Java) descriptor.

 #KT-19251 Fixed Target versions 1.1.5
2017-07-28 08:24:46 +03:00
Dmitry Petrov
c8bc2d9d16 Minor: code cleanup 2017-07-28 08:24:46 +03:00
Dmitry Petrov
5df461c7e0 Add test for KT-19246
The issue was fixed by
904c7f9c64
2017-07-28 08:24:46 +03:00
Nikolay Krasko
24865ba26a Allow deprecated fix for TYPEALIAS_EXPANSION_DEPRECATION 2017-07-28 01:28:56 +03:00
Nikolay Krasko
53373b66b9 Do not replace in alias when constructor has special pattern (KT-19202)
#KT-19202 Fixed
2017-07-28 01:28:56 +03:00
Nikolay Krasko
1b93e2030f Create isCallee utility function 2017-07-28 01:28:56 +03:00
Yan Zhulanow
142a64e039 Minor: Fix Gradle integration test compilation, replace .use() with try&finally 2017-07-27 21:22:06 +03:00
Sergey Igushkin
fabcd6b73c Fix Gradle IT compilation. 2017-07-27 20:44:03 +03:00
Anton Bannykh
e9e81d96a5 Fixed maven multiplatform test 2017-07-27 19:34:14 +03:00
Mikhael Bogdanov
79921b0206 Update changelog for 1.1.4-eap-33 2017-07-27 14:18:35 +02:00
Valentin Kipyatkov
ee7eb3186d Fixed problems with ModuleDescriptor mismatch after ProcessCanceledException 2017-07-27 14:05:45 +03:00
Valentin Kipyatkov
6ba96b1103 Renamed function 2017-07-27 13:56:30 +03:00
Valentin Kipyatkov
7f467f0fdd Minor 2017-07-27 13:56:29 +03:00
Valentin Kipyatkov
d3ea7c3a14 No need to pass fq-names to import when we have bindingContext 2017-07-27 13:56:28 +03:00
Valentin Kipyatkov
996292264b Fixed inline when multiple implicit receivers exist
#KT-17776 Fixed
 #KT-17266 Fixed
2017-07-27 13:55:25 +03:00
Valentin Kipyatkov
0346b31628 Enabled Loop to call chain inspection again 2017-07-27 13:54:59 +03:00
Valentin Kipyatkov
44dafc38e5 A bit more correct fix of KT-14665 2017-07-27 13:33:57 +03:00
Kirill Rakhman
3ff5c95419 Improve inspection message for NullableBooleanElvisInspection
Also report as "should" or "can" depending on severity
So #KT-19006 Fixed
2017-07-27 11:08:26 +03:00
Simon Ogorodnik
c41c5f1916 KT-19145: Enable type completion for extension properties
#KT-19145 fixed
2017-07-27 09:57:11 +03:00
Andrius Semionovas
68659f5a32 Introduce error "ANNOTATION_USED_AS_ANNOTATION_ARGUMENT" along with QF
The relevant inspection has been removed
So #KT-18855 Fixed
2017-07-27 09:54:22 +03:00
Dmitry Petrov
b81ca31aae Record resolved delegation call for primary ctor if single result
Do the same thing as for secondary constructor (looks like it was a
workaround for R&I bug that was used only for secondary constructors
for some reason).

 #KT-17464 Fixed Target versions 1.1.5
2017-07-27 09:24:48 +03:00
Dmitry Petrov
c9ad290ad5 Do not store null for temporary in destructuring assignment
#KT-19256 Fixed Target versions 1.1.5
2017-07-27 09:02:26 +03:00
Dmitry Petrov
b867c46f72 Generate for-in-range loop as counter loop when possible
If an upper bound is a compile-time constant != Int.MAX_VALUE,
we can generate 'for (i in x..N)' as 'for (i in x until N+1)'.
2017-07-27 09:02:26 +03:00
Dmitry Petrov
7450899b87 Minor: extract get*CompileTimeConstant
Get rid of code duplication.
2017-07-27 09:02:26 +03:00
Ilya Gorbunov
ca8bf395c3 Do not create iterator in 'any', 'none', 'all' and 'count' unless necessary
#KT-19133 Fixed
2017-07-26 22:42:29 +03:00
Mikhael Bogdanov
ff676c050f Properly generate inner classes when compiling source for inline
KT-19175: Compiler generates different bytecode when classes are compiled separately or together

 #KT-19175 Fixed
2017-07-26 20:31:14 +02:00
Sergey Igushkin
7da6ff78c1 Fix Kapt3 classes not consumed by kotlinCompile tasks from their friend 2017-07-26 20:19:33 +03:00
Yan Zhulanow
ea1068a822 Parcelable, minor: Rename MagicParcel to Parcelize 2017-07-26 20:19:32 +03:00
Yan Zhulanow
f29cf07fa4 Android Extensions, minor: Fix test 2017-07-26 20:19:32 +03:00
Yan Zhulanow
92558ad183 Minor: Clarify module name in warning message about empty output classpath/output directories 2017-07-26 20:19:31 +03:00
Yan Zhulanow
826672ea1b Kapt: Register kapt classes output directory as Java classes directory (KT-19211)
This is relevant to pure (non-Android) Java projects and Gradle 4.0+.
2017-07-26 20:19:30 +03:00
Yan Zhulanow
725f51056f Kapt: Do not use AbstractCompile as a supertype for KaptTask (KT-19179)
Gradle sometimes tells that kaptCompile is UP-TO-DATE even when it's not true, so the annotation processing step is silently skipped.
Looks like replacing `mapSource {}` with an explicit getter or with manual `source()` invocation does not fix the problem.

This looks like a bug in Gradle appeared since 3.0. The test from this commit works with Gradle 2.14.1.
2017-07-26 20:19:29 +03:00
Yan Zhulanow
53fda33499 Kapt: 'kaptKotlin' task should be invoked only when all task dependencies from kapt configuration is built (KT-19178) 2017-07-26 20:19:28 +03:00
Yan Zhulanow
c2be771486 Android Extensions: Support defaultCacheImplementation in Gradle 2017-07-26 20:19:27 +03:00
Yan Zhulanow
5a1a4bd8bd Android Extensions: Add global cache flag in compiler plugin 2017-07-26 20:19:26 +03:00
Yan Zhulanow
84eff43b49 Parcelable: Support Android Extensions experimental flag 2017-07-26 20:19:25 +03:00
Yan Zhulanow
98a2506eb0 Android Extensions: Add kotlin-android-extensions-runtime only if experimental flag is enabled 2017-07-26 20:19:25 +03:00
Yan Zhulanow
8cdcfc5e67 Android Extensions: Migrate enabled status check to Gradle importer #KT-17641 2017-07-26 20:19:24 +03:00
Yan Zhulanow
38449caaed Parcelable: Fixes after review 2017-07-26 20:19:23 +03:00
Yan Zhulanow
d0e4b236a7 Parcelable: Support SortedSet, NavigableSet, SortedMap, NavigableMap 2017-07-26 20:19:22 +03:00
Yan Zhulanow
cf607a0f14 Parcelable: Report error on unsupported parameter types, add @RawValue annotation support 2017-07-26 20:19:21 +03:00
Yan Zhulanow
4200629347 Parcelable: Support CharSequence, IBinder/IInterface, objects, enums. Serialize Parcelable efficiently if possible 2017-07-26 20:19:20 +03:00
Yan Zhulanow
19eb30b3ae Parcelable: Add test for clinit merging 2017-07-26 20:19:19 +03:00
Yan Zhulanow
3062e72282 Parcelable: Support Parcelizer interface in order to be able to customize serialization 2017-07-26 20:19:18 +03:00
Yan Zhulanow
aa5f9ee3ec Parcelable: Correctly handle writeToParcel() overriding, report errors on custom writeToParcel() and CREATOR 2017-07-26 20:19:18 +03:00
Yan Zhulanow
96c9bcd820 Parcelable: Allow custom describeContents() implementation 2017-07-26 20:19:17 +03:00
Yan Zhulanow
4197380621 Parcelable: Add declaration checker 2017-07-26 20:19:16 +03:00
Yan Zhulanow
c23bca6afe Parcelable: Add Parcelable functionality to Android Extensions plugin 2017-07-26 20:19:15 +03:00
Yan Zhulanow
edd8a0a64e Parcelable: Download Robolectric artifacts in order to use them in tests 2017-07-26 20:19:14 +03:00
Toshiaki Kameyama
5290553184 Fix Math.min with coerceAtMost intention inside qualified expression
So #KT-19232 Fixed
2017-07-26 20:12:53 +03:00
Ilya Chernikov
a82f66cf45 Add tests for client/session flags removal, minor fix in shutdown logic 2017-07-26 17:16:38 +02:00
Ilya Chernikov
dc88e1e16c Fix daemon clients cleanup, fixes hanging daemon processes 2017-07-26 17:16:37 +02:00
Toshiaki Kameyama
c3988ef184 Support "Lift return out of when" for exhaustive when without else
So #KT-18852 Fixed
2017-07-26 17:44:19 +03:00
Mikhail Glukhikh
9781d1fcdf Remove unused variable with constant initializer #KT-13886 Fixed 2017-07-26 15:18:46 +03:00
Mikhail Glukhikh
a08f55cf99 Cast to type quick-fix: handle case with qualified elements correctly
Same fix for 'add !!' fix
So #KT-18368 Fixed
2017-07-26 15:18:38 +03:00
Mikhail Glukhikh
e6872c52a3 More accurate deparenthesize (keeping annotations) in some IDE actions
So #KT-19004 Fixed
2017-07-26 15:18:30 +03:00
Mikhail Glukhikh
7fb78a0372 Code cleanup: replace chained null-checks with safe-calls 2017-07-26 15:18:22 +03:00
Nikolay Krasko
732d1129ab Enable replace for deprecated alias in whole project (KT-14929)
#KT-14929 Fixed
2017-07-26 14:20:59 +03:00
Nikolay Krasko
5df2698f77 Enable ReplaceWith for type aliases (KT-14929)
#KT-14929 Fixed
2017-07-26 14:20:57 +03:00
Alexander Udalov
224df7a1ea Change -Xload-jsr305-annotations argument to -Xjsr305-annotations={ignore|enable}
See https://youtrack.jetbrains.com/issue/KT-19229 for a complete
explanation

 #KT-19229 Fixed
 #KT-10942
2017-07-26 11:45:25 +03:00
Alexander Udalov
2f99f6ad34 Refactor AnalysisFlags and their support in IDE
* Support flags with any value (not just Boolean)
* Support all flags by parsing arguments in KotlinFacetSettings, instead
  of manually listing known flags

 #KT-19210 Fixed
2017-07-26 11:45:24 +03:00
Alexander Udalov
845de7aa4d Minor, change parameter type of parseCommandLineArguments 2017-07-26 11:45:24 +03:00
Alexander Udalov
593f98190d Keep .txt and .caps files in compiler.pro
Files like org/jline/utils/capabilities.txt are needed for jline to
function correctly

 #KT-19237 Fixed
2017-07-26 11:45:23 +03:00
Dmitry Petrov
0391c24ab2 Provide diagnostic for typealias using deprecated class or constructor
#KT-19205 Fixed Target versions 1.1.5
2017-07-26 09:02:45 +03:00
Dmitry Jemerov
c78ad9c047 Correctly detect library kind when not using modules per sourceset
#KT-19219 Fixed
2017-07-25 18:20:45 +02:00
Simon Ogorodnik
fa88fb74c4 Disable completion binding context caching by default
Now it opt-in in internal mode, due duplication problems
 #KT-19191 fixed
2017-07-25 18:26:34 +03:00
Simon Ogorodnik
094125c970 KT-19154: Fix auto-import to check receiver for members properly
#KT-19154 fixed
2017-07-25 16:16:57 +03:00
Alexander Udalov
f313001b2d Update to jline 3.3.1 and jansi 1.16
Note that the history file name was changed (.kotlin_history ->
.kotlinc_history) because the history is now stored in a different
(incompatible) format.

 #KT-11369 Fixed
2017-07-25 11:10:45 +03:00
Ilya Gorbunov
baa6b44567 Deprecate CharSequence.size in JS
#KT-18267 Fixed
2017-07-24 21:14:45 +03:00
Ilya Gorbunov
f10ea03173 Provide extension to get mutable iterator from the mutable map
#KT-18992 Fixed
2017-07-24 21:02:15 +03:00
Dmitry Jemerov
e0dc7a27a0 Migration for pre-1.1.3 JS libraries
#KT-19156 Fixed
2017-07-24 19:53:52 +02:00
Dmitry Jemerov
861219f502 ConfigureKotlinTest refactoring to avoid duplicating production logic 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
63c6ba7e31 Add missing read action 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
f370d74609 Correctly detect stdlib in Gradle projects; move detection out of EDT
To detect whether a module has an stdlib in its dependencies, look at
source root modules and not at base module.
2017-07-24 19:53:52 +02:00
Dmitry Jemerov
0971af803c Check for non-configured modules in background thread
#KT-17835 Fixed
2017-07-24 19:53:52 +02:00
Dmitry Jemerov
e1f7c91728 Use Kotlin/JVM and Kotlin/JS terms in the UI 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
0f2992ddec JavaFrameworkType: J2K 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
079f7690a8 JavaFrameworkType: rename to .kt 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
6dbaec0cc6 Use distinct icon for Kotlin/JS module and libraries 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
6eff8c7b4b JSFrameworkType: J2K 2017-07-24 19:53:52 +02:00
Dmitry Jemerov
57a501ebce JSFrameworkType: rename to .kt 2017-07-24 19:53:52 +02:00
Pavel V. Talanov
8e3f8c4c14 Fix calling GSS.union for empty array
EA-104046
2017-07-24 18:56:19 +03:00
Pavel V. Talanov
d5ca46157a Refactor: Make DependenciesCache and ScriptDependenciesUpdater services
Rename: DependenciesCache -> ScriptDependenciesCache
    (makes sense to make name more specific since it is a service now)
2017-07-24 18:56:16 +03:00
Pavel V. Talanov
f1811e7f0e Minor, more precise error message 2017-07-24 18:56:14 +03:00
Kirill Rakhman
4c7ddbe397 "Use destructuring declaration" should not be available for top-level and class properties (#1205)
Fixes #KT-19167
2017-07-24 14:33:46 +02:00
Dmitry Petrov
f558b4238c Use counter loop in intrinsic array constructors
#KT-19149 Fixed Target versions 1.1.5
2017-07-24 10:17:30 +03:00
Dmitry Petrov
c9d9a8220d Minor: use IntrinsicMethods.INTRINSICS_CLASS_NAME where appropriate 2017-07-24 10:15:27 +03:00
Dmitry Petrov
fda89e9c72 Add test for KT-19128
It looks like the problem was caused by incorrect merging of
StrictBasicValues and was fixed by commit
904c7f9c64.

 #KT-19128 Fixed
2017-07-24 10:15:27 +03:00
Dmitry Petrov
d0c8af5621 Keep track of second receiver type in CallReceiver
#KT-17725 Fixed Target versions 1.1.5
2017-07-24 10:15:27 +03:00
Dmitry Petrov
3f34a97880 Minor: extract CallReceiver to a top-level class, move code around 2017-07-24 10:15:27 +03:00
Simon Ogorodnik
f079ed949c KT-19015: Enable multiarg completion for non-first argument
#KT-19015 fixed
2017-07-24 00:00:11 +03:00
Ilya Gorbunov
ec5c15f190 test-dagger-maven-example: kotlin version comes as a parameter 2017-07-21 20:15:34 +03:00
Ilya Gorbunov
d8ea3ddcc8 Cleanup poms of projects migrated to gradle 2017-07-21 20:15:34 +03:00
Alexander Udalov
f69e96b240 Fix IAE at protoDifferenceUtils.kt on new metadata field
The class_local_variable/package_local_variable JVM extensions were
added in 616d575fb6

 #KT-19155 Fixed
2017-07-21 20:11:43 +03:00
Nikolay Krasko
b6bd3e15c5 Fix outdated highlighting for Kotlin injected fragments (KT-18842)
Do not use cached value for injection in non-dispatch threads and throw
PCE if value isn't ready. Otherwise outdated value may be stored in
highlighting.

 #KT-18842 Fixed
2017-07-21 19:57:21 +03:00
Alexander Udalov
7f8e7c66f5 Suppress FNFE in .kotlin_metadata index
Similarly to VirtualFileKotlinClass.create.

This could happen for example when some files are removed from
kotlin-stdlib-common
2017-07-21 19:03:15 +03:00
Alexander Udalov
ebdf5aa223 Discriminate header classes in favor of non-header type aliases
In the test case, the problem was that Foo.a's type was resolved to the
_class A_, which was written to metadata on JVM instead of the class
AImpl with typealias A as an abbreviation. This metadata was incorrect
because there's no class A from the JVM compiler's point of view; that's
why the error "cannot access class A" was reported

 #KT-19151 Fixed
2017-07-21 19:03:15 +03:00
Mikhail Glukhikh
6ee94dae6f Code cleanup: KotlinSafeDeleteProcessor 2017-07-21 18:59:13 +03:00
Mikhail Glukhikh
d05a525d8d Search for KtTypeAlias in safe delete processor
Related to KT-16046
2017-07-21 18:59:07 +03:00
Mikhail Glukhikh
dd0cf8219e Add type aliases into UnusedSymbolInspection / safe delete
So #KT-16046 Fixed
2017-07-21 18:59:01 +03:00
Mikhail Glukhikh
951e8cd91a Code cleanup: unnecessary local variable applied 2017-07-21 18:58:48 +03:00
Mikhail Glukhikh
202fb19cf6 If-then to safe access: more correct receiver calculation
So #KT-18928 Fixed
2017-07-21 18:58:33 +03:00
Mikhail Glukhikh
31bb1cc0f9 Invoke back setting "show inline dialog for local variables"
So #KT-19130 Fixed
2017-07-21 18:58:27 +03:00
Kirill Rakhman
a7084ceb9b Fix some type hints related issues (#1204)
* Type hints shouldn't appear for negative literals
Fixes #KT-18974

* Make type hints work for destructuring declarations
Fixes #KT-18444

* Hide type hints for generic constructor calls if type arguments are explicitly specified
Fixes #KT-19167
2017-07-21 16:31:46 +02:00
Nikolay Krasko
f4038f7109 Fix slow typing because of counting injected fragments (KT-18842)
- cache result of kotlin injection on modification tracker
- never count injection in dispatch thread, use cached result instead
- compute injection with write action priority, reuse cache if unfinished

 #KT-18842 Fixed
2017-07-21 15:41:06 +03:00
Nikolay Krasko
436b637282 Refactoring: show using ProcessCancelException in method name 2017-07-21 15:41:06 +03:00
Nikolay Krasko
fbe16f7b91 Refactoring: delete unused CachedValueProperty class 2017-07-21 15:41:06 +03:00
Mikhail Glukhikh
1cb6128f2f Minor: J2K test fix 2017-07-21 12:21:04 +03:00
Dmitry Petrov
bf3e896464 Update 'this' extension receiver when there's a smart cast
If 'this' (implicit or explicit) was used as an extension receiver,
and the corresponding call required a smart-cast,
this information was effectively lost in "old" resolution & inference,
but is required by "old" JVM BE to generate proper CHECKCASTs.
2017-07-21 08:58:52 +03:00
Dmitry Petrov
c9d54d7110 Generate proper error candidates for type aliases
#KT-17745 Fixed Target versions 1.1.5
2017-07-21 08:58:12 +03:00
Dmitry Petrov
b4d8337ca5 Ignore test for 'primitive Char == object' in JS (KT-19081) 2017-07-21 08:52:29 +03:00
Dmitry Petrov
709a7e201f Simplify code for specialized BranchedValues 2017-07-21 08:52:29 +03:00
Dmitry Petrov
e1a55e8dec Prefer compact bytecode for primitive/object comparisons with Boolean
'java.lang.Boolean#valueOf' doesn't allocate new objects
(it uses pre-allocated singletons for 'true' and 'false').
2017-07-21 08:52:29 +03:00
Dmitry Petrov
8e9c0294fe Do not box primitives for 'primitive == object'
NB user-defined 'equals' can violate contract for 'Object#equals', e.g.,
it can be asymmetric.
Thus we can't avoid boxing for 'object == primitive'.
2017-07-21 08:52:29 +03:00
Dmitry Petrov
fa42f202fa Avoid boxing on 'primitive == boxed' when possible
Similar to 'boxed == primitive' case, different bytecode due to
evaluation order.
2017-07-21 08:52:29 +03:00
Dmitry Petrov
e440de3494 Minor: GeneratePrimitiveVsObjectEqualityTestData 2017-07-21 08:52:29 +03:00
Dmitry Petrov
98ee83f4a3 Minor: move condition for boxed==primitive to corresponding isApplicable 2017-07-21 08:52:29 +03:00
Dmitry Petrov
4cba600268 Minor: some more evaluation order tests for 'boxed == primitive' 2017-07-21 08:52:29 +03:00
Dmitry Petrov
81609e4c6f Generate complex equality comparison only when RHS can have side effects
In "short" version, LHS is always evaluated before RHS,
and RHS may be not evaluated if LHS is null.
So, it makes sense to use "short" version in cases when RHS can't have
side effects (because of more compact bytecode and more opportunities
for code elimination).
2017-07-21 08:52:29 +03:00
Dmitry Petrov
8aacddb9f0 Avoid primitive boxing for 'boxed == primitive' if possible
This makes sense for non-floating-point primitive type
(boolean, char, byte, short, int, long):
floating-point types use specialized versions of 'areEqual'.
2017-07-21 08:52:29 +03:00
Dmitry Petrov
275c758da1 Cleanup and move code around in BranchedValue
- Cleanup inspections
- Move optimized boxed-vs-primitive comparisons to a separate file
2017-07-21 08:52:29 +03:00
Dmitry Petrov
051ac44759 Verify bytecode after mandatory transformations and after optimizations 2017-07-21 08:52:29 +03:00
Simon Ogorodnik
7ed1669050 KT-19011: Fix import optimizing when extension functional type is used
It should check is extension functional type imported from companion
is actually called on companion instance

 #KT-19011 fixed
2017-07-21 03:08:06 +03:00
Dimach
65e603c1ed KT-13552: Fix J2K to generate else block while converting switch
#KT-13552 fixed
2017-07-20 23:35:11 +03:00
Mikhail Glukhikh
44790eccaf Use "unnecessary variable" inspection in J2K
Unused variables are no more treated as unnecessary
Related to KT-15958
2017-07-20 17:48:27 +03:00
Mikhail Glukhikh
39f1ef390e Do not report "redundant Unit" for generic calls coerced to Unit
So #KT-18999 Fixed
2017-07-20 17:48:20 +03:00
Mikhail Glukhikh
c554bfa20d Move: RemoveSetterParameterTypeInspection to inspections package 2017-07-20 17:48:14 +03:00
Mikhail Glukhikh
e154e4cf75 Move: RedundantUnitReturnTypeInspection to inspections package 2017-07-20 17:48:07 +03:00
Simon Ogorodnik
8f78446bff Minor: Clarify code for KT-18786: Fix J2K to move properties to top 2017-07-20 16:04:07 +03:00
Dmitry Jemerov
9213c4a1ab EA-104855 - (1.1.4) NPE: KotlinCommonBlockKt.isFirstParameter 2017-07-20 12:50:12 +02:00
Dmitry Jemerov
fbcc519098 Fix tests affected by annotation wrapping changes 2017-07-20 12:32:48 +02:00
Alexander Udalov
5128b8a409 Add default implementation for Annotations.findAnnotation 2017-07-20 13:27:34 +03:00
Alexander Udalov
def3f73fdd Use AnnotationDescriptor.fqName instead of type
Also use the annotationClass extension property instead of
TypeUtils.getClassDescriptor(annotation.type)
2017-07-20 13:26:13 +03:00
Alexander Udalov
541b9dab52 Introduce optimized BuiltInAnnotationDescriptor for built-in annotations
It's built on a FQ name and avoids resolution of the annotation class
descriptor as much as possible
2017-07-20 13:26:13 +03:00
Alexander Udalov
f39106f75c Do not use parameter descriptors in AnnotationDescriptorImpl 2017-07-20 13:26:13 +03:00
Alexander Udalov
eb205f620c Do not use parameter descriptors in most annotation implementations
Except AnnotationDescriptorImpl, which is refactored in the subsequent
commit.

Note that we no longer check the presence of parameters with the
corresponding names in the annotation class in
LazyJavaAnnotationDescriptor, this is why test data changed
2017-07-20 13:25:39 +03:00
Alexander Udalov
cc7ed2ba54 Change map key type in AnnotationDescriptor.getAllValueArguments
Turns out, only the parameter's name is needed at all usages of this
method. Such a map is both easier to use (no need to call
ValueParameterDescriptor.getName) and easier to construct (no need to
resolve annotation class, its constructor, its parameters). In this
commit, only usages have changed but the implementations are still using
the old logic, this is going to be refactored in subsequent commits
2017-07-20 13:25:39 +03:00
Alexander Udalov
41ea0e8ef8 Introduce AnnotationDescriptor.fqName
Could be used instead of ".annotationClass.fqName" to avoid the unneeded
resolution of the annotation class descriptor
2017-07-20 13:25:38 +03:00
Alexander Udalov
1d64b61a8f J2K AnnotationDescriptor, refactor implementations 2017-07-20 13:25:38 +03:00
Alexander Udalov
7ec67505c5 Optimize Annotations.isEmpty in some implementations 2017-07-20 13:25:38 +03:00
Alexander Udalov
9ee4b39e1b Provide default implementation for Annotations.findExternalAnnotation 2017-07-20 13:25:38 +03:00
Alexander Udalov
5636318eb4 Optimize DeserializedAnnotations in terms of memory traffic
Do not wrap every annotation object into an AnnotationWithTarget
2017-07-20 13:25:38 +03:00
Alexander Udalov
21197b53aa Do not load annotations on value parameter if there are none
Also fix an error in the doc in descriptors.proto
2017-07-20 13:25:38 +03:00
Alexander Udalov
c197db9c69 Remove some unnecessary lazy computations in LazyJavaClassDescriptor 2017-07-20 13:25:38 +03:00
Mikhail Glukhikh
bdc44ff4cf Unnecessary variable: do not start inlining in write action
So #KT-19110 Fixed

(cherry picked from commit 6325fb1)
2017-07-20 12:39:52 +03:00
Ilya Chernikov
e38aaf3e07 Fix xmx setting for the daemon in tests 2017-07-20 10:54:05 +02:00
Ilya Chernikov
17a189a24b Improve logging and exception handling in the daemon 2017-07-20 10:54:05 +02:00
Denis Zharkov
904c7f9c64 Fix nullable variables spilling in coroutines
See the last comment in testData for clarification

 #KT-18983 Fixed
2017-07-20 10:53:32 +03:00
Denis Zharkov
90e894b171 Use known jvm binary class for package part if possible 2017-07-20 10:53:09 +03:00
Denis Zharkov
99a10d8d63 Minor. Rename compactIfPossible -> compact
As ArrayList can always be compacted
2017-07-20 10:53:09 +03:00
Denis Zharkov
f454858bbb Optimize memory footprint for case of empty annotations in types
It seems that most of the simple types don't have any annotations,
so for that case it's worth removing the field from SimpleTypeImpl

Also introduce a NotNullSimpleType being used when replacing nullability
2017-07-20 10:53:09 +03:00
Denis Zharkov
f8a12a0ec3 Optimize JavaTypeResolver by avoiding using some language features
It's quite a hot point and using local functions with default
parameters seem to affect negatively to overall performance
(at least some of compiler benchmark have shown it)
2017-07-20 10:53:09 +03:00
Denis Zharkov
d7cee95d95 Call compactIfPossible where it's possible in BinaryJava*
It helps to avoid retaining a lot of redundant empty SmartList's
instances
2017-07-20 10:53:09 +03:00
Denis Zharkov
e2ce285ec3 Reduce memory footprint after functions substitution
Do not recreate new instances if descriptors' parts remain
effectively the same
2017-07-20 10:53:09 +03:00
Denis Zharkov
4a73fbb70a Reduce memory footprint of TypeSubstitutor
Avoid creating new instances if types remain unchanged
2017-07-20 10:53:09 +03:00
Denis Zharkov
4385ce8828 Reduce memory footprint for basic case of flexible types
The case is when we have a simple type constructor
(not array nor collection) and type is not raw:
A<T1, >..A<T1>?

Actually these types are almost equal besides of nullability,
but we create and resolve two different simple types,
they have different arguments' lists, etc.

The idea is to add NullableSimpleType subclass with delegate
to another simple type

It should help a lot both with common cases and with corner ones:
flexibles types in spark for Function22 having exponential size
because of its flexibility

 #KT-14375 Fixed
 #KT-14323 Fixed
2017-07-20 10:53:09 +03:00
Denis Zharkov
59f2ba98a6 Avoid creating SimpleType instances for default type 2017-07-20 10:53:09 +03:00
Denis Zharkov
8576054788 Use SmartList instead of SmartSet for overridden descriptors
SmartSet was used because it was the only lightweight collection
available in core, but now there is org.jetbrains.kotlin.utils.SmartList
2017-07-20 10:53:09 +03:00
Denis Zharkov
729f20ed81 Reduce memory size retained by LookupTrackerImpl
By default SmartList is used there for storing values of a multimap,
so a lot of duplicated items is stored there (file names are being
duplicated).

Even although there is a separate interner for these values,
retained memory size has been reduced for 30M when compiling `idea`
module in Kotlin project
2017-07-20 10:53:09 +03:00
Denis Zharkov
c7e6f200da Use SmartList for storing annotations in binary classes
Looks like in the most cases there are <= 1 annotations
in real declarations
2017-07-20 10:53:09 +03:00
Simon Ogorodnik
36ab31f2f7 Minor: fix test after merge 2017-07-20 02:30:34 +03:00
Toshiaki Kameyama
fe599463ac KT-18978 Intention Move to class body generates incorrect code for vararg val/var (#1188)
Intention Move to class body generates incorrect code for vararg val/var #KT-18978 Fixed
2017-07-20 01:29:56 +03:00
Dimach
a59021a25e KT-18786: J2K should move all properties to top of class
#KT-18786 fixed
2017-07-20 01:15:15 +03:00
Simon Ogorodnik
ccfcfd8721 Add benchmark for local completion and improve benchmarking 2017-07-19 21:18:58 +03:00
Dmitry Jemerov
4df6db141c Advance source stub version which wasn't advanced in 5d87276cf
#KT-19113 Fixed
2017-07-19 18:52:29 +02:00
Dmitry Petrov
891799c853 Generate 'Deprecated' annotation on invisible companion object field
Design decision: if the field for a companion object should have
non-public visibility, generate it with @Deprecated annotation in
language version 1.2.

TODO: generate it with proper visibility in 1.3 and later.

KT-11567 Companion object INSTANCE field more visible than companion object class itself
2017-07-19 17:38:17 +03:00
Dmitry Jemerov
951392005b Add options for wrapping local variable and property annotations
#KT-14950 Fixed
2017-07-19 15:03:00 +02:00
Dmitry Jemerov
050ff03b07 Implement wrapping options for enum constants
#KT-14126 Fixed
2017-07-19 15:02:59 +02:00
Dmitry Jemerov
7555bb6c3c Support formatting of 'where' clauses
#KT-14083 Fixed
2017-07-19 15:02:58 +02:00
Dmitry Jemerov
325e950bfe Reformat expression body property accessors
#KT-17394 Fixed
2017-07-19 15:02:52 +02:00
Dmitry Jemerov
4db8639bf8 Consistent name for option controlling spaces around .. 2017-07-19 15:02:50 +02:00
Dmitry Jemerov
31840fa328 Fix GradleLanguageFeatureQuickFixTest on Windows 2017-07-19 13:56:00 +02:00
Toshiaki Kameyama
366b9d1d79 KT-12195 Quickfix @JvmStatic on main() method in an object (#1192)
* Quickfix @JvmStatic on main() method in an object #KT-12195 Fixed

* Fixed #KT-12195
2017-07-19 13:37:12 +02:00
Toshiaki Kameyama
a8da79a130 KT-12504 Intention to make open class with only private constructors sealed (#1193)
* Intention to make open class with only private constructors sealed #KT-12504 Fixed

* Fixed #KT-12504
2017-07-19 13:36:36 +02:00
Nikolay Krasko
dd2a87dbf7 Rewrite test class to make it work on Windows
Stop using dummy file and assert result with assertEqualsToFile().

Previous version didn't work on Windows because of `\r`.
2017-07-19 13:25:17 +03:00
Nikolay Krasko
4e76975a52 Force OOB in accessors for properties without explicit type (KT-19062)
#KT-19062 Fixed
2017-07-19 12:45:06 +03:00
Nikolay Krasko
bcbff98382 Check OOB stays the same for string in super type constructor call 2017-07-19 12:45:06 +03:00
Pavel V. Talanov
41276c950b Update CodegenTestCase after rebasing on latest changes 2017-07-19 12:29:27 +03:00
Pavel V. Talanov
5faad493b4 Catch and report exceptions from DependenciesResolver 2017-07-19 12:29:25 +03:00
Pavel V. Talanov
eb5be038fa ScriptDependenciesUpdater: compute script contents synchronously 2017-07-19 12:29:22 +03:00
Pavel V. Talanov
9eb8cec5cf ScriptDependenciesUpdater: set job to null after processing result
Fix inconsistency introduced after extracting ScriptDependenciesUpdater
2017-07-19 12:29:20 +03:00
Pavel V. Talanov
537b1689b7 DependenciesCache: remove ad-hoc ScriptDependencies comparison 2017-07-19 12:29:17 +03:00
Pavel V. Talanov
b1ac451959 Make sure template classpath is always among script dependencies 2017-07-19 12:29:15 +03:00
Pavel V. Talanov
f84cc7fb5b Offload legacy dependency resolver work to a separate thread pool
This is mainly to improve experience for kdsl users before gradle migrates to new API
2017-07-19 12:29:12 +03:00
Pavel V. Talanov
bc399444ab Fix creating DependenciesResolver with default arguments 2017-07-19 12:29:09 +03:00
Pavel V. Talanov
7aee51fd77 Refactor ScriptDependenciesUpdater: improve readability a bit 2017-07-19 12:29:07 +03:00
Pavel V. Talanov
c0e08c61ee Minor: extract ScriptContentLoader::getEnvironment 2017-07-19 12:29:04 +03:00
Pavel V. Talanov
42629d6f8d ScriptDependenciesUpdater: use Job explicitly instead of futures
Cancel jobs without interrupting
2017-07-19 12:29:02 +03:00
Pavel V. Talanov
999c3c5e76 Rename services related to script dependencies
KotlinScriptConfigurationManager -> ScriptDependenciesManager
KotlinScriptExternalImportsProvider -> ScriptDependenciesProvider
2017-07-19 12:28:59 +03:00
Pavel V. Talanov
96db16a988 ScriptDependenciesUpdater, minor: improve isLastSentRequestCheck 2017-07-19 12:28:56 +03:00
Pavel V. Talanov
aacb9a437a Rename: dependenciesClasspath -> templateClasspath
Clearer distinction from additionalResolverClasspath
2017-07-19 12:28:54 +03:00
Pavel V. Talanov
96d8f685e9 Refactor KotlinScriptConfigurationManager: extract parts
Introduce ScriptDependenciesUpdater, DependenciesCache and ScriptContentLoader
2017-07-19 12:28:51 +03:00
Pavel V. Talanov
1b42095dc1 Support @AcceptedAnnotations for different kinds of resolvers 2017-07-19 12:28:49 +03:00
Pavel V. Talanov
1c412b4068 AsyncDependenciesResolver: provide implementation for sync resolve 2017-07-19 12:28:46 +03:00
Pavel V. Talanov
008c27d547 Compiler build depends on kotlinx-coroutines-core 2017-07-19 12:28:43 +03:00
Pavel V. Talanov
ee70a64e1c Minor, template providers: don't create classloader for empty classpath 2017-07-19 12:28:41 +03:00
Pavel V. Talanov
beb28a1c7d Gradle Kotlin DSL uses compiler-embdeddable jar when loading resolver 2017-07-19 12:28:38 +03:00
Pavel V. Talanov
5c18ab750b GradleScriptTemplateProvider: avoid duplicating template loading code 2017-07-19 12:28:36 +03:00
Pavel V. Talanov
6c3ce7adc1 ScriptTemplatesProvider: refactor dependency loading
Change dependenciesClasspath is of type List<File>
Add additionalResolverClasspath
2017-07-19 12:28:33 +03:00
Pavel V. Talanov
a77cd0ab09 Catch errors when instantiating script templates
If we throw from this code IDE becomes unusable

 #KT-18945 Fixed
2017-07-19 12:28:31 +03:00
Pavel V. Talanov
8ac17400ae ScriptDependenciesFileAttribute: fix TODOs 2017-07-19 12:28:28 +03:00
Pavel V. Talanov
75220e145b Minor: suppress deprecation warning 2017-07-19 12:28:26 +03:00
Pavel V. Talanov
cf57e5a7a1 Script templates: search for parameterless constructor of resolver 2017-07-19 12:28:23 +03:00
Pavel V. Talanov
10e14103b6 Propagate reports from script dependency resolver
Compiler: show as compiler messages
IDE: annotate code in a separate highlighting pass
2017-07-19 12:28:20 +03:00
Pavel V. Talanov
96c2a589c0 Support legacy resolver interface 2017-07-19 12:28:18 +03:00
Pavel V. Talanov
65dba3615c Update project code to use new script.runtime APIs 2017-07-19 12:28:15 +03:00
Pavel V. Talanov
375b058a28 Add coroutines-jdk8 to project 2017-07-19 12:28:13 +03:00
Pavel V. Talanov
1012a24afc Refactor: move KotlinScriptExternalImportsProviderImpl to 'cli' module 2017-07-19 12:28:10 +03:00
Pavel V. Talanov
b6a7d831bf Script IDE API: remove <TF: Any> 2017-07-19 12:28:08 +03:00
Pavel V. Talanov
581176fa90 AbstractScriptConfigurationTest: adapt to changes in API 2017-07-19 12:28:05 +03:00
Pavel V. Talanov
788eaf8a18 Refactor getting dependencies for script files API
Deprecate KotlinScriptDefinition#getDependenciesFor
Expose dependencyResolver as a property
KotlinScriptExternalImportsProvider is the component clients should be asking for dependencies
2017-07-19 12:28:02 +03:00
Pavel V. Talanov
ff391628de KSCM: fix wrong update on null return from Template.getDependenciesFor 2017-07-19 12:28:00 +03:00
Pavel V. Talanov
1834721880 KSCM: persist script dependencies between idea launches 2017-07-19 12:27:55 +03:00
Pavel V. Talanov
930d502b12 KSCM: rework async requests 2017-07-19 12:27:53 +03:00
Pavel V. Talanov
3c511f3f40 KSCM: temporary workaround gradle returning results in unstable order 2017-07-19 12:27:50 +03:00
Pavel V. Talanov
fb0e0e3767 Introduce ScriptDependenciesFileAttribute to persist script dependencies 2017-07-19 12:27:48 +03:00
Pavel V. Talanov
a2aeda7b2c Support async script dependency updates for annotation based templates
Do not try to cache dependencies for every script on startup
Schedule cache updates upon request as opposed to updating them synchronously
2017-07-19 12:27:45 +03:00
Pavel V. Talanov
b7fc909821 Split compiler and ide specific parts of script dependency caching
Move all caching logic to ide specific KotlinScriptConfigurationManager
Clean up apis
Remove logging when updating caches
2017-07-19 12:27:43 +03:00
Anton Bannykh
e43a145614 fixup: updated EXPECTED_REACHABLE_NODES 2017-07-19 12:24:09 +03:00
Anton Bannykh
6ed7eaf546 JS tests: changes to kotlin.test + the way compiler tests are generated. 2017-07-19 12:24:09 +03:00
Alexey Sedunov
eda747c0bf Minor: Fix tests 2017-07-19 11:34:30 +03:00
Roman Elizarov
f2b5f37b22 Support inline suspend functions built with compiler version less than 1.1.4/1.2-M1
The error message is removed and is replaced with a code that adapts
inline suspend functions produced by the old compiler with the
suspension markers that new compiler expects.
2017-07-19 08:59:55 +03:00
Roman Elizarov
9f0810f723 Pull implementations up from AbstractCoroutineContextElemenet
Fixes KT-18671
2017-07-19 08:59:43 +03:00
Alexander Udalov
c9b14c5a45 Reduce classpath for class loader in CodegenTestCase
There's no point in adding JDK (mock or full) roots to it, as well as
stdlib/reflect/test (they are loaded by the parent class loader, created
in ForTestCompileRuntime)
2017-07-18 20:10:07 +03:00
Alexander Udalov
743278d456 Fix ReplInterpreter on Java 9 2017-07-18 20:10:05 +03:00
Alexander Udalov
aa53fa7e15 Fix execution of simple .kts scripts on Java 9 2017-07-18 20:10:05 +03:00
Alexander Udalov
bc2c958a2e Remove unused class GenericRepl 2017-07-18 20:10:05 +03:00
Alexander Udalov
36001ff931 Do not allow to access compiler internals in .kts scripts
Set parent class loader to null explicitly instead of the system class
loader
2017-07-18 20:10:05 +03:00
Alexander Udalov
d1603c4329 Minor, move deserializeToDescriptor to package kotlin.reflect.jvm.internal
To prevent binary-compatibility-validator from reporting it as a public
API; that happens because the signature is different after the
gradle-shadow-plugin is applied
2017-07-18 20:09:24 +03:00
Yan Zhulanow
00225b3de3 Use compiling evaluator only if there is non-inline lambda or a loop in the bytecode 2017-07-18 18:22:30 +03:00
Yan Zhulanow
a6925e0d0f Minor: Fixes after review 2017-07-18 18:22:29 +03:00
Yan Zhulanow
904b693571 Pass byte array more efficiently
Filling byte[] values is especially slow on Android (>3000ms to fill a byte[3000] on emulator).
2017-07-18 18:22:28 +03:00
Yan Zhulanow
069579fd79 Debugger: Disable code interpreting by default in evaluator
Provide the compiled bytecode to debugger instead of interpreting the expression by default.
This significantly increases evaluation speed in numerous cases, e.g. `(1..10000).map { it.toString() }.count()`.
Leave interpreter mode as a fallback.

Android does not provide decent in-memory class loading support.
Moreover, we need to run dex on the compiled classes, and it required significant time.
So for now compiling evaluator for Android is available only in Android O, and only if there're any local classes or non-inline lambdas (evaluator didn't work for them before so we may consider this change as an improvement).
2017-07-18 18:22:28 +03:00
Yan Zhulanow
4851a83a83 Android Extensions: put new functionality under the flag 2017-07-18 18:10:30 +03:00
Yan Zhulanow
77eafb9716 Kapt: Map kaptGenerateStubsKotlin task classpath properly, ensure the destination for compileKotlin isn't in it (KT-18799) 2017-07-18 18:10:29 +03:00
Yan Zhulanow
83f9835e00 Android Exensions: Add kotlin-android-extensions-runtime dependency automatically in Gradle plugin 2017-07-18 18:10:28 +03:00
Yan Zhulanow
b303fa9caa Android Extensions: Fixes after review 2017-07-18 18:10:27 +03:00
Yan Zhulanow
7b238e0b21 Android Extensions: Add SparseArray implementation for the View cache (KT-18250) 2017-07-18 18:10:26 +03:00
Yan Zhulanow
fbfd51e97e Minor: Group plugin modules 2017-07-18 18:10:25 +03:00
Yan Zhulanow
820f914d35 Remove obsolete kapt2 implementation 2017-07-18 18:10:24 +03:00
Yan Zhulanow
423a09e46a Android Extensions: Support LayoutContainer in code generation 2017-07-18 18:10:23 +03:00
Yan Zhulanow
a69f9729e0 Android Extensions: Use Activity and Fragment supertypes in INVOKE_VIRTUAL calls instead of the user implementation class names 2017-07-18 18:10:22 +03:00
Yan Zhulanow
d4b4bc71ee Android Extensions: Support @ContainerOptions in compiler plugin 2017-07-18 18:10:21 +03:00
Yan Zhulanow
6e1dd08fbb Android Extensions: Add runtime library with LayoutContainer and its options 2017-07-18 18:10:20 +03:00
Yan Zhulanow
1a1db5a6f1 Android Extensions: Support cache in custom Views 2017-07-18 18:10:19 +03:00
Yan Zhulanow
c9cd1a4d75 Minor: Android Extensions compiler plugin refactoring 2017-07-18 18:10:18 +03:00
Yan Zhulanow
0494862ce5 Minor: Move Android Extensions compiler plugin tests to some other package 2017-07-18 18:10:17 +03:00
Yan Zhulanow
303b246a49 Minor: Move AndroidExtensionsReportSubmitter to other KAE files 2017-07-18 18:10:16 +03:00
Yan Zhulanow
e037cafe18 Use descriptor modality in IDE inspections/intentions
This fixes KT-18160, KT-18194, KT-18195, KT-18197 ~
2017-07-18 18:10:15 +03:00
Yan Zhulanow
942fa7719a Android Extensions: Add synthetic property highlighting 2017-07-18 18:08:33 +03:00
Yan Zhulanow
f7786a42ab Android Extensions: Show warning on a dot-call of a reference which is missing in some configurations (KT-18012)
When more than one layout configuration is available, a particular resource (view or fragment) may be absent in some of them.
We should show a warning on such resource reference calls as the call may lead to NPE.
2017-07-18 18:08:32 +03:00
Yan Zhulanow
f4acf404ca Android Extensions: Support Android variants and library dependencies (KT-14086, KT-16934) 2017-07-18 18:08:31 +03:00
Yan Zhulanow
8e9a62d553 Kapt: Add gradle warnings for Android projects
1. When the old kapt (aka kapt1) is used
2. (for Android projects) When Kotlin plugin is applied but annotationProcessor (Java-only) dependencies are found
2017-07-18 18:08:29 +03:00
Toshiaki Kameyama
865f9d4c7e Wrong caption "Change to property access" for Quick Fix to convert class instantiation to object reference #KT-13870 Fixed (#1189) 2017-07-18 15:47:43 +02:00
Mikhail Glukhikh
987c7f5be8 Add "unnecessary local variable" inspection #KT-15958 Fixed 2017-07-18 16:37:47 +03:00
Dmitry Neverov
9d06a80519 Do not report "property can be private" on JvmField properties
So #KT-18970 Fixed
2017-07-18 15:48:10 +03:00
Nikolay Krasko
5281602381 Don't ignore filters in smart step over for inline calls 2017-07-18 14:39:55 +03:00
Nikolay Krasko
f664ffb06b Check correspondent call on end token for better step over (KT-18949)
#KT-18949 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko
d282f14eac Don't add double linenumber when return expression is absent (KT-18949)
#KT-18949 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko
a41c9d2476 Avoid state machine build for suspend function with single inline call
#KT-18949 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko
ce4f923ba0 Replace return with nop to avoid merging line instructions (KT-18949)
Dex ignores subsequent line numbers for same instructions and interprets
instruction after inline as if they were inlined. This makes debugger
behaves as if there's nowhere to stop on line with breakpoint.

This also makes stepping through inline function consistent with
non-inline analog. In both context debugger now stops on '}'.

 #KT-18949 Fixed
 #KT-17120 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko
fc685aa03f Refactoring: extract common part to function 2017-07-18 14:39:54 +03:00
Nikolay Krasko
179ec84684 Refactoring: mark getTopmostElementAtOffset() as not-null 2017-07-18 14:39:54 +03:00
Mikhail Glukhikh
c0e1b3ef2d CFG: fix label binding for last instruction of finally block
So #KT-18698 Fixed
2017-07-18 14:37:13 +03:00
Mikhail Glukhikh
ab0e734e7d PseudocodeLabel: add slightly better exception diagnostics 2017-07-18 14:36:42 +03:00
Mikhail Glukhikh
9a5b5393f5 Code cleanup: CFG (several inspections applied) 2017-07-18 14:36:18 +03:00
Mikhail Glukhikh
43f9035d07 Minor test fix 2017-07-18 13:51:27 +03:00
Toshiaki Kameyama
f8cf0f2ab9 Misleading quick fix message for an 'open' modifier on an interface member #KT-18738 Fixed 2017-07-18 18:59:22 +09:00
Alexey Sedunov
d2dbc47454 Create from Usage: Remove extra space before type parameters list
#KT-16352 Fixed
2017-07-17 16:09:57 +03:00
Alexey Sedunov
e98af7bfc1 Create Class from Usage: Use type parameter bounds as supertypes
#KT-15242 Fixed
2017-07-17 16:09:55 +03:00
Alexey Sedunov
95769dc9d3 Create from Usage: Make property lateinit where possible
#KT-17651 Fixed
2017-07-17 16:09:54 +03:00
Alexey Sedunov
e9bf1d2ab8 Create from Usage: Add test for KT-17537
#KT-17537 Fixed
2017-07-17 16:09:53 +03:00
Alexey Sedunov
0365d3a3d6 Create from Usage: Do not create type parameter by constuctor reference
#KT-17353 Fixed
2017-07-17 16:09:52 +03:00
Alexey Sedunov
2e76a76088 Control Flow: Fix CFG usage info for double-colon expressions
#KT-12551 Fixed
 #KT-17092 Fixed
2017-07-17 16:09:51 +03:00
Alexey Sedunov
216b28ec55 Implement Members: Do not generate 'header' keyword
#KT-18466 Fixed
2017-07-17 16:09:50 +03:00
Alexey Sedunov
26d6088c82 Create from Usage: Infer expected type for lambda body
#KT-18186 Fixed
2017-07-17 16:09:49 +03:00
Alexey Sedunov
b48feb257c Create from Usage: Create data class property from destructuring entry
#KT-18540 Fixed
2017-07-17 16:09:48 +03:00
Simon Ogorodnik
a212a1bf72 Put all internal actions under Tools | Kotlin | Internal group 2017-07-17 16:03:10 +03:00
Simon Ogorodnik
4cdc3fdde9 KT-14606: Never compute decompiled text in BasicLookupElementFactory
#KT-14606 fixed
2017-07-17 16:03:07 +03:00
Simon Ogorodnik
6036c95511 Prevent KotlinDecompiledFileViewProvider from reading vfile when possible 2017-07-17 16:03:04 +03:00
Simon Ogorodnik
bc5872dd8f Add completion benchmark to check completion speed 2017-07-17 16:03:02 +03:00
Nikolay Krasko
dfef1f4921 Add reference equality shortcut for equals() in light members 2017-07-17 14:50:59 +03:00
Nikolay Krasko
44ed903303 Implement equivalence of light members by origin when possible
Previous implementation worked through equality that used equality
of method stubs (see LightMemberOriginForCompiledMethod). But method
stubs for compiled element can be recreated when caches are outdated,
including weak reference cleaning (see ClsJavaStubByVirtualFileCache).

This could cause misbehave of find usages when java reference has an
outdated version of light element in resolution cache.
2017-07-17 14:50:59 +03:00
Toshiaki Kameyama
fda097fc3b Correct "before" sample in description for intention Convert to enum class #KT-18722 Fixed (#1196) 2017-07-17 13:03:15 +02:00
Dmitry Jemerov
6baa8614e6 Fix JS tests in AbstractConfigureKotlinTest 2017-07-17 12:09:11 +02:00
Dmitry Jemerov
2c2b64d44a AbstractConfigureKotlinTest: J2K 2017-07-17 12:09:10 +02:00
Dmitry Jemerov
4198a5c3ec AbstractConfigureKotlinTest: rename to .kt 2017-07-17 12:09:09 +02:00
Dmitry Jemerov
0e6c9a96c7 Specify library kind when configuring library in tests 2017-07-17 12:09:04 +02:00
Dmitry Jemerov
060b8e0025 ConfigLibraryUtil: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
921db30c90 ConfigLibraryUtil: rename to .kt 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
0fa09adf17 Provide library kind for common libraries; get rid of autodetection 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
c7e85ea28f Better encapsulate JS library detection 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
b8d453eec3 Set library kind when importing projects from Maven 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
608f5892f9 Set library kind when importing projects from Gradle 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
902fe1f5ce Implement explicit library kind for JS libraries, don't autodetect 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
1367e6f303 Get library versions directly, not through LibraryPresentationProvider 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
2d1ac69986 JSLibraryStdDescription: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
5f3366d60b JSLibraryStdDescription: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
c185730846 KotlinJsModuleConfigurator: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
ffb3e2fcbc KotlinJsModuleConfigurator: rename to .kt 2017-07-17 11:58:57 +02:00
Dmitry Jemerov
1f6788ac31 Fix CodeConformanceTest on Windows 2017-07-17 11:57:03 +02:00
Nikolay Krasko
b3e9dfcea9 Minor: fix weak warnings and formatting in KotlinReferencesSearcher.kt 2017-07-17 12:25:06 +03:00
Nikolay Krasko
d93e0adc4f Do not wrap to light elements if Kotlin search is requested (KT-19054)
#KT-19054 Fixed
2017-07-17 12:25:06 +03:00
Dmitry Petrov
8c7352e668 Generate constant "" for effectively empty string 2017-07-17 09:18:41 +03:00
Knize
389c7d03b7 KT-6676 Show enum ordinal in quickdoc (#1165)
KT-6676: Show enum ordinal in quickdoc

 #KT-6676 fixed
2017-07-14 22:28:16 +03:00
Simon Ogorodnik
cc8933c82b KT-17074: Make completion respect DslMarker's
#KT-17074 fixed
2017-07-14 21:06:43 +03:00
Alexander Udalov
3c04ca4397 Update KotlinVersion.CURRENT to 1.1.5 2017-07-14 21:03:06 +03:00
Alexander Udalov
2611c7de7e Restore anonymous classes for local delegate metadatas in inline functions
The problem is that now that the local delegated property metadata is in
the $$delegatedProperties array of the containing class, the access to
it from code calling an inline function with a local delegated property
is illegal.

Currently it seems to be a lot of work to support this rather rare case
properly (see the comment in ExpressionCodegen.getVariableMetadataValue)
so we postpone it and return the old behavior of using the anonymous
KProperty subclass for metadata
2017-07-14 15:13:12 +03:00
Alexander Udalov
616d575fb6 Support reflection for local delegated properties
#KT-15222 Fixed
2017-07-14 15:13:12 +03:00
Alexander Udalov
c444c4d10b Ignore $$delegatedProperties in light analysis mode tests
For tests with local delegated properties, this field is generated in
the full mode, but is not generated in the lite mode because local
variables are not analyzed properly in the lite mode
2017-07-14 15:04:05 +03:00
Alexander Udalov
db27a885f1 Rework property metadata generation for local delegated properties
Instead of generating an anonymous class for each delegated local
variable, store metadatas in the $$delegatedProperties array of the
containing class, as is done for member properties
2017-07-14 15:04:05 +03:00
Alexander Udalov
9344f7f42f Remove unused and obsolete code in JVM backend 2017-07-14 15:04:05 +03:00
Alexander Udalov
728de91140 Refactor generation of metadata for delegated properties
In CodegenAnnotatingVisitor, store all delegated properties whose
metadata should be generated in each class (identified by ASM Type).
Use the stored information later, both in the $$delegatedProperties
array generation and in the access to it from property's accessor
methods, instead of an heuristical indexOfDelegatedProperty()
2017-07-14 15:04:04 +03:00
Alexander Udalov
b97589b33e Remove CodegenBinding.LOCAL_VARIABLE_DELEGATE
Calculate this value at call sites explicitly instead
2017-07-14 15:04:04 +03:00
Alexander Udalov
66ea288be7 Minor, extract fakeDescriptorsForReferences.kt 2017-07-14 15:04:04 +03:00
Stanislav Erokhin
9e98c11114 [NI] Minor. Change return type substitute function to not null 2017-07-14 12:43:09 +03:00
Stanislav Erokhin
2602216039 [NI] Use NewTypeSubstitutor when create descriptor with fresh variables. 2017-07-14 12:43:09 +03:00
Stanislav Erokhin
652676dc71 [NI] Introduce transactions for constraint system.
This will be used for callable reference resolution.
2017-07-14 12:43:09 +03:00
Stanislav Erokhin
cb494c46d7 [NI] Add initial constraint to IncorporationConstraintPosition 2017-07-14 12:43:08 +03:00
Stanislav Erokhin
c767545d4c Minor. Remove unused CandidateWithBoundDispatchReceiver#copy 2017-07-14 12:43:08 +03:00
Stanislav Erokhin
ac06060260 [NI] Minor. Drop unused CommonSupertypeCalculator 2017-07-14 12:43:08 +03:00
Stanislav Erokhin
0404fbc092 [NI] Minor. Rename LambdaAnalyzer to KotlinResolutionCallbacks 2017-07-14 12:43:08 +03:00
Dmitry Petrov
178e3e2c98 [NI] Update argument types on call completion using nested calls resolution 2017-07-14 12:43:07 +03:00
Dmitry Petrov
4448637727 [NI] Support calling abstract class constructor in delegating call 2017-07-14 12:43:07 +03:00
Dmitry Petrov
549e8ba668 [NI] Use ALWAYS_SUITABLE_RECEIVER when no receiver is available
(as in "old" resolution & inference)

This fixes issues with Java static members access.
2017-07-14 12:43:07 +03:00
Dmitry Petrov
2bdeef7970 [NI] Postprocess lambda result expressions on call completion
Should update type to denotable, e.g.,
IntegerValueType(x) to proper numeric type.

TODO extract common code into some ValueArgumentPostprocessor
2017-07-14 12:43:07 +03:00
Dmitry Petrov
1d6ed4ef8e [NI] Update lambda result types.
When completing calls, update return types for functional descriptors
for lambdas using type inference results.

Add toString to some Call subclasses (for debugging purposes).
2017-07-14 12:43:06 +03:00
Dmitry Petrov
2bf252afe6 [NI] Introduce lambda result dependency edges
Given a lambda result type R_L with constraint R_L <: T,
for each constituent type variable V in T with variance matching
approximation direction for V, consider a dependency edge V -> R
(lambda-result-dependency).

E.g., given a constraint:
    R <: Out<V>
where V is approximated down (to sub-type).
After R is fixed, we obtain constraint
    Out<T> <: Out<V>
which is incorporated as
    T <: V
which is a relevant constraint for V.
2017-07-14 12:43:06 +03:00
Dmitry Petrov
13e8720ddc [NI] Keep track of fresh type variables created for particular call candidate
Otherwise we can't obtain inferred type arguments for the call,
which is required for reification.
2017-07-14 12:43:06 +03:00
Dmitry Petrov
eb7e9196b5 [NI] Fix some argument mapping problems
1. Value arguments for the resolved call are indexed with resulting
descriptor value parameters (which can be substituted).

2. Simple argument can be a single vararg element if the corresponding
value parameter is a vararg parameter.

3. Resulting descriptor should be approximated to super-type.
This doesn't affect type inference, but the JVM BE expects types with
proper classifiers.
2017-07-14 12:43:06 +03:00
Stanislav Erokhin
0c79949cf1 [NI] Implement NewTypeSubstitutor 2017-07-14 12:43:05 +03:00
Stanislav Erokhin
ff8a57dc26 [NI] Implement New CommonSuperTypeCalculation 2017-07-14 12:43:05 +03:00
Stanislav Erokhin
6aac67aa7e [NI] Approximate captured types when set them into variable.
Also do not store type with captured type inside possible types.
It is hack for now, but without it captured types can flow to
resolution and exception will be thrown.
2017-07-14 12:43:05 +03:00
Stanislav Erokhin
397103f9d0 [NI] Fix smart cast for expression with captured input type. 2017-07-14 12:43:05 +03:00
Stanislav Erokhin
73cc1fdd9c [NI] Resolve type variable to Nothing for TO_SUBTYPE direction. 2017-07-14 12:43:04 +03:00
Stanislav Erokhin
6e24b0f89d [NI] Approximate captured types when we resolve type variable TO_SUPER. 2017-07-14 12:43:04 +03:00
Stanislav Erokhin
53caa84db9 [NI] Add constrains even we try add constraint like TypeVariable <: CapturedType from subtyping.
If such captured type has lower type, then from TypeVariable <: lowerType => TypeVariable <: CapturedType.
2017-07-14 12:43:04 +03:00
Stanislav Erokhin
657c332a1f [NI] Do not run "or" branches for constraint subtyping.
We should never do that, because otherwise we can get unexpected result.
  Example for input constraint: C(in String) <: T.
  If we run usual subtyping algorithm, then we get 2 constraints:
  C(in String) <: T and T <: String.
  Of course such system has contradiction.
2017-07-14 12:43:04 +03:00
Stanislav Erokhin
0fadf0bf70 [NI] Approximate captured types before type variable fixation.
We prefer denotable types when we solve constraint system.
I.e. if for T we have not equality constraint with captured type we can approximate captured type to denotable type.
2017-07-14 12:43:03 +03:00
Stanislav Erokhin
b4bf534d29 [NI] Capture from supertypes of type parameter.
This works by accident in OI, so this should be supported by new inference.
2017-07-14 12:43:03 +03:00
Stanislav Erokhin
c4ddc7a3a6 [NI] Store stub resolved call to trace because some clients read this before all calls are completed.
This is bad idea, but this is how it works in old inference.
Now we just save old behaviour.
Future plan: fix checks where we get unfinished resolved calls.
2017-07-14 12:43:03 +03:00
Stanislav Erokhin
78f8d29a4c [NI] Fix find maximally specific for NI. 2017-07-14 12:43:03 +03:00
Dmitry Petrov
d67b51e91a [NI] Support wrong number of type arguments and integer constants.
- report WRONG_NUMBER_OF_TYPE_ARGUMENTS
- make integral types work again: IntegerValueType is represented as {Int & Byte & Short & Long} in the constraint system
2017-07-14 12:43:02 +03:00
Dmitry Petrov
f5c59b1343 [NI] Report special error message on constant expression type mismatch. 2017-07-14 12:43:02 +03:00
Dmitry Petrov
5afd3e72d6 [NI] Report diagnostic on abstract class instantiation. 2017-07-14 12:43:02 +03:00
Stanislav Erokhin
b012681a53 [NI] New inference -- initial commit. 2017-07-14 12:43:02 +03:00
Dmitry Petrov
036090be91 Support intersection type in TypeUtils.contains(...) 2017-07-14 12:43:01 +03:00
Stanislav Erokhin
e8501c7d54 Add method replaceType for ReceiverValue.
This method will used for capturing from expressions before call resolution.
2017-07-14 12:43:01 +03:00
Nikolay Krasko
1dcdb72a49 Process UastContext service absence (EA-100670) 2017-07-14 12:39:13 +03:00
Dmitry Jemerov
448dba3f78 License-related cleanup 2017-07-14 11:09:45 +02:00
Ilya Chernikov
84a812df19 Drop forced in-process compilation (as interface compatibility is resolved) 2017-07-13 15:45:34 +02:00
Dmitry Jemerov
9b37e76b14 Don't trigger update check when an in-memory file is modified
#KT-18954 Fixed
2017-07-13 12:50:15 +02:00
Mikhail Zarechenskiy
2d3ce89afc Use only completed arguments of special call 2017-07-13 12:26:03 +03:00
Dmitry Petrov
a687dea898 Introduce special IrDeclarationOrigin's for for-loop variables
FOR_LOOP_ITERATOR
 - temporary variable for for-loop iterator

FOR_LOOP_VARIABLE
 - `x` in `for (x in xs)`

FOR_LOOP_IMPLICIT_VARIABLE
 - temporary variable for for-loop with destructuring, e.g.:
   for ((x, y) in xys)
   =>
   for (tmp in xys) {
     val (x, y) = tmp
   }
2017-07-13 10:59:51 +03:00
Andrius Semionovas
1cab0d09ab KT-18979 Add val to proper place for 'Add val/var' intent 2017-07-13 01:20:24 +03:00
Alexander Udalov
f01de3a935 Minor, move lateinit tests into a subdirectory 2017-07-12 18:59:02 +03:00
Alexander Udalov
b2b492447f Maven plugin: initial support for Java 9 modules 2017-07-12 18:58:36 +03:00
Alexander Udalov
848edc14cb Maven plugin: fix warnings, update copyrights 2017-07-12 18:58:35 +03:00
Alexander Udalov
1d46070bd5 Minor, remove unneeded codegen test
This test is already present in compiler/testData/cli/jvm/
2017-07-12 18:58:35 +03:00
Mikhael Bogdanov
b2a7fb9534 Update ChangeLog.md for 1.1.4-EAP-11 2017-07-12 16:33:25 +02:00
Mikhael Bogdanov
b15cfeb0a0 Add 1.1.3-2 changes 2017-07-12 16:33:25 +02:00
Mikhael Bogdanov
ef003db020 Update ChangeLog.md for 1.1.3 2017-07-12 16:33:25 +02:00
baratynskiy
0b6ef5f291 Make idea-full exported in tests-common module because kapt3 tests use KotlinTestUtils.assertEqualsToFile which uses Editor defined in idea-full 2017-07-12 17:25:32 +03:00
baratynskiy
a288b8d318 Add jsr305.jar to intellij-core because guava-19.0 jar depends on Nullable defined in jsr305.jar 2017-07-12 17:25:32 +03:00
Anton Bannykh
0935ed41d4 JS: return exit code from the NodeJs kotlinc-js wrapper 2017-07-12 17:19:59 +03:00
Dmitry Petrov
da404de51e Add comment regarding testData generation to RangeValues.kt 2017-07-12 16:23:36 +03:00
Dmitry Petrov
2849e19af5 Add test for indices.reversed() 2017-07-12 15:56:29 +03:00
Dmitry Petrov
6a673a03e4 Generate test data for in-expression tests, fix bug with indices 2017-07-12 15:56:29 +03:00
Igor Chevdar
890c6a9983 Regenerated box tests 2017-07-12 15:12:34 +03:00
Igor Chevdar
fd380f7545 Split up test on map access onto two tests: stdlib & compiler box test 2017-07-12 15:12:33 +03:00
Mikhail Zarechenskiy
14890890b1 Minor, get rid of unchecked cast 2017-07-12 14:37:27 +03:00
Mikhail Zarechenskiy
ee173077c0 Simplify diagnostic when there are wrong number of type arguments
#KT-12767 Fixed
2017-07-12 14:37:27 +03:00
Mikhail Zarechenskiy
e82c909f75 Use more specific status to report diagnostics
#KT-12737 Fixed
2017-07-12 14:37:26 +03:00
Mikhail Zarechenskiy
178bb900b4 Introduce inapplicable wrong receiver status to improve diagnostics
#KT-10754 Fixed
2017-07-12 14:37:26 +03:00
Mikhail Zarechenskiy
79ee8f452c Add test for obsolete issue
#KT-12688 Obsolete
2017-07-12 14:37:26 +03:00
Toshiaki Kameyama
848f7423ee Do not report "can be private" on properties of private class
So #KT-18822 Fixed
2017-07-12 10:35:10 +03:00
Dmitry Petrov
f4d63158cc Take into account JvmName annotation when generating accessors
#KT-17444 Fixed Target versions 1.1.5
2017-07-12 09:37:16 +03:00
Dmitry Petrov
efb6756cbc Initialize property metadata array before class body generation
Initialization of companion object members (e.g., delegate properties
using provideDelegate convention) can depend on property metadata array,
which in turn can be initialized before other class members.

 #KT-18902 Fixed Target versions 1.1.5
2017-07-12 09:37:16 +03:00
Dmitry Petrov
8a9707c140 Generate proper initialization for possibly nullable SAM wrapper
#KT-18916 Fixed Target versions 1.1.5
2017-07-12 09:37:16 +03:00
Yan Zhulanow
b99007961f NoArg: Do not invoke initializers by default. Require "invokeInitializers" option to be set explicitly (KT-18667, KT-18668) 2017-07-12 00:17:24 +03:00
Yan Zhulanow
a983137978 Kapt: Handle parameter with Java names clashing with Java keywords properly (KT-18377) 2017-07-12 00:17:23 +03:00
Alexey Tsvetkov
e56e3d78c8 Use ANSI escape codes only with CLI tools
Before this change jansi was used by the compiler,
unless "kotlin.colors.enabled" is not set to false.
This caused multiple issues in different build systems,
where newer or older version of jansi could crash the JVM
since it uses native code.

The following short term solutions were discussed:
* Set "kotlin.colors.enabled" to false where jansi is not needed
(basically in any build system).
* Set "kotlin.colors.enabled" to true where jansi is needed,
and use it only when the system property is set to true.

Escaped codes are only needed in CLI tools (kotlinc, REPL),
so the second solution is preferred (less places to set the property).

     #KT-17031 fixed
     #KT-18874 fixed
     #KT-18927 fixed
2017-07-11 21:03:11 +03:00
Kirill Rakhman
cb19a86c44 Add "simplify if with constant" inspection #KT-17919 Fixed 2017-07-11 20:00:33 +03:00
Alexey Andreev
7634673213 Fix module re-importing when inlining functions in JS BE
When inliner reads function's body from other module, it performs
substitution _ -> moduleAlias. However, local alias can't be used
for this purpose, since call site can be in public inline function
itself, so the correct substitution would be -> _.$$imports$$.alias
2017-07-11 19:27:08 +03:00
Mikhail Glukhikh
cc4e55b829 Add groupPath/Name, change displayName for null checks -> safe call
Related to KT-14799
2017-07-11 19:25:38 +03:00
Dimach
7407083624 Add inspection to simplify successive null checks #KT-14799 Fixed 2017-07-11 18:47:26 +03:00
Ilya Chernikov
fc12f37105 Rolling back commits related to Unit -> Void? confersion in RMI interface
since it breaks the compatibility and doesn't actually help - the problem
with NoClassDef Unit is apparently elsewhere.
2017-07-11 15:06:38 +02:00
Ilya Chernikov
3da5ba4efe Switch to the newer gradle plugin, fix jansi problem, in-process compiling in gradle parts
Switching to in-process to avoid compilation warnings caused by introduced
daemon interface changes.
Switching to the gradle plugin 1.1.3 causes jansi incompatibility in
in-process compilation mode, so disabling jansi usage to avoid it.
2017-07-11 15:06:37 +02:00
Mikhail Glukhikh
0ca5c0fcc6 Refactoring (clone remove) of LiftAssignmentOutOfTryFix
Related to KT-18830
2017-07-11 15:28:45 +03:00
Toshiaki Kameyama
8cc9330e63 Introduce "Lift return out of try" intention #KT-18830 Fixed 2017-07-11 15:14:30 +03:00
Toshiaki Kameyama
8f9b680fc6 Support generic type parameters in 'Specify return type explicitly'
So #KT-18074 Fixed
2017-07-11 14:39:22 +03:00
Toshiaki Kameyama
0af3c6542d Correct "after" sample for intention "Convert to apply" #KT-18723 Fixed 2017-07-11 14:06:01 +03:00
Alexey Andreev
5a9adcca2d Improve performance of JS tests
* Do not read protos for descriptors of stdlib and kotlin-tests
  repeatedly
* Parse libraries lazily in inline, so that when no inline function
  exist in a test, we won't parse huge kotlin.js file
* Speed-up source map parser
2017-07-11 11:06:52 +03:00
Dmitry Petrov
83ec8aa918 typealias expansion fixes
- Exception on dynamic type in typealias argument expansion
 #KT-18858 Fixed Target versions 1.1.5
- Wrong report location for repeated annotations in typealias arguments
 #KT-18940 Fixed Target versions 1.1.5
- Don't drop type annotations for dynamic type
 #KT-18944 Fixed Target versions 1.1.5
2017-07-11 10:33:39 +03:00
Nikolay Krasko
a0f11f773b Better diagnostic for error configuration in debugger tests 2017-07-10 15:32:42 +03:00
Nikolay Krasko
68e0727894 Force space between { and first enum entry (KT-18863)
#KT-18863 Fixed
2017-07-10 15:32:42 +03:00
Nikolay Krasko
7f8d6b3008 Don't move line and /**/ comments during reformat (KT-18805)
#KT-18805 Fixed
2017-07-10 15:32:42 +03:00
Mikhail Glukhikh
ebdadf30d8 Get rid of redundant toMap() calls in DelegatingDataFlowInfo 2017-07-10 14:51:52 +03:00
Mikhail Glukhikh
8c9ace7d40 Get rid of Guava in DelegatingDataFlowInfo (except Multimap things) 2017-07-10 14:35:01 +03:00
Mikhail Glukhikh
564cc27a1d Get rid of Guava in CFA (except Multimap things) 2017-07-10 14:34:48 +03:00
Mikhail Glukhikh
dfe2c16bc7 More cleanup: lift return / assignment out 2017-07-10 12:59:58 +03:00
Alexander Udalov
9269de721e JPS: use module path instead of classpath for modular projects
No test added because it would involve running javac 9 and because tests
run JavaBuilder in the same process, this would require either a new
module in our project with dependency on JDK 9 (which would require
everyone to install JDK 9), or complex code that runs javac in another
process
2017-07-10 12:48:21 +03:00
Alexander Udalov
03a6488464 Use module path instead of class path for stdlib on Java 9
Also report the "named does not read unnamed" error, which was not
possible previously because we wouldn't be able to read anything from
kotlin-stdlib (because it was added to the unnamed module by default)
2017-07-10 12:48:21 +03:00
Alexander Udalov
c94b21edd5 Remove obsolete code about runtime versions conflict 2017-07-10 12:48:21 +03:00
Alexander Udalov
4128064f87 Move JavaModuleGraph from 'frontend.java' to 'cli' 2017-07-10 12:48:21 +03:00
Alexander Udalov
5b8e58fe36 Implement module accessibility checks differently in compiler and IDE
Essentially, the logic that was previously in
JvmModuleAccessibilityChecker.diagnosticFor, is moved into a new
abstract method JavaModuleResolver.checkAccessibility, which is
implemented differently in the compiler and in the IDE. In the compiler,
we use our JavaModuleInfo and JavaModuleGraph, as previously. In the
IDE, we use intellij's PsiJavaModule and JavaModuleGraphUtil.

This fixes strange behavior in IDE where some modules could be observed
in an invalid state. The cause of that was the JavaModuleGraph instance
caching modules in IdeJavaModuleResolver, which is a project component.

Moreover, this will allow to report an error "named module does not read
unnamed module" in the compiler, and avoid reporting it in the IDE (see
the comment in IdeJavaModuleResolver about that)
2017-07-10 12:48:21 +03:00
Alexey Andreev
7edb352aeb Copy stdlib-js source map during JPS build 2017-07-10 12:42:33 +03:00
Dmitry Petrov
0ce6bac7eb Generate proper 'compareTo' calls for non-primitive 'a in x .. y'
When we have some custom implementation of Comparable, it's important
that we compare values exactly as 'lowBound <= a && a <= highBound'.

Make sure that evaluation order and compareTo calls match for
optimized and non-optimized case.
2017-07-10 10:51:26 +03:00
Dmitry Petrov
dd5bb78178 Minor: don't use StringBuilder#setLength(0) - absent in JS 2017-07-10 10:51:26 +03:00
Dmitry Petrov
0962aec456 Minor: don't use java.lang.Integer in common test 2017-07-10 10:51:26 +03:00
Dmitry Petrov
aa7db727ba Fold I2L with ICONST_n when beneficial
ICONST_0; I2L -> LCONST_0
ICONST_1; I2L -> LCONST_1
2017-07-10 10:51:26 +03:00
Dmitry Petrov
ad80c3cd7f If at least one of the range bounds is "pure", order doesn't matter 2017-07-10 10:51:26 +03:00
Dmitry Petrov
22e12dc139 Minor: use method names in bytecode text tests 2017-07-10 10:51:26 +03:00
Dmitry Petrov
905a16e1df Maintain proper evaluation order for 'a in x .. y'
As of Kotlin 1.0 and 1.1, expression 'a in x .. y' is considered
equivalent to 'x.rangeTo(y).a', and should be evaluated in the following
order:
1. x
2. y
3. a
4. compare x with a
5. compare y with a (if needed)
2017-07-10 10:51:26 +03:00
Dmitry Petrov
fc3e9318d9 Handle DUPnXm instructions in PopBackwardPropagationTransformer 2017-07-10 10:51:26 +03:00
Dmitry Petrov
6a3ff5ca46 Add tests for intrinsified in/!in and mismatching range types 2017-07-10 10:51:26 +03:00
Dmitry Petrov
850e1b11fc Minor: test modification after review 2017-07-10 10:51:26 +03:00
Dmitry Petrov
64f880ba71 Add test for in/!in in a custom object range 2017-07-10 10:51:26 +03:00
Dmitry Petrov
9d1901fc7c Intrinsify some mismatching range/element combinations for in/in!
It's safe to upcast integer types to Long,
floating-point types to Double.
So we don't have to create a range instance for cases such as

fun testLongInInt(x: Long, a: Int, b: Int) =
    x in a .. b

which is equivalent to

fun testLongInInt(x: Long, a: Int, b: Int) =
    x in a.toLong() .. b.toLong()
2017-07-10 10:51:26 +03:00
Dmitry Petrov
d137b04b0a Pull up logic for ComparisonGenerator selection 2017-07-10 10:51:26 +03:00
Dmitry Petrov
ea95f31f99 Simplify some basic instructions using peephole optimization
DUP_X1; POP = SWAP

p1_a; p1_b; SWAP = p1_b; p1_a
where p1_a, p1_b are instructions without side effects pushing value of
size 1 on stack.
E.g.: ACONST_NULL; ALOAD 0; SWAP = ALOAD 0; ACONST_NULL

NOP; NOP = NOP
2017-07-10 10:51:26 +03:00
Dmitry Petrov
224848163d Use InContinuousRangeExpressionGenerator for primitive range intrinsics 2017-07-10 10:51:26 +03:00
Dmitry Petrov
c855b5c889 Extract SimpleBoundedValue class 2017-07-10 10:51:26 +03:00
Dmitry Petrov
a3409b46b0 Primitive number range literal as BoundedValue 2017-07-10 10:51:26 +03:00
Dmitry Petrov
b693b54a2c Fix DUPn_Xm handling in PopBackwardPropagationTransformer
DUPn_Xm instructions implicitly depend on elements directly under stack
top (which are not "copied", but still required). We can't analyze them
precisely now, and should skip methods containing these instructions.
Fortunately, we didn't generate these instructions under POP before,
but with new range check code generation and constant conditions
elimination such combination of instructions becomes possible.
2017-07-10 10:51:26 +03:00
Dmitry Petrov
4480a9bdfb Introduce BoundedValue as a generalization of (low..high) range
Provide BoundedValue-based implementation of InExpressionGenerator,
test it on range of comparable values.
Drop unneeded test (range of comparables is already tested by
ranges/contains/inComparableRanges.kt).
2017-07-10 10:51:26 +03:00
Dmitry Petrov
f4ea1a2f41 Minor: move RangeValue-related classes to proper packages 2017-07-10 10:51:26 +03:00
Dmitry Petrov
d19eb05382 Introduce AbstractForInProgressionLoopGenerator
AbstractForInProgressionLoopGenerator is a base class for
progression-based 'for' loop generators with progression step unknown
at compile time.
2017-07-10 10:51:26 +03:00
Dmitry Petrov
83ff1a2ef3 Minor: refactor ForInProgressionExpressionLoopGenerator initialization 2017-07-10 10:51:26 +03:00
Dmitry Petrov
6551fdc695 Add test for nullable primitive in range 2017-07-10 10:51:26 +03:00
Dmitry Petrov
db1dcc68ff Minor: cleanup in ExpressionCodegen 2017-07-10 10:51:26 +03:00
Dmitry Petrov
614d90d6ef Skip NOP instructions in fast pop backward propagation 2017-07-10 10:51:26 +03:00
Dmitry Petrov
36cbc0defd Ensure that {Collection, CharSequence}.indices intrinsic works with 'in' 2017-07-10 10:51:26 +03:00
Dmitry Petrov
ec99fa2142 Ensure that 'in/!in x until y' intrinsic works 2017-07-10 10:51:26 +03:00
Dmitry Petrov
05cad83c79 Fix tests for in/in! with primitive range literals
- ClosedFloatingPointRange<T>
- IntRange, etc
- extensions in kotlin.ranges for ranges of Byte/Int/Short
2017-07-10 10:51:26 +03:00
Dmitry Petrov
5decf65d6a Ensure that no range instance is created for 'x in array.indices' 2017-07-10 10:51:26 +03:00
Dmitry Petrov
4320b63922 Ensure that no boolean negation is generated for !in expression
#KT-18777 Fixed Target versions 1.1.4
2017-07-10 10:51:26 +03:00
Dmitry Petrov
b9c0ecf2b1 Ensure that ranges are not created for in-Comparable-range-literal
#KT-6247 Fixed Target versions 1.1.4
2017-07-10 10:51:26 +03:00
Dmitry Petrov
7175361c97 Ensure that BranchedValue for in/!in work well with boolean operations 2017-07-10 10:51:26 +03:00
Dmitry Petrov
a3cd4f415a Add test for comparison used for primitives and Comparable
There's a subtle difference in behavior between comparing
primitive Float/Double (comparison follows IEEE standard)
and boxed Float/Double (comparison is a total order).
Make sure this corner case is preserved.
2017-07-10 10:51:26 +03:00
Dmitry Petrov
fd402cb76c Provide intrinsic for in/in! expression with range of Comparable 2017-07-10 10:51:26 +03:00
Dmitry Petrov
bd2021411c Don't use intrinsic 'in' generator for non-intrinsified 'in' expressions 2017-07-10 10:51:26 +03:00
Dmitry Petrov
a7071ae7af Provide intrinsic generators for in/!in expression
TODO some tests should fail because range of comparables
(e.g., '"Alpha" .. "Omega"') is currently not implemented
2017-07-10 10:51:26 +03:00
Dmitry Petrov
e3320c53f5 Minor: AbstractForInRangeWithGivenBoundsLoopGenerator 2017-07-10 10:51:26 +03:00
Dmitry Petrov
e261b8edf8 Minor: extract high-level interface for ForLoopGenerator 2017-07-10 10:51:26 +03:00
Dmitry Petrov
c870eeac2e RangeCodegenUtil: convert to Kotlin + cleanup 2017-07-10 10:51:26 +03:00
Dmitry Petrov
304e4e8dce RangeCodegenUtil: .java -> .kt 2017-07-10 10:51:26 +03:00
Dmitry Petrov
6140f29818 Ranges: introduce RangeValue class
The overall idea is to unify intrinsics for 'for-in' loop generation
and for 'in'/'!in' expression generation.
2017-07-10 10:51:26 +03:00
Alexey Andreev
811da2e285 Compile stdlib-js with source map 2017-07-09 14:22:08 +03:00
Ilya Chernikov
25c731241b Fix parallel daemon start test reporting 2017-07-08 18:16:29 +02:00
Ilya Chernikov
21eed9ee78 Get rid of kotlin.Unit usage in RMI interfaces
attempt to fight mysterous "Cannot instantiate kotlin.Unit" exception.
2017-07-08 18:16:29 +02:00
Ilya Chernikov
06d27a9efa Fix failing tests on TC on Windows by falling back to standard launcher
...in one more case
Plus some minor test tweaks, diagnostics improvement and important comments
2017-07-08 18:16:28 +02:00
Ilya Chernikov
e4ed217a3b Add missing explicit serialVersionUID to the REPL API classes 2017-07-08 18:16:27 +02:00
Ilya Chernikov
8542e878f7 Refactor daemon periodic check and shutdown logic
Cleaner logic and logging, improved stability during shutdown, reduced
overhead of the periodic checks, and regular calls, should also eliminate
dying daemons scenario on parallel execution (another attempt to do it).
2017-07-08 18:16:26 +02:00
Ilya Chernikov
2c35675fd6 Refactor daemon parallel start test to improve diagnostics
also add daemon info to the RPC
and remove redundant daemon stopping calls, that should speed up
tests execution
2017-07-08 18:16:26 +02:00
Ilya Chernikov
e2d2c5ff42 Refactor daemon startup for better logging and cleaner code 2017-07-08 18:16:25 +02:00
Ilya Chernikov
2ec2a08753 Implement advanced gradle script template selection in the provider, improve diagnostics 2017-07-08 18:16:24 +02:00
Ilya Chernikov
ebcac3dd01 Use renamed Gradle Kotlin DSL template in the provider when available 2017-07-08 18:16:24 +02:00
Pavel V. Talanov
bf09d91e80 script.runtime: restore old apis and mark as deprecated
Needed for compatibility (i.e. with old gradle kdsl versions)
2017-07-08 15:10:46 +03:00
Pavel V. Talanov
20be924bbb script.runtime: update api
- Clean up some api inconsistencies
 - Provide experimental async resolver to allow cleaner async updates of dependencies
2017-07-08 15:10:45 +03:00
Alexander Udalov
127cd1295e Disable JSR-305 annotations by default, introduce CLI argument
No package annotations are going to be loaded, and
TypeQualifierDefault/TypeQualifierNickname are no longer recognized by
default. Use the CLI argument "-Xload-jsr305-annotations" to enable this
behavior back

 #KT-10942
2017-07-07 22:08:50 +03:00
Mikhail Glukhikh
522f67fda0 Severity is softened for some style issues 2017-07-07 18:15:38 +03:00
Mikhail Glukhikh
a960fa78cb Use expression body: add new line more accurately 2017-07-07 18:15:36 +03:00
Mikhail Glukhikh
b0fda5f451 Lift return out fix: do not suggest for labeled returns 2017-07-07 18:15:35 +03:00
Mikhail Glukhikh
41893736df Cleanup: make single KtExpression.isElseIf 2017-07-07 18:15:34 +03:00
Mikhail Glukhikh
a6f0b7c7a4 Preferred style inspections: WEAK WARNING -> INFO 2017-07-07 18:15:33 +03:00
Mikhail Glukhikh
1d2017b0fc Cleanup: apply "cascade if..." inspection (+ some others) 2017-07-07 18:15:32 +03:00
Mikhail Glukhikh
9c06739594 Cleanup: apply "lift out..." inspection (+ some others) 2017-07-07 18:15:30 +03:00
Mikhail Glukhikh
0c41ceea9d "Cascade if" inspection: do not suggest for one-line if 2017-07-07 18:15:28 +03:00
Mikhail Glukhikh
0fe9030eba "Cascade if" inspection: don't highlight for complex logical conditions
Related to KT-18615
2017-07-07 18:15:27 +03:00
Mikhail Glukhikh
8273eff1a1 Introduce "cascade if" inspection suggesting replacement with when
So #KT-18615 Fixed
2017-07-07 18:15:26 +03:00
Mikhail Glukhikh
1ddaee5b4a "Lift return / assignment": don't highlight if other returns available 2017-07-07 18:15:24 +03:00
Mikhail Glukhikh
691b733c55 "Lift return / assignment": do not suggest for else arguments 2017-07-07 18:15:22 +03:00
Mikhail Glukhikh
042990dda1 "Lift return / assignment": do not suggest for too long expressions 2017-07-07 18:15:21 +03:00
Mikhail Glukhikh
398f92dc6f Lift assignment out: do not suggest if other assignments available
So #KT-18709 Fixed
2017-07-07 18:15:20 +03:00
Mikhail Glukhikh
9c4dfa3343 Lift return out: do not suggest for lambda in return #KT-18711 Fixed 2017-07-07 18:15:18 +03:00
Mikhail Glukhikh
c0d10264bc Lift assignment out: do not highlight for exactly one assignment
Related to KT-14900
2017-07-07 18:15:17 +03:00
Mikhail Glukhikh
1010ecca8c Lift return out: do not report for zero returns
Also, do not highlight (but suggest fix) for exactly one return
Related to KT-14900
2017-07-07 18:15:16 +03:00
Mikhail Glukhikh
2deef48b84 Cleanup code: BranchedFoldingUtils 2017-07-07 18:15:15 +03:00
Mikhail Glukhikh
2d1abda9a1 Convert "lift return / assignment" intentions into a single inspection
Also includes minor test fix, related to KT-14900
2017-07-07 18:15:14 +03:00
Mikhail Glukhikh
8f33bd0768 Handle break / continue / throw in lift return / assignment intentions
So #KT-14900 Fixed
2017-07-07 18:15:09 +03:00
Mikhail Glukhikh
523cbc6723 Convert to expression body: insert new-line after = for long lines 2017-07-07 18:15:07 +03:00
Mikhail Glukhikh
d08b18f5f8 Introduce "use expression body" inspection #KT-16063 Fixed
Converted from the relevant intention
Reported cases: one-liners, whens
Also, more exact caret detection in local inspection tests
2017-07-07 18:15:06 +03:00
takahirom
fe9d3f16d3 KT-18501: Fix to find KDoc even if KDoc is in ModifierList 2017-07-07 18:12:19 +03:00
Dmitry Jemerov
4b92349031 Specify group for "Redundant 'Unit' return type" inspection 2017-07-07 16:53:42 +02:00
nd
33a93e5fc5 Inspection detecting redundant Unit return type (#1144) 2017-07-07 16:51:53 +02:00
Dmitry Jemerov
5f9a33564a Implement option for wrapping method annotations 2017-07-07 16:48:31 +02:00
Dmitry Jemerov
a379a814ba Implement option for wrapping class annotations 2017-07-07 16:48:31 +02:00
Dmitry Jemerov
6c62b60147 Implement option for wrapping parameter annotations 2017-07-07 16:48:31 +02:00
Dmitry Jemerov
be15ee3c03 Add "Wrap extends/implements list" option 2017-07-07 16:48:30 +02:00
Dmitry Jemerov
722cc521a9 Add "Blank lines before }" option
#KT-15504 Fixed
2017-07-07 16:48:30 +02:00
Dmitry Jemerov
5c8a90fe85 "Blank lines after class header" option supported 2017-07-07 16:48:30 +02:00
Dmitry Jemerov
6a96ade02c Options for blank lines between 'when' branches
#KT-18607 Fixed
2017-07-07 16:48:29 +02:00
Dmitry Jemerov
8fe2858c6a Option to use normal indent in chained calls
#KT-18605 Fixed
2017-07-07 16:48:29 +02:00
Simon Ogorodnik
d8bb0b1023 KT-16999: Fix duplicates in parameter info
Use ShadowedDeclarationFilter in Parameter Info
 #KT-16999 fixed
2017-07-07 17:40:32 +03:00
nd
58e5c497d0 Intention to replace add/addAll on a mutable collection with += (#1143) 2017-07-07 16:34:20 +02:00
nd
fae8efdc7f Handle unsafe implicit invoke on array access expression (#1151) 2017-07-07 16:29:11 +02:00
Dmitry Jemerov
8cc9195fae Merge remote-tracking branch 'origin/master' 2017-07-07 13:26:59 +02:00
Dmitry Jemerov
9dc4183a16 Fix tests affected by the inspection behavior change 2017-07-07 13:25:59 +02:00
Mikhail Zarechenskiy
039729908d Minor, remove field that never used 2017-07-07 14:20:03 +03:00
Mikhail Zarechenskiy
3fed4e6dc7 Improve diagnostic for unresolved reference when function expected
#KT-10657 Fixed
2017-07-07 14:20:02 +03:00
Mikhail Zarechenskiy
0ae45a2835 Add test for obsolete issue
#KT-6502 Obsolete
2017-07-07 14:20:01 +03:00
Mikhail Zarechenskiy
c853ac95ad Improve diagnostic message for annotations with @receiver
#KT-14647 Fixed
2017-07-07 14:19:59 +03:00
Mikhail Zarechenskiy
f5cd8c7e4d Relax name shadowing warning on parameter names
#KT-17611 Fixed
2017-07-07 14:19:57 +03:00
Mikhail Zarechenskiy
daa8521729 Avoid getting descriptors for collection literals from built-ins scope
#KT-18845 Fixed
2017-07-07 14:14:30 +03:00
Dmitry Jemerov
a12594fe27 Merge branch 'KT-18717' of https://github.com/nd/kotlin 2017-07-07 13:10:52 +02:00
Dmitry Jemerov
1de685949b Merge branch 'KT-18797' of https://github.com/nd/kotlin 2017-07-07 13:02:02 +02:00
Alexey Andreev
2f74fd6f90 Don't exit with error status when node.js tests fail 2017-07-07 11:57:32 +03:00
Vyacheslav Gerasimov
4cef8728d7 Add layout file name in completion for Android Extension properties
#KT-11051 Fixed
2017-07-07 03:24:19 +03:00
Vyacheslav Gerasimov
f59859842a Fix Android extensions import rename
#KT-17890 Fixed
2017-07-07 03:24:10 +03:00
Vyacheslav Gerasimov
ee53e81e8e Fix Android resource reference folding
Properly fold qualified expressions and handle nested references

 #KT-18429 Fixed
2017-07-07 03:24:03 +03:00
Vyacheslav Gerasimov
7c6ffff198 Refactor Kotlin Gradle configurator 2017-07-07 03:23:34 +03:00
Vyacheslav Gerasimov
9810c10f8b Implement Add Kotlin library quickfix for GSK 2017-07-07 03:23:26 +03:00
Vyacheslav Gerasimov
2ec1a4311a Implement Kotlin configurator for GSK
#KT-14965 Fixed
2017-07-07 03:23:17 +03:00
Vyacheslav Gerasimov
2116877991 J2K: rename KotlinAndroidGradleModuleConfigurator .java -> kt 2017-07-07 03:22:28 +03:00
Simon Ogorodnik
9f340b40c2 Minor: Add test to check inferred types shown correctly in parameter info
#KT-11858 Obsolete
2017-07-06 20:40:53 +03:00
Alexander Udalov
0f15413d47 Minor, do not output stack trace on invalid contents of build file 2017-07-06 17:03:25 +03:00
Alexander Udalov
55468735df Rename -module argument to -Xbuild-file
To prevent confusion with Java 9 module-related arguments

 #KT-18754 Fixed
2017-07-06 17:03:25 +03:00
Alexey Sedunov
6200d07808 Minor: Fix compilation 2017-07-06 14:42:24 +03:00
Alexander Udalov
0b399fe7bb Ignore testAutomaticModuleNames on older Java 9 builds 2017-07-06 13:01:16 +03:00
Alexander Udalov
158afdea2b Improve sorting of compiler messages in GroupingMessageCollector
Ensure that messages reported on a file but with no line information are
reported before diagnostics related to code. This fixes
Java9ModulesIntegrationTest.testSeveralModulesWithTheSameName on some
machines
2017-07-06 13:01:16 +03:00
Alexander Udalov
3808ecbd1e Minor, return a set in JavaModuleGraph.getAllDependencies
To prevent duplicate roots to be added
2017-07-06 13:01:15 +03:00
Alexander Udalov
ec6e4f2469 Minor, take List instead of Iterable in convertClasspathRoots
To emphasize that the order is important
2017-07-06 13:01:15 +03:00
Alexander Udalov
0f06140a3d Check 'Multi-Release' manifest attribute value for multi-release jars
See http://openjdk.java.net/jeps/238
2017-07-06 13:01:14 +03:00
Alexander Udalov
7ab018da7b Use ASM 6 API to read class files in IDE
Otherwise ASM throws exceptions trying to read module-info.class

 #KT-13072 Fixed
2017-07-06 13:01:13 +03:00
Alexander Udalov
51fb02b2d5 Report warning for several modules with same name on module path 2017-07-06 13:01:13 +03:00
Alexander Udalov
e8a8bdc58e Add test on cyclicly dependent Java 9 modules 2017-07-06 13:01:12 +03:00
Alexander Udalov
9199023952 Improve automatic module handling in module graph construction
Add all automatic modules to roots if at least one automatic module is
added, as per
http://cr.openjdk.java.net/~mr/jigsaw/spec/api/java/lang/module/package-summary.html
2017-07-06 13:01:12 +03:00
Alexander Udalov
c428505d4d Load automatic module names correctly
Load the Automatic-Module-Name manifest entry value if it's present (see
http://mail.openjdk.java.net/pipermail/jpms-spec-observers/2017-May/000877.html),
otherwise sanitize the name of the .jar file, throwing out all chars
except alphanumeric, duplicate dots and a version qualifier
2017-07-06 12:50:05 +03:00
Alexander Udalov
612e64d8e3 Load module-info.class from multi-release jars' META-INF/versions/ 2017-07-06 12:50:04 +03:00
Alexander Udalov
5b9ee88b52 Remove --add-opens options to workaround Java 9 visibility checks
These options are no longer needed because the problematic code in
intellij-core that was accessing these private APIs has been dealt with
in the 171 branch.

The remaining options in "Codegen Tests" run configurations are needed
because of reflection usage on JDK internals in KtUsefulTestCase
2017-07-06 12:50:04 +03:00
Alexander Udalov
40d4eeab4f Do not try to load jrt file system from JDK version < 9
The FileSystems.newFileSystem call failed if the compiler was being run
on Java 9 with -jdk-home $JDK_16
2017-07-06 12:50:03 +03:00
Alexander Udalov
0f4684da67 Fix codegen tests on JDK 9 with jdkKind = FULL_JDK 2017-07-06 11:58:03 +03:00
Alexey Andreev
4bd9866975 Remove unnecessary overriding methods, fix compilation 2017-07-06 10:34:05 +03:00
Alexey Andreev
ca63717124 Multiple fixes of JS source maps
- elvis expression with complex RHS
- destructuring declarations
- decomposition of `var` statement (for example, in case of
  inline destructuring functions)
- `is` LHS &&/|| inline fun RHS
- argument assignment to temporary var on inline call site
- assignment of `next()` result to temporary var in `for` expression
- rethrow statement in exception handler
2017-07-06 10:20:49 +03:00
Alexey Andreev
f873834529 Fix JS source maps for objects and enums 2017-07-06 10:20:49 +03:00
Alexey Andreev
d8fe7e55db Fix JS source maps for lambdas with captured variables 2017-07-06 10:20:48 +03:00
Alexey Andreev
ec2a5bf0ee Fix JS source map for char boxing and unboxing 2017-07-06 10:20:47 +03:00
Alexey Andreev
be7f3a787c Fix JS source maps for when expression 2017-07-06 10:20:46 +03:00
Alexey Andreev
d613124cb1 Generate JS source maps for temporary vars declarations and definitions 2017-07-06 10:20:46 +03:00
Alexey Andreev
64f335380f Provide more source map info about statements in JS tests 2017-07-06 10:20:45 +03:00
Alexey Andreev
fa95f78e78 Generate JS source map for if statement got from optional argument 2017-07-06 10:20:44 +03:00
Alexey Andreev
1e74325c52 Generated source map for JS function's closing curly bracket 2017-07-06 10:20:44 +03:00
Alexey Andreev
4e18ea2d04 Fix JS source map of decomposed conditional expression 2017-07-06 10:20:43 +03:00
Alexey Andreev
b5218915f8 Fix associativity of generated comma operator in JS BE 2017-07-06 10:20:42 +03:00
Alexey Andreev
2122f57f51 Don't merge locations in JS source map test cases
Don't merge locations of containing if/while/do..while/for
statements with locations of conditions
2017-07-06 10:20:42 +03:00
Alexey Andreev
dea73ebecf Refactor generator of JS source map
- refactor pipeline for generation of source map
- generate "empty" mappings for nodes that impossible
  to map to something reasonable
- generate more accurate locations in source maps for specific
  JS AST nodes
- for binary operation nodes parser now returns location
  of binary operator tokens instead of location of first operand
- change completely how source map remapper works
2017-07-06 10:20:41 +03:00
Nikolay Krasko
6a2f3d8065 Minor: remove let usage 2017-07-05 20:21:13 +03:00
Nikolay Krasko
72611d1337 Fix extract refactoring for android extensions declarations (KT-11048)
Allow any target declarations in marking references. Otherwise conflicts
for references resolved to xml are not considered broken.

This also fix evaluate for extension fields.

 #KT-11048 Fixed
2017-07-05 20:21:13 +03:00
Mikhail Glukhikh
a09b31b568 Classify all Kotlin inspections 2017-07-05 16:00:22 +03:00
Mikhael Bogdanov
2808e45b89 Enable test in js, native 2017-07-05 11:15:38 +02:00
Dmitry Neverov
4a0e70ad53 Report MemberVisibilityCanBePrivate on visibility modifier if present 2017-07-04 21:33:37 +02:00
Alexander Udalov
d97fa604e1 Write metadata for suspend function into anonymous coroutine classes
To render nice Kotlin types in toString() of continuation
2017-07-04 19:41:48 +03:00
Alexander Udalov
5a8546519a Do not fail on lambdas without metadata in toString() 2017-07-04 19:41:47 +03:00
Vladimir Koshelev
61e52f0bfe Improve a reported message if -jdk-home path does not exist.
Fix KT-18794
2017-07-04 19:40:42 +03:00
Alexey Sedunov
994b6d687c Find Usages: Use MethodReferencesSearch to find constructor usages 2017-07-04 19:37:55 +03:00
Alexey Sedunov
28c5978d81 Light Classes: Fix AIOOBE on KtParameter -> PsiParameter conversion
EA-88058 Fixed
2017-07-04 19:37:54 +03:00
Alexey Sedunov
d69caea725 Kotlin Facet: Ignore modules unprocessed by kotlin project resolver
This happens in AS on project opening, but we can't (re-)configure facet
in such case since relevant module data are not available

 #KT-18725 Fixed
2017-07-04 19:37:53 +03:00
Alexey Sedunov
ee200c87ea Kotlin Facet: Change module JDK according to jdkHome
It's possible when JDK with the same home path is already configured
2017-07-04 19:37:52 +03:00
Alexey Sedunov
2a53043fef Generate equals/hashCode(): Fix function body generation
#KT-18596 Fixed
2017-07-04 19:37:50 +03:00
Simon Ogorodnik
33c22b8251 KT-8208: Support static members completion when receiver not-imported
#KT-8208 fixed
2017-07-04 16:41:50 +03:00
Dmitry Petrov
16505daeea Fix 'equals' for NotNullBasicValue
NotNullBasicValues were merged incorrectly sometimes,
which caused problems with INSTANCEOF checks.

 #KT-18779 Fixed
2017-07-04 12:19:10 +03:00
Mikhael Bogdanov
8121c1d3c4 Update test to support js-backend 2017-07-04 10:12:42 +02:00
Dmitry Neverov
08afaca518 Don't propose making property private if it's used in inline function 2017-07-03 21:58:22 +02:00
Mikhael Bogdanov
8666b95dd2 Delete local variables on default mask expantion
#KT-18792 Fixed
2017-07-03 17:01:06 +02:00
Mikhael Bogdanov
01e2f8e32c Preventively allocate slots for additional default parameters
Otherwise they are corrupted by inline
2017-07-03 17:01:06 +02:00
Denis Zharkov
5453f3067c Load @NonNull(when=UNKNOWN) annotated type as a flexible one 2017-07-03 17:55:37 +03:00
Denis Zharkov
55b585f3d0 Replace JavaTypeAttributes interface with simple data class 2017-07-03 17:55:37 +03:00
Denis Zharkov
939bacc810 Minor. Drop unused parameters in LazyJavaScope 2017-07-03 17:55:37 +03:00
Denis Zharkov
e26c210d69 Support TypeQualifierDefault from JSR 305 for nullability qualifiers
#KT-10942 Fixed
2017-07-03 17:55:37 +03:00
Denis Zharkov
5141a88a53 Add TypeQualifier annotation to IDE test data
Othewise nullability is not processed correctly
2017-07-03 17:55:37 +03:00
Denis Zharkov
a95d3e601b Fix container for extension receiver types from Java
No tests are added since there are some already
(e.g. TypeEnhancement.testOverriddenExtensions)
2017-07-03 17:55:37 +03:00
Denis Zharkov
57b7b91444 Do not add container annotaions to type artificially
It was only used for type-related nullability/mutability
annotations and it was necessary to remove them
in the descriptor renderer (duplicating their fqnames there).
At the same time they're only needed for types enhancement
where they can be simply restored from type owners' descriptors

The testData changes are more or less correct: this kind of annotations
is bound both to types themselves and their use because of their targets
2017-07-03 17:55:37 +03:00
Denis Zharkov
f877c82029 Simplify computeIndexedQualifiersForOverride() declaration
Do not pass properties of the to its own methods
2017-07-03 17:55:37 +03:00
Denis Zharkov
8812844d43 Move type qualifiers calculation into SignatureParts
It helps not to pass signature parts content to them
2017-07-03 17:55:37 +03:00
Denis Zharkov
92f9194112 Support TypeQualifierNickname for nullability annotations
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov
f2a55d590c Move type qualifiers extraction to SignatureEnhancement
These methods will depend on other components soon
2017-07-03 17:55:37 +03:00
Denis Zharkov
b3caa1da34 Introduce SignatureEnhancement component
It will depend on the AnnotationTypeQualifierResolver later
2017-07-03 17:55:37 +03:00
Denis Zharkov
21d1d16e74 Drop RawBound class and relevant property from JavaTypeAttributes
The main motivation behind this change is code simplification:
raw bounds can be simply replaced with common flexible bounds
2017-07-03 17:55:37 +03:00
Denis Zharkov
cbe62f076d Drop JavaTypeAttributes::isMarkedNotNull property
The only cases this code runs are annotation parameters
and supertypes that are already not-nullable by default
2017-07-03 17:55:37 +03:00
Denis Zharkov
42b2534c46 Remove redundant check in WhenByPlatformEnumChecker
If a type is annotated as not null its upper bound is not nullable
in most cases besides override conflicts, but in the latter case
we should behave consistently with flexibility of this type
2017-07-03 17:55:37 +03:00
Denis Zharkov
fc9810182e Get rid of JavaTypeAttributes::allowFlexible property
It's only false now in case of annotation parameters
2017-07-03 17:55:37 +03:00
Denis Zharkov
507eccc4ec Replace another allowFlexible=false with isNotNullable
Having field initilized doesn't make it inflexible in a sense
of mutability
2017-07-03 17:55:37 +03:00
Denis Zharkov
a0268d23bb Get rid of trivial allowFlexible replacing
As the type is anyway replaced with not-nullable version
explicitly, the only thing that changes is what type is loaded
for String[][].class:
- before it would be Array<Array<String?>?>
- now it's Array<(out) Array<(out) String!>!>

It's both a minor change and new behaviour can be considered
as correct
2017-07-03 17:55:37 +03:00
Denis Zharkov
58442e7b8b Drop TypeUsage::MEMBER_SIGNATURE_CONTRAVARIANT
It's only used for value parameters, but they're always resolved
with flexible types now
2017-07-03 17:55:37 +03:00
Denis Zharkov
6cd6608281 Drop TypeUsage::MEMBER_SIGNATURE_COVARIANT
It's only used for choosing mutability of a collection class, but
using annotations while loading is redundant since there is
a separate phase of type enhancement where they're taken
into account (for flexible types)

For inflexible type it doesn't matter since they appear only in
special cases like annotation methods (where collection classes can't be met)
2017-07-03 17:55:37 +03:00
Denis Zharkov
5ca3459a0f Minor. Merge TypeUsage::MEMBER_SIGNATURE_INVARIANT and COMMON
Their usages are effectively the same
2017-07-03 17:55:37 +03:00
Denis Zharkov
69e70575f9 Drop some of the TypeUsage enum entries
The only sensible usage of them was in the `isNullable` method
But you can check that UPPER_BOUND/SUPERTYPE_ARGUMENT are always
flexible and TYPE_ARGUMENT is not only in case of annotation
methods/parameters
2017-07-03 17:55:37 +03:00
Denis Zharkov
5c8f2a8ae8 Add resolution for JSR 305 type qualifier nicknames
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov
79e14f88e4 Support package level annotations in Java
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov
b7ead75947 Minor. Move BinaryJavaModifierListOwner -> MapBasedJavaAnnotationOwner 2017-07-03 17:55:04 +03:00
Mikhail Glukhikh
2d1e1cb6ed Minor: !!-related quick-fixes refactoring 2017-07-03 15:18:10 +03:00
Dmitry Neverov
4f678fa85c Do not suggest !! on expression which is always null
Related to KT-14643
2017-07-03 15:14:11 +03:00
Dmitry Neverov
66bd9d63dd Do not suggest adding !! on null constant #KT-14643 Fixed 2017-07-03 15:13:46 +03:00
Dmitry Jemerov
84418738a7 Optimize library kind detection and make it interruptible 2017-07-03 12:02:50 +02:00
Mikhael Bogdanov
49252f6eec Properly process primitive receiver on inlining bound callable references
#KT-18728 Fixed
2017-07-03 10:51:51 +02:00
Ilya Gorbunov
fe17c4416e Fix a typo: retail -> retain
#KT-18526 Fixed
2017-07-01 17:05:17 +03:00
Ilya Gorbunov
a21dbf08a8 Reorder values and entries in MutableMap to match docs
Also change references to mutable collections in docs.

#KT-18670 Fixed
2017-07-01 17:05:17 +03:00
Stuart Kent
962958c403 Fix String capitalize/decapitalize sample references and sample names 2017-07-01 17:05:17 +03:00
Simon Ogorodnik
ab919886ae Fix rendering of local anonymous object types for quick doc
#KT-8893 fixed
2017-07-01 15:04:29 +03:00
Nikolay Krasko
25109671b1 Postpone counting light elements till all psi checks done 2017-07-01 03:05:38 +03:00
Nikolay Krasko
fe17d616b9 Don't process Java references twice when looking for kotlin overrides (KT-17751) 2017-07-01 03:05:37 +03:00
Nikolay Krasko
0cd8ee57b8 Don't run another method reference search for constructors (KT-17751)
Constructors can't be used as properties and have no overrides.
2017-07-01 03:05:37 +03:00
Alexander Udalov
37982e4bb1 Move SAM-related descriptor classes to module frontend.java
Also move SyntheticMemberDescriptor to module resolution
2017-06-30 21:02:18 +03:00
Alexander Udalov
9717745b83 Minor, remove implementation overridden in all subclasses 2017-06-30 21:02:18 +03:00
Alexander Udalov
778a6758a5 Do not add inner class names to functions in Java static scope
Previously it was needed for SAM adapters, but they can no longer be
found in this scope
2017-06-30 21:02:18 +03:00
Sergey Igushkin
c4e7f1aa97 Fix parsing Gradle version with zero
(cherry picked from commit 732972c)
2017-06-30 20:44:59 +03:00
Sergey Igushkin
40a8bbf24d Fix friend paths not configured correctly with separate classes dirs
(cherry picked from commit d5ee659)
2017-06-30 20:44:49 +03:00
Alexey Sedunov
9ba868a903 Minor: Fix test data 2017-06-30 13:53:09 +03:00
Valentin Kipyatkov
6df0c28119 Correction after code review 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov
8fabb6945e Allow slice rewrite in trace when in IDE 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov
61d9a6b9cd Use the same way to check for ProcessCanceledException everywhere 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov
eb4f322c77 Do not store ProcessCanceledException as result for cached value 2017-06-30 11:21:15 +03:00
Valentin Kipyatkov
09dbb07fb8 Optimization to reuse BindingContext in completion 2017-06-30 11:21:15 +03:00
Sergey Igushkin
1174c7bdd9 Add sourcesJar and javadocJar to artifacts of gradle-tools projects.
(cherry picked from commit 450345b)
2017-06-29 20:59:36 +03:00
Sergey Igushkin
a4be282074 Add Gradle Plugin Portal publication to the buildscripts
Add option to disable signing (-PnoSign), to be used when publishing
pre-built artifacts

Add option to define specific version for publishing, to be used when
publishing test versions

(cherry picked from commit dcd55e9)
2017-06-29 20:59:36 +03:00
Dmitry Jemerov
4497874f31 Remove unnecessary saveAll() 2017-06-29 17:56:59 +02:00
Sergey Igushkin
d1bddb6250 Fix disabling IC not applied to kapgGenerateStubsKotlin tasks
Issue #KT-18647 Fixed

(cherry picked from commit ffb656a)
2017-06-29 18:44:00 +03:00
Sergey Igushkin
a9cad7f112 Add a test for project.buildDir lazy evaluation
(cherry picked from commit ab0f9cd)
2017-06-29 18:42:50 +03:00
Nikita Skvortsov
b2cdb0d63d evaluate and use buildDir as late as possible
(cherry picked from commit a2c7f80)

(cherry picked from commit 5643fa1)
2017-06-29 18:41:53 +03:00
Sergey Igushkin
351f810797 Add tests for separate classes dirs
(cherry picked from commit b07d79b)
2017-06-29 18:31:53 +03:00
Sergey Igushkin
700b162233 Implemented separate classes dirs support in the Gradle plugins.
Issue #KT-18495 Fixed
Issue #KT-18544 Fixed

(cherry picked from commit e25f0fd)
2017-06-29 18:31:23 +03:00
Sergey Igushkin
ae47c59dc9 Pass freeCompilerArgs unchanged to the compiler, without parsing them
with the compiler loaded along the Gradle plugin.

Issues: #KT-17618 Fixed

(cherry picked from commit 44f7428)
2017-06-29 18:27:18 +03:00
Alexey Sedunov
88968807b2 Generate equals/hashCode(): Swap class literals in comparison 2017-06-29 17:42:20 +03:00
Alexey Sedunov
e3e4c447fa Generate equals/hashCode(): Use class literals when possible
#KT-18683 Fixed
2017-06-29 17:42:18 +03:00
Alexey Sedunov
50a38df8b1 Remove Parentheses: Forbid on call inside a call without argument list
#KT-18699 Fixed
2017-06-29 17:42:17 +03:00
Alexey Sedunov
20969f161c Introduce Parameter: Fix NPE on invalid parameter name or type
EA-95189 Fixed
2017-06-29 17:42:16 +03:00
Alexey Sedunov
2e8b374ce8 Move: Use KtNamedDeclaration as referrer when reporting a conflict
EA-103817 Fixed
2017-06-29 17:42:15 +03:00
Alexey Sedunov
58addf72ff New File Action: Do not start under write action
EA-102468 Fixed
2017-06-29 17:42:14 +03:00
Alexey Sedunov
b1637df8df Misc: Format generated members under write action
EA-87901 Fixed
2017-06-29 17:42:13 +03:00
Alexey Sedunov
392370bb23 Extract Interface: Fix NPE
EA-90440 Fixed
2017-06-29 17:42:11 +03:00
Alexey Sedunov
dd0f8e98e8 Create Type Alias From Usage: Disable on PsiPackage
EA-92625 Fixed
2017-06-29 17:42:10 +03:00
Alexey Sedunov
6060a39494 Change Signature: Use correct index in getOriginalParameter()
#KT-18642 Fixed
 #KT-18606 Fixed
2017-06-29 17:42:09 +03:00
Nikolay Krasko
9122f58d5d Re-enable optimize on the fly activation when unused imports found
Remove deprecated usages
2017-06-29 16:56:15 +03:00
Nikolay Krasko
6a5d6854bb Refactoring: inline implementation into KotlinStdJSProjectDescriptor 2017-06-29 16:56:15 +03:00
Nikolay Krasko
df393e18fe Configure AbstractInspectionTest with project descriptors
Previous implements produced flaky tests when non-js tests were
executed after js.
2017-06-29 16:56:15 +03:00
Nikolay Krasko
be28c4a48f Remove unused configuration of runtime library
The project descriptor used in the test already has the configuration.
Also directive is not used in tests.
2017-06-29 16:56:15 +03:00
Mikhail Glukhikh
c8a9b5f67a Restrict range of "simplifiable call chain" inspection 2017-06-29 16:25:58 +03:00
Mikhail Glukhikh
840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Mikhail Glukhikh
fdca96634e Add restrictions for "simplifiable call chain" inspection
Do not use on maps; do not suggest for lambdas with return inside
Related to KT-18274
2017-06-29 16:25:55 +03:00
Mikhail Glukhikh
2f0159a7ab Minor fix: useless call on collection type 2017-06-29 16:25:54 +03:00
Mikhail Glukhikh
36be1fdaef Introduce "simplifiable call chain on collection" inspection
Related to KT-12165
So #KT-18274 Fixed
So #KT-17198 Fixed
2017-06-29 16:25:52 +03:00
Mikhail Glukhikh
bdb9f00c75 Introduce "Useless call on collection type" inspection
Related to KT-12165
Supported functions: filterNotNull, filterIsInstance,
mapNotNull, mapNotNullTo, mapIndexedNotNull, mapIndexedNotNullTo

Also, "Useless cal on not-null" improved a bit
2017-06-29 16:25:50 +03:00
Mikhail Glukhikh
f80f41d254 Introduce "redundant explicit type" inspection #KT-18517 Fixed
Reported cases: constants, constructors, object references
2017-06-29 16:25:47 +03:00
Mikhail Glukhikh
0f4ae3b727 Introduce "Useless call on not-null type" inspection #KT-18386 Fixed
Supported functions: orEmpty(), isNullOrEmpty(), isNullOrBlank()
2017-06-29 16:25:45 +03:00
Alexander Udalov
8c21ff66a4 Always treat all sources as parts of the module being compiled
If a path to the module-info.java file is passed as an argument, we
should treat all other source files passed as arguments (either as
individual source files or inside a source directory) as members of that
module. Previously we treated other source files as members of the
unnamed module, and this resulted in incorrect errors when using a
member exported with a qualification from another named module, for
example

 #KT-18598 In Fixed
2017-06-29 15:59:57 +03:00
Alexander Udalov
5192f946c5 Fix depth-first search for Java 9 modules
To compute modules to be added to compilation roots in
JavaModuleGraph.getAllDependencies, we should look not only for
transitive requirements of root modules, but for transitive requirements
of _root modules' requirements_. The same logic applies to
JavaModuleGraph.reads. In other words, when looking for a path in the
module graph between two modules, the first edge's transitiveness
doesn't matter, but all other edges after the first must be transitive.

There was also a stupid bug in dfs in
JavaModuleGraph.getAllDependencies: we continued the DFS only if the
module _was not_ added to the "visited" set ("add" returns true if the
element was added successfully)

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
72f37a278c Do not add all modules from module path when compiling unnamed module
Note that javac reports a nice error in this case ("package foo is
declared in module lib, which is not in the module graph"), but we only
report "unresolved reference" because the corresponding modules are not
added to classpath roots. We should improve this in the future

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
f8346d21c2 Check type alias expansion for Java 9 module accessibility
#KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
8768500844 Fix incorrect behavior and refactor JvmModuleAccessibilityChecker
Previously we assumed that a symbol is accessible if its containing
package is exported by module-info.java. Which was obviously wrong and
could lead to a situation where a symbol would be incorrectly accessible
if a usage module has a dependency on the symbol's module in IDEA
project terms, but does not require it in its module-info.java

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
2d3888c710 Do not add JDK .jar roots if the JDK is modular (9+)
Files like ant-javafx.jar, deploy.jar, java.jnlp.jar, javafx-swt.jar etc
should not be added to the classpath if JDK home points to a JDK 9
distribution
2017-06-29 15:59:57 +03:00
Alexander Udalov
9274d963aa Create KotlinCoreEnvironment a bit later in tests
Before this change, diagnostic tests with Java source files failed
because KotlinCoreEnvironment was being created in the test's setUp,
even before the test data file has been split into .java/.kt and the
resulting .java files have been copied to a temporary directory. In
KotlinCoreEnvironment's constructor, we now inspect all roots for
module-info files, which involves calling VirtualFile.getChildren on all
roots in the configuration. CoreLocalVirtualFile.getChildren is
cached on the first access, and so because the temporary directory with
.java files was empty at this point, the VirtualFile for that directory
returned empty array in getChildren later in the test, resulting in
unresolved reference errors.

This is fixed by creating the environment _after_ the .java files have
been copied to a temporary directory. Note that slow assertions for
flexible types are now enabled in KtUsefulTestCase instead of
KotlinTestWithEnvironmentManagement, because BaseDiagnosticsTest no
longer inherits from the latter
2017-06-29 15:59:56 +03:00
Alexander Udalov
03d83db660 Support -Xmodule-path and -Xadd-modules command line arguments
#KT-18598 In Progress
 #KT-18599 Fixed
2017-06-29 15:59:56 +03:00
Alexander Udalov
e32880d9a3 Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module
declarations in the IDE across the whole project, whereas in the
compiler we should do this on the module path only and that requires
separate work (KT-18599) which is done in the following commits.

(The change in Cache.kt is needed so that
JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class,
would be injected properly.)

 #KT-18598 In Progress
 #KT-18599 In Progress
2017-06-29 15:59:56 +03:00
Alexander Udalov
2275068c94 Introduce JavaModule, refactor module graph construction
#KT-18598 In Progress
 #KT-18599 In Progress
2017-06-29 15:59:56 +03:00
Mikhael Bogdanov
4f914fafca Calculate default mask shift properly
#KT-18689 Fixed
2017-06-29 14:57:42 +02:00
Alexey Andreev
1fa7193901 Change variance of return type of Promise.all function
See KT-18624
2017-06-29 10:34:10 +03:00
Alexey Andreev
479148f7e0 Run JS DCE gradle task in a separate process 2017-06-29 10:32:30 +03:00
Alexey Andreev
cfbb9209a7 Add JS DCE gradle plugin 2017-06-29 10:32:30 +03:00
Nikolay Krasko
9eefbc2036 Perform 'all import resolve' once and protect it with lock (EA-79696)
Binding context and diagnostic structures are not thread-safe now and
need to be protected with the lock.

Fix flacky test testRemoveDuplicateImport

This also probably fixes some traces in EA-79696
2017-06-28 18:57:13 +03:00
Nikolay Krasko
9f873f869a Print all diagnostics if null diagnostic found (EA-79696)
Diagnostics collection shouldn't contain nulls, but may do so when there
were unprotected simultaneous writes from several threads.
2017-06-28 18:57:12 +03:00
Mikhail Glukhikh
6c274cecff Protect getSingleAbstractMethodOrNull from data binding deadlock
Now it cannot cause resolve re-entrance
Probably #KT-18687 Fixed
2017-06-28 16:40:27 +03:00
Dmitry Neverov
3e29f9ed5a Don't report as redundant 1st semicolon in enum without entries
So #KT-12524 Fixed
2017-06-28 15:30:40 +03:00
Toshiaki Kameyama
3a606d13f0 Extends range of change visibility intention #KT-14093 Fixed 2017-06-28 15:28:50 +03:00
Dmitry Neverov
44ce5f73f7 Apply De Morgan's laws to non-negated binary expressions
So #KT-18460 Fixed
2017-06-28 15:28:43 +03:00
Toshiaki Kameyama
af53a0ecd5 Add quick-fix "Replace with safe call & elvis" #KT-17815 Fixed 2017-06-28 15:28:35 +03:00
Toshiaki Kameyama
c2707bb81b Support cascade if / when in lift return / assignment intentions
So #KT-13458 Fixed
So #KT-13436 Fixed
2017-06-28 15:28:28 +03:00
Toshiaki Kameyama
ed04b4debd Add quick-fix for empty brackets after primary constructor
So #KT-18534 Fixed
2017-06-28 15:28:21 +03:00
Mikhael Bogdanov
69457ef3f1 Generate optimized hashCode for primitive type with jvmTarget 1.8+
#KT-7571 Fixed
2017-06-28 13:44:07 +02:00
Igor Chevdar
d7e4350d42 Ignored/fixed some tests for Kotlin/Native 2017-06-28 12:54:32 +03:00
Alexey Andreev
7b52300287 Remove unnecessary system property from JS tests launch configuration
Replace it with property that allows to disable DCE tests.
This is useful for temporary disabling DCE without examining source
code to find property name.
2017-06-28 10:48:02 +03:00
Alexey Andreev
4037112f28 Implement deepCopy in JsRegExpr 2017-06-28 10:48:01 +03:00
Alexey Andreev
64331ffa40 Avoid excessive copying in JsLabel
See KT-18331
2017-06-28 10:48:01 +03:00
Denis Zharkov
3dc4f8a2ff Do not write generics for $suspendImpl synthetic method
#KT-18252 Fixed
2017-06-28 10:25:08 +03:00
Yan Zhulanow
e7e0032cc8 Kapt3, minor, tests: Weaken regular expression for Metadata shrinking 2017-06-28 10:25:08 +03:00
Denis Zharkov
d88d1d6189 Do not use non-existing class for suspend markers
As they remain in inline functions now proguard emits
a warning about them, even though inline suspend functions
are effectively inline-only and these markers can't be
executed at runtime

 #KT-18702 Fixed
2017-06-28 10:24:53 +03:00
Denis Zharkov
cb95986c36 Report error on calls to obsolete inline suspend functions
They do not contain markers for suspend calls in them

See the changes introduced for fixing KT-16603
2017-06-28 10:24:27 +03:00
Zalim Bashorov
6441c9d913 Restore executable attributes for all files in kotlinc/bin after copying them 2017-06-27 21:57:59 +03:00
Zalim Bashorov
6cd678af06 Add the ability to provide custom tag when deploy to npm 2017-06-27 21:35:09 +03:00
Nikolay Krasko
d8d862fa68 Do not compute class names for inline usages during stepping (KT-18411)
This was lost in "Debugger: Fix AbstractPositionManagerTest"(622430a29)

ExtraSteppingFilter: do not compute classNames for inline (f28f7eaa3b)

 #KT-18411 Fixed
2017-06-27 17:39:17 +03:00
Mikhail Glukhikh
7d7ef18e99 Fix type in README 2017-06-27 17:10:27 +03:00
Alexey Andreev
f6964b18db Fix performance issue in JS inliner
See KT-18679
2017-06-27 15:10:21 +03:00
Alexander Udalov
f96ef96078 Check JDK_16 and JDK_18 existence in build.xml 2017-06-27 14:54:53 +03:00
Alexander Udalov
e42b151561 Support primitive array annotation arguments in ConstantValueFactory
This has no visible consequences at the moment, but will help once we
need to load such argument from some annotation in the compiler in the
future
2017-06-27 14:53:39 +03:00
Alexander Udalov
b67542533b Drop unused FunctionDescriptor.Configuration.setSource 2017-06-27 14:53:39 +03:00
Alexander Udalov
288c2b5dc9 Minor, remove some obsolete usages of ResolutionContext#replaceScope 2017-06-27 14:53:39 +03:00
Alexander Udalov
59b932a815 Optimize away unneeded FqName computation in KotlinBuiltIns
Before computing the FqName, check the simple class name first. This
code was responsible for about 20% of FqNameUnsafe instances created
during compilation of "core" modules
2017-06-27 14:53:39 +03:00
Alexander Udalov
0352bdbca5 Optimize and improve AbstractClassTypeConstructor.equals
Instead of computing and comparing FQ names, compare simple names of
classes and theirs containers. This code was responsible for creation of
about 10% of FqNameUnsafe instances during compilation of "core"
modules.

Also make the check more strict: previously, a class "c" declared in
package "a.b" would be considered equal to a class "c" declared in class
"b" in package "a". Because JVM type descriptors of such classes are
different, this behavior was suspicious and might have lead to error at
runtime. Now, we require the number of containing classes of the given
two classes also to be the same
2017-06-27 14:53:39 +03:00
Dmitry Petrov
d5e02f069a Fast version for POP backward propagation (without SourceInterpreter) 2017-06-27 14:28:42 +03:00
Dmitry Petrov
f1183d98a9 Fix complexity formula for SourceInterpreter
It is actually N^2 * F (VERY pessimistic case),
N = number of instructions
F = frame size
because frames contain sets of instructions.
2017-06-27 14:28:42 +03:00
Dmitry Petrov
a84c2a6f31 Improve string concatentation & string templates code generation
Reuse StringBuilder instances for nested subexpressions.
(NB StringBuilder instance for string template with a string
concatenation inside an expression entry, such as `"${"a" + "b"}"`,
will not be reused, although that doesn't seem to be a real-life issue).

 #KT-18558 Fixed Target versions 1.1.4
 #KT-13682 Fixed Target versions 1.1.4

Join adjacent strings literals, escaped strings, and constant values
(in a language version that supports const val inlining).
Use StringBuilder#append(char) for single-character constants
(e.g., " " in "$a $b").

 #KT-17280 Fixed Target versions 1.1.4
 #KT-15235 Fixed Target versions 1.1.4
2017-06-27 14:28:42 +03:00
Dmitry Petrov
ae71833a12 Use original descriptors for functions when generating stubs
Descriptors for builtin class members on JVM are substituted.
2017-06-27 13:00:10 +03:00
Dmitry Petrov
5e5a1bd686 Use java.lang.Object as a fall-back reference type
If for some reason during preliminary analysis in redundant null check
elimination we failed to determine a local variable type statically,
treat it as java.lang.Object.
This will disable some further optimizations using precise type
information (such as INSTANCEOF check elimination), but will not fail
with an exception anyway.
2017-06-27 12:56:34 +03:00
vitaly.khudobakhshov
d165ea9ea7 Add expression type string to the REPL API
PR-1131
2017-06-27 11:28:40 +02:00
Alexander Udalov
8783f7a94e Remove unneeded nullability annotations in CallableReference 2017-06-26 18:46:26 +03:00
Alexey Andreev
20842dcc44 Add module name as a prefix to declaration keys in JS translator
This is necessary due to different modules can have same
package declarations. When importing declarations from these
packages, we should distinguish from which module we are importing it.

See KT-18652
2017-06-26 18:16:00 +03:00
Alexey Andreev
3331be9cc8 Fix JS CLI test that fails in Windows 2017-06-26 18:15:30 +03:00
Alexey Andreev
adc04196b1 Support JS source map source embedding configuration in IDEA 2017-06-26 18:15:29 +03:00
Alexey Andreev
a0e1bde594 Allow to embed source files into JS source maps 2017-06-26 18:15:28 +03:00
Nikolay Krasko
73c37ecd25 Remove usage of HighlightingSession.getEditor()
It's going to be deleted in IDEA.
2017-06-26 17:39:39 +03:00
Alexander Udalov
0c8ca5f930 Extract some functions from test class into base class
To be used in other tests which will be subclasses of
AbstractKotlinCompilerIntegrationTest
2017-06-26 16:22:05 +03:00
Alexander Udalov
69efb81a12 Minor refactoring in JavaModuleInfo
Remove unused declarations
2017-06-26 16:22:05 +03:00
Alexander Udalov
fd0658e0f4 Minor, inline unneeded JvmDependenciesIndexFactory 2017-06-26 16:22:05 +03:00
Alexander Udalov
0e2e3b3e65 Cleanup KotlinCoreEnvironment and usages
Remove unused API, weaken declaration visibility, reformat
2017-06-26 16:22:05 +03:00
Alexander Udalov
999e4cda1d Compute module mappings eagerly in JvmPackagePartProvider, refactor
Previously we traversed all notLoadedRoots on each request for package
parts with the given package FQ name. Since notLoadedRoots might contain
a lot of roots (which never transition into "loadedModules" because e.g.
they are not Kotlin libraries, but just Java libraries or SDK roots with
the META-INF directory), this was potentially hurting performance. It
seems it's more optimal to compute everything eagerly once
JvmPackagePartProvider is constructed.

Another problem with the previous version of JvmPackagePartProvider was
that it did not support "updateable classpath" which is used by REPL and
kapt2, it only used the initial roots provided in the
CompilerConfiguration. In REPL specifically, we would thus fail to
resolve top-level callables from libraries which were dynamically added
to the execution classpath (via some kind of a @DependsOn annotation).
In the new code, JvmPackagePartProvider no longer depends on
CompilerConfiguration to avoid this sort of confusion, but rather relies
on the object that constructed it (KotlinCoreEnvironment in this case)
to provide the correct roots. This is also beneficial because the
computation of actual VirtualFile-based roots from the ones in the
CompilerConfiguration might get trickier with modular Java 9 roots
2017-06-26 16:22:05 +03:00
Alexander Udalov
a5a78b8f91 Minor refactoring in ClasspathRootsResolver.convertClasspathRoots
Package prefix only makes sense for JavaSourceRoot content roots
2017-06-26 16:22:05 +03:00
Alexander Udalov
2424431e16 Extract ClasspathRootsResolver out of KotlinCoreEnvironment 2017-06-26 16:22:04 +03:00
Alexander Udalov
6d48b1c3fb Minor, extract MessageUtil.virtualFileToPath 2017-06-26 16:22:04 +03:00
Alexander Udalov
8af923c5ff Refactor MockLibraryUtil and related tests
- separate compileLibraryToJar into two public functions, for JVM and JS
- allow to pass any extra options instead of just -Xallow-kotlin-package
- add a bunch of default arguments for the most common cases
2017-06-26 16:22:04 +03:00
Alexander Udalov
68df1d73e7 J2K MockLibraryUtil: prettify 2017-06-26 16:22:04 +03:00
Alexander Udalov
46a6dc6550 J2K MockLibraryUtil: convert 2017-06-26 16:22:04 +03:00
Alexander Udalov
884e85653f J2K MockLibraryUtil: rename .java -> .kt 2017-06-26 16:22:04 +03:00
Denis Zharkov
c8a2de0243 Allow custom expected result for fast class reading tests 2017-06-24 17:26:02 +03:00
Denis Zharkov
bc564af2fc Regenerate mockJDK using openJDK 7 2017-06-24 17:26:01 +03:00
Dmitry Jemerov
3158c71c29 Check that we have correct sources for mockjdk 2017-06-24 17:08:11 +03:00
Nikolay Krasko
87889904ee Allow only one invoke to be a target for smart step into (KT-18632)
It's difficult to distinguish such calls reliably in debug session

 #KT-18632 Fixed
2017-06-23 21:33:26 +03:00
Mikhail Glukhikh
247c0497b1 Visibility can be private: weaken level to INFO 2017-06-23 18:15:21 +03:00
Mikhail Glukhikh
c99db11ace Visibility can be private: do not perform too expensive search
Also, additional test for usage via accessor was added
So #KT-18617 Fixed
2017-06-23 18:15:20 +03:00
Zalim Bashorov
3358f0ab69 KJS: use korlinc-js runner written in js to make possible to run it on any OS
Restore executable attributes on kotlinc* bash scripts after copying them.
2017-06-23 15:14:35 +03:00
Nikolay Krasko
502ac80b89 Do not skip invoke call on parameters during smart step into (KT-18577)
#KT-18577 Fixed
2017-06-23 13:47:33 +03:00
Nikolay Krasko
e5ce91dc5b Show receiver for invoke calls in smart step into popup 2017-06-23 13:47:33 +03:00
Alexey Sedunov
9681f5ca42 Generate equals/hashCode(): Enable for classes without properties
Also:
- forbid for enum classes
- use javaClass.hashCode() instead of 0 if class has no properties

 #KT-18418 Fixed
2017-06-22 19:50:55 +03:00
Alexey Sedunov
895407f5e3 Rename: Do not silently rename all parameters in function hierarchy
#KT-18325 Fixed
2017-06-22 19:50:54 +03:00
Alexey Sedunov
31d21a14f2 Copy: Disable when selection doesn't contain Kotlin source files
#KT-18390 Fixed
2017-06-22 19:50:53 +03:00
Alexey Sedunov
423fb9dfb3 Move/Copy: Warn about usages of JDK when moving to non-JVM module
#KT-18135 Fixed
2017-06-22 19:50:52 +03:00
Alexey Sedunov
1d36c49537 Copy: Copy elements and process usages under the same write action
In some cases doing these operations in separate write actions
may lead to invalidation of copied elements

 #KT-18149 Fixed
2017-06-22 19:50:51 +03:00
Alexey Sedunov
6b18ff1d97 Copy/Move: Fix processing of calls used as callees
#KT-18241 Fixed
2017-06-22 19:50:50 +03:00
Mikhail Zarechenskiy
87a41293e8 Improve diagnostics on callable reference of unresolved class
#KT-10839 Fixed
2017-06-22 15:02:13 +03:00
Mikhail Zarechenskiy
0579604653 Do not propose to specify constructor invocation in diagnostics
#KT-17188 Fixed
2017-06-22 15:02:10 +03:00
Mikhail Zarechenskiy
0f350f5db8 Don't report error on member that overrides open member from final class
#KT-14598 Fixed
2017-06-22 15:02:09 +03:00
Mikhail Zarechenskiy
9847278699 Report error about invalid if as expression on the if keyword
#KT-14633 Fixed
2017-06-22 14:18:11 +03:00
Mikhail Zarechenskiy
e40c8fff05 Make resolution status name more precise 2017-06-22 13:50:01 +03:00
Mikhail Zarechenskiy
7a9e1b2b1d Improve diagnostic on overload resolution ambiguity
Report type mismatch on argument when a nullable argument is passed to non-null parameter.

 Note that this affects only functions with simple types without generics

 #KT-2007 Fixed
 #KT-9282 Fixed
2017-06-22 13:41:31 +03:00
Mikhail Zarechenskiy
16de991b07 Add test for obsolete issue
#KT-8262 Obsolete
2017-06-22 13:41:30 +03:00
Mikhail Zarechenskiy
4b3ffd9418 If all candidates are invisible then don't report ambiguity
#KT-10045 Fixed
2017-06-22 13:41:28 +03:00
Mikhail Zarechenskiy
cd1ae7f0f2 Add resolution status to report about unsuccessful smartcast
#KT-10248 Fixed
 #KT-11119 Fixed
2017-06-22 13:41:27 +03:00
Mikhail Zarechenskiy
0f4497256b Report about wrong number of type arguments instead of ambiguity
#KT-7975 Fixed
 #KT-1809 Fixed
2017-06-22 13:05:10 +03:00
Dmitry Jemerov
24f1bbfb46 Add code for configuring eap-1.2 bintray repo
#KT-18316 Fixed
2017-06-22 11:01:03 +02:00
Dmitry Petrov
2b3043bf9f Fix CFG problem for 'when' in Konan
If type of 'when' expression is 'Nothing', it should be kept that way
even if the expression itself is implicitly coerced to Unit.
2017-06-22 10:21:54 +03:00
Alexander Udalov
1f34dfabd5 Use kotlin.Lazy for script definition computation, add test for no definition 2017-06-22 10:19:06 +03:00
Ilya Chernikov
4178188e15 Fix name retrieval on exception reporting during analysis 2017-06-22 10:19:05 +03:00
Alexander Udalov
135f0a136e CLI: report error if the first argument for "-script" is not kts
#KT-3045 Fixed
2017-06-22 10:19:05 +03:00
Alexander Udalov
85d1bef351 Add reflection.jvm module sources to kotlin-reflect library
To be able to debug classes in kotlin-reflect via reflection.jvm's
sources when running tests
2017-06-22 00:08:38 +03:00
Alexander Udalov
a064b59a7d Do not put "Class-Path: kotlin-stdlib.jar" into kotlin-reflect manifest
Since the kotlin-reflect artifact might be used in environments where
the kotlin-stdlib artifact is named something else (e.g.
kotlin-stdlib-{version}.jar) and the file existence is verified by the
launcher

 #KT-16399 Fixed
2017-06-22 00:08:38 +03:00
Dmitry Jemerov
2407f8b9ac Add collection building methods to default blacklist
#KT-18030 Fixed
2017-06-21 19:09:23 +02:00
Dmitry Jemerov
16c8a092ca Correctly show parameter name hints for non-ambiguous overloads 2017-06-21 19:09:21 +02:00
Nikolay Krasko
ad6c84924b Copy bootstrap compiler to dist directory
Can by used in old branches where it's impossible to make dist properly
2017-06-21 17:51:51 +03:00
Nikolay Krasko
3ffd63a17c Attempt for fix flaky debugger tests - wait for the resume before exit 2017-06-21 17:49:03 +03:00
Alexander Udalov
233b63469a Fix IllegalAccessException on private annotation in reflection
#KT-14094 Fixed
2017-06-21 15:43:00 +03:00
Alexander Udalov
fb60f4ad8f Do not load annotations of each function in JvmBuiltInsSettings.isFunctionAvailable
This fixes the exception in the case described in KT-14094 because we no
longer try to load annotations on functions which cannot be annotated
with @PlatformDependent. (However, the underlying problem in KT-14094 is
not fixed by this, and is still reproducible on explicit call to
KCallable.annotations.)

 #KT-14094 In Progress
2017-06-21 15:43:00 +03:00
Alexander Udalov
6388c1885c Fix KCallable.call for protected members from base class
Class.getMethod does not return protected methods from super class, so
we invoke getDeclaredMethod on each super class manually instead

 #KT-18480 Fixed
2017-06-21 15:42:59 +03:00
Alexander Udalov
a25aa2fed8 Cleanup DefaultErrorMessagesJvm
Use static imports, use Kotlin stdlib API, use more precise renderers
2017-06-21 15:42:59 +03:00
Alexander Udalov
4e51448b66 Refactor and simplify functionTypes.kt and related code
Remove unused declarations, inline one-liners, optimize by using
KotlinBuiltIns.isUnderKotlinPackage
2017-06-21 15:42:58 +03:00
Alexander Udalov
5a25ba199a Micro optimization to avoid computing class FQ name when not necessary
KotlinBuiltIns.isConstructedFromGivenClass checks the simple name of the
class first, and only computes the full FQ name if it matches the last
segment of the expected FQ name
2017-06-21 15:42:57 +03:00
Alexander Udalov
aed5b934f8 Introduce KotlinBuiltIns.isUnderKotlinPackage
Semantics is the same as in the former
FunctionDescriptor.hasSubpackageOfKotlin, but it doesn't compute the FQ
name of the descriptor
2017-06-21 15:42:57 +03:00
Alexey Sedunov
7bc42f89d3 Configuration: Fix API version selection on language version change 2017-06-21 12:36:53 +03:00
Alexey Sedunov
3460a31e3a Kotlin Facet: Do not import dependency-based classpath from Gradle
JPS obtains it automatically via imported module dependencies

 #KT-18475 Fixed
2017-06-21 12:36:52 +03:00
Alexey Sedunov
f68689b5e4 Kotlin Facet: Do not import jdkHome from Gradle/Maven model
#KT-18151 Fixed
2017-06-21 12:36:51 +03:00
Alexey Sedunov
fe42586c6f Kotlin Facet: Fix NPE in Maven importer tests
#KT-18376 Fixed
2017-06-21 12:36:50 +03:00
Alexey Sedunov
0570592952 Kotlin Facet: Avoid rewriting platform version with project settings
#KT-18373 Fixed
2017-06-21 12:36:49 +03:00
Ilya Chernikov
2e823a4816 Fix compatibility with renamed Gradle Kotlin DSL 2017-06-21 11:35:21 +02:00
Mikhail Zarechenskiy
1e020644e1 Fix getting right bracket element for collection literal 2017-06-21 01:22:08 +03:00
Mikhail Zarechenskiy
837df66c19 Register reference contributor for collection literals
#KT-18551 Fixed
2017-06-21 00:16:28 +03:00
Alexey Andreev
78b238a05b Report warning when two .kt files get same paths in JS source map 2017-06-20 17:40:36 +03:00
Alexey Andreev
60dd475493 Don't expose sourceMapSourceRoots argument to Gradle (JS)
Exposing this property causes IDEA to treat it as a free
command line argument, which is undesirable.
Support source roots via setting command line arguments inside
JS gradle task.
2017-06-20 17:40:35 +03:00
Alexey Andreev
49b742ab3d Add new JS source map config options to Maven plugin 2017-06-20 17:40:35 +03:00
Alexey Andreev
cfd3b137d8 Add support for JS source map source roots to Gradle plugin 2017-06-20 17:40:34 +03:00
Alexey Andreev
62fb149f08 Add support for sourceMapPrefix option (JS) in IDEA 2017-06-20 17:40:34 +03:00
Alexey Andreev
1d6f01ee6c Add support for relative JS source map paths in JPS 2017-06-20 17:40:33 +03:00
Alexey Andreev
13ab63ae09 Generate relative paths in JS source maps
Also, add CLI options to manipulate prefixes of path

See KT-4078
2017-06-20 17:40:32 +03:00
Nikolay Krasko
44d3b8fb1a Ignore sub-queries for other operators with the same receiver (KT-18566)
ExpressionsOfTypeProcessor searches for all occurence of expression
with given type. It start from usages of the class, searches for sub-classes,
declarations that return those classes, usages of these declarations,
and so on.

During this search, find usages for all operators that return the
subject type is executed as sub-queries. Full search for such queries
can't give addition types. And it also shouldn't give additional scopes
for search, because same scopes should be located by operands. In other
words, if sub-query can spot the scope of usage starting from the same
type, the original query should also process same scope.

 #KT-18566 Fixed
2017-06-20 16:53:05 +03:00
Yan Zhulanow
0f3dff44ac Minor: Remove invalid Maven module reference 2017-06-20 15:23:15 +03:00
Alexander Udalov
31b2fffbe1 Avoid NPE at UtilKt.toJavaClass for unrecognized classes
Sadly, the case where this NPE would reproduce, remains unknown

 #KT-18494 Fixed
2017-06-20 14:39:48 +03:00
Alexander Udalov
8ef3531c48 Add kotlin.Any to KClass.superclasses if it's absent
#KT-18476 Fixed
2017-06-20 14:39:48 +03:00
Alexander Udalov
9471f33c38 Refactor getDefaultSupertype, drop obsolete diagnostic 2017-06-20 14:39:47 +03:00
Alexander Udalov
90f2ea87a6 Fix exception on callBy of callable with more than 32 parameters
The previous condition that checked if we'd skipped any optional
parameters didn't work when number of parameters > 32 because the number
of bit masks in that case was more than one

 #KT-18404 Fixed
2017-06-20 14:39:47 +03:00
Mikhael Bogdanov
62cd57b0d2 Make base test classes 'abstract' 2017-06-20 13:07:30 +02:00
Dmitry Petrov
786ac46fa6 Do not store nulls for captured variables going out of scope
These values can't be read after going out of scope.
JVM implementation can take care of such object references on its own.
Ref objects for captured variables are not different from any other
objects stored in local variables, so there's really no reason to
nullify these references explicitly.

 #KT-18478 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00
Dmitry Petrov
9356c1e0ef Skip PopBackwardPropagation for methods with large frames or no POPs
TODO get rid of SourceInterpreter here, it's quite expensive.
2017-06-20 13:31:36 +03:00
Dmitry Petrov
0a622e4440 Rewrite OtherOrigin overloads to prevent further silly problems
#KT-18413 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00
Mikhael Bogdanov
8ca82c8e99 Add missed common parts 2017-06-20 11:08:53 +02:00
Mikhael Bogdanov
956cc0dbfd Support IMPLICIT_INTEGER_COERCION 2017-06-20 11:01:10 +02:00
Mikhael Bogdanov
d888addba0 Add KCallableNamePropertyLowering 2017-06-20 11:00:38 +02:00
Mikhael Bogdanov
44b7f5a5be Add inline tests to IR 2017-06-20 10:26:38 +02:00
Mikhael Bogdanov
8ab705a14c Introduce IrInliner 2017-06-20 10:26:37 +02:00
Mikhael Bogdanov
9f736f2192 Extract PsiSourceCompiler 2017-06-20 10:26:36 +02:00
Mikhael Bogdanov
2507780e19 Extract PsiInlineCodegen 2017-06-20 10:26:35 +02:00
Mikhael Bogdanov
8dc1b8f95f Introduce BaseExpressionCodegen and SourceCompilerForInline,
switch CallGenerator and InlineCodegen to them

~base
2017-06-20 10:26:35 +02:00
Alexey Andreev
3ae214b97a Fix reified parameters with non-identifier names in JS
See KT-18169
2017-06-20 10:41:52 +03:00
Alexey Andreev
d3a5201ecc Intrinsify String?.plus in JS BE
See KT-8020
2017-06-20 10:40:21 +03:00
Ilya Gorbunov
7efb9ddd4e Early return if value is null
The change is required to fix compilation for IDEA 172, where getValue()
became explicitly nullable.
2017-06-20 02:58:40 +03:00
Zalim Bashorov
8b9fd44bbe Publish kotlin compiler artifacts to NPM 2017-06-19 22:52:01 +03:00
Zalim Bashorov
06cd02f769 Publish to NPM with dev tag by default 2017-06-19 22:52:00 +03:00
Yan Zhulanow
04c09bedeb SamWithReceiver, minor: Add missing module to Spring plugin classpath (fixes Spring tests) 2017-06-19 20:28:48 +03:00
Yan Zhulanow
d07fd52c43 SamWithReceiver: Add general-purpose plugin and Gradle/Maven integrations 2017-06-19 20:28:47 +03:00
Alexey Sedunov
db3172a750 Configuration: Inline createDefaultArguments() methods
It's a superficial fix: the bug is actually caused by
uninitialized companion instance reference in
Kotlin2JvmCompilerArgumentsHolder class

 #KT-18505 Fixed
2017-06-19 18:15:40 +03:00
Mikhail Zarechenskiy
2a4cac024b Add test for obsolete issue
#KT-13813 Obsolete
2017-06-19 17:36:10 +03:00
Mikhail Zarechenskiy
aeac2ea384 Fix 'add not-null asserted call' quick fix for operation in
#KT-18529 Fixed
2017-06-19 17:36:09 +03:00
Mikhail Zarechenskiy
b53a3b324f Fix 'infix call' diagnostic for in operation
#KT-8845 Fixed
2017-06-19 17:36:08 +03:00
Mikhail Zarechenskiy
d17f31c8b0 Refactoring: move several utils from js module to frontend 2017-06-19 17:36:07 +03:00
Mikhail Zarechenskiy
dbfea9b787 Fix TCE for invalid code with wrong callee expression
#KT-14927 Fixed
2017-06-19 17:36:06 +03:00
Sergey Igushkin
0032719ab9 (minor) Bump Android Gradle plugin version to 3.0.0-alpha4 in tests 2017-06-19 14:37:02 +03:00
Mike
7e01ac81ab Fixed Slack link (#1140)
http://kotlinslackin.herokuapp.com/ is down, replaced with http://slack.kotlinlang.org/
2017-06-19 08:33:13 +02:00
Mikhail Glukhikh
e8b0d47765 PlainTextPasteImportResolver: use relevant facade for Java classes
Fixes EA-75803 for this particular case
2017-06-16 17:17:38 +03:00
Vyacheslav Gerasimov
f51e3ab90c Fix Android extensions property usage highlighting
#KT-10736 Fixed
2017-06-16 17:13:34 +03:00
Mikhail Zarechenskiy
f8617f6676 Adapt collecting synthetic constructors in IDE for completion 2017-06-16 16:44:53 +03:00
Mikhail Zarechenskiy
011231f2ab Collect sam adapters for constructors in synthetic scope
Also place computation of synthetic constructors under one function
2017-06-16 16:44:52 +03:00
Mikhail Zarechenskiy
0adc8d9bfa Minor: remove val 2017-06-16 16:44:51 +03:00
Mikhail Glukhikh
e9e028f987 Minor: add getName() for three local quick fixes to fix 162 / AS23 2017-06-16 16:20:55 +03:00
Mikhail Glukhikh
4f8db14e5b Update changelog (1.1.3-eap-85)
(cherry picked from commit 61cb598)
2017-06-16 16:04:32 +03:00
Derek Alexander
1f5cc059f9 Fix compiler failure related NO_EXPECTED_TYPE
Changes to turn KT-16016 into a compiler diagnostic error rather than a
stack trace

#KT-16016 Fixed
2017-06-16 15:52:09 +03:00
Mikhail Glukhikh
ace3bfbbf9 Fix if -> ?: / ?. highlight type
if should be transformed, default level used (weak warning);
if should not be transformed, no highlighting (information) used.
2017-06-16 15:23:48 +03:00
Mikhail Glukhikh
9e85b0c2ba Has platform type inspection: do not enforce weak warning type
So #KT-17954 Fixed
2017-06-16 15:17:50 +03:00
Mikhail Glukhikh
c3f3392f0c Minor 2017-06-16 15:04:29 +03:00
fitermay
81f5a29526 Make overridden member open: invalidate cached state on PSI modification
Before, waiting for inspection rerun was necessary
Also rename: computeState --> computeInfo
Related to KT-17740
2017-06-16 15:04:22 +03:00
fitermay
289286c8cd Avoid mutating state and do not rely on side effects for proper function
So #KT-17740 Fixed
2017-06-16 15:04:16 +03:00
fitermay
0dced8d29c Do not suggest "Make overridden member open" for already open ones
So #KT-18148 Fixed
2017-06-16 15:04:10 +03:00
shiraji
cbccf932a7 Add inspection removing redundant spread operator for arrayOf call
So #KT-17920 Fixed
2017-06-16 15:04:04 +03:00
Mikhail Glukhikh
ce55d9e364 Fix of "Replace array of with array literal"
Do not apply if module does not support the relevant feature
Related to KT-17164
2017-06-16 15:03:58 +03:00
Toshiaki Kameyama
b9fb7cc3a5 Add quick fix to generate equals / hashcode in data class with arrays
So #KT-15893 Fixed
2017-06-16 15:03:52 +03:00
Dmitry Neverov
5df5a001a1 Support implicit receiver in if-then intentions #KT-16069 Fixed 2017-06-16 15:02:44 +03:00
Kirill Rakhman
13a2612e20 Add inspection for ranges with start > endInclusive #KT-18438 Fixed 2017-06-16 15:02:31 +03:00
shiraji
647558c98a Add inspection for potentially wrongly placed unary operators
So #KT-18236 Fixed
2017-06-16 15:02:24 +03:00
Alexey Sedunov
eaea160f0e Kotlin Facet: Fix detection of source set name by Gradle compile task
#KT-17492 Fixed
2017-06-15 17:26:40 +03:00
Alexey Sedunov
1544467725 Presentation: Fix NPE on star projection rendering
EA-100480 Fixed
2017-06-15 17:26:39 +03:00
shiraji
ab4eb1dd20 Add better quickfix for scope functions #KT-13676 Fixed 2017-06-15 15:01:42 +03:00
Mikhail Glukhikh
09d8c31433 Change highlight type of many inspections to GENERIC_ERROR_OR_WARNING
This way they will use highlight type depending on their level.
Otherwise highlight type is enforced and changing level in IDE
actually changes nothing.
2017-06-15 15:01:41 +03:00
Dimach
d369fa094a Add Boolean? == const to elvis conversion and vice versa #KT-15368 Fixed
Convert elvis to equality check implemented as inspection due
code style guide
2017-06-15 15:01:39 +03:00
Nikolay Krasko
6e9c0a0fda Move test logging processing in find usages to single place 2017-06-15 14:00:43 +03:00
Nikolay Krasko
60c8d5dcc0 Fix search usages for invoke() with vararg parameter (KT-18479)
#KT-18479 Fixed
2017-06-15 14:00:42 +03:00
Nikolay Krasko
018d4653e8 Fix search usages for invoke() extension operator (KT-18269)
#KT-18269 Fixed
2017-06-15 14:00:41 +03:00
Pavel V. Talanov
46512f34e4 Fix 'Find symbol' and 'Go to declaration' when jar is used in many libs
SourceNavigationHelper takes into account all the module infos
    that given virtual file is a part of

 #KT-15093 Fixed
2017-06-15 13:35:40 +03:00
Pavel V. Talanov
6eb4addb6e Test 'find symbol' when same jar is shared by libs(some without sources) 2017-06-15 13:35:40 +03:00
Pavel V. Talanov
8cfd6ffae0 Test navigation from source when same jar is in different libraries
One library can have sources attached and the other doesn't

 #KT-15093 In progress
2017-06-15 13:35:39 +03:00
Pavel V. Talanov
b12de14482 Refactor, extract some 'goto' related testing utils 2017-06-15 13:35:38 +03:00
Pavel V. Talanov
4356795324 Refactor, extract util in test code 2017-06-15 13:35:37 +03:00
Pavel V. Talanov
7949d3209b Minor, untangle Multi(Module)HighlightingTest hierarchy a bit 2017-06-15 13:35:36 +03:00
Nikolay Krasko
850568b8e9 Support "Force Step Over" action over suspended calls (KT-18453)
#KT-18453 Fixed
2017-06-15 13:29:28 +03:00
Nikolay Krasko
0e8e8ef546 Step over for suspended calls (KT-18453)
Debugger do the normal step over action and checks if function is
going to suspend. In this case the "run-to-cursor" breakpoint is
installed on function enter to intercept re-enter into function
after suspension.

 #KT-18453 In Progress
2017-06-15 13:29:27 +03:00
Nikolay Krasko
6d7ce6cec1 Prevent debugger to stop twice on breakpoints after suspension point
#KT-18453 In Progress
2017-06-15 13:29:26 +03:00
Nikolay Krasko
49baba017a Allow to stop in suspend funciton on enter and before suspended return
This commit is needed to implement "step over" action over suspended
call. Debugger have to understand when function is going to be
suspended and be able to set a breakpoint on function re-enter.

 #KT-18453 In Progress
2017-06-15 13:29:25 +03:00
Dmitry Jemerov
a2427c64a1 Reset library caches on file types change and dumb mode enter/exit
Ref: 50df476199
2017-06-14 18:08:52 +02:00
Mikhail Glukhikh
94dcadbec7 filterNotInSource: retains only files in contentScope
So #KT-18221 Fixed
2017-06-14 18:22:52 +03:00
Mikhail Glukhikh
81a1f26b1d Rename: findSyntheticFiles -> filterNotInSource 2017-06-14 18:22:46 +03:00
Mikhail Glukhikh
7734ec3bd5 Do not highlight semantics in files not under module content
Related to KT-18221
2017-06-14 18:22:40 +03:00
Mikhail Glukhikh
2a1c101350 Use NotUnderContentRootModuleInfo only from PsiElement.getModuleInfo()
This makes getModuleInfoByVirtualFile nullable
Fixes a variant of EA-75803 (from moveConflictUtils)
2017-06-14 18:22:24 +03:00
Dmitry Jemerov
0e2bdb8e66 Support CONFIGURE_LIBRARY directive in intention tests
Also restore tests for ConvertCamelCaseTestFunctionToSpaced
and apply fix for KT-18375
2017-06-14 16:17:01 +02:00
Dmitry Jemerov
4fa75256b7 Options for wrapping parentheseses in calls (KT-18113) 2017-06-14 14:37:30 +02:00
Dmitry Jemerov
72e8cd7e78 Consistent names for spacing options 2017-06-14 14:37:30 +02:00
Dmitry Jemerov
2e9a3e6d12 Option to use continuation indent in expression bodies (KT-9818) 2017-06-14 14:37:22 +02:00
Dmitry Jemerov
f4c75e61ad Option to use continuation indent in parameter lists 2017-06-14 14:33:52 +02:00
Dmitry Jemerov
a4916a3c00 NodeIndentStrategy: J2K and cleanup 2017-06-14 14:33:51 +02:00
Dmitry Jemerov
14edd7e357 NodeIndentStrategy: rename to .kt 2017-06-14 14:33:51 +02:00
Dmitry Jemerov
6c954d7e04 Refactor custom options registration for more type-safe API 2017-06-14 14:33:44 +02:00
Dmitry Jemerov
fc2a1fce8b Remove line break between ) and : if there's a line break before ) 2017-06-14 14:33:42 +02:00
Dmitry Jemerov
2ce430d608 Refactor spacing rules representation for easier debugging 2017-06-14 14:33:41 +02:00
Dmitry Jemerov
a0b5a3a8a2 Implement parenthesis wrapping options 2017-06-14 14:33:41 +02:00
Dmitry Jemerov
487d948ad3 KotlinLanguageCodeStyleSettingsProvider: J2K and cleanup 2017-06-14 14:33:40 +02:00
Dmitry Jemerov
1da3c7f577 KotlinLanguageCodeStyleSettingsProvider: rename to .kt 2017-06-14 14:18:59 +02:00
Dmitry Jemerov
f32dc9e84e Put lambda parameters on the same line as opening curly brace 2017-06-14 14:18:58 +02:00
Toshiaki Kameyama
af941bfdf5 KT-18158 Expand selection should select the comment after expression getter on the same line (#1122)
* Expand selection should select the comment after expression getter on the same line #KT-18158 Fixed

* Fixed expand selection behavior for the declaration with comment #KT-18158

* Remove redundant code #KT-18158
2017-06-14 12:28:56 +02:00
Dmitry Jemerov
b1f84676d1 Update tests according to new formatter behavior 2017-06-14 11:40:41 +02:00
Andrius Semionovas
8c6f93b899 Add tests for KEEP_LINE_BREAKS 2017-06-14 11:28:57 +02:00
Andrius Semionovas
839141e4f6 Stop formatting line breaks between keywords and parentheses 2017-06-14 11:28:57 +02:00
Andrius Semionovas
c6acc4c5be KT-16558 Add space before parentheses config 2017-06-14 11:28:57 +02:00
Mikhael Bogdanov
c4fc0f3808 Review fixes 2017-06-14 10:34:25 +02:00
Mikhael Bogdanov
724ac3cf59 Convert text util methods to extension properties 2017-06-14 10:34:24 +02:00
Mikhael Bogdanov
e96d2212da Workaround for LightClass generation problem KT-18419 2017-06-14 10:34:24 +02:00
Mikhael Bogdanov
c8d3553a31 Rename InlineCodegenUtil.kt to inlineCodegenUtils.kt 2017-06-14 10:34:23 +02:00
Mikhael Bogdanov
bbb2b36794 Merge InlineCodegeUtil and InlineCodegeUtils 2017-06-14 10:34:22 +02:00
Mikhael Bogdanov
172a9c7e1e Code clean after convertion 2017-06-14 10:34:21 +02:00
Mikhael Bogdanov
51d494a271 Convert InlineCodegenUtil to Kotlin 2017-06-14 10:34:21 +02:00
Mikhael Bogdanov
b7b3b3a19c Rename InlineCodegenUtil.java to InlineCodegenUtil.kt 2017-06-14 10:34:20 +02:00
Mikhael Bogdanov
63c4794c30 Clean code after convertion 2017-06-14 10:34:19 +02:00
Mikhael Bogdanov
e6dbe87ee2 Convert InlineCodegen to Kotlin 2017-06-14 10:34:18 +02:00
Mikhael Bogdanov
7ce980815c Rename InlineCodegen.java to InlineCodegen.kt 2017-06-14 10:34:18 +02:00
Dmitry Jemerov
52cfec5bc1 Add actions for toggling type hints to list of irrelevant actions
They are available in many tests and only starting with  the 172 branch,
 so we ignore them to reduce clutter and branch divergence.
2017-06-13 19:45:39 +02:00
Nikolay Krasko
b0c82aac6a Minor: remove warnings and reformat KotlinDebuggerTestCase.java 2017-06-13 19:14:50 +03:00
Nikolay Krasko
a4f6b17559 Invalidate debugger tests caches on dist compiler updates 2017-06-13 19:14:49 +03:00
Nikolay Krasko
6d22e06359 Move all test data for single test to one directory 2017-06-13 19:14:48 +03:00
Simon Ogorodnik
75e5dca735 KT-18051: Allow copy-pasting from IDEA java to kotlin conversion
#KT-18051 fixed
2017-06-13 15:32:21 +03:00
Simon Ogorodnik
fa3f87492c KT-12104: Fix smart completion for argument of implicit invoke
#KT-12104 fixed
2017-06-13 15:32:09 +03:00
Dmitry Jemerov
8077a71aec Show more correct type hints
- Don't show hints containing error type as type parameter
 - Do not expand type aliases
 - Show base type for types of anonymous objects

 #KT-18369 Fixed
 #KT-18341 Fixed
 #KT-18343 Fixed
2017-06-13 14:26:56 +02:00
Mikhail Glukhikh
c6578384fb Minor: remove unused functions 2017-06-13 15:18:16 +03:00
Mikhail Glukhikh
ada697c6b0 Highlighting visitor: make holder immutable 2017-06-13 15:18:10 +03:00
Mikhail Glukhikh
945859ae4d Remove non-actual suppress 2017-06-13 15:18:05 +03:00
Mikhail Glukhikh
d5e605d5cc Distinguish captured highlighting from local variable / parameter
So #KT-14271 Fixed
2017-06-13 15:17:59 +03:00
Mikhail Glukhikh
aa3589004e Highlighting visitor: refactoring
Do not call AnnotationHolder functions directly,
only via HighlightingVisitor
2017-06-13 15:17:53 +03:00
Mikhail Glukhikh
f225d8dea5 J2K: HighlightingVisitor, AfterAnalysisHighlightingVisitor 2017-06-13 15:17:48 +03:00
Mikhail Glukhikh
44e727b75c Redundant toString() in string template: highlight selector only
And not the receiver. So #KT-18253 Fixed
2017-06-13 15:17:42 +03:00
Toshiaki Kameyama
2afe8989df Make <modifier> intention handle sealed correctly #KT-18425 Fixed 2017-06-13 15:02:36 +03:00
Dmitry Jemerov
a6d80b78de Fix tests 2017-06-13 13:04:11 +02:00
Vasily Kirichenko
6829c5ef8f add a test 2017-06-13 13:04:10 +02:00
Vasily Kirichenko
0381018d00 add the check into CanBePrimaryConstructorPropertyInspection as well 2017-06-13 13:04:10 +02:00
Vasily Kirichenko
c0ee50a693 do not show "Move to constructor" intention for properties declared in interfaces 2017-06-13 13:04:09 +02:00
Dmitry Jemerov
b9cfb6b59b typo 2017-06-12 19:20:12 +02:00
Dmitry Jemerov
2d9bf73049 Sort plugins before uploading 2017-06-12 19:02:20 +02:00
Toshiaki Kameyama
ac03c91dcc Make <modifier> intention inserts modifier between annotation and class keywords #KT-14092 Fixed 2017-06-12 18:32:35 +02:00
Alexey Sedunov
79493985be Kotlin Facet: Fix facet existence check during Gradle import
EA-101476 Fixed
2017-06-12 16:37:41 +03:00
Simon Ogorodnik
a371bcb624 Fix flaky kdoc lexer test
Normalize line separators
2017-06-11 18:13:49 +03:00
Ilya Gorbunov
4798c029de Limit visibility of sublists, make them implement RandomAccess 2017-06-10 10:00:15 +03:00
Ilya Gorbunov
d7ad1f3950 Explicitly disable ArrayLiteralsInAnnotations feature in test which validates it's unsupported 2017-06-10 10:00:15 +03:00
Anton Bannykh
46d9d296ca JS: use '/' as separator on all platforms to prevent sourcemap parse errors 2017-06-09 20:32:22 +03:00
Alexey Sedunov
3b15285a0c Analyze Data Flow: Add usage context panels 2017-06-09 17:19:23 +03:00
Alexey Sedunov
ff5a52b445 Analyze Data Flow: Respect member hierarchies
#KT-11994 In Progress
2017-06-09 17:19:22 +03:00
Alexey Sedunov
49da81f681 Analyze Data Flow: Support val/var parameters
#KT-11994 In Progress
2017-06-09 17:19:20 +03:00
Alexey Sedunov
ea7d535ae7 Analyze Data Flow: Support properties with custom accessors
#KT-11994 In Progress
2017-06-09 17:19:20 +03:00
Alexey Sedunov
d61ddaccb6 Analyze Data Flow: Support callable references
#KT-11994 In Progress
2017-06-09 17:19:18 +03:00
Alexey Sedunov
3f411fc93b Analyze Data Flow: Support lambdas/anonymous functions
#KT-11994 In Progress
2017-06-09 17:19:18 +03:00
Alexey Sedunov
0f44dd6ab0 Analyze Data Flow: Support dereference processing
#KT-11994 In Progress
2017-06-09 17:19:16 +03:00
Alexey Sedunov
858b454138 Analyze Data Flow: Initial implementation
#KT-11994 In Progress
2017-06-09 17:19:15 +03:00
Dmitry Neverov
3f104833ba Handle multi-line spaces and leading asterisks more correctly 2017-06-09 17:14:28 +03:00
Sergey Igushkin
0453c4a7bf Fix Android SDK licenses not being accepted in Kapt3AndroidIT
(cherry picked from commit 8084ac6)
2017-06-09 16:38:09 +03:00
Mikhail Glukhikh
630af6a9c6 Correct 1.1-specific test to fix 1.2-M1 build 2017-06-09 13:10:37 +03:00
Valentin Kipyatkov
ca7a0da10f Fixed one more case of redundant type arguments 2017-06-08 23:26:39 +03:00
Valentin Kipyatkov
4b0cbc61d1 More correct 2017-06-08 23:26:38 +03:00
Valentin Kipyatkov
c08d862e9e More correct algorithm for redundant type arguments detection 2017-06-08 23:26:38 +03:00
Valentin Kipyatkov
cfa442a42a Move refactoring available on cut/paste declarations from an object to top-level 2017-06-08 23:26:12 +03:00
Dmitry Jemerov
b143b1be42 Revert tesdata changes to match changed code behavior 2017-06-08 19:48:12 +02:00
fitermay
4fab29b648 KT-18006 Don't cut off trailing new lines. Make behavior consistent with Java literal copy/paste 2017-06-08 19:48:12 +02:00
fitermay
a63d631435 KT-18006 Bring behavior of Kotlin literal copy/paste inline with Java's after IDEA-172984 2017-06-08 19:48:12 +02:00
Nikolay Krasko
ba34ed89d3 Allow to report exceptions in internal mode when updates are available 2017-06-08 17:21:13 +03:00
Toshiaki Kameyama
c149e956cc Replace explicit parameter isn't shown on destructuring declaration
So #KT-17026 Fixed
2017-06-08 16:32:54 +03:00
Alexey Sedunov
e5717d3e96 Copy: Enable file copy for mixed Java-Kotlin case
Also merge CopyKotlinFileHandler with CopyKotlinDeclarationsHandler
as it currently can't be invoked for such cases

 #KT-18200 Fixed
2017-06-08 14:37:37 +03:00
Alexey Sedunov
13212f06b4 Copy/Move: Fix processing of imported Java static members
#KT-18098 Fixed
2017-06-08 14:37:37 +03:00
Alexey Sedunov
a0629bfc58 Rename: Fix rename of import alias referring to object member
#KT-18096 Fixed
2017-06-08 14:37:35 +03:00
Alexey Sedunov
1ded171720 Rename: Disable member inplace when variable inplace is available 2017-06-08 14:37:34 +03:00
Alexey Sedunov
69c315443a Rename: Disable label rename outside of reference range
#KT-17128 Fixed
2017-06-08 14:37:34 +03:00
Alexey Sedunov
566e701131 Rename: Disable Java member rename by reference to import alias
#KT-18076 Fixed
2017-06-08 14:37:32 +03:00
Alexey Sedunov
9c11c42ec2 Rename: Fix inplace refactoring for declarations with backticked names
#KT-15859 Fixed
2017-06-08 14:37:31 +03:00
Alexey Sedunov
2f88b6ef9b Copy: Rename only self-usages of the copied class
#KT-18034 Fixed
2017-06-08 14:37:30 +03:00
Alexey Andreev
4252d9786b Fix translation of interface with non-abstract methods in JS BE
Fix additional case of generic interfaces in KT-18187
2017-06-08 13:51:18 +03:00
Alexander Udalov
09e4775a10 REPL: display configuration-related messages after start
Previously these messages (e.g. non-existing jar path in classpath,
invalid language version, etc.) were shown after the user exited from
the REPL
2017-06-08 12:28:07 +03:00
Alexander Udalov
cbb6269391 REPL: do not report warnings when there are errors
#KT-18349 Fixed
2017-06-08 12:28:06 +03:00
Alexander Udalov
ed922deb93 REPL: do not output additional newline after compiler and runtime errors 2017-06-08 12:28:05 +03:00
Alexander Udalov
bd9dd90649 REPL: print newline before exit
No tests added because the only way to test this seems to be to launch a
new process and send "Ctrl+D" into it, which seems cumbersome for such
small change
2017-06-08 12:28:04 +03:00
Alexander Udalov
6f22baa0f6 REPL: improve "are all errors at EOF" detection
Also ignore whitespaces and comments that appear after the last error in
a REPL line

 #KT-15172 Fixed
2017-06-08 12:26:54 +03:00
Dmitry Jemerov
2326b5faf3 Update testdata according to behavior changes 2017-06-08 10:43:19 +02:00
Toshiaki Kameyama
d90cc6f4cf Intention Make private and friends should respect modifier order #KT-17823 Fixed 2017-06-08 10:41:07 +02:00
Mikhael Bogdanov
5dfe77b7c3 Fix array element processing 2017-06-08 09:23:50 +02:00
Mikhael Bogdanov
5bba5b2fb7 Bind annotation methods via primary constructor 2017-06-08 09:23:45 +02:00
Mikhael Bogdanov
514d25bdd4 Fix FAKE_OVERRIDE processing 2017-06-08 09:23:39 +02:00
imknown J. Kimu
317e24ce69 Fix Git CLI typo. (#1119)
No soft-wrapped words.
2017-06-08 08:28:06 +02:00
Simon Ogorodnik
a6e153312c Prevent early deleting of not-null assertions
Before val to var conversion applied, smart-cast can cause
dropping not-null assertion, which will be required when val will
become var
2017-06-07 21:21:37 +03:00
Simon Ogorodnik
e41c027c9a Add IDEA data-flow analysis to guess nullability
Add "if return..." folding to "return if"
2017-06-07 21:21:36 +03:00
Simon Ogorodnik
1f26353de4 Add measureTimeMillisWithResult function to addToStdlib 2017-06-07 21:21:34 +03:00
Simon Ogorodnik
682a278cb8 Fix deleting of semicolon when it required to mark statement empty
#KT-18142 fixed
#KT-18141 fixed
2017-06-07 21:08:08 +03:00
Dmitry Jemerov
558203e2bb Rename "Remove no constructor" to "Remove constructor call"; fix test 2017-06-07 19:49:45 +02:00
Toshiaki Kameyama
bb5681fdb5 Add quick-fix for NO_CONSTRUCTOR error #KT-17842 Fixed 2017-06-07 19:47:36 +02:00
Ilya Zorin
862631b2ec Handle spaces around dot in type references and before type argument list 2017-06-07 19:43:14 +02:00
Andrius Semionovas
4acb95acb5 Fix KT-16725; Remove spaces between array indices 2017-06-07 19:39:55 +02:00
Zoltan Polgar
46ce9a6946 JS: Avoid declaration skeleton body generation in case of external class or object 2017-06-07 19:22:24 +02:00
Alexander Udalov
15e392bbd1 Fix compilation on Windows
JDK_16 environment variable may have spaces in it ("C:\Program
Files\..."), so it should be passed as a separate argument explicitly to
the kotlinc ant task
2017-06-07 16:26:09 +03:00
Alexander Udalov
c851e9d206 CLI: use JDK 1.6 to compile the "kotlin" launcher script
"kotlin" is used to run programs compiled by "kotlinc" which supports
emitting JVM bytecode 1.6, so it should also be runnable on JDK 1.6
2017-06-07 14:57:44 +03:00
Alexander Udalov
96bd8cb3c2 Minor, move PluginCliParser and PluginURLClassLoader to subpackage 2017-06-07 14:56:58 +03:00
Alexander Udalov
534e8a5c50 Do not pack useless files into the compiler jar
Do not pack META-INF/services to compiler-quick from out directories
because they're packed from sources anyway in the pack-compiler target.
Also do not pack the "META-INF/jb/$$size$$" and "META-INF/LICENSE" files
found in some IntelliJ libraries. Licenses are not required in binaries,
and previously only the first of them was packed anyway
2017-06-07 14:41:13 +03:00
Alexander Udalov
a614419b43 Fix KotlinJpsBuildTest.testHelp on Windows 2017-06-07 14:17:35 +03:00
Alexander Udalov
4844d720cc Remove dependency of module 'java-model-wrappers' on 'annotation-processing'
This breaks the circular dependency between them
2017-06-07 14:06:01 +03:00
Nikolay Krasko
0e693c39a3 Don't remove else block if it participate in other expression (KT-18309)
#KT-18309 Fixed
2017-06-07 13:49:34 +03:00
Dmitry Jemerov
5c993ce83f Fix Slack link 2017-06-07 11:58:00 +02:00
Pavel V. Talanov
2b153d5c10 Improve search for facade light class by kotlin file
LightClassUtil#getWrappingClass works for clashing facade fq names

 #KT-17855 Fixed
2017-06-07 11:19:23 +03:00
Mikhail Glukhikh
417b430033 Test reproducing KT-17855 2017-06-07 11:19:23 +03:00
Alexey Andreev
59240a4bd9 Report errors in JS source maps as compiler warnings 2017-06-07 11:13:55 +03:00
Alexey Andreev
bf21cfd6e0 Use source map remapper in JS inliner 2017-06-07 11:13:55 +03:00
Alexey Andreev
9c4ec902b0 Fix test broken by changes in JS source maps 2017-06-07 11:13:54 +03:00
Alexey Andreev
e43cc65702 Fix location reported by JS parser in case of long lines 2017-06-07 11:13:54 +03:00
Alexey Andreev
1dae687e7d Fix support of - and + prefix operators in JS parser
Treat number literal that represents minimum integer as integer node in
JS AST.

Treat +<number_literal> JS AST as unary node (+) containing single
number literal
2017-06-07 11:13:53 +03:00
Alexey Andreev
590954e9a8 Add processor that removes location from ambiguous JS AST nodes
There are cases when it's impossible to distinguish which JS node
owns location denoted by source map. Consider example:

a + b

Both root JsBinaryNode and its arg1 point to the same start location.
Out translator provides full information, though parser can't
produce the same AST. The second AST will miss some of the locations
available on the first one. This processor gets AST node produced
by translator and removes locations from there so that both ASTs
become equal.
2017-06-07 11:13:53 +03:00
Alexey Andreev
c5bf76578a Add test infrastructure for JS source map parser and generator 2017-06-07 11:13:52 +03:00
Alexey Andreev
ca738a9536 Prevent JS source map builder from inserting overlapping mappings
Check if newly inserted mapping is in the same position within
JS line and in this case omit the mapping
2017-06-07 11:13:51 +03:00
Alexey Andreev
174068c462 Add JS source map parser and remapper
JS source map remapper takes parsed source maps
together with JS AST with correct JS positioning information
and converts the latter into Kotlin positioning information
2017-06-07 11:13:51 +03:00
Alexey Andreev
e784d1846e Fix warning in BasicBoxTest (JS) 2017-06-07 11:13:50 +03:00
Alexey Andreev
93ec81d2eb Add source information to parsed JS AST 2017-06-07 11:13:50 +03:00
Alexey Andreev
1d1da326be Refactor JS parser 2017-06-07 11:13:49 +03:00
Alexey Andreev
3a3720db8d Reformat JS parser for conformance with project's style settings 2017-06-07 11:13:49 +03:00
Alexey Andreev
41ad637bad Fix warnings in JS parser 2017-06-07 11:13:48 +03:00
Alexey Andreev
9d186cfc66 Fix JS source maps for temporary variables 2017-06-07 11:13:47 +03:00
Alexey Andreev
27a44f3282 Fix JS source maps for complex enum entry 2017-06-07 11:13:47 +03:00
Alexey Andreev
b70c52e41f Fix JS source maps for optional arguments
Also, when function has expression body, use expression instead
of function declaration to mark return statement.
2017-06-07 11:13:46 +03:00
Alexey Andreev
6f0e4c4deb Fix JS source maps for data class synthetic methods 2017-06-07 11:13:46 +03:00
Alexey Andreev
5bc6c07f9e Fix JS source maps for companion objects of enum 2017-06-07 11:13:45 +03:00
Alexey Andreev
c9545f291a Fix JS source maps for properties without initializer 2017-06-07 11:13:44 +03:00
Vyacheslav Gerasimov
fdf098d65c Add gutter icon with navigation to related files for Android components 2017-06-06 20:47:30 +03:00
Vyacheslav Gerasimov
3f03b05bd3 Fix Android gutterIcon test, use findGuttersAtCaret method 2017-06-06 20:47:21 +03:00
Vyacheslav Gerasimov
643e3587cc Kotlin UAST should visit property delegate expression
#KT-15164 Fixed
2017-06-06 20:47:01 +03:00
Vyacheslav Gerasimov
15bfd4439a Fix AddTargetVersionCheckQuickFix, generate else branch with TODO
when surrounded statement used as expression

#KT-17786 Fixed
#KT-17788 Fixed
2017-06-06 20:46:53 +03:00
Vyacheslav Gerasimov
33c3ba815f Fix Android SuppressLint and Api quickfixes: proper annotation placing
#KT-17783 Fixed
 #KT-17787 Fixed
2017-06-06 20:46:40 +03:00
Alexander Udalov
e6001f57fa Remove dependency of module 'backend' on 'backend.jvm' and 'ir.tree'
This breaks the circular dependency between 'backend' and 'backend.jvm'
2017-06-06 19:55:06 +03:00
Alexander Udalov
cf04157ec8 Ignore gradle build directories in the root module 2017-06-06 19:52:43 +03:00
Alexander Udalov
5e6db3d4a6 Fix broken source and class roots of project libraries 2017-06-06 19:52:42 +03:00
Alexander Udalov
fb520e3040 Maven: do not set JVM target to null
After a236400, it's expected that the value of jvmTarget should not be
null. Otherwise ArgumentUtils.convertArgumentsToStringList fails with
NPE
2017-06-06 19:52:04 +03:00
Alexander Udalov
a802e7fb71 CLI: fix non-XML rendering of argument parse error, simplify code
If the compiler is invoked through JPS, an instance of
XmlMessageRenderer is used and the output should be a valid XML.
Previously, we reported the argument parse error (and the note to try
"-help") before calling messageRenderer.renderPreamble, which resulted
in invalid XML. The same was happening for the usage printed on "-help".
Both of these problems are fixed

 #KT-14848 Fixed
2017-06-06 19:52:04 +03:00
Alexander Udalov
a67382fdec Daemon: do not exit with internal error on invalid arguments
Invalid compiler arguments should lead to a compilation error, not
internal error. This has been fixed by splitting the
"parseArguments(...)" call (which does parsing + validation) in
CompileServiceImpl into two calls of parseCommandLineArguments +
validateArguments, and returning with a compilation error if the latter
did not succeed

 #KT-16057 Fixed
 #KT-14848 In Progress
2017-06-06 19:52:02 +03:00
Sergey Igushkin
2cad64881d (minor) Improve exception message in case no Android plugin was found 2017-06-06 17:21:20 +03:00
Sergey Igushkin
21b88995ab Add tests for the introduced fixes
Add a test for applying kotlin-android plugin with com.android.feature

Add a test for Databinding (not passing yet with 3.0.0+, until
3.0.0-alpha4 is released, which contains the fix from the Android side).

Add missing test project android-databinding.

Refactor and improve the tests

* Remove redundant files from test project 'android-databinding'
* Refactoring and minor improvements in the tests
2017-06-06 17:21:20 +03:00
Sergey Igushkin
483218e491 Fix for the Databinding issue where the kapt task started to early, not
letting the Databinding pre-process the project.
2017-06-06 17:21:20 +03:00
Sergey Igushkin
f053d79994 Add support for com.android.feature plugin. 2017-06-06 17:21:20 +03:00
Pavel V. Talanov
bdf76f23c4 Jvm Codegen: do not throw on malformed delegation to a type parameter
Fix exception on light class building

See KT-15931
2017-06-06 17:11:19 +03:00
Pavel V. Talanov
19db4304bd Use clsDelegate to calculate hasModifierProperty("final") for light psi
AllOpen plugin can make some changes and we don't have the tools to make
    correct decision based on psi

 #KT-17857 Fixed
2017-06-06 17:11:18 +03:00
Pavel V. Talanov
f3f2379e5a KtLightMemberModifierList:hasExplicitModifier("default") returns false
#KT-18070 Fixed
2017-06-06 17:11:17 +03:00
Mikhail Glukhikh
f54267eab4 Revert 'configureSilently' removal 2017-06-06 16:14:50 +03:00
Nikolay Krasko
0980446836 Fix running Android tests locally on windows 2017-06-06 14:56:22 +03:00
Nikolay Krasko
45958e630d Refactoring: move method 2017-06-06 14:56:21 +03:00
Nikolay Krasko
cb4c840d3b Remote old tasks for fetching continuous branches 2017-06-06 14:56:21 +03:00
Alexander Udalov
6a4c1b138f Remove dependency of module 'cli' on 'builtins-serializer'
This breaks the circular dependency between them
2017-06-06 14:29:27 +03:00
Alexander Udalov
7febd846e8 Export 'intellij-core' in module 'frontend'
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00
Alexander Udalov
2ed027219c Remove dependency of module 'frontend' on 'plugin-api'
This breaks the circular dependency between them
2017-06-06 14:29:25 +03:00
Alexander Udalov
cc2f607be3 Remove dependency of module 'frontend.java' on 'javac-wrapper'
This breaks the circular dependency between them
2017-06-06 14:29:24 +03:00
Alexander Udalov
1df13e0bc9 Move TopDownAnalyzerFacadeForJVM to module 'cli'
It's only used in the command line compiler and in tests
2017-06-06 14:29:23 +03:00
Alexander Udalov
f6c263b54d Remove dependency of module 'javac-wrapper' on 'cli' and 'cli-common'
This breaks the circular dependency between them
2017-06-06 14:29:22 +03:00
Alexander Udalov
1273ac9647 Remove dependency of module 'descriptors' on 'deserialization' 2017-06-06 14:29:21 +03:00
Alexander Udalov
751ff48301 Extract logic of builtins package fragment provider creation
This allows to drop the compile dependency of module 'descriptors' on
'deserialization', breaking the circular dependency between them
2017-06-06 14:29:20 +03:00
Alexander Udalov
1728b77b2c Minor, refactor createBuiltInsPackageFragmentProvider 2017-06-06 14:29:19 +03:00
Alexander Udalov
cbaa676c3d Move some declarations between 'descriptors' and 'deserialization'
- Move the following from 'deserialization' to 'descriptors':
  NotFoundClasses.kt
  AdditionalClassPartsProvider.kt
  ClassDescriptorFactory.kt
  PlatformDependentDeclarationFilter.kt
  findClassInModule.kt
- Move the following form 'descriptors' to 'deserialization':
  BuiltInSerializerProtocol.kt
  builtInsPackageFragmentProvider.kt
- Extract a marker interface from BuiltInsPackageFragment and move its
  implementation to 'deserialization'
- Change the type of parameters in PlatformDependentDeclarationFilter
  and AdditionalClassPartsProvider to ClassDescriptor

This will help in getting rid of the circular dependency of
'descriptors' <-> 'deserialization'
2017-06-06 14:29:18 +03:00
Alexander Udalov
a4931568ba Relocate service definition files for kotlin-reflect
See
http://imperceptiblethoughts.com/shadow/#merging_service_descriptor_files

 #KT-16810 Fixed
2017-06-06 14:29:17 +03:00
Alexander Udalov
2b878f863c CLI: report error if kotlinc is invoked on Java 6 or 7
#KT-17297 Fixed
2017-06-06 14:17:28 +03:00
Alexander Udalov
ea9194e1fb CLI: compile preloader against JDK 1.6
To be able to detect the Java runtime version at startup to report an
error if it's < 1.8
2017-06-06 14:17:27 +03:00
Alexander Udalov
a236400785 CLI: drop CommonCompilerArguments.createDefaultInstance
Move the corresponding default value initializers to the field
declarations
2017-06-06 14:17:26 +03:00
Alexander Udalov
26e3d2cf5d Use TopLevelDeclarations analysis mode in REPL
#KT-12564 Fixed
2017-06-06 14:00:45 +03:00
Alexey Andreev
b6d12fe7f3 Fix bug in re-importing modules from inline declarations in JS
Fix another case in KT-18201
2017-06-06 13:36:19 +03:00
Alexey Andreev
67f9474e2e Update changelog for 1.1.3 2017-06-06 11:40:36 +03:00
Dmitry Petrov
fd1866b838 Do not check argumentMapping.isError()
Argument matching status can be considered an "error" in resolve,
even though it is not a compilation error and doesn't prevent code
from being generated.
Actually, we should only check if the argument matching status is
ArgumentMatch.

 #KT-18294 Fixed
2017-06-06 10:19:18 +03:00
Dmitry Neverov
e2aa3518df Property accessor isn't recursive when called on another object
So #KT-18120 Fixed
2017-06-05 19:42:44 +03:00
Mikhail Glukhikh
ecfc2236a6 Fix script properties kind in modifier checker #KT-18234 Fixed 2017-06-05 17:22:11 +03:00
Mikhail Glukhikh
29f25ebeb9 Fix of JUnitMembersSearcherTest.testJunit3 2017-06-05 16:57:10 +03:00
Alexey Andreev
ee18c0f4e7 Fix name of JS DCE tool 2017-06-05 11:22:37 +03:00
Alexey Andreev
3180ea24d1 Fix assertion in test for reimporting declarations in JS 2017-06-05 11:21:41 +03:00
Alexander Udalov
e67e0440bb Rename LexicalScope.Empty -> Base
"Empty" is slightly confusing because although the scope has no declared
symbols, it is not empty: it has a parent scope which can contain
symbols and can have parents as well
2017-06-05 10:27:38 +03:00
Alexey Andreev
1df6f2f9a0 JS BE: expose imported modules via $$importsForInline$$ property
... and use it as prefix to FQN in inline functions. This allows
to properly inline function declared in module A to module B,
when this function calls another function in module C.

See KT-18201
2017-06-02 14:18:42 +03:00
Dmitry Petrov
978661c53d Do not generate default parameter values for synthetic functions
This causes a subtle issue with 'copy' function for data class,
which has parameters with source elements corresponding to
the data class primary constructor parameters: default value expression
for such parameters is generated second time (to be overwritten later),
which creates duplicate bindings if such expression included any
(possibly anonymous) declarations, such as lambdas or anonymous objects.

 #KT-18208 Fixed
2017-06-02 10:57:45 +03:00
Alexander Udalov
eb3e728e63 Merge pull request #1111 from mithunsasidharan/patch-1
Fixed a typo in a comment
2017-06-02 10:47:18 +03:00
Alexander Udalov
45053c1de6 Merge pull request #1112 from mithunsasidharan/master
Minor corrections in spec-docs
2017-06-02 10:46:34 +03:00
Dmitry Petrov
4a632857d7 Fix internal compiler error in DefaultParameterValueSubstitutor
Most likely a typo in the original code.
2017-06-02 10:14:33 +03:00
Mithun Sasidharan
15716a7a3c Minor corrections to spec-docs 2017-06-02 10:59:59 +05:30
Mithun Sasidharan
21849fe466 Fixed a minor spelling mistake in a comment
Fixed a minor spelling mistake in a comment
2017-06-02 08:57:00 +05:30
Vyacheslav Gerasimov
24476fc581 Fix MoveProperty intention: better property placement
Property is placed now before first property, or at the beginning of class body if no properties found.

#KT-18044 Fixed
2017-06-01 20:35:20 +03:00
Vyacheslav Gerasimov
ca124d1e36 Remove Android api diagnostic error on Kotlin interface default methods
They don't require java 8 or any other special support to work on Android

#KT-18059 Fixed
2017-06-01 20:35:08 +03:00
Dmitry Jemerov
286f82a5c5 Don't set java.awt.headless if it was set externally 2017-05-31 16:02:26 +02:00
Alexey Tsvetkov
5a22917f82 Run Gradle Android tests with other Gradle tests 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
aa9a40b61b Add tests with new Android Gradle Plugin 2017-05-31 16:59:03 +03:00
Sergey Igushkin
dce6a4f869 Fix UnsupportedOperationException caused by mutation of FileCollection 2017-05-31 16:59:03 +03:00
Sergey Igushkin
a68f7d79f5 Migration to AGP 2.3.0 2017-05-31 16:59:03 +03:00
Sergey Igushkin
6e721c4cee Further fixes for Android tests on TeamCity
Added support repository to download_android_sdk.xml
Changed the build tools version in testProject to 23.0.1

(trial) Remove platform 22
2017-05-31 16:59:03 +03:00
Sergey Igushkin
227a1d5fa0 Got rid of the sdk-manager plugin. 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
18505157e0 Fix failing Gradle tests
* Extract ANDROID_HOME_PATH constant
* Set ANDROID_HOME_PATH to dependencies/androidSDK
* Running download_android_sdk.xml is now needed to run Gradle Integration Tests
* Modify download_android_sdk.xml so that tools/android is executable

(cherry picked from commit 75a6e37)
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
6e07b1cd99 Gradle: set default values of languageVersion and apiVersion to null
Before the change, Gradle always explicitly set language and api
version to the latest version, preventing the compiler
from inferencing the arguments.

     #KT-18047 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
b06b18de07 Set destination to null when module is set in JPS
This fixes the warning "The '-d' option with a directory destination
is ignored because '-module' is specified", when a project imported
from Gradle is built with JPS.

    #KT-17665 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
5fbb41bf86 Stabilize test of Gradle's daemon for memory leaks
We need to wait for GC to finish, because GC can be concurrent
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
d80a463735 Report memory usage only when system property is set
This improves performance of Gradle builds with debug logging (--debug),
because System.gc is now forced only when the system property
'kotlin.gradle.test.report.memory.usage' is set.

    #KT-17960 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
a6a829c272 Improve test error message 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
e1457ffea0 Limit max number of active Gradle processes for the test run
This is needed to avoid retaining memory by each Gradle version
which is critical for running tests on CI server.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
2fa8a1139f Refactor Gradle ITs so any Gradle wrapper version can be used
This change:
* fixes tests with missing (in branch 1.1.3) GradleWrapper-3.4
* enables using any Gradle version in integration tests
without adding a new GradleWrapper-<version> dir.

The only difference between wrappers is in a version
number in a `gradle-wrapper.properties` file.
I removed all but one wrappers from `test/resources`,
and replaced the version with the template token <GRADLE_WRAPPER_VERSION>
for the remaining wrapper.
During a test run a template wrapper for each required version
is copied to a temporary directory.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
be1b1029a4 Minor: add .gitignore for gradle-tools 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
a8263361c0 Fix tests for coroutines setting in Gradle
ArgumentUtils#convertArgumentsToStringList does not
serialize an argument with default value,
so the string "-Xcoroutines=warn" was no longer present in logs.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
0a17dc3229 Refactor kapt tasks' wiring
* Unify tasks wiring for new and old Android Gradle Plugin
* rename wireKaptTask->registerGeneratedJavaSource
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
e529592d15 Pass task object instead of task name to dependsOn
This simplifies filtering out dependsOn later
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov
c8d05f8485 Remove most of Gradle tests with Jack
Jack is deprecated and Kotlin Gradle plugin throws,
so one test checking that build is failing with the exception
is enough.
2017-05-31 16:59:02 +03:00
Alexey Tsvetkov
0cb67b4052 Minor: simplify expression 2017-05-31 16:59:02 +03:00
Alexey Tsvetkov
c20d569aaa Simplify friend paths configuration 2017-05-31 16:59:02 +03:00
Sergey Igushkin
3e95a551e0 Various fixes
* Expose internals as public to use them in the agp25 source set
* Refactor of Android25ProjectHandler.kt
* Fix Kapt3 for non-Android projects
2017-05-31 16:59:02 +03:00
Sergey Igushkin
546a26a4cd Fix Kapt task depending on compileKotlin because of incorrect filtering
of compileJava dependencies

(cherry picked from commit 9a2c3b0)
2017-05-31 16:59:02 +03:00
Alexey Tsvetkov
95d3d3057a Update gradle wrapper permissions
It was not executable on linux
2017-05-31 16:59:02 +03:00
Sergey Igushkin
a82c0c843e Use the Google Maven repository instead of local preview.
(cherry picked from commit 4279335)

(cherry picked from commit 0e8b850)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
edd22310c0 (minor) Fix missing dependency on JUnit
(cherry picked from commit 7ad5d04)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
1bc0e8a276 Fix friend paths configuration with the new API for compile*Test tasks
Add lazy `friendClasspathEntries` to KotlinCompile
Set `friendClasspathEntries` in the Android25Pro
Change to AGP 3.0.0-alpha1;

(cherry picked from commit 1d6dd5c)

(cherry picked from commit 6cdf501)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
7fae7c1d55 Fix registering the non-existent Kapt3 classes directory as bytecode if
Kapt3 is disabled.

(cherry picked from commit 692e23c)

(cherry picked from commit 1cbdb6c)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
77031ab6f9 Change the legacy API threshold to 2.5.0
(cherry picked from commit fca2e23)

(cherry picked from commit 9394d15)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
d2a08c5fe4 Tasks wiring improvements & Kapt3 integration through variant wrapping 2017-05-31 16:59:02 +03:00
Sergey Igushkin
b0c2c4eba9 Task wiring
* Generalized tasks wiring
* Moved the old implementation to LegacyAndroidAndroidProjectHandler.kt
* Added an implementation with the new AGP API

(cherry picked from commit 1b4592d)

(cherry picked from commit 50a75d4)
2017-05-31 16:59:02 +03:00
Sergey Igushkin
eb71dee9cc Add prototype against the new AGP API
* Add a separate Gradle source set, that is compiled against the new
  versions of AGP and Gradle

* Separate the public AGP API usages from the old internal API usages
  in KotlinPlugin.kt -- see AbstractAndroidProjectHandler

* Implement Android25ProjectHandler with the new AGP API, wired it
  to KotlinAndroidPlugin through reflection

(cherry picked from commit e6dbf54)

(cherry picked from commit 88e3d4b)
2017-05-31 16:59:02 +03:00
Dmitry Petrov
a5620454fa Minor: use IntrinsicMethods.INTRINSICS_CLASS_NAME where appropriate 2017-05-31 16:48:14 +03:00
Dmitry Petrov
a6f8aad49b Minor: fix typo in exception message 2017-05-31 16:48:14 +03:00
Dmitry Petrov
08885e273b Support additional intrinsics in null check elimination
1. checkExpressionValueIsNotNull implies checked value is non-null

2. throwNpe never returns

 #KT-18162 Fixed Target versions 1.1.4
 #KT-18164 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Dmitry Petrov
d559212d70 Optimize out trivial INSTANCEOF checks
#KT-18157 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Mikhail Glukhikh
74ee9ce68b Fix "remove explicit type arguments" in J2K
Do not delete type arguments if intention is not applicable just befor
2017-05-31 12:47:56 +03:00
Mikhail Glukhikh
9c15db93d9 Inline: more accurate handling of type arguments
Partial revert of b8cc7c2ca6
Soften requirements in remove type arguments intention in this mode
So #KT-17622 Fixed
Related to KT-17623
2017-05-31 12:47:50 +03:00
Mikhail Glukhikh
38d6c597a3 Handle expected type more precisely in RemoveExplicitTypeArguments
So #KT-17623 Fixed
2017-05-31 12:46:59 +03:00
Mikhail Glukhikh
c67f8c07d2 Minor cleanup 2017-05-31 12:46:47 +03:00
Alexey Andreev
e6b0cc64bd Fix copying of non-abstract functions of interfaces in JS BE
Fix copying of non-abstract functions of interfaces to implementing
classes when implementing class inherits interface via 2+ paths.

See KT-18187
2017-05-31 11:21:13 +03:00
Dmitry Petrov
c558e2657b Update testData for light classes after generic signature fixes 2017-05-31 10:18:48 +03:00
Dmitry Petrov
17d2472511 Do not patch generic signature for methods with special bridges
Somewhat awkward solution for KT-18189.
2017-05-31 10:18:48 +03:00
Dmitry Petrov
fd00a6fbe8 Generate generic signatures for special bridges
#KT-12408 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Dmitry Petrov
48a60e6f39 Dump generic signatures in bytecode listing tests if required
Add '// WITH_SIGNATURES' to test file if generic signatures should be
dumped.
2017-05-31 10:18:48 +03:00
Dmitry Petrov
78de1fb72c Handle incorrect code for interface delegation
#KT-15931 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Yan Zhulanow
4f132f6d40 Kapt: Fix output file reporting in IC
Fix REPORT_OUTPUT_FILES option passing to GenerationState created in kapt.

This fixes these tests:
Kapt3Incremental.testChangeAnnotatedPropertyType()
Kapt3Incremental.testRemoveAnnotations()
Kapt3Incremental.testRemoveSourceFile()
2017-05-30 22:09:20 +03:00
Alexander Udalov
1572d2cf2b Improve modular JDK root module detection
According to the spec, "java.se" and every other non-"java.*" module
that exports at least one package without qualification, is a root.
Currently we only support compilation of a single unnamed module, and
apparently unnamed module should read all root modules.

 #KT-18180 Fixed
2017-05-30 17:35:25 +03:00
Alexander Udalov
5042bbe4a1 Minor refactoring in ContentRoots, JvmContentRoots and usages 2017-05-30 17:35:23 +03:00
Alexander Udalov
227c2d2c23 Minor, display multiline argument help prettier 2017-05-30 17:33:11 +03:00
Mikhail Glukhikh
00fa7c8166 Minor cleanup: MoveReceiverAnnotationFix 2017-05-30 15:58:22 +03:00
Kirill Rakhman
08bd212d82 Add quickfix for @receiver applied to extension member instead of type
So #KT-14648 Fixed
2017-05-30 15:47:21 +03:00
Dmitry Neverov
b206f6288d Convert to primary constructor preserves accessors #KT-17996 Fixed 2017-05-30 15:35:54 +03:00
Alexey Andreev
4346fb5c23 Minor refactoring of JS AST nodes representing boolean literals 2017-05-30 12:49:00 +03:00
Alexey Andreev
5715803b96 Fix incremental recompilation of JS source maps
Note that this breaks binary compatibility.
It should be OK, since nobody is using incremental compilation API
for now.
2017-05-30 12:48:59 +03:00
Alexey Andreev
ed592452a3 Fix JS source maps for functions with expression body 2017-05-30 12:48:59 +03:00
Alexey Andreev
1014666937 Fix JS source maps for delegates and backing fields 2017-05-30 12:48:58 +03:00
Alexey Andreev
13795b47fb Fix JS source maps for initialization of variables captured by class 2017-05-30 12:48:58 +03:00
Alexey Andreev
bfc3a9c2af Fix JS source maps for && expression with complex operands 2017-05-30 12:48:57 +03:00
Alexey Andreev
1111f2d5cd Fix JS source maps for while/do..while statements 2017-05-30 12:48:57 +03:00
Alexey Andreev
413ac40c25 Fix JS source maps for for statements 2017-05-30 12:48:56 +03:00
Alexey Andreev
d7a10750e0 Fix JS source maps for lambdas 2017-05-30 12:48:55 +03:00
Alexey Andreev
82d37c0d57 Fix JS source maps for catch blocks 2017-05-30 12:48:55 +03:00
Alexey Andreev
6ad991adfb Fix JS source maps for "is" and "in" clauses in when expression 2017-05-30 12:48:54 +03:00
Alexey Andreev
9692c02f6e Fix JS source maps for string literals 2017-05-30 12:48:53 +03:00
Alexey Andreev
8dae399945 Fix generation of JS source maps for default parameters
(Of open member functions)
2017-05-30 12:48:52 +03:00
Alexey Andreev
e1009622af Fix generation of JS source maps for call expressions 2017-05-30 12:48:52 +03:00
Alexey Andreev
6e489900cb Fix generation of JS source maps for long literals 2017-05-30 12:48:51 +03:00
Alexey Andreev
89e3fb7592 Keep JS AST source information after refreshing local names 2017-05-30 12:48:51 +03:00
Alexey Andreev
ad89e5906f Fix JS source maps for increment expression used as statement 2017-05-30 12:48:50 +03:00
Alexey Andreev
bad79dfa85 Fix JS source maps for return statement of inlined function 2017-05-30 12:48:49 +03:00
Alexey Andreev
5a4d3c5391 Generate JS source maps for object instance function 2017-05-30 12:48:49 +03:00
Alexey Andreev
77df0f28bf Fix generation of JS source maps for class properties 2017-05-30 12:48:48 +03:00
Alexey Andreev
6f8ccfb80d Add test for JS source maps for literals 2017-05-30 12:48:47 +03:00
Alexey Andreev
e9a2c8c0f1 Prevent JS AST nodes of several types to be shared 2017-05-30 12:48:47 +03:00
Alexey Andreev
3077a0f640 Fix generation of JS source maps for suspend functions 2017-05-30 12:12:49 +03:00
Alexey Andreev
28140b0883 Fix generation of JS source maps for closures 2017-05-30 12:12:34 +03:00
Alexey Andreev
3a7df13440 Fix generation of source maps for synthetic code in enums in JS BE 2017-05-30 12:12:33 +03:00
Alexey Andreev
fb3a864892 Fix generation of JS source maps for synthetic code in constructors 2017-05-30 12:12:32 +03:00
Alexey Andreev
4332f1cb2c Don't share instances of JsNameRef nodes to avoid wrong source maps
When to name references to the same name are represented by
a shared JS AST node, setting line number of the second usage may
override line number of the first usage.

Also, supply more JS AST nodes related to default parameters,
with corresponding source information.
2017-05-30 12:12:30 +03:00
Alexey Andreev
e5662ac2ad Copy location info when copying JS AST subtrees
This is necessary to preserve source information of a function's body
after inlining.
2017-05-30 12:12:28 +03:00
Alexey Andreev
9218b61141 Add tests for source maps in JS BE 2017-05-30 12:12:27 +03:00
Simon Ogorodnik
f8914013ef Fix infinity deferred element unfolding in J2K
#KT-13146 fixed
2017-05-29 20:26:45 +03:00
Alexey Andreev
4bb1130f3f Fix translation of labels with non-identifier names in JS BE
See KT-18027
2017-05-29 15:37:31 +03:00
Alexey Andreev
9375a1d984 Prohibit illegal identifiers in packages in JS BE
See KT-18032
2017-05-29 15:37:30 +03:00
Alexey Andreev
a0ddbf0e9b Fix handling non-ES5 identifiers in JS
When a Kotlin identifiers contains non-ES5 chars, JS BE
either reports error (for published declarations) or mangles name
(for non-published ones). The old approach relied on wrong
assuption that Java identifier = ES identifier.
However, that's not true. This commit introduces functions that
check identifiers according to ES5.1 spec rather than
using Character.isIdentifierStart[Part]

See KT-17476
2017-05-29 15:37:29 +03:00
Alexey Andreev
24c0a1e7ce Fix translation of delegated functions with default params in JS BE
See KT-17285
2017-05-29 15:30:28 +03:00
Alexey Andreev
383e273fed In LightAnalysisModeTestGenerated skip tests ignored in JVM
When a test is marked as ignored in JVM BE (i.e. IGNORE_BACKEND: JVM)
it's ignored in LightAnalysisModeTestGenerated. This means that
this tests is expected to fail. However, often tests that fail
in JVM blackbox tests, don't fail in LAMTG, therefore it's reasonable
to skip these tests in LAMTG at all.
2017-05-29 15:30:27 +03:00
Denis Zharkov
2c98bd053a Fix super calls to suspend functions in abstract classes 2017-05-29 10:58:18 +03:00
Alexander Udalov
26ef954507 Merge pull request #1102 from igorini/master
Fix inline code block in notation.grm
2017-05-29 10:55:38 +03:00
igorini
00a5ff2364 Fix inline block in notation.grm 2017-05-28 17:12:52 +01:00
Alexander Udalov
da0ecc6cf7 Refactor CompileKotlinAgainstCustomBinariesTest
Combine compileLibrary and compileJava into a universal compileLibrary
which compiles both .java and .kt files, either to a directory or to a
.jar file. Also introduce compileJsLibrary for JS only
2017-05-26 19:38:54 +03:00
Alexander Udalov
dae414854d Reduce boilerplate in CompileKotlinAgainstCustomBinariesTest
Check against output.txt in compileKotlin; adapt test data of some tests
2017-05-26 19:38:53 +03:00
Alexander Udalov
0899eb9924 J2K CompileKotlinAgainstCustomBinariesTest: prettify 2017-05-26 19:38:52 +03:00
Alexander Udalov
2ef48bfbca J2K CompileKotlinAgainstCustomBinariesTest: convert 2017-05-26 19:38:51 +03:00
Alexander Udalov
0e4ea10d8a J2K CompileKotlinAgainstCustomBinariesTest: move .java -> .kt 2017-05-26 19:38:50 +03:00
Alexander Udalov
a583a2f171 Move JavaModuleInfo and JavaModuleGraph to frontend.java 2017-05-26 19:38:49 +03:00
Alexey Andreev
dde50a34db Fix comparison of boolean values in JS BE
See KT-16984
2017-05-26 18:26:08 +03:00
Alexey Andreev
f5510b8d66 Fix translation to JS of call to top-level fun with vararg and @JsModule
See KT-17871
2017-05-26 18:24:15 +03:00
Alexey Andreev
e2fc808d83 Add simple test infrastructure for JS DCE
Add test infrastructure that allows to test handwritten JS
to test various small aspects of DCE, as opposed to box tests
which test kotlin stdlib + kotlin generated examples
2017-05-26 18:20:30 +03:00
Alexey Andreev
522a56947c Add -keep command line option to JS DCE tool 2017-05-26 18:20:23 +03:00
Alexey Andreev
9181140387 Suppress some DCE tests that can't pass 2017-05-26 18:20:21 +03:00
Alexey Andreev
e2c2fcf1ff Generate EXPECTED_REACHABLE_NODES directive on JS box tests 2017-05-26 18:20:20 +03:00
Alexey Andreev
ab9b639652 Improve test infrastructure for JS DCE tool
Introduce directives to assert minification rate (MINIFIER_THRESHOLD)
and to skip DCE test at all (SKIP_MINIFIER).
Allow to run DCE on some of the box tests by default.
2017-05-26 18:20:19 +03:00
Alexey Andreev
8a8fdf1968 Command-line tool for JS DCE 2017-05-26 18:20:17 +03:00
Alexey Andreev
ca7062d776 Fix JS parser to properly handle "." <keyword> sequence 2017-05-26 18:20:16 +03:00
Alexey Andreev
9e89213d66 Prototyping DCE tool for JS 2017-05-26 18:20:15 +03:00
Simon Ogorodnik
d617b1d869 Fix IfThenToSafeAccessIntention broken by refactoring
Broken in 66c5717adc
2017-05-26 17:32:47 +03:00
Valentin Kipyatkov
87e3725306 Do not report property as unused when it is used
#KT-17062 Fixed
2017-05-26 16:37:38 +03:00
Valentin Kipyatkov
986eaeb7ea Refactoring 2017-05-26 16:37:37 +03:00
Valentin Kipyatkov
d53aa28ddf Fixed expected type for setter 2017-05-26 16:37:37 +03:00
Valentin Kipyatkov
db0309c39d Reorder 2017-05-26 16:37:37 +03:00
Valentin Kipyatkov
545384910c Special order of usage processing is not needed anymore 2017-05-26 16:37:37 +03:00
Valentin Kipyatkov
c69375ebdc Remove redundant curly braces in string templates on inline 2017-05-26 16:37:37 +03:00
Valentin Kipyatkov
ab1b985bac Inline Property supported for properties with setter
#KT-2638 Fixed
2017-05-26 16:37:36 +03:00
Valentin Kipyatkov
e6bfa55534 Inline Property also supported for properties with getter 2017-05-26 16:37:36 +03:00
Valentin Kipyatkov
20686297e5 Refactored to not use too many local functions 2017-05-26 16:37:36 +03:00
Valentin Kipyatkov
940ce27925 Inline val: more correct and simple detection of write usages
#KT-17489 Fixed
2017-05-26 16:37:35 +03:00
Valentin Kipyatkov
55979aca74 Drop result value if it's not needed 2017-05-26 16:37:35 +03:00
Mikhail Glukhikh
adbece82ef Clear DF info for variables assigned in 'try' #KT-17929 Fixed 2017-05-26 15:39:27 +03:00
Mikhail Glukhikh
0fd70df681 Add tests for KT-17929 2017-05-26 15:39:25 +03:00
Mikhail Glukhikh
d9e4b445b9 Add extra information for EA-76201 2017-05-26 15:39:24 +03:00
Alexey Tsvetkov
3de679fb23 Minor: add comment for CompilerMessageSeverity.OUTPUT 2017-05-26 15:16:41 +03:00
Alexey Tsvetkov
afa1e901a7 Ensure output directory exists when adding it to classpath
Otherwise a warning is reported:
"Сlasspath entry points to a non-existent location".
Currently it only affects Maven + IC.
2017-05-26 15:16:41 +03:00
Alexey Tsvetkov
fd9e42a233 Do not print OUTPUT message as warning in Maven
Before the change Maven + IC had been reporting OUTPUT
messages as warnings since OUTPUT was removed
from CompilerMessageSeverity.VERBOSE
2017-05-26 15:16:41 +03:00
Zalim Bashorov
13aeb171bd Provide more info for EA-89216 2017-05-26 15:06:32 +03:00
Dmitry Neverov
753b714544 Report cases when class member can be private 2017-05-26 13:29:01 +02:00
Dmitry Petrov
c83b764c73 Update testData after changes in diagnostics 2017-05-26 13:58:46 +03:00
Dmitry Petrov
2c83718452 Prohibit having duplicate parameter names in functional types
#KT-15804 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
9908212c99 Report VIRTUAL_MEMBER_HIDDEN on declaration name
#KT-13749 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
96f7a2d38a Fix message for EXTERNAL_DECLARATION_CANNOT_BE_INLINED
#KT-10164 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
a86fe89aae Include file name for package-level members in diagnostics 2017-05-26 13:58:46 +03:00
Dmitry Petrov
7979663e6c Update testData for changed diagnostic messages 2017-05-26 13:58:46 +03:00
Dmitry Petrov
17eab2865d Include containing declaration name in message for JVM signature clashes
#KT-9359 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
d850f01c39 Fix diagnostic for uninitialized extension property without accessors
#KT-8612 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
902d3af280 Prohibit extending kotlin.Enum directly
#KT-7773 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
b9e45bcd54 Fix diagnostic message for INACCESSIBLE_OUTER_CLASS_EXPRESSION
Diagnostic messages should describe a problem,
and should not suggest taking actions.
That's a prerogative of quick fixes in IDE.

 #KT-5511 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov
7518119bff Fix diagnostic message for abstract member not implemented
Diagnostic messages should describe a problem,
and should not suggest taking actions.
That's a prerogative of quick fixes in IDE.

 #KT-5066 Fixed
2017-05-26 13:58:46 +03:00
Mikhael Bogdanov
3f7bf8467a Process non-aload0 outer access in constructor during inline
#KT-17972 Fixed
2017-05-26 09:24:10 +02:00
Ilya Zorin
5e265b3d17 Convert intention "a..b-1 -> a until b" into weak warning inspection
So #KT-17895 Fixed
2017-05-26 09:48:04 +03:00
Dmitry Neverov
0fd42bc747 Don't suggest cast when !! is possible #KT-18033 Fixed 2017-05-26 09:47:57 +03:00
Mikhail Glukhikh
af3a123c15 Report WRONG_MODIFIER_CONTAINING_DECLARATION for vararg in setter 2017-05-26 09:47:51 +03:00
Dmitry Petrov
30182c38ce Fix toString and hashCode for array members of data classes
Generate them as special intrinsics that would be mapped to proper
platform-specific calls by BEs.

 #KT-16945 Fixed
2017-05-26 09:32:29 +03:00
Dmitry Petrov
1420926a9b Generate receivers for callable references in the same way as for calls
Properly handle callable members imported from objects
and other related corner cases.

 #KT-18084 Fixed
2017-05-26 09:32:29 +03:00
Yan Zhulanow
7220183912 Kapt: Write @kotlin.Metadata annotation to Java stubs #KT-17937 2017-05-25 21:28:47 +03:00
Yan Zhulanow
141f12e71b Minor: Commit forgotten kapt test data 2017-05-25 21:28:40 +03:00
Mikhail Zarechenskiy
4e38ff3b72 Exclude several tests about inner generic signature on Android
There is no information about inner generic class in the middle of signature
 on android.

 For example, on JVM we can get signature:
  `FirstInner$SecondInner<A>.ThirdInnner;`

 But on Android it would be
  `FirstInner$SecondInner$ThirdInnner;`
2017-05-25 16:46:07 +03:00
Mikhail Zarechenskiy
d0e26c6527 Support underscores in non local destructuring declarations 2017-05-25 16:46:06 +03:00
Mikhail Zarechenskiy
47f2386212 Generate non-local destructuring declarations as properties
#KT-5620 Fixed
 #KT-15810 Fixed
2017-05-25 16:46:05 +03:00
Mikhail Zarechenskiy
400ecd5e13 Support destructuring declarations in scripts and REPL
#KT-5620 In Progress
 #KT-15810 In Progress
2017-05-25 16:46:04 +03:00
Alexey Andreev
0e31c14a86 Implement inlining of default parameters in JS BE
Fix KT-17910
2017-05-25 14:38:53 +03:00
Valentin Kipyatkov
40bbf82a41 Hint action to update usages on cut/paste of top-level declarations 2017-05-24 16:49:37 +03:00
nd
cb5459b7d7 Don't suggest adding replaceWith in DeprecationLevel.HIDDEN (#1094)
#KT-17917 Fixed
2017-05-24 15:06:51 +02:00
nd
8d6d228bb8 Move property to constructor preserves vararg keyword (#1095)
#KT-18035 Fixed
2017-05-24 14:58:30 +02:00
Alexander Udalov
965b4199f4 Fix compilation against JRE 9 on JPS
Write the modular JDK (9+) path to the module.xml file passed to the
compiler from the JPS plugin. This path is then recorded in the compiler
configuration in KotlinToJVMBytecodeCompiler.configureSourceRoots. This
is needed because in JPS plugin, we pass "-no-jdk" and thus no JDK home
path was recorded in the compiler configuration in
K2JVMCompiler.setupJdkClasspathRoots. Presence of JDK home path in the
configuration is crucial for JDK 9 support (see
KotlinCoreEnvironment.Companion.createApplicationEnvironment), because
classes there can only be loaded with the special "jrt" file system, not
as .class files in .jar files

 #KT-17801 Fixed
2017-05-24 15:46:57 +03:00
Alexander Udalov
f8dabc79c3 Use environment variable JDK_19 instead of JDK_9
JDK_19 is set on TeamCity agents, not JDK_9.

Also do not invoke getJreHome() because Java 9 distribution does not
have a "jre" subdirectory
2017-05-24 15:46:57 +03:00
shiraji
c8e58ce9ab Fix WrapWithSafeLetCallFix ignore extension method
Related to KT-17726
2017-05-24 14:02:01 +03:00
Mikhail Glukhikh
bd73916d99 Minor cleanup 2017-05-24 14:01:59 +03:00
Dmitry Neverov
46aaee5d05 Fix nullability quick-fixes with implicit receiver #KT-17726 Fixed 2017-05-24 14:01:58 +03:00
Ilya Chernikov
9d2ae54d2c Introduce other JVM options inheritance for daemon 2017-05-24 10:52:38 +02:00
Ilya Chernikov
6190b1ec2e Fix daemon selection on the memory settings 2017-05-24 10:52:37 +02:00
Ilya Chernikov
f8ef48f03e minor: log daemon client registration 2017-05-24 10:52:37 +02:00
Ilya Chernikov
f00149ad05 Reuse daemon launching logic for out-of-process compilation in gradle 2017-05-24 10:52:36 +02:00
Ilya Chernikov
61570fc4b8 Improve daemon client diagnostic and run failure detection
Removing prefiltering of the daemon client reporting - filtering should
be performed on the receiver site. And put daemon process output during
executioninto INFO category. May make daemon usage more talkative,
but will not eat important error messages anymore.
Add test with failure condition.
Also failed daemon start should not cause timeout anymore.
2017-05-24 10:52:35 +02:00
Ilya Chernikov
bec2ae7cab Refactor daemon tests, some minor fixes in the client and daemon
Tests refactored for better readability and code reuse
Some shutdown livelock is fixed
Some logging added
2017-05-24 10:52:35 +02:00
Dmitry Petrov
7600b6de52 Allow top-level type aliases in scripts 2017-05-24 11:20:22 +03:00
Dmitry Petrov
425c66b0cd Separate stub generation for external dependencies from PSI2IR 2017-05-24 11:18:52 +03:00
Dmitry Petrov
952f53d37c Use DeclarationStubGenerator for built-ins initialization 2017-05-24 11:18:52 +03:00
Dmitry Petrov
ec9427a36b Minor: make DeepCopySymbolsRemapper open 2017-05-24 11:18:52 +03:00
Dmitry Petrov
e7eb078c3f Minor: remove always true is-check 2017-05-24 11:18:52 +03:00
Dmitry Petrov
6fd762cfce Provide DeclarationStubGenerator as a separate class in IR utilities 2017-05-24 11:18:52 +03:00
Dmitry Petrov
7204a929f3 Move SymbolTable to common IR utilities 2017-05-24 11:18:52 +03:00
Dmitry Jemerov
4f08d2b16a Remove incorrect argument count check from TODO searcher 2017-05-23 18:36:17 +02:00
Denis Zharkov
970dfd10d4 Update rendered public API for coroutines
suspendCoroutine is not public anymore as it's inline
and all inline suspend functions are treated as inline-only,
i.e. private in JVM
2017-05-23 18:45:33 +03:00
Nikolay Krasko
d717da5413 Add language to formatting blocks to fetch indent settings propertly 2017-05-23 18:28:13 +03:00
Nikolay Krasko
8f964978da Minor: activate copy actual to expected file 2017-05-23 18:28:06 +03:00
Nikolay Krasko
287443cab9 Add not-null annotation to avoid warnings on getProjectDescriptor() 2017-05-23 18:26:21 +03:00
Yan Zhulanow
87f3b574aa Kapt: Filter the content root items for the compile classpath properly 2017-05-23 16:45:40 +03:00
Yan Zhulanow
5ec16167bc Kapt: Preserve parameter names for abstract methods 2017-05-23 16:45:29 +03:00
Yan Zhulanow
18e17a4400 Android Extensions: Remove obsolete migration warning in Gradle plugin 2017-05-23 16:45:24 +03:00
Yan Zhulanow
1a342faf38 Kapt3: Ignore packages with Java keywords inside (KT-17184) 2017-05-23 16:45:19 +03:00
Yan Zhulanow
1c5765628e Kapt3: Fix flaky integration tests on Windows agents 2017-05-23 16:45:14 +03:00
Dmitry Jemerov
57f4672b43 Fix ExtractionTestGenerated 2017-05-23 14:37:58 +02:00
Pavel V. Talanov
f701f8f590 Cache GSScope by dependencies in ScriptDependencyModuleInfo
Removing state in previous commit led to 'toVfsRoots' being called to often
2017-05-22 19:12:09 +03:00
Pavel V. Talanov
4f3b68f8e9 Avoid caching state in ScriptModuleInfos
This led to caching stale dependencies

 #KT-17770 Fixed
2017-05-22 18:37:00 +03:00
qx
152c8b521e Missed file 2017-05-22 18:34:27 +03:00
qx
bc14ce740a KT-15309 Don't apply "Fix with 'asDynamic'" to member extension funcitons 2017-05-22 18:34:27 +03:00
Alexander Udalov
7f73e9f4f7 Improve hack in BuiltInsSerializerExtension for ranges
Serialize class names as qualified names in the string table, not as
simple strings. Otherwise NameResolverImpl crashes on deserialization
because it expects that all class names are indices into QualifiedName
table
2017-05-22 18:17:48 +03:00
Alexander Udalov
6d47991172 Minor, use other package in test data file
To avoid rendering contents of package org.intellij.lang.annotations
into the corresponding .txt file
2017-05-22 18:15:32 +03:00
Alexander Udalov
f8e82f148a Drop TypeLazinessToken and LazyResolveToken 2017-05-22 18:15:19 +03:00
Pavel V. Talanov
8fc953f529 Modules with different language levels can't be analyzed together
"Supports additional builtIn members" setting
    is basically adding members to some types
If we analyze them toghether other modules would leak types
    that have those members (or don't) into other modules scopes
    leading to code that has erroneous highlighting

See KT-17357

#KT-17357 Fixed
2017-05-22 17:42:21 +03:00
Denis Zharkov
eedc35aefd Drop new coroutine-related API introduced in 1.1.4
See 49453ca705 for clarification

 #KT-17898 Fixed
2017-05-22 14:51:04 +03:00
Denis Zharkov
e2e93d633c Get rid of using label field in named function
It preventing from making it protected (as it was before)

 #KT-17898 In progress
2017-05-22 14:51:04 +03:00
Denis Zharkov
52b2e632df Simplify generated code for rangeTo/concat intrinsics
The main reason is avoiding complicated operations like
dup + dup_x2 + pop2 for instances obtained by NEW instruction.

Otherwise it leads to problems in performRefinedTypeAnalysis
because code there has a sensible assumption that NEW instances
can be only dupped or stored into a local (rare cases)

 #KT-17457 Fixed
2017-05-22 14:51:04 +03:00
Anton Bannykh
419f12f1b7 JS: fix char to string convertion in string templates (#KT-17966 fixed) 2017-05-22 13:57:36 +03:00
Simon Ogorodnik
6a8bb8b33d Fix CCE in constructNestedClassReferenceIdentifier J2K
#KT-17712 fixed
2017-05-22 13:55:26 +03:00
fitermay
d0991fffd2 Fix keyword completion in 'if' blocks
#KT-17914 fixed
2017-05-22 13:54:25 +03:00
Alexey Sedunov
75b73ecbcb Copy: Disable CopyKotlinDeclarationsHandler on non-source files 2017-05-22 13:51:08 +03:00
Alexey Sedunov
151b512a6c Kotlin Facet: Do not rewrite v2 configuration to latest version
This causes unwanted changes in configuration files
after plugin update
2017-05-22 13:51:07 +03:00
Alexey Sedunov
6049bb8238 Configuration: Use project-level JVM target when facet is absent
#KT-17722 Fixed
2017-05-22 13:51:06 +03:00
Dmitry Petrov
45820f0220 Minor: more cleanup after converting to Kotlin 2017-05-22 11:57:20 +03:00
Dmitry Petrov
39aa97eebf Use Intrinsics#compare when specializing compareTo for ints 2017-05-22 11:57:20 +03:00
Dmitry Petrov
a1ae40a617 RedundantBoxingMethodTransformer: convert to Kotlin & cleanup 2017-05-22 11:57:20 +03:00
Dmitry Petrov
f1bb9a9839 RedundantBoxingMethodTransformer: .java -> .kt 2017-05-22 11:57:20 +03:00
Dmitry Petrov
89bfa64e90 Minor: simplify code in RedundantGotoMethodTransformer 2017-05-22 11:57:20 +03:00
Dmitry Petrov
e1b41eee15 Specialize Comparable#compareTo for boxed primitives
Support Comparable#compareTo for boxed primitive in redundant
boxing/unboxing analysis, along with CHECKCAST to java.lang.Comparable.

Note that we can do that for Float and Double, too, because
Float#compareTo(Float) and Double#compareTo(Double) are delegated to
Float#compare(float, float) and Double#compare(double, double),
respectively.

Fuse specialized comparison for integers with conditional jumps
if possible (both for Comparable#compareTo and Intrinsics#areEqual).

 #KT-11959 Fixed
2017-05-22 11:57:20 +03:00
Dmitry Petrov
bd5b984da9 Return type of local delegated property setter should be Unit
#KT-17950 Fixed
2017-05-22 11:47:09 +03:00
Mikhael Bogdanov
ba06ad3e53 Minor. Fix test directive 2017-05-22 08:31:03 +02:00
Valentin Kipyatkov
1fe6886a33 Fixed error message to quote parameter name 2017-05-20 23:44:20 +03:00
Kirill Rakhman
4cbdbaa057 refactor ConvertFunctionToPropertyIntention and fix 'Convert function to property shouldn't insert explicit type if it was inferred previously' (#1011)
Fixes #KT-14820
2017-05-19 21:32:11 +03:00
Dmitry Jemerov
927cd04405 Add module documentation for kotlin.test 2017-05-19 19:46:51 +02:00
Mikhail Glukhikh
17869abfaf Don't suggest making interface member final
(which was possible in leaking this inspection)
So #KT-14443 Fixed
2017-05-19 20:36:31 +03:00
Mikhail Glukhikh
a73cf0e1fe Don't suggest make object container open #KT-11003 Fixed 2017-05-19 20:36:24 +03:00
Dmitry Neverov
3b4dafe691 Detect recursive property accessors #KT-17221 Fixed 2017-05-19 20:36:09 +03:00
ReadmeCritic
20f5023c48 Update README URLs based on HTTP redirects (#1086) 2017-05-19 20:25:05 +03:00
Dmitry Jemerov
ded5bfb841 Show calls of TODO() function in TODO view
#KT-8617 Fixed
2017-05-19 18:23:45 +02:00
Dmitry Jemerov
c8b0bd44eb Mark document as out-of-date 2017-05-19 14:32:58 +02:00
Dmitry Petrov
2cda5aaeb5 Additional customization for DeepCopyIrTreeWithSymbols
1. Allow overriding 'getNonTransformedLoop'
2. Allow descriptor remapping on deep copy
2017-05-19 14:49:34 +03:00
Dmitry Petrov
b9dee7fcf3 Extract SymbolRemapper interface for DeepCopy customization 2017-05-19 14:49:34 +03:00
Dmitry Petrov
5f57368b4f Minor: IR verifier should always check receiver descriptors 2017-05-19 14:49:34 +03:00
Dmitry Petrov
1dbd6453e0 Add more stub generator tests for external dependencies 2017-05-19 14:49:34 +03:00
Simon Ogorodnik
dba9011563 Check for batch PSI children update when invalidating package cache
#KT-17868 fixed
2017-05-19 13:07:30 +03:00
Valentin Kipyatkov
92a763552c KT-17970 Intention actions to format parameter/argument list placing each on separate line
#KT-17970 Fixed
2017-05-19 12:20:51 +03:00
Mikhael Bogdanov
47fec6c9d5 Wrap captured local delegated property into Delegate
#KT-16864 Fixed
2017-05-19 09:53:19 +02:00
Ilya Gorbunov
fec8f4a48b preparePublication task requires project version to be set 2017-05-19 05:37:58 +03:00
Dmitry Jemerov
f6574a475b Show location for local classes in Goto Class
#KT-7954 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
232af8a4fc Cleanup code style option names
#KT-14639 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
4dd3f30f2d Build stubs for local functions; show them in Goto Symbol
#KT-14161 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
f72dd75127 Use provided file content in KotlinJsMetadataVersionIndex
#KT-17821 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
af043843b7 Don't show disambiguation for "Show expression type" on "this"
#KT-17840 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
2cbb8d03c0 Find Usages on "override val" in constructor asks about base usages
Also fix long-standing bug with "title" parameter being ignored when
displaying messages

 #KT-17845 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov
8f38d03b48 Indicate vararg parameters in Goto Symbol presentation
#KT-17899 Fixed
2017-05-18 21:02:24 +02:00
Nikolay Krasko
14c343de35 Enable auto-indent in multiline strings when caret is before interpolation
#KT-17849 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko
251a0270a4 Make auto-indent work for multiline string with injection (KT-17942)
#KT-17942 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko
e5822c76fb Allow injection in strings with interpolation (KT-6610)
#KT-6610 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko
12002aed57 Do injection with comments through our injector (KT-6610)
Hide Kotlin from CommentLanguageInjector as it only can insert simple
injection. Process injection by commented strings on our own.

 #KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko
0191c8c6c1 Force kotlin injector before temporary injector (KT-6610)
Place KotlinLanguageInject before TemporaryPlacesInjector

TemporaryPlacesInjector injects languages as a single place while we
need to distinguish interpolated and non-interpolated strings. Bad
ordering leads to inconsistent behaviour in temporary injection and
injection with annotations and comments.

See InjectedLanguageManagerImpl.getInjectorMap()

 #KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko
2f1a40a40d Use multi host injector for Kotlin injection (KT-6610)
#KT-6610 In Progress
2017-05-18 20:00:18 +03:00
Nikolay Krasko
0551659281 Don't indent to unrelated closing quote (KT-17894)
#KT-17894 Fixed
2017-05-18 20:00:18 +03:00
Nikolay Krasko
e211980df4 Minor: Remove commented tests 2017-05-18 20:00:17 +03:00
Nikolay Krasko
0cd3e4f3a4 Minor: JetFile -> KtFile 2017-05-18 20:00:17 +03:00
Alexander Udalov
d1c9d0328a Report error if <withKotlin> is run in fork mode
Otherwise the error message is confusing, see #KT-9292
2017-05-18 19:25:21 +03:00
Alexander Udalov
671aed252d Support single Java source files in kotlinc arguments
E.g. "kotlinc foo.kt test/Bar.java" will compile foo.kt, and
declarations from Bar.java will be accessible to Kotlin code in foo.kt.

The change in AbstractTopLevelMembersInvocationTest is needed because an
incorrect configuration was created in that test where a library jar was
also a Java source root (the compiler is never configured this way in
production), which led to an exception in
JavaCoreProjectEnvironment#addSourcesToClasspath

 #KT-17697 Fixed
2017-05-18 19:22:17 +03:00
Mikhael Bogdanov
511c9f86b1 Add new test on receiver clash during default lambda inlining 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov
ec23df1d29 Extract callable reference tests to separate directory 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov
f4a388cf71 Add new tests for default lambda inlining 2017-05-18 18:18:14 +02:00
Mikhael Bogdanov
42074f143d Report diagnostic on inline parameter usage inside defaul value for another inline parameter 2017-05-18 18:18:13 +02:00
Mikhael Bogdanov
0d1ede40c1 Convert InlineChecker to Kotlin 2017-05-18 18:18:12 +02:00
Mikhael Bogdanov
4a28287c68 Rename InlineChecker.java to InlineChecker.kt 2017-05-18 18:18:11 +02:00
Sergey Igushkin
6a31f8c139 Update ReadMe.md 2017-05-18 17:53:23 +03:00
Alexey Sedunov
23c0e6fcb5 Kotlin Facet: Filter out API versions exceeding library version
Also drop version validator as it's not needed anymore
 #KT-17847 Fixed
2017-05-18 14:22:43 +03:00
Alexey Sedunov
d288c684c8 Kotlin Facet: Configure facet if kotlin-android plugin is present
#KT-17861 Fixed
2017-05-18 14:22:42 +03:00
Alexey Sedunov
8f6f69db65 Kotlin Facet: Suppress bogus warning about language/api version
#KT-17848 Fixed
2017-05-18 14:22:41 +03:00
Alexey Sedunov
0994474e87 Presentation: Fix NPE on functional type rendering
#KT-17638 Fixed
2017-05-18 14:22:40 +03:00
Alexey Sedunov
a80fb6f20f Copy: Report module accessibility conflicts 2017-05-18 14:22:39 +03:00
Alexander Udalov
bfb3b38ebc Do not try to load Java classes from incorrect packages
#KT-11474 Fixed
2017-05-18 13:30:06 +03:00
Alexander Udalov
52237ce77f Fix KClass.java intrinsic for stack values of type Unit
#KT-17692 Fixed
2017-05-18 13:29:04 +03:00
Alexander Udalov
9b85fed3c4 Fix typo in kotlinc-js help
File separator is '/', path separator is ':' or ';'
2017-05-18 13:29:03 +03:00
Alexander Udalov
18a211cb84 Add regression test for obsolete issue
#KT-17365
2017-05-18 13:29:02 +03:00
Denis Zharkov
49453ca705 Avoid dependency on coroutine-related public API changes
These changes has been introduced in c3a032ea0b
to support new scheme for named functions

At the same time they can be avoided by generating some additional
code/accessors in the anonymous classes for coroutine state

Now we cannot simply remove introduced API because of bootstrap problems

 #KT-17898 Fixed
2017-05-18 12:42:12 +03:00
Denis Zharkov
06b598e595 Minor. Rename CoroutineCodegenForLambda.kt -> CoroutineCodegen.kt 2017-05-18 12:42:12 +03:00
Dmitry Petrov
c1ef0bfcdb Report deprecation on usage of type alias expanded to a deprecated class
#KT-15243 Fixed
2017-05-18 10:56:02 +03:00
Dmitry Petrov
a2db4dc0d5 Fix incremental compilation problems related to type alias constructors
1. Determine source element for descriptors with NO_SOURCE recursively.

2. Always provide type abbreviation for type alias constructor
return type.

 #KT-15495 Fixed
2017-05-18 10:55:16 +03:00
Ilya Gorbunov
2500a182e5 Refactor: use sam-like constructor for comparators 2017-05-17 19:34:44 +03:00
Ilya Gorbunov
ddf6599b38 Do not use spread-operator when it causes excessive array copying 2017-05-17 19:34:44 +03:00
baratynskiy
1eb1735ac9 Return from compile() function immediately if javaFiles collection is empty 2017-05-17 17:49:53 +03:00
baratynskiy
eb85e9f5f3 Introduce isFromSourceCodeInScope function
See `VirtualFileBoundJavaClass` interface
2017-05-17 17:49:33 +03:00
baratynskiy
91412b0ee9 Add tools.jar for JPS plugin 2017-05-17 17:48:59 +03:00
baratynskiy
71ba8e3ad0 Add tools.jar for command line compiler if -Xuse-javac is specified 2017-05-17 17:48:53 +03:00
baratynskiy
09e4ea55c7 kotlin-maven-plugin: add tools.jar dependency if -Xuse-javac is specified 2017-05-17 17:48:47 +03:00
baratynskiy
5eea3b6569 Introduce experimental -Xuse-javac compilation mode
In this mode, javac AST and Symbol files are used during
Kotlin compilation instead of PSI / binary stuff.
Later, they are reused for Java file compilation.
javac in this mode is integrated into kotlinc.
2017-05-17 17:48:17 +03:00
baratynskiy
c9a04fe1e2 Extract VirtualFileBoundJavaClass interface 2017-05-17 17:42:13 +03:00
baratynskiy
a815125281 Use JDK 8 in AbstractCompileAgainstKotlin test 2017-05-17 17:42:12 +03:00
baratynskiy
65aac7ae13 Extract AbstractJavaResolverCache 2017-05-17 17:42:10 +03:00
baratynskiy
f576f0b4a0 Extract AbstractJavaClassFinder 2017-05-17 17:42:09 +03:00
baratynskiy
fe9a2b30fd JavaClassFinderImpl: J2K 2017-05-17 17:42:08 +03:00
baratynskiy
7af5dc7d03 JavaClassFinderImpl: java -> kt 2017-05-17 17:42:07 +03:00
baratynskiy
5c01b6fa20 AbstractCompileJavaAgainstKotlinTest: J2K 2017-05-17 17:42:05 +03:00
baratynskiy
be41364fdd AbstractCompileJavaAgainstKotlinTest: java -> kt 2017-05-17 17:42:04 +03:00
Denis Zharkov
63c5d85cf4 Optimize memory footprint for generated protobuf code
The problem was that an overload of CodedOutputStream.newInstance
without size uses 4000 as a default value, thus allocating
a 4k-sized byte array.
At the same time the array remained effectively unused
in the most cases since it only used for storing data
for unknown fields.

Because such arrays are being created for each read of
protobuf message, during compilation of IntelliJ project
it was producing 25% of redundant memory traffic.

Of course these arrays were all in the young gen, but still
they have some effect on GC
2017-05-17 14:34:11 +03:00
Denis Zharkov
692840860e Use allScope when resolving classifiers of binary classes
Otherwise it might lead to the problems when reading class files
from the source scope (e.g. a groovy file or an already compiled java file)

Note that it may be reproduced only with Maven because in JPS
and Gradle we reading source java files even when they're shouldn't be
recompiled, while in Maven we read class files in the case

 #KT-17897 Fixed
2017-05-17 14:33:23 +03:00
Mikhael Bogdanov
d9dc2bd443 Minor. Fix review remarks 2017-05-17 10:20:04 +02:00
Mikhael Bogdanov
fd561c6cb9 Support default bound callable reference inlining
#KT-6884 Fixed
2017-05-17 10:20:03 +02:00
Mikhael Bogdanov
8a083a41d5 Clean code after transformation 2017-05-17 10:20:02 +02:00
Mikhael Bogdanov
eca359f176 Convert RegeneratedLambdaFieldRemapper to Kotlin 2017-05-17 10:20:01 +02:00
Mikhael Bogdanov
fe4668c315 Rename RegeneratedLambdaFieldRemapper.java to RegeneratedLambdaFieldRemapper.kt 2017-05-17 10:20:01 +02:00
Mikhael Bogdanov
77af888b6f Code clean after convertion 2017-05-17 10:20:00 +02:00
Mikhael Bogdanov
5b947ac27e Convert FieldRemapper to Kotlin 2017-05-17 10:19:59 +02:00
Mikhael Bogdanov
f795f2777c Rename FieldRemapper.java to FieldRemapper.kt 2017-05-17 10:19:58 +02:00
Mikhael Bogdanov
e86e128c8a Code clean after convertion 2017-05-17 10:19:58 +02:00
Mikhael Bogdanov
fcd76e6dec Convert InlinedLambdaRemapper to Kotlin 2017-05-17 10:19:57 +02:00
Mikhael Bogdanov
d1fdfd484b Rename InlinedLambdaRemapper.java to InlinedLambdaRemapper.kt 2017-05-17 10:19:56 +02:00
Mikhael Bogdanov
05d2aa700b Support default property reference inlining 2017-05-17 10:19:55 +02:00
Mikhael Bogdanov
a96fada230 Switch tests for default lambda inlining on language level 1.2 2017-05-17 10:19:55 +02:00
Mikhael Bogdanov
0ac23c789e Add diagnostics for default lambda inlining 2017-05-17 10:19:54 +02:00
Mikhael Bogdanov
81c2e1dd8c Code clean after convertion 2017-05-17 10:19:53 +02:00
Mikhael Bogdanov
6373c3115a Convert LocalVarRemapper to Kotlin 2017-05-17 10:19:52 +02:00
Mikhael Bogdanov
c6189076cc Rename LocalVarRemapper.java to LocalVarRemapper.kt 2017-05-17 10:19:51 +02:00
Mikhael Bogdanov
6730fa2bbf Support default inline lambda reification 2017-05-17 10:19:51 +02:00
Mikhael Bogdanov
9e8495dc3d Clean code 2017-05-17 10:19:50 +02:00
Mikhael Bogdanov
45bfb2075d Move reifiedTypeInliner to root context 2017-05-17 10:19:49 +02:00
Mikhael Bogdanov
da13ea4a8a Move all InliningContext's to one place 2017-05-17 10:19:48 +02:00
Mikhael Bogdanov
9fdd4c647a Clean code. Add LambdaInfo to InliningContext 2017-05-17 10:19:48 +02:00
Mikhael Bogdanov
9dae183e3a Convert RootInliningContext.java to Kotlin 2017-05-17 10:19:47 +02:00
Mikhael Bogdanov
8b2164e2b8 Code clean after transformation 2017-05-17 10:19:46 +02:00
Mikhael Bogdanov
fcbd27fdc4 Convert InliningContext.java to Kotlin 2017-05-17 10:19:45 +02:00
Mikhael Bogdanov
04cf5d49d6 Rename InliningContext.java to InliningContext.kt 2017-05-17 10:19:45 +02:00
Mikhael Bogdanov
309051bd21 Obtain reification marker on default lambda extraction.
Add reification tests.
2017-05-17 10:19:44 +02:00
Mikhael Bogdanov
47c5e64ba5 Sort smap data by output file name 2017-05-17 10:19:43 +02:00
Mikhael Bogdanov
3e50203283 Add source mapping tests for default lambda inlining 2017-05-17 10:19:42 +02:00
Pavel V. Talanov
21b32b9de5 IDE Performance: skip resolver construction for non-relevant modules
Querying non-existent packages does not trigger module resolver computation
2017-05-16 22:15:07 +03:00
Pavel V. Talanov
55721e4f16 Test not creating resolvers for modules that have no relevant packages 2017-05-16 22:15:06 +03:00
Pavel V. Talanov
77e611b2e7 Minor: refactor PerModulePackageCacheService 2017-05-16 22:15:05 +03:00
Pavel V. Talanov
f750d08350 Light classes: test extending Number and CharSequence 2017-05-16 22:01:06 +03:00
Pavel V. Talanov
1c5e7c4726 Make sure java completion doesn't suggest classes from builtIns
Fix an undesirable sideeffect of previous changes
2017-05-16 22:01:05 +03:00
Pavel V. Talanov
798c80ed07 Use wrappers around java.util.* to emulate kotlin.collection.* behaviour
Backend: If kotlin class extends kotlin.collection.List
    write it as it's super interface (light class mode only)
IDE: Provide wrapper classes to java resolve
    that try to emulate backend behaviour

For example if kotlin class implements kotlin.collections.Map,
    we provide a superinterface that has abstract 'getEntries' method
    and 'entrySet' method that is considered default.
In reality all those methods are generated in the class itself.

In IDE supporting this case without hacks is not feasible performance-wise
    since kotlin.collection.* may not be an immediate supertype and we need
    to compute all supertypes just to calculate own methods of the class
2017-05-16 22:01:03 +03:00
Pavel V. Talanov
c56f74cc81 Do not generate bridge and stub methods in light class mode 2017-05-16 22:01:02 +03:00
Pavel V. Talanov
4bdfb8c646 Jvm backend: specify declaration origin of generated methods
Allow to distinguish collection stub methods and augmented kotlin api methods
2017-05-16 22:01:01 +03:00
Pavel V. Talanov
eb3c20d630 Refactor constructing KOTLIN_MARKER_INTERFACES map 2017-05-16 22:01:00 +03:00
Pavel V. Talanov
1a04960ff0 J2K class map: expose classes having mutable/readonly kotlin equivalents
Refactor JavaToKotlinClassMap a little bit
2017-05-16 22:00:59 +03:00
Pavel V. Talanov
40561dabed J2K JavaToKotlinClassMap 2017-05-16 22:00:58 +03:00
Pavel V. Talanov
6701eb70fb Light classes, minor: introduce cannotModify() utility 2017-05-16 22:00:57 +03:00
Mikhail Glukhikh
51af18608f AbstractLocalInspectionTest: add LANGUAGE_VERSION support
Related to KT-17164
2017-05-16 20:44:12 +03:00
Mikhail Glukhikh
9990550429 Introduce inspection "replace arrayOf with literal" #KT-17164 Fixed 2017-05-16 20:44:11 +03:00
Zalim Bashorov
fb9d88315a Don't print unnecessary empty line separators when generate tests 2017-05-16 19:42:47 +03:00
Gaetan Zoritchak
c00918c9f8 KT-17853: Kotlin.js switched parameters of Math.atan2
https://youtrack.jetbrains.com/issue/KT-17853
The current exposition of the JavaScript [Math object] switched the parameters names. 
The correct version is `atan2(y,x)`.
2017-05-16 17:41:43 +02:00
Sergey Igushkin
74288ff8ae Fix main and test compilation tasks having different module name in
free compiler args.
2017-05-16 17:35:45 +03:00
Dmitry Petrov
899ad7bb53 Generate for-in-indices as a precondition loop
Precondition loops are better optimized by HotSpot
(and, quite likely, by ART).
Also, we generate more compact bytecode that way.

KT-17903 Generate 'for-in-indices' as a precondition loop
2017-05-16 17:28:43 +03:00
Dmitry Petrov
793fb65666 Introduce AbstractForInExclusiveRangeLoopGenerator 2017-05-16 17:28:43 +03:00
Dmitry Petrov
8903504334 Update test for incremental compilation after new DCE
Previous test had an inline setter that didn't produce any effect,
thus, corresponding code was removed by new DCE.
Make sure that changes made in the inline property are caught up by IC.
2017-05-16 17:28:43 +03:00
Dmitry Petrov
84e54124a2 More aggressive DCE should honor debugger invariants
- A LINENUMEBER node is "dead" if the corresponding instruction interval
 contains at least one "dead" bytecode instruction
 and no live bytecode instructions

- Observable local variable lifetimes should be taken into account
 when determining if a NOP is required for debugger.
2017-05-16 17:28:43 +03:00
Dmitry Petrov
65799a5cb4 Fix debugger-related tests after dead code elimination improvements 2017-05-16 17:28:43 +03:00
Dmitry Petrov
fe7870a1cd Minor: RedundantCoercionToUnit -> PopBackwardPropagation
It is actually more meaningful than just "coercion to unit elision":
it removes instructions without side effects with results that are
unused (popped from the stack).
2017-05-16 17:28:43 +03:00
Dmitry Petrov
1378b0cf05 Fix bytecode tests after new optimizations
- Turn some const conditions into non-const conditions
- Make sure inlined const values are used where required
(otherwise they are eliminated by POP backward propagation)
2017-05-16 17:28:43 +03:00
Dmitry Petrov
2051355d6a Optimize constant conditions
Using basic constant propagation (only integer constants, no arithmetic
calculations), rewrite conditional jump instructions with constant
arguments.

This covers problem description in KT-17007.
Note that it also works transparently with inline functions.
Partial evaluation is required to cover more "advanced" cases.

As a side effect, this also covers KT-3098:
rewrite IF_ICMP<cmp_op>(x, 0) to IF<cmp0_op>(x).
2017-05-16 17:28:43 +03:00
Dmitry Petrov
495fba43c0 Fuse primitive equality with safe call to avoid boxing
In code like 'a?.b == 42', we can immediately generate equality
comparison result when receiver is null (false for '==', true for '!='),
since the primitive value is definitely non-null.
Otherwise unnecessary boxing/unboxing is generated to handle possibly
null result of 'a?.b'.
2017-05-16 17:28:43 +03:00
Dmitry Petrov
55498b7f63 Minor: move around some optimization-related classes 2017-05-16 17:28:43 +03:00
Dmitry Petrov
847f889a0a Allow merging tracked values in ReferenceTrackingInterpreter subclasses
This is required for things like detupling.
2017-05-16 17:28:43 +03:00
Dmitry Petrov
b445e0a049 Drop old null check optimizer 2017-05-16 17:28:43 +03:00
Dmitry Petrov
689298b11f CompositeMethodTransformer 2017-05-16 17:28:43 +03:00
Dmitry Petrov
0dbf383ce8 OptimizationMethodVisitor: convert to Kotlin 2017-05-16 17:28:43 +03:00
Dmitry Petrov
a3a60db926 OptimizationMethodVisitor: .java -> .kt 2017-05-16 17:28:43 +03:00
Mikhail Glukhikh
d185adfedd Fix UAST test 2017-05-16 16:43:29 +03:00
Dmitry Neverov
bf4e69e17f Make semicolon in loop with empty body not redundant
So #KT-12805 Fixed
2017-05-16 16:43:28 +03:00
fitermay
e30b9758f4 Introduce action to add missing when branches on sealed class
Made via diagnostics NON_EXHAUSTIVE_WHEN_FOR_SEALED_CLASS
with INFO severity and quick-fix
So #KT-17580 Fixed
2017-05-16 16:43:27 +03:00
Alexey Sedunov
1072495001 Copy: Support top-level declarations 2017-05-16 13:10:41 +03:00
Alexey Sedunov
4c1c1a989a Copy: Support multiple classes in the same file 2017-05-16 13:10:40 +03:00
Alexey Sedunov
92446df14a Copy: Support class copying
#KT-8180 Fixed
 #KT-9054 Fixed
2017-05-16 13:10:39 +03:00
Alexey Sedunov
405a28648f J2K: KtLabeledExpression 2017-05-16 13:10:38 +03:00
Alexey Sedunov
32c90c67c7 J2K: KtLabeledExpression (rename to .kt) 2017-05-16 13:10:37 +03:00
Alexey Sedunov
f2bb6e4dac Rename: Support import aliases
#KT-4379 Fixed
2017-05-16 13:10:36 +03:00
Alexey Sedunov
5d87276cff PSI: Introduce KtImportAlias element 2017-05-16 13:10:35 +03:00
Alexey Sedunov
3c94184de9 Rename: Support labeled expressions
#KT-7107 Fixed
2017-05-16 13:10:34 +03:00
Dmitry Jemerov
63d32a524c Fix exception on new file creation when no file template is defined
#KT-17906 Fixed
2017-05-16 11:59:38 +02:00
Dmitry Jemerov
f113a5ce99 Fix stdlib-jre7/8 configuration in new projects
#KT-17875 Fixed
 #KT-17876 Fixed
2017-05-16 11:45:35 +02:00
Denis Zharkov
57cb556efd Update rendered public API in coroutines package
- suspendCoroutine is not public anymore, since all of the
inline functions are generated as private
- `label` is public to allow update it from the named functions
2017-05-16 11:38:59 +03:00
Denis Zharkov
2c5baf6c08 Make companion object private to avoid its presence in public API 2017-05-16 11:38:59 +03:00
Denis Zharkov
d24d3a73d7 Support open suspend members and super-calls
The problem was that the resume call (from doResume) for open members
was based on common INVOKEVIRTUAL to the original function
that lead to the invocation of the override when it was expected
to be the overridden (after super-call being suspended)

The solution is to generate method bodies for open members into
the special $suspendImpl synthetic function that may be called
from the doResume implementation

 #KT-17587 Fixed
2017-05-16 11:38:59 +03:00
Denis Zharkov
e75b6c8404 Perform fix-stack transformation before method analysis
Otherwise it might fail on an "invalid" bytecode
2017-05-16 11:38:59 +03:00
Denis Zharkov
dcaad530ce Make code generation in method transformer more stable
Do not mix references to label nodes and common ASM labels
as it may lead to different LabelNode instance (not defaultLabel)
being inserted into insns list

It's been working before because there was no `resetLabels` call
on insnList, and label/label nodes were bound to each other
2017-05-16 11:38:59 +03:00
Denis Zharkov
4033786902 Minor. Drop always-false parameter in fix-stack utils 2017-05-16 11:38:59 +03:00
Denis Zharkov
d362fa6eea Minor. Use trailing lambda syntax in FixStackMethodTransformer 2017-05-16 11:38:59 +03:00
Dmitry Jemerov
675305fef3 Don't highlight 'this' references as deprecated
#KT-17613 Fixed
2017-05-15 14:57:52 +02:00
Yan Zhulanow
5d31e00d27 Allopen, Gradle: Fix JPS build on Windows (KT-17830)
Appears that plugin classpath can contain not only `File.separatorChar`, but also '/' on Windows. Without the proper handling of this case, Gradle importer may import the plugin JAR made for Gradle with shaded 'com.intellij' and cause an exception during the JPS build.
2017-05-15 14:42:01 +03:00
Sergey Mashkov
fd0578b564 KT-10028 Support parallel builds in maven
Mark mojo's as thread safe as users confirmed that all related errors
seem to be fixed
2017-05-15 12:55:33 +03:00
Alexander Udalov
3f5b8b3f68 Refactor JvmDependenciesIndexImpl.search
- use nullable type "T?" instead of HandleResult consisting of the found
  value and the "should continue" flag
- inline all local functions because they don't add any value now
2017-05-15 12:17:46 +03:00
Alexander Udalov
939f969f12 Support .jar archives in friend paths (for internal visibility) 2017-05-15 12:17:45 +03:00
Mikhail Zarechenskiy
ac8fbce249 Fix false "useless cast" when target type is flexible
#KT-17820 Fixed
2017-05-15 11:24:39 +03:00
Mikhail Zarechenskiy
a8f1e32dec Refactoring: move utils related to casts to CastDiagnosticUtil 2017-05-15 11:24:37 +03:00
Mikhail Zarechenskiy
b323d2b24a Refactoring: extract method to detect redundant is out 2017-05-15 11:24:36 +03:00
Dmitry Neverov
cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Glukhikh
768e0fa738 Add forgotten KotlinAbstractUElement.hashCode() 2017-05-12 22:27:58 +03:00
Nikolay Krasko
c5a8001aa4 Revert generated formatter tests 2017-05-12 20:16:22 +03:00
Simon Ogorodnik
a0a6ef4f2e Use ModalityState.any() for J2K post processing
#KT-17870 fixed
2017-05-12 17:53:50 +03:00
Nikolay Krasko
861cac5b52 Better indent in multi-line strings (KT-17849)
Inspired by MultilineStringEnterHandler from https://github.com/JetBrains/intellij-scala
edb741f344/src/org/jetbrains/plugins/scala/editor/enterHandler/MultilineStringEnterHandler.scala

 #KT-17849 Fixed
2017-05-12 17:34:05 +03:00
Nikolay Krasko
30639b0a5e Allow injection in strings with interpolation (KT-6610)
#KT-6610 In Progress
2017-05-12 17:33:37 +03:00
Dmitry Jemerov
f53b9aa419 Improve diagnostics for EA-100849
KNPE: DeserializerForClassfileDecompilerKt.DeserializerForClassfileDecompiler
2017-05-12 12:34:54 +02:00
Dmitry Jemerov
db1f8c7541 EA-100074 - SOE: ExpressionsOfTypeProcessor.containsTypeOrDerivedInside 2017-05-12 12:33:46 +02:00
Dmitry Jemerov
ddcde3f688 EA-101095 NSEE: KotlinUsageToPsiElementProvider.getAppropriateParentFrom) 2017-05-12 12:33:45 +02:00
Dmitry Jemerov
4e58319d1b Revert "Deprecated setting was used for import optimization on the fly. (#1049)"
This reverts commit 75d231cc37.
The added API is available only in IDEA 2017.1.1, not in the original 2017.1 build.
2017-05-12 12:33:45 +02:00
Anton Bannykh
e098de5e33 JS: fix char boxing in elvis expressions (#KT-17700 fixed) 2017-05-11 21:31:38 +03:00
Mikhail Glukhikh
a1e00ed9f1 Don't suggest "if to ?." without else when used in expression position 2017-05-11 20:47:16 +03:00
Mikhail Glukhikh
326d850760 Use "if-then to" even for 'if (arg != null) arg' removing 'if' 2017-05-11 20:47:10 +03:00
Mikhail Glukhikh
977d8e1cd7 If to safe access: fix message when no dot calls are available
Now "Replace 'if' with safe cast" is suggested
2017-05-11 20:47:04 +03:00
Mikhail Glukhikh
a77390ccd6 Change both IfThenTo... inspections highlight level
Retain WEAK WARNING for null checks, one-liners,
and is checks without dot calls in main branch.
Set INFORMATION (no highlighting, just fix) for other cases.

Switch off both bound intentions.
So #KT-15076 Fixed
2017-05-11 20:46:51 +03:00
Mikhail Glukhikh
2d9a5afb15 Refactoring: convert problemHighlightType to function with parameter 2017-05-11 20:46:37 +03:00
Mikhail Glukhikh
d9a33af61e Reduce range of IfThenTo... inspections to just 'if' 2017-05-11 20:46:31 +03:00
Mikhail Glukhikh
781a45c747 Minor refactoring: IfThenToSelectData.clausesReplaceableByElvis 2017-05-11 20:46:24 +03:00
Mikhail Glukhikh
f3ee5ea45f IfThenToDoubleBang: fix AWT from writeAction problem 2017-05-11 20:46:17 +03:00
Mikhail Glukhikh
66c5717adc Refactoring of IfThen: ToDoubleBang / ToElvis / ToSafeAccess
Some common actions were extracted to IfThenUtils.kt
Use consistent logic in all three intentions
Also fixes potential PSI consistency problems in conversions dot->safe calls
2017-05-11 20:46:11 +03:00
Dmitry Neverov
fd6d1520c7 Convert 'if' with 'is' check to 'as?' with safe call #KT-17054 Fixed 2017-05-11 20:46:05 +03:00
Mikhail Glukhikh
0361ed8c68 Refactoring: SelfTargetingIntention / IntentionBasedInspection
Remove complex logic which disables intention when bound inspection on
Add much simpler logic in SelfTargetingIntention.equals
2017-05-11 20:45:59 +03:00
Alexey Andreev
1900b20e6e Implement inlining of Array constructor in JS BE
See KT-15456
2017-05-11 17:10:45 +03:00
Mikhail Glukhikh
6523f237a6 Test fix (I hope so) from parameter info group 2017-05-11 16:38:51 +03:00
Mikhael Bogdanov
97bcf9f538 Add default lambda inlining prototype 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov
b7af4ac882 Add SKIP_INLINE_CHECK_IN directive to inline test framework 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov
daf6768181 Add proper DefaultLambda initialization,
patch lambda related instructions in default method

Remove default lambda linked instructions from default method
2017-05-11 11:06:46 +02:00
Mikhael Bogdanov
ec066a06d8 Clean code after convertion to Kotlin 2017-05-11 11:06:45 +02:00
Mikhael Bogdanov
1e9ffe42b1 Convert MethodInliner.java to Kotlin 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov
e34f934aba Rename MethodInliner.java to MethodInliner.kt 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov
f915192827 Minor. Clean and refactoring after convertion 2017-05-11 11:06:43 +02:00
Mikhael Bogdanov
3fe152aad3 Convert AnonymousObjectTransformer.java to Kotlin 2017-05-11 11:06:42 +02:00
Mikhael Bogdanov
36c43b630e Rename AnonymousObjectTransformer.java to AnonymousObjectTransformer.kt 2017-05-11 11:06:41 +02:00
Mikhael Bogdanov
980414674a Add default lambda parsing 2017-05-11 11:06:40 +02:00
Mikhael Bogdanov
70e550e984 Introduce ExpressionLambda and DefaultLambda abstractions,
extract common part to LambdaInfo
2017-05-11 11:06:40 +02:00
Mikhael Bogdanov
9c51392aff Convert LambdaInfo.java to Kotlin 2017-05-11 11:06:39 +02:00
Mikhael Bogdanov
f8f4fc5de1 Rename LambdaInfo.java to LambdaInfo.kt 2017-05-11 11:06:38 +02:00
Sergey Igushkin
7097246866 Unify build output with Maven
* Added manifest properties to `gradle-tools` projects.
* Add `-kotlin-module` to free compiler args to make the module names
  match the ones in Maven build
* Fixed path to the Groovy sources in `kotlin-gradle-plugin/pom.xml`
2017-05-10 20:15:08 +03:00
Sergey Igushkin
7030b89b7c Fix rootDir mis-use in commonConfiguration.gradle:
replace with `kotlin_root`, that is set in the projects
2017-05-10 20:03:26 +03:00
Sergey Igushkin
c3ae37c6ce Gradle build fixes & improvements:
* Fix Java not compiled in kotlin-gradle-plugin Kotlin source set
* Fix the integration tests running under Java 6
* Fix kotlin-gradle-subplugin-example not being installed -- needed
  for a test
* Fix Android tests being always excluded
* Move versions out of `build.gradle` (x2) to a common `versions.gradle`
* Move JDK, dist and bootstrap to `commonConfiguration.gradle`
* Build `kotlin-gradle-plugin` with JDK_18
2017-05-10 20:03:26 +03:00
Sergey Igushkin
8e65b5f2c8 Gradle plugins migration to Gradle build
* Add gradle-tools subproject
* Add Gradle buildscripts to the related projects
* Remove the projects from the libraries pom.xml
* Move AndroidGradleWrapper.groovy to separate source root
* Changed artifact dependencies to project dependencies where needed
* Extract common configuration into commonConfiguration.gradle
* (convert functions to closures to be able to call them)
* Refactor DSL usage
* Replace `project.properties` with `findProperty`
* Unify Gradle wrapper between `libraries` and `gradle-tools`
(as a temporary solution, just made the wrapper files the same)
2017-05-10 20:03:26 +03:00
Anton Bannykh
503891846f Updated some tests to expect the new '-Xfoo=bar' advanced options syntax 2017-05-10 19:32:52 +03:00
Mikhail Glukhikh
f0543439f4 Use InfixCallToOrdinaryIntention directly for INFIX_MODIFIER_REQUIRED
So #KT-10211 Fixed
2017-05-10 17:43:46 +03:00
Mikhail Glukhikh
967c01f0ba Override 'equals' in SelfTargetingIntention
This prevents suggestion of duplicating intentions
2017-05-10 17:43:45 +03:00
Kirill Rakhman
a8b2d3b4e8 Add inspection to detect copy() calls in a data class without named arguments
So #KT-17660 Fixed
2017-05-10 17:43:44 +03:00
Alexey Andreev
2c10f253c5 Fix node.js tests on Windows agents in Teamcity 2017-05-10 16:46:49 +03:00
Dmitry Neverov
3002639fd7 Take control flow into account for checking fall-through switch branches
#KT-16133 Fixed
2017-05-10 15:57:21 +03:00
Dmitry Neverov
31478f8efa Detect escaped backslashes
#KT-15761 Fixed
2017-05-10 15:51:18 +03:00
Dmitry Jemerov
9c4f897d31 Index properties defined in primary constructor
#KT-15029 Fixed
2017-05-10 14:27:28 +02:00
Dmitry Jemerov
ec53a6dbe7 Return non-default lexer state for unmatched backtick
When a document is changed, the editor highlighter restarts the lexer
at the last point where it was in the default state. Previously, if
a matching backtick was deleted and then reinserted, the lexer was
resumed just before the reinsertion point, and as the result the two
backticks were parsed not as two delimiters of a single token but as
two BAD_CHARACTER tokens. With this change, all tokens after the
unmatched backtick will be in a non-default state, so the lexer will
restart at the first backtick and will correctly see the two backticks
as a single token.

 #KT-9091 Fixed
2017-05-10 14:27:27 +02:00
Dmitry Jemerov
66877c138d Correctly handle editor selection in "Show expression type"
To avoid showing a large list, the previous logic returned only the
element directly at caret and other elements with the same start
offset. When selection is present, the platform logic looks only at
elements which have a larger range than the selection, so our elements
could be completely filtered out. Now we look at the selection
ourselves and adjust the returned elements accordingly.

 #KT-16423 Fixed
2017-05-10 14:27:26 +02:00
Dmitry Jemerov
c3c0bcb1be Better caret position for new Kotlin file/class
#KT-15255 Fixed
2017-05-10 14:27:26 +02:00
Dmitry Jemerov
d1893cfa5f Don't highlight entire complex callee expression as call
If an expression returns something that has invoke() defined on it,
this entire expression can act as a callee. If we highlight it, this
will suppress more useful highlighting such as string literals.

 #KT-16159 Fixed
2017-05-10 14:27:25 +02:00
Dmitry Jemerov
5d9307024a Hide Kotlin live template macros from non-Kotlin contexts
#KT-16635 Fixed
2017-05-10 14:27:24 +02:00
Dmitry Jemerov
c778e0454d Show line markers for suspending iteration
#KT-16803 Fixed
2017-05-10 14:27:23 +02:00
Dmitry Jemerov
baa43a2a55 Show line markers for sealed classes
#KT-16755 Fixed
2017-05-10 14:27:22 +02:00
Dmitry Jemerov
f64aaed205 Allow updating of fold region for imports when it's collapsed
#KT-12856 Fixed
2017-05-10 14:26:15 +02:00
Dmitry Jemerov
66ce2a6998 Render anonymous objects in Show Expression Type
#KT-17304 Fixed
2017-05-10 14:25:03 +02:00
Dmitry Jemerov
06a1d362d1 Pass Editor to StructureViewModel (required for autoscroll from source)
#KT-17439 Fixed
2017-05-10 14:25:02 +02:00
Dmitry Jemerov
b33c544fdf Enable rainbow highlighting for destructuring declaration entries
#KT-17652 Fixed
2017-05-10 14:25:02 +02:00
Mikhail Glukhikh
382bf9a500 ConvertReferenceToLambda status refactoring
Intention is not registered now; inspection is enabled by default now,
 but has highlight level of "No highlighting"
2017-05-10 14:56:38 +03:00
Mikhail Glukhikh
759e6643c6 ConvertLambdaToReference refactoring
Intention is not registered now; inspection is enabled by default now,
 but has highlight level of "No highlighting"
Inspection does not depend on text length now

So #KT-14335 Fixed
2017-05-10 14:56:37 +03:00
Mikhail Glukhikh
1d722e01f0 Get rid of local version of RemoveModifierFix 2017-05-10 14:56:36 +03:00
Mikhail Glukhikh
02345670b2 Get rid of local version of AddModifierFix 2017-05-10 14:56:35 +03:00
Mikhail Glukhikh
bb76783654 Minor (import removed) 2017-05-10 14:56:33 +03:00
Alexey Sedunov
f70bac019a Change Signature: Fix TypeInfo comparison
#KT-13437 Fixed
2017-05-10 14:49:53 +03:00
Alexey Sedunov
8bbf8e185a Move: Filter out usages with visibility error before refactoring
If declaration is already invisible before move,
no visibility conflict should be reported

 #KT-17571 Fixed
2017-05-10 14:49:52 +03:00
Alexey Sedunov
0a5f9d8181 Move: Specify conflict containing declaration more precisely
Also do not render class fqname for member declarations

 #KT-17547 Fixed
2017-05-10 14:49:51 +03:00
Mikhail Zarechenskiy
fba52359ac Add tests for obsolete issues
#KT-13112 Obsolete
 #KT-14249 Obsolete
2017-05-10 13:52:26 +03:00
Mikhail Zarechenskiy
38eff6966d Lazy resolve: fix scope for primary constructor parameters
For classes on top level scope was getting for file, which may introduce resolution problems with generics

 #KT-8829 Fixed
2017-05-10 13:52:21 +03:00
Kirill Rakhman
dbcf796e90 Add Smart Enter processor for object expessions (#1079)
Fixes #KT-17807
2017-05-10 11:49:08 +03:00
Dmitry Jemerov
4b811a3639 Fix tests 2017-05-09 11:50:31 +02:00
nd
e20e097a63 Stricter type checks in 'convert to range' intention (#1073)
#KT-17079 #KT-17762 Fixed
2017-05-09 10:31:32 +03:00
Nadia Humbert-Labeaumaz
e76f1acc0b Remove "Move to class body" intention for annotation parameters (#1076)
#KT-17708 Fixed
2017-05-09 10:27:37 +03:00
Dmitry Jemerov
80e17cbe9c Don't crash on non-jar files added to classpath
#KT-17698 Fixed
2017-05-09 09:18:07 +02:00
Yuli Fiterman
4393e2d518 KT-7848 -- unmerged changes (#1075)
* KT-7848 Initial implementation of literal copy/paste processor for Kotlin

* KT-7848: Tests

* KT-7848: fix issues caught in unit tests with recognizing invalid template entries

* KT-7848: check for KtFile

* KT-7848:  fix capitalization for test data file names

* KT-7848:  Initial changes according as per review

* KT-7848:  TemplateTokenSequence tests

* KT-7848:  fix off by one error caught in test

* KT-7848:  Reformat with keep empty lines in code -> 0
2017-05-08 18:50:41 +03:00
Yuli Fiterman
99b1bb98dc KT-7848: Literal copy/paste processor for Kotlin (#1074)
* KT-7848 Initial implementation of literal copy/paste processor for Kotlin

* KT-7847: Tests

* KT-7847: fix issues caught in unit tests with recognizing invalid template entries

* KT-7847: check for KtFile

* KT-7847:  fix capitalization for test data file names

* KT-7847:  Initial changes according as per review
2017-05-08 17:18:28 +03:00
Kirill Rakhman
8e00af5642 Add intention to convert top level val with object expression to object declaration (#974)
* Add intention to convert top level val with object expression to object
Fixes #KT-14137

* fix intention description
2017-05-08 16:35:03 +03:00
nd
93b5eec71e Convert to secondary constructor is not applicable to data classes (#1071)
#KT-15942 Fixed
2017-05-08 16:24:37 +03:00
nd
c9f475b402 Detect redundant semicolon before empty import list (#1072)
#KT-16577 Fixed
2017-05-08 16:14:22 +03:00
xiexed
b8942c5f04 Readme for ultimate project (#1070) 2017-05-08 15:55:30 +03:00
Ilya Chernikov
71a04f8cfc Fix script-related tests that aren't ready for roots changed optimizations
(cherry picked from commit ab52c55)
2017-05-08 00:20:37 +02:00
Ilya Chernikov
ca331d2f55 Optimize scripting-related cache creation and update
reduce number of cases when changes are reported from script dependencies
  provider, that causing rootsChanged event, in particular empty dependencies
  are filtered out now

Should reduce IDEA startup delays.
2017-05-07 17:32:48 +02:00
Ilya Chernikov
07ad9aa08d Add logging with time measurement to script dependencies caching and caches updating 2017-05-07 17:32:47 +02:00
Ilya Chernikov
3f9aec31bd Optimize scripting-related files monitoring
filter vfs changes events to take only non-infrastructure files from actual
project
also drop unnecessary readAction during internal caches update

Should reduce IDEA startup delays.
2017-05-07 17:32:46 +02:00
Dmitry Jemerov
8337cd455f Fix reporting exception problems on Kotlin UAST fields (KT-17714) 2017-05-06 08:18:08 +02:00
shiraji
56d712a02a Introduce quick-fix adding label to 'return' in closures #KT-16851 Fixed 2017-05-05 23:27:10 +03:00
Ilya Gorbunov
2f7ab1c0c1 Inline some properties from kotlinManifest.properties that were used only once 2017-05-05 21:56:56 +03:00
Ilya Gorbunov
96c36fb317 Remove manifest.impl.value.kotlin.version and other unused properties from kotlinManifest.properties 2017-05-05 21:56:56 +03:00
Ilya Gorbunov
720e6ecdb6 kotlin.language.version property no longer used in maven build 2017-05-05 21:56:56 +03:00
Mikhail Zarechenskiy
3bfc17c2d4 Avoid redundant cache entries: move checks to the caller function 2017-05-05 21:30:39 +03:00
Mikhail Zarechenskiy
adb8e60615 Fix resolve of last destructuring declaration in block
Last declaration in block is resolved in DEPENDENT mode because it has
 influence on return type and therefore fake call for destructuring declaration
 wasn't completed (see `getBlockReturnedTypeWithWritableScope`)

 Now we resolve fake call for destructuring declaration in INDEPENDENT
 mode as it doesn't have effect on return type

 #KT-15480 Fixed
2017-05-05 21:30:38 +03:00
Mikhail Zarechenskiy
7530a9426f Warn about val reassignment via backing field
#KT-16681 In Progress
2017-05-05 21:30:37 +03:00
Mikhail Zarechenskiy
e821b25288 Resolve type alias SAM constructors in synthetic scope 2017-05-05 21:30:36 +03:00
Mikhail Zarechenskiy
7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Mikhail Zarechenskiy
429f0e4f68 Adapt changes in IDE after moving SAM adapters to synthetic scope
The main change is that now to get static sam adapters one should do it using synthetic scopes and static scope of container
2017-05-05 21:30:10 +03:00
Mikhail Zarechenskiy
8e233162ed Drop SamAdapterOverridabilityCondition as it became obsolete
There is no need in checking overridability of sam adapters as now we don't create fake synthesized methods for static sam adapters
2017-05-05 21:30:10 +03:00
Mikhail Zarechenskiy
95ede7fb67 Move SAM adapters from static scope to synthetic one 2017-05-05 21:30:10 +03:00
Alexey Tsvetkov
2ff28ebced Merge sequent filter and map calls into one loop
ScopeTowerProcessors.kt contains a few code snippets
that look like `collectCandidates(...).filter { ... }.map { ... }`.
Filter argument is always side-effect free, so it is safe
to merge `filter` and `map` calls into one for-loop.

The change also makes sense, because modified functions are quite hot.
For example `NoExplicitReceiverScopeTowerProcessor.simpleProcess`
produces 11,392,768 ArrayList instances (~1.08% of all objects)
when compiling the compiler according to aprof at the moment of writing.

On my machine the change improves compilation speed of the compiler up to 5%.
2017-05-05 20:02:04 +03:00
Alexey Tsvetkov
e25060f8c9 Make closing artifact difference registry more robust
KT-16298
2017-05-05 18:42:33 +03:00
Alexey Tsvetkov
b504f1eb45 Add test for KT-16298 2017-05-05 18:42:29 +03:00
Jonathan Leitschuh
0ed4b7f58a Avoid flushing cache removed by clean
#KT-16298 fixed
2017-05-05 18:42:24 +03:00
Ilya Gorbunov
180233b78e binary-compatibility-validator: use project version to disambiguate artifacts 2017-05-05 18:01:02 +03:00
Ilya Gorbunov
ab70307cc0 Minor: refactor iterable tests 2017-05-05 18:01:02 +03:00
Ilya Gorbunov
2792dbf988 Import for buildSequence in generated code for sequences 2017-05-05 18:01:02 +03:00
Anton Bannykh
9bd562bf67 Prevent 'obsolete form' warnings by passing advanced (-X) arguments using the '-Xfoo=bar' syntax 2017-05-05 16:05:44 +03:00
Denis Zharkov
6e114a90dc Adjust debugger to the new suspend function strategy
Now it's impossible to determine by descriptor if there is
a state machine for function, but at the same time
it doesn't really matter here since there is no LINENUMBERs
in doResume of continuation implementations for named suspend
functions

 #KT-17585 Fixed
 #KT-16603 Fixed
2017-05-05 14:14:38 +03:00
Denis Zharkov
7c6a15ddfe Treat inline suspend functions as inline-only
Now their bodies don't have real state machines, thus they cannot
be called correctly from Java

 #KT-17585 In progress
 #KT-16603 In progress
2017-05-05 14:14:38 +03:00
Denis Zharkov
ba200f5de1 Minor. Remove redundant kind of coroutine markers
It was necessary while the additional code was being inserted
outside of transformer, but now we can just remember where
the actual body starts
2017-05-05 14:14:37 +03:00
Denis Zharkov
b3f66c7641 Remove $ character from fake continuation parameter
The reason is that when it gets captured into the field
having name $$continuation inliner fails with an exception
as it skips fields starting with '$$'

At the same time it doesn't really matter how to call
that parameter because it's only visible in Java

 #KT-17585 In Progress
 #KT-16603 In Progress
2017-05-05 14:14:37 +03:00
Denis Zharkov
5b5f612a7c Support new strategy for suspend inline functions
The main idea is to leave all the inline functions as is, without
state machines (but keeping suspend-calls markers) and
determine whether we need a state machine from the bytecode
after inlining into a non-inline function

 #KT-17585 In Progress
 #KT-16603 In Progress
 #KT-16448 Fixed
2017-05-05 14:14:00 +03:00
Denis Zharkov
5d0aeb4ef6 Minor. Drop unused BindingContext slice 2017-05-05 14:01:50 +03:00
Denis Zharkov
0b99c5c54e Remove fix for tail-placed branch operations in suspend functions
It has been introduced in 2286027bed
and should've help to avoid verify error

Now it became both impossible and unnecessary:
- It's impossible now since we can't determine in codegen
if we'll needa state machine
(it depends from inline functions' contents)
- It's unnecessary since we'll introduce the state machines for cases
described in the 2286027bed tests

NB: There's still a problem that now we work a bit suboptimally
because actually these samples can be generated without state
machines
2017-05-05 14:01:50 +03:00
Denis Zharkov
7803c9c0ba Minor. Convert loop to 'removeIf' call 2017-05-05 14:01:50 +03:00
Denis Zharkov
00526f5934 Add optional JVM declarations rendering for box tests
This option will be used later to check if state machine has been
generated for suspend function
2017-05-05 14:01:50 +03:00
Denis Zharkov
d92c403f9e Move helpers for coroutine tests in separate package
It will help to skip their content when rendering bytecode listing
for box tests
2017-05-05 14:01:50 +03:00
Denis Zharkov
035fcc2424 Minor. Rewrite part in CoroutineTransformer with 'run'
It helps to avoid unnecessary val customCoroutineStartMarker
in the scope of performTransformations
2017-05-05 14:01:50 +03:00
Denis Zharkov
c3a032ea0b Generate state machine for named functions in their bodies
Inline functions aren't supported yet in the change

 #KT-17585 In Progress
2017-05-05 14:01:50 +03:00
Denis Zharkov
59d89a1ae3 Generate private suspend function in JVM as package-private
It helps to simplify implementation of generating state machines
into the named functions' bodies but of course has some flaws:
1. They may be called from the same package in Java
2. It may lead to problems when declaring clashing descriptor
in an inheritor

This change must be reverted at some moment, or these flaws
should be fixed in some other way

 #KT-17585 In Progress
 #KT-17584 Open
2017-05-05 14:01:50 +03:00
Denis Zharkov
bb7a188f87 Minor. Weaken assertion in refined int type analysis
It's necessary because ASM remebers exact types obtained from
value parameters, and in the further commits we're going
to place code of suspend functions in their bodies, and there
we get already refined type for int-like slots
2017-05-05 14:01:50 +03:00
Denis Zharkov
0cd80d8b0e Get rid of class builder factory for coroutines
Initially it was a sort of hack: introducing another
interception class builder factory that will process all functions.

To differentiate suspend functions from the common ones
the fake annotation class has been used.

The problem is that now we should inject the different
class builder into the CoroutineTransformerMethodVisitor:
we need class builder for anonymous class representing state
for named function while currently it will be the one for the class
where the named function is defined
2017-05-05 14:01:50 +03:00
Mikhail Glukhikh
7271ca0b72 KT-13997 related: fix of JS relevant test 2017-05-05 11:17:52 +03:00
Kirill Rakhman
cd07aea5e3 Add quickfix for adding 'lateinit'
Fixes #KT-17650
2017-05-05 11:09:07 +03:00
Mikhail Glukhikh
5de55e80ce KT-13997 related: fix of J2K relevant test 2017-05-05 10:55:26 +03:00
Dmitry Petrov
e902cff937 Add 'getTypeArgumentOrDefault' extension for IrMemberAccessExpression 2017-05-05 09:59:30 +03:00
Dmitry Petrov
f5fde2c24f Dump absent type arguments 2017-05-05 09:59:30 +03:00
Dmitry Petrov
ddb2b7508b Generate property initializer within property scope 2017-05-05 09:59:30 +03:00
Dmitry Petrov
8e84862afa Generate do-while condition within loop body scope 2017-05-05 09:59:30 +03:00
Dmitry Petrov
fdb4de355c Use original descriptors to create symbols for callable references 2017-05-05 09:59:30 +03:00
Dmitry Petrov
c2601c947f Postpone call arguments generation in compound assignment expressions
Otherwise RHS is generated twice, causing ISE in symbol binding
2017-05-05 09:59:30 +03:00
Alexey Tsvetkov
6b956b3746 Fix exception "Unknown CompilerMessageSeverity: OUTPUT"
`CompilerMessageSeverity.OUTPUT` was removed from the enum set
`CompilerMessageSeverity.VERBOSE` in the commit d8d3bafbe9,
so `GradleMessageCollector` started to throw the exception.

    #KT-17711 fixed
2017-05-04 23:03:16 +03:00
Anton Bannykh
2e9a59819a JS: support internal visibility from friend modules
Friend modules should be provided using the -Xfriend-modules flag
in the same format as -libraries. No manual configuration required for
JPS, Gradle and Maven plugins.

Friend modules could be switched off using the -Xfriend-modules-disabled
flag. Doing that will
  * prevent internal declarations from being exported,
  * values provided by -Xfriend-modules ignored,
  * raise a compilation error on attemps to use internal declarations from other modules

Fixes #KT-15135 and #KT-16568.
2017-05-04 21:44:17 +03:00
Yan Zhulanow
7bbf9861d0 Kapt3: Simplify handling of annotation processing exceptions
The previous handling method was unreliable ("Don't know how to render diagnostic of type KAPT3_PROCESSING_ERROR", exceptions being lost).
2017-05-04 19:59:30 +03:00
Alexey Tsvetkov
f8b785fc31 Test that Kapt3 IC removes stubs for dirty source files 2017-05-04 19:59:29 +03:00
Alexey Tsvetkov
5c041cb182 Kapt3: Remove source stubs together with the class files when .kt file is marked dirty (IC) 2017-05-04 19:59:29 +03:00
Yan Zhulanow
19c00abc62 Kapt3: Avoid annotation processing execution when possible (KT-17620)
Do not execute annotation processing if no stubs (and Java files) were changed since the previous execution.
2017-05-04 19:59:16 +03:00
Yan Zhulanow
c8d7c339cf Kapt3: Modify kapt incremental tests in order to support kapt3 2017-05-04 19:00:43 +03:00
Yan Zhulanow
c18bf5088d Kapt3: Support incremental compilation of Java stubs (KT-15151) 2017-05-04 19:00:42 +03:00
Yan Zhulanow
3bf534b392 Kapt3: Support apt modes
Allow to run kapt in "annotation processing only" and "stub generation only" modes in order to support incremental compilation in Gradle.
Unfortunately, annotation processing can't be done incrementally cause it uses all module files, but the stub generation can be done incrementally.
2017-05-04 19:00:41 +03:00
Yan Zhulanow
7a692b56f4 Add kapt3 module to non-compiler-tests 2017-05-04 18:46:44 +03:00
Yan Zhulanow
99a05f5d61 Kapt3: Convert reference to KMutableMap.Entry correctly (KT-17567) 2017-05-04 18:46:43 +03:00
Yan Zhulanow
254e8156ac NoArg: Initialize properties in noarg constructor (KT-16692) 2017-05-04 18:46:42 +03:00
Yan Zhulanow
eba5baa7ff Kapt3: Add Maven integration test 2017-05-04 18:46:41 +03:00
Anton Bannykh
7503376731 JS: unmute box/test/coroutinessuspendFunctionAsCoroutine/inlineTwoReceivers.kt 2017-05-04 16:47:00 +03:00
qx
a5dea7ef1c Fixes after review: used getParentOfType 2017-05-04 16:11:18 +03:00
qx
079380c70d Fixes after review: renamed to isMemberExtensionDeclaration 2017-05-04 16:11:18 +03:00
qx
0ba4a82ca6 Fixes after review: ConvertMemberToExtensionIntention.convert moved to companion object 2017-05-04 16:11:18 +03:00
qx
f163788821 Fixes after review: got rid of unused parameters 2017-05-04 16:11:17 +03:00
qx
f6fe1c50c2 Used ConvertMemberToExtensionIntention in MigrateExternalExtensionFix instead of manually creating extension method 2017-05-04 16:11:17 +03:00
qx
8ba61ce7aa Fixed KT-15270 Quickfix to migrate from @native*** 2017-05-04 16:11:17 +03:00
qx
11bc0d87b8 Fixes to AbstractQuickFixTest (full path to file and file separator)
The full path to file in getTestDataPath is necessary to show file diff link in exception when the test fails.
The File.separatorChar fixes tests on Windows machines.
2017-05-04 16:11:16 +03:00
qx
71de20b9e6 Retain javascript name from @native annotation
As the first part of KT-15257 JS: quickfix to migrate from @native to external
2017-05-04 16:11:16 +03:00
qx
c364e79557 Implemented @native-* annotation migration quickfix for extension functions
As the first part of KT-15270 Quickfix to migrate from @native***
2017-05-04 16:11:16 +03:00
Anton Bannykh
a71e5abb45 Update KotlinVersion.CURRENT to 1.1.4 2017-05-04 15:24:40 +03:00
Mikhail Glukhikh
1273166ed0 Do not report redundant else for enum / sealed from another module
Related to KT-17497
2017-05-04 14:17:43 +03:00
Mikhail Glukhikh
35754a98e7 KT-17497 related: introduce fix for REDUNDANT_ELSE_IN_WHEN 2017-05-04 14:17:42 +03:00
Mikhail Glukhikh
14886827a2 Introduce warning REDUNDANT_ELSE_IN_WHEN #KT-17497 Fixed 2017-05-04 14:17:41 +03:00
Mikhail Glukhikh
e53c548ead Consider property external if all accessors are external #KT-13997 Fixed 2017-05-04 14:17:40 +03:00
Mikhail Glukhikh
b8af0f5922 J2K: move isEffectivelyExternal to kt-file, parameter -> receiver 2017-05-04 14:17:38 +03:00
Dmitry Petrov
d5feb2d6f4 Deep copy fixes + sanitize file names for module dumps 2017-05-04 13:51:17 +03:00
Dmitry Petrov
506941e7e0 Optimize range operations for 'until' extension from stdlib (KT-9900)
NB: for-in-until loop is generated as precondition loop, because the
corresponding range is right-exclusive (and thus we have no problems
with integer overflows).
2017-05-04 10:09:42 +03:00
Dmitry Petrov
b83620fdb9 Minor: DeepCopyIrTree: make some utility methods 'protected' 2017-05-04 09:33:03 +03:00
Dmitry Petrov
e600a1af30 Minor: IrDeclarationOrigin.NEW_INSTANCE_RECEIVER -> INSTANCE_RECEIVER 2017-05-04 09:33:03 +03:00
Dmitry Petrov
1eb693b8ee Transform variable-as-function calls for extension functions
In the following code example
  fun test(f: Any.() -> Unit) = 42.f()
front-end resolves variable-as-function call for 'f' as 'invoke'
with signature 'Function1<Any, Unit>#Any.() -> Unit'.
However, Function1<Any, Unit> has a single 'invoke' method
with signature 'Function1<Any, Unit>#(Any) -> Unit'.
This didn't cause any problems with loosely typed JVM and JS back-ends.
However, in IR with symbols this means a reference to non-existing
declaration.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
7bd75df1f1 Minor: small refactorings in IrElementTransformerVoid 2017-05-04 09:33:03 +03:00
Dmitry Petrov
0203ba4dff Use stable order when generating stubs for scope members 2017-05-04 09:33:03 +03:00
Dmitry Petrov
40939da9fb Minor: DeclarationGeneratorExtension already extends Generator 2017-05-04 09:33:03 +03:00
Dmitry Petrov
17706d0fb6 Generate parameter declarations for synthetic members of enum classes 2017-05-04 09:33:03 +03:00
Dmitry Petrov
c4346f95ff Minor: fix testData format local delegated properties with 'suspend' 2017-05-04 09:33:03 +03:00
Dmitry Petrov
8b32d54a62 Minor: fix testData format for IR source range tests 2017-05-04 09:33:03 +03:00
Dmitry Petrov
78a601af87 Generate parameter declarations for fake overrides 2017-05-04 09:33:03 +03:00
Dmitry Petrov
fa4dc26814 Put 'thisReceiver' declaration in class
Interfaces also have 'thisReceiver'
2017-05-04 09:33:03 +03:00
Dmitry Petrov
90ec53b3b0 Generate catch-block body within proper scope 2017-05-04 09:33:03 +03:00
Dmitry Petrov
acefd0d891 Minor refactor and fix in Scope constructors 2017-05-04 09:33:03 +03:00
Dmitry Petrov
54294eaaa7 Minor fix and deprecation in DeepCopyIrTree 2017-05-04 09:33:03 +03:00
Dmitry Petrov
4dd199fedf OldDeepCopyIrTree --> DeepCopyIrTree (for migration) 2017-05-04 09:33:03 +03:00
Dmitry Petrov
d5fb0f3f32 Minor: simplify code in generateEnumConstructorCallOrSuperCall 2017-05-04 09:33:03 +03:00
Dmitry Petrov
aa515a9e5a Add test for outer class instance reference from inner class 2017-05-04 09:33:03 +03:00
Dmitry Petrov
5ec9cb3171 OldDeepCopyIrTree: old DeepCopyIrTree working with new IrElement hierarchy 2017-05-04 09:33:03 +03:00
Dmitry Petrov
b53807ab83 Drop IrBuiltinsOperatorsBuilder 2017-05-04 09:33:03 +03:00
Dmitry Petrov
de7b7ce6d5 Generate anonymous initializer body in separate scope 2017-05-04 09:33:03 +03:00
Dmitry Petrov
9c3387e174 Deprecate IrMemberFunctionBuilder 2017-05-04 09:33:03 +03:00
Dmitry Petrov
6f2c8140cf IrDelegatingConstructorCall should have substituted descriptor 2017-05-04 09:33:03 +03:00
Dmitry Petrov
6e79709ef1 Simplify helper methods in SymbolTable auxiliary classes 2017-05-04 09:33:03 +03:00
Dmitry Petrov
a511540aad Render receivers as 'this@owner: type'
Add test for generic inner class with generic outer class.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
1bf6f8fc57 Do not generate separate type parameter declarations for constructors 2017-05-04 09:33:03 +03:00
Dmitry Petrov
57b2a4461c Call IrSymbol.bind in declaration constructors 2017-05-04 09:33:03 +03:00
Dmitry Petrov
7995684d07 Bind declaration symbols in DeepCopyIrTree.
Check that symbols are properly bound.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
208bf5c667 Bind declaration symbols in DeepCopyIrTree.
Check that symbols are bound.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
a840cf7643 Fix source range tests: support "undefined" offsets 2017-05-04 09:33:03 +03:00
Dmitry Petrov
40e09a39c1 Fix prototype JVM BE tests 2017-05-04 09:33:03 +03:00
Dmitry Petrov
2b0d3440ad Descriptors in calls are substituted,
and symbols refer to the original descriptors.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
d7a362b4f6 Binding: all current tests are green. 2017-05-04 09:33:03 +03:00
Dmitry Petrov
00e4accb7b Add 'isBound' property to IrSymbol 2017-05-04 09:33:03 +03:00
Dmitry Petrov
2b48908586 Local delegated properties implementation + some more fixes 2017-05-04 09:33:03 +03:00
Dmitry Petrov
c9777fd79f Add symbols to references
TODO: fix some more tests
2017-05-04 09:33:03 +03:00
Dmitry Petrov
0595e93952 Use SymbolTable to create symbols for declarations
Introduce hierarchical sub-tables (for variables, type parameters, and value parameters).
First version passing all tests.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
209864e6a3 Minor: fix IrFunctionImpl#accept 2017-05-04 09:33:03 +03:00
Dmitry Petrov
7289903fa5 Introduce SymbolTable as a symbol factory and unbound symbols tracker 2017-05-04 09:33:03 +03:00
Dmitry Petrov
f96a21e899 Redo IrSymbol as a light-weight declaration reference
Strip it of any "useful" information but a reference to the corresponding
symbol owner (file or a declaration).
TODO: add that useful information to declarations.

NB not all IrDeclarations have IrSymbols (IrProperty doesn't - at least now).
2017-05-04 09:33:03 +03:00
Dmitry Petrov
b817638851 Add IrSimpleFunction : IrFunction
NB can't make 'override val descriptor: SimpleFunctionDescriptor' there,
because there are quite some FunctionDescriptors that are not
SimpleFunctionDescriptor, but actually belong to this category.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
a416cddcb2 Generate declarations for FAKE_OVERRIDE members 2017-05-04 09:33:03 +03:00
Dmitry Petrov
4ee1fb9309 Minor refactoring
- Get rid of IrClassImpl usages where IrClass is enough
- Use startOffsetOrUndefined / endOffsetOrUndefined
2017-05-04 09:33:03 +03:00
Dmitry Petrov
8cea27b5bb Generate IrTypeParameter and IrValueParameter declarations 2017-05-04 09:33:03 +03:00
Dmitry Petrov
03b664febd Insert implicit casts for default parameter values in IrValueParameter 2017-05-04 09:33:03 +03:00
Dmitry Petrov
77614a749b Minor: unnecessary overrides in IrBlockImpl 2017-05-04 09:33:03 +03:00
Dmitry Petrov
abb687aa7f Introduce IrTypeParameter and IrValueParameter declarations 2017-05-04 09:33:03 +03:00
Dmitry Petrov
c6b259c36c IrSymbol interface hierarchy, initial import
"Symbols" are (presumably simpler) alternative to descriptors, tailored
for IR-based back-end implementation.
2017-05-04 09:33:03 +03:00
Pavel V. Talanov
59012c0551 FakeFileForLightClass is not physical
Fix Spring tests
2017-05-03 21:38:49 +03:00
Pavel V. Talanov
9e25dfdd93 KtLightModifierList extends KtLightElementBase
Fix getContainingFile always returning null
2017-05-03 21:38:48 +03:00
Ilya Chernikov
25d2cc0279 Use invokeLater properly on scripts reconfiguration
Should fix #EA-97987
2017-05-03 18:11:48 +02:00
Ilya Chernikov
5745752841 Ignore empty lines at the end of the testdata, more tests
should finally fix source-section plugin tests on windows
2017-05-03 18:11:47 +02:00
Ilya Chernikov
732367e671 Pass earlier scripts as array, removes 255-lines repl limitation
fixes #KT-10060
2017-05-03 18:11:46 +02:00
Ilya Chernikov
15ccd28e2e Switch old IDE/CLI repls to the new infrastructure
should also fix #KT-5822
2017-05-03 18:11:45 +02:00
Ilya Chernikov
e384268c8b minor: unwrapping InvocationTargetException on repl line evaluation...
To provide better error diagnostics
2017-05-03 18:11:44 +02:00
Ilya Chernikov
8cc576d44f Add total reset to repl history and state interfaces 2017-05-03 18:11:43 +02:00
Ilya Chernikov
c746cae72d minor: add some generic repl tests...
in particular ignored test256Evals test that fails due to #KT-10060
2017-05-03 18:11:42 +02:00
Ilya Chernikov
f152af6385 minor: some repl cleanup 2017-05-03 18:11:41 +02:00
Mikhael Bogdanov
4e0bacab1e Add '/' to 'bin/java' path 2017-05-03 17:48:43 +02:00
Nikolay Krasko
d094854878 Better indentation for expressions without parsed errors (KT-12123)
#KT-12123 Fixed
2017-05-03 18:03:40 +03:00
Nikolay Krasko
c0b545085a Search statics java declarations through star imports 2017-05-03 18:03:39 +03:00
Nikolay Krasko
2d51d72708 Use classes to increase search pattern for static declarations
Static common names like 'INSTANCE', 'create' can give many irrelevant
references in the project.

#KT-17000 Fixed
#KT-14974 Fixed
2017-05-03 18:03:39 +03:00
Nikolay Krasko
7ee58be515 Don't fall back to full search because of reference in fqname 2017-05-03 18:03:39 +03:00
Nikolay Krasko
5cbc653f00 Avoid 'invoke' reference resolve because of references on the same range
When 'text' usages are being search, invoke reference in 'some(text)'
is considered relevant.
2017-05-03 18:03:39 +03:00
Nikolay Krasko
43d8a70ad3 Remove property accessor references from packages, imports and types 2017-05-03 18:03:39 +03:00
Nikolay Krasko
ba2f43ab78 Add caching for reference resolution in idea ResolveCache 2017-05-03 18:03:39 +03:00
Ilya Gorbunov
9953efc66b Clarify ReentrantReadWriteLock.write behavior regarding upgrade from read to write lock
#KT-17704 Fixed
2017-05-03 17:51:14 +03:00
Ilya Gorbunov
ef72371fd7 Add samples for contentToString and contentDeepToString array operations 2017-05-03 17:44:30 +03:00
Marek Langiewicz
934b0b8c38 Fix List.takeLast for lists without RandomAccess 2017-05-03 16:38:15 +02:00
Ilya Gorbunov
8da4839f22 Document IllegalArgumentException thrown from string-number conversion
functions when an invalid radix is specified
#KT-17635 Fixed
2017-05-03 17:32:49 +03:00
Alexey Andreev
cffdd3fd26 Add changelog for 1.1.3 2017-05-03 17:26:21 +03:00
Mikhael Bogdanov
84eeed51b1 Restore accidentally removed parameter index passing to call generator
Parameter index was removed in
 7690a8bc3e commit:
 "Get rid of redundant 'afterParameterPut' method from call generators"

  #KT-17653 Fixed
2017-05-03 12:56:15 +02:00
Igor Chevdar
962bce19a2 Enabled tests on coroutines for native 2017-05-03 10:42:07 +03:00
Dmitry Jemerov
7812a17f13 Mark Kotlin plugin as a JPS plugin so that JPS extensions are loaded
The Kotlin output parser for the Gradle build output in Android Studio
is loaded through the JPS extension manager, and the Kotlin JPS
plugin doesn't exist in Android Studio, so we need to use this
mechanism.

 #KT-17596 Fixed
2017-05-02 21:26:45 +02:00
Svetlana Isakova
191e0802e9 Added description for 'Name resolution and SAM conversion' 2017-05-02 21:14:48 +03:00
Mikhail Glukhikh
b5d0de7c3f Add test for KT-17479 looks like #KT-17479 Fixed
(after CAPTURED_MEMBER_VAL_INITIALIZATION introduction)
2017-05-02 19:59:43 +03:00
Mikhail Glukhikh
28283bad3e Introduce special CAPTURED_VAL_INITIALIZATION for members 2017-05-02 19:59:37 +03:00
Mikhail Glukhikh
56e633e345 CFA: detect captured writes more precisely
So #KT-14381 Fixed
So #KT-13597 Fixed
Also refactors captured writes detection inside DFA
2017-05-02 19:59:23 +03:00
Mikhail Glukhikh
8fa739ed0f Test for KT-14381 and KT-13597 2017-05-02 19:02:01 +03:00
Mikhail Glukhikh
fbc1d1a844 Clear var nullability in loops more accurately #KT-14977 Fixed 2017-05-02 19:01:48 +03:00
Mikhail Glukhikh
dc3ea4b6e4 Remove <Unknown Name> from module name rendering
Fixes failing multi-platform tests
2017-05-02 19:01:43 +03:00
Mikhail Glukhikh
1efa45f79e Minor: deprecation fix 2017-05-02 19:01:37 +03:00
Mikhail Glukhikh
0798e43524 Consider only source-compatible modules in allImplementingModules use-sites
So #KT-17400 Fixed
So #KT-15680 Fixed
So #KT-15660 Fixed
Likely also #KT-16838 Fixed
2017-05-02 19:01:31 +03:00
Pavel V. Talanov
956ace3463 Light classes: modifierList#findAnnotation does not trigger exact resolve 2017-05-02 15:40:22 +03:00
Pavel V. Talanov
57baaf2a50 Test no exact delegates were constructed during annotated element search
Add test case for aliased import
2017-05-02 15:40:21 +03:00
Pavel V. Talanov
ac92cf8bea Refactor: AnnotatedMembersSearchTest is now generated and J2K'ed 2017-05-02 15:40:21 +03:00
Pavel V. Talanov
55a0e138fc Refactor: extract AnnotationDescriptor.annotationClass utility 2017-05-02 15:40:20 +03:00
Pavel V. Talanov
7ef18fe5ba Tests: add some test cases for inheritor search
Refactor inheritor search tests to be generated
2017-05-02 15:40:19 +03:00
Pavel V. Talanov
178e59a6e8 LazyLightClassDataHolder: move internal members check to IDELightClassContexts#isDummyResolveApplicable 2017-05-02 15:40:18 +03:00
Pavel V. Talanov
0571c62943 KtLightElements: make light annotations lazier
Allow to get annotation list and to invoke `findAnnotation` without building delegate
Introduce KtLightNullabilityAnnotation which holds nullability information and is built
    before delegate is built
2017-05-02 15:40:17 +03:00
Pavel V. Talanov
03b68666e4 KtLightClassForSourceDeclaration: use psi based resolve to speedup isInheritor checks 2017-05-02 15:40:17 +03:00
Pavel V. Talanov
bdc4014ded Refactor: Introduce KtLightElementBase 2017-05-02 15:40:16 +03:00
Pavel V. Talanov
5346efae6e Minor: toString() in IDELightClassConstructionContext 2017-05-02 15:40:15 +03:00
Pavel V. Talanov
901aa9c18b PsiBasedClassResolver: use ImpreciseResolveResult instead of Boolean? 2017-05-02 15:40:14 +03:00
Pavel V. Talanov
8f4c969933 KtLightElement is no longer PsiNamedElement 2017-05-02 15:40:14 +03:00
Mikhail Glukhikh
04f7ba95c5 Add module name to HEADER_WITHOUT_IMPLEMENTATION message 2017-05-02 14:17:20 +03:00
Dmitry Petrov
6cefc0ddf3 Infer suspend flag for local delegated property accessors
Local delegated property accessors calling suspend operators getValue
or setValue should be suspend functions themselves.

KT-17605 Getter and setter of suspend delegated property are not suspend
2017-05-02 12:52:36 +03:00
Alexander Udalov
0624854d5a Fix compilation of kotlin-gradle-plugin
The "ClassReader(InputStream)" constructor is stripped from
kotlin-compiler by proguard, so use the "ClassReader(ByteArray)"
constructor instead
2017-04-29 18:43:58 +03:00
Alexander Udalov
e79fdbe5e8 Gradle: print version loaded from environment's compiler jar
And not from the KotlinCompilerVersion class that is accessible in the
current version of kotlin-gradle-plugin, because the version of the
compiler might be different
2017-04-28 20:56:14 +03:00
Alexander Udalov
fcf44af294 Change how kotlinc and tools display their version
- Display the Kotlin version in kotlin-gradle-plugin. This is needed
  because if "-version" is specified in compiler arguments, the "info"
  level of the message printed by the compiler in CLICompiler prevents
  it from being displayed by default (unless "--debug" is passed to
  Gradle).
- Display the version of JRE the compiler is running on. This will be
  helpful to diagnose Java 9 related issues in the future.
- In CLI, also display the executable name (kotlinc-jvm or kotlinc-js)
2017-04-28 20:49:54 +03:00
Alexander Udalov
bb01ca038a Improve messages printed by JPS plugin in Messages view
- Don't print "Loaded plugin: KotlinAndroidJpsPlugin" and "Using
  kotlin-home = ..." for every build. They are rarely useful; they can
  be found in the build log now
- Instead of potentially confusing for the user "Kotlin JPS plugin
  version ..." output simply "Kotlin version ...". Also add the version
  of the JRE, where the compiler is being run
- Do not treat messages reported with severity LOGGING as BuildMessage
  with kind PROGRESS. Such build messages are displayed to the user in
  the progress/status bar when IDEA Make process is running, but LOGGING
  messages never had this meaning. In particular, users could be
  confused by the progress bar message "Kotlin: Configuring the
  compilation environment" visible for a very long time during
  compilation. This message just happens to be the last LOGGING message
  reported by the compiler before the actual compilation; its presence
  there created an illusion that Kotlin spends most of the time
  configuring the compilation environment

 #KT-17387 Fixed
2017-04-28 20:49:29 +03:00
Alexander Udalov
d8d3bafbe9 Introduce "-Xreport-output-files" to report source-output mapping for JPS
This makes "-verbose" not required for JPS to run correctly and
therefore allows to print more useful debugging stuff in the compiler
and read them in CLI, for example. The output will also be more readable
because there'll be no "output" messages
2017-04-28 20:49:28 +03:00
Yan Zhulanow
ce145c015d Android Extensions: rename plugin JAR file names in plugin artifact
Rename compiler plugin to 'android-extensions-compiler' in order to have the same name in dist and IDEA plugin.
Rename IDEA plugin to 'android-extensions-ide' to make things clear.
2017-04-28 19:43:36 +03:00
Mikhail Glukhikh
d0da11321d Fix of SpringInspectionTestGenerated 2017-04-28 18:22:21 +03:00
Alexander Udalov
5bd3716637 Fix compilation of kotlin-maven-plugin and kotlin-script-util 2017-04-28 16:31:11 +03:00
Zalim Bashorov
87db245dd8 KJS: fix JS backend tests on windows 2017-04-28 16:17:02 +03:00
Vyacheslav Gerasimov
e841fceea0 Update changelog for 1.1.2-2 2017-04-28 16:12:39 +03:00
Simon Ogorodnik
9a969b0449 Add basic completion for operator fun names
#KT-11250 fixed
2017-04-28 15:06:27 +03:00
Mikhail Glukhikh
0e7753df3a Added tests forgotten by alexey andreev 2017-04-28 13:37:24 +03:00
Mikhael Bogdanov
a7c9e14805 Don't generate default arguments for inline call 2017-04-28 12:19:09 +02:00
Mikhael Bogdanov
7690a8bc3e Get rid of redundant 'afterParameterPut' method from call generators 2017-04-28 12:19:09 +02:00
Mikhael Bogdanov
b440561f5c Generate default arguments and varargs lazily
The aim to perform optimizations in call generators
2017-04-28 12:19:08 +02:00
Mikhael Bogdanov
02cc5f6bc1 Expand default parameters conditions on inlining default function
#KT-14564 Fixed
 #KT-10848 Fixed
 #KT-12497 Fixed
2017-04-28 12:19:07 +02:00
Dmitry Jemerov
d49e9d7064 Fix override navigation from properties defined in primary constructor
EA-91185 - CCE: KotlinLineMarkerProviderKt$OVERRIDDEN_PROPERTY$.browse
2017-04-28 12:02:20 +02:00
Dmitry Jemerov
c22e0d88f0 More generic solution for testing line marker navigation 2017-04-28 12:02:19 +02:00
Dmitry Jemerov
f9bca06e33 AbstractLineMarkersTest: J2K 2017-04-28 12:02:19 +02:00
Dmitry Jemerov
18a065865b AbstractLineMarkersTest: rename to .kt 2017-04-28 12:02:19 +02:00
Dmitry Jemerov
d46f222a12 Don't try to store "is Kotlin" state for non-local jars (EA-80264) 2017-04-28 12:02:19 +02:00
Dmitry Jemerov
184ff9542c Add missing case to DECLARATION_NAME_WITH_KIND renderer (EA-100667) 2017-04-28 12:02:19 +02:00
Mikhail Glukhikh
b58c512f7b Fix broken parameter info test: add WITH_RUNTIME 2017-04-28 11:32:30 +03:00
Mikhail Glukhikh
9fca7e814f Test refactoring: extract common parts from inspection tests 2017-04-28 10:56:08 +03:00
shiraji
6f94f45409 Disable "Make constructor internal" for annotations #KT-17599 Fixed 2017-04-28 10:55:13 +03:00
shiraji
d542aef7e4 Disable "Make constructor private" for annotations #KT-17600 Fixed 2017-04-28 10:54:54 +03:00
Alexey Andreev
c8c3d24b45 Fix non-suspending labeled loop in suspend function
Fix bug when labeled loop, which does not contain suspend calls
in its body, was losing its label
2017-04-28 10:52:14 +03:00
Alexey Andreev
6047746c90 Fix optimization in JS BE
Don't apply while condition folding when corresponding break
statement breaks outer loop.
2017-04-28 10:52:13 +03:00
Alexey Andreev
d89ce80d97 Fix temporary variable elimination in JS BE
Don't eliminate temporary variable when between its usage and its
definition there's assignment to a non-local variable.

Fix KT-17540
2017-04-28 10:51:30 +03:00
Ilya Gorbunov
8d0eb207e3 Do not hardcode kotlin version in one of maven integration tests 2017-04-27 23:35:18 +03:00
Ilya Gorbunov
71636aec41 Share run configuration to regenerate sources, share vcs and issue tracker settings 2017-04-27 23:34:58 +03:00
Ilya Gorbunov
a50c2ff0a5 Upgrade kotlin gradle plugin used to build libraries to 1.1.2 2017-04-27 21:59:46 +03:00
Mikhail Glukhikh
19021ec1aa VarianceChecker refactoring: move checkClassOrObject to IDE 2017-04-27 20:58:40 +03:00
Mikhail Glukhikh
b66401a41d Variance checker: add check for nested local / anonymous classes
So #KT-16136 Fixed
2017-04-27 20:58:39 +03:00
Dmitry Neverov
9dd217eee3 Introduce intention to name anonymous parameter #KT-17191 Fixed 2017-04-27 20:58:38 +03:00
Mikhail Glukhikh
bc071bf543 Add parameter info test for #KT-14484 Obsolete 2017-04-27 20:58:36 +03:00
Alexander Udalov
c92aa1a62d Fix test data in incompleteHierarchyInJava test
This likely started to behave differently since d65af8f9
2017-04-27 20:52:33 +03:00
Alexander Udalov
82e6324c45 Support compilation against modular JDK (9+)
For more information about the "jrt" file system, see
http://openjdk.java.net/jeps/220 and
https://bugs.openjdk.java.net/browse/JDK-8066492.

This commit fixes DiagnosticsWithJdk9TestGenerated.testKt11167

 #KT-11167 Fixed
2017-04-27 20:48:24 +03:00
Alexander Udalov
a519ab681a Add diagnostic tests against Java 9
These tests currently won't run if you don't have environment variable
JDK_9 set up
2017-04-27 20:35:14 +03:00
Alexander Udalov
7f5d87ea17 Rename PathUtil.getJdkClassesRoots to avoid confusion
Two of these methods return roots given a path to the JRE, and the third
one returns roots given a path to the _JDK_.
2017-04-27 20:35:14 +03:00
Alexander Udalov
15efbcae02 Use Class->KClass cache in Class.kotlin extension
#KT-17594 Fixed
2017-04-27 20:34:45 +03:00
Mikhail Zarechenskiy
fcf70fda22 Fix exception when classes erroneously have no name
#KT-16775 Fixed

 Exception appears because of different representation of classes without name. For Kotlin we load them with `SpecialNames.NO_NAME_PROVIDED`, but for Java (for light classes) with `SpecialNames.safeIdentifier`
2017-04-27 18:57:45 +03:00
Yan Zhulanow
4b072d59ac Minor: Fix test for Android illegal identifiers 2017-04-27 18:52:13 +03:00
Yan Zhulanow
14fde339ef Minor: Fix Android JPS test 2017-04-27 18:52:12 +03:00
Yan Zhulanow
8354d25800 Android Extensions: Fix availability in Android/JPS projects (KT-17610) 2017-04-27 18:52:11 +03:00
Yan Zhulanow
63243b99fa Kapt3: Check if the 'tools.jar' is present in the plugin classpath (KT-17456)
Kapt3 won't work without the 'tools.jar' file provided, but we shouldn't throw an exception in this case.
This commit adds the warning message (and disables Kapt if it can't be used).
2017-04-27 18:52:10 +03:00
Yan Zhulanow
20e362e363 Kapt3: Do not generate "options not recognized" for "kapt.kotlin.generated" option (KT-17418)
"kapt.kotlin.generated" AP option is always present (and it's the way to say the arbitrary processors about the target directory for generated Kotlin source files).
In this commit, the "fake" empty annotation processor is added to consume the option if no other processor does it.
2017-04-27 18:52:09 +03:00
Denis Zharkov
c970763a7f Fix callable reference resolution regression
The regression appeared after
b5a8ffaddc
when we started trying both static and member methods until
first success and when there is no successful
we were just leaving the last one (e.g. private member)

But the actual problem is that we were commiting the trace
in case of single (but incorrect) result in resolution mode of
SHAPE_FUNCTION_ARGUMENTS when we couldn't yet choose the
correct static method

Also we shouldn't choose a shape for callable reference
using only the knowledge that result is single:
it may lead to the wrong inference result
(see test with Pattern::compile)

 #KT-17597 Fixed
2017-04-27 18:38:10 +03:00
Mikhail Glukhikh
4b6667f599 Make IntentionBasedInspection deprecated 2017-04-27 18:21:39 +03:00
Mikhail Glukhikh
bb8091a6ca KT-17503 add check whether callable reference is acceptable in lambda 2017-04-27 18:21:33 +03:00
shiraji
0eceef1519 Add inspection to detect use of callable reference as a lambda body
So #KT-17053 Fixed
2017-04-27 18:21:27 +03:00
Mikhail Glukhikh
53e11cbeb5 Create test group: AbstractLocalInspectionTest
Goal is to have inspection tests that work on per-file per-case basis
Test group allow both inspection message control and local fixes control
2017-04-27 18:21:15 +03:00
Simon Ogorodnik
de66f76299 Fix regression of sample resolution in library sources
Use hack to answer package questions
 #KT-17448 fixed
2017-04-27 16:53:07 +03:00
Ilya Gorbunov
99504eb753 Support rendering receiver parameters
Otherwise generated coroutine implementation class could not be rendered since one of its members corresponds to receiver parameter descriptor.
2017-04-27 16:38:25 +03:00
Vyacheslav Gerasimov
5f09e18394 Fix Android api issues reporting for generic collection method calls
#KT-16712 Fixed
2017-04-27 16:02:37 +03:00
Vyacheslav Gerasimov
9552666aa6 Use platform-25 for android tests
Add Android platform-25 to dependencies
Update platform tools to 25.0.3
2017-04-27 16:02:37 +03:00
Mikhail Zarechenskiy
7af10769c9 Enable control flow checks for functions without body
Except checks for tail recursive calls

 #KT-7796 Fixed
2017-04-27 15:50:18 +03:00
Mikhail Zarechenskiy
a0d7b703f4 Align generic signature for inner classes to work as in Java
#KT-10397 Fixed

According to JVMS (p. 4.3.4) inner classes should be separated with `$` in generic signature.

Note that in Java, inner types separated with `.` after first parameterized type, and now we preserve the same behaviour. See tests for clarification.
2017-04-27 15:47:28 +03:00
Mikhail Glukhikh
14e798a1fc Take imported from object descriptor into account in pseudocode
So #KT-15566 Fixed
2017-04-27 15:27:41 +03:00
Alexander Udalov
056eebf69c Update list of excluded directories in root module 2017-04-27 12:38:01 +03:00
Ilya Matveev
935d42f8ac Ignore explicitEqualsOnDouble.kt box-test for native backend 2017-04-27 14:55:32 +07:00
Dmitry Jemerov
75a1e8f0a2 Don't show hint for parameter with explicitly specified type 2017-04-26 18:23:45 +02:00
Dmitry Jemerov
7973e033a9 Initial tests for type hints; don't show hint when type is obvious 2017-04-26 18:23:41 +02:00
Dmitry Jemerov
d1cdd6d8ed Separate logic for argument name hints and type hints 2017-04-26 18:23:16 +02:00
Dmitry Jemerov
108e97b70e Show parameter hints for ambiguous calls 2017-04-26 18:21:19 +02:00
Dmitry Jemerov
26445397bb Add varargs tests; show ... before vararg arguments 2017-04-26 18:09:13 +02:00
Dmitry Jemerov
c9639f6ae0 Port some Java tests for parameter hints; fix detected issues
Show hints for string templates; correctly apply blacklist for
constructor calls
2017-04-26 18:09:13 +02:00
Dmitry Jemerov
760e43d4f1 Include in MethodInfo only names of arguments actually in the call
Needed to apply blacklist for e.g. startsWith more correctly.
2017-04-26 18:09:13 +02:00
Dmitry Jemerov
aad79f4d63 Fix blacklist application by returning parameter names correctly 2017-04-26 18:09:13 +02:00
Dmitry Jemerov
d8f16c0464 Disable inlay type hints by default 2017-04-26 18:09:12 +02:00
Dmitry Jemerov
6cda992204 Separate options for showing types of local vars and properties 2017-04-26 18:09:12 +02:00
Dmitry Jemerov
0132b643ec Show function return type hint in the end of parameter list 2017-04-26 18:09:12 +02:00
Dmitry Jemerov
8508b8b397 Show parameter hints only before unclear expressions, as in Java 2017-04-26 18:09:12 +02:00
fitermay
8b3f8ce750 Inlay param/type support for kotlin 2017-04-26 18:09:12 +02:00
Vyacheslav Gerasimov
49c8dfbb06 Add gutter icons for Android resource references
#KT-16843 Fixed
2017-04-26 18:38:29 +03:00
Vyacheslav Gerasimov
386ec53dd5 Update AndroidTestCase to AS 2.3 + Android tests refactoring 2017-04-26 18:38:29 +03:00
Alexander Udalov
e2c62cbded Support serialization of built-in ranges as error types
This will be needed to move ranges and progressions out of builtins.
Currently they're only used in signatures of "rangeTo" functions on
primitives
2017-04-26 18:10:54 +03:00
Alexander Udalov
f648f0235c Move ErrorUtils.ErrorTypeImpl to top level ErrorType and J2K 2017-04-26 18:10:53 +03:00
Alexander Udalov
38ea9986ab Make KotlinType.isError extension instead of member 2017-04-26 18:10:49 +03:00
Mikhail Glukhikh
787a32f4f1 KT-17408 related: fix of two broken tests 2017-04-26 17:31:46 +03:00
Stanislav Erokhin
dce373b807 Create special data flow info for ControlStructure. It will be used in new inference for special calls. 2017-04-26 13:47:53 +03:00
Stanislav Erokhin
dbe867e2c0 Minor. Change upper bound for collection of given candidates. 2017-04-26 13:47:52 +03:00
Stanislav Erokhin
1af733da05 Added isAllowedTypeVariable inside KotlinTypeChecker 2017-04-26 13:47:51 +03:00
Stanislav Erokhin
53ccfcf195 Add util functions getKPropertyType for both receivers and isNumberedKFunction 2017-04-26 13:47:50 +03:00
Stanislav Erokhin
22e667ad65 Removed generic hell from tower resolver 2017-04-26 13:47:49 +03:00
Stanislav Erokhin
863b9f7603 Minor. Change parameter type from Set to Collection. 2017-04-26 13:47:48 +03:00
Stanislav Erokhin
83a82cdd04 Refactoring. Remove descriptor from resolution Candidate. 2017-04-26 13:47:47 +03:00
Zalim Bashorov
794e65b5d6 KJS: remove Rhino library 2017-04-26 13:07:35 +03:00
Zalim Bashorov
fb1c4320b6 KJS: check hashCode property only for objects to avoid extra boxing for primitive values
Also in Nashorn everything has hashCode including primitive types,
so the result can be different at Nashorn and at other engines.
2017-04-26 13:07:34 +03:00
Zalim Bashorov
678d2e7c21 KJS: transform labeled blocks to labeled do-while
It's a workaround for JDK-8177691.
Such code can appear during inline.
2017-04-26 13:07:33 +03:00
Zalim Bashorov
76fa6ad5c2 KJS: switch to using Nashorn instead of Rhino for JS backend tests 2017-04-26 13:07:30 +03:00
Dmitry Petrov
a39a0abb2a Traverse store-load chains for POP instructions
POP instructions can be only live usages for functional parameters,
e.g., when corresponding invoke is in dead code (KT-17591).
2017-04-26 12:42:45 +03:00
Dmitry Petrov
fe571a7dfa Normalize local returns before other inlining transformations
Local returns normalization can generate POP instructions.
These POP instructions can drop functional parameters, as in KT-17590,
and should be processed in markPlacesForInlineAndRemoveInlinable just
as other POP instructions.

KT-17590 conditional return in inline function parameter argument causes compilation exception
2017-04-26 12:42:33 +03:00
Dmitry Petrov
996a08a3f7 Add tests with loop in store-load chains on noinline function parameters 2017-04-26 12:42:33 +03:00
Dmitry Petrov
e1731373d8 Do not restore stack in default handler for try-finally
It never terminates, so the corresponding value on stack can't be used.
However, if this happens in an inlined lambda argument, the inliner is
unable to remove the corresponding ALOAD instruction (because default
handler never terminates, and thus corresponding ALOAD is not used for
lambda invocation).

KT-17573 try-finally expression in inlined function parameter argument fails with VerifyError
2017-04-26 12:42:33 +03:00
Dmitry Petrov
e91f4cf65a Print generated text to System.err in failed DxChecker.check
Otherwise it can mix with exception from test.
2017-04-26 12:42:33 +03:00
Dmitry Petrov
08fb9c2122 Traverse multiple store-load chains for inlined lambda parameters
When a try-catch expression is passed as an argument to the inline
lambda parameter, lambda variable on stack is spilled and restored in
several different locations (1 for try-block, 1 for each catch-blocks).
So it's possible that lambda to be invoked comes from multiple loads,
all of which should have the same "root" lambda parameter.
2017-04-26 12:42:33 +03:00
Dmitry Petrov
441be56a40 During inlining, remove POP instructions popping inlined lambdas
In cases like KT-17384, where 'break' or 'continue' happens in an argument
to an inlined lambda call, fix-stack transformation sees corresponding
ALOAD for lambda, and inserts corresponding POP instruction before jump.
However, this ALOAD is later removed during inlining.
So, we should also remove the related POP instructions.
2017-04-26 12:42:33 +03:00
Alexey Andreev
38aecb14a2 Improve Number.hashCode implementation in JavaScript
Fix KT-13577
2017-04-26 11:52:54 +03:00
Vyacheslav Gerasimov
c0542f7dc0 Remove from changelog items about multiplatform 2017-04-26 11:29:45 +03:00
Dmitry Neverov
f84c5b0339 Do not suggest 'Convert to secondary constructor' for annotation classes
#KT-17408 Fixed
2017-04-26 06:37:30 +02:00
Zalim Bashorov
d5867c1ee3 Changes in list of files which size is printed for TeamCity statistics
Fix path to kotlin.meta.js;
Add kotlin-test.js to list.
2017-04-25 22:40:16 +03:00
Vyacheslav Gerasimov
a8227461f1 Prettify changelog for 1.1.2 again 2017-04-25 17:29:19 +03:00
Vyacheslav Gerasimov
3c1ff566c5 Prettify changelog for 1.1.2 2017-04-25 16:57:01 +03:00
Kirill Rakhman
76507caf4b Add intention to convert concatenation to raw string #KT-17503 Fixed 2017-04-25 16:43:52 +03:00
Alexey Tsvetkov
50085722d1 Fix internal visibility check for deserialized typealiases
#KT-15495 fixed
2017-04-25 16:27:23 +03:00
Mikhael Bogdanov
b9409523b0 Fix for KT-17588: Compiler error while optimizer tries to get rid of captured variable
#KT-17588 Fixed
2017-04-25 15:06:41 +02:00
Simon Ogorodnik
6e8406f73c Fix completion of 'else' keyword
#KT-14665 fixed
2017-04-25 14:44:24 +03:00
Simon Ogorodnik
bd2ad6a089 Tweak keyword completion for lateinit and companion object
#KT-13673 fixed
 #KT-12293 fixed
2017-04-25 14:42:50 +03:00
Alexey Andreev
3fb15a4423 Fix iml file of js.serializer module 2017-04-25 13:31:26 +03:00
Mikhail Zarechenskiy
63d015ec70 Merge pull request #1055 from JetBrains/rr/matveev
Ignore native backend in some box tests
2017-04-25 11:42:51 +03:00
Mikhael Bogdanov
9d021ee1ac Add infrastructure to run codegen test on jdk 6
Perform actual codegen test execution in separate process.
One server process is used to run all codegen tests
through socket connection.
2017-04-25 09:31:17 +02:00
Dmitry Petrov
1ee337d976 Optimize iteration over CharSequence's on JVM
KT-7931 Optimize iteration over strings/charsequences on JVM
2017-04-25 10:07:05 +03:00
Dmitry Petrov
bc1e1515fd Move for-loop generators out of ExpressionCodegen, convert them to Kotlin 2017-04-25 10:07:05 +03:00
Sergey Mashkov
e03a842317 KT-15050 Use more stable way to specify idea compatible version
Here we have to specify build number static field
 as system properties are out of our control
 and they could be wiped out externally

#KT-15050 Fixed
2017-04-25 01:56:08 +03:00
Pavel V. Talanov
f3dd09beaf Lighter classes: DeprecationLevel.HIDDEN affects codegen 2017-04-24 20:55:50 +03:00
Pavel V. Talanov
337eb883b3 IDELightClassContexts: Use CallResolver to resolve relevant annotation calls
Drop code that made decisions based on text
Use CallResolver directly to avoid calling TypeResolver which only returns error types in ad hoc resolve
2017-04-24 20:55:49 +03:00
Pavel V. Talanov
46c6aaddeb Light classes: do not try to build lighter classes if failed once
Avoid multiple exceptions thrown and analysis being unable to complete
2017-04-24 20:55:48 +03:00
Alexey Sedunov
a8c57f11af Move: Implement more accurate 'protected' visibility check
#KT-17545 Fixed
2017-04-24 20:52:12 +03:00
Alexey Sedunov
480982b690 Shorten References: Wrap elements to shorten in smart pointers
#KT-17526 Fixed
2017-04-24 20:52:11 +03:00
Alexey Sedunov
c690761715 Move: Do not process imported references when moving entire file
#KT-17538 Fixed
2017-04-24 20:52:10 +03:00
Alexey Sedunov
eab6c024c2 Move: Warn about moving to non-Kotlin class
#KT-17472 Fixed
2017-04-24 20:52:09 +03:00
Alexey Sedunov
d71b02f972 Move: Improve filtering in "Move nested class" dialog member list
Do not suggest inner classes and companion objects
 #KT-17515 Fixed
2017-04-24 20:52:08 +03:00
Simon Ogorodnik
3acebc3001 Fix KNPE in KotlinAddImportActionKt.createSingleImportActionForConstructor
#KT-17525 fixed
2017-04-24 19:18:13 +03:00
Alexey Andreev
0d7b39eb57 JS: minor code cleanup 2017-04-24 18:39:04 +03:00
Alexey Andreev
feb968e66d JS: fix generation of names for local declarations
Local declarations obtain names prefixed with outer function's name.
Only simple name (i.e. without mangling) of outer function used
in this case. This raises a problem in case of inline functions
with object literals. Currently, they are not copied, but exported
from module. Consider two inline functions foo with different
signatures, both declare object literals. In this case both literals
are exported as foo$f, so only one will be accessible from outside.
2017-04-24 18:39:04 +03:00
Alexey Andreev
88cf37951b JS: always create aliases for function parameters
This is required to make translateAndAliasParameters
behaviour a little more clear.
Also, fix destructuring declaration translator to use parameter aliases
from TranslationContext, when possible.
2017-04-24 18:39:04 +03:00
Alexey Andreev
524dd122e7 JS: move deserialization logic out of createTopDownAnalyzerForJs
Remove code that deserializes unchanged descriptors from
`createTopDownAnalyzerForJs`, deserialize in caller instead.
2017-04-24 18:39:03 +03:00
Alexey Andreev
df46417cd7 JS: fix NPE in incremental compilation
Fix NPE when compiling project incrementally and a file which
is not recompiled contains try/catch statement
2017-04-24 18:39:03 +03:00
Alexey Andreev
f916d83978 JS: replace consumer in with returning value
Refactor some utility functions that take consumer of JsStatement
to return actual statements, so that caller now responsible
for putting these statements to corresponding lists.
2017-04-24 18:39:02 +03:00
Alexey Andreev
a055a038a8 JS: minor fixes after rebasing
Multiple minor fixes after rebasing incremental compilation related
branch to actual master
2017-04-24 18:39:02 +03:00
Alexey Andreev
1c2120d7e2 JS: avoid repeated export of the same declaration 2017-04-24 18:30:42 +03:00
Alexey Andreev
dd43d0a9e0 JS: don't use wrapper messages for string, int and double literals. This allowed to decrease binary AST size of stdlib from 2659138 bytes to 2642908 bytes 2017-04-24 18:30:41 +03:00
Alexey Andreev
f4a9b99e4d JS: fix incremental generation of source maps 2017-04-24 18:30:38 +03:00
Alexey Andreev
0058d2fdf6 JS: add some tests to ensure that AST metadata is correctly serialized and deserialized and visible to JS optimizer 2017-04-24 18:29:52 +03:00
Alexey Andreev
80c1ac8b1b JS: don't generate metadata for fragments when fragment serialization is turned off 2017-04-24 18:29:51 +03:00
Alexey Andreev
85bd380373 JS: fix performance regression caused by changing approach to detection of main and test function from PSI-based to descriptor-based 2017-04-24 18:29:50 +03:00
Alexey Andreev
dc1ce0e8b5 JS: replace declareFreshName with declareTemporaryName in inliner, get rid of scopes where possible 2017-04-24 18:29:50 +03:00
Alexey Andreev
22f24d13b9 JS: transform coroutines before serializing AST to binary format 2017-04-24 18:29:49 +03:00
Alexey Andreev
02ca374dc9 JS: fix inlining in incremental compilation 2017-04-24 18:29:48 +03:00
Alexey Andreev
c85108602a JS: add tests for recompilation of only some files in a project 2017-04-24 18:29:46 +03:00
Alexey Andreev
49dacfcd76 JS: add metadata to AST serialization/deserialization 2017-04-24 18:29:19 +03:00
Alexey Andreev
8d2eb344ff JS: add AST deserializer 2017-04-24 18:29:18 +03:00
Alexey Andreev
4d3a86a183 JS: add AST serializer 2017-04-24 18:29:17 +03:00
Alexey Andreev
83df21329f JS: add protobuf declarations for JS AST 2017-04-24 18:29:17 +03:00
Alexey Andreev
df4c7048d0 JS: do not create duplicate local variables for packages 2017-04-24 18:29:16 +03:00
Alexey Andreev
cb8189989c JS: optimize removeUnusedFunctionDefinitions 2017-04-24 18:29:15 +03:00
Alexey Andreev
a1780234ee JS: when compiling stdlib, prevent builtin class from import when the same class is declared in compiled module 2017-04-24 18:29:14 +03:00
Alexey Andreev
f82f5d0471 JS: add tests for private external declarations 2017-04-24 18:29:13 +03:00
Alexey Andreev
8d2dac4577 JS: fix generation of main call and test run 2017-04-24 18:29:13 +03:00
Alexey Andreev
5b34ff8fa4 JS: don't generate inner name for class functions. Looks like this is not necessary. However, it breaks new pipeline when generating class members, since two distinct names are generated (inner and outer) for one declaration and that confuses Merger 2017-04-24 18:29:12 +03:00
Alexey Andreev
c1627e840b JS: use eval instead of js in tests to refer local declarations to avoid renaming by resolveTemporaryNames 2017-04-24 18:29:12 +03:00
Alexey Andreev
ce1eabdf6f JS: generate name table entries for non-internal name so that Merger could merge them in a single JsName. It is required for inlining to properly work on non-toplevel declarations between different files. 2017-04-24 18:29:11 +03:00
Alexey Andreev
ee1e0fc0b1 JS: minor optimization: when attempting to set default value to MetadataProperty, remove value from underlying map 2017-04-24 18:29:11 +03:00
Alexey Andreev
ecdf8a9985 JS: import external declarations, reference them by aliases, not by FQN 2017-04-24 18:29:10 +03:00
Alexey Andreev
435be921f2 JS: when generating class, translate reference to its parent, so that fragment can import corresponding declaration 2017-04-24 18:29:10 +03:00
Alexey Andreev
7d3e3c0299 JS: de-duplicate temporary names in some cases to allow name resolution to make its work better 2017-04-24 18:29:09 +03:00
Alexey Andreev
9e0a06a4aa JS: refactor JsScope, JsName and related things, since it's became unnecessary to track scopes and declaration order of temporary JsName's 2017-04-24 18:29:09 +03:00
Alexey Andreev
9530ce6c26 JS: when resolving temporary functions, don't rely on JsScope hierarchy, build this hierarchy instead, based on scoping rules for function, var, etc expressions 2017-04-24 18:29:08 +03:00
Alexey Andreev
a6bb5743db JS: include expandIsCalls in new translator pipeline 2017-04-24 18:29:08 +03:00
Alexey Andreev
714cb60375 JS: support bridges and copying of non-abstract methods of interfaces in new pipeline 2017-04-24 18:29:07 +03:00
Alexey Andreev
83140bc5f7 JS: support inlining in new pipeline 2017-04-24 18:29:07 +03:00
Alexey Andreev
a414cd64c5 JS: support module imports in new pipeline 2017-04-24 18:29:06 +03:00
Alexey Andreev
2354adfa22 JS: support class prototypes in new pipeline 2017-04-24 18:29:06 +03:00
Alexey Andreev
108fcba885 JS: support imports in new pipeline 2017-04-24 18:29:05 +03:00
Alexey Andreev
6711db86ee JS: reworking translator pipeline to generate multiple fragment each for source file 2017-04-24 18:29:05 +03:00
Alexey Andreev
e909ef984c JS: prepare all necessary abstractions for new pipeline 2017-04-24 18:29:04 +03:00
Zalim Bashorov
56810c5100 KJS: cleanup RhinoUtils and remove obsolete rhino result checkers 2017-04-24 17:59:10 +03:00
Zalim Bashorov
25dd31a2e0 KJS: introduce new base class WebDemoExamples* tests 2017-04-24 17:59:08 +03:00
Zalim Bashorov
e1cf6445ee KJS: make OutputPrefixPostfixTest generated and migrate to BasicBoxTest 2017-04-24 17:59:08 +03:00
Zalim Bashorov
030809e3b1 KJS: add generateNodeJsRunner flag to BasicBoxTest to control the generating files for node.js runner 2017-04-24 17:59:07 +03:00
Zalim Bashorov
41ce3936fc KJS: move some "static" properties of BasicBoxTest to its companion object 2017-04-24 17:59:07 +03:00
Zalim Bashorov
7eb882ed27 KJS: switch sourcemap tests to generated using BasicBoxTest 2017-04-24 17:59:07 +03:00
Zalim Bashorov
725b0100e2 KJS: remove useless StdLibTest 2017-04-24 17:59:06 +03:00
Denis Zharkov
62a55b7b00 Fix false-positive resolution ambiguity when using akka
com.typesafe.akka:akka-cluster-sharding_2.12:2.5
akka.cluster.sharding.ClusterSharding  has the following methods:

    public static ClusterSharding get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

    public static Extension get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

NB: ClusterSharding  <: Extension
None of these methods is synthetic or something, but javac allows
calls like ClusterSharding.get(null)  and they get resolved
to the first method returning ClusterSharding

It seems that both javac and IntelliJ resolution algorithms filter out
such clashing declarations choosing the one that has the most
specific return type, the same idea is applied in the change

 #KT-17560 Fixed
2017-04-24 17:54:01 +03:00
Denis Zharkov
40e1d5bc23 Optimize KtFile::isScipt/getScript when file is not kts
`isScript` gets invoked for each call
(see org.jetbrains.kotlin.resolve.calls.CandidateResolver#checkOuterClassMemberIsAccessible)

And currently it may work for O(|top-level-declarations|),
that is rather slow e.g. for native stubs for gtk

 #KT-17562 Fixed
2017-04-24 17:53:20 +03:00
Ilya Chernikov
af4caeaf24 Ignore empty lines at the end of the testdata, remove debug dump
should fix source-section plugin tests on windows
2017-04-24 16:50:19 +02:00
Alexey Sedunov
fd41e266fb Quick Fixes: Add/remove 'suspend' in hierarchy
#KT-15903 Fixed
2017-04-24 14:55:37 +03:00
Vyacheslav Gerasimov
0d32ac924a Update 1.1.2 changelog 2017-04-24 14:07:49 +03:00
Ilya Matveev
629be10a53 Ignore native backend in some box tests 2017-04-24 17:43:14 +07:00
Anton Bannykh
0db3649da1 Added EnvironmentConfigFiles.NATIVE_CONFIG_FILES for Kotlin/Native 2017-04-24 13:20:57 +03:00
Dmitry Jemerov
5315f4d9da Initial implementation of rainbow highlighting for Kotlin
#KT-12629 Fixed
2017-04-22 13:45:36 +02:00
Alexander Udalov
c9769ab454 Do not serialize/deserialize CommonCompilerArguments#errors
This prevents .idea/kotlinc.xml from being added with an empty
ArgumentParseErrors object and also fixes
ConfigureKotlinInTempDirTest.testKotlincExistsNoSettingsRuntime11
2017-04-22 02:17:49 +03:00
Ilya Gorbunov
e0a4f9ba76 Rewrite precondition samples and refactor precondition tests
Precondition tests are shared for JS target.
Samples do not use assertFailsWith as expression, as it's going to be converted as a special template.
2017-04-21 21:13:25 +03:00
Ilya Gorbunov
2c32bae5ca kotlin-test: Make assertFailsWith<reified T: Throwable>() common 2017-04-21 20:52:14 +03:00
Ilya Gorbunov
307b132015 kotlin-test: Make assertFailsWith(KClass<T: Throwable>) common 2017-04-21 20:52:12 +03:00
Ilya Gorbunov
ec8ead754f Run kotlin-test-js tests with kotlin-stdlib-js
Rework kotlin-test common tests to make them runnable with qunit.
Change the way how asserter is overridden in js box tests.
Minor: remove unneeded test configs
2017-04-21 20:51:07 +03:00
Ilya Gorbunov
f009e0c665 kotlin-test: Make 'todo { }' function common 2017-04-21 20:50:59 +03:00
Nikolay Krasko
4d0b88e34b Minor: use 'Searching for' instead of 'Searching' 2017-04-21 15:12:08 +03:00
Nikolay Krasko
666ecdb7d6 Don't iterate through classes for Scala and Clojure 2017-04-21 15:12:08 +03:00
Nikolay Krasko
111f0b1e66 Avoid full references search for languages without PsiClass (KT-14974)
Make smart type search work for Groovy.

 #KT-14974 Fixed
2017-04-21 15:12:07 +03:00
Nikolay Krasko
102310e3c2 Skip references for invoke when number of arguments in psi is wrong 2017-04-21 15:08:52 +03:00
Nikolay Krasko
d3ff8c12a4 Use dialog wrapper for controlling behaviour from tests
Known issue: can't use same approach for modifying Java dialogs
behaviour
2017-04-21 15:08:40 +03:00
Mikhail Glukhikh
247a571f51 Add test for multi-platform find usages #KT-15665 Obsolete
+ perform minor AbstractFindUsagesTest refactoring
2017-04-21 14:26:41 +03:00
Dmitry Jemerov
4e8fe18ca8 Fix facet validation: change ArgumentParseErrors to a data class
BaseCompilerSettings.validateInheritedFieldsUnchanged() compares
old and new properties of the compiler settings, and the check requires
ArgumentParseErrors.equals() to be correctly implemented
2017-04-21 13:20:49 +02:00
Dmitry Jemerov
7346fee513 Quickfix to enable coroutine support works in Maven projects
#KT-17521 Fixed
2017-04-21 13:20:49 +02:00
Dmitry Jemerov
aabd560eef Quickfix to enable language feature works for Maven project
#KT-17520 Fixed
2017-04-21 13:20:48 +02:00
Dmitry Jemerov
f389dc068c Import project configuration specified as Maven properties
#KT-17517 Fixed
2017-04-21 13:20:47 +02:00
Dmitry Jemerov
2fd290567c Remove unnecessary use of API which is not intended for clients 2017-04-21 13:20:46 +02:00
Dmitry Jemerov
34b5920225 Fix order of files with fixed data 2017-04-21 13:20:45 +02:00
Dmitry Jemerov
37d5a42b53 Delete some dead code which also happens to crash on test startup 2017-04-21 13:20:44 +02:00
Dmitry Jemerov
794a21aa9c Set default jvmTarget when configuring Kotlin with default configurator 2017-04-21 13:20:34 +02:00
Dmitry Jemerov
98903d4e39 Set default jvmTarget in new JPS projects 2017-04-21 13:20:33 +02:00
Dmitry Jemerov
79f228153c Set default jvmTarget when configuring Kotlin with Maven 2017-04-21 13:20:32 +02:00
Dmitry Jemerov
08dda665aa Ensure that idea-maven tests run on TeamCity 2017-04-21 13:20:31 +02:00
Dmitry Jemerov
372a65570c Set default jvmTarget when configuring Kotlin with Gradle 2017-04-21 13:20:30 +02:00
Dmitry Jemerov
1da1fcceb7 KotlinGradleModuleConfigurator: J2K 2017-04-21 13:20:30 +02:00
Dmitry Jemerov
d4b0e85963 KotlinGradleModuleConfigurator: rename to .kt 2017-04-21 13:20:29 +02:00
Dmitry Jemerov
948699a24b Set default jvmTarget when creating new Gradle project
jvmTarget "1.8" is required to be able to use inline functions from
kotlin-stdlib-jre8.
2017-04-21 13:20:28 +02:00
Dmitry Jemerov
d3682025cb Reuse repository selection logic in KotlinMavenConfigurator 2017-04-21 13:20:27 +02:00
Alexey Sedunov
f575e2710f Move: Fix processing of implicit extension 'invoke' calls
Also fix bogus "unused import" inspection reported on such calls

 #KT-17496 Fixed
2017-04-21 13:32:34 +03:00
Alexey Sedunov
c492f339e6 Quick Fixes: Fix AssertionError on rendering type parameter
#KT-17404 Fixed
2017-04-21 13:32:33 +03:00
Alexey Sedunov
b80fbe1192 Change Signature: Avoid creating parameters from scratch
#KT-15519 Fixed
2017-04-21 13:32:32 +03:00
Alexey Sedunov
c305a42128 Convert Receiver to Parameter: Place new parameter at the start
This affects editor template only since Change Signature already
puts converted receiver at the parameter list start by default

 #KT-15543 Fixed
2017-04-21 13:32:31 +03:00
Alexey Sedunov
6f984d8260 Gradle Support: Do not create facet for module without kotlin plugin
#KT-17265 Fixed
2017-04-21 13:32:30 +03:00
Denis Zharkov
513655239d Introduce initializer-related properties into JavaField
It's much more convenient to use and implement these
properties instead of manual "pattern matching" in the
JavaPropertyInitializerEvaluatorImpl
2017-04-21 12:56:30 +03:00
Denis Zharkov
a5c352dc9f Add -Xuse-old-class-files-reading CLI argument
By default we use the fast implementation in CLI compiler,
but in the most of the tests the old one is enabled

Also add tests on CompiledJava with the fast class reading
implementation
2017-04-21 12:56:29 +03:00
Denis Zharkov
af202ef5bc Get rid of wrong assumption that Java* classes are always PSI-based
See org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaClass
as a counter-example, these classes may be used now in CLI too and they
aren't built upon Java PSI
2017-04-21 12:56:29 +03:00
Denis Zharkov
d65af8f951 Introduce custom Java model implementation for class-files
It's only used for CLI compiler, and it should improve performance
of loading Java descriptors from class-files

For IntelliJ, it leads to 10-15% percent speedup of Kotlin Builder

Before this change, we were using a Java model based on Java PSI that
also read class files, but do it less effectively since it performs
some extra work, that we don't need, e.g. eagerly reading all
the inner classes
2017-04-21 12:56:29 +03:00
Denis Zharkov
88950521a8 Refactor KotlinCliJavaFileManager: make it return JavaClass
It seems to be very natural refactoring considering the
following changes: optimizing KotlinCliJavaFileManagerImpl.findClass
to make it read class files manually instead of requesting PSI
2017-04-21 12:48:31 +03:00
Denis Zharkov
506d7ab3d2 Replace JavaClass.innerClasses with innerClassNames
Also add a findInnerClass method that can find an inner class
by its name

This change helps to avoid loading all the inner class files
eagerly (that may be rather slow), while all the names are available
in InnerClass attribute
2017-04-21 12:48:31 +03:00
Denis Zharkov
5936424659 Replace JavaClassifierType.canonicalText with classifierQualifiedName
The reason is that canonicalText requires some additional
computations to be done when reading class files, while
in fact we only need a class name of the type
2017-04-21 12:48:31 +03:00
Denis Zharkov
aba8b4e2ba Add cache for top-level classes' virtual files
The reason is that searching for a class in a VirtualFile-based
directory (i.e. in a package) happens for O(|amount-of-files-in-dir|),
and it may be rather crucial for packages with a huge amount
of classes

Note that it was checked that the cache should not take a lot of heap
since we call findClass only for really existing classes:
see org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageScope.kt:48

For example, there are no more than 10k classes for the whole
intelliJ project (but the cache is flushed for each module)
2017-04-21 12:48:31 +03:00
Denis Zharkov
06ffbb7b93 Minor. Avoid repeating calls to isRaw 2017-04-21 12:48:31 +03:00
Denis Zharkov
aef1ca10f7 Add additional cache for packages' directories
It's important because even if we know the root where
the package is located we need to go through its parts,
and it's not as fast as it could be since implementation
of VirtualFile.findChild() traverse all files in the directory
to find the relevant one
2017-04-21 12:48:31 +03:00
Denis Zharkov
e4cb5496b8 Optimize getSingleAbstractMethodOrNull
Searching for the single abstract method leads to computing
whole member scopes of given intrefaces, especially when
they contain a lot of methods (i.e. they're definitely not SAMs)

On the other side this method is very hot because it's called
for each Java interface used as a type for some value parameter
(for building SAM adapters)

The idea is to apply some heuristics to understand using only
JavaMethod and supertypes that this interface is definitely not a SAM
2017-04-21 12:48:31 +03:00
Alexander Udalov
db3f70cfe9 Drop unneeded hack relating to matching header class to impl typealias
This is not needed anymore because we use a special TypeCheckerContext
which correctly matches header class to impl typealias.

Also fix 'platformModule' in areCompatibleClassifiers: it's not b's
module (b is already the expansion of a typealias), but the module of
"other", original 'impl' classifier
2017-04-20 22:33:26 +03:00
Alexander Udalov
ea727ff3f0 Use header->impl mapping in HeaderImplDeclarationChecker.areCompatibleTypes
Construct a special TypeCheckingContext that is aware of the magic
behind the "impl typealias" that implements a "header class"

 #KT-16986 Fixed
2017-04-20 22:33:25 +03:00
Alexander Udalov
1ce4612f74 Refactor module usages in HeaderImplDeclarationChecker
Instead of a vague name "moduleToCheck", use explicit names
"commonModule" and "platformModule".
2017-04-20 22:13:32 +03:00
Alexander Udalov
a2e050a3b9 Use correct function to find header for impl in IDE
Also do not call isHeader/isImpl because the returned declarations are
guaranteed to be isHeader in findCompatibleHeaderForImpl and isImpl in
findCompatibleImplForHeader
2017-04-20 22:13:32 +03:00
Alexander Udalov
af4f96fb52 Refactor HeaderImplDeclarationChecker
Build the compatibility map when looking for header given an impl, in
the same way as it's done for the search of impl given a header. The map
is mostly unused now (only its value at key=Compatible is used), but
will be used in the future to improve the diagnostic messages here
2017-04-20 22:13:32 +03:00
Simon Ogorodnik
4978a204f0 Make LibraryDependenciesCache cache again!
#KT-17495 fixed
2017-04-20 20:23:11 +03:00
Mikhail Glukhikh
99653b9afc Refactoring: merge doTest in AbstractMultiModuleHighlightingTest 2017-04-20 19:13:20 +03:00
Mikhail Glukhikh
266d36f289 Refactoring: rename header to common in MultiModuleLineMarkerTest 2017-04-20 19:12:13 +03:00
Mikhail Glukhikh
3a1866b405 Refactoring: introduce doTest in MultiModuleLineMarkerTest 2017-04-20 19:12:11 +03:00
Christopher Horner
8df40eaa46 Add support for RxJava's nullability annotations. 2017-04-20 17:20:39 +03:00
Alexander Udalov
aee5326ca7 CLI: refactor argument validation out of parsing 2017-04-20 16:20:54 +03:00
Alexander Udalov
8aba862e97 CLI: use "--" to separate free arguments from compiler options
#KT-9370 Fixed
2017-04-20 16:20:54 +03:00
Zalim Bashorov
baef649fe4 KJS: change asserter to DefaultAsserter for JS Backend tests
It required for fix JsCodegenBoxTestGenerated.

Right now QUnitAsserter used as default asserter in kotlin-test
and we don't want to change it now to avoid breaking stdlib-js tests
and maybe user code.
2017-04-20 16:19:06 +03:00
Zalim Bashorov
2f4119a8ae KJS: remove obsolete code related to Unit testing 2017-04-20 16:19:06 +03:00
Zalim Bashorov
7cf684f624 KJS: remove unnecessary files from testData 2017-04-20 16:19:06 +03:00
Zalim Bashorov
c112542935 KJS: remove unnecessary test runners (mostly for stdlib)
Stdlib tests run separately via gradle.
2017-04-20 16:19:05 +03:00
Zalim Bashorov
5ef75e6e2b KJS: remove PackageTest.java and move actual files to box/ 2017-04-20 16:19:04 +03:00
Vyacheslav Gerasimov
dcae66a727 Add quickfix for INAPPLICABLE_JVM_FIELD
replaces with 'const' when possible

#KT-10981 Fixed
2017-04-20 12:10:20 +03:00
Vyacheslav Gerasimov
199bff7e70 Add quickfix for 'Illegal inline parameter modifier'
Adds inline to function if crossinline is used on parameter

#KT-14046 Fixed
2017-04-20 12:09:53 +03:00
Dmitry Jemerov
49a211b3cd Ensure that UElement.nameIdentifier.containingFile is a real file
This is needed to report inspection problems on UAST elements.
2017-04-20 11:02:56 +02:00
Dmitry Jemerov
d001cea4c3 Fix tests: add ACTION tags for newly added actions 2017-04-20 11:02:40 +02:00
Dmitry Petrov
a3985bbdd3 Substitute underlying constructor when substituting type alias constructor
KT-17426 Constructor call of typealiased class gets suspicious type arguemnts
2017-04-20 10:20:36 +03:00
Simon Ogorodnik
02fec6e4a5 Add fine check of type inference when adding <> in completion
Add check if type inferred via type parameter of upper bound
 of extension receiver or value argument
 #KT-16161 fixed
2017-04-19 21:27:31 +03:00
Zalim Bashorov
c021af0fef KJS: fix non-local return inside catch block 2017-04-19 20:20:21 +03:00
Zalim Bashorov
29e7bcce65 Add explicitly the proguard rule to save JAXPParserFactory#createParser
And remove obsolete rules.
2017-04-19 20:18:21 +03:00
Zalim Bashorov
d64140a11c Add jars to intellij_core explicitly
It prevents unintended using jars from core dir,
also, it allowis us gradually remove a dependency on some jars.
2017-04-19 20:18:20 +03:00
Zalim Bashorov
2c69198926 Make return type of KotlinScriptDefinitionProvider.getInstance nullable
For example service can be absent in Kotlin JS only compiler.
2017-04-19 20:18:20 +03:00
Anton Bannykh
d5bcf18e5c JS: disable JVM specific part of internal visibility resolution 2017-04-19 18:53:27 +03:00
Ilya Gorbunov
2db8714fc5 Fix null values being treated as missing in 'put' method of a specialized string-keyed map 2017-04-19 18:32:47 +03:00
Mikhail Glukhikh
8fdb611e3b Do not try to inline properties from decompiled files
This removes GUI freeze for library properties #KT-17234 Fixed
2017-04-19 18:27:29 +03:00
Mikhail Glukhikh
983611a75f Fix in createBlockStringTemplateEntry (use createExpressionByPattern)
This fixes one more broken test for inlining
2017-04-19 18:27:28 +03:00
Mikhail Glukhikh
6571a573f1 Use correct callElement for variable invoke in replacer
Check only 'status.isSuccess' before inlining, no descriptor check
Add two tests and fixes two other
2017-04-19 18:27:27 +03:00
Mikhail Glukhikh
4ef0096d46 Refactoring: inline val / fun now use the common inliner
This prevents their inconsistent work in some situations
NB: breaks three tests if used alone
2017-04-19 18:27:26 +03:00
Mikhail Glukhikh
e6fa7356e1 Inline: support compound case without containing block #KT-17296 Fixed 2017-04-19 18:27:25 +03:00
Mikhail Glukhikh
ade838bff2 Inline fun: remove recursion inside includesCallOf
Probably #KT-17330 Fixed
2017-04-19 18:27:24 +03:00
Ilya Gorbunov
a87da4338f arrayIterators: Restore index to the previous value after NoSuchElementException has been thrown
Relates to #KT-17453
2017-04-19 18:12:58 +03:00
Ilya Chernikov
731dcf5d6f minor: fix after faulty rebase 2017-04-19 15:22:15 +02:00
Ilya Chernikov
c91a3f8bf0 Add sam-with-receiver and source-sections compiler plugins to maven
rename source-sections compiler plugin jar in the dist (add kotlin- prefix),
according to the agreed naming scheme for the artefacts. (The renaming of the
other plugins should follow.)
in addition configure proguard to retain VirtualFile members, since they
are used in the source-sections plugin
2017-04-19 15:22:15 +02:00
Ilya Chernikov
ea71d57808 Use script-runtime properly in IDEA project:
use it from the installed plugin for dependent modules (frontend)
use it from bootstrap in the plugin being built
also drop unused daemon-client from the plugin

This makes it consistent with ant build and allow building idea project
without prior ant dist
2017-04-19 15:22:15 +02:00
Sergey Igushkin
2360d5f330 Changed to prepending annotation processor path instead of appending it
to classpath and existing annotation processors.
2017-04-19 16:06:55 +03:00
Mikhail Glukhikh
91f7f19902 ExpressionReplacementPerformer: handle string templates accurately 2017-04-19 13:12:59 +03:00
Mikhail Glukhikh
815a367978 ReplacementPerformer: always copy statement to insert #KT-17273 Fixed 2017-04-19 13:12:58 +03:00
Mikhail Glukhikh
0f6b9473e9 Inliner: don't take into account nonexistent PSI to keep parameter
So #KT-17272 Fixed
2017-04-19 13:12:57 +03:00
Mikhail Glukhikh
b8cc7c2ca6 Add type arguments more accurately during inlining 2017-04-19 13:12:56 +03:00
Mikhail Glukhikh
f8e1f5e613 Inliner: specify explicit lambda signature for calls with lambdas
So #KT-17213 Fixed
So #KT-17395 Fixed
2017-04-19 13:12:55 +03:00
Mikhail Glukhikh
02e9a3d027 Specify lambda signature: handle special parameters correctly
So #KT-17372 Fixed
2017-04-19 13:12:53 +03:00
Mikhail Glukhikh
6453e10d44 If necessary, add parameter types while inlining lambda 2017-04-19 13:12:52 +03:00
Mikhail Glukhikh
666133beee Minor refactoring (.replaced instead of .replace) 2017-04-19 13:12:51 +03:00
Alexander Podkhalyuzin
75d231cc37 Deprecated setting was used for import optimization on the fly. (#1049) 2017-04-19 11:57:15 +02:00
AJ Alt
8d8f5aa3e0 Update usage of deprecated sourceMappingURL format
The usage of `//@` in sourceMappingURL pragmas was deprecated in favor of `//#`. 
The deprecation happened in 2013, and was motivated by incompatibilities in IE.

The Chromium and Mozilla issues tracking the change:

https://bugs.chromium.org/p/chromium/issues/detail?id=239660
https://bugzilla.mozilla.org/show_bug.cgi?id=870361

And the Mozilla documentation on the warning that is issued as a result of using the deprecated syntax:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_source_map_pragma?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default
2017-04-19 12:54:45 +03:00
Dmitry Jemerov
c7bcf4bea7 Don't assert element validity in diagnostic code (EA-92848) 2017-04-19 11:49:12 +02:00
Dmitry Jemerov
ffa77c55c4 Handle the case when there's no current project view pane (EA-91198) 2017-04-19 11:49:12 +02:00
Dmitry Jemerov
f35079055a Don't try to import elements that don't belong to any module (EA-91890) 2017-04-19 11:49:12 +02:00
Dmitry Jemerov
a76d72ea52 Wrap index access in read actions (EA-96128) 2017-04-19 11:49:12 +02:00
Dmitry Jemerov
a96eaa2fa9 Remove incorrect @NotNull annotation on getIcon() (EA-79802) 2017-04-19 11:49:12 +02:00
Dmitry Jemerov
03cef30717 Correctly honor expected type when converting string templates to UAST
#KT-17315 Fixed
 #KT-17316 Fixed
2017-04-19 11:46:13 +02:00
Dmitry Jemerov
f801c5f3f8 Avoid another case of reading file content when building stubs
Do not read file content in isKotlinInternalCompiledFile() if possible
2017-04-19 11:36:10 +02:00
shiraji
83169ad781 "Add open to callable" intention introduced #KT-16786 Fixed 2017-04-19 11:37:48 +03:00
Ilya Chernikov
cdb42c989e Relax error reporting on script dependencies resolving
to avoid exceptions reported on the gradle model problems, e.g. missing
dependencies
2017-04-19 08:14:30 +02:00
Alexander Udalov
134bec6de8 Move dependency on built-ins in IDE higher for common modules
See the comment in ModuleInfo
2017-04-18 22:58:56 +03:00
Alexander Udalov
a96b67ea29 Refactor, move TargetPlatform to ModuleInfo 2017-04-18 22:58:56 +03:00
Alexander Udalov
9a8dc14616 Do not add JS/JVM libraries to common library dependencies in LibraryDependenciesCache
Currently kotlin-stdlib-common doesn't have serialized built-ins inside,
so in a multiplatform project, it was possible that either JVM or JS
built-ins (depending on the order of entries in the project
configuration) were going to be used for the analysis of a common module
depending on kotlin-stdlib-common. This resulted, for example, in
additional built-in member calls (e.g. "List.stream()") being unresolved
in JVM modules when they used the List instance coming from the common
module (see the added test)
2017-04-18 22:58:56 +03:00
Alexander Udalov
4c2c734733 Minor cleanup in LibraryDependenciesCache 2017-04-18 22:58:56 +03:00
Ilya Gorbunov
59dc0f57fc Clarify copyRecursively behavior in case of a single file. 2017-04-18 21:26:55 +03:00
Shaun Reich
7ebd86725f Fix FileTreeWalk doc typo/grammar 2017-04-18 21:26:53 +03:00
Ilya Gorbunov
ea18282f4c Minor: reformat docs to distinguish summary 2017-04-18 21:26:52 +03:00
Vyacheslav Gerasimov
06c8de02b5 Add intentions for registering Android components in manifest
Activity, Service, BroadcastReceiver

#KT-17389 Fixed
2017-04-18 19:04:15 +03:00
Vyacheslav Gerasimov
5b58a6f9e8 Add intentions Add/Remove/Redo parcelable implementation
#KT-17465 Fixed
#KT-12049 Fixed
2017-04-18 19:04:14 +03:00
Ilya Gorbunov
37c3d8f204 Sort out warnings related to inline and library functions in stdlib-js 2017-04-18 18:51:20 +03:00
Ilya Gorbunov
6ae19e03d5 Clean warnings and refactor stdlib tests.
Merge RangeJVMTest into RangeTest.
2017-04-18 18:51:20 +03:00
Ilya Gorbunov
ac46f1e23d Cleanup warnings in stdlib-js 2017-04-18 18:51:20 +03:00
Ilya Gorbunov
cb186aabf9 Another workaround for IDEA shared source root limitation 2017-04-18 18:51:20 +03:00
Ilya Gorbunov
4a5d8534c1 Fix array iterators to adhere to Iterator contract
#KT-17453 Fixed

Change expected exceptions in tests.
2017-04-18 18:51:20 +03:00
Simon Ogorodnik
2380e0bacc Optimize PluginDeclarationProviderFactory.getStubBasedPackageMemberDeclarationProvider
Add cache for fast package exists check in specific module
 #KT-16850 fixed
2017-04-18 17:58:45 +03:00
Simon Ogorodnik
9ca65fcf99 Fix addition of wrong java.lang imports on optimize imports
Add check to star importer, to not import already imported fqNames
 #KT-15273 fixed
2017-04-18 17:45:45 +03:00
Dmitry Jemerov
dd4a5944f1 Delegate getContaingFile() for UAST declarations to Kotlin origin
This is required to be able to report inspection problems on such
elements.
2017-04-18 15:13:34 +02:00
Ilya Chernikov
2a9de93a82 Attempt to eliminate crashes if script template is broken
Attempts to fix issues similar to EA-100334 completely
2017-04-18 14:57:31 +02:00
Ilya Chernikov
7754e90ad4 Restore another part of script template resolving for even older legacy code
complements d284979
Fixes EA-100334
2017-04-18 14:57:30 +02:00
Nikolay Krasko
5dbf3b6b4d Allow search usages for declarations when correct isEquivalentTo
Now it's possible to do find usages for other languages when light
elements are used.

Revert efb36f4a49 and revise fix of KT-7983:
Don't consider local and non-local class with same fqn equivalent.

 #KT-7983 Fixed
2017-04-18 15:25:08 +03:00
Nikolay Krasko
eb941c75f9 Minor: check that invoke() usages search doesn't find overrides 2017-04-18 15:25:08 +03:00
Nikolay Krasko
d0a26cf052 Log shifting to plain text search for tests 2017-04-18 15:25:08 +03:00
Nikolay Krasko
6e3016284a Test find usages behaviour when failing to text search on Groovy files
Set test directory to directory with test files (not relative to
findUsages folder). This way test will be configured as if all testdata
is under source root (previously it was copied into package under path
with findUsages) and resolvers will see classes under root package.

 #KT-14974 In Progress
2017-04-18 15:25:08 +03:00
Nikolay Krasko
e1de0b9cd8 Fix bad language check in find usages that caused falling to text search 2017-04-18 15:25:08 +03:00
Nikolay Krasko
331279583d Restores test failures on unknown directive 2017-04-18 15:25:07 +03:00
Pavel V. Talanov
ec4da854b8 Codegen: fix NPE in NO_ANNOTATION_VISITOR
EA-100245 fixed
2017-04-18 14:59:49 +03:00
Pavel V. Talanov
8eb7117bf1 Light class codegen: do not apply compiler plugins
Applying plugins leads to failures when matching members in LazyLightClassDataHolder
    because plugins rely on analysis results
This decision has its drawbacks (java won't see results of plugin execution)
    but more work on light classes is needed if we want to support this usecase
We can argue that plugins should only generate synthetic members
    but there is no such restriction atm
2017-04-18 14:59:47 +03:00
Pavel V. Talanov
bea1da5c7a KtLazyLightClass: do not store references to LightClassDataHolder
Otherwise any cached reference to light class can lead to severe memory leaks in IDE
    since LightClassBuiderResult holds GenerationState which holds ModuleDescriptor
2017-04-18 14:59:45 +03:00
Pavel V. Talanov
3401529be1 IDELightClassContexts#isDummyResolveApplicable: add missing check
Missing check caused exact resolve being applied to every class that had 'equals' overridden
2017-04-18 14:59:43 +03:00
Pavel V. Talanov
10aa9c5910 PsiBasedClassResolver: get default imports without resolution facade
Using DefaultImportProvider is expensive in this scenario
2017-04-18 14:59:41 +03:00
Pavel V. Talanov
c436a9af07 TargetPlatform#getDefaultImports(): cache result in all implementations 2017-04-18 14:59:39 +03:00
Pavel V. Talanov
421b785697 Minor: fix erroneous refactoring 2017-04-18 14:59:37 +03:00
Ilya Gorbunov
f22375601b Remove unneeded suppressions 2017-04-18 12:47:11 +03:00
Ilya Gorbunov
8f452ed046 Cleanup warnings in stdlib and generated code 2017-04-18 12:47:04 +03:00
Ilya Gorbunov
6af986cfdd Refactor serialization tests and move them to test/io package
Add tests for singleton deserializing.
2017-04-18 12:46:52 +03:00
Ilya Gorbunov
b67aed61ce Fix preprocessor failure to to create directory when the first operation is modification 2017-04-18 12:46:43 +03:00
Sergey Mashkov
96160606ba Maven: KT-15050 setup logger so IDEA's core could log error
Introduce system property kotlin.compiler.X.enable.idea.logger=true
The reason is that I suspect that the error is somewhere at com.intellij.ide.plugins.PluginManagerCore#loadDescriptorFromJar but unfortunately default logger doesn't log messages at "info" log level so we can't see why exactly does it fail.
Users can enable IDEA's logger to see more details.
2017-04-18 12:31:39 +03:00
Alexey Andreev
7e6df03421 Fix improper handling of coroutine interceptors
Don't use coroutine facade in following cases:
* When calling coroutine functions in non-suspend mode (i.e.
  suspend flag is either false or skipped).
* When passing continuation from suspend function to suspend function.

Use facade only for corresponding intrinsics.
Reason: interceptor should not be called on each suspend function
invocation, it should be called after resume from innermost
suspend function.

Fix KT-17067. The example provided with the issue is very similar to
dispatchResume.kt which passes after these changes.

Add test to prove that KT-17446 is no more reproducible.
2017-04-18 11:22:18 +03:00
Mikhail Zarechenskiy
f3ed75998e Simplify resolve for control labels by using PSI
Diagnostic `NOT_A_RETURN_LABEL` wasn't quite useful and its eliminating allows to simplify label resolver a lot. It could be also added using PSI
2017-04-18 10:23:19 +03:00
Alexey Sedunov
e79a7d3e94 Change Signature: Update test data 2017-04-17 23:00:20 +03:00
Alexey Sedunov
45929fd3e3 Change Signature: Invalidate ChangeInfo after the refactoring
The goal is to avoid keeping all semantic information used by
KotlinChangeInfo in UndoableAction produced by the refactoring

#KT-17333 Fixed
2017-04-17 23:00:19 +03:00
Alexey Sedunov
b33b06722d Change Signature: Support header/impl declarations 2017-04-17 23:00:18 +03:00
Alexey Sedunov
66265972aa Multiplatform Project: Fix impl-by-header search and vice versa 2017-04-17 23:00:17 +03:00
Alexey Sedunov
e1503d80f2 Test Framework: Move common members to KotlinMultiFileTestCase 2017-04-17 23:00:16 +03:00
Alexey Sedunov
d78828001d Rename: Support header/impl declarations 2017-04-17 23:00:15 +03:00
Alexey Sedunov
701ba5b59b Rename: Support rename by caret in multi-module tests 2017-04-17 23:00:13 +03:00
Alexey Sedunov
b65e082425 Test Framework: Fix module creation in multi-module tests 2017-04-17 23:00:12 +03:00
Alexey Sedunov
69ef8e89a9 Move: Fix NPE on moving file to non-source directory 2017-04-17 23:00:11 +03:00
Alexey Sedunov
b229eeeb47 Move: Prevent running refactoring helpers on partial move
It may lead to some imports being wringly removed
due to their references being unresolved yet

Also fix NPE on package rename via directory move
2017-04-17 23:00:10 +03:00
Alexey Sedunov
aa0f0ef02d Presentation: Do not use resolve to compute element description
Invoking analysis on EDT may degrade editor performance
2017-04-17 23:00:08 +03:00
Alexey Sedunov
8df502de84 Move To Upper Level: Fix target package computation
#KT-13466 Fixed
2017-04-17 23:00:07 +03:00
Alexey Sedunov
fc33d89e28 Move Member out of Companion: Improve conflict checking
Also do not show conflict dialog under write action
2017-04-17 23:00:06 +03:00
Alexander Udalov
7a25af0f2f Fix NPE caused by KotlinCompileMojoBase if no "Xcoroutines" value is passed
NPE was happening in CLICompiler.chooseCoroutinesApplicabilityLevel
2017-04-17 18:40:35 +03:00
Zalim Bashorov
9783a31779 Remove kotlin-reflect.jar dependency from util module and move reflectionUtil.kt closer to "clients"
Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.
2017-04-17 18:18:38 +03:00
Zalim Bashorov
f32fcd4ec1 Minor: remove temporary prefix from KotlinScriptExternalImportsProvider.kt
Rename was required to preserve git history of original file (see previous commit).
2017-04-17 18:18:36 +03:00
Zalim Bashorov
51e84f7ce4 Move some script related part of frontend to separate module to avoid using kotlin-reflect.jar in frontend module
Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.
2017-04-17 18:18:35 +03:00
Zalim Bashorov
05c3e7e81d Don't export kotlin-reflect form util module and add it explicitly where it's required.
Also, remove kotlin-reflect form container module.

Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.
2017-04-17 18:18:31 +03:00
Zalim Bashorov
465582c15b Minor: remove unused UserDataHolderImpl 2017-04-17 18:18:30 +03:00
Mikhail Zarechenskiy
32f609ceee Check lambda parameter for name shadowing
#KT-5160 Fixed
2017-04-17 17:12:44 +03:00
Mikhael Bogdanov
708bfdbd5f Generate line numbers for function call parameters
Before this fix line numbers for function call arguments were not generated,
 so if argument was on another line than function call it was
 impossible to stop on argument line during debugging.
 Now line number for each argument is generated if necessary
 (another line than function call line).

 #KT-17144 Fixed
2017-04-17 16:09:59 +02:00
Mikhail Zarechenskiy
b60efab62e Fix using qualified this with labeled function literals
#KT-9251 Fixed
2017-04-17 16:21:07 +03:00
Mikhail Zarechenskiy
b17b3f4c63 Resolve local function parameters with function inner scope
This allows to use type parameters and value paramters in default value expressions

 #KT-7984 Fixed
 #KT-7985 Fixed
2017-04-17 16:21:06 +03:00
Mikhail Zarechenskiy
e86d52b681 Fix return type of private members that return anonymous object
#KT-16813 Fixed

Anonymous objects returned from private-in-file members should behave as for private class members
2017-04-17 16:21:05 +03:00
Mikhail Zarechenskiy
44170f3357 Fix typo in DSL marker message
#KT-17318 Fixed
2017-04-17 16:21:04 +03:00
Mikhail Zarechenskiy
1fbd8f3f53 Support automatic labeling for infix calls
#KT-8877 Fixed
2017-04-17 16:21:03 +03:00
Mikhail Zarechenskiy
6a352bccb6 Resolve control label locally when label name clashes with fun name
#KT-5354 Fixed
 #KT-15085 Fixed
2017-04-17 16:21:02 +03:00
Mikhail Zarechenskiy
1c3f546319 J2K: convert & prettify LabelResolver 2017-04-17 16:21:01 +03:00
Mikhail Zarechenskiy
9ebbb73487 J2K: rename LabelResolver 2017-04-17 16:21:00 +03:00
Alexander Udalov
027b83a252 Minor, pass coroutines state explicitly in maven plugin 2017-04-17 15:51:43 +03:00
Alexander Udalov
dc5e51f4ac Do not parse/serialize additional compiler arguments in JPS
This is mostly a revert of e5a128ab, where the issue of the compiler
failing on repeated command line arguments was worked around. Now the
compiler behaves more properly: it uses the last passed argument and its
value, and prints a warning that several values have been passed. With
this behavior, the workaround is no longer necessary
2017-04-17 15:51:43 +03:00
Ilya Gorbunov
723642c9d4 binary-compatibility-validator: depend on required artifacts to ensure they are built.
Read dumped declarations lazily in order not to fail on class initialization.
2017-04-17 15:17:02 +03:00
Ilya Gorbunov
94895c4e4d Clean warnings in binary-compatibility-validator cases 2017-04-17 14:50:07 +03:00
Mikhael Bogdanov
46cdf0215e Add codegen tests with substituted bytecode version (1.8->1.9) 2017-04-17 13:22:04 +02:00
Alexey Andreev
b11e33901b Fix parsing of JavaScript number literals out of integer range
Fix KT-17219
2017-04-17 14:17:08 +03:00
Alexander Udalov
b7de272884 CLI: support delimiter for array arguments
The " " delimiter is used in kotlin-native (see
K2NativeCompilerArguments)
2017-04-17 11:51:33 +03:00
Alexander Udalov
ae1fb16fe8 Fix compilation of kotlin-gradle-plugin 2017-04-17 11:51:08 +03:00
Alexander Udalov
10f2e9d33a Revert usages of -X arguments to old form in some places
We use the old compiler in Gradle build and in GradleFacetImportTest, so
some changes in f4b6db4 should not have been made yet
2017-04-17 11:33:58 +03:00
Alexander Udalov
072f87ddab Introduce -Xintellij-plugin-root, deprecate CompilerJarLocator 2017-04-14 20:13:11 +03:00
Alexander Udalov
ce6676baa8 Do not print usage if wrong argument is passed, do not exit with INTERNAL_ERROR
This is a normal situation, not an internal error of the compiler, so
return COMPILATION_ERROR instead
2017-04-14 20:07:54 +03:00
Alexander Udalov
ff846e787f Report warning for non-boolean CLI argument passed multiple times
Only if its values are different, see the test
2017-04-14 20:07:54 +03:00
Alexander Udalov
be54e4b93b Get rid of coroutinesWarn/coroutinesEnable/coroutinesError
Use a single coroutinesState instead. Change the coroutines state in
some tests from "warn" to "enable"/"error" to test that deserialization
of older config files works ("warn" is the default value, so it wasn't
testing anything here)
2017-04-14 20:07:54 +03:00
Alexander Udalov
f4b6db4dc0 Change format of -X arguments to require value after '='
Report a warning when an argument is passed in the old form (with the
whitespace)

 #KT-17264 Fixed
2017-04-14 20:07:54 +03:00
Alexander Udalov
78c0111c6e Drop cli-parser, use simple reflection-based parser instead
The main reason of this change is that major changes are required in how
command line arguments are parsed in kotlinc, and it's much easier to
make them in our own codebase (given that the code is short and simple
enough) than in a third-party library
2017-04-14 20:07:53 +03:00
Sergey Mashkov
007408c792 Maven: rename completion providers 2017-04-14 13:27:09 +03:00
Sergey Mashkov
c890200f08 Maven: show non-stable language/api versions only in internal mode 2017-04-14 13:27:08 +03:00
Sergey Mashkov
a22ed0f7c0 Maven: minor: fix comment 2017-04-14 13:27:08 +03:00
Sergey Mashkov
711398f14f Maven: eliminate constants in maven.xml 2017-04-14 13:27:07 +03:00
Sergey Mashkov
a427248969 Maven: add more plugin parameters IDE support 2017-04-14 13:27:07 +03:00
Sergey Mashkov
2521dacc25 Maven: KT-17093 Import from maven: please provide a special tag for coroutine option 2017-04-14 13:27:06 +03:00
Sergey Mashkov
5010047b1b KT-16283 Maven compiler plugin warns, "Source root doesn't exist" 2017-04-14 13:27:05 +03:00
Sergey Mashkov
40a5e646c6 KT-10028 Support parallel builds in maven
mark all the mojos as not thread safe so Maven should never run them in parallel
2017-04-14 13:27:05 +03:00
Sergey Mashkov
307fdd1024 KT-16762 Maven: JS compiler option main is missing 2017-04-14 13:27:04 +03:00
Sergey Mashkov
6de0d79a78 KT-16743 Update configuration options in Kotlin Maven plugin
deprecate parameters module and testModule
2017-04-14 13:27:04 +03:00
Sergey Mashkov
de35863b57 KT-16743 Update configuration options in Kotlin Maven plugin
add javaParameters configuration parameter
2017-04-14 13:27:03 +03:00
Sergey Mashkov
e6b729d38b KT-16743 Update configuration options in Kotlin Maven plugin
deprecate parameters module and testModule
2017-04-14 13:27:02 +03:00
Alexey Andreev
e182290f54 Fix sorting of source files before compilation.
This should fix unstable generated JS between recompilations.
2017-04-14 11:46:52 +03:00
Mikhael Bogdanov
a35ad64454 Disable reflection tests on android 2017-04-14 10:33:13 +02:00
Alexander Udalov
7fe9b99087 Support different target platforms for modules in AnalyzerFacade
Instead of reusing the same AnalyzerFacade that is used for resolution
of a module to resolve its dependencies, analyze each dependency
module/library with a facade depending on its target platform. Introduce
and use CommonLibraryDetectionUtil in addition to
KotlinJavaScriptLibraryDetectionUtil, to detect common libraries (with
.kotlin_metadata files).

Note that before multi-platform projects, this was not needed because
there were only two platforms (JVM and JS), and JVM module had only JVM
modules/libraries as dependencies, JS module had only JS
modules/libraries as dependencies. Now, for example, a JVM module can
have a common module/library as a dependency, and it would be incorrect
to analyze that dependency with JvmAnalyzerFacade because that facade
does not know anything about .kotlin_metadata files.

The changes in Dsl.kt and KotlinCacheServiceImpl.kt are needed because
PsiElement.getJavaDescriptorResolver, called from some IDE code, started
to fail on a common module, because the container for a common module
does not have the JavaDescriptorResolver
2017-04-14 00:44:00 +03:00
Alexander Udalov
722687acd6 Refactor multiplatform test cases in MultiModuleHighlightingTest
Groupt multiplatform test cases in a nested class, get rid of duplicated
code, rename "header" -> "common" where it relates to the common module
2017-04-14 00:43:59 +03:00
Alexey Tsvetkov
c41818b6a7 Minor: use JDK_18 instead of JAVA_HOME to run Maven IC tests 2017-04-13 21:53:28 +03:00
Alexey Tsvetkov
753c99a377 Wrap getDaemonConnection in try-catch
Just in case it would throw one day
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov
6b315259d3 Fix "Unexpected message" from daemon when CompilerMessageLocation is null
Recently the CompilerMessageLocation.NO_LOCATION was replaced with a null value.
This caused daemon clients to report "Unexpected message" for compiler messages without location.
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov
e160931ec5 Delete daemon client file when Gradle process stops
#KT-17177 fixed
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov
34a8896ad4 Minor: rename test KotlinDaemonAdvaced->KotlinDaemonIT 2017-04-13 21:53:28 +03:00
Mikhael Bogdanov
a6c9cf7d3f Minor. Cleanup code 2017-04-13 19:04:47 +02:00
Mikhael Bogdanov
3df32ad425 Add flag for dex verification 2017-04-13 19:04:45 +02:00
Mikhael Bogdanov
df65b3f6b3 Refactor test framework to process directives in one place
Perform directive processing in base test class
2017-04-13 19:04:44 +02:00
Alexander Udalov
c2f275faec Refactor codegen test utilities
Use GenerationUtils.compileFiles instead of
CodegenTestUtil.generateFiles
2017-04-13 19:04:43 +02:00
Mikhael Bogdanov
7613ec54f5 Add run configuration to run common java backend tests under jdk 9
With jvmTarget 1.6 and 1.8
2017-04-13 17:54:39 +02:00
Mikhael Bogdanov
a8382c25b2 Add run configuration to run common java backend tests on jdk 8 with jvm target 1.8 2017-04-13 17:54:38 +02:00
Mikhael Bogdanov
806db3852d Support for custom default jvmTarget in jvm backend tests 2017-04-13 17:54:37 +02:00
Mikhael Bogdanov
2bb5b3881a Run dex checker only on java 6 files 2017-04-13 17:54:36 +02:00
Mikhael Bogdanov
73d771717c Don't assign classFileFactory outside generateClassesInFile
Otherwise dex cheker wouldn't be called
2017-04-13 17:54:35 +02:00
Alexey Andreev
5c1882bfcc Unmute test that passes 2017-04-13 17:33:15 +03:00
Dmitry Petrov
e0ebaac70c Perform additional checks on catch parameter declaration
KT-8320 It should not be possible to catch a type parameter type
KT-7645 Prohibit default value for `catch`-block parameter
2017-04-13 16:23:17 +03:00
Dmitry Petrov
5ccfbcbe22 KT-4960 Redeclaration is not reported for type parameters of interfaces
When resolving a class body for a class without a primary constructor
(e.g., an interface), no checks were performed for redeclarations
in the corresponding class header.
Creating & initializing a lexical scope of an appropriate kind will do it.
Note that since class has no primary constructor, only type parameters
could be redeclared (and that's KT-4960).
2017-04-13 15:57:24 +03:00
Alexander Udalov
eb0c0a8869 Fix incorrect logic in KotlinJavaScriptLibraryDetectionUtil
Previously the lambda almost always returned false, because the library
root is never a JS file with metadata, which led to
processFilesRecursively always returning false, which led to every
library being detected as a Kotlin/JS library here
2017-04-13 14:39:07 +03:00
Nikolay Krasko
01782fb4b9 Fix build: restore lost imports 2017-04-13 14:30:17 +03:00
Alexander Udalov
bbdff8c7ce Move DeclarationDescriptor.substitute to separate interface Substitutable
To get rid of pointless/confusing implementations in ModuleDescriptor,
PackageViewDescriptor, TypeParameterDescriptor and others.

Note that there are still implementations that do not make sense, for
example in those subclasses of VariableDescriptor which are not also
subclasses of CallableMemberDescriptor (e.g. ValueParameterDescriptor).
Those can be removed by making CallableMemberDescriptor (instead of
CallableDescriptor) inherit from Substitutable. However, that would
require more changes in the compiler because CallableDescriptor is used
rather often in places where in fact only CallableMemberDescriptor
instances can appear.

Explicit return types and casts are required in some places now because
there's no single non-trivial supertype for
ClassifierDescriptorWithTypeParameters and CallableDescriptor.
Previously it was DeclarationDescriptorWithVisibility, now it's both
that and Substitutable<...>
2017-04-13 14:16:07 +03:00
Nikolay Krasko
9f037c3c62 Minor: remove warnings caused by ExtensionPointName.create nullability 2017-04-13 13:48:03 +03:00
Nikolay Krasko
baa75fc8d5 Refactoring: move OptionsParser to separate file 2017-04-13 13:48:02 +03:00
Nikolay Krasko
fa22a5c3a4 Minor: clean warnings in AbstractSearcherTest.java 2017-04-13 13:48:02 +03:00
Nikolay Krasko
65c1a2d732 Minor: extract common method to base class 2017-04-13 13:48:02 +03:00
Nikolay Krasko
9748c7d068 Refactoring: move operators searchers to separate package 2017-04-13 13:48:02 +03:00
Kirill Rakhman
d44bf27ec3 Completion of keywords (like constructor) doesn't insert parentheses/braces if they're already there
#KT-15603 Fixed
 #KT-13524 Fixed
2017-04-13 13:41:41 +03:00
Zalim Bashorov
56d3f90a02 Don't log content of module.xml when Logger is not initialized
When Logger is not initialized it returns default logger which prints to stdout and stderr,
so it can lead to different results when run CLI tests locally and on TC.
2017-04-13 13:16:32 +03:00
Alexey Andreev
43c084fde3 Simplify coroutine generation in JS backend
Stop making aliasing suspend function descriptor with reference to
instance of state machine. This may cause problems in some cases,
for example, when compiling recursive suspend function. See KT-17281.
Instead, make alias for synthetic continuation parameter. This
additionally required some refactoring, e.g. *always* generating
continuation parameter during codegen.
2017-04-13 12:56:34 +03:00
Ilya Chernikov
f4a4a41525 Restore parts of the template resolving code in the compiler...
that was moved to the script-runtime, that it a row caused the incompatibility
with old GSK implementations. Now the legacy template resolving related code
is restored, marked obsolete and wrapped for compatibility with the new code.
2017-04-12 19:48:43 +02:00
Vyacheslav Gerasimov
d8fdd04e7f Remove custom lint detectors registration from kotlin lint
#KT-14970 Fixed
2017-04-12 19:23:43 +03:00
Dmitry Jemerov
2a8933e5a0 Run all Gradle import tests with Gradle 3.5 2017-04-12 15:37:44 +02:00
Alexander Udalov
27c3155ce3 Refactor AnalyzerFacade.setupResolverForProject for better readability 2017-04-12 14:22:34 +03:00
Alexander Udalov
f594a4c018 Drop ModuleDescriptor.sourceKind, move this code to IDE modules
This information is only used in IDE and it can easily be computed there
2017-04-12 14:22:34 +03:00
Ilya Chernikov
aaeb53fb8b Fix compiler client test after introducing nullable CompilerMessageLocation 2017-04-12 11:51:02 +02:00
Dmitry Jemerov
40df565369 Use correct repository for checking if current EAP version is published
Logic for determining the Maven repository corresponding to the current
plugin version has been centralized and reused in the version chooser
in "Configure Kotlin" dialog.
  #KT-17291 Fixed
2017-04-12 10:41:57 +02:00
Dmitry Jemerov
546040fafd Change AddKotlinLibQuickFix to support adding multiple jars 2017-04-12 10:41:57 +02:00
Dmitry Jemerov
aee32e6204 New Kotlin projects and Configure Kotlin adds JRE-specific jars 2017-04-12 10:41:57 +02:00
Dmitry Jemerov
aacaa61cf2 JavaRuntimeLibraryDescription: J2K 2017-04-12 10:41:57 +02:00
Dmitry Jemerov
f4db36ad5d JavaRuntimeLibraryDescription: rename to .kt 2017-04-12 10:41:57 +02:00
Dmitry Jemerov
8000989bb8 Fix updating libraries
Use correct order root type for updating jars; correctly find file
in VFS after rename; provide logging instead of exceptions in case
of failure; update library model under write action; locate stdlib
sources under the old name
 #KT-17334 Fixed
2017-04-12 10:41:57 +02:00
Mikhael Bogdanov
a4fef1371f Split resulting test jar into small ones (1000 files per jar)
Dex on teamcity has memory problems with large jar
2017-04-11 20:28:25 +02:00
Simon Ogorodnik
c6cdbe7eed Fix import member quickfix to check receiver
#KT-17037 fixed
2017-04-11 20:29:15 +03:00
Vyacheslav Gerasimov
a47bc1492d Update changelog for 1.1.2 EAP 2 2017-04-11 18:13:14 +03:00
Alexey Andreev
72898b378e Add and target to prepare running tests in node.js 2017-04-11 16:15:26 +03:00
Alexey Andreev
7077de02e7 Fix passing non-string value to print/println in node.js
See KT-15484
2017-04-11 16:15:25 +03:00
Alexey Andreev
dbfa3fce2a Fix running tests in node.js 2017-04-11 16:15:24 +03:00
Alexander Udalov
3430059b3a Minor, refactor TargetPlatformDetector.getPlatform
Inline dangerous getPlatform(PsiFile) method to prevent it from being
called accidentally instead of getPlatform(KtFile)
2017-04-11 16:06:56 +03:00
Zalim Bashorov
5f0e896843 Minor: simplify isVisible of Visibilities.INTERNAL and write comment on non-obvious line 2017-04-11 15:47:02 +03:00
Zalim Bashorov
712b2c8117 Add tests for KT-12199 to prevent regression
#KT-12199 Obsolete
2017-04-11 15:46:13 +03:00
Nikolay Krasko
ab2dbba249 Abstract class icon added (KT-7810)
#KT-7810 Fixed
2017-04-11 14:28:11 +03:00
Nikolay Krasko
6898176b43 Abstract extension function added 2017-04-11 14:28:10 +03:00
Denis Zharkov
1596f19fd7 Add javaslang library to kotlin-plugin artifact
This change should be contained in 5e449fdc02
But I've forgotten to apply it
2017-04-11 12:52:52 +03:00
Nikolay Krasko
cee54a4111 Revert "Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity"
This reverts commit 0cf1c8d900.
2017-04-11 12:33:07 +03:00
Nikolay Krasko
cc3b6998b1 Minor: fix warnings in KotlinTypeMapper.java 2017-04-11 12:33:07 +03:00
Nikolay Krasko
172bee58b4 Expose connection between mangling internal names in backend and jdiEval 2017-04-11 12:33:07 +03:00
Nikolay Krasko
42868b1364 Fix evaluate for internal functions (KT-15854)
#KT-15854 Fixed
2017-04-11 12:33:07 +03:00
Nikolay Krasko
9eae9aa938 Minor: fix warnings and refactoring 2017-04-11 12:33:07 +03:00
Alexey Sedunov
9979c6e361 Move: Fix processing of callable references to Java constructors 2017-04-11 12:11:51 +03:00
Alexey Sedunov
bdaf73411a Move: Extract MoveToKotlinFileProcessor class 2017-04-11 12:11:50 +03:00
Alexander Udalov
cb4d2994a3 Drop CompilerMessageLocation.NO_LOCATION, use null everywhere instead 2017-04-11 12:08:31 +03:00
Alexander Udalov
861d9a1620 Use null instead of CompilerMessageLocation.NO_LOCATION in MessageCollector 2017-04-11 12:08:31 +03:00
Alexey Sedunov
411a8dc206 Move: Remove duplicating conflict messages from test data 2017-04-11 11:45:13 +03:00
Alexey Sedunov
cd6177534a Move: Add conflict checking for "Move packages" case 2017-04-11 11:45:12 +03:00
Alexey Sedunov
e21ff23e26 Move: Add conflict checking for "Move directory with classes" case 2017-04-11 11:45:11 +03:00
Alexey Sedunov
87a12ee1c7 Move: Check for conflicts using entire collections of elements to move 2017-04-11 11:45:10 +03:00
Alexey Sedunov
358b5fe548 Move: Force package name change when moving Java files
Package statement in Java file is updated too late
when moving the entire containing directory, so we force it
with intercepting MoveFileHandler implementation
2017-04-11 11:45:08 +03:00
Alexey Sedunov
3007b11973 Move: Use MoveFilesWithDeclarationProcessor for files & directories 2017-04-11 11:45:07 +03:00
Alexey Sedunov
22a56a81b9 Move: Drop obsolete code 2017-04-11 11:45:06 +03:00
Alexey Sedunov
f5d106a68f Refactoring: Drop obsolete KotlinFileReferencesResolver class 2017-04-11 11:45:05 +03:00
Alexey Sedunov
7f115343f9 Kotlin Facet: Drop Gradle/Maven-based version info providers
They are obsolete since compiler/library version can be detected
based on module dependencies generated on external model import
2017-04-11 11:45:04 +03:00
Denis Zharkov
aaddc34b54 Optimize control-flow analysis algorithm
There's no need to recalculate results if all of the
previous instructions' results remain unchanged.

It's a crucial optimizations because otherwise algorithm
can degrate to O(n * m) [n - instructions number, m - variables number]
even in a linear code like this:
var a_1 = 1
var a_2 = 1
...
var a_m = 1

We perform analysis iteration once, then we repeat it to be sure
that no changes happened and here for each instruction we're
starting to check if recomputed value is the same, that basically
compares maps of all the variables, so it works O(n * m)

After this change on the second iteration we won't recompute new values
as none of predecessor has been changed
2017-04-11 11:26:11 +03:00
Denis Zharkov
5e449fdc02 Optimize control-flow analysis by use of persistent maps
The case that it's worth to optimize is functions
with a lot of variables.

After debugging it's recovered that control-flow works nearly
O(n * m) where n is pseudocode size and m is a number of variables:
the algorithm performs O(n) copies of hashmap of size O(m)

Persistent maps should help because we don't need to perform a
copy of them, so the expected performance after the change is applied
is O(n log m)

We've tried pcollections and javaslang, and the latter one has demonstrated
better results

See results before and after optimizations
before:
3da7ba45a7/reports/benchmarks-many-vars-2017-03-14.txt

after with pcollections:
3da7ba45a7/reports/benchmarks-many-vars-persistent-optimizations-2017-03-17.txt

after with javaslang:
d22a871b17/reports/benchmarks-many-vars-javaslang-2017-04-07.txt
2017-04-11 11:26:11 +03:00
Yan Zhulanow
9e61eea758 Support inline properties in debugger class search 2017-04-10 23:25:55 +03:00
Yan Zhulanow
cb9e90183a Debugger: Fix AbstractPositionManagerTest
MockReferenceType can't be used anymore because the new DebuggerClassNameProvider requires much more from it.
The new SmartMockReferenceType implements methods such as nestedTypes() or allLineLocations() properly.

Also, as PositionManager can return more than one class, we should check if any of the classes it returned matches the pattern.
2017-04-10 23:25:54 +03:00
Yan Zhulanow
622430a296 Debugger: Fix AbstractPositionManagerTest
MockReferenceType can't be used anymore because the new DebuggerClassNameProvider requires much more from it.
The new SmartMockReferenceType implements methods such as nestedTypes() or allLineLocations() properly.

Also, as PositionManager can return more than one class, we should check if any of the classes it returned matches the pattern.
2017-04-10 23:25:53 +03:00
Yan Zhulanow
fe3c1aff8b Debugger: Classes for callable references should be treated as synthetic 2017-04-10 23:25:52 +03:00
Natalia Ukhorskaya
42e14961de Debugger: Find classes using its inner classes (initial implementation) 2017-04-10 23:25:51 +03:00
Yan Zhulanow
3ee65ac499 Kapt: Support specifying javac options (KT-17245) 2017-04-10 22:48:17 +03:00
Sergey Igushkin
8cdb08cbfe Fixed duplicated kapt options caused by multiple call to args setup
Separated kapt args from other plugin options.

Issues: #KT-16965 Fixed

Fix indentation
2017-04-10 20:59:23 +03:00
Sergey Igushkin
ea3adb0629 Implemented resolving the compiler jar using the class loader
Added resolving the compiler jar using the class loader urls as the
first step with the fallback to the original resolution method. Also
helps if the compiler is not present in the classpath dependencies.

Issues: #KT-16580 Fixed

Changed to getting plugin version from the applied plugin instead of
the plugin JAR name.

Removed unnecessary working with version of AbstractKotlinPlugin.
2017-04-10 20:55:19 +03:00
Sergey Igushkin
bda59e58d5 Filling in and reverting annotationProcessor
Added reverting processor path back.
Appending processor path instead of setting it.

Issues: #KT-17255 Fixed

(cherry picked from commit 843844b)

Added a test checking that -processorpath is set for all Gradle versions
2017-04-10 20:50:34 +03:00
Sergey Igushkin
64278a06cc Refactoring in AnnotationProcessingManager.kt. 2017-04-10 20:45:03 +03:00
Sergey Igushkin
80daae90e3 Partial fix for the processor path not being set up properly.
Issues: #KT-17255
2017-04-10 20:44:12 +03:00
Alexey Tsvetkov
e7e29f2651 Avoid changing java.rmi.server.hostname property 2017-04-10 20:39:34 +03:00
Alexey Tsvetkov
54ee779ba1 Import 'implement' dependency of platform project transitively
#KT-16926 fixed
2017-04-10 20:25:48 +03:00
Ilya Gorbunov
e9c47d6498 Minor: validate required environment variables are set. 2017-04-10 19:46:06 +03:00
Ilya Gorbunov
3425f6d3af Remove dist-quick as it fails on terminal steps anyway.
Add compiler-for-maven packing step to dist-quick-compiler-only.
2017-04-10 19:46:06 +03:00
Ilya Gorbunov
37e046f6cd Provide shortcuts for producing quick compiler for maven and rebuilding stdlib-js from ant. 2017-04-10 19:46:06 +03:00
Ilya Gorbunov
afba967fcf Use kotlin-stdlib.jar instead of kotlin-runtime.jar as runtime during build 2017-04-10 19:46:06 +03:00
Dmitry Jemerov
655fe87d43 Remove obsolete code for deleting script/kotlin.js 2017-04-10 17:34:13 +02:00
Dmitry Jemerov
62eb9e9909 Check jar name before calling getVirtualFileForJar()
#KT-17331 Fixed
2017-04-10 17:32:30 +02:00
Dmitry Jemerov
406714a1f4 Remove warning for running the compiler under Java 6/7
Now the compiler won't even start, so no need to check this manually.
2017-04-10 17:30:03 +02:00
Dmitry Jemerov
5a7278b856 Fix test: update Android build tools to release version 2017-04-10 16:13:31 +02:00
Mikhail Zarechenskiy
438f318d3e Minor, update test data 2017-04-10 16:35:00 +03:00
Mikhael Bogdanov
b51cb9a911 Delete clean reference instructions on dereferencing captured variables
Codegen generates clean instructions for ref values (captured vars)
on block exit so we should delete them on dereferencing captured values.

  #KT-17200 FIXED
2017-04-10 16:35:03 +05:00
Mikhael Bogdanov
f3e2abfd5f Don't eliminate redundant casts to multi-dimension arrays
Dex doesn't recognize ANEWARRAY [Ljava/lang/Object; types as Object [][], but Object [].
It's not clear is it bug in dex or not

 #KT-17200 InProgress
2017-04-10 16:35:01 +05:00
Mikhail Zarechenskiy
86c4ad1165 Drop erroneously used @Deprecated annotation from parameter
Annotation @native is deprecated itself and @deprecated on parameter doesn't have message, which cause compilation error after 3c4afcd
2017-04-10 12:48:10 +03:00
Mikhail Zarechenskiy
682fe9e9ca Don't forget to resolve annotations from constructor parameter
#KT-12245 Fixed
2017-04-10 12:48:10 +03:00
Mikhail Zarechenskiy
c9b468581a Fix type checking of local return inside return expression
#KT-16426 Fixed
2017-04-10 12:48:09 +03:00
Mikhail Zarechenskiy
7f287a4230 Support warning about useless cast on safe cast
#KT-13348 Fixed
2017-04-10 12:48:09 +03:00
Vyacheslav Gerasimov
107879a78a Implement getTypeElement for UastKotlinPsiVariable
#KT-16849 Fixed
2017-04-10 12:40:33 +03:00
Vyacheslav Gerasimov
1d134ffc72 Register Android api quickfixes for inlined api inspection
#KT-14857 Fixed
2017-04-10 12:39:40 +03:00
Vyacheslav Gerasimov
70d24d0108 Fix NoSwingUnderWriteActionException in KotlinAndroidAddStringResource 2017-04-10 12:38:34 +03:00
Pavel V. Talanov
2f159bb64b Light classes: do not rely on dummy context when data class autogenerated members conflict with declared members
Fix related issues with nested classes
2017-04-09 15:10:29 +03:00
Pavel V. Talanov
69c250a1b7 Light class test: avoid checking method visibility when NoLaziness is not specified
Allows to avoid putting NoLaziness flag on every test that mentions 'override' modifier
2017-04-09 15:09:15 +03:00
Pavel V. Talanov
32d3a1b4c9 Light classes: generate ACC_STATIC for DefaultImpls classes
To provide consistency between light classes and their delegates

IdeLightClass#testExtendingInterfaceWithDefaultImpls still failing since
    we do not generate implementations delegating to DefaultImpls of superinterfaces
2017-04-09 15:09:13 +03:00
Pavel V. Talanov
5e351061e8 Light classes: test consistency for inner classes 2017-04-09 15:09:10 +03:00
Pavel V. Talanov
4f701285b1 Light class builder: do not generate methods delegating to DefaultImpls in kotlin classes
Class APIs from java point of view stays the same so we can avoid generating those methods
Otherwise we have to calculate all supertypes when getMethods() is called,
    which imposes severe performance penalties
We have to pretend these methods are not 'abstract' (also we consider them 'default' for safety)
    so java highlighting does not report "class should be abstract" for all inheritors
We have to manually report "class should be abstract" on some of the java inheritors,
    specifically those that are implementing interfaces directly
	    as opposed to extending kotlin classes implementing those interfaces
2017-04-09 15:09:01 +03:00
Pavel V. Talanov
db294da24d Minor, refactor: Move hasBody() to KtProperty 2017-04-09 15:07:50 +03:00
Pavel V. Talanov
922fde9986 LazyLightClassDataHolder: minor, improve diagnostics 2017-04-09 15:07:48 +03:00
Pavel V. Talanov
8fbd75ce27 AbstractIdeLightClassTest: minor, refactor 2017-04-09 15:07:45 +03:00
Alexey Tsvetkov
0a42a1c104 Minor: fix maven IC tests with custom local repository 2017-04-08 21:14:49 +03:00
Ilya Gorbunov
e7dc7ec005 Rebuild sources for kotlin-daemon-client and compiler-client-embeddable in maven build
Do not build these sources in ant.
Do not require them as artifact dependencies.
2017-04-08 19:07:54 +03:00
Ilya Gorbunov
5aabcb6ea3 Update build instructions in ReadMe to include gradle build step.
Also update links and overall readme structure.
2017-04-08 08:37:12 +03:00
Ilya Gorbunov
f5647fb27f Delete temporary proguard configuration for gradle, change the primary one. 2017-04-08 08:32:05 +03:00
Ilya Gorbunov
5aff64078c Drop helper functions and use ones from stdlib instead. 2017-04-08 08:32:03 +03:00
Ilya Gorbunov
e8e8bec342 Drop unneeded steps from updateDependencies
Do not download closure compiler for ant,
do not rebuild markdown anymore,
do not build protobuf-lite.
2017-04-08 08:31:07 +03:00
Ilya Gorbunov
6e961be1a1 No need to fork ant under jdk8 to build annotation-processing 2017-04-08 08:31:03 +03:00
Ilya Gorbunov
eef835f6c1 Remove ant targets that are superseded by gradle build. 2017-04-08 08:31:01 +03:00
Ilya Gorbunov
337fd4e180 Drop poms that are no longer required. Drop separate unit test modules for stdlib js. 2017-04-08 08:28:50 +03:00
Anton Bannykh
93f11a6da3 Update HtmlUnit driver to version 2.24; run tests using JDK 1.8
The old version had very limited TypedArray support, which lead to
browser-example crashes.
The new version of HtmlUnit needs JDK 1.8 to run.
2017-04-07 18:52:56 +03:00
Mikhail Glukhikh
767db68daf Cleanup: when possible, do analyzeFully -> analyze 2017-04-07 15:36:02 +03:00
Mikhail Glukhikh
ba04dac4b7 Cleanup: when possible, do analyzeFullyAndGetResult -> analyzeFully
Also, when possible, do analyzeAndGetResult -> analyze
2017-04-07 15:36:00 +03:00
Mikhail Glukhikh
ceff19ee74 Cleanup: leaking this inspection 2017-04-07 15:35:59 +03:00
Mikhail Glukhikh
aed98a745e Do not use KtClassInitializer as analyzable parent
Fixes analyzeFully() semantics making it closer to compiler
Fixes two flaky tests for "leaking this" quick-fixes
2017-04-07 15:35:58 +03:00
Mikhail Glukhikh
55d304a9a5 Minor refactoring: anonymous initializers 2017-04-07 15:35:57 +03:00
Vyacheslav Gerasimov
6b9242075a Fix MovePropertyToConstructorIntention applicability and type rendering
#KT-17238 Fixed

(cherry picked from commit 7f9d88a)
2017-04-07 14:32:06 +03:00
Nikolay Krasko
d65b7a5b4b Better indent in else-if editing (KT-14601)
#KT-14601 Fixed

(cherry picked from commit 25d6d61)
2017-04-07 14:21:45 +03:00
Dmitry Jemerov
da9af682d9 Don't show Kotlin in "Add framework support" for Maven/Gradle modules
#KT-16392 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
f1e96709a8 JSFrameworkSupportProvider: J2K 2017-04-07 13:09:58 +02:00
Dmitry Jemerov
ee5ebb8ab7 JSFrameworkSupportProvider: rename to .kt 2017-04-07 13:09:58 +02:00
Dmitry Jemerov
372ab57b65 JavaFrameworkSupportProvider: J2K 2017-04-07 13:09:58 +02:00
Dmitry Jemerov
25830be3a2 JavaFrameworkSupportProvider: rename to .kt 2017-04-07 13:09:58 +02:00
Dmitry Jemerov
5ef2b39804 Don't create multiple copies of KotlinJavaRuntime for multiple modules
#KT-17259 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
1488b21143 More consistent configurator names
#KT-17138 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
7159550a8f Show selected configurator in title of "Configure Kotlin" dialog
#KT-17251 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
2e33850981 Hide "Configure Kotlin" notification after Kotlin has been configured
#KT-17289 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
29eafcbc97 Don't show "Choose Configurator" popup for one available configurator
#KT-17287 Fixed
2017-04-07 13:09:58 +02:00
Dmitry Jemerov
02af278766 Hide "Configure Kotlin (JavaScript)" in Android Studio
#KT-17288 Fixed
2017-04-07 13:09:58 +02:00
Alexander Udalov
2be8a4f184 Minor, delete obsolete test data 2017-04-07 13:44:02 +03:00
Anton Bannykh
7287645937 JS: fix AMD module integration tests 2017-04-06 21:35:03 +03:00
Ilya Gorbunov
324445fa7d Create staging sonatype repository manually and change deploy-url parameter.
This is required to ensure that both gradle and maven build publish their artifacts
to the same sonatype staging repository.

Override deployment repository url for publishing snapshots to sonatype.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
c5e52b124b Prepare for publishing to bintray and maven central. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
4bc85f9c0e .gitignore fine tuning for gradle. Limit existing patterns. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
02293dab9e Add public api dumps for kotlin-reflect and kotlin-stdlib-jre7/8 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
88e6f2160a Build and verify runnable samples with gradle. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
97d1ffb036 Do not build modules with maven which are built with gradle.
kotlin-maven-plugin-test:
Remove dependency on kotlin-test-parent that is no longer published and required.
Add dependency on kotlin-runtime as it's no longer coming transitively from kotlin-script-runtime.
Change kotlin version test to reflect manifest implementation title changes.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
356f8dd0d1 Killswitch: do not build runtime with ant, switch to gradle artifacts. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
df44f3bfe6 Launch kotlin runtime gradle build from ant.
Fork ant to build compiler as it requires a lot of memory.
Pass build.number to gradle build.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
3db1613167 Setup dist task to assemble libs for compiler distribution.
Produce special stdlib artifact with annotations for dist.
Put js outputs to dist, they're required for JS backend tests.

Use kotlin-compiler for maven, which has all required dependencies bundled.
Clean local directory repository on clean.

Change paths in tests to compiled artifacts.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
0b2cadc638 Provide a method for common publishing configuration. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
92ef26606b Refactor build to make manifest specification less error-prone.
Use legacy implementation title in manifest of JS stdlib for now.

Change the way common jvm project configurations is applied.
Add missing artifacts to common libraries.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
325ebfbd5f Use karma plugin to run kotlin-stdlib-js tests.
Also create html page to run tests interactively in browser.

Use karma-teamcity-reporter 0.1.2 to workaround https://github.com/karma-runner/karma-teamcity-reporter/issues/38
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
dedf9fe898 kotlin-stdlib-js: copy sources in order to prevent duplicate source root in IDEA 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
026a76e98c Assemble protobuf-lite with gradle, and use it in kotlin-reflect. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
d1d62d557d Create task to run kotlin scripts and use it to strip metadata. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
65a800840c Use single task for empty javadocs. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
c2aa906d77 Build reflection classes with gradle: all from main sourceSet 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
f619dbe631 Build and package reflection with gradle 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
4645fc4b7b Build reflection classes with gradle 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
7a6621cc85 Migrate stdlib generator to gradle and include it to the main project
Use latest released kotlin compiler and stdlib to build it.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
e090a44b71 Migrate binary-compatibility-validator tests to gradle. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
e119f3a042 Make kotlin-test tests compile as tests for multiplatform project
Also remove utils not needed anymore.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
f8ebe5593f Make assertFailsWith common
Because headers cannot have default parameters.
This leads to less effective implementation in JVM.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
609355a311 Provide kotlin.AssertionError in kotlin-stdlib-common
Remove related workarounds from kotlin-test-common
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
5c0110850d Preprocess and build JS library tests 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
0e1fc0cff2 Rewrite preprocessor task in gradle without ant 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
8fd8310033 Build and package kotlin-test-js with gradle 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
49ce11f363 Build and package kotlin-stdlib-js with gradle 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
122e63d072 Build kotlin-stdlib-js with gradle 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
846b74885c Remove some configuration duplication by using 'tasks.withType()'
Setup common options of java and kotlin compiler tasks.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
d25b07fe23 Exclude additional test source sets when importing project in IDEA, enable coroutines in stdlib 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
08fa304b6f Build common standard library headers and kotlin-test (common and jvm) as multiplatform projects. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
780e12f04a Build stdlib without dependency to kotlin-runtime and kotlin-test. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
decccfd0d1 Update version of kotlin gradle plugin to 1.1.1 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
a49df5aaae Use gradle 3.4.1 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
d3afc1ba2e Extract manifest attribute specification to helper function.
Specify default jdkHome for all projects.
2017-04-06 20:32:37 +03:00
Ilya Gorbunov
5755210498 Tune build options for kotlin-test, kotlin-runtime, kotlin-stdlib, kotlin-stdlib-jre7/8 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
c5aa5ef571 Do not duplicate sources, add non-compiled sources to runtime, dump declarations to json. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov
25e69962f3 Use maven central for dependencies for all projects 2017-04-06 20:32:37 +03:00
Ilya Chernikov
dfdce5ff58 Publish to custom local repo, add copy-only reflect and js-lib
Add artifact signing
2017-04-06 20:32:37 +03:00
Ilya Chernikov
35a135cbf6 Add builds for main stdlib, stdlib jre7/8, kotlin.test 2017-04-06 20:32:37 +03:00
Ilya Chernikov
ed9221cb7d Add script runtime, refactorings 2017-04-06 20:32:37 +03:00
Ilya Chernikov
c2c051cfe8 Prepare gradle config for building libs - bootstrap and runtime
Use external gradle plugin (1.1-M04) with compiler.jar from dist
Add empty build scripts for other projects that needs to be built with gradle
2017-04-06 20:32:37 +03:00
Ilya Chernikov
8e3453f0eb Add gradle wrapper (3.2) to the libraries dir, add appropriate gradle stuff into gitignore 2017-04-06 20:32:37 +03:00
Dmitry Jemerov
9a215bfec6 Show idea.log when running IDEA from IDEA 2017-04-06 19:00:32 +02:00
Ilya Chernikov
a19303e121 Fix environment arg parsing regex - avoid SO on the long strings 2017-04-06 18:49:58 +02:00
Alexey Sedunov
3552b94cdc Kotlin Facet: Avoid excessive validation
#KT-17293 Fixed
2017-04-06 18:54:07 +03:00
Alexey Sedunov
c1066b98f0 Move: Fix warning on companion used as implicit dispatch receiver
Do not report conflict if target class is a sublcass of
companion object's containing class
2017-04-06 18:54:02 +03:00
Alexey Sedunov
5c35061afa Move: Make minor improvements and refactorings 2017-04-06 18:52:45 +03:00
Alexey Sedunov
97789d4a32 Move: Show progress indicator when updating usages 2017-04-06 18:18:34 +03:00
Alexey Sedunov
4a168ff780 Move: Process internal usages after all declarations are moved 2017-04-06 18:18:33 +03:00
Alexey Sedunov
a9e7d3d5cf Move: Support test data with multiple carets 2017-04-06 18:18:32 +03:00
Alexey Sedunov
18632c3200 Kotlin Facet: Fix facet creation with non-default JVM target 2017-04-06 18:18:31 +03:00
Nikolay Krasko
fc55b532d4 Store only string in closure instead of full type 2017-04-06 16:58:31 +03:00
Nikolay Krasko
76fae363ee Stop fail tests because of JNI bugs 2017-04-06 16:53:16 +03:00
Alexey Tsvetkov
a047c3682a Invalidate cache version if corresponding file is empty
Sometimes an expression `versionFile.readText()`
returns an empty string, so that `toInt()` fails
with `NumberFormatException`.

It can happen in with both JPS and Gradle.
I could not reproduce the problem,
and it seems to be impossible (under normal circumstances),
because we always write a non-empty string,
and the file is checked to exist before reading.
Maybe it could be caused by an FS error.

The only "solution" to the problem I could think
is to swallow the exception, and assume
that cache version is not valid (so it would cause a rebuild of a module).

    #KT-17125 fixed
2017-04-06 15:53:29 +03:00
Alexey Tsvetkov
56182746b5 Fix printing daemon client messages
Fixing the problem introduced in the commit 9819de1abd:
the daemon client messages should be reported
when the debug log level is enabled
or when the connection not successful

    #KT-17199 fixed
2017-04-06 15:53:29 +03:00
Ilya Chernikov
659002f5ce minor: Fix daemon shutdown livelock
due to wrong minimal aliveness, daemon was in some situations livelocked
in the last session state on shutdown.
2017-04-06 10:02:50 +02:00
Ilya Chernikov
30048f8f49 Fix CRLF handling in source-sections plugin 2017-04-06 10:02:49 +02:00
Ilya Chernikov
0199ec18b1 Add new compiler argument for passing script resolver environment 2017-04-06 10:02:48 +02:00
Ilya Chernikov
234ad39fd6 minor: improve daemon start failure diagnostic 2017-04-06 10:02:47 +02:00
Ilya Chernikov
a309511adf Add actual sources to compiler and daemon client jars 2017-04-06 10:02:46 +02:00
Ilya Chernikov
88652154c9 Port compiler to the script-runtime with script base classes 2017-04-06 10:02:45 +02:00
Ilya Chernikov
7ceaca133a Add new artifact kotlin-compiler-client-embeddable.jar 2017-04-06 10:02:44 +02:00
Ilya Chernikov
aebfc2f4a1 minor: move native platform launcher to separate file to make native-platform dependency optional 2017-04-06 10:02:43 +02:00
Mikhail Zarechenskiy
90a8a164b4 Fix false warning about check for instance of nullable type
#KT-12269 Fixed
2017-04-05 21:35:09 +03:00
Mikhail Zarechenskiy
0d6b7bb6a1 Prohibit check for instance of a non-reified, non-subtype type parameter
#KT-12683 Fixed
 #KT-9986 Fixed
2017-04-05 21:35:07 +03:00
Mikhail Zarechenskiy
9fdd5fe5e8 Allow to import private members if they are in the same file
#KT-7724 Fixed
2017-04-05 21:35:06 +03:00
Mikhail Zarechenskiy
f518e8ebb8 Prefer stable types to diagnose useless cast
#KT-11622 Fixed
2017-04-05 21:35:05 +03:00
Mikhail Zarechenskiy
13eddba1f2 Fix false warning about useless cast in property and property accessor
Note that there are some other problems, for example:
`val a = if (true) 1 as Number else 2`, here we'll get useless cast

 #KT-9551 Fixed
 #KT-9645 Fixed
2017-04-05 21:35:04 +03:00
Mikhail Zarechenskiy
12db3a263e Don't report useless cast in lambda if it has influence on return type
#KT-15161 Fixed
 #KT-12690 Fixed
2017-04-05 21:30:32 +03:00
Alexey Tsvetkov
30d6af7aae Provide incremental compilation for Maven
#KT-11916 fixed

To use the IC either:
1. set the `kotlin.compiler.incremental` property to `true` in a pom.xml:
```
<properties>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties>
```
2. pass the `kotlin.compiler.incremental` property in a command line:
```
mvn install -Dkotlin.compiler.incremental=true
```

When IC is on Kotlin plugin is expected to print the warning in the log:
```
Using experimental Kotlin incremental compilation
```

After each call an incremental compiler will also log how many files it has compiled:
```
Compiled %SOME_NUMBER% Kotlin files using incremental compiler
```

Note that the first build will be non-incremental.

For more diagnostic information (such as an exact list of compiled files) use the `kotlin.compiler.incremental.log.level` system property:
```
mvn install -Dkotlin.compiler.incremental=true -Dkotlin.compiler.incremental.log.level=info
```

To force the rebuild just run the 'clean' goal:
```
mvn clean install
```
2017-04-05 21:00:43 +03:00
Yan Zhulanow
21da11fe18 Fix 'kotlin-spring' and 'kotlin-noarg' Gradle plugin importing (KT-17049)
Allopen and Noarg plugins now use 'presets' that should be handled in the Gradle importer as well.
2017-04-05 18:13:14 +03:00
mglukhikh
9fa16364e1 Find enclosing element for object literal in delegate #KT-8187 Fixed 2017-04-05 16:38:04 +03:00
mglukhikh
6277476573 Do not add a new label to labeled loop
Relevant situation: break / continue in when #KT-16128 Fixed
2017-04-05 15:40:08 +03:00
mglukhikh
d9e1e82948 Destructure is available even without usages #KT-14435 Fixed 2017-04-05 15:07:15 +03:00
mglukhikh
feb9dd4d83 Don't suggest destructuring if at least half components not used
So #KT-16828 Fixed
2017-04-05 14:45:48 +03:00
Mikhail Glukhikh
318314f1a4 Fix "must not be null" in KotlinInlineFunctionDialog #KT-17233 Fixed 2017-04-04 19:22:46 +03:00
mglukhikh
8fb818fc74 Don't report 'protected in final' for implicitly protected
So #KT-16339 Fixed
2017-04-04 19:22:39 +03:00
mglukhikh
f13997750f Make destructure intention work on library data classes
So #KT-16468 Fixed
So #KT-14402 Fixed
2017-04-04 19:22:31 +03:00
mglukhikh
8a02ce3dc2 KT-16828: use _ when appropriate in destructure intention 2017-04-04 19:22:24 +03:00
Ilya Chernikov
32d0d7a4d5 Remove xerces from compiler uberjar, pack compiler with explicit jar names
xercesImpl was unnecessarily added to the compiler uberjar during migration
to the idea platform 171. This caused NCDFE about classes from org.w3c
package.
And to simplify application of this commit and to ensure that only required
jars are packed into the uberjar, the build.xml was altered to use
explicit list of the jars from the ideaSdk/core directory, rather than
a mask.

Fixes #KT-17143 and #KT-17157

(cherry picked from commit 5595bea)
2017-04-04 15:14:46 +02:00
mglukhikh
1b2edf6a0c KT-15870: run getTargetDirectory() in write action 2017-04-04 15:55:57 +03:00
mglukhikh
ee239d59aa Set startInWrite... in intention-based quick fix as in intention
So #KT-15870 Fixed
2017-04-04 15:55:55 +03:00
Simon Ogorodnik
57c1d8eda4 Fix conversion of assignment as expression in J2K
Blockless if's and so with assignment as expression inside
should turn into blockful
 #KT-16816 fixed
2017-04-04 14:38:25 +03:00
Simon Ogorodnik
86137e1f65 Fix deadlock in J2K
#KT-17230 fixed
2017-04-04 14:38:25 +03:00
Alexey Sedunov
6bf23d5e02 Kotlin Facet: Convert paths to OS-independent form
#KT-17223 Fixed
2017-04-04 14:35:12 +03:00
Alexey Sedunov
7e0bb089e2 Kotlin Facet: Suppress selection on plugin options tab
#KT-17046 Fixed
2017-04-04 14:35:11 +03:00
Alexey Sedunov
746ec48176 Move: Fix internal reference processing on moving multiple files
#KT-17211 Fixed
2017-04-04 14:35:10 +03:00
Alexey Sedunov
a8a9c3bbf4 Kotlin Facet: Fix platform detection in android-gradle projects
Sort candidate library names by descending length.
Suppress common library if platform-specific one is also present

 #KT-16827 Fixed
2017-04-04 14:35:08 +03:00
Mikhail Glukhikh
7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00
Nikolay Krasko
110fc103de Run tests with JDK 1.8 and remove hack with downloading libraries from previous ide 2017-04-04 13:22:43 +03:00
Dmitry Jemerov
fe8e02f4cf Use LibraryJarDescriptor for refreshing jars on plugin update 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
78844dd4aa Use new path for stdlib sources jar 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
38abc0ca8e Get rid of RuntimeLibraryFiles and its remaining uses 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
09fbbb369a Use LibraryJarDescriptor in CustomLibraryDescriptorWithDeferredConfig 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
2bb1b670f7 CustomLibraryDescriptorWithDeferredConfig: J2K 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
ff985314cf CustomLibraryDescriptorWithDeferredConfig: rename to .kt 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
f9aff3be13 Rewrite configureModuleWithLibrary() based on LibraryJarDescriptor
Also remove duplicated logic for identifying Kotlin libraries.
2017-04-04 11:21:06 +02:00
Dmitry Jemerov
06e8f8e5be Remove obsolete logic for updating source root URL 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
291e888802 Encapsulate library search in LibraryJarDescriptor 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
f9495aa0d7 Introduce and use KotlinPaths.getStdlibPath()
Also support renaming .jar file when updating an existing library
2017-04-04 11:21:06 +02:00
Dmitry Jemerov
344f372327 KotlinJavaModuleConfigurator: J2K 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
16c2dec60a KotlinJavaModuleConfigurator: rename to .kt 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
00d3141ba2 KotlinWithLibraryConfigurator: J2K 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
2059a052c9 KotlinWithLibraryConfigurator: rename to .kt 2017-04-04 11:21:06 +02:00
Dmitry Jemerov
296fe698b8 KotlinAnnotatedElementsSearcher optimization
When possible, try to resolve references in types using only the PSI
without building the full resolve session.
2017-04-04 11:14:09 +02:00
Pavel V. Talanov
b9809566e6 Workaround for KotlinJpsBuiltTest js tests
Caused by problems with classloading (having two copies of DefaultImplementation class)
2017-04-03 21:44:43 +03:00
Mikhael Bogdanov
16d95d803f Use jdk 1.8 to run android tests 2017-04-03 19:20:52 +02:00
Nikolay Krasko
d9c57728e2 Try to avoid null exception in getCommandProvider() in debugger tests 2017-04-03 19:05:22 +03:00
Nikolay Krasko
b4ebd6074c Restore quick doc for it parameter and this of extension function 2017-04-03 19:05:22 +03:00
Nikolay Krasko
eb4e6e6c1a Ad hoc solution to avoid resolution in language injection by receiver (KT-16995)
#KT-16995 Fixed
2017-04-03 19:05:22 +03:00
Yoshinori Isogai
f16736285a Update JAVA_HOME path to JDK8 (#1043) 2017-04-03 17:52:51 +02:00
Alexander Udalov
b5ea6d3e25 Upgrade maven-shade-plugin to 3.0.0
A critical bug related to Java 8 bytecode (default/static methods in
interfaces) was fixed in maven-shade-plugin in 3.0.0, which reproduces
for kotlin-compiler-embeddable on Java 9 because the verifier in Java 9
started to check consistency of constant pool references to methods in
interfaces

 #KT-17112 Fixed
2017-04-03 18:37:22 +03:00
Alexander Udalov
dc4c8c40bf Fix Java6BuiltInsWithJDKMembersTest on Linux
PathUtil.getJdkClassesRoots() takes the path to the JRE. On macOS, this
is the same as the path to the JDK (for Java 6), so the test worked
there. However for OpenJDK on Linux, there's a separate directory named
"jre" in the JDK root. See JavaSdkUtil.getJdkClassesRoots for more
information on how the JDK roots are found
2017-04-03 18:30:59 +03:00
Alexander Udalov
b368da8456 Do not warn on non-JAR files in classpath
#KT-17140 Fixed
2017-04-03 18:18:40 +03:00
Alexander Udalov
64dfa6d33d Do not add current directory to "kotlin" classpath
As "java" does, do not include the current directory to the classpath if
the explicit classpath is specified. This is more stable than always
adding the current directory, and users can easily add the ".:" to the
beginning of the explicit classpath themselves

 #KT-17100 Fixed
2017-04-03 18:17:27 +03:00
Alexander Udalov
3b8110f51c Minor, use "use" to automatically close JarFile
JarFile extends Closeable on JDK 8, so we can use "use" here now
2017-04-03 18:05:04 +03:00
Alexander Udalov
cbc893ed17 Minor, drop useless class in cli-runner
Use a simple List<URL> instead of Classpath
2017-04-03 18:05:04 +03:00
Alexander Udalov
93d5f6e635 Fix NPE on equals/hashCode of local function references
Anonymous classes for local function references implement their
getOwner() as "return null" currently (KT-14291). To avoid NPE in this
case, we now consider two local functions the same if their name and
signature are equal. This is incorrect in general, but unlikely to cause
major problems and is going to be fixed by KT-14291 eventually anyway

 #KT-17055
2017-04-03 18:05:04 +03:00
Alexander Udalov
8dc4fa62ac Minor, drop unused directive and test
The directive was only used in this test and it had no effect on the
behavior of the test. The test is removed because it's equivalent to
simple.kt in the same directory
2017-04-03 18:05:04 +03:00
Mikhail Zarechenskiy
bff9ebc0d5 Fix check for instance for types with compatible upper bounds
#KT-5246 Fixed
2017-04-03 16:25:32 +03:00
Mikhail Zarechenskiy
1e56815b3b Do not show warning about useless elvis for error function types
#KT-17214 Fixed
 #KT-12112 Fixed
2017-04-03 16:25:32 +03:00
Mikhail Zarechenskiy
3cdf6c898a Warn for unnecessary (!!) assertion after method with generics
#KT-12276 Fixed
2017-04-03 16:25:32 +03:00
Mikhail Zarechenskiy
4aa808b250 Fix warning about useless elvis when generics are involved
#KT-13648 Fixed
2017-04-03 16:25:32 +03:00
Alexander Udalov
0badc686ca Minor, inline FunctionCodegen.getSignatureMapper 2017-04-03 14:51:19 +03:00
Alexander Udalov
78e278ec4c Remove redundant type arguments for Java 8+ in compiler modules 2017-04-03 14:51:18 +03:00
Alexander Udalov
d440f07111 Use Java 7+ diamond operator in compiler modules 2017-04-03 14:51:15 +03:00
Alexander Udalov
37f435da93 Use List.sort instead of Collections.sort 2017-04-03 14:50:33 +03:00
Alexander Udalov
a9f35ae898 Replace Map operations with computeIfAbsent 2017-04-03 14:50:32 +03:00
Alexander Udalov
5ebee6ceca Use Java 8 lambdas instead of anonymous classes in compiler modules 2017-04-03 14:49:23 +03:00
Alexander Udalov
6aa0f7bb65 Use multi-catch when possible 2017-04-03 14:26:53 +03:00
Alexander Udalov
34f0576135 Invoke "remove unnecessary final" intention in compiler modules 2017-04-03 14:26:52 +03:00
Alexander Udalov
463bbbd386 Use try-with-resources instead of manual try/finally 2017-04-03 14:26:51 +03:00
Alexander Udalov
08b50cab08 Use java.util.function.Predicate instead of Guava 2017-04-03 14:26:50 +03:00
Alexander Udalov
f723ad76f7 Use java.util.function.Predicate instead of Guava in JS modules 2017-04-03 14:26:49 +03:00
Mikhael Bogdanov
7c3ad97df5 Test for obsolete KT-17134: java.lang.VerifyError: Bad type on operand stack
#KT-17134 Obsolete
2017-04-01 15:34:56 +02:00
Nikolay Krasko
4dcae54ed1 Refactoring: extract lambda expression element type to separate class 2017-04-01 11:52:47 +03:00
Nikolay Krasko
6201aa4fd9 Re-parse after lambda was converted to block (KT-17156)
#KT-17156 Fixed
2017-04-01 11:52:46 +03:00
Ilya Gorbunov
c740c0b177 Do not produce javadoc for kotlin-compiler and do not attach it to maven artifacts 2017-04-01 04:32:01 +03:00
Nikolay Krasko
e7ac7deabd Fix psi traverse without read action exception in debugger 2017-04-01 01:39:08 +03:00
Anton Bannykh
3eb5ce7d9a JS: polyfill ArrayBuffer.isView in order to support PhantomJS 2017-03-31 21:20:01 +03:00
Alexander Udalov
dac9ed4a33 Fix compilation of kotlin-script-util
See 20d5616
2017-03-31 20:14:13 +03:00
Alexey Sedunov
96b9aba172 Move: Process Kotlin files befoire Java files
This ensures that light classes are updated
before changing references in Java files.

 #KT-10577 Fixed
2017-03-31 18:24:17 +03:00
Alexey Sedunov
2eb912a30c Move: Convert AbstractMoveTest to light fixture test case
Extract multi-module move test to a separate class
2017-03-31 18:24:16 +03:00
Alexey Sedunov
691322e406 Move: Show file dialog if all elements to be moved are KtFile 2017-03-31 18:24:15 +03:00
Alexey Sedunov
64a2fa2d6b Move: Allow changing file package without moving to new directory
#KT-8370 Fixed
2017-03-31 18:24:14 +03:00
Alexey Sedunov
b5db50f429 Move: Implement Kotlin-specific editor for class name
#KT-13192 Fixed
2017-03-31 18:24:13 +03:00
Alexey Sedunov
eaba215bbb Move: Wrap individual internal usages for better preview
Fix unused import removal for internal usages

 #KT-9158 Fixed
2017-03-31 18:24:12 +03:00
Alexey Sedunov
3c6358dd91 Move: Fix file preview presentation
#KT-8930 Fixed
2017-03-31 18:24:11 +03:00
Alexey Sedunov
270168f50f Kotlin Facet: Update multi-editor tabs using project-level settings 2017-03-31 18:24:10 +03:00
Alexey Sedunov
b04cbf537f Kotlin Facet: Fix IAE on null module kind in multi-editor
#KT-17145 Fixed
2017-03-31 18:24:09 +03:00
Alexey Sedunov
313f90e7eb Configuration: Provide title for additional parameters dialog
#KT-17094 Fixed
2017-03-31 18:24:08 +03:00
Alexey Sedunov
3f7b28d840 Configuration: Fix behavior of "output directory" control
#KT-17088 Fixed
2017-03-31 18:24:07 +03:00
Alexey Sedunov
72436c1738 Light Classes: Fix origin search for KtLightSuperTypeReference
Use analyzeFully() when resolving super type references
2017-03-31 18:24:06 +03:00
Dmitry Jemerov
b6a26aa732 Don't delete config and system directories when updating IDEA 2017-03-31 13:18:41 +02:00
Dmitry Jemerov
f3ad2cd1ff Don't recreate ProjectResolutionFacade on every completion
Rely on POM events sent when modifying synthetic file copies during
completion to update the OOCB modification count, and recreate
facade only on OOCB mod count changes.
2017-03-31 12:48:36 +02:00
Nikolay Krasko
0d5913287f Add line numbers for suspend function to enhance stepping (KT-16025)
Stop at function start on step into.
Step at function end on step out.

Both cases should actually be skipped by debugger, but this is postponed
till new backend generation for suspend functions is ready.

 #KT-16025 Fixed
2017-03-30 19:48:49 +03:00
Mikhail Glukhikh
8cfcd7e5a6 Inline function: add extra tests taken from intellij-community 2017-03-30 19:42:22 +03:00
Mikhail Glukhikh
b8b7d1f644 Inline function: keep the function if some usages are not processed 2017-03-30 19:42:20 +03:00
Mikhail Glukhikh
091e875551 Inline function: process usages in children-first order 2017-03-30 19:42:19 +03:00
Mikhail Glukhikh
fc0bf47067 Inline function: use "function" in GUI messages 2017-03-30 19:42:17 +03:00
Mikhail Glukhikh
93b624fdbe Inline function: handle callable references through lambdas 2017-03-30 19:42:16 +03:00
Mikhail Glukhikh
75bb599991 Inline function: handle recursive calls 2017-03-30 19:42:14 +03:00
Mikhail Glukhikh
e79f006659 Introduce dialog for function inlining #KT-6159 Fixed
See KotlinInlineFunctionProcessor and KotlinInlineFunctionDialog
2017-03-30 19:42:13 +03:00
Mikhail Glukhikh
b6803af746 KT-6159: generate Unit while code inlining when needed 2017-03-30 19:42:11 +03:00
Mikhail Glukhikh
7de0197a60 Minor: deprecation fix in ScopeUtils 2017-03-30 19:42:10 +03:00
Mikhail Glukhikh
081caadec1 Fix code inlining for expression body with multiple occurrences
So #KT-17022 Fixed
2017-03-30 19:42:09 +03:00
Mikhail Glukhikh
96846d0b52 Minor: style fix in KotlinInlineFunctionHandler 2017-03-30 19:42:07 +03:00
Mikhail Glukhikh
77888349cd KT-6159: rename duplicates met 2017-03-30 19:42:06 +03:00
Mikhail Glukhikh
342118dfa8 Do not perform function inlining if it's not supported 2017-03-30 19:42:05 +03:00
Mikhail Glukhikh
de861066bf KT-6159: allow local / private functions inlining 2017-03-30 19:42:03 +03:00
Mikhail Glukhikh
127b7c80df Some inline tests that do not work 2017-03-30 19:42:02 +03:00
Mikhail Glukhikh
1d5b8ea029 KT-6159: Inline function refactoring enabled 2017-03-30 19:42:00 +03:00
Pavel V. Talanov
795a83ee24 LookupTracker.DO_NOTHING is the default implementation of LookupTracker 2017-03-30 18:59:19 +03:00
Pavel V. Talanov
aeda85b256 FileScopeProvider(Impl): use DefaultImplementation annotation 2017-03-30 18:59:17 +03:00
Pavel V. Talanov
2b373a3601 Component container add tools to specify default implementation of a component 2017-03-30 18:59:14 +03:00
Simon Ogorodnik
8bd23d71a7 Fix J2K to apply post convert intentions on EDT only
#KT-16754 fixed
2017-03-30 18:48:39 +03:00
Simon Ogorodnik
6cbeffe4b2 Add kotlinx.coroutines to IDEA dependencies
Add some cool coroutine-based stuff
Like CoroutineDispatcher for EDT
2017-03-30 18:48:37 +03:00
Dmitry Jemerov
f255f2a1e0 Optimize isReferenceTo() when searching for PsiMethod usages
Avoid resolving references when we know from context that a reference
at given location can't resolve to a PsiMethod.
2017-03-30 15:33:11 +02:00
Mikhail Glukhikh
e3f0a604d1 Use library-only sources as resolve scope from library #KT-12264 Fixed 2017-03-30 13:55:56 +03:00
Ilya Gorbunov
322ec0fa32 Do not add library with empty path when libraries argument is empty
#KT-17059

-libraries parameter without argument can be passed by maven or gradle, when there are no dependencies specified.
2017-03-30 13:43:55 +03:00
Mikhail Zarechenskiy
fd6ed5aa72 Fix bogus warning about numeric overflow when value is zero
#KT-17149 Fixed
2017-03-30 13:27:53 +03:00
Mikhail Zarechenskiy
3820c7653b Update configuration for bytecode listing tests by directives in files 2017-03-30 13:27:51 +03:00
Mikhail Zarechenskiy
aec0c029e5 Display description of language version in options 2017-03-30 13:27:50 +03:00
Mikhail Zarechenskiy
5750a96b13 Write to configuration files only version without description 2017-03-30 13:27:49 +03:00
Mikhail Zarechenskiy
c512453e16 Show LV=1.2 in IDE only in internal mode 2017-03-30 13:27:48 +03:00
Mikhail Zarechenskiy
5027a76ed4 Add strong warning when trying to compile with experimental LV 2017-03-30 13:27:47 +03:00
Mikhail Zarechenskiy
54f034a636 Place array literals in annotations feature under the version 1.2 2017-03-30 13:27:46 +03:00
Mikhail Zarechenskiy
20d5616d75 Introduce Kotlin language version 1.2
Wherein DEFAULT version is still 1.1, which means that version 1.2 should be configured manually
2017-03-30 13:27:45 +03:00
Mikhail Zarechenskiy
283ed85df2 Drop useless parameter and avoid creating sets 2017-03-30 13:27:44 +03:00
Alexander Udalov
3655fc02bd Support running Kotlin compiler daemon on JDK 9
This should have fixed the compiler that is run in Gradle on Java 9, but
there's another issue filed as KT-17112

 #KT-17112 Open
 #KT-14988 Fixed
2017-03-30 13:05:24 +03:00
Alexander Udalov
a5d70cfa68 Support running Kotlin compiler CLI on Java 9 on Unix
Workaround IDEA-170005, IDEA-170494 and similar issues by opening the
required packages from java.base to the unnamed module

 #KT-14988 In Progress
2017-03-30 13:04:41 +03:00
Dmitry Jemerov
03a26c4ce0 Set language level 6 for modules using JDK 6 2017-03-29 18:41:00 +02:00
Mikhail Glukhikh
a35b770c8d Evaluate allImplementingModules lazily #KT-17136 Fixed 2017-03-29 18:17:55 +03:00
Dmitry Jemerov
e66d5d6e1a Advance Java language level 2017-03-29 17:10:22 +02:00
Simon Ogorodnik
ddcff3c96d Fix ImportFixBase to compute suggestions not on EDT 2017-03-29 17:35:13 +03:00
Vyacheslav Gerasimov
94b261d701 Add changelog for 1.1.2 2017-03-29 16:00:38 +03:00
Dmitry Petrov
caae6ff2ec KT-16264 Forbid usage of _ without backticks
Forbid underscore-only (_, __, ___, ...) names as callees and as types.

If CHECK_TYPE directive is on, filter out UNDERSCORE_USAGE_WITHOUT_BACKTICKS messages.
2017-03-29 15:47:22 +03:00
Ilya Chernikov
0a3c031528 Optimize and simplify script deps cache and appropriate index rebuilding 2017-03-29 13:29:47 +02:00
Dmitry Petrov
2a97fb17ba Fix source information mapping in PsiSourceManager
Add tests for source information mapping

KT-17108 source information corrupted on PSI -> IR transformation
2017-03-29 13:03:38 +03:00
Anton Bannykh
4086a84622 JS: add suffix '_test' to test module output files to avoid name conflicts (KT-16979)
Also stop setting AMD module ids explicitly.
2017-03-28 21:44:56 +03:00
Anton Bannykh
867bd13ce4 JS: make tests dependent on primitive array is checks pass even when -Xtypedarray is disabled (related: KT-17137) 2017-03-28 21:41:20 +03:00
Anton Bannykh
7d4c26c0c1 JS: fix maven SeleniumTest 2017-03-28 21:23:21 +03:00
Pavel V. Talanov
df71116dc5 KtLightElements: fix KtLightMember not extending KtLightDeclaration
Fix problem introduced in 4b85fd9fbe
2017-03-28 19:47:13 +03:00
Dmitry Jemerov
6febe1e8a2 Convert RenameTest to light fixture test case
Extract multi-module rename test to a separate class.
2017-03-28 15:48:38 +02:00
Yan Zhulanow
228b3c56a3 Minor: fix failing CliTestGenerated#testPluginSimple test
Add missing Android Dialog stub cause Android Extensions plugin now generates the synthetic property for Dialog.
2017-03-28 16:08:46 +03:00
Dmitry Jemerov
8ec70f44dc Log fallbacks to plain text search when searching expressions of type
This will help diagnose performance problems in IDEA inspections.
2017-03-28 13:00:56 +02:00
Dmitry Jemerov
f13c1b8d87 Convert MultiFileIntentionTest to light fixture test case 2017-03-28 11:36:29 +02:00
Alexey Andreev
de58786fcc Regenerate LightAnalysisModeTestGenerated 2017-03-28 11:32:47 +03:00
Alexey Andreev
8fe96664b7 Fix initialization order of enum with companion object in JS BE
Make enum entries initialize before companion object. This helps
in situation when companion object initializer refers to enum fields.
JVM be generates <clinit> method which first initializes all enum fields
and then runs companion object initializer. This commit introduces the
similar behaviour in JS BE. The old behaviour was: initialize companion
object in constructor. In enum, constructor is called to initialize
enum fields, so previously companion object was initialized first,
which is incorrect.

See KT-16745
2017-03-28 11:32:46 +03:00
Alexey Andreev
0606ebe0dc Fix suspend function with default argument
In JS BE, fix translation of suspend function with default argument
inherited from interface.

See KT-16658
2017-03-28 11:32:45 +03:00
Alexey Andreev
6ba3812582 Fix inlining of tail call suspend function
When inlining tail-call suspend function to regular
suspend function in JS BE, don't forget to insert suspension point.
See KT-16951
2017-03-28 11:32:45 +03:00
Alexey Andreev
466540399c Fix translation of copy() fun in data class
Fix translation of copy() function in data class which has secondary
constructor in JS BE. See KT-16717.
2017-03-28 11:32:44 +03:00
Mikhail Zarechenskiy
b46205f60b Add tests to check collection literals with varargs 2017-03-28 09:01:57 +03:00
Sergey Igushkin
ae2b4f5ff2 Support omitting version of org.jetbrains.kotlin dependencies
Related to #KT-12792
2017-03-28 03:57:38 +03:00
Sergey Igushkin
9ba84df954 Fixed classes copying fail in cases when destinationDir has changed
Added @Input to the property returning classes dirs: it will make
Gradle fall back to non-incremental input when the property value
changes.

Issues: #KT-16820 Fixed
2017-03-28 03:53:11 +03:00
Jonathan Leitschuh
cc0ac36fed Java IC compatibility fix for Gradle 2.14+
Added version check to switch between old and new approaches because
Gradle versions before 2.14 have a bug in Java IC.
Added Kotlin classes to Java task input.
Added  annotationsFile into task input to include it into up-to-date check.

Related issues: #KT-16585 Fixed
2017-03-28 03:47:21 +03:00
Anton Bannykh
9b34e21619 JS: fixed <Type>Array.iterator methods; added -Xtypedarray compiler key
The <Type>Array.iterator used to lack next<Type>() method (KT-16626).

The -Xtypedarray compiler key enables translation of primitive arrays
to TypedArrays, and primitive array`is`-checks (KT-15358, KT-14007,
KT-14614, KT-16056).
2017-03-27 23:09:34 +03:00
Vyacheslav Gerasimov
ba5e78a917 Replace deprecated Iterators.emptyIterator() in JavaContext.java
with ContainerUtil.emptyIterator()
2017-03-27 21:35:11 +03:00
Pavel V. Talanov
ca6516c2a2 findDecompiledDeclaration: find builtIns more accurately
Use resolveScope of a reference to help searching for builtIn binaries
Do not search non-builtIn descriptors in random scopes
2017-03-27 21:24:45 +03:00
Dmitry Jemerov
265e765ec9 Allow to exclude specific qualified names from import in tests
In tests, ImportFix imports the first available candidate. This can
lead to non-deterministic tests when multiple candidates are available.
With this fix, unwanted candidates can be excluded.
2017-03-27 19:48:59 +02:00
Dmitry Jemerov
88372132be Delete Android facet in teardown 2017-03-27 19:48:58 +02:00
Dmitry Jemerov
79c814636e Convert AddOpenToClassDeclarationTest to regular multifile quickfix test 2017-03-27 19:48:52 +02:00
Dmitry Jemerov
4f229c3fdc Convert AbstractQuickFixMultiFileTest to light fixture test case 2017-03-27 19:48:51 +02:00
Dmitry Jemerov
387dbdf3bb AbstractQuickFixMultiFileTest: J2K 2017-03-27 19:48:50 +02:00
Dmitry Jemerov
d11ea64f00 AbstractQuickFixMultiFileTest: rename to .kt 2017-03-27 19:48:49 +02:00
Dmitry Jemerov
e2f75463d7 Rewrite AbstractQuickFixTest based on light fixture test case
Don't reconfigure runtime before every test. For consistency,
mark tests that require the runtime with directives instead of relying
on test file names.
2017-03-27 19:48:43 +02:00
Dmitry Jemerov
34ad19a912 AbstractQuickFixTest: J2K 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
ad59a122ac AbstractQuickFixTest: rename to .kt 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
9d74657f11 Mark KotlinCodeInsightTestCase as deprecated 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
9a5028c4f2 Convert KotlinShortNamesCacheTest to light test case; cleanup code 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
159c2382b4 Convert KotlinChangeSignatureTest to light test case 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
e9998aa329 AbstractResolveByStubTest: convert to light test case 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
d8bbb8f2ef AbstractResolveByStubTest: J2K 2017-03-27 19:45:50 +02:00
Dmitry Jemerov
49aaa0edf6 AbstractResolveByStubTest: rename to .kt 2017-03-27 19:45:50 +02:00
Alexander Udalov
ccd3781403 Disallow using named arguments for members of header classes
#KT-17083 Fixed
2017-03-27 20:10:18 +03:00
Alexander Udalov
b971ac9312 Allow impl declarations to have flexible types
Types of the corresponding parameters (or type parameter bounds, types
in supertypes, etc) are now compatible not only if they're equal, but
also if values of those types are mutually assignable (if "a" is subtype
of "b" and "b" is subtype of "a")

 #KT-17005 Fixed
2017-03-27 20:10:17 +03:00
Alexander Udalov
116380a826 Allow impl declarations to have non-stable parameter names
#KT-17027 Fixed
2017-03-27 19:50:25 +03:00
Alexander Udalov
633798db18 Render incompatible impl member in "no impl for header" diagnostic 2017-03-27 19:50:25 +03:00
Alexander Udalov
db1f039586 Serialize and deserialize 'header' modifier for descriptors
This fixes KT-17001 because now 'header' modifier is loaded correctly
for deserialized members and the standard disambiguation in
OverloadingConflictResolver.compareCallsByUsedArguments takes place,
where header members are discriminated against the corresponding impl
members

 #KT-17001 Fixed
2017-03-27 19:50:25 +03:00
Pavel V. Talanov
ee33879031 Light class tests: hidden deprecated affects codegen
Provide fix later
2017-03-27 17:59:05 +03:00
Pavel V. Talanov
e822a17c0d Lazy light classes: can't use laziness for classes with supertypes delegates 2017-03-27 17:59:03 +03:00
Pavel V. Talanov
2291d91109 KtLightMethod: isVarArgs() does not trigger exact delegate computation 2017-03-27 17:59:01 +03:00
Pavel V. Talanov
c4be805962 Light members: allow to get modifier list without computing delegate 2017-03-27 17:58:59 +03:00
Pavel V. Talanov
e84a674504 LazyLightClassDataHolder: rollback optimization on suspected inherited internal visibility
Internal visibility affects member names
2017-03-27 17:58:57 +03:00
Pavel V. Talanov
ec895f18f2 Light classes: refactor, move getOrigin to corresponding classes 2017-03-27 17:58:55 +03:00
Pavel V. Talanov
a2511232ab Lazy light classes: fix visibility modifier in case of inherited protected visibility 2017-03-27 17:58:53 +03:00
Pavel V. Talanov
a81bac0b50 LightClassTest: test corner cases related to inherited visiblity
EA-99155
 #KT-16899 Fixed
2017-03-27 17:58:51 +03:00
Pavel V. Talanov
4b85fd9fbe Refactor light members: introduce KtLightMemberImpl
Holds common code for fields and methods
2017-03-27 17:58:49 +03:00
Pavel V. Talanov
a44aa8e112 Introduce KotlinOverridableInternalMembersShortNameIndex
Keeping track of all potentially overridable internal members
To optimize certain scenarios in light classes
2017-03-27 17:58:47 +03:00
Pavel V. Talanov
24303c8b39 Minor, stubs: isTrait -> isInterface 2017-03-27 17:58:45 +03:00
Alexander Udalov
1c7ac2da5a Do not use CoreJavaFileManager in KotlinCliJavaFileManagerImpl
The inheritance is still needed because of the code in intellij-core,
specifically in JavaCoreProjectEnvironment.addSourcesToClasspath and
CoreJavaDirectoryService.getPackage, which assumes that the
JavaFileManager instance in the project is a CoreJavaFileManager
2017-03-27 17:19:25 +03:00
Alexander Udalov
c67eb84369 Support nested classes in KotlinCliJavaFileManagerImpl.findClass
findClass(String, GlobalSearchScope) is invoked for example when we're
resolving supertypes of classes in Java libraries. Previously, it never
found nested classes and falled back to CoreJavaFileManager's
implementation, which lacks a fix for the original issue (KT-12664,
which was fixed in JvmDependenciesIndex in 5a533a52 and 164c72e8)

 #KT-16931 Fixed
2017-03-27 17:19:24 +03:00
Alexander Udalov
f1a1ebae01 Refactor JvmDependenciesIndex
- Move collectKnownClassNamesInPackage to the only place where it's used
- Fix warnings/inspections and simplify implementation a bit
2017-03-27 17:19:24 +03:00
Alexander Udalov
801a93edbc Refactor KotlinJavaPsiFacade.KotlinPsiElementFinderImpl
Split KotlinPsiElementFinderImpl into two classes: one is used in the
compiler (boolean field isCliFileManager previously handled that), the
other is used in IDE and possibly other non-CLI scenarios.

Also avoid a possible class cast exception in
KotlinJavaPsiFacade.knownClassNamesInPackage
2017-03-27 17:19:24 +03:00
Dmitry Jemerov
d8dfad875d Drop pre-1.0 whole-project syntax migration actions 2017-03-27 14:57:44 +02:00
Alexander Udalov
d615aba4cf Update KotlinVersion.CURRENT to 1.1.3 2017-03-27 10:48:18 +03:00
Mikhail Zarechenskiy
3f1a43a743 Minor, update test data
See 8466270 for the reason.
 Note that actually we do not report errors on such cases because psiElement is not valid, but in tests for intentions we check all errors
2017-03-27 10:36:10 +03:00
Alexey Sedunov
298ee266c3 Move: Fix conflict checking when switching between similar libraries
#KT-17006 Fixed
2017-03-26 12:56:26 +03:00
Alexey Sedunov
45b8cd29e1 Resolution Facade: Add explicit property for file target platform 2017-03-26 12:56:25 +03:00
Alexey Sedunov
87ea13b307 Move: Fix runtime unconfiguration for multiple modules 2017-03-26 12:56:24 +03:00
Alexey Sedunov
1d0162402e Move: Fix processing of calls and callable references
Fix CCE on callable references to Java methods.
Fix qualification of callable references without receivers.
Fix processing of calls/callable references to object extensions
and extension members.
Do not explicate short companion references

 #KT-16809 Fixed
2017-03-26 12:56:24 +03:00
Alexey Sedunov
58495555dc Move: Perform extension import insertion after reference shortening 2017-03-26 12:56:22 +03:00
Alexey Sedunov
b3274acfc0 Refactor KotlinShortenReferencesRefactringHelper
Rename refactoring helper and its infrastructure
Add support for different request types
2017-03-26 12:56:21 +03:00
Alexey Sedunov
dc04b200b6 Move: Do not shorten references unaffected by the refactoring 2017-03-26 12:56:20 +03:00
Alexey Sedunov
aad11ff0f4 Shorten References: Skip companion receivers on callable references
This is temporary fix due to KT-13934 which prevents resolution
of references like X::foo where foo is a member or extension
of X companion object
2017-03-26 12:56:19 +03:00
Alexey Sedunov
d71cefee8a Move: Fix "scanEntireFile" values after the refactoring
#KT-17032 Fixed
2017-03-26 12:56:18 +03:00
Alexey Sedunov
b818ef0a51 Kotlin Facet: Detect module platform by 'kotlin'/'kotlin2js' plugin 2017-03-26 12:56:17 +03:00
Alexey Sedunov
0ad28228d7 Kotlin Facet: Fix settings initialization 2017-03-26 12:56:16 +03:00
Ilya Gorbunov
d54f11421f Run gradle unit tests with Java 8 2017-03-25 04:14:17 +03:00
Ilya Gorbunov
6dc4056d5f Fix missing kotlin-test dependencies
(previously it was bundled to kotlin-compiler-embeddable)
2017-03-25 04:13:52 +03:00
Vyacheslav Gerasimov
8c41e44b3b Fix MovePropertyToConstructorIntention and broken tests 2017-03-24 21:55:27 +03:00
Dmitry Jemerov
efa03e7ad8 Fix project leaks in tests 2017-03-24 19:51:32 +01:00
Yan Zhulanow
eda3b08c31 Kapt3: Fix Maven build on CI
'tools_jar_profile' Maven profile is activated only if 'kotlin-annotation-processing-maven-build.txt' exists.
It already works this say for the 'kotlin-annotation-processing' artifact.
2017-03-24 20:02:39 +03:00
Yan Zhulanow
e84eadebdc Kapt3: Use 'compilerArgs' safely (KT-16990)
'android-apt' (com.neenbedankt) adds the 'File' instance to 'compilerArgs' (List<String>).
2017-03-24 20:02:38 +03:00
Alexander Udalov
6d69e37fe9 Update to ASM 6-alpha from intellij 171
Will be needed to read module-info files
2017-03-24 19:46:35 +03:00
Alexander Udalov
c99b03d6b3 Remove unused library 'intellij-core-analysis' 2017-03-24 19:46:35 +03:00
Ilya Gorbunov
c98c2d9931 Remove 'nearly_stateless' category, do not mention statefulness for terminal operations.
#KT-16994
2017-03-24 19:06:06 +03:00
Ilya Gorbunov
4018db680e Sequence operation classification regarding their statefulness and laziness.
#KT-16994 Fixed
2017-03-24 19:06:06 +03:00
Alexey Tsvetkov
0a4c43a5f1 Fallback to ProcessBuilder when native ProcessLauncher fails
#KT-16902 fixed
2017-03-24 19:03:41 +03:00
Alexey Tsvetkov
9d95c841a6 Use connect-and-lease when using daemon in JPS & Gradle
Relates to KT-15562 "Service is dying".

This commit includes multiple changes:
 1. JPS & Gradle daemon clients are refactored to use `connectAndLease` from `KotlinCompilerClient`.
 `connectAndLease` was introduced in previous commits
 2. `withKotlin` was removed because `connectAndLease` already covers retrying on connection error
 3. Gradle flag files creation is changed:
   * client-alive flag file lives as long as Gradle instance lives,
   * session-alive flag file lives until the end of a build.
2017-03-24 19:03:36 +03:00
Alexey Tsvetkov
9819de1abd Improve daemon client debug reports
Before this change a daemon client debug messages were printed
only when the client could not connect and the 'kotlin.daemon.verbose'
system property was set up.

Now messages are printed if the debug logging is enabled and
the 'kotlin.daemon.verbose' is set up.
2017-03-24 19:03:32 +03:00
Alexey Tsvetkov
c5324fcc50 Speed up daemon startup when DNS timeouts
#KT-16917 fixed

The daemon code contained the following code:
```
ManagementFactory.getRuntimeMXBean().name
```

As it turns out `RuntimeImpl#getName` calls `VMManagementImpl#getVmId`,
which in turn calls `InetAddress.getLocalHost().getHostName()`.

`InetAddress.getLocalHost()` tries to resolve by making a DNS-request.
In case of a DNS-problem or a network misconfiguration,
resolving localhost can be very slow,
so a daemon client can disconnect
by the timeout (10 seconds) and fallback to the non-daemon compilation.

This change removes the call `getRuntimeMXBean().name`
(it is only used for logs).
2017-03-24 19:03:28 +03:00
Alexey Tsvetkov
da24a99b91 Set 'java.rmi.server.hostname' property on client too
The RMI documentation (http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/javarmiproperties.html)
says it is useful to set up a `java.rmi.server.hostname`
system property on a client and a server.
When the property is set up on a client, I saw that "RenewClean" threads
stopped listening to my external IP, so all client and server threads
are now only listening the loopback interface.

I also changed the way the property is set up on the server side:
before the change it was passed in jvmargs at a process launcher.
I moved this code directly to the main method of the daemon,
because it is easy to forget to set up the property,
when running the main for debug purposes.
2017-03-24 19:03:24 +03:00
Alexey Tsvetkov
f748dc625c Minor: print errors to stderr when gradle test build
It takes time to find compile errors or exceptions,
when a Gradle test build fails, because a debug log
is very verbose.
This change prints all error messages from Gradle
when a test build fails unexpectedly.
2017-03-24 19:03:19 +03:00
Dmitry Jemerov
961d83fcd4 Bump code cache size (64m is no longer enough under JDK 8) 2017-03-24 16:40:23 +01:00
Dmitry Jemerov
859e3e17b4 Bump code cache size (64m is no longer enough under JDK 8) 2017-03-24 16:37:11 +01:00
Vyacheslav Gerasimov
543f59bf54 Add new quickfix for CanBePrimaryConstructorPropertyInspection
MovePropertyToConstructorIntention is used as quick fix
2017-03-24 17:38:52 +03:00
mglukhikh
4700936f66 DFA: count null comparison as identity comparison #KT-16538 Fixed
+ minor parameter refactoring
2017-03-24 17:33:42 +03:00
Mikhail Glukhikh
b5aa529901 Make inspection "lambda->reference" off by default #KT-17002 Fixed 2017-03-24 16:20:07 +03:00
Mikhail Glukhikh
b121990368 Don't suggest 'remove let' when 'it' is used multiple times
So #KT-16857 Fixed
2017-03-24 16:20:00 +03:00
Mikhail Glukhikh
4687a867c3 Anti-KNPE refactoring of RedundantSamConstructorInspection
So EA-84354 fixed
2017-03-24 16:19:47 +03:00
Mikhail Glukhikh
6f4ae2585b Fix "surround with null check": place check correctly for unsafe call
So #KT-16928 Fixed
2017-03-24 16:19:32 +03:00
Mikhail Glukhikh
bbdcf19123 Fix "secondary constructor -> primary" in case of implicit super call
So #KT-16903 Fixed
2017-03-24 16:19:18 +03:00
Mikhail Glukhikh
0baae16601 Don't apply "object->lambda" if 'this' is used inside #KT-15250 Fixed 2017-03-24 16:19:04 +03:00
Mikhail Glukhikh
ca92ec0b7b Fix "Specify explicit lambda signature" when no parameters exists
So #KT-15075 Fixed
2017-03-24 16:18:56 +03:00
Vyacheslav Gerasimov
f60a7ffab0 Add intentions to move property from/to primary constructor
#KT-4578 Fixed
2017-03-24 15:22:50 +03:00
Alexander Udalov
fef4c8ccd8 Fix VerifyError on bound function reference on generic property
Also add a test for obsolete KT-14755

 #KT-16929 Fixed
2017-03-24 11:06:15 +03:00
Dmitry Petrov
fc38479f48 References to enum entries should be always generated as GET_ENUM 2017-03-24 10:06:10 +03:00
Dmitry Petrov
64013171e8 KT-16905 Wrong IR for call to inner class constructor through typealias 2017-03-24 10:06:10 +03:00
Dmitry Petrov
d05de88e3e KT-16904 Wrong IR when applying some operators to superclass properties in constructor
Use property accessors for assignment generation for inherited properties in constructor.
2017-03-24 10:06:10 +03:00
Nikolay Krasko
5405c81106 Minor: remove warnings in KotlinDebuggerTestBase 2017-03-23 21:01:42 +03:00
Nikolay Krasko
dfd7b0f388 Delegate step into command to kotlin command provider first 2017-03-23 21:01:42 +03:00
Nikolay Krasko
2c4f702d50 Remove stored contexts in tests to avoid leaks 2017-03-23 21:01:42 +03:00
Nikolay Krasko
2aa1b19ec9 Replace CompilingEvaluatorUtils methods with ClassLoadingUtils 2017-03-23 21:01:42 +03:00
Ilya Chernikov
3b60d56c0b minor: fixing maven plugin tests 2017-03-23 18:11:40 +01:00
Ilya Chernikov
4d7e64614a Make daemon tests more stable
Probably due to switching to the JDK8, the daemon tests became more flaky.
Making it less reliable on the log file closing. And try to close log files
on the daemon side.
Also improving diagnostics on many tests.

Also weaken parallel daemon start test a bit since it seems it is failing
on the RMI timeouts now.
2017-03-23 18:11:39 +01:00
Ilya Chernikov
c034a73d72 Extract and reuse JarFS-related IO fallback configurator function
Partly fixes #KT-16927
2017-03-23 18:11:38 +01:00
Ilya Chernikov
e59f6741c4 Move GradleScriptTemplatesProvider to the optional gradle part of "plugin.xml"
Fixes #KT-16649
2017-03-23 18:11:37 +01:00
Ilya Chernikov
8eaeadddfa Disable flaky statistical benchmark tests for source sections plugin and JSR 223 2017-03-23 18:11:36 +01:00
Ilya Chernikov
3061862d31 Fix classloader extraction from script template
fixes #KT-16699
2017-03-23 18:11:35 +01:00
Ilya Chernikov
6b477e9f38 Remove jna from compiler-embeddable
It is considered in fact unused in the compiler
Fixes #KT-16862
2017-03-23 18:10:55 +01:00
Ilya Chernikov
319440718c Add more JSR 223 and repl tests, fix double aggregation of GenericRepl state
- repl test with compilation error
- JSR 223 compilable tests
2017-03-23 18:07:45 +01:00
Ilya Chernikov
adc541c3b1 minor: Move sameSignature function into single use site to avoid local build problems 2017-03-23 18:07:44 +01:00
Dmitry Jemerov
b24ce04dea Convert IntentionTestGenerated to light fixture test case 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
5af423f1b4 Allow configuring kotlin.test in KotlinLightCodeInsightFixtureTestCase 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
036b87a001 KotlinJdkAndLibraryProjectDescriptor: J2K 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
1435f11a9f KotlinJdkAndLibraryProjectDescriptor: rename to .kt 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
24bdf994a9 AbstractIntentionTest: J2K 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
68ec8b3077 AbstractIntentionTest: rename to .kt 2017-03-23 15:48:33 +01:00
Dmitry Jemerov
199ce6706b Convert AbstractConcatenatedStringGeneratorTest to light test case
Remove explicit library configuration; rely on
getProjectDescriptorFromFileDirective() instead.
2017-03-23 15:48:33 +01:00
Mikhail Glukhikh
1780f7c9a2 Put not-null original type as last possible smart cast target
This fixes muted tests testSmartCast (IDE highlighting) and
testNestedSealed (Diagnostics).
Together with commit 555b3f12 this makes #KT-15901 Fixed
2017-03-23 17:17:37 +03:00
Ilya Gorbunov
1cb4580380 Refactor: rename 'check' helper function with more descriptive name, remove 'var result' 2017-03-23 16:48:38 +03:00
Ilya Gorbunov
dce0da68c6 Cleanup: post-cleanup after deprecation cleanup in compiler
Replace `takeIf { !expr }` with `takeUnless { expr }`.
Cleanup redundant parethesis as in `listOf((expr))`.
Replace `listOf(expr)` with `expr.let(::listOf)` where the former caused significant indentation change.
2017-03-23 16:48:38 +03:00
Nikolay Krasko
e599688733 "Go to Type Declaration" for extension receiver and 'it' (KT-13013)
#KT-13013 Fixed
2017-03-23 13:37:06 +03:00
Nikolay Krasko
daaa59a1ad Navigate to receiver from this in extension function (KT-16991)
#KT-16991 Fixed
 #KT-13013 In Progress
2017-03-23 13:37:05 +03:00
Nikolay Krasko
9dfc92c55e Navigate to lambda declaration from generated 'it' (KT-16992)
#KT-16992 Fixed
 #KT-13013 In Progress
2017-03-23 13:37:05 +03:00
Nikolay Krasko
c976c3d909 Refactoring: extract common function (some usages were slightly changed) 2017-03-23 13:37:05 +03:00
Alexander Udalov
ccfa42289c Fix compilation of kotlin-script-util
'check' was removed in 579238c3be
2017-03-23 11:46:26 +03:00
Nikolay Krasko
84c473d800 Speed up debugger tests by replacing base output preprocessor
Avoid calling InetAddress.getLocalHost() that can be very slow.
Exact connection or disconnection string isn't relevant for tests
anyway.
2017-03-23 00:31:43 +03:00
Nikolay Krasko
9ad705a60a Remove all allFiles*.out from debugger output 2017-03-23 00:31:42 +03:00
Yan Zhulanow
cba523958e Android Extensions: Support Dialog classes (KT-16957) 2017-03-22 22:03:22 +03:00
Yan Zhulanow
f1e303e18d Minor: Update kapt tests for Kotlin 1.1 2017-03-22 22:03:21 +03:00
Yan Zhulanow
9d8adc1882 Minor: Execute kapt in IDEA tests 2017-03-22 22:03:20 +03:00
Yan Zhulanow
e93bc4c00d Kapt3, minor: Enable parameter name saving in javac ClassReader 2017-03-22 22:03:19 +03:00
Yan Zhulanow
7535778ed4 AllOpen, NoArg: Check for the Gradle plugin in the classpath properly
Path segments in the plugin classpath entries are separated by the system file separator, not by '/'.

This fixes KT-16901
2017-03-22 22:03:19 +03:00
Yan Zhulanow
0379254918 Kapt3: Fix compatibility with IC (KT-16753)
Kapt does not support incremental compilation for stubs so we should delete source stubs before running annotation processing.
2017-03-22 22:03:18 +03:00
Yan Zhulanow
8ac14ab930 Android Extensions: Allow to disable IDE support (KT-12741)
Enable IDE plugin only if it is enabled in the build.gradle file.
2017-03-22 22:03:17 +03:00
Yan Zhulanow
5d4cefcc30 AllOpen: Do not make private members open (KT-16627) 2017-03-22 22:03:00 +03:00
Yan Zhulanow
bb0a46ac17 Kapt3: Ignore inner classes with clashing names (KT-16458)
Ignore classes (and references to such classes in declaration signatures) if one of the containing classes has the same simple name. This is forbidden in Java, thus should not be present in kapt source stubs.
2017-03-22 22:02:30 +03:00
Yan Zhulanow
2afc27a462 Initial implementation of kapt for Maven (KT-14478) 2017-03-22 22:02:29 +03:00
Yan Zhulanow
40fa5fb758 Kapt3: Support 'processors' option in Gradle plugin (KT-8558)
Also warn if kapt3 options are used without the "apply plugin: 'kotlin-kapt'" specified.
2017-03-22 22:02:28 +03:00
Yan Zhulanow
47ab47d6d1 Kapt3: Support 'processors' option in the compiler plugin (KT-8558)
Support specifying qualified names of annotation processors in the kapt3 compiler plugin (feature-parity with javac).
2017-03-22 22:02:27 +03:00
Yan Zhulanow
d30dbf25b5 Kapt1: Allow to use spaces in the collected identifiers (KT-12769) 2017-03-22 22:02:26 +03:00
Yan Zhulanow
948207be30 AllOpen, NoArg: Use the bundled plugins in Maven projects
Use the bundled compiler plugins for Maven projects (as we do for Gradle projects already) because the plugin provided as a dependency in the POM file may have an incompatible version.
2017-03-22 22:02:25 +03:00
Yan Zhulanow
4a2e409948 Kapt3: Support Kotlin sources generation (KT-14070) 2017-03-22 22:02:24 +03:00
Ilya Gorbunov
3088586ac3 Add runnable samples for trimIndent and trimMargin.
#KT-9786 Fixed
2017-03-22 21:54:46 +03:00
Alexander Udalov
579238c3be Remove deprecated declarations from project code, cleanup usages 2017-03-22 20:25:54 +03:00
Alexander Udalov
6a049c9ab5 Fix Java6BuiltInsWithJDKMembersTest
After update of the project to JDK 8, the default JDK at java.home is
now JDK 8. However, this test relied on the fact that the default is JDK
6. Pass the path to the JDK 6 explicitly
2017-03-22 20:24:28 +03:00
Alexander Udalov
e4ae7ca4ce Use type substitution when matching header-impl members
Previously, type substitution, which is critical for matching generic
header/impl members with each other, was only performed when
checkImplementationHasHeaderDeclaration was called for impl class
(areCompatibleClassifiers creates the correct substitutor). This was
done in areCompatibleClassifiers: a substitutor which maps type
parameters of the header class to type parameters of the impl class was
created.

Now we create the same substitutor when
checkImplementationHasHeaderDeclaration is called for an impl member of
an impl class as well, manually.

 #KT-15230 Fixed
2017-03-22 20:19:14 +03:00
Alexander Udalov
4c868be869 Minor, render "header" or "impl" in LazyClassDescriptor.toString
This makes debugging of multi-platform compilation much easier
2017-03-22 20:19:13 +03:00
Alexander Udalov
81774926fa Discriminate header class in resolution from sources in AbstractLazyMemberScope
Similarly to getFirstClassifierDiscriminateHeaders, we select the first
non-header class if possible, otherwise we select just the first class.
This makes sure that a reference will never be resolved to a header
class if the corresponding impl class is present.

Note that overall the issue may not be fixed yet, because there are
other scopes where header classes are not yet discriminated
(LazyImportScope, DeserializedMemberScope). However, at this point I
cannot reproduce this problem with these other scopes

 #KT-15521 Fixed
2017-03-22 20:18:16 +03:00
Alexander Udalov
93e3bdc1ab Improve multi-platform integration test
Compile the platform-specific code two times: once with the common file
first and the platform file second, and once with the platform file
first and the common file second in the compilation arguments. This is
needed because some issues in the compiler are only reproducible in one
of these two scenarios
2017-03-22 20:18:04 +03:00
Alexander Udalov
82c5c586b1 Minor, remove unnecessary test data files 2017-03-22 20:11:02 +03:00
Dmitry Jemerov
3caf7f112a Disable JAnsi in tests
Workaround for https://github.com/fusesource/jansi/issues/66
2017-03-22 16:22:40 +01:00
Mikhail Zarechenskiy
2a93dea0c4 Use concrete candidate to resolve collection literal
This helps to avoid resolution errors when there is local array-like function with the same signature as in built-ins
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
222f101d10 Extract collection literal resolve components to separate Kotlin file 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
8466270bdb Check that arguments of array function call in annotation are constants
#KT-16956 Fixed
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
a2ea518b1a Allow to use collection literals only in annotations 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
bfe2ddf7c1 Introduce language feature for array literals in annotations 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
0f1acab40d Support collection literals in the JVM backend 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
859bccb9fc Propagate resolution results without ambiguity to constant evaluator
This allows to get rid of useless diagnostics that some value is not a constant
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
e49b2811ec Apply constant folding for collection literals to use in annotations
Currently this is achieved with several hacks:
- Postpone computation of argument type info when there is no candidate resolver. We have to do this, because we don't have expected type and therefore we could write wrong information to trace
- Presume that for annotation calls there is only one candidate resolver and then resolve arguments with expected type (see `getArgumentTypeInfo`), otherwise because of quadratic complexity of the algorithm resolve would be slow
2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
c85f6e7d0e Resolve collection literal expression as special array-like function 2017-03-22 17:59:58 +03:00
Mikhail Zarechenskiy
d3fd96ceed Parse collection literals as atomic expressions 2017-03-22 17:59:58 +03:00
Dmitry Jemerov
3c7678092e Don't mark compiler-created PSI elements as generated
This saves some memory on storing the generated flag in the PsiElement
userdata and time required to store the flag.
2017-03-22 13:59:21 +01:00
Alexander Udalov
dc3aa26e3f Ignore getMembersOfStandardJavaClasses light analysis test
See #KT-16616
2017-03-22 14:33:57 +03:00
Alexey Sedunov
56d22277b7 Move: Filter out ConflictUsageInfo instances before running the refactoring
#KT-16556 Fixed
2017-03-22 13:36:19 +03:00
Alexey Sedunov
2f136dae1c Move: KT-8955
Fix NPE on moving directory where at least one Kotlin file
contains package directive unmatched by the containing directory

 #KT-8955 Fixed
2017-03-22 13:36:18 +03:00
Alexey Sedunov
d1857d68bc Move: Fix element listener retrieval
Get element listener before original declaration is invalidated by the refactoring
2017-03-22 13:36:17 +03:00
Alexey Sedunov
1a8aa6091a Move: Fix incorrect FqName when moving declaration to default package
#KT-15586 Fixed
2017-03-22 13:36:16 +03:00
Alexey Sedunov
1331922963 Move: Fix file rename of move
Avoid temporary file rename if the current name doesn't conflict
with other files in the target directory.
Improve protection against exceptions during the refactoring
which may prevent final rename
2017-03-22 13:36:15 +03:00
Alexey Sedunov
92fbca452d Move: Do not report conflict on usages of inherited protected members
#KT-15190 Fixed
2017-03-22 13:36:14 +03:00
Alexey Sedunov
e82b256640 Move: Implement conflict checking for internal members
#KT-13190 Fixed
2017-03-22 13:36:13 +03:00
Alexey Sedunov
6f5249ecc7 Move: Fix processing of references to non-real members of companion object
#KT-15559 Fixed
2017-03-22 13:36:12 +03:00
Alexey Sedunov
bab762b761 Implement post-refactoring optimization of unused imports
#KT-15822 Fixed
 #KT-13755 Fixed
2017-03-22 13:36:11 +03:00
Alexey Sedunov
7d185349c8 Move: Fix broken tests
Check that constructor call corresponds to class being moved before
transforming outer instance to argument
2017-03-22 13:36:10 +03:00
Alexey Sedunov
13de9aea81 Move: Fix processing of conflicting usages
Exclude conflict-associated usages from refactoring.
Move search of file internal usages to MoveKotlinDeclarationsProcessor
2017-03-22 13:36:09 +03:00
Alexey Sedunov
a21f19d613 Move: Use Kotlin declaration mover to handle KtFile
IDEA-provided file mover does not process conflicts

 #KT-13911 Fixed
2017-03-22 13:36:08 +03:00
Alexey Sedunov
9a3ace423a Move: Update test data for tests with conflicts
Check refactoring result for the case when conflicts are ignored.
Fix move destination when moving to another source root
2017-03-22 13:36:07 +03:00
Alexey Sedunov
38f9e99d91 Kotlin Facet: Fix argument merging
#KT-16982 Fixed
2017-03-22 13:36:06 +03:00
Alexey Sedunov
7c7e41592a Kotlin Facet: KT-16980
Avoid reinitialization of module-level settings on each run of
the analyzer in the absence of Kotlin facet

 #KT-16980 Fixed
2017-03-22 13:36:05 +03:00
Alexander Udalov
43f1c843ce Minor, fix typo in docs on built-ins 2017-03-22 13:27:38 +03:00
Dmitry Jemerov
93cb12fed0 Don't keep around an empty value parameters list in FunctionDescriptor 2017-03-22 10:40:19 +01:00
Dmitry Jemerov
3aedf2548c Don't create empty list for Call arguments 2017-03-22 10:40:19 +01:00
Dmitry Jemerov
51c7fc9f73 Don't use UserDataHolder in SlicedMapImpl, use KeyFMap directly 2017-03-22 10:37:07 +01:00
Dmitry Jemerov
f45511b983 Don't recreate Name instances for special resolve constructs 2017-03-22 10:35:16 +01:00
Matthew Brener
adc19b433e its --> it's in Char.kt (#1041) 2017-03-22 10:29:39 +01:00
Yan Zhulanow
7a5f94129c Add ClassBuilderMode.KAPT3 tests 2017-03-21 20:49:36 +03:00
Yan Zhulanow
e25e19c4d6 Refactoring: Remove light analysis test data
The light analysis test data is not needed anymore cause the light analysis result is now automatically checked against the one from the full analysis.
2017-03-21 20:49:36 +03:00
Yan Zhulanow
c50881fd02 Refactoring: Extract light analysis tests from box tests 2017-03-21 20:49:34 +03:00
Mikhail Glukhikh
23848fa728 Suggest bound references in "Lambda --> Reference" for 1.1+ only 2017-03-21 20:32:15 +03:00
Ilya Chernikov
0f21db1ecb Copy base script classes to script-runtime before building bootstrap 2017-03-21 16:30:51 +01:00
Ilya Chernikov
08f6b6c93c minor: get rid of the compiler-test dependency in source-sections test 2017-03-21 16:30:50 +01:00
Ilya Chernikov
1eab936618 minor: Bump rubygrapefruit native-platform version to 0.14 2017-03-21 16:30:49 +01:00
Ilya Chernikov
d439c13fb5 minor: correct measurement error in eval bench test 2017-03-21 16:30:48 +01:00
Ilya Chernikov
4043f491da minor: replace Pair with data class in daemon client connectAndLease call
backport from 1.0.7
2017-03-21 16:30:47 +01:00
Ilya Chernikov
4b430b49a7 Implement source sections compiler plugin
allows to compile only parts of the source files, denoted by top-level
"sections" (function with lambda param calls), but preserving original
file line/column numbers for easier diagnostics. Allow e.g. to compile
gradle "buildscript" section without preprocessing original file in
advance. See tests for examples.
2017-03-21 16:30:46 +01:00
Ilya Chernikov
63c276d444 Create extension points and register plugins earlier...
to allow plugins to affect source files creation
2017-03-21 16:30:45 +01:00
Alexander Udalov
7dfa3bea18 Update tools & libraries projects to use JDK 8 when needed 2017-03-21 17:45:53 +03:00
Alexander Udalov
33a0ae0fcd Skip kotlin-maven-plugin integration test if "skipTests" is defined
Similarly to kotlin-maven-plugin-test/pom.xml
2017-03-21 17:45:51 +03:00
Alexander Udalov
4273357adf Skip kotlin-maven-plugin-test tests if "skipTests" property is defined
"mvn -DskipTests ..." or "mvn -DskipTests=true ..." should not invoke
any tests
2017-03-21 17:45:51 +03:00
Sergey Igushkin
132393cc64 Fix for androidTest Gradle build
Replaced adding Kotlin sources with dependency on copy*KotlinClasses,
which might not be called since Android Gradle plugin sometimes
bypasses the tasks in finalizedBy .
Added a test for androidTest build apart from general build.

Issues: #KT-16897 Fixed
2017-03-21 17:30:59 +03:00
Dmitry Jemerov
ba9213234c Increase -Xmx for running Ant from AntTaskTestGenerated
The current value is no longer sufficient when running under JDK 8.
2017-03-21 15:19:55 +01:00
Sergey Igushkin
498c4dddea Fix for compatibility with Android Gradle plugin 2.4.0-alpha1
Deferred resolution of JAR-to-AAR mapping, since the Android Gradle
plugin now resolves dependencies at execution phase.
Dropped the code related to the Jack toolchain compatibility.
Throwing a build error when Jack is enabled.
Changed warning about Jack into a build error.
2017-03-21 16:56:09 +03:00
Simon Ogorodnik
439e158fb2 Fix failing test after migration to IDEA 171
BasicCompletionWeigherTestGenerated$ExpectedInfo.testPreferMatchingThis
Looks like IDEA now rearranges elements with same weight by length and
then alphabetically
2017-03-21 16:47:16 +03:00
Dmitry Jemerov
f0b7891d41 Turn off API usage inspection 2017-03-21 14:44:20 +01:00
Pavel V. Talanov
a03e9d340e Wrap sourceScope() and binaryScope() using sourceFilterScope
To avoid having to wrap at call site
2017-03-21 16:20:02 +03:00
Pavel V. Talanov
06fd1f3c44 Drop unused LibrarySourceHacks 2017-03-21 16:20:02 +03:00
Pavel V. Talanov
dec9fa0324 SourceNavigationHelper: fix navigation to callables
Previously we could differentiate between callables with the same name
    when relevant type declaration were in the same file only
Problem manifested most severely when several copies of sources were attached
    to the same library
2017-03-21 16:20:01 +03:00
Pavel V. Talanov
d9a9d50602 KotlinScriptConfigurationManager#notifyRootsChanges: run synchronously in tests
Allows to unmute some of the ScriptConfigurationNavigation tests
2017-03-21 16:20:00 +03:00
Pavel V. Talanov
88447d69cb Introduce ScriptDependenciesSourceModuleInfo
Implement SourceForBinaryModuleInfo api to support navigation
Support in getModuleInfo and KotlinCacheServiceImpl
2017-03-21 16:19:59 +03:00
Pavel V. Talanov
434018f679 ScriptConfigurationNavigationTest: test navigation to kotlin library 2017-03-21 16:19:59 +03:00
Pavel V. Talanov
115474b90f SourceNavigationHelper: use API to narrow search scope 2017-03-21 16:19:58 +03:00
Pavel V. Talanov
4dee108afe J2K SourceNavigationHelper: convert to Kotlin and prettify 2017-03-21 16:19:57 +03:00
Pavel V. Talanov
aa74ccf163 J2K SourceNavigationHelper: rename file 2017-03-21 16:19:57 +03:00
Pavel V. Talanov
4c94d931fa findDecompiledDeclaration: narrow decompiled declaration search scope
Search scope of library that descriptor originated from
Introduce API that matches binaries and its' sources via IdeaModuleInfos
2017-03-21 16:19:56 +03:00
Pavel V. Talanov
569e7ac593 getModuleInfo, minor: clarify parameter parameter 2017-03-21 16:19:55 +03:00
Pavel V. Talanov
c7f147d058 Introduce NavigationWithMultipleLibrariesTest
Test navigation to library decompiled and source declaration when
there are multiple copies of the same library in project
Related to ba1ee99e97
2017-03-21 16:19:54 +03:00
Pavel V. Talanov
47e77201d5 AbstractNavigateToLibraryTest: refactor, extract utility code 2017-03-21 16:19:54 +03:00
Alexander Udalov
2d1b15b6fb Drop usages of '-XX:MaxPermSize' in run configurations on JDK 8 2017-03-21 16:09:18 +03:00
Dmitry Jemerov
04b64fa30c Sort Kotlin versions loaded from Maven by number
Otherwise we get 1.0.7 on top of 1.1.1, which is suboptimal
2017-03-21 14:03:25 +01:00
Dmitry Jemerov
8f8db75bb4 getNonConfiguredModules(project, configurator) excludes modules already configured with other configurators
#KT-16381 Fixed
2017-03-21 14:02:05 +01:00
Dmitry Jemerov
95bc0813f8 Don't show "Configure Kotlin" notification with an empty list of configurators (context: KT-16070) 2017-03-21 14:02:05 +01:00
Dmitry Jemerov
9f8af1feea Refactor getNonConfiguredModules(Project)
Rename to getNonConfiguredModulesWithKotlinFiles() to match what it
actually does, remove duplicate configurator status check, extract code
for collecting all configurators
2017-03-21 14:02:05 +01:00
Dmitry Jemerov
b86fe60a24 Don't report "can be configured" status if the file is already configured with another Gradle configurator 2017-03-21 14:02:05 +01:00
Dmitry Jemerov
1f96ead801 "Configure Kotlin in project" handles modules from Gradle source roots
THose modules are now always collapsed to their base modules.
 #KT-11828 Fixed
2017-03-21 14:02:05 +01:00
Dmitry Jemerov
b1a65e4c74 Don't show pre-1.1.0 version of Kotlin in version chooser when configuring JS projects
#KT-16400 Fixed
2017-03-21 14:02:05 +01:00
Dmitry Jemerov
8e26d5257f Don't add stdlib-jre7 or stdlib-jre8 dependencies when configuring Kotlin with pre-1.1 version
#KT-16401 Fixed
2017-03-21 14:02:05 +01:00
Dmitry Jemerov
cd4636a1e5 Add current version to "Configure Kotlin in project" version chooser if it is a release version and it wasn't found in the search results
#KT-16571 Fixed
2017-03-21 14:01:37 +01:00
Dmitry Jemerov
0f21595e4b Don't show "Configure Kotlin" if module is configured, project is not
Report CAN_BE_CONFIGURED from Gradle configurator only if we didn't
find any file containing valid configuration (normally the top-level
project file in an Android project doesn't have any Kotlin
configuration, so we report CAN_BE_CONFIGURED even though the module
file contains valid configuration)
2017-03-21 14:01:37 +01:00
Dmitry Jemerov
b48b3b3237 Show "Configure Kotlin" notification at most once after project opening
Don't show notification after every sync; trigger it from
rootsChanged handler because the root model is not yet updated at
syncDone point
 #KT-16590 Fixed
2017-03-21 14:01:37 +01:00
Dmitry Jemerov
0a586291b6 Check jar name before trying to load JS library version
#KT-16596 Fixed
2017-03-21 14:01:37 +01:00
Dmitry Jemerov
09b60e3f77 JsLibraryStdDetectionUtil: J2K 2017-03-21 14:01:37 +01:00
Dmitry Jemerov
dffff77a5d JsLibraryStdDetectionUtil: rename to .kt 2017-03-21 14:01:37 +01:00
Dmitry Jemerov
ad3be8f8b5 Add test for checking JS runtime version 2017-03-21 14:01:37 +01:00
Dmitry Jemerov
1c0acee989 Remove obsolete code for removing obsolete JS library 2017-03-21 14:01:37 +01:00
shiraji
27e1462b00 Apply quick-fix "Make visible" for INVISIBLE_FAKE #KT-16131 Fixed 2017-03-21 13:50:49 +03:00
Alexander Udalov
d4500878cb Do not strip some classes from xercesImpl.jar in compiler.pro
Note that with this config, the kotlin-compiler.jar's size is increased
by 1.5Mb

 #KT-16968 Fixed
2017-03-21 13:03:19 +03:00
Alexander Udalov
af5fbef4ea Use JDK 1.6 to compile modules under "core"
Outputs of these modules go into kotlin-stdlib and kotlin-reflect, both
of which must be usable on Java 6
2017-03-21 13:03:18 +03:00
Dmitry Jemerov
d80891e823 Add xercesImpl.jar to core classpath as it's now required for JDOMUtil 2017-03-20 18:46:13 +01:00
Alexey Sedunov
2e3617adbb Spring Support: Fix tests in IDEA 2017.1
Filter out duplicate reference targets.
Fix test data as directory references are available
inside of string literals.
Fix test data as Spring @Autowired inspection
no more reports parameterless methods.
Fix gutter checking as configuration bean references now resolve
to @ComponentScan annotation
2017-03-20 18:46:12 +01:00
Simon Ogorodnik
2804264289 Fix regression of completion inside string templates
CompletionContributor should not store offsets inside
replacement zone(part of file which are replaced with
dummy identifier) in offsetMap
 #KT-16848 fixed
2017-03-20 18:46:11 +01:00
Dmitry Jemerov
cf18c2243f Fix test: check highlighting only in one direction
Otherwise, when we check the highlighting on one of the files, the text
of the other still contains the <lineMarker> annotation and can't be
indexed as valid Kotlin code.
2017-03-20 18:46:10 +01:00
Alexander Udalov
555b3f12ee Use LinkedHashSet instead of HashSet in DataFlowInfo.getCollectedTypes
This fixes DiagnosticsTestGenerated$Tests.testImplicitIntersection,
which began to fail after update to JDK 8 because the iteration order of
HashMap/HashSet has changed in JDK 8:
http://openjdk.java.net/jeps/180
http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/43bd5ee0205e
2017-03-20 18:46:09 +01:00
Mikhael Bogdanov
211b58ac6e kt1770.kt test rewrote during migration to 171 platform 2017-03-20 18:46:08 +01:00
Dmitry Jemerov
10aedaf0f4 Adjust test data for IDEA 2017.1
Since https://github.com/JetBrains/intellij-community/commit/9c8003c
deprecated methods are considered to be entry points, so the Safe
Delete quickfix is no longer available for them.
2017-03-20 18:46:08 +01:00
Alexander Udalov
999e1061b8 Update test data for ant task tests
Looks like javac 1.8 started to report compilation errors a bit
differently here
2017-03-20 18:46:07 +01:00
Alexander Udalov
449d1f6ad2 Fix KotlinVersionsTest, use SAX parser instead of DOM 2017-03-20 18:46:06 +01:00
Alexander Udalov
33e9e660c4 Fix JvmRuntimeDescriptorLoaderTestGenerated
- Use FULL_JDK instead of mock JDK in some tests because mock JDK is
  created from JDK 6 and full JDK is now JDK 8, so there are differences
  in the behavior in the compiler and at runtime
- Remove some '*.runtime.txt' files which were workarounds to JDK 6
  reflection issues regarding generic inner classes; code in these tests
  is now loaded exactly the same in the compiler and at runtime
- Change supertype in SupertypesAndBounds.kt: the class in the supertype
  is not relevant to that test, it checks that annotations can be loaded
  on types
2017-03-20 18:46:05 +01:00
Alexander Udalov
3c96099f7c Fix compileJavaAgainstKotlin tests
- Use another API to get file name out of a javac diagnostic
  (.getSource().getName()'s behavior changed in JDK 8)
- Delete .txt files for those tests which check that javac reported a
  compilation error; the order and content of declarations in those
  files is undefined
2017-03-20 18:46:05 +01:00
Nikolay Krasko
4edfd0d960 Move getting source position to manager thread in tests
Real usages are performed in this thread too. Using AWT now fails
under runInReadActionWithWriteActionPriorityWithRetries added in
b0e995b41e
2017-03-20 18:46:04 +01:00
Alexey Sedunov
ecd56c6a40 Safe Delete: Fix tests in IDEA 2017.1
Now Java refactoring checks for side effects when deleting
arguments, so instantiation of Kotlin FunctionN is treated as
"unsafe"
2017-03-20 18:46:03 +01:00
Alexey Sedunov
b65460c12f Move: Fix tests in IDEA 2017.1
Do not prevent usages search if target directory is not known yet.
Force content root configuration for multi-module tests
2017-03-20 18:46:02 +01:00
Mikhael Bogdanov
496a21254b Black box update 2017-03-20 18:46:01 +01:00
Alexey Tsvetkov
40574d31ac JPS tests: avoid using deprecated API 2017-03-20 18:46:00 +01:00
Dmitry Jemerov
3a8cf68541 Keep class file version during shrinking; generate Java 8 bytecode
sometimes
2017-03-20 18:45:59 +01:00
Dmitry Jemerov
4cae0538a8 Don't warn about ElementTraversal
IDEA now (since commit 6ff87c6) uses this class to build classpath
for Xerces, and we don't use Xerces
2017-03-20 18:45:59 +01:00
Dmitry Jemerov
0638106bf3 Fix NPE in tests when ProjectFileIndex is not available 2017-03-20 18:45:51 +01:00
Dmitry Jemerov
0d86bdd216 Remove Java 6/7 warning from expected output of the compiler 2017-03-20 18:45:51 +01:00
Dmitry Jemerov
2adacf74ac Reduce -Xmx of "All Non-Compiler Tests" configuration
This should prevent VM crashes on TeamCity
2017-03-20 18:45:50 +01:00
Dmitry Jemerov
a8bd529871 Register MetaLanguage.EP_NAME in J2K test 2017-03-20 18:45:49 +01:00
Dmitry Jemerov
61f157e89d Remove write action around finishLookup(), according to IJ 2017.1 req 2017-03-20 18:45:48 +01:00
Dmitry Jemerov
b9f326bfa1 Register MetaLanguage extension point in ParsingTestCase 2017-03-20 18:45:47 +01:00
Dmitry Jemerov
097ba45783 Fix service and EP registration according to changes in 2017.1
Remove ControlFlowFactory (which is now registered in the platform),
register MetaLanguage (new in 2017.1)
2017-03-20 18:45:46 +01:00
Dmitry Jemerov
a539939388 Fix testdata according to contract inference changes in 2017.1 2017-03-20 18:45:46 +01:00
Dmitry Jemerov
ad821e83bd Fix testdata according to comment selection changes in 2017.1 2017-03-20 18:45:45 +01:00
Dmitry Jemerov
d6709b726e Fix testdata according to changes in automatic renaming rules in 17.1 2017-03-20 18:45:44 +01:00
Dmitry Jemerov
374cf517e1 Don't try to create "add modifier" fix for read-only elements
This fixes a failure of KotlinCleanupInspectionTest on IDEA 17.1.
2017-03-20 18:45:43 +01:00
Dmitry Jemerov
3d98237304 Fix GradleFacetImportTest: run write action only in EDT 2017-03-20 18:45:43 +01:00
Dmitry Jemerov
49a4625368 Fix testdata: Android projects use kotlin-stdlib-jre7 2017-03-20 18:45:42 +01:00
Dmitry Jemerov
12fc89f35d Update to 171.SNAPSHOT to pick up fix for IDEA-169570; fix compilation 2017-03-20 18:45:41 +01:00
Nikolay Krasko
1d29c81346 ! (TODO) Update build test data in 171 2017-03-20 18:45:40 +01:00
Nikolay Krasko
7da424d53f Port setInPerformanceTest -> setInStressTest 2017-03-20 18:45:39 +01:00
Nikolay Krasko
e57b3651c2 Replace removed method in LibraryPresentationProviders 2017-03-20 18:45:39 +01:00
Nikolay Krasko
615f9d3a1f Try to avoid exception in getOffset() call 2017-03-20 18:45:38 +01:00
Nikolay Krasko
eb8415a1f3 Use new api from idea 171 in KotlinStepOverInlinedLinesHint 2017-03-20 18:45:37 +01:00
Nikolay Krasko
bcf29e6fbf Run tests in read action and not in EDT thread
Otherwise test will fail because of runInReadActionWithWriteActionPriority call in EDT
2017-03-20 18:45:36 +01:00
Nikolay Krasko
82a2a705fb Do not wrap analyze into write action priority in tests
In tests the code is executed in EDT and runInReadActionWithWriteActionPriority fails

See: MergingUpdateQueue.setPassThrough() and ExternalToolPassFactory() constructor
2017-03-20 18:45:36 +01:00
Nikolay Krasko
95061885b0 Update after separating JPS builders into two modules 2017-03-20 18:45:35 +01:00
Nikolay Krasko
3e6f57b684 Updated nullability in RunLineMarkerContributor 2017-03-20 18:45:34 +01:00
Nikolay Krasko
4f079d2768 LightQuickFixTestCase.parseActionHint() method was removed 2017-03-20 18:45:33 +01:00
Nikolay Krasko
d5aac7df25 Copy dropped method nameToCompare() to test utils 2017-03-20 18:45:33 +01:00
Nikolay Krasko
9f51b12193 Update guava 19.0 sources jar 2017-03-20 18:45:32 +01:00
Nikolay Krasko
ed9e083008 Remove unused import 2017-03-20 18:45:31 +01:00
Mikhail Glukhikh
e6cefba98b Fix imports vs 2016.3 (ResourceFoldingBuilder) 2017-03-20 18:45:30 +01:00
Mikhail Glukhikh
83a8b041ad Fix ConfigureProjectTestGenerated / GradleConfigureProject ... for branch 163 (jre7->jre8) 2017-03-20 18:45:29 +01:00
Nikolay Krasko
2eb6c393a4 Move android modules to Java 8 SDK 2017-03-20 18:45:29 +01:00
Dmitry Jemerov
715410a9bc Workaround for hanging test 2017-03-20 18:45:28 +01:00
Dmitry Jemerov
60a2151a33 Fix compilation
(cherry picked from commit 46b9041)
2017-03-20 18:45:27 +01:00
Yan Zhulanow
0995f2700e doMoveFile() now accepts not-null PsiDirectory
(cherry picked from commit 8a16c90)
2017-03-20 18:45:26 +01:00
Yan Zhulanow
59055e28ee CreateFileResourceQuickFix now accepts ResourceFolderType instead of ResourceType
(cherry picked from commit 55f350f)
2017-03-20 18:45:26 +01:00
Ilya Chernikov
4be5fcc14a Fix test code after UsefulTestCase api changes 2017-03-20 18:45:25 +01:00
Vyacheslav Gerasimov
180ae070ee Fixed KotlinAndroidResourceQuickFixProvider for AS 2.2 2017-03-20 18:45:24 +01:00
Dmitry Jemerov
594e2b6a77 fix compilation 2017-03-20 18:45:23 +01:00
Dmitry Jemerov
ab5067a0d3 remove write action around closeAndDeleteProject() 2017-03-20 18:45:23 +01:00
Dmitry Jemerov
b10073465c fix compilation of new lint checks against IDEA 163 2017-03-20 18:45:22 +01:00
Alexey Tsvetkov
05f278ce20 JPS: implement tracking of null annotations
#KT-12933 fixed
    #KT-14266 fixed
2017-03-20 18:45:21 +01:00
Alexey Tsvetkov
6d958eb32b Fix dist by ignoring some library classes during compiler shrinking 2017-03-20 18:45:20 +01:00
Dmitry Jemerov
b101550cae Advance idea.plugins.compatible.build 2017-03-20 18:45:19 +01:00
Dmitry Jemerov
e51018406f register PsiElementFinder extensions before JavaPsiFacade is registered 2017-03-20 18:45:18 +01:00
Dmitry Jemerov
036bfed984 Add resources_en.jar to properties plugin classpath 2017-03-20 18:45:18 +01:00
Konstantin Bulenkov
fcdd5e0a19 update Kotlin icons according to new IntelliJ style 2017-03-20 18:45:17 +01:00
Dmitry Jemerov
aced2e7eb4 Update compatible build number range 2017-03-20 18:45:16 +01:00
Dmitry Jemerov
a2b0b3d6eb fix compilation against branch 163 2017-03-20 18:45:15 +01:00
Yan Zhulanow
24c9b6e171 Migrate IDEA plugin code to Android Studio 2.2 (br 145) 2017-03-20 18:45:15 +01:00
Dmitry Jemerov
99af2a809b Update IDEA to 171.2613.7 2017-03-20 18:45:14 +01:00
Dmitry Jemerov
4d10b18fe1 Fix for 171 platform 2017-03-20 18:44:14 +01:00
Ilya Gorbunov
87c055cc61 Fix progression iterators to respect the Iterator contract.
#KT-16923 Fixed
2017-03-20 20:13:54 +03:00
Ilya Gorbunov
e5a28311bc Fix infinite sequence being terminated prematurely when being iterated without calling hasNext
#KT-16922 Fixed
2017-03-20 20:13:54 +03:00
Valentin Kipyatkov
f00ab135d6 Do not insert redundant space 2017-03-20 19:08:03 +03:00
Valentin Kipyatkov
3ec28f1242 Attempt to preserve partial substitution when detecting expected type for smart completion 2017-03-20 19:08:03 +03:00
Valentin Kipyatkov
b5dd2cc540 Completion of lambda parameters
Also changed policy for sorting of smart completion items in basic completion

 #KT-16800 Fixed
 #KT-12002 Fixed
2017-03-20 19:08:02 +03:00
Nikolay Krasko
c6b9aebfcf Minor: remove warning 2017-03-20 17:49:23 +03:00
Nikolay Krasko
afc0892d1f Synchronize state of parser and lexer for LONG_TEMPLATE_ENTRY (KT-14865)
Lexer monitors "long string template" state end and will produce
LONG_TEMPLATE_ENTRY_END token when it is reached. If parser continues
without waiting for it, it will eventually get handling token that
will produce irrelevant error. Such behaviour also breaks lazy
elements (LAMBDA_EXPRESSION in this case) contract: range of parsed text
in eager mode should be same to one parsed in lazy mode.

 #KT-14865 Fixed
2017-03-20 17:47:29 +03:00
Alexander Udalov
87ff70ee0f Replace JS metadata version with '$ABI_VERSION$' in tests
Similarly to the JVM metadata version, this is done in order to avoid
changing any test data when the version is increased
2017-03-20 17:22:29 +03:00
Alexander Udalov
e6f6b0dad5 JS: merge LibrarySourcesConfig into JsConfig 2017-03-20 17:22:29 +03:00
Alexander Udalov
bf90cb5cc0 JS: support -Xskip-metadata-version-check for incompatible ABI libraries
Allow the compiler to read such libraries without any errors, at the
risk of crashing with an exception.

Also fix a minor bug in the diagnostic message in LibrarySourcesConfig
and in the corresponding test in KotlinJpsBuildTest
2017-03-20 17:22:29 +03:00
Alexander Udalov
30dfd5cc1b JS: support '-Xskip-metadata-version-check' to allow pre-release libraries 2017-03-20 17:22:29 +03:00
Alexey Sedunov
a795a256f4 Configuration: Fix behavior of "output directory" control
Do not show file chooser twice.
Disable/enable control on component initialization and change of
"Use project settings" option

 #KT-16952 Fixed
 #KT-16953 Fixed
2017-03-20 17:19:13 +03:00
Simon Ogorodnik
f56af41d1e Fix TypeAliasConstructorDescriptor's to create only once when required
Some IDE features relates onto that same descriptors will remain same
between resolve calls
Fix it to be true for TypeAliasConstructorDescriptor's

 #KT-16265 fixed
2017-03-20 16:55:40 +03:00
Sergey Mashkov
23cbb83c75 IDL2K: drop garbage code, refactor to improve readability 2017-03-20 16:51:32 +03:00
Mikhail Zarechenskiy
1a4b9cb228 Show warning for mod from built-ins since API=1.1 2017-03-20 00:45:18 +03:00
Mikhail Zarechenskiy
e4188f889e Do not show warning for mod from built-ins when LV=1.0
#KT-16372 Fixed
2017-03-20 00:41:58 +03:00
Alexey Sedunov
071744a57f Extract Superclass/Interface: show inapplicability error before choosing the extraction container
#KT-15339 Fixed
2017-03-19 17:20:32 +03:00
Alexey Sedunov
eb9c775476 Navigation: Support NEW_AS_CONSTRUCTOR flag for constructor calls
#KT-15398 Fixed
 #KT-15536 Fixed
2017-03-19 17:20:24 +03:00
Alexey Sedunov
5e8cd654ec Find Usages: Fix processing of label references in 'return' expressions
#KT-7516 Fixed
2017-03-19 17:20:17 +03:00
Alexey Sedunov
275cdbbea7 Rename: Fix renaming of function by label reference inside of lambda argument
#KT-7520 Fixed
2017-03-19 17:20:10 +03:00
Alexey Sedunov
b1df91395a Minor: Use handler autodetection in some rename tests 2017-03-19 17:20:02 +03:00
Alexey Sedunov
871d42f05a Rename: Support renaming class by short reference to companion object
#KT-16108 Fixed
2017-03-19 17:19:55 +03:00
Alexey Sedunov
834cdd63ab Create from Usage: Support class generation by class literal expression
#KT-16188 Fixed
2017-03-19 17:19:48 +03:00
Alexey Sedunov
505a6bcbf2 JPS: Copy project-level settings before use
Sharing these settings for reading/writing
between different module during JPS build
may lead to compiler settings
(plugionOptions, in particular) of several
modules to be mixed

 #KT-16888 Fixed
2017-03-19 17:19:40 +03:00
Alexey Sedunov
2e1b4cd692 Misc: Fix test 2017-03-19 17:19:33 +03:00
Alexey Sedunov
2bb7bdfc3f Kotlin Facet: Fix reading of v1 configuration
Favor language/api version specified in <versionInfo> element
in case it differs from the one in
<option name="_commonCompilerArguments">

#KT-16861 Fixed
2017-03-19 17:19:26 +03:00
Alexey Sedunov
ca46100581 Kotlin Facet: Add tab for compiler plugin options
#KT-15768 Fixed
2017-03-19 17:19:18 +03:00
Alexey Sedunov
c264a2e15f Configuration: Improve presentation of the settings override warning 2017-03-17 21:08:44 +03:00
Alexey Sedunov
7c1249746f Kotlin Facet: Show scripting section only if target platform is JVM
#KT-16316 Fixed
2017-03-17 21:03:29 +03:00
Alexey Sedunov
f63828ff20 Configuration: Make UI improvements
Fix layout
Fix label names
Replace "Generate no warnings" checkbox with "Report compiler warnings"
2017-03-17 21:03:22 +03:00
Nikolay Krasko
f38753ee3c Remove explicit AppScheduledExecutorService shutdown (commit revert)
Revert "Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly"

The commit was added during update to 162.1024.1 to fix hangs in ant
tasks on teamcity because of some thread created in
AppScheduledExecutorService service.

Remove the commit because can't reproduce those hangs under 162.2946
(Probably 12a079ef41 fixed the hangs).

This should also be addressed in fix for https://youtrack.jetbrains.com/issue/IDEA-169562

This reverts commit 99a75021e1.
2017-03-17 18:02:11 +03:00
Nikolay Krasko
a63953432e Set "weak warning" severity for SameParameterValue inspection 2017-03-17 17:27:54 +03:00
Nikolay Krasko
52789df812 Minor: fix warnings in AbstractKotlinParsing.java 2017-03-17 17:27:53 +03:00
Sergey Mashkov
49c2f40f7d KT-16572 Add links to Mozilla Developer Network to kdocs of classes that we generate from IDL
regenerate
2017-03-17 13:04:34 +03:00
Sergey Mashkov
8842b6894e KT-16572 Add links to Mozilla Developer Network to kdocs of classes that we generate from IDL 2017-03-17 13:04:34 +03:00
Sergey Mashkov
02721a0b7f KT-16252 IDL2K: Add ItemArrayLike interface implementation to collection-like classes
regenerate
2017-03-17 13:04:33 +03:00
Sergey Mashkov
496795dd56 IDL2K eliminate attribute modality change caused by inheritance
always override attributes in class if it is inherited from an interface
2017-03-17 13:04:33 +03:00
Sergey Mashkov
a5d6541f1e KT-16252 IDL2K: Add ItemArrayLike interface implementation to collection-like classes 2017-03-17 13:04:32 +03:00
Vyacheslav Gerasimov
a795313c7d Add inspection for usages of Kotlin internal declarations in Java
#KT-11393 Fixed
2017-03-16 21:12:05 +03:00
Alexander Udalov
bd53922c64 Minor, don't shade com.sampullara in compiler-embeddable
See 73b879e
2017-03-16 15:40:06 +03:00
Alexander Udalov
332a0f5adc Use 'languageVersionSettings' extension instead of key directly
Also fix compilation of kotlin-script-util
2017-03-16 14:18:01 +03:00
Alexey Sedunov
0e4c3ec202 Kotlin Facet: Do not present imported -d/-cp in "Additional arguments" 2017-03-16 03:14:41 +03:00
Alexey Sedunov
88a394e892 Kotlin Facet: Validate "additional arguments"
Validate consistency of "additional arguments" with respect to settings specified in other UI controls
2017-03-16 03:14:40 +03:00
Alexey Sedunov
fa06965ed6 Kotlin Facet: Add import test for Maven project with submodule 2017-03-16 03:14:39 +03:00
Alexey Sedunov
cf9d7a0470 Kotlin Facet: Detect platform by stdlib dependency in android-gradle projects
#KT-16827 Fixed
2017-03-16 03:14:38 +03:00
Alexey Sedunov
040f5f88f2 Configuration: Show warning in project settings if they'are overridden in some modules(s) 2017-03-16 03:14:37 +03:00
Alexey Sedunov
5dc5ca551f Configuration: Make UI improvements
Use JTextField for output file prefix/postfix.
Use TextFieldWithBrowseButton for output directory
Improve layout
2017-03-16 03:14:36 +03:00
Alexey Sedunov
ee36abd73a Kotlin Facet: Drop obsolete facet detection infrastructure 2017-03-16 03:14:35 +03:00
Alexey Sedunov
5c55b9fbbe Configuration: Check that project-level common arguments are not changed through platform-specific holders 2017-03-16 03:14:34 +03:00
Alexey Sedunov
ce434585e3 J2K: Convert BaseKotlinCompilerSettings and its inheritors 2017-03-16 03:14:32 +03:00
Alexey Sedunov
f8e5065845 J2K: Convert BaseKotlinCompilerSettings and its inheritors (rename to .kt) 2017-03-16 03:14:31 +03:00
Pavel V. Talanov
f1c0d5316f Refactor delegate members to light members conversion 2017-03-15 20:55:42 +03:00
Pavel V. Talanov
eedcc19209 J2K KtLightClassBase: rename file 2017-03-15 20:55:41 +03:00
Pavel V. Talanov
04591bb938 LightClassDataHolder: refactor, extract subinterfaces 2017-03-15 20:55:40 +03:00
Pavel V. Talanov
6d595e30c2 ClassFileFactory, minor: make done() public and use in LightClassDataProvider 2017-03-15 20:55:40 +03:00
Pavel V. Talanov
d62db8dc6b LightClassGenerationSupport: refactor, minor
Use typealias where appropriate
Less verbose method names
2017-03-15 20:55:39 +03:00
Pavel V. Talanov
a645dc109a KotlinLightClassBuilderFactory, LightClassBuilder: refactor, clarify 2017-03-15 20:55:38 +03:00
Pavel V. Talanov
c73e58516b Refactor LightClassDataProvider: drop LightClassDataProvider class
Move code to inheritors
Improve api to avoid getting empty file lists in random places
2017-03-15 20:55:37 +03:00
Pavel V. Talanov
ab0d939626 searchHelpers: remove hack relying on light classes triggering resolve 2017-03-15 20:55:08 +03:00
Pavel V. Talanov
feae5079ed Light classes: refactor, introduce lazyPub util to reduce verbosity 2017-03-15 20:55:07 +03:00
Pavel V. Talanov
ba185d7616 LightClassDataProvider: refactor, extract class filters to separate classes 2017-03-15 20:55:05 +03:00
Pavel V. Talanov
48cae0e480 KtLightField/Method: Use equality in equivalence checks
Avoid computing delegate to determine equivalence
2017-03-15 20:55:03 +03:00
Pavel V. Talanov
8054020f61 IDELightClassContexts: @PublishedApi affects codegen 2017-03-15 20:55:02 +03:00
Pavel V. Talanov
d846d05527 PsiElementChecker: minor
Check own members before inners' since it triggers the computation of outer stub
2017-03-15 20:55:01 +03:00
Pavel V. Talanov
d34b73befb Light class codegen: all objects are considered static
Simplify code handling access flag computation
Fix a problem where kotlin nested object wasn't producing a nested light class
2017-03-15 20:55:01 +03:00
Pavel V. Talanov
d94da5af40 Frontend: create component functions for properties with error types
Fixes an inconsistency in light classes where we could have different
  class structure depending on whether the type was resolved
2017-03-15 20:55:00 +03:00
Pavel V. Talanov
fa58f1b4d7 KtLightMethod(Field): use dummyDelegate to determine modifier properties 2017-03-15 20:54:59 +03:00
Pavel V. Talanov
abf206a134 KtLightMethod(Field): do not use clsDelegate in hashCode && equality checks 2017-03-15 20:54:58 +03:00
Pavel V. Talanov
fee29c47c8 KtLightMethod: use dummy delegate to compute parameter count and isContructor 2017-03-15 20:54:56 +03:00
Pavel V. Talanov
3e7357a5d7 IDELightClassTest: provide tools to check laziness of light class construction
StubComputationTracker knows which context was used to construct light class
2017-03-15 20:54:55 +03:00
Pavel V. Talanov
daef8a0eed Light classes in IDE: Make light class delegate construction a two step process
Step 0: Light class object is created, no delegates are computed
Step 1: constructs dummy delegate which can not be relied upon to know signature of any member
		It can be used to construct light field and light method objects
		(which can correctly respond to some queries) before constructing real delegate
Step 2:
		Construct real delegate if dummy delegate is not enough to respond to a query

This speeds up multiple scenarios where getMethods() and getFields() are called on numerous classes

Dummy delegate's faster consruction is achieved by using specially setup dumb analysis instead of ide analysis

Introduce LazyLightClassDataHolder: which manages creation of Step 1 and Step 2 delegates
Introduce MemberIndex: keeping track of member creation order, helps matching light class delegates created in different contexts
KtLightMethod and Field: make use of dummy delegate
KtLightMethod no longer extends LightMethod since it requires eager delegate construction
KtLightMethod now implements PsiAnnotationMethod for convenience (ClsMethodImpl implements PsiAnnotationMethod)
2017-03-15 20:54:55 +03:00
Pavel V. Talanov
ed9e94c632 KtLightModifierListWithExplicitModifiers: fix equals 2017-03-15 20:53:59 +03:00
Pavel V. Talanov
d01aaeb65c Refactor light classes: Delegate LightClassDataHolder construction to LightClassGenerationSupport 2017-03-15 20:53:58 +03:00
Pavel V. Talanov
00e84fb483 Light classes: Refactor construction
Introduce LightClassDataHolder: which now is reponsible for constructing clsDelegate
Move out light big chunk of delegate building logic out of LightClassDataProvider into LightClassBuilder
LightClassData only holds information about single class
2017-03-15 20:53:37 +03:00
Pavel V. Talanov
22fb9ec5e1 Refactor light classes: move light members creation to their respective classes 2017-03-15 20:52:51 +03:00
Pavel V. Talanov
15b063d236 J2K LightClassGenerationSupport: rename file 2017-03-15 20:52:50 +03:00
Pavel V. Talanov
dd2d9c1dc2 J2K LightClassGenerationSupport: convert code 2017-03-15 20:52:49 +03:00
Pavel V. Talanov
71161e218b Refactor LightClassData: remove redundant entities 2017-03-15 20:52:48 +03:00
Pavel V. Talanov
0a0e628068 Refactor: move code to new package 2017-03-15 20:52:26 +03:00
Pavel V. Talanov
ac368ac182 Light classes test: test methods & fields with same name 2017-03-15 20:52:25 +03:00
Pavel V. Talanov
955fe9e1e6 Light class tests: add tests
- test Jvm* annotations with wrong arguments
  - test JvmStatic annotation
  - test JvmName annotation
2017-03-15 20:52:24 +03:00
Pavel V. Talanov
dbcd141a46 Extract superclass from AnnotationResolver 2017-03-15 20:52:24 +03:00
Pavel V. Talanov
8794005234 JvmPlatform#getDefaultImports: avoid recomputing JvmBuiltins
We need to use LockBasedStorageManager() (instead of NO_LOCKS) since getDefaultImports()
    can be called concurrently in certain scenarios
2017-03-15 20:52:23 +03:00
Pavel V. Talanov
bbe3b3cabe WrappedType: introduce WrappedTypeFactory to encapsulate wrapped types creation 2017-03-15 20:52:22 +03:00
Pavel V. Talanov
85420d1ffd MemberCodegen: Do not try to write inner class metadata for inner class 2017-03-15 20:51:22 +03:00
Pavel V. Talanov
1441aea2ea Light classes: allow light classes for inner/nested classes to be build separately
Avoid analyzing/generating bytecode for outers
2017-03-15 20:51:22 +03:00
Pavel V. Talanov
6924ddeace Clarify logic in KotlinTypeMapper.mapType() dealing with enum entries
This allows to write correct class signatures for enum entries
    regardless of whether ASM_TYPE slice was written to
2017-03-15 20:51:20 +03:00
Pavel V. Talanov
6f6a595fef Refactor FileScopeFactory 2017-03-15 20:51:19 +03:00
Pavel V. Talanov
d7c1993194 FileScopeFactory: postpone default import resolver construction 2017-03-15 20:51:18 +03:00
Pavel V. Talanov
babb3b557d J2K ImportPath: kotlinify 2017-03-15 20:51:17 +03:00
Pavel V. Talanov
50d0f5bde6 J2K ImportPath: autoconvert 2017-03-15 20:50:12 +03:00
Pavel V. Talanov
91e8d9e211 J2K ImportPath: rename file 2017-03-15 20:49:22 +03:00
Simon Ogorodnik
e7753c31db Minor: Add Dokka format param to build-docs script
To have an ability to change it in TeamCity between custom builds
2017-03-15 19:43:14 +03:00
Simon Ogorodnik
38047240d3 Fix documentation for stdlib
Add forgotten files to file list used by
Dokka when generating documentation
2017-03-15 18:26:52 +03:00
Simon Ogorodnik
5c4ba53f42 Optimization of Basic Code Completion
Now we first search for simple reference variants, then for extensions
 Because extension search is slow
 #KT-16856
2017-03-15 17:50:29 +03:00
Simon Ogorodnik
4906ddfc29 Optimization of Basic Code Completion
Now we don't perform code formatting on temporary psi used
  in ShadowedDeclarationFilter
  #KT-16856
2017-03-15 17:50:20 +03:00
Mikhail Glukhikh
bbab0f11ca Cleanup: fix some "leaking this" warnings 2017-03-15 17:36:08 +03:00
Mikhail Glukhikh
045a23ae10 Cleanup: apply "Convert lambda to reference" 2017-03-15 17:36:02 +03:00
Mikhail Glukhikh
b121bf8802 Cleanup: fix some compiler warnings (mostly deprecations, javaClass) 2017-03-15 17:35:31 +03:00
Mikhail Glukhikh
d0cc1635db Cleanup: apply "Use synthetic property access syntax" 2017-03-15 16:13:40 +03:00
Mikhail Glukhikh
1375267996 Cleanup: apply redundant curly braces in string template inspection 2017-03-15 16:13:22 +03:00
Mikhail Glukhikh
e37800d056 Cleanup: apply redundant string template inspection 2017-03-15 16:12:59 +03:00
Igor Chevdar
10ea2883f7 Supported KProperty2 and KMutableProperty2 for delegated properties
Consider this code:
object Delegate {
    operator fun getValue(t: Any?, p: KProperty<*>): String {
        return ""
    }
}

class A {
    val String.ext by Delegate
}

then the type of <p> is KProperty2 (it has 2 receivers).

Test fix + review fixes
2017-03-15 12:20:57 +03:00
Alexander Udalov
d58d75c6ef Refactor "do not check impl" flag for multi-platform projects
Instead of LanguageFeature, make it an AnalysisFlag, which is more clear
2017-03-15 11:03:05 +03:00
Alexander Udalov
56201a6dc4 Refactor skipMetadataVersionCheck flag
To make addition of other flags easier in the future, provide a more
abstract 'isFlagEnabled' in LanguageVersionSettings
2017-03-15 11:03:04 +03:00
Alexander Udalov
7a240b63c7 Use LanguageFeature.State enum instead of CoroutineSupport 2017-03-15 11:03:03 +03:00
Alexander Udalov
34e131c928 Refactor LanguageVersionSettings.isApiVersionExplicit
Pass it in the CompilerConfiguration instead of LanguageVersionSettings.
This is better because LanguageVersionSettings is accessible everywhere
in front-end and back-end, and this flag should not be used there
2017-03-15 11:03:01 +03:00
Alexander Udalov
32826c1686 Introduce LanguageFeature.State, drop coroutines-related pseudofeatures
Previously there were three LanguageFeature instances -- Coroutines,
DoNotWarnOnCoroutines and ErrorOnCoroutines -- which were handled very
awkwardly in the compiler and in the IDE to basically support a language
feature with a more complex state: not just enabled/disabled, but also
enabled with warning and enabled with error. Introduce a new enum
LanguageFeature.State for this and allow LanguageVersionSettings to get
the state of any language feature with 'getFeatureSupport'.

One noticeable drawback of this approach is that looking at the API, one
may assume that any language feature can be in one of the four states
(enabled, warning, error, disabled). This is not true however; there's
only one language feature at the moment (coroutines) for which these
intermediate states (warning, error) are handled in any way. This may be
refactored further by abstracting the logic that checks the language
feature availability so that it would work exactly the same for any
feature.

Another issue is that the difference among ENABLED_WITH_ERROR and
DISABLED is not clear. They are left as separate states because at the
moment, different diagnostics are reported in these two cases and
quick-fixes in IDE rely on that
2017-03-15 11:03:00 +03:00
Alexander Udalov
cf7048dd0f Do not inject CompilerConfiguration into compiler front-end
Inject LanguageVersionSettings instead; all information relevant to the
analysis should be now passed via an instance of LanguageVersionSettings
(which should be renamed to a more general name in the future).

This is partially a revert of d499998 and related commits
2017-03-15 11:02:59 +03:00
Alexander Udalov
a879cb0cfd Minor, take LanguageVersionSettings in CompilerDeserializationConfiguration 2017-03-15 11:02:58 +03:00
Alexander Udalov
ac530ac49c Move skipMetadataVersionCheck flag to LanguageVersionSettings
This makes it possible to avoid the CompilerConfiguration instance in
injectors, because CompilerDeserializationConfiguration was the only
left component that required it.

LanguageVersionSettings is not a good name for this entity anymore, it
should be renamed in the future
2017-03-15 11:02:58 +03:00
Alexander Udalov
f5d4dd33da Inject JvmTarget into some JVM-specific call checkers
This makes it possible to drop CompilerConfiguration from
CallCheckerContext, which in turn helps to avoid passing the entire
CompilerConfiguration instance through front-end
2017-03-15 11:02:57 +03:00
Alexander Udalov
573c6ab5d4 Move JvmTarget to frontend.java, introduce TargetPlatformVersion
Previously JvmTarget was declared in module 'util' which is accessible
for example from 'frontend', which is not very good.

Also add a superinterface named TargetPlatformVersion which is going to
be used in platform-independent injectors in 'frontend' in the following
commits. Use it in one place (LanguageVersionSettingsProviderImpl.kt)
instead of DescriptionAware because TargetPlatformVersion sounds like a
better abstraction than DescriptionAware here
2017-03-15 11:02:56 +03:00
Denis Zharkov
d2cd5d46fa Minor. Use static method from super class
It was a code with warning
2017-03-15 10:47:12 +03:00
Denis Zharkov
dcc98e3839 Improve check for statements-only postfix templates
Before this change the check was quite complicated
because of cases like:
for (i in 1..9)
    foo(i)<caret>

It's not located in a block, but in the same time it's a stament.
So we had a tricky heuristics that if is parent is not a block, then
we should check if element isn't used as expression.

Of course this heuristics is wrong, e.g. for import/package nodes.

The solution is to reuse similar logic from BasicExpressionTypingVisitor.
it has been checked once that statement container is one of:
- KtBlockExpression
- KtContainerNodeForControlStructureBody
- KtWhenEntry

So there's no need to check anything else

 #KT-14986 Fixed
 #KT-14483 Fixed
2017-03-15 10:47:12 +03:00
Denis Zharkov
78ffe47bf8 Fix samples for 'iter' postfix template
#KT-14727 Fixed
2017-03-15 10:47:12 +03:00
Denis Zharkov
bd88919411 Refine predicate for 'iter' postfix template
Use IterableTypesDetection to determine if the given expression may be iterated

 #KT-14134 Fixed
 #KT-14129 Fixed
2017-03-15 10:47:12 +03:00
Denis Zharkov
465a424af4 Refactor postfix template selector
Allow to specify predicate by KtExpression instead of type predicate
It will be used for `for` template which need a context to determine
whether the expression is iterable
2017-03-15 10:47:12 +03:00
Vyacheslav Gerasimov
b8ebc087e2 Add inspection for calls of function with lambda expression body
Added "Unused return value of a function with lambda expression body" inspection with quickfix "Remove '=' token from function declaration"

#KT-10393 Fixed
2017-03-15 00:22:31 +03:00
Vyacheslav Gerasimov
087551ad61 Implement quick fix for "Invalid type of annotation member"
Quickfix changes array of boxed type to array of primitive type

#KT-8568 Fixed
2017-03-15 00:21:24 +03:00
Vyacheslav Gerasimov
b8563f7fcf Fix KotlinUastTypesTest.testCycleInTypeParameters 2017-03-15 00:20:40 +03:00
Mikhail Glukhikh
cab80812ef KT-13111: lambda --> reference supports also object members 2017-03-14 18:45:08 +03:00
Mikhail Glukhikh
631f58f27f Lambda --> reference: correct handling of companion references
Reference receivers are named more accurately now #KT-13341 Fixed
2017-03-14 18:45:06 +03:00
Mikhail Glukhikh
2c692de98f KT-13111: lambda --> reference support methods called via this now 2017-03-14 18:45:05 +03:00
Mikhail Glukhikh
19db4869e6 Lambda --> reference: correct handling of parameter-less function
Issue #KT-15556 Fixed
2017-03-14 18:45:04 +03:00
Mikhail Glukhikh
b6974a88c5 Refactoring: convert lambda --> reference intention 2017-03-14 18:45:02 +03:00
Mikhail Glukhikh
3a14a5c461 Lambda --> reference supports bound references now #KT-13111 Fixed 2017-03-14 18:45:01 +03:00
Mikhail Glukhikh
831467891c Reference --> lambda supports bound references now #KT-16292 Fixed 2017-03-14 18:45:00 +03:00
Yan Zhulanow
f6734e74e1 Minor, SamWithReceiver: Fix services for kotlinc CLI execution
Move service files to META-INF to support execution from CLI (using PluginCliParser).
2017-03-14 18:36:40 +03:00
Mikhael Bogdanov
23698f93e0 Fix reification for crossinline lambdas inlined into object literal
Inline lambda could capture reified parameter of containing inline function ('a' function)
when it is inlined in another one.
If it's inlined in any anonymous object we should track it and
add reification marker to such anonymous object instance creation
to rewrite it on inlining bytecode of 'a' function.

  #KT-15997 Fixed
2017-03-14 15:54:13 +01:00
Alexey Sedunov
6b6d7a5030 Configuration: Don't create kotlinc.xml if the settings don't differ from the defaults
#KT-16647 Fixed
2017-03-14 15:33:11 +03:00
Alexey Sedunov
e8749e639c Kotlin Facet: Add link to project-level compiler settings UI
#KT-16022 Fixed
2017-03-14 15:33:10 +03:00
Alexey Sedunov
8c91dc579a Kotlin Facet: Show project-level settings when "Use project settings" is selected
#KT-16023 Fixed
2017-03-14 15:33:09 +03:00
Alexey Sedunov
9bbea47f93 Kotlin Facet: Parse and merge compiler arguments specified in <arg> elements instead of appending them (to avoid duplication)
#KT-16776 Fixed
2017-03-14 15:33:08 +03:00
Alexey Sedunov
e5a128ab2e JPS: Parse and merge additional arguments with primary ones instead of
appending them (to avoid duplication)
 #KT-16788 Fixed
2017-03-14 15:33:07 +03:00
Alexey Sedunov
73b879ea89 Misc: Include cli-parser 1.1.2 sources into the project under different package and drop original library dependency
This would allow building the project with Kotlin JPS plugin on TeamCity where older library takes precendence due to appearing earlier in JPS classpath
2017-03-14 15:33:06 +03:00
Dmitry Jemerov
e037e9de39 Do not cache contents in VFS when reading contents of .jar files
This follows the standard IDEA policy of caching file contents.
2017-03-14 13:06:47 +01:00
Dmitry Jemerov
8d1d76cdae Try to recover from corrupt VFS data for a .kotlin_module file
#KT-13135 Fixed
2017-03-14 13:06:29 +01:00
Mikhail Zarechenskiy
da53317357 Fix exception when type parameters appear in object declaration
#KT-14536 Fixed
2017-03-14 01:10:00 +03:00
Mikhail Zarechenskiy
0568bc3ef1 Add note about JS to the changelog 2017-03-13 21:09:17 +03:00
Mikhail Zarechenskiy
fd80c0d1d1 Remove KT-15200 from the changelog
It was postponed until 1.1.2
2017-03-13 20:38:43 +03:00
Mikhail Zarechenskiy
05ef705609 Add IGNORE_BACKEND directive for native automatically
Also parse correctly case IGNORE_BACKEND: JS, NATIVE
2017-03-13 19:56:13 +03:00
Dmitry Jemerov
006062499c Optimize imports (to fix compilation under 171 branch) 2017-03-13 16:34:48 +01:00
Mikhail Zarechenskiy
774aa720b4 Update Changelog for version 1.1.1 2017-03-13 16:45:25 +03:00
Dmitry Petrov
a0a8beee82 Handle TypeAliasDescriptor in AdaptiveClassifierNamePolicy
(as ClassDescriptor)
2017-03-13 14:15:27 +03:00
Mikhael Bogdanov
ce3b455f57 Fix for KT-16801: Accessors of @PublishedApi property gets mangled
#KT-16801 Fixed
2017-03-13 10:51:10 +01:00
Dmitry Petrov
c46164481a KT-15871 Unnecessary boxing for equality operator on inlined primitive values
Allow kotlin.jvm.internal.Intrinsics#areEqual for boxed values.
Rewrite to primitive equality.

NB we can't do that for Float and Double, because java.lang.Float#equals
and java.lang.Double#equals behave differently from primitive equality comparisons.
2017-03-13 09:04:31 +03:00
Dmitry Petrov
a087ea559f Eliminate redundant CHECKCAST instructions
CHECKCAST is redundant if the corresponding static type exactly matches the target type.
CHECKCAST instructions to-be-reified should not be eliminated.

KT-14811 Unnecessary checkcast generated in parameterized functions
KT-14963 unnecessary checkcast java/lang/Object
2017-03-13 09:04:31 +03:00
Dmitry Petrov
ec403bfdbc KT-16245 Redundant null-check generated for a cast of already non-nullable value
KT-16194 Code with unnecessary safe call contains redundant boxing/unboxing for primitive values
KT-12839 Two null checks are generated when manually null checking platform type

Recognize some additional cases of trivial null checks and trivial instance-of checks.

A variable is "checked for null", if it is:
- a function parameter checked with 'INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull'
- checked for nullability with 'IFNULL/IFNONNULL'
- checked for nullability with 'INSTANCEOF'
  (if objectref is instance-of T, then objectref is non-null)

Before analyzing nullability, introduce synthetic assumptions for execution branches
where a variable is guaranteed to be null or not null. For example, the following bytecode:

     ALOAD 1 // Ljava/lang/String;
     IFNULL L
     <non-null branch>
  L:
     <null branch>

is transformed to

     ALOAD 1
     IFNULL L1
     NEW java/lang/String
     ASTORE 1            // tells analyzer that variable 1 is non-null
     <non-null branch>
  L:
     <null branch>
  L1:
     ACONST_NULL
     ASTORE 1            // tells analyzer that variable 1 is null
     GOTO L

After the analysis is performed on a preprocessed method,
remember the results for "interesting" instructions
and revert the preprocessing transformations.

After that, perform bytecode transformations as usual.

Do not transform INSTANCEOF to-be-reified, because reification at call site
can introduce null checks. E.g.,

    inline fun <reified T> isNullable() = null is T
    ...
    assert(isNullable<String?>())
2017-03-13 09:04:31 +03:00
Dmitry Petrov
3c09a26e16 KT-5248 Don't wrap variable if it is captured only in inlined closures
Remove non-escaping Ref's on bytecode postprocessing pass.
2017-03-13 09:04:31 +03:00
Dmitry Petrov
3fc106572e Make redundant null check optimization independent of boxing optimization algorithm.
Run DCE after each single redundant null check optimization pass.
2017-03-13 09:04:31 +03:00
Ilya Matveev
eda43c8b45 Mute tests with standard collection extensions in native 2017-03-10 19:59:37 +03:00
Ilya Matveev
29e5ad5abe Mute tests with '::class' in native backend 2017-03-10 19:59:37 +03:00
Ilya Matveev
8a3fa2e4e5 Fix expected SMAPs after test muting for native 2017-03-10 19:59:37 +03:00
Ilya Matveev
a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00
Alexander Udalov
d21d362f0f Allow enum entries in double colon LHS with LV = 1.0
#KT-16782 Fixed
2017-03-10 19:44:00 +03:00
Denis Zharkov
39055229a1 Add diagnostic info to assertion on type argument consistency 2017-03-10 18:17:50 +03:00
Vyacheslav Gerasimov
830bf62d94 Fix SOE from UAST in containsLocalType
containsLocalType now properly handles start projections
#KT-16680 Fixed
2017-03-10 17:30:21 +03:00
Simon Ogorodnik
4e98394c38 Fix Sample reference to resolve cross-module packages correctly
Now @sample links to FqName in IDE will be resolved correctly
 Cause now we resolve packages over all modules in project
 #KT-14710 fixed
2017-03-10 15:33:47 +03:00
Nikolay Krasko
688802de51 Check breakpoints work in delegate initializer
Additional test after review
2017-03-10 14:59:37 +03:00
Nikolay Krasko
e6ee933b27 Fix "smart step into" for classes with complex hierarchy (KT-16667)
#KT-16667 Fixed
2017-03-10 14:58:21 +03:00
Nikolay Krasko
6d9b519bb2 Use new utility method for getting lexical scope
It's expected that for call expressing some nearest parent will have
lexical scope written in binding context. Under this circumstances it's
refactoring.
2017-03-10 14:58:17 +03:00
Nikolay Krasko
0a7a73d4be Refactoring: extract method for getting lexical scope without facade 2017-03-10 14:58:16 +03:00
Nikolay Krasko
9120ccc054 Fix breakpoints in inline calls in fields initialization (KT-16525)
Backend generates properties initializer in constructor context

 #KT-16525 Fixed
2017-03-10 14:58:15 +03:00
Nikolay Krasko
d886cd7d06 Fix breakpoints when inline call is in qualified expression (KT-16062)
Scope is stored for DOT_QUALIFIED_EXPRESSION not directly for
CALL_EXPRESSION.

 #KT-16062 Fixed
2017-03-10 14:58:14 +03:00
Nikolay Krasko
2719016539 Fix search of correspondent call expression by element (KT-11234)
getStrictParentOfType() looks for nearest parent of given type

In complex expressions like:

SamConversion.doAction({
  inlineCall {
    {
      // here <--
    }()
  }
})

doAction was found twice, while inlineCall was skipped.

See code:
// call(param, { <it> })
lambdaExpression?.typedParent<KtValueArgument>()?.typedParent<KtValueArgumentList>()?.typedParent<KtCallExpression>() ?:

// call { <it> }
lambdaExpression?.typedParent<KtLambdaArgument>()?.typedParent<KtCallExpression>()

 #KT-11234 Fixed
2017-03-10 14:58:13 +03:00
Nikolay Krasko
b240ae791c Minor: extract variable 2017-03-10 14:58:12 +03:00
Denis Zharkov
52d11eb22b Minor. Revert workarounds for problem on KClass from annotation
See KT-9453 for clarification
2017-03-10 13:49:07 +03:00
Denis Zharkov
82d7a269ed Minor. Make sure that implicit contract of mapSignature is satisfied
For ordinary functions mapSignature doesn't use original descriptor
and maps the given descriptor itself, but for constructor it obtained
the original value parameters.

Necessary `getOriginal` calls were added to the call-sites
2017-03-10 13:49:06 +03:00
Denis Zharkov
394c68c326 Minor. Move unwrapping of FunctionImportedFromObject
It should not affect the semantics, because mapSignatureWithCustomParameters
can only be called with FunctionImportedFromObject from mapSignature.

At the same time it's very nice to have all of these kinds
of custom unwrapping in the same place
2017-03-10 13:49:06 +03:00
Denis Zharkov
530214fcee Minor. Simplify mapping to callable method
There's no need in unwrapping for TypeAliasConstructorDescriptor
because mapSignatureSkipGeneric/mapDefaultMethod already do it
in some moment, and ConstructorDescriptor has getConstructedClass method
for mapping its owner
2017-03-10 13:49:05 +03:00
Denis Zharkov
be90f7d331 Make type aliases constructors return correct original descriptors
The problem was that when resolving super-calls we used known substitutor
when creating a type alias constructor, thus its original return itself,
while it's expected that it should return the descriptor before substitution

The main idea of the fix that `createIfAvailable` should always return
unsubstituted constructor.

Note that known substitutor for type alias constructor should be based
on abbreviation.

The test change seems to be correct as PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE
is already reported.
Beside this, resolution behavior isn't expected to be changed dramatically
2017-03-10 13:49:05 +03:00
Denis Zharkov
2b21280ba9 Unwrap underlying typealias constructor earlier
The problem is very subtle (see the test): when generating a signature
for an object literal we also were mapping its super-class
(a type alias here).

Although we did unwrap its underlying constructor to map it properly
we did too late (after obtaining value parameters from the type alias constructor descriptor).

Another problem is that TypeAliasConstructorDescriptor.getOriginal
in the case does return itself, while it's expected to return
unsubstituted version

Note: everything works for common calls for such constructors
because they mapped through mapCallableMethod which contains
another custom unwrapping of type alias constructors

 #KT-16555 Fixed
2017-03-10 13:45:37 +03:00
Denis Zharkov
8761ef6694 Minor. Rename mapSignature overload to mapSignatureWithCustomParameters 2017-03-10 13:45:37 +03:00
Denis Zharkov
7173e56393 Make computation of arguments for raw types lazy
See how we translate raw types to Kotlin model:
RawType(A) = A<ErasedUpperBound(T1), ...>
ErasedUpperBound(T : G<t>) = G<*> // UpperBound(T) is a type G<t> with arguments
ErasedUpperBound(T : A) = A // UpperBound(T) is a type A without arguments
ErasedUpperBound(T : F) = UpperBound(F) // UB(T) is another type parameter F

Stack overflow happens with the following classes:
class A<X extends B> // NB: raw type B in upper bound
class B<Y extends A> // NB: raw type A in upper bound

when calculating raw type for A, we start calculate ErasedUpperBound(Y),
thus starting calculating raw type for B => ErasedUpperBound(X) => RawType(A),
so we have SOE here.
The problem is that we calculating the arguments for these raw types eagerly,
while from the definition of ErasedUpperBound(Y) we only need a type constructor
of raw type B (and the number of parameters), we don't use its arguments.

The solution is to make arguments calculating for raw types lazy

 #KT-16528 Fixed
2017-03-10 13:30:33 +03:00
Mikhael Bogdanov
f2fea9a04a Generate unboxing operation on boxed class not Number.class when possible 2017-03-10 10:04:30 +01:00
Mikhael Bogdanov
5e80d80797 Fix for KT-16732: Type 'java/lang/Number' (current frame, stack[0]) is not assignable to 'java/lang/Character
#KT-16732 Fixed
2017-03-10 10:04:29 +01:00
Mikhail Glukhikh
32bdb6becb KT-16714 related refactoring of tryRunWriteAction (now runWriteAction is not used if intention is called from J2K) 2017-03-10 10:46:49 +03:00
Alexey Sedunov
faa0dff649 Kotlin Facet: Do no present compiler plugin classpaths and options in additional arguments string
#KT-16313 Fixed
2017-03-09 23:06:52 +03:00
Alexey Sedunov
cc20c66bfc Kotlin Facet: Fix platform detection by Maven execution goals
#KT-15947 Fixed
 #KT-16342 Fixed
2017-03-09 23:06:47 +03:00
Alexey Sedunov
e8640b441d JPS: Fix earlier configurations with incorrect combination of language and API version 2017-03-09 23:06:42 +03:00
Alexey Sedunov
811b8978c2 Kotlin Facet: Escape additional compiler arguments when converting them to string and unescape before parsing
#KT-16700 Fixed
2017-03-09 23:06:38 +03:00
Alexey Sedunov
c5ee28da05 Kotlin Facet: Detect module platform by gradle plugin
#KT-16703 Fixed
 #KT-16342 Fixed
2017-03-09 23:06:33 +03:00
Alexey Sedunov
26537cd8fc Kotlin Facet: Distinguish compiler arguments specified for different source sets
#KT-16698 Fixed
2017-03-09 23:06:28 +03:00
Alexey Sedunov
0e583aa929 Kotlin Facet: Update Gradle import test data to use 1.1.0 plugin 2017-03-09 23:06:23 +03:00
Alexey Sedunov
278cc71c4a Kotlin Facet: Reuse configuration serialization in JPS (previous implementation is not usable after configuration refactoring) 2017-03-09 23:06:18 +03:00
Alexey Sedunov
641a9a7153 Kotlin Facet: Get rid of duplicating data in facet configuration 2017-03-09 23:06:12 +03:00
Alexey Sedunov
19ea18a340 Kotlin Facet: Correctly enable/disable "output directory" field when changing "Use project settings" option
#KT-16317 Fixed
2017-03-09 22:48:44 +03:00
Dmitry Jemerov
01a9d9a284 Support lazy conversion of parent chain; correctly check expected class 2017-03-09 17:07:43 +01:00
Dmitry Jemerov
8c3936a0ee Update to UAST 0.12 2017-03-09 17:07:43 +01:00
Simon Ogorodnik
3bf7223448 Internal Kotlin packages now should be completable in parent packages
Internal packages which are hard-excluded from completion and
 imports now should be visible there if file package are parent of
 excluded one
 e.g kotlin.jvm.internal.* now visible from kotlin and kotlin.jvm
 #KT-16214 fixed
2017-03-09 19:05:10 +03:00
Dmitry Petrov
27bf51c73f All multifile class tests should have 'TARGET_BACKEND: JVM' directive. 2017-03-09 17:22:28 +03:00
Dmitry Petrov
6a68eb218f KT-16077 Redundant private getter for private var in a class within a JvmMultifileClass annotated file 2017-03-09 17:22:28 +03:00
Dmitry Jemerov
c9df227fef Add more tests for coroutines; use higher-level API to check that changes have been applied 2017-03-09 13:57:45 +01:00
Dmitry Jemerov
73a2c8c436 Test quickfixes for updating language/API version and coroutine support in Gradle projects 2017-03-09 13:41:57 +01:00
Dmitry Jemerov
5d461ec6df Support updating language/API level specified with compact options 2017-03-09 13:41:57 +01:00
Dmitry Jemerov
4261880340 Add test for enabling coroutines/bumping language level, fix several breakages 2017-03-09 13:41:57 +01:00
Sergey Igushkin
999ef51653 Added gradle-plugins properties with fqnames
Added .property files to make the plugins available by fqnames in
order to publish them to Gradle Plugin Portal.

#KT-5756

(cherry picked from commit 991de64)
2017-03-09 14:13:40 +03:00
Dmitry Jemerov
cbccb68948 Fix logic for searching inner classes in LazyResolveBasedCache.findInPackageFragments()
#KT-14058 Fixed
2017-03-09 11:47:21 +01:00
Alexander Udalov
9f2ce3c521 Refactor synthesized invokes creation in resolution
Instead of verifying that the container of an 'invoke' is a
FunctionClassDescriptor instance, make sure that it's a function class
checking its FQ name instead (classId + isBuiltinFunctionClass calls).
This makes sure that we will create synthesized invokes in a setting
where function classes are not FunctionClassDescriptor instances
synthesized by the compiler, but ordinary classes from sources or
binaries as well, as is going to be the case in kotlin-native
2017-03-09 11:29:39 +03:00
Dmitry Petrov
d188de3086 KT-6014 Wrong ABSTRACT_MEMBER_NOT_IMPLEMENTED for toString implemented by delegation
Members declared in interface or overriding members declared in super-interfaces
can be implemented by delegation even if they override members declared in super-class
(NB for interface this can be only 'kotlin.Any').
2017-03-09 09:38:48 +03:00
Mikhail Glukhikh
5e8afd26e1 Do not run write actions from J2K #KT-16714 Fixed
Also #EA-97363 Fixed
2017-03-09 09:37:35 +03:00
Dmitry Petrov
f950ff4b8f 'ConstructorDescriptor#getConstructedClass()' should be used to obtain a descriptor for constructed class
(it can be different from 'getContainingDeclaration()' in case of type alias constructor).

KT-15109 Subclass from a type alias with named parameter in constructor will produce compiler exception
KT-15192 Compiler crashes on certain companion objects: "Error generating constructors of class Companion with kind IMPLEMENTATION"
2017-03-09 09:23:38 +03:00
Dmitry Petrov
9a2c9ed30e KT-13342 Unqualified super call should not resolve to a method of supertype overridden in another supertype 2017-03-09 09:16:21 +03:00
Dmitry Jemerov
954c1d853d Correctly locate build.gradle for modules created from source sets
(cherry picked from commit ecce92d)
2017-03-08 15:08:41 +01:00
Dmitry Jemerov
a2f7808ab1 Don't check Java version in LauncherScriptTest 2017-03-08 14:07:47 +01:00
Dmitry Jemerov
263cf85c5c Fix project leak in IdeReplExecutionTest 2017-03-08 13:47:09 +01:00
Dmitry Petrov
11caa03427 KT-16713 Insufficient maximum stack size
1. Analyze method node with fake jumps for loops to make sure that
all instructions reachable only through break/continue jumps are processed.
2. Fix stack for break/continue jumps.
3. Drop fake jumps for loops, analyze method node again.
4. Fix stack for try/catch and beforeInline.
2017-03-08 09:56:08 +01:00
Mikhail Glukhikh
80063b6f91 Quick-fix for DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE added #KT-15966 Fixed 2017-03-07 19:06:16 +03:00
Ilya Gorbunov
b83b534374 Add missing SinceKotlin to IntStream.toList. 2017-03-07 18:22:11 +03:00
Ilya Gorbunov
c038d3e9a3 Mark all api in kotlin.reflect.full package with SinceKotlin(1.1), since it actually appeared in that package only in 1.1. #KT-16557 Fixed.
It doesn't matter that some functions were since 1.0 in the old package.
2017-03-07 18:22:11 +03:00
Kirill Rakhman
646f50dd66 Extract method refactoring should order parameters by first usage
Fixes #KT-16198
2017-03-07 18:10:02 +03:00
Ilya Gorbunov
1296c5444b Fix warning that failed maven plugin smoke test. 2017-03-07 13:56:11 +03:00
Ilya Gorbunov
61e8848aa2 Add samples for sequence building API. 2017-03-07 13:32:39 +03:00
Ilya Gorbunov
a04e6de047 Add groupingBy and eachCount sample. 2017-03-07 13:31:44 +03:00
Ilya Gorbunov
75ae42121b Improve sample comments.
Improve sample for lastIndex property.
2017-03-07 13:31:44 +03:00
Mikhail Zarechenskiy
578dd1dc42 Update Changelog for Kotlin 1.1.1-RC 2017-03-07 12:12:04 +03:00
Dmitry Petrov
d096f1d381 'while' and 'do-while' loop generator fixes.
Generate 'do-while' loop body as IrComposite, because variables declared
in loop body should be visible in loop condition.
Wrap 'do-while' loop in IrBlock so that variables declared in loop body
are not visible outside of the loop.

Generate 'while' and 'do-while' loops as expressions of type Unit.
2017-03-07 11:56:52 +03:00
Dmitry Petrov
cb61c358ea Always generate primitive boolean constants as expressions of type 'kotlin.Boolean'. 2017-03-07 11:56:52 +03:00
Dmitry Petrov
1bbbc1ca1c KT-16684 hashCode doesn't check data class property value of generic type for null 2017-03-07 11:56:52 +03:00
Dmitry Petrov
68fab55251 Minor: cleanup unused imports 2017-03-07 11:56:52 +03:00
Dmitry Petrov
6bc6c1b6cc KT-16671 Calls to members imported from objects should be desugared in PSI2IR 2017-03-07 11:56:52 +03:00
Dmitry Petrov
4ba8268a29 KT-16669 Exception in PSI2IR on type alias constructor in supertypes list 2017-03-07 11:56:52 +03:00
Dmitry Petrov
e4683a1e9f KT-16666 IMPLICIT_INTEGER_COERCION expression should have non-nullable type 2017-03-07 11:56:52 +03:00
Dmitry Petrov
8c32719f3d Render 'type' for IrTypeOperatorCall expressions, update testData. 2017-03-07 11:56:52 +03:00
Dmitry Petrov
b3aeddac85 Refactor: generalize postfix order transformation in InsertImplicitCasts 2017-03-07 11:56:52 +03:00
Dmitry Petrov
8e8f83656f KT-16618 IMPLICIT_INTEGER_COERCION isn't generated for global properties and default parameters 2017-03-07 11:56:52 +03:00
Sergey Igushkin
ee6aae7219 Enabled incremental compilation by default in Gradle plugin.
#KT-16546 Fixed

(cherry picked from commit 06715c5)
2017-03-07 11:32:26 +03:00
Alexey Andreev
ef38761dc2 JS: unmute now passing tests and mute test that passed by accident. 2017-03-07 10:46:09 +03:00
Alexey Andreev
a6ca2906d8 JS: add tests for reflection against external classes 2017-03-07 10:46:08 +03:00
Alexey Andreev
723c9be5a0 JS: fix class literal expression with primitive classes. See KT-16545 2017-03-07 10:46:08 +03:00
Alexey Andreev
8567db10b5 JS: fix coroutine transformation of callable references to local functions. See KT-16164 2017-03-07 10:46:07 +03:00
Dmitry Petrov
18fb70b32f Potential fix for KT-16673
See also:
http://stackoverflow.com/questions/42571812/unsupportedoperationexception-while-building-a-kotlin-project-in-idea

'original' for SamAdapterFunctionScope.MyFunctionDescriptor#doSubstitute should exactly match 'this.original',
so we can just provide it by default in SamAdapterFunctionScope.MyFunctionDescriptor#newCopyBuilder.
2017-03-06 22:00:09 +03:00
Dmitry Jemerov
268f7b715c "Configure Kotlin plugin updates" shows 1.2 and doesn't show 1.0.x 2017-03-06 19:50:58 +01:00
Ilya Chernikov
50e7973fc0 Implement verification workaround for annotation-like class InvalidScriptResolverAnnotation
fixes #KT-16621
2017-03-06 16:31:52 +01:00
Sergey Mashkov
243f718193 EA-88059 - assert: CompositeElement.addChild
ensure parent element for anchor elements so we never try to insert at wrong place
2017-03-06 17:34:36 +03:00
Sergey Mashkov
4637dcde33 EA-86479 - ISE: PomFile.<init>
don't apply any inspections for inappropriate pom files
2017-03-06 17:34:35 +03:00
Mikhael Bogdanov
ff9fe85507 Fix for KT-16614: Report inability to inline 1.8 bytecode into 1.6 bytecode as an error, no as an exception 2017-03-06 15:15:22 +01:00
Vyacheslav Gerasimov
5e4459f41d Fix broken MultiFileHighlightingTest
Android resource folding builder should not run in non-Android projects
2017-03-06 14:31:01 +03:00
Alexander Udalov
0111c4d581 Allow references to nested class constructors in objects in LV = 1.0
#KT-16598 Fixed
2017-03-06 11:03:24 +03:00
Alexander Udalov
7c22113c34 Refactor serialization of package FQ name extension
Instead of requiring to pass it in SerializerExtensionBase's
constructor, pass it always in serializePackage. This is more
straightforward and helps in a situation where one SerializerExtension
instance is used for the whole module, not one per-package
2017-03-06 11:03:24 +03:00
Kirill Rakhman
c952e26cbb Fix NPE caused by Rename Refactoring of backing field when caret is after the last character
#KT-16605 Fixed
2017-03-06 11:01:38 +03:00
Kirill Rakhman
1bad04db50 Fix Can't rename implicit lambda parameter 'it' when caret is placed right after the last character
#KT-14401 Fixed
2017-03-06 11:01:38 +03:00
Ilya Chernikov
e3391175d9 Rewrite parallel daemon start test to make it tougher but more robust 2017-03-05 11:29:54 +01:00
Anton Bannykh
4c6b9b695c JS: mute some tests with extension functions in external declarations 2017-03-03 21:39:40 +03:00
Anton Bannykh
fcffd190d0 JS: prohibited extension function arguments in external functions; removed extension receiver in jQuery declarations. 2017-03-03 20:37:59 +03:00
Sergey Igushkin
73e94ffde0 Added a test for the fix of KT-16434.
(cherry picked from commit 5a6d06f)
2017-03-03 18:04:23 +03:00
Sergey Igushkin
6605ba80e7 Fix for androidTest variants of Android Gradle build.
Added a workaround reflection call to TaskManager to create a
javac task since it is missing for androidTest variants with jack.
Added source configuration with the tested variant to make
the tested sources visible to the compiler.

#KT-16434 Fixed

(cherry picked from commit 84efd05)
2017-03-03 18:04:12 +03:00
Mikhail Glukhikh
0432e2e947 Quick-fix to add noinline to parameter with suspend function type + AddInlineModifierFix refactoring #KT-16074 Fixed 2017-03-03 17:28:37 +03:00
Mikhail Glukhikh
d9710ea4ff #EA-97027 Fixed 2017-03-03 17:28:35 +03:00
Mikhail Glukhikh
8965bb8977 Navigation: new icons for header <---> impl #KT-15842 Fixed 2017-03-03 17:28:34 +03:00
Vyacheslav Gerasimov
1376c8f8cf Implement quickfixes for Android Lint api issues
#KT-16624 Fixed
#KT-16625 Fixed
#KT-14947 Fixed
2017-03-03 16:22:36 +03:00
Vyacheslav Gerasimov
a907ec92b5 Implement Android resource reference folding
#KT-15451 Fixed
2017-03-03 16:18:20 +03:00
Vyacheslav Gerasimov
39010ab847 Fix broken isReferenceTo checking code for Android extensions
#KT-16132 Fixed
2017-03-03 16:17:52 +03:00
Alexander Udalov
25c1828288 JS: write and load pre-release flag on binaries 2017-03-03 13:33:51 +03:00
Alexander Udalov
de8dd37e44 Change DeserializedContainerSource.presentableFqName to String
To allow outputting something other than "Class 'XXX'" in the diagnostic
message for declarations deserialized from JS
2017-03-03 13:33:51 +03:00
Alexander Udalov
f120865350 Combine cls stub builders for built-ins and JS 2017-03-03 13:33:51 +03:00
Alexander Udalov
297eb952bc Extract common parts of built-ins and JS decompilers 2017-03-03 13:33:51 +03:00
Alexander Udalov
b52b90c182 Extract serialization of packageFqName extension to SerializerExtensionBase 2017-03-03 13:33:51 +03:00
Alexander Udalov
4e91dadfab Combine decompiler deserializers for built-ins and JS 2017-03-03 13:33:50 +03:00
Alexander Udalov
bafa0ec1ee Minor, don't throw exception on empty proto message 2017-03-03 13:33:50 +03:00
Alexander Udalov
5a00a97cf1 Extract common parts from deserialization of built-ins and JS 2017-03-03 13:33:50 +03:00
Alexander Udalov
3cb8f1ab20 Drop BuiltIns protobuf message, use ProtoBuf.PackageFragment instead 2017-03-03 13:33:50 +03:00
Alexander Udalov
a36e457c12 Introduce PackageFragment protobuf message for kjsm/builtins/common metadata 2017-03-03 13:33:50 +03:00
Alexander Udalov
2b1b1fb0d4 Merge VirtualFileKotlinClassFinder into VirtualFileFinder
VirtualFileKotlinClassFinder was the only direct subclass of VirtualFileFinder
2017-03-03 13:33:50 +03:00
Alexander Udalov
abb5bc6aba Simplify VirtualFileFinder and their factories' hierarchy
Since there's no JsVirtualFileFinder anymore, inline JvmVirtualFileFinder into
VirtualFileFinder and drop "Jvm" prefix everywhere
2017-03-03 13:33:50 +03:00
Alexander Udalov
ee0874a26d Drop JsVirtualFileFinder and its factory, refactor nearby
The only remaining usage was in KotlinRuntimeLibraryUtil.kt where we only
needed to check whether there's at least one file in a given package indexed by
KotlinJavaScriptMetaFileIndex. Move that logic to a public extension, drop
everything else
2017-03-03 13:33:50 +03:00
Alexander Udalov
67699bf17e Rename metadata version index and its subclasses 2017-03-03 13:33:50 +03:00
Alexander Udalov
57877bb007 Add default value to js_code_binary_version in js.proto
By default, assume the version is 1.0.0
2017-03-03 13:33:49 +03:00
Mikhael Bogdanov
a03ed6f742 Fix for KT-16581: VerifyError when calling default value parameter with jvm-target 1.8
#KT-16581 Fixed
2017-03-03 11:21:42 +01:00
Ilya Chernikov
ffe3453937 Do not pollute IDEA log with fake script dependencies 2017-03-03 10:59:28 +01:00
Mikhail Glukhikh
3060ecc066 Minor build fix: "Convert to apply" is now applicable only with 2+ calls with the same receiver 2017-03-03 11:10:01 +03:00
Dmitry Petrov
634d9834de Wrong receiver is generated for variable-as-function call on object.
Move 'generateExpressionForReferencedDescriptor' to CallGenerator,
use it in 'generateCall',
add PSI-free versions of some utility methods so that call elements can
be generated when we're already deep in ResolvedCall generation
and have forgotten about PSI.
2017-03-03 10:15:59 +03:00
Mikhail Zarechenskiy
d573962259 Add test for class delegation with private constructor
#KT-16583 Obsolete
2017-03-02 18:34:59 +03:00
Mikhail Zarechenskiy
e2dcec62d3 Fix access to top-level declarations inside anonymous initializer
#KT-16583 Fixed
2017-03-02 18:34:51 +03:00
shiraji
0e5603f644 Implement an intention converting several calls with same receiver to with/apply/run #KT-12183 Fixed 2017-03-02 16:56:56 +03:00
shiraji
c2e5fc5215 Move KtDotQualifiedExpression.deleteFirstReceiver to Utils.kt 2017-03-02 16:56:53 +03:00
Alexander Udalov
39d0cd7237 Test that all Kotlin versions in the project are consistent
There are two different tests: the one that checks that all versions are
consistent (but not equal, because some versions are major.minor.patch,
but some only major.minor), and the one that checks that versions of all
subprojects of the Maven projects are exactly equal (1.1-SNAPSHOT
currently)

 #KT-16455 Fixed
2017-03-02 16:36:51 +03:00
Denis Zharkov
6fb83c2ba3 Force wrapping java classes from annotation methods into KClasses
Before this change such wrapping happened only during coercion,
i.e. when a call-site expected a KClass instance.

But when call-site expects Any, for example, no wrapping happened,
and raw j.l.Class instance was left on stack.

The solution is to put wrapping code closer to generation of annotation's
method call itself to guarantee that necessary wrapping will happen.

 #KT-9453 Fixed
2017-03-02 15:19:09 +03:00
Denis Zharkov
415c3d57af Fix substitutor for synthetic SAM adapters
When synthetic member comes not from the receiver type itself,
but from one of its supertypes it doesn't make sense to subsitute
the member with receiver type, we should obtain relevant supertype
and use it instead.

 #KT-16578 Fixed
2017-03-02 15:06:59 +03:00
Anton Bannykh
9e5ecc11b7 JS: fixed Double.NaN behaviour (KT-13610). 2017-03-02 14:29:50 +03:00
Dmitry Petrov
f636ab21f8 Use proper descriptor for (generic) property assignment.
Insert IMPLICIT_INTEGER_COERCION only if Int is coerced to an integer type.
2017-03-02 14:25:58 +03:00
Dmitry Petrov
97fbbc74e6 KT-16440 ClassConstructorDescriptorImpl has null returnType
Set constructor return type in FunctionDescriptorResolver#createConstructorDescriptor
(it seems to be the only place where ClassConstructorDescriptorImpl#initialize(...)
is called, but returnType is not set).
2017-03-02 14:25:58 +03:00
Dmitry Petrov
dc1d92855d KT-16438 Strange dispatch receiver for descriptors of delegated members
Provide proper dispatch receiver parameter for delegated members.
Use dispatch receiver parameter for delegated members in IR generation
for delegated member body (and check that the receiver has corresponding type).
2017-03-02 14:25:58 +03:00
Dmitry Petrov
c92f118e5e Refactoring: introduce CopyBuilder for CallableMemberDescriptor and PropertyDescriptor.
Allow providing new dispatchReceiverParameter via CopyBuilder
(required for proper dispatch receiver for delegates).
2017-03-02 14:25:58 +03:00
Dmitry Petrov
9baaf607a3 KT-16566 Support destructuring declarations for lambda parameter in psi2ir 2017-03-02 14:25:58 +03:00
Dmitry Petrov
c226707a80 KT-16554 Local function with default arguments have no IR elements for them 2017-03-02 14:25:58 +03:00
Igor Chevdar
ab3681e164 Package level delegated properties have no dispatch receiver. 2017-03-02 12:33:01 +03:00
Igor Chevdar
3ef612f05a Added dispatch receiver to delegation implementing property 2017-03-02 12:33:01 +03:00
Simon Ogorodnik
6dd75f697a Fix Show implementation to show inheritance through type-aliases
Show implementation(Ctrl-Hover) now should show classes which inherit such class through type-alias
 #KT-15200 fixed
2017-03-01 23:05:19 +03:00
Yan Zhulanow
593fbadc98 Force using the 'kotlin-stdlib-jre7' artifact when configuring Android modules with JDK >= 1.8 as Dex can't process our 'kotlin-stdlib-jre8' artifact.
This fixes KT-16530: Configure Kotlin in Project inserts dependency to kotlin-stdlib-jre8 in Android projects.
2017-03-01 18:50:22 +03:00
Yan Zhulanow
060095d39f Remove kotlin-annotation-processing artifact from the serialized compiler options. It is unused in kapt3 (or if no annotation processor dependencies are provided) but is still imported into the IDEA module files. This leads to compilation error due to the plugin incompatibility.
Incompatibility reason: kotlin-annotation-processing has references to the shaded intellij-core, so, being provided to the unshaded kotlinc from the Kotlin plugin, it throws the AbstractMethodError.

This fixes #KT-16184.
2017-03-01 18:50:22 +03:00
Kirill Rakhman
2506bb6673 Inspection checking that destructuring variable name matches the name of different component #KT-12004 Fixed 2017-03-01 18:24:48 +03:00
Dmitry Jemerov
af7de9a0c5 Warn when running the compiler under Java 6 or 7
(cherry picked from commit 5537800)

(cherry picked from commit 5614874)
2017-03-01 16:21:57 +01:00
Simon Ogorodnik
000da2f6d0 Fix of <ERROR CLASS>-es pointing to public TypeAliases 2017-03-01 16:09:24 +01:00
Dmitry Jemerov
78b4cbdb69 Don't generate documentation for option that doesn't work in Gradle 2017-03-01 16:09:23 +01:00
Alexey Andreev
0c0e0aab09 JS: add some docs to declarations related to interop 2017-03-01 16:09:21 +01:00
Dmitry Jemerov
322379e6ae Assorted stdlib KDocs 2017-03-01 16:09:01 +01:00
Dmitry Jemerov
1d86bd5610 Build multiplatform stdlib docs 2017-03-01 16:08:38 +01:00
Dmitry Jemerov
adc937c57d Extract separate target for preprocessing JS stdlib sources 2017-03-01 16:08:28 +01:00
Kirill Rakhman
8d425a6f94 Add intention to add missing components to destructuring assignment #KT-16258 Fixed 2017-03-01 18:00:55 +03:00
Mikhael Bogdanov
4d47c0fd63 Partial fix for KT-16193: Incremental compilation generates invalid bytecode for crossinlined functions; avoid IllegalAccessError 2017-03-01 14:45:11 +01:00
Alexander Udalov
3ad4f18e1a Update grammar to Kotlin 1.1
Also drop obsolete comments and inline some trivial rules
2017-03-01 14:50:36 +03:00
Mikhail Zarechenskiy
875fdef917 Add tests for obsolete issues
#KT-15913 Obsolete
 #KT-12248 Obsolete
2017-03-01 14:07:09 +03:00
Anton Bannykh
318014e4ab Test vararg with Java behaviour only for JVM backends 2017-03-01 13:58:57 +03:00
Mikhail Glukhikh
91cd590395 Change log: note about javaClass added 2017-03-01 10:14:57 +03:00
Denis Zharkov
a7fc32c8da Add diagnostic on calling inner classes constructors without receiver
Otherwise there will be just an unresolved reference that doesn't give
any useful information

 #KT-8959 Fixed
2017-03-01 09:59:01 +03:00
Denis Zharkov
1e0ae04aba Minor. Convert if to when 2017-03-01 09:59:00 +03:00
Denis Zharkov
b5a8ffaddc Fix resolution of callable references
When there is unsuccessful (e.g invisible) result of one kind (static/non-static)
and there is a successful candidate for another kind, choose the latter one.

Note, that we have to postpone commiting trace until we choose one of the results,
otherwise errors of unsuccessful results are reported

TODO: Maybe it makes sense to report all results when all of them are
unsuccessful (NONE_APPLICABLE or something like this)

 #KT-16278 Fixed
2017-03-01 09:59:00 +03:00
Dmitry Petrov
dd61a5b2c6 KT-16553 Underscore variable values shall not be evaluated
Do not generate 'componentN' calls for '_' in destructuring assignment.
2017-03-01 09:25:38 +03:00
Dmitry Petrov
63b16e14d8 KT-16536 Wrong IR generated for '++x'
Make psi2ir confirm to JVM BE behavior for prefix increment/decrement.
TODO reconsider after design decision (in 1.2?).
2017-03-01 09:25:38 +03:00
Dmitry Petrov
885f397cdd KT-16535 'provideDelegate' convention is not supported in IR
Implement provideDelegate convention support.
NB delegate type now depends on 'provideDelegate' convention resolution.
2017-03-01 09:25:38 +03:00
Dmitry Petrov
6046b25f56 Minor: silence that irritating KT-14030 2017-03-01 09:25:38 +03:00
Dmitry Petrov
045a12ddc6 Minor: constructor IrExpressionBodyImpl(IrExpression) 2017-03-01 09:25:38 +03:00
Dmitry Petrov
e66c2621af KT-16436 Incorrect primitive constants handling
Expression '1.unaryMinus()' is resolved as Int::unaryMinus call with Int receiver.
However, this expression is implicitly coerced to a different integral type (Byte, Short, Long)
based on results of constant evaluation.

Introduce IMPLICIT_INTEGER_COERCION type operator to handle such cases.

TODO: should we use it for simple constant expressions like '1' and '-1'?
2017-03-01 09:25:38 +03:00
Dmitry Petrov
d0134f2c64 KT-16437 Incorrect type inference for some when coerced to Unit
If the result of 'when' is not used in an expression,
this 'when' expression has type 'Unit' despite of whatever FE has inferred.
2017-03-01 09:25:38 +03:00
Dmitry Petrov
e2e57e5b6d KT-16439 Generated methods of data classes have no expression for default arguments
Provide default argument expressions for generated 'copy' declaration.
2017-03-01 09:25:38 +03:00
Dmitry Petrov
0f1f354ba6 KT-16486 Strange IR for delegated members
Delegated implementations should refer to delegate field:
  $this: GET_FIELD <delegate_field> ...
    receiver: <this_for_containing_class>
2017-03-01 09:25:38 +03:00
Alexander Udalov
abbbdb5771 Update KotlinVersion.CURRENT to 1.1.2 2017-02-28 20:24:33 +03:00
Alexander Udalov
559da842c0 Clear reflection caches in black box codegen tests
To prevent tests from altering outcomes of the subsequent tests.

Also expose the clearCaches method (in the internal class
ReflectionFactoryImpl) so that it can be used in other places in similar
circumstances
2017-02-28 20:19:58 +03:00
Alexander Udalov
e19c1b5364 Drop MockTypeAliasDescriptor, use MockClassDescriptor instead
It's irrelevant whether the non-found classifier is a class or a
typealias
2017-02-28 20:19:58 +03:00
Alexander Udalov
12b48f86e7 Do not load error classes in ReflectionTypes
Previously ReflectionTypes.find returned an error class in case a class
is not found in the module dependencies. The problem with this approach
is that each call site should call ErrorUtils.isError on the result and
report an error if needed, in order to stop this type from reaching the
codegen, which can't handle error types.

Now we create a MockClassDescriptor instance instead. It's not an error
class, so it'll be handled correctly in the codegen. Also its scope is
empty and errors are reported on any non-trivial usage (see
MissingDependencyClassChecker), so this approach is not worse than error
classes

 #KT-16484 Fixed
2017-02-28 20:19:58 +03:00
Alexander Udalov
794cc1e3be Refactor API of NotFoundClasses
Move deserialization-related stuff to TypeDeserializer, because it's
going to be used in other places besides deserialization
2017-02-28 20:19:58 +03:00
Alexander Udalov
86994f81c3 Refactor ClassId.getOuterClassId, make it nullable 2017-02-28 20:19:57 +03:00
27178 changed files with 714167 additions and 259300 deletions

3
.gitattributes vendored
View File

@@ -1 +1,4 @@
**/testData/** linguist-vendored
*Generated.java linguist-generated=true
compiler/cli/bin/* eol=lf
compiler/cli/bin/*.bat eol=crlf

33
.gitignore vendored
View File

@@ -6,18 +6,31 @@
/dist
/gh-pages
/ideaSDK
/clionSDK
/android-studio/sdk
out
tmp
out/
/tmp
workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
ultimate/.DS_Store
ultimate/.idea/shelf
ultimate/dependencies
ultimate/ideaSDK
ultimate/out
ultimate/tmp
ultimate/workspace.xml
ultimate/*.versionsBackup
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
.gradle/
build/
!**/src/**/build
!**/test/**/build
*.iml
!**/testData/**/*.iml
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/modules
.idea/modules.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name

1
.idea/.name generated
View File

@@ -1 +0,0 @@
Kotlin

3
.idea/ant.xml generated
View File

@@ -3,7 +3,7 @@
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/compiler/frontend/buildLexer.xml" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<antCommandLine value="-J-XX:MaxPermSize=100m -J-ea" />
<antCommandLine value="-J-ea" />
<maximumHeapSize value="1024" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />
@@ -18,6 +18,5 @@
</properties>
</buildFile>
<buildFile url="file://$PROJECT_DIR$/TeamCityRelay.xml" />
<buildFile url="file://$PROJECT_DIR$/node_utils.xml" />
</component>
</project>

View File

@@ -1,9 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="IdeLazyResolver">
<output-path>$PROJECT_DIR$/out/artifacts/internal/</output-path>
<root id="archive" name="kotlin-ide-common.jar">
<element id="module-output" name="ide-common" />
<element id="dir-copy" path="$PROJECT_DIR$/idea/ide-common" />
</root>
</artifact>
</component>

View File

@@ -1,9 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="Instrumentation">
<output-path>$PROJECT_DIR$/out/artifacts/Instrumentation</output-path>
<root id="archive" name="Instrumentation.jar">
<element id="module-output" name="instrumentation" />
<element id="extracted-dir" path="$PROJECT_DIR$/ideaSDK/lib/asm-all.jar" path-in-jar="/" />
</root>
</artifact>
</component>

View File

@@ -1,9 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="KotlinFormatter">
<output-path>$PROJECT_DIR$/out/artifacts/internal</output-path>
<root id="archive" name="kotlin-formatter.jar">
<element id="module-output" name="formatter" />
<element id="dir-copy" path="$PROJECT_DIR$/idea/formatter" />
</root>
</artifact>
</component>

View File

@@ -1,31 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="KotlinJpsPlugin">
<output-path>$PROJECT_DIR$/out/artifacts/KotlinJpsPlugin</output-path>
<properties id="ant-postprocessing">
<options enabled="true">
<file>file://$PROJECT_DIR$/idea-runner/runner.xml</file>
<target>copy-runtime-for-jps-plugin</target>
</options>
</properties>
<root id="archive" name="kotlin-jps-plugin.jar">
<element id="directory" name="META-INF">
<element id="dir-copy" path="$PROJECT_DIR$/jps-plugin/src/META-INF" />
</element>
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar" path-in-jar="/" />
<element id="module-output" name="cli-common" />
<element id="module-output" name="idea-jps-common" />
<element id="module-output" name="jps-plugin" />
<element id="module-output" name="preloader" />
<element id="module-output" name="util" />
<element id="module-output" name="util.runtime" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="daemon-client" />
<element id="module-output" name="daemon-common" />
<element id="module-output" name="deserialization" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/native-platform-uberjar.jar" path-in-jar="/" />
<element id="module-output" name="android-extensions-jps" />
<element id="module-output" name="build-common" />
<element id="module-output" name="compiler-runner" />
</root>
</artifact>
</component>

View File

@@ -1,112 +0,0 @@
<component name="ArtifactManager">
<artifact name="KotlinPlugin">
<output-path>$PROJECT_DIR$/out/artifacts/Kotlin</output-path>
<properties id="ant-postprocessing">
<options enabled="true">
<file>file://$PROJECT_DIR$/idea-runner/runner.xml</file>
<target>copy-runtime-for-idea-plugin</target>
</options>
</properties>
<root id="root">
<element id="directory" name="lib">
<element id="archive" name="kotlin-plugin.jar">
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar" path-in-jar="/" />
<element id="module-output" name="backend" />
<element id="module-output" name="frontend" />
<element id="module-output" name="descriptors" />
<element id="module-output" name="frontend.java" />
<element id="module-output" name="descriptor.loader.java" />
<element id="module-output" name="idea" />
<element id="module-output" name="light-classes" />
<element id="module-output" name="util" />
<element id="module-output" name="util.runtime" />
<element id="module-output" name="j2k" />
<element id="module-output" name="js.frontend" />
<element id="module-output" name="js.parser" />
<element id="module-output" name="cli-common" />
<element id="module-output" name="idea-jps-common" />
<element id="module-output" name="build-common" />
<element id="module-output" name="preloader" />
<element id="module-output" name="deserialization" />
<element id="module-output" name="backend-common" />
<element id="library" level="project" name="builtins" />
<element id="module-output" name="js.ast" />
<element id="directory" name="kotlin">
<element id="dir-copy" path="$PROJECT_DIR$/core/builtins/native/kotlin" />
<element id="dir-copy" path="$PROJECT_DIR$/core/builtins/src/kotlin" />
</element>
<element id="module-output" name="eval4j" />
<element id="module-output" name="idea-analysis" />
<element id="module-output" name="ide-common" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="idea-android" />
<element id="module-output" name="idea-android-output-parser" />
<element id="module-output" name="js.serializer" />
<element id="module-output" name="serialization" />
<element id="module-output" name="idea-completion" />
<element id="module-output" name="idea-core" />
<element id="module-output" name="container" />
<element id="module-output" name="daemon-common" />
<element id="module-output" name="idea-repl" />
<element id="module-output" name="idea-live-templates" />
<element id="module-output" name="resolution" />
<element id="module-output" name="plugin-api" />
<element id="module-output" name="idea-ultimate" />
<element id="module-output" name="formatter" />
<element id="module-output" name="idea-maven" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="backend.common" />
<element id="module-output" name="ir.tree" />
<element id="module-output" name="backend.jvm" />
<element id="module-output" name="ir.psi2ir" />
<element id="module-output" name="annotation-based-compiler-plugins-ide-support" />
</element>
<element id="library" level="project" name="javax.inject" />
<element id="directory" name="jps">
<element id="artifact" artifact-name="KotlinJpsPlugin" />
</element>
<element id="library" level="project" name="markdown" />
<element id="archive" name="kotlin-android-extensions-plugin.jar">
<element id="module-output" name="android-extensions-idea" />
</element>
<element id="archive" name="kotlin-android-extensions-compiler-plugin.jar">
<element id="module-output" name="android-extensions-compiler" />
</element>
<element id="archive" name="android-lint.jar">
<element id="module-output" name="uast-kotlin" />
<element id="module-output" name="lint-idea" />
<element id="module-output" name="lint-checks" />
<element id="module-output" name="lint-api" />
<element id="module-output" name="uast-kotlin-idea" />
</element>
<element id="archive" name="allopen-ide-plugin.jar">
<element id="module-output" name="allopen-ide" />
</element>
<element id="archive" name="allopen-compiler-plugin.jar">
<element id="module-output" name="allopen-cli" />
</element>
<element id="archive" name="noarg-compiler-plugin.jar">
<element id="module-output" name="noarg-cli" />
</element>
<element id="archive" name="noarg-ide-plugin.jar">
<element id="module-output" name="noarg-ide" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/dist/kotlinc/lib/kotlin-daemon-client.jar" />
<element id="file-copy" path="$PROJECT_DIR$/dist/kotlinc/lib/kotlin-script-runtime.jar" />
<element id="archive" name="sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="sam-with-receiver-cli" />
</element>
<element id="archive" name="sam-with-receiver-ide-plugin.jar">
<element id="module-output" name="sam-with-receiver-ide" />
</element>
<element id="archive" name="kotlin-gradle-tooling.jar">
<element id="module-output" name="kotlin-gradle-tooling" />
</element>
<element id="library" level="project" name="uast-java" />
</element>
<element id="directory" name="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />
</element>
</root>
</artifact>
</component>

285
.idea/codeStyles/Project.xml generated Normal file
View File

@@ -0,0 +1,285 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="RIGHT_MARGIN" value="140" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<GroovyCodeStyleSettings>
<option name="STATIC_METHODS_ORDER_WEIGHT" value="5" />
<option name="METHODS_ORDER_WEIGHT" value="4" />
</GroovyCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="PREFER_LONGER_NAMES" value="false" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="java.awt" withSubpackages="false" static="false" />
<package name="javax.tools" withSubpackages="true" static="false" />
<package name="javax.swing" withSubpackages="false" static="false" />
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CONTINUATION_INDENT_IN_PARAMETER_LISTS" value="false" />
<option name="CONTINUATION_INDENT_IN_ARGUMENT_LISTS" value="false" />
<option name="CONTINUATION_INDENT_FOR_EXPRESSION_BODIES" value="false" />
<option name="CONTINUATION_INDENT_FOR_CHAINED_CALLS" value="false" />
<option name="CONTINUATION_INDENT_IN_SUPERTYPE_LISTS" value="false" />
<option name="CONTINUATION_INDENT_IN_IF_CONDITIONS" value="false" />
<option name="WRAP_EXPRESSION_BODY_FUNCTIONS" value="1" />
<option name="IF_RPAREN_ON_NEW_LINE" value="true" />
</JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CFML">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
</codeStyleSettings>
<codeStyleSettings language="CoffeeScript">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="GSP">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Groovy">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<indentOptions>
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="Scala">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

35
.idea/compiler.xml generated
View File

@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="BUILD_PROCESS_HEAP_SIZE" value="2000" />
<excludeFromCompile>
<directory url="file://$PROJECT_DIR$/core/reflection.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/runtime.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/builtins" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/script.runtime" includeSubdirectories="true" />
</excludeFromCompile>
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<bytecodeTargetLevel>
<module name="android-studio" target="1.8" />
<module name="idea" target="1.8" />
<module name="idea-analysis" target="1.8" />
<module name="idea-completion" target="1.8" />
<module name="idea-core" target="1.8" />
<module name="idea-live-templates" target="1.8" />
<module name="idea-repl" target="1.8" />
<module name="idea-runner" target="1.8" />
<module name="idea-test-framework" target="1.8" />
<module name="j2k" target="1.8" />
<module name="kannotator-jps-plugin-test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

View File

@@ -1,9 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="keyword" value="Copyright" />
<option name="allowReplaceKeyword" value="JetBrains" />
<option name="allowReplaceRegexp" value="JetBrains" />
<option name="myName" value="apache" />
<option name="myLocal" value="true" />
<option name="notice" value="Copyright 2000-&amp;#36;today.year JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license &#10;that can be found in the license/LICENSE.txt file." />
</copyright>
</component>

7
.idea/dictionaries/4u7.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="4u7">
<words>
<w>foldable</w>
</words>
</dictionary>
</component>

View File

@@ -2,6 +2,7 @@
<dictionary name="Nikolay.Krasko">
<words>
<w>accessors</w>
<w>coroutines</w>
<w>crossinline</w>
<w>fqname</w>
<w>goto</w>
@@ -12,6 +13,7 @@
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>
<w>navigatable</w>
<w>preload</w>
<w>preloader</w>
<w>preloading</w>

View File

@@ -2,9 +2,13 @@
<dictionary name="bashor">
<words>
<w>ctor</w>
<w>inlining</w>
<w>interner</w>
<w>kclass</w>
<w>lookups</w>
<w>minification</w>
<w>minifier</w>
<w>minify</w>
<w>unescape</w>
</words>
</dictionary>

View File

@@ -3,6 +3,8 @@
<words>
<w>checkcast</w>
<w>coroutine</w>
<w>experimentalities</w>
<w>experimentality</w>
<w>insn</w>
<w>liveness</w>
</words>

View File

@@ -1,8 +1,10 @@
<component name="ProjectDictionaryState">
<dictionary name="yan">
<words>
<w>deserializes</w>
<w>impls</w>
<w>kapt</w>
<w>parceler</w>
<w>uast</w>
</words>
</dictionary>

7
.idea/dictionaries/yole.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="yole">
<words>
<w>multiplatform</w>
</words>
</dictionary>
</component>

17
.idea/encodings.xml generated
View File

@@ -1,6 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/libraries" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example-with-library" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/js-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/kotlin-java-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/kotlin-js-library-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/idl2k" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-annotation-processing-maven" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-allopen" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-noarg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin-test" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-sam-with-receiver" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-osgi-bundle" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-jvm" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@@ -1,7 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0" is_locked="false">
<profile version="1.0">
<option name="myName" value="idea.default" />
<option name="myLocal" value="false" />
<inspection_tool class="AbstractMethodCallInConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ArchaicSystemPropertyAccess" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AssignmentToForLoopParameter" enabled="true" level="WARNING" enabled_by_default="true">
@@ -57,7 +56,7 @@
<option name="ignoreOnVolatileVariables" value="true" />
</inspection_tool>
<inspection_tool class="DuplicateCondition" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreMethodCalls" value="false" />
<option name="ignoreSideEffectConditions" value="true" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_reportEmptyBlocks" value="false" />
@@ -236,11 +235,6 @@
<scope name="idea openapi" level="WARNING" enabled="true" />
<scope name="runtime.classes" level="ERROR" enabled="true" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="LoopToCallChain" enabled="false" level="INFO" enabled_by_default="false" />
<inspection_tool class="MethodMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_onlyPrivateOrFinal" value="false" />
<option name="m_ignoreEmptyMethods" value="true" />
@@ -287,6 +281,7 @@
<option name="fromVersion" value="2.4" />
<option name="toVersion" value="3.1" />
</inspection_tool>
<inspection_tool class="Reformat" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreLazyOperators" value="true" />
<option name="ignoreObscureOperators" value="true" />
@@ -347,11 +342,12 @@
<constraint name="__context__" script="&quot;&quot;" within="" contains="" />
</searchConfiguration>
</inspection_tool>
<inspection_tool class="SameParameterValue" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="SetReplaceableByEnumSet" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SetupCallsSuperSetup" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SetupIsPublicVoidNoArg" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SimplifiableIfStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="Since15" enabled="true" level="ERROR" enabled_by_default="true">
<inspection_tool class="Since15" enabled="false" level="ERROR" enabled_by_default="false">
<scope name="IDEA Test Sources" level="ERROR" enabled="false" />
</inspection_tool>
<inspection_tool class="SocketResource" enabled="true" level="WARNING" enabled_by_default="true">
@@ -407,8 +403,10 @@
<inspection_tool class="UnnecessaryFullyQualifiedName" enabled="true" level="WARNING" enabled_by_default="true">
<scope name="IDEA Test Sources" level="WARNING" enabled="false">
<option name="m_ignoreJavadoc" value="true" />
<option name="ignoreInModuleStatements" value="true" />
</scope>
<option name="m_ignoreJavadoc" value="true" />
<option name="ignoreInModuleStatements" value="true" />
</inspection_tool>
<inspection_tool class="UnnecessaryLabelOnBreakStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessaryLabelOnContinueStatement" enabled="false" level="WARNING" enabled_by_default="false" />

12
.idea/kotlinc.xml generated
View File

@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JsCompilerArguments">
<option name="sourceMapEmbedSources" />
<option name="sourceMapPrefix" />
</component>
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
<option name="errors">
<ArgumentParseErrors />
</option>
</component>
<component name="KotlinCompilerSettings">
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="Rhino">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/rhino-1.7.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/rhino-1.7.6-sources.jar!/rhino1.7.6/src" />
</SOURCES>
</library>
</component>

View File

@@ -1,18 +0,0 @@
<component name="libraryTable">
<library name="android-plugin">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib" />
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib/jps" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/android-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib/jps" recursive="false" />
</library>
</component>

View File

@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="android-studio">
<CLASSES>
<root url="file://$PROJECT_DIR$/android-studio/sdk/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/android-studio/sdk/lib" recursive="false" />
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="ant">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/ant-1.8/lib/ant.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/apache-ant-1.8.2-src.zip!/apache-ant-1.8.2/src/main" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="asm">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/asm-all.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="builtins">
<CLASSES>
<root url="file://$PROJECT_DIR$/dist/builtins" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="cli-parser">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="copyright-plugin">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/copyright/lib/copyright.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="coverage-plugin">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/coverage.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/jacocoant.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/coverage/lib/coverage-agent.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="dx-android">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/android-5.0/lib/dx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/dependencies/dx-src/src" />
</SOURCES>
</library>
</component>

View File

@@ -1,19 +0,0 @@
<component name="libraryTable">
<library name="gradle-and-groovy-plugin">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" />
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/Groovy/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/Groovy/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" recursive="false" type="SOURCES" />
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="guava">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-17.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,18 +0,0 @@
<component name="libraryTable">
<library name="idea-full">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/lib" recursive="false" />
</library>
</component>

View File

@@ -1,18 +0,0 @@
<component name="libraryTable">
<library name="intellij-core">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/core" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/core" recursive="false" />
</library>
</component>

View File

@@ -1,17 +0,0 @@
<component name="libraryTable">
<library name="intellij-core-analysis">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/core-analysis/intellij-core-analysis.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="intellilang-plugin">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/IntelliLang/lib/IntelliLang.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="jansi">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/jansi.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/jansi-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="java-decompiler-plugin">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/java-decompiler/lib/java-decompiler.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="java-i18n">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/java-i18n/lib/java-i18n.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="javax.inject">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/javax.inject.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/javax.inject-src.zip!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="jline">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/jline.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/jline-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,26 +0,0 @@
<component name="libraryTable">
<library name="jps">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/jps" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/antLayout/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-launcher/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-api/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/plugin-system/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/standalone-builder/src" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/jps" recursive="false" />
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="jps-model">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/jps/jps-model.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="jps-test">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/jps/test" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/jps/test" recursive="false" />
</library>
</component>

View File

@@ -1,16 +0,0 @@
<component name="libraryTable">
<library name="junit-4.12">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/hamcrest-core-1.3.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/junit-4.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/hamcrest-core-1.3-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/junit-4.12-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="junit-plugin">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/junit/lib/idea-junit.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/junit/lib/resources_en.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="kotlin-reflect">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="kotlin-runtime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/libraries/stdlib/src" />
<root url="file://$PROJECT_DIR$/core/builtins/native" />
<root url="file://$PROJECT_DIR$/core/builtins/src" />
</SOURCES>
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="kotlin-script-runtime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-script-runtime.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="kotlin-test">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/"/>
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin.jvm" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
</SOURCES>
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="markdown">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/markdown.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="maven">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/maven/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/maven/lib" recursive="false" />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="native-platform-uberjar">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/native-platform-uberjar.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="properties">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/properties/lib/properties.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="protobuf-java">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,17 +0,0 @@
<component name="libraryTable">
<library name="testng-plugin">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/testng/lib/testng-plugin.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/testng/lib/testng.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/testng/lib/jcommander.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/testng/lib/resources_en.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,17 +0,0 @@
<component name="libraryTable">
<library name="trove4j">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/trove4j.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/core/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/generated/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/test/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/src/trove4j_src.jar!/util/src" />
</SOURCES>
</library>
</component>

View File

@@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="uast-java">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/uast-common.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-java.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-tests.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/uast-common-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-java-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/uast-tests-sources.jar!/" />
</SOURCES>
</library>
</component>

14
.idea/misc.xml generated
View File

@@ -6,7 +6,6 @@
</properties>
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
<list size="1">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
</list>
@@ -41,19 +40,24 @@
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/confluence-highlighting/pom.xml" />
<option value="$PROJECT_DIR$/confluence/pom.xml" />
<option value="$PROJECT_DIR$/libraries/pom.xml" />
</list>
</option>
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SuppressABINotification">
<option name="isSuppressed" value="true" />
<option name="modulesWithSuppressedNotConfigured">
<set>
<option value="kotlin-stdlib-common" />
<option value="kotlin-stdlib-js" />
<option value="kotlin-test-common" />
</set>
</option>
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="com.sixrr.metrics.MetricsReloaded">

103
.idea/modules.xml generated
View File

@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Kotlin.iml" filepath="$PROJECT_DIR$/Kotlin.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/allopen/allopen-cli/allopen-cli.iml" filepath="$PROJECT_DIR$/plugins/allopen/allopen-cli/allopen-cli.iml" group="plugins/allopen" />
<module fileurl="file://$PROJECT_DIR$/plugins/allopen/allopen-ide/allopen-ide.iml" filepath="$PROJECT_DIR$/plugins/allopen/allopen-ide/allopen-ide.iml" group="plugins/allopen" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" filepath="$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/android-studio/android-studio.iml" filepath="$PROJECT_DIR$/android-studio/android-studio.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/android-tests/android-tests.iml" filepath="$PROJECT_DIR$/compiler/android-tests/android-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-based-compiler-plugins-ide-support/annotation-based-compiler-plugins-ide-support.iml" filepath="$PROJECT_DIR$/plugins/annotation-based-compiler-plugins-ide-support/annotation-based-compiler-plugins-ide-support.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" filepath="$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" filepath="$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/ant/ant.iml" filepath="$PROJECT_DIR$/ant/ant.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend/backend.iml" filepath="$PROJECT_DIR$/compiler/backend/backend.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend-common/backend-common.iml" filepath="$PROJECT_DIR$/compiler/backend-common/backend-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/build-common/build-common.iml" filepath="$PROJECT_DIR$/build-common/build-common.iml" />
<module fileurl="file://$PROJECT_DIR$/core/builtins/builtins.iml" filepath="$PROJECT_DIR$/core/builtins/builtins.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" filepath="$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli.iml" filepath="$PROJECT_DIR$/compiler/cli/cli.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli-common/cli-common.iml" filepath="$PROJECT_DIR$/compiler/cli/cli-common/cli-common.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli-runner/cli-runner.iml" filepath="$PROJECT_DIR$/compiler/cli/cli-runner/cli-runner.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/compiler-runner/compiler-runner.iml" filepath="$PROJECT_DIR$/compiler/compiler-runner/compiler-runner.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests/compiler-tests.iml" filepath="$PROJECT_DIR$/compiler/tests/compiler-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-java8/compiler-tests-java8.iml" filepath="$PROJECT_DIR$/compiler/tests-java8/compiler-tests-java8.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/conditional-preprocessor/conditional-preprocessor.iml" filepath="$PROJECT_DIR$/compiler/conditional-preprocessor/conditional-preprocessor.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/container/container.iml" filepath="$PROJECT_DIR$/compiler/container/container.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/daemon/daemon.iml" filepath="$PROJECT_DIR$/compiler/daemon/daemon.iml" group="compiler/daemon" />
<module fileurl="file://$PROJECT_DIR$/compiler/daemon/daemon-client/daemon-client.iml" filepath="$PROJECT_DIR$/compiler/daemon/daemon-client/daemon-client.iml" group="compiler/daemon" />
<module fileurl="file://$PROJECT_DIR$/compiler/daemon/daemon-common/daemon-common.iml" filepath="$PROJECT_DIR$/compiler/daemon/daemon-common/daemon-common.iml" group="compiler/daemon" />
<module fileurl="file://$PROJECT_DIR$/core/descriptor.loader.java/descriptor.loader.java.iml" filepath="$PROJECT_DIR$/core/descriptor.loader.java/descriptor.loader.java.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/descriptors/descriptors.iml" filepath="$PROJECT_DIR$/core/descriptors/descriptors.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/descriptors.runtime/descriptors.runtime.iml" filepath="$PROJECT_DIR$/core/descriptors.runtime/descriptors.runtime.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/deserialization/deserialization.iml" filepath="$PROJECT_DIR$/core/deserialization/deserialization.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/eval4j/eval4j.iml" filepath="$PROJECT_DIR$/eval4j/eval4j.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/formatter/formatter.iml" filepath="$PROJECT_DIR$/idea/formatter/formatter.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" />
<module fileurl="file://$PROJECT_DIR$/grammar/grammar.iml" filepath="$PROJECT_DIR$/grammar/grammar.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/idea/ide-common/ide-common.iml" filepath="$PROJECT_DIR$/idea/ide-common/ide-common.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea.iml" filepath="$PROJECT_DIR$/idea/idea.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" filepath="$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" filepath="$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-core/idea-core.iml" filepath="$PROJECT_DIR$/idea/idea-core/idea-core.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" filepath="$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" filepath="$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" filepath="$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" filepath="$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea-runner/idea-runner.iml" filepath="$PROJECT_DIR$/idea-runner/idea-runner.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" filepath="$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/incremental-compilation-impl/incremental-compilation-impl.iml" filepath="$PROJECT_DIR$/compiler/incremental-compilation-impl/incremental-compilation-impl.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" filepath="$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/j2k/j2k.iml" filepath="$PROJECT_DIR$/j2k/j2k.iml" group="j2k" />
<module fileurl="file://$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" filepath="$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-plugin.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/js/js.ast/js.ast.iml" filepath="$PROJECT_DIR$/js/js.ast/js.ast.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.frontend/js.frontend.iml" filepath="$PROJECT_DIR$/js/js.frontend/js.frontend.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.inliner/js.inliner.iml" filepath="$PROJECT_DIR$/js/js.inliner/js.inliner.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.parser/js.parser.iml" filepath="$PROJECT_DIR$/js/js.parser/js.parser.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.serializer/js.serializer.iml" filepath="$PROJECT_DIR$/js/js.serializer/js.serializer.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.tests/js.tests.iml" filepath="$PROJECT_DIR$/js/js.tests/js.tests.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.translator/js.translator.iml" filepath="$PROJECT_DIR$/js/js.translator/js.translator.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" filepath="$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/plugins/kapt3/kapt3.iml" filepath="$PROJECT_DIR$/plugins/kapt3/kapt3.iml" />
<module fileurl="file://$PROJECT_DIR$/idea/kotlin-gradle-tooling/kotlin-gradle-tooling.iml" filepath="$PROJECT_DIR$/idea/kotlin-gradle-tooling/kotlin-gradle-tooling.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/light-classes/light-classes.iml" filepath="$PROJECT_DIR$/compiler/light-classes/light-classes.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-cli/noarg-cli.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" filepath="$PROJECT_DIR$/plugins/noarg/noarg-ide/noarg-ide.iml" />
<module fileurl="file://$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" filepath="$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" filepath="$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" filepath="$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/preloader.iml" filepath="$PROJECT_DIR$/compiler/preloader/preloader.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" filepath="$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/resolution/resolution.iml" filepath="$PROJECT_DIR$/compiler/resolution/resolution.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" filepath="$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/sam-with-receiver-cli.iml" filepath="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/sam-with-receiver-cli.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/sam-with-receiver-ide.iml" filepath="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/sam-with-receiver-ide.iml" />
<module fileurl="file://$PROJECT_DIR$/core/script.runtime/script.runtime.iml" filepath="$PROJECT_DIR$/core/script.runtime/script.runtime.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/serialization/serialization.iml" filepath="$PROJECT_DIR$/compiler/serialization/serialization.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-common/tests-common.iml" filepath="$PROJECT_DIR$/compiler/tests-common/tests-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" filepath="$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin-idea/uast-kotlin-idea.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin-idea/uast-kotlin-idea.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/util/util.iml" filepath="$PROJECT_DIR$/compiler/util/util.iml" />
<module fileurl="file://$PROJECT_DIR$/core/util.runtime/util.runtime.iml" filepath="$PROJECT_DIR$/core/util.runtime/util.runtime.iml" group="core" />
</modules>
</component>
</project>

View File

@@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Compiler Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="JUnit" name="Compiler Tests" />
<toRun type="JUnit" name="Java 8 Tests" />
<toRun type="JUnit" name="Js-backend tests" />
<method />
</configuration>
</component>

View File

@@ -1,37 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All IDEA Plugin Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="idea" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,37 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Jvm Backend Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,39 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Non Compiler Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="non-compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1100m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs>
<env name="NO_FS_ROOTS_ACCESS_CHECK" value="true" />
</envs>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="53032" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="CompoundRunConfigurationType" name="All Compiler Tests" />
<toRun type="JUnit" name="All Non Compiler Tests" />
<method />
</configuration>
</component>

View File

@@ -1,26 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All in jps-tests" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="jps-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Profile ">
<option name="myExternalizedOptions" />
</RunnerSettings>
<method />
</configuration>
</component>

View File

@@ -1,30 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android Studio" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Didea.paths.selector=AndroidStudioPreview -Didea.platform.prefix=AndroidStudio -Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin,$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/android-studio/sdk/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="android-studio" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
<option name="BuildArtifacts" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -1,31 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests on Android" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="android-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.6" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.android.tests" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.android.tests.AndroidRunner" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx850m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,37 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Compiler Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -XX:MaxPermSize=300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,31 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Eval4j Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="eval4j" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.eval4j.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-x :ultimate:generateTests" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="generateTests" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Compiler Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/compiler" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":compiler:generateTests" />
<option value=":compiler:tests-java8:generateTests" />
<option value=":js:js.tests:generateTests" />
<option value=":core:descriptors.runtime:generateTests" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>

View File

@@ -1,34 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Tests" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.generators.tests.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.generators.tests.GenerateTestsKt" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="generators" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="Make" enabled="false" />
<option name="MakeNoErrorCheck" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate standard library sources" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/kotlin-stdlib-gen" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--configure-on-demand" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -1,49 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="idea-runner" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
<configuration default="false" name="IDEA" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/idea-runner/runner.xml" target="force-enable-kotlin-plugin" />
</method>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runUltimate" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate (No ProcessCanceledException) " type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-PnoPCE" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runUltimate" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -1,31 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="idea-runner" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-PnoPCE" />
<option name="taskDescriptions">
<list />
</option>
<option name="BuildArtifacts" enabled="true" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/idea-runner/runner.xml" target="force-enable-kotlin-plugin" />
</method>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -1,40 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="J2K Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="j2k" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="pattern" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns>
<pattern testClass="org.jetbrains.kotlin.idea.conversion.copy.*" />
<pattern testClass="org.jetbrains.kotlin.j2k.*" />
</patterns>
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Java 8 Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests-java8" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Java 8 Tests on JDK 9" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests-java8" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,31 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Js-backend tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="js.tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,31 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="KAnnotator Jps Plugin Test" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="kannotator-jps-plugin-test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.jps.build.kannotator" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,42 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Smart Completion Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.completion.handlers.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="idea" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.completion.handlers" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="pattern" />
<option name="VM_PARAMETERS" value="-ea -Xmx850m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns>
<pattern testClass="org.jetbrains.kotlin.idea.completion.test.JvmSmartCompletionTestGenerated" />
<pattern testClass="org.jetbrains.kotlin.idea.completion.test.handlers.SmartCompletionHandlerTestGenerated" />
<pattern testClass="org.jetbrains.kotlin.idea.completion.test.handlers.SmartCompletionMultifileHandlerTest" />
<pattern testClass="org.jetbrains.kotlin.idea.completion.test.weighers.SmartCompletionWeigherTestGenerated" />
<pattern testClass="org.jetbrains.kotlin.idea.completion.test.MultiFileSmartCompletionTestGenerated" />
</patterns>
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: public API binary compatibility validator, overwrite results" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/binary-compatibility-validator" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value=" --tests * " />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":kotlin-runtime:clean" />
<option value=":kotlin-stdlib:clean" />
<option value=":kotlin-reflect:clean" />
<option value=":tools:binary-compatibility-validator:cleanTest" />
<option value=":tools:binary-compatibility-validator:test" />
</list>
</option>
<option name="vmOptions" value="-Doverwrite.output=true" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@@ -1,29 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Update-Dist-Run" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="idea-runner" />
<envs />
<method>
<option name="Make" enabled="false" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/build.xml" target="clean_idea_output" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/update_dependencies.xml" target="update" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/build.xml" target="dist" />
<option name="MakeProject" enabled="true" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Generate Tests" run_configuration_type="Application" />
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
<option name="BuildArtifacts" enabled="true" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/idea_runner/runner.xml" target="force_enable_kotlin_plugin" />
</method>
</configuration>
</component>

2
.idea/scopes/IDE.xml generated
View File

@@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="IDE" pattern="file[idea]:src/*/||file[idea]:testData/*/||file[ide-common]:src/*/||file[idea-analysis]:src/*/||file[idea-android]:src/*/||file[idea-completion]:src/*/||file[idea-completion]:testData/*/||file[idea-core]:src/*/||file[idea-jps-common]:/*/||file[idea-live-templates]:/*/||file[idea-live-templates]:testData/*/||file[idea-repl]:/*/||src[idea-android-output-parser]:*..*" />
<scope name="IDE" pattern="file[idea_main]:*/||file[idea]:testData/*/||file[idea-formatter_main]:*/||file[ide-common_main]:*/||file[idea-android_main]:*/||file[idea-android-output-parser_main]:*/||file[idea]:idea-completion/testData/*/||file[idea-core_main]:*/||file[idea-gradle_main]:*/||file[idea-jps-common_main]:*/||file[idea-jvm_main]:*/||file[idea]:idea-live-templates/src/*/||file[idea]:idea-live-templates/testData/*/||file[idea-maven_main]:*/||file[idea-repl]:*/||file[idea-test-framework_main]:*/||file[kotlin-gradle-tooling_main]:*/" />
</component>

10
.idea/tools.protobuf.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProtobufSettings">
<option name="includePaths">
<list>
<option value="$PROJECT_DIR$" />
</list>
</option>
</component>
</project>

4
.idea/vcs.xml generated
View File

@@ -11,6 +11,10 @@
<option name="issueRegexp" value="EA\-(\d+)" />
<option name="linkRegexp" value="http://ea.jetbrains.com/browser/ea_problems/$1" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="KEEP\-(\d+)" />
<option name="linkRegexp" value="https://github.com/Kotlin/KEEP/issues/$1" />
</IssueNavigationLink>
</list>
</option>
</component>

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
<excludeFolder url="$MODULE_DIR$/libraries/out" />
<excludeFolder url="file://$MODULE_DIR$/android.tests.dependencies" />
<excludeFolder url="file://$MODULE_DIR$/dependencies" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/androidSDK" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/config" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/config-idea" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/system" />
<excludeFolder url="file://$MODULE_DIR$/ideaSDK/system-idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/.idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/docs/apidoc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/docs/website/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/browser-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/js-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-java-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin-jdbc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin-swing/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kunit/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/validator/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/.idea" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kdoc-maven-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kdoc/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-core/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-core/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-library/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-tests-junit/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-js-tests/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin-test/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin/local-repo" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-reflect/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-stdlib-gen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/runtime/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

149
ReadMe.md
View File

@@ -1,5 +1,6 @@
<a href="https://kotlinslackin.herokuapp.com"><img src="https://kotlinslackin.herokuapp.com/badge.svg" height="20"></a>
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/bt345.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt345&branch_Kotlin=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
<a href="http://slack.kotlinlang.org/"><img src="http://slack.kotlinlang.org/badge.svg" height="20"></a>
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
@@ -9,13 +10,13 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](http://try.kotlinlang.org/)
* [Try Kotlin](https://try.kotlinlang.org/)
* [Kotlin Standard Library](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](https://youtrack.jetbrains.com/issues/KT)
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](https://kotlinslackin.herokuapp.com/)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
@@ -32,11 +33,17 @@ In order to build Kotlin distribution you need to have:
- JDK 1.6, 1.7 and 1.8
- Setup environment variables as following:
JAVA_HOME="path to JDK 1.6"
JAVA_HOME="path to JDK 1.8"
JDK_16="path to JDK 1.6"
JDK_17="path to JDK 1.7"
JDK_18="path to JDK 1.8"
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 8 installed, and to point all of the environment variables mentioned above to your JDK 8 installation.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
## Building
To build this project, first time you try to build you need to run this:
@@ -45,79 +52,63 @@ To build this project, first time you try to build you need to run this:
which will setup the dependencies on
* intellij-core: is a part of command line compiler and contains only necessary APIs.
* idea-full: is a full blown IntelliJ IDEA Community Edition to be used in former plugin module.
* `intellij-core` is a part of command line compiler and contains only necessary APIs.
* `idea-full` is a full blown IntelliJ IDEA Community Edition to be used in the plugin module.
Then, you need to run
Then, you may run Gradle to build the project and run tests, using:
ant -f build.xml
./gradlew <tasks-and-options>
command on Unix/macOS, or
which will build the binaries of the compiler and put them into the 'dist' directory. You may need to increase the **heap size** for Ant using
[ANT_OPTS](https://web.liferay.com/community/wiki/-/wiki/Main/Ant+opts).
gradlew <tasks-and-options>
on Windows.
**OPTIONAL:** Maven distribution is built separately, run
## Important gradle tasks
mvn package
- `clean` - clean build results
- `dist` - assembles the compiler distribution into `dist/kotlinc/` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/Kotlin` folder
- `install` - build and install all public artifacts into local maven repository
- `runIde` - build IDEA plugin and run IDEA with it
- `coreLibsTest` - build and run stdlib, reflect and kotlin-test tests
- `gradlePluginTest` - build and run gradle plugin tests
- `compilerTest` - build and run all compiler tests
- `ideaPluginTest` - build and run all IDEA plugin tests
from 'libraries' directory after building the compiler. Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately by Maven: go into `libraries` directory after building the compiler and run:
mvn install
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
## Working with the project in IntelliJ IDEA
The [root kotlin project](https://github.com/JetBrains/kotlin) already has an IntelliJ IDEA project, you can just open it in IntelliJ IDEA.
Working with the Kotlin project requires IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
You may need to set the Project SDK (File -> Project Structure -> Project).
You may also need to add `tools.jar` to your SDK: File -> Project Structure -> SDKs -> <Your JDK> -> Classpath,
then choose the `tools.jar` in the JDK's `lib` directory.
To import the project in Intellij choose project directory in Open project dialog. Then, after project opened, Select
`File` -> `New...` -> `Module from Existing Sources` in the menu, and select `build.gradle.kts` file in the project's root folder.
If you are not dealing with Android, you may need to disable the Android Plugin in order to compile the project.
In the import dialog, select `use default gradle wrapper`.
Since Kotlin project contains code written in Kotlin itself, you will also need a Kotlin plugin to build the project in IntelliJ IDEA.
To keep the plugin version in sync with the rest of the team and our [Continuous Integration server](https://teamcity.jetbrains.com/project.html?projectId=Kotlin&tab=projectOverview)
you should install the according to the [instructions below](#plugin-for-contributors).
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` in the Gradle runner settings.
If you want to have an IntelliJ IDEA installation without the Kotlin plugin which is separate to your default IntelliJ IDEA installation which has the Kotlin
plugin [see this document](https://devnet.jetbrains.com/docs/DOC-181) which describes how to have multiple IntelliJ IDEA installations using different configurations and plugin directories.
At this time, you can use the latest released 1.1.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
### Compiling and running
From this root project there are Run/Debug Configurations for running IDEA or the Compiler Tests for example; so if you want to try out the latest and greatest IDEA plugin
* VCS -> Git -> Pull
* Run IntelliJ IDEA
* Run the "IDEA" run configuration in the project
* a child IntelliJ IDEA with the Kotlin plugin will then startup
* you can now open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries) to then work with the various kotlin libraries etc.
### <a name="pre-built-plugin"></a>Using a pre-built Kotlin IntelliJ IDEA plugin
There are several options for getting Kotlin plugin. A stable version can be obtained as any other plugin for IntelliJ IDEA:
Preferences -> Plugins -> Install JetBrains plugin... -> Search with "Kotlin" string
The most recent version of the plugin can be downloaded from the
[IDEA Plugin and Tests CI build](https://teamcity.jetbrains.com/project.html?projectId=project67&tab=projectOverview). When downloading is
finished you can install it with "Install plugin from disk...":
Preferences -> Plugins -> Install plugin from disk...
You can now open any Kotlin based projects.
<a name="plugin-for-contributors"></a>
**Note for contributors**: If you are planning to contribute to Kotlin project you probably want to have locally the same version of plugin that build server is using for building.
As this version is constantly moving, the best way to always be updated is to let IntelliJ IDEA notify you when it is time to renew your plugin.
Open
Preferences -> Plugins -> Browse Repositories -> Manage Repositories...
and add the following URL to your repositories:
https://teamcity.jetbrains.com/guestAuth/repository/download/bt345/bootstrap.tcbuildtag/updatePlugins.xml
Then update the list of plugins in "Browse Repositories", you'll see two versions of Kotlin there, install the one with the higher version number.
# Contributing
We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=Subtask+of%3A+KT-2554+%23Unresolved) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://kotlinslackin.herokuapp.com/)
[standard library](https://youtrack.jetbrains.com/issues/KT?q=%23Kotlin%20%23Unresolved%20and%20(links:%20KT-2554,%20KT-4089%20or%20%23Libraries)) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://slack.kotlinlang.org/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
@@ -128,40 +119,13 @@ A nice gentle way to contribute would be to review the [standard library docs](h
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/collections/Maps.kt#L64)
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/Maps.kt#L91)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
## If you want to work on the compiler
The Kotlin compiler is written in Java and Kotlin (we gradually migrate more and more of it to pure Kotlin). So the easiest way to work on the compiler or IntelliJ IDEA plugin is
* download a clean [IDEA 15 EAP build](https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP)
* [install the Kotlin plugin](#pre-built-plugin)
* open the [root kotlin project](https://github.com/JetBrains/kotlin) in IDEA (opening the kotlin directory)
You can now run the various Run/Debug Configurations such as
* IDEA
* All Compiler Tests
* All IDEA Plugin Tests
## If you want to work on the Kotlin libraries
* download a clean [IDEA 15 EAP build](https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP)
* [install the Kotlin plugin](#pre-built-plugin)
* open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries)
Then build via
cd libraries
mvn install
Some of the code in the standard library is created by generating code from templates. See the [README](https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/ReadMe.md) in the stdlib section for how run the code generator. The existing templates can be used as examples for creating new ones.
Some of the code in the standard library is created by generating code from templates. See the [README](libraries/stdlib/ReadMe.md) in the stdlib section for how run the code generator. The existing templates can be used as examples for creating new ones.
## Submitting patches
@@ -169,12 +133,9 @@ The best way to submit a patch is to [fork the project on github](https://help.g
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [github](https://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing `git config --global pull.rebase
true`. This will avoid your local repo having too many merge commits
when you pull by executing
``` bash
git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.
## Commit comments
If you include in your comment this text (where KT-1234 is the Issue ID in the [Issue Tracker](https://youtrack.jetbrains.com/issues/KT), the issue will get automatically marked as fixed.
#KT-1234 Fixed

View File

@@ -2,12 +2,11 @@
<import file="build.xml" optional="false"/>
<property name="build.number" value="snapshot"/>
<property name="jdk16.home" value="${java.home}"/>
<property name="fail.on.plugin.verifier.error" value="true"/>
<property name="version_substitute_dir" value="${basedir}/versions_temp/"/>
<property name="artifact.output.path" value="${basedir}/out/artifacts"/>
<property name="artifact.output.path" value="${basedir}/dist/artifacts"/>
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
<property name="plugin.xml.bk" value="${version_substitute_dir}/plugin.xml.bk"/>
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned"/>
@@ -17,8 +16,10 @@
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinCompilerVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
<property name="compiler.version.number" value="${build.number}"/>
<property name="compiler.ant.fork.jvmargs" value="-Xmx1024m"/>
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip"/>
<property name="pluginArtifactDir" value="Kotlin" />
<macrodef name="echoprop">
<attribute name="prop"/>
@@ -74,14 +75,7 @@
</macrodef>
<target name="writeCompilerVersionToTemplateFile">
<mkdir dir="${version_substitute_dir}"/>
<substituteVersionInFile
target.file="${compiler.version.java}"
target.file.bk="${compiler.version.java.bk}"
target.file.versioned="${compiler.version.java.versioned}"
test.string="public static final String VERSION = &quot;@snapshot@&quot;;"
version="${compiler.version.number}"/>
<!-- empty, version is written in gradle build -->
</target>
<target name="writePluginVersionToTemplateFile">
@@ -107,21 +101,21 @@
<target name="zipArtifacts">
<macrodef name="zipPlugin">
<attribute name="filename"/>
<attribute name="prefix" />
<attribute name="dir"/>
<sequential>
<zip destfile="@{filename}">
<zipfileset prefix="@{dir}" dir="${artifact.output.path}/@{dir}" excludes="kotlinc/bin/*"/>
<zipfileset prefix="@{dir}/kotlinc/bin" dir="${artifact.output.path}/@{dir}/kotlinc/bin" includes="*.bat"
<zipfileset prefix="@{prefix}" dir="@{dir}" excludes="kotlinc/bin/*"/>
<zipfileset prefix="@{prefix}/kotlinc/bin" dir="@{dir}/kotlinc/bin" includes="*.bat"
filemode="644"/>
<zipfileset prefix="@{dir}/kotlinc/bin" dir="${artifact.output.path}/@{dir}/kotlinc/bin" excludes="*.bat"
<zipfileset prefix="@{prefix}/kotlinc/bin" dir="@{dir}/kotlinc/bin" excludes="*.bat"
filemode="755"/>
</zip>
<delete dir="${artifact.output.path}/@{dir}" quiet="true"/>
</sequential>
</macrodef>
<zipPlugin filename="${plugin.zip}" dir="Kotlin"/>
<zipPlugin filename="${plugin.zip}" prefix="Kotlin" dir="${artifact.output.path}/${pluginArtifactDir}"/>
</target>
<macrodef name="print-statistic">
@@ -150,8 +144,8 @@
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib-js.jar"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.meta.js}"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.js}"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin-test.js"/>
<print-file-size-statistic path="${basedir}/libraries/stdlib/js/build/classes/main" file-name="kotlin.meta.js"/>
</target>
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="ant" level="project" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" name="kotlin-reflect" level="project" />
<orderEntry type="module" module-name="preloader" />
</component>
</module>

23
ant/build.gradle.kts Normal file
View File

@@ -0,0 +1,23 @@
description = "Kotlin Ant Tools"
apply { plugin("kotlin") }
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(projectDist(":kotlin-stdlib"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
}
runtimeJar {
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar")
}
dist()

View File

@@ -29,8 +29,8 @@ internal object KotlinAntTaskUtil {
private val libPath: File by lazy {
// Find path of kotlin-ant.jar in the filesystem and find kotlin-compiler.jar in the same directory
val resourcePath = "/" + javaClass.name.replace('.', '/') + ".class"
val jarConnection = javaClass.getResource(resourcePath).openConnection() as? JarURLConnection
val resourcePath = "/" + this::class.java.name.replace('.', '/') + ".class"
val jarConnection = this::class.java.getResource(resourcePath).openConnection() as? JarURLConnection
?: throw UnsupportedOperationException("Kotlin compiler Ant task should be loaded from the JAR file")
val antTaskJarPath = File(jarConnection.jarFileURL.toURI())
@@ -54,7 +54,7 @@ internal object KotlinAntTaskUtil {
val cached = classLoaderRef.get()
if (cached != null) return cached
val myLoader = javaClass.classLoader
val myLoader = this::class.java.classLoader
if (myLoader !is AntClassLoader) return myLoader
val classLoader = ClassPreloadingUtils.preloadClasses(listOf(compilerJar), Preloader.DEFAULT_CLASS_NUMBER_ESTIMATE, myLoader, null)

View File

@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ant
import org.apache.tools.ant.BuildException
import org.apache.tools.ant.MagicNames
import org.apache.tools.ant.Project.MSG_ERR
import org.apache.tools.ant.Project.MSG_WARN
import org.apache.tools.ant.taskdefs.compilers.Javac13
import org.apache.tools.ant.taskdefs.condition.AntVersion
@@ -38,12 +39,15 @@ class KotlinCompilerAdapter : Javac13() {
return argument
}
override fun getSupportedFileExtensions(): Array<String> {
return super.getSupportedFileExtensions() + KOTLIN_EXTENSIONS
}
override fun getSupportedFileExtensions(): Array<String> = super.getSupportedFileExtensions() + KOTLIN_EXTENSIONS
@Throws(BuildException::class)
override fun execute(): Boolean {
if (javac.isForkedJavac) {
javac.log("<withKotlin> task does not yet support the fork mode", MSG_ERR)
return false
}
val javac = javac
checkAntVersion()

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="frontend.java" />
<orderEntry type="module" module-name="util.runtime" />
<orderEntry type="module" module-name="cli-common" />
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="tests-common" scope="TEST" />
<orderEntry type="library" scope="TEST" name="idea-full" level="project" />
</component>
</module>

Some files were not shown because too many files have changed in this diff Show More