Compare commits

..

6612 Commits

Author SHA1 Message Date
Alexey Sedunov
16f6bf4fa6 Analyze Data Flow: Add usage context panels 2017-06-05 16:36:21 +03:00
Alexey Sedunov
33bddb42c0 Analyze Data Flow: Respect member hierarchies
#KT-11994 In Progress
2017-06-05 16:36:14 +03:00
Alexey Sedunov
64c1d8e1ce Analyze Data Flow: Support val/var parameters
#KT-11994 In Progress
2017-06-05 16:36:08 +03:00
Alexey Sedunov
4406a4bec8 Analyze Data Flow: Support properties with custom accessors
#KT-11994 In Progress
2017-06-05 16:36:01 +03:00
Alexey Sedunov
f33f7d6c75 Analyze Data Flow: Support callable references
#KT-11994 In Progress
2017-06-05 16:35:54 +03:00
Alexey Sedunov
84be3c1ba3 Analyze Data Flow: Support lambdas/anonymous functions
#KT-11994 In Progress
2017-06-05 16:35:48 +03:00
Alexey Sedunov
49640b38f5 Analyze Data Flow: Support dereference processing
#KT-11994 In Progress
2017-06-05 16:35:41 +03:00
Alexey Sedunov
823ccee42a Analyze Data Flow: Initial implementation
#KT-11994 In Progress
2017-06-05 16:35:34 +03:00
Alexey Sedunov
605084e151 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-05 16:26:10 +03:00
Alexey Sedunov
f3bcac16e8 Copy/Move: Fix processing of imported Java static members
#KT-18098 Fixed
2017-06-05 13:04:33 +03:00
Alexey Sedunov
cd376c20fb Rename: Fix rename of import alias referring to object member
#KT-18096 Fixed
2017-06-05 13:04:26 +03:00
Alexey Sedunov
f8c3e42124 Rename: Disable member inplace when variable inplace is available 2017-06-05 13:04:19 +03:00
Alexey Sedunov
a36dddba04 Rename: Disable label rename outside of reference range
#KT-17128 Fixed
2017-06-05 13:04:12 +03:00
Alexey Sedunov
2d96e9366a Rename: Disable Java member rename by reference to import alias
#KT-18076 Fixed
2017-06-05 13:04:03 +03:00
Alexey Sedunov
5f6c9714d6 Rename: Fix inplace refactoring for declarations with backticked names
#KT-15859 Fixed
2017-06-05 13:03:56 +03:00
Alexey Sedunov
74f404fc76 Copy: Rename only self-usages of the copied class
#KT-18034 Fixed
2017-06-05 13:03:49 +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
Mikhael Bogdanov
21de67cac1 Fix for KT-16532: Kotlin 1.1 RC - Android cross-inline synchronized won't run
Finnaly markers are used only for non-local return processing and are removed after inlining  to non-inline functions, same deletion should be performed on inlining to anonymous objects

 #KT-16532 Fixed
2017-02-28 15:40:04 +01:00
Alexey Sedunov
387c91f957 Kotlin Facet: Do not concat "additional argument" string as configuration gets duplicated
KT-16548 Fixed
2017-02-28 16:07:58 +03:00
Anton Bannykh
6608e97d35 JPS JS: simplified the code and added tests for the missing meta.js case (e.g. empty sourceroot; fixed by yole in 00ed0248d9a23701dbef52da02259d174a9999e7) 2017-02-28 16:05:16 +03:00
Anton Bannykh
2d9392aad4 JS: fixed callable reference to a class constructor within object (KT-16411). 2017-02-28 15:55:50 +03:00
Mikhail Glukhikh
6ed3672f8d Change log for 1.1 (release)
(cherry picked from commit afd6e0d)
2017-02-28 11:46:25 +03:00
Denis Zharkov
ecec87cbc7 Refine signature calculation for methods with default parameters
The problem was that he number of mask parameters for defaults when
generating methods declaration was being calculated upon resulting signature
(with additional parameters: extension receivers, enum name/ordinal),
while on call-sites the masks number was calculated by the arguments number
in resolved call, i.e. by the number of real value parameters.

And because of the additional synthetic parameters (like enum.ordinal) these
two numbers could be different.

The solution is just to use value parameters number in both places.
Note, that we only count value parameters from the original sourse
declaration, ignoring synthetic ones generated by backend (e.g.
Continuation for suspend functions)

 #KT-14565 Fixed
2017-02-28 10:42:07 +03:00
Denis Zharkov
9e03b712de Use flexible upper bound of parameter's type for vararg argument
See the issue and the test. The problem was that when generating
call to `foo` method in member scope of `AT<*>` its resulting descriptor
after substitution and approximation was: fun foo(x: Nothing..Array<out Nothing>).

This signature is correct, but when using this parameter type
for generating a vararg argument the assertion is violated that
the type of the argument must be an array
(by default we're using lower flexible bound everywhere)

The solution is using upper bound for flexible types that should
always have a form of Array<out T> for varargs (even for such corner cases)
both for Kotlin and Java declarations.

 #KT-14607 Fixed
2017-02-28 10:40:54 +03:00
Alexey Sedunov
14dad61fe5 Kotlin Facet: Import more configuration options from Maven
(cherry picked from commit dca696f)
2017-02-28 03:06:54 +03:00
Alexey Sedunov
90c2b14051 Kotlin Facet: Import Maven option specified in <jvmTarget> element
#KT-16329 In Progress
2017-02-28 03:05:13 +03:00
Nikolay Krasko
b9b4cce293 Set JVM target from facet settings on compiler configuration creation
Otherwise analyse in IDE is perfomed under default JVM target and wrong
diagnostics are reported.

 #KT-16329 In Progress
2017-02-28 02:32:59 +03:00
Roman Elizarov
266d7c15fe Documentation for createCoroutine/createCoroutineUnchecked 2017-02-27 16:48:24 +03:00
Nikolay Krasko
f0be88fc07 Use doResume name for suspend lambdas context (KT-16481)
#KT-16481 Fixed
2017-02-27 14:49:13 +03:00
Nikolay Krasko
dffbe0f707 Count JVM class name for inlined function from base declaration
Drop code with naive removing all anonymous classes.
Breakpoints now works when inline call is in anonymous call.
2017-02-27 14:49:12 +03:00
Nikolay Krasko
cd92e3fc98 Refactoring: use constants instead of string literals 2017-02-27 14:49:11 +03:00
Ilya Chernikov
fa5728b288 Use Void instead of Unit in RMI calls, should fix EA-82064
("Could not initialize class Kotlin.Unit")

(cherry picked from commit b3a1311)
2017-02-24 16:58:25 +01:00
Ilya Chernikov
00e8dfe1be Use sessions with connection to eliminate async shutdown problems
(cherry picked from commit 78d334b)
2017-02-24 16:58:25 +01:00
Ilya Chernikov
4202bde550 Make daemon connection more reliable by retrying on certain exceptions
(cherry picked from commit 74a0711)
2017-02-24 16:58:25 +01:00
Ilya Chernikov
c7a2422314 minor: Make parallel daemong start test less demanding 2017-02-24 16:58:25 +01:00
Ilya Chernikov
6d9ecc60ef Skip metadata version check in repl, improve JSR 223 template compatibility 2017-02-24 16:58:25 +01:00
Ilya Chernikov
a16f412b48 Add eval in eval benchmark tests 2017-02-24 16:58:25 +01:00
Ilya Chernikov
1ae95853e7 Fix merging errors 2017-02-24 16:58:25 +01:00
Ilya Chernikov
d3682b7f7d Implement JSR 223 script template with eval functions, some fixes 2017-02-24 16:58:25 +01:00
Ilya Chernikov
63aae56b11 Get rid of eval on daemon completely, fixes also JSR 223 examples 2017-02-24 16:58:24 +01:00
Ilya Chernikov
a3a782613a Cleanup 2017-02-24 16:58:24 +01:00
Ilya Chernikov
1032f0d39c Fix java 8 repl tests 2017-02-24 16:58:24 +01:00
Ilya Chernikov
b9469a9308 Fix script-util after changes in repl infrastruct 2017-02-24 16:58:24 +01:00
Ilya Chernikov
75234701c7 Fix remote repl state facade 2017-02-24 16:58:24 +01:00
Ilya Chernikov
b23911fd59 Reintroduce history check between compile and eval, place generation into code line and id 2017-02-24 16:58:24 +01:00
Ilya Chernikov
7b2ea001c1 Fix state conversion, fix tests 2017-02-24 16:58:24 +01:00
Ilya Chernikov
c5bc58ad32 Implement remote part of the new repl state handling 2017-02-24 16:58:24 +01:00
Ilya Chernikov
f9dedab8c8 Extract repl state as a separate object 2017-02-24 16:58:24 +01:00
Anton Bannykh
3eb5b3e08c JS: changed BoxedChar visibility to internal 2017-02-24 13:46:29 +03:00
Dmitry Jemerov
5c9f0df256 Download specific build of IJ 162, not a snapshot 2017-02-24 11:19:43 +01:00
Nikolay Krasko
6b62686019 Add blank lines tab to Kotlin code style UI with two basic options
KEEP_BLANK_LINES_IN_CODE
KEEP_BLANK_LINES_IN_DECLARATIONS

#KT-15504 In Progress
2017-02-22 20:13:28 +03:00
Nikolay Krasko
bc90d52873 Minor: remove warnings in KotlinSpacingBuilder.kt 2017-02-22 20:13:24 +03:00
Nikolay Krasko
6a4590839c Don't merge two lines in formatter after line comment (KT-16032)
#KT-16032 Fixed
2017-02-22 20:12:19 +03:00
Nikolay Krasko
20f92c6200 Use own kotlin settings for spacing instead of default set
Mostly affected by settings:
- KEEP_LINE_BREAKS,
- KEEP_BLANK_LINES_IN_DECLARATIONS
- KEEP_BLANK_LINES_IN_CODE

Allow settings KEEP_LINE_BREAKS in UI.
2017-02-22 20:04:34 +03:00
Nikolay Krasko
5ed5f8f048 Minor: reuse DO_RESUME_METHOD_NAME constant instead of literal 2017-02-22 19:58:50 +03:00
Alexander Udalov
a9678010a8 Invert LanguageFeature responsible for warning on coroutines
The problem was that LanguageVersionSettingsImpl.DEFAULT did not have
"WarnOnCoroutines" as a feature and so it was manually added to the settings,
but only in two places: in the compiler and in the IDE
2017-02-22 18:55:48 +03:00
Dmitry Jemerov
e3dab96715 Add Trove4j license 2017-02-22 16:04:33 +01:00
Ilya Gorbunov
6e8f227121 Drop ERROR deprecations in JS library that were introduced in 1.1-rc 2017-02-22 17:28:02 +03:00
Ilya Gorbunov
b393c66426 Drop ERROR deprecations from kotlin-reflect. 2017-02-22 17:28:02 +03:00
Ilya Gorbunov
c0c01d6e49 Drop HIDDEN deprecations from kotlin-stdlib. 2017-02-22 17:28:02 +03:00
Ilya Gorbunov
8e951dee16 Drop remaining ERROR deprecations from kotlin-stdlib-js.
Leave only `native`, `parseInt`, `parseFloat` and `noImpl`.
2017-02-22 17:28:02 +03:00
Ilya Gorbunov
eebb820060 Do not refer to java packages in common completion tests 2017-02-22 17:28:02 +03:00
Ilya Gorbunov
3cea5c4510 Drop entire java.util package from kotlin-stdlib-js
#KT-6561 Fixed
2017-02-22 17:28:02 +03:00
Ilya Gorbunov
5867d27fb7 [Standard Library] Take the javaClass deprecation back as its replacement is often inconvenient. 2017-02-22 17:27:20 +03:00
Alexander Udalov
d124912c91 Specify language / API version in .idea/kotlinc.xml 2017-02-22 14:45:57 +03:00
Anton Bannykh
909d83c3af JS: Force Rhino to load files using UTF8 encoding. Fixes failing kt14597 on windows agents. 2017-02-22 14:39:46 +03:00
Alexey Andreev
66f5a12cc4 JS: fix translation of && and || operators when their RHS declare temporary variables. See KT-16350 2017-02-22 11:10:07 +03:00
Dmitry Jemerov
c6bfb02754 Move JsAnalyzerFacade to ide-common module to enable its use in Dokka 2017-02-21 18:39:21 +01:00
Stanislav Erokhin
0a24bf1613 Fix type deserialization for suspend function types which was written by pre-release compiler.
Notes: if arity == 0, it means that type was `suspend () -> String` => arguments.size == 1, and it means that SuspendFunction0 has only one type argument and it is return type.
2017-02-21 17:26:07 +03:00
Stanislav Erokhin
81df7645e0 Fix potential CCE -- use unwrappedType after instanceof check. 2017-02-21 17:19:50 +03:00
Mikhael Bogdanov
d24ebf711b Fix for KT-16441: NoSuchFieldError: $$delegatedProperties when delegating through provideDelegate in companion object
#KT-16441 Fixed
2017-02-21 13:01:40 +01:00
Mikhael Bogdanov
a8625b632d Fix for KT-16411, KT-16412: Exception from compiler when try call SAM constructor where argument is callable reference to nested class inside object
#Fixed KT-16411
  #Fixed KT-16412
2017-02-21 11:40:25 +01:00
Denis Zharkov
85f9e2e47b Fix CCE in generated code that happens when comparing boxed chars
The problem was that when obtaining char from the wrapper,
codegen used int as expected type that led
to a ClassCastException: java.lang.Character cannot be cast to java.lang.Number

The solution is using coercion to chars, it's still correct,
because of implicit widening coercion in JVM from C to I

 #KT-15105 Fixed
2017-02-21 12:33:45 +03:00
Denis Zharkov
378acbf7ec Minor. Clarify method patchOpcode contract 2017-02-21 12:33:45 +03:00
Alexander Udalov
21449763ab Add extension CompilerConfiguration.languageVersionSettings for convenience 2017-02-21 10:58:19 +03:00
Alexander Udalov
103bd6dbde Minor, convert CommonConfigurationKeys to Kotlin 2017-02-20 16:18:00 +03:00
Alexander Udalov
d499998655 Inject CompilerConfiguration instead of LanguageVersionSettings
LanguageVersionSettings can be read from the configuration. Also, the
configuration may be used for other stuff, not related to language version
settings, soon
2017-02-20 16:18:00 +03:00
Alexander Udalov
4b31e75550 Refactor createContainerForLazyResolve/createLazyResolveSession 2017-02-20 16:18:00 +03:00
Alexander Udalov
ee1152bc98 Simplify injection of LanguageVersionSettings into JVM analysis
Pass the LanguageVersionSettings instance inside the CompilerConfiguration,
since it's needed anyway. In compiler and tests, the configuration comes from
KotlinCoreEnvironment; in IDE, we're constructing it in JvmAnalyzerFacade
2017-02-20 16:18:00 +03:00
Denis Zharkov
f2aacf774e Get rid of redundant not-null assertion for parameter
The problem was that in `Function<T>.apply(T)` T is now not-platform,
so when checking if not-null assertion is needed for parameter in SAM,
it's defined by the upper bounds of T that is a platform (Any..Any?),
and while it's definitely not marked as nullable it's still nullable
in a sense that it can contain null as a value.

So the solution is obvious

 #KT-16413 Fixed
2017-02-20 15:46:49 +03:00
Dmitry Jemerov
1bb7a617ad Don't overwrite explicitly specified language version in facet with version from dependencies; add tests for setting language version based on dependencies
(cherry picked from commit fc2b9f6)
2017-02-20 11:32:11 +01:00
Denis Zharkov
a3baca829f Drop KotlinTarget.INNER_CLASS entry
In most of the cases it was used together with CLASS_ONLY and vice versa
They only case when CLASS_ONLY was used without INNER_CLASS
is possibleParentTargetMap.COMPANION_KEYWORD.

But after diagnostic NESTED_OBJECT_NOT_ALLOWED has been introduced,
there's no sense in the restriction of exactly the companion's parent

For clarification see test data changed
2017-02-20 13:24:42 +03:00
Denis Zharkov
d1b17f050b Prohibit objects inside inner classes
#KT-16232 Fixed
2017-02-20 13:24:42 +03:00
Denis Zharkov
5b9b003e02 Prohibit inner sealed classes
#KT-16233 Fixed
2017-02-20 13:24:42 +03:00
Alexey Andreev
86d1c7b7ec JS: fix absence of temporary variable in secondary constructors. See KT-16377 2017-02-20 11:31:38 +03:00
Alexey Tsvetkov
3b222f13f3 Replace daemon's message after start with constant string
#KT-15783 fixed

When a daemon client cannot find an existing daemon, it starts a new one.
The client waits for a daemon to start and initialize.
Then the daemon is expected to signal that it is ready for compiling by printing message in stdout.
Before this change the message was the daemons' run path (a directory where all daemons store
their "flag" files).
However the path printed by the daemon was not matched by the path expected by the client somehow
on Windows for a user with a username containing non-English letters.
This commit replaces the message with the constant string.
2017-02-18 19:35:06 +03:00
Alexey Tsvetkov
b2de822fd4 Start daemon with explicit server ip address to prevent host name resolution 2017-02-18 19:35:06 +03:00
Denis Zharkov
0d8f64353a Fix JVM signature mapping for multi-dimensional arrays
#KT-11314 Fixed
2017-02-17 17:50:43 +03:00
Dmitry Jemerov
83d64e8eba Don't replace explicitly configured project settings with autodetected ones
(cherry picked from commit f16f975)
2017-02-17 14:44:37 +01:00
Nikolay Krasko
7bae72113b Rename: ExtraSteppingFilter -> KotlinExtraSteppingFilter 2017-02-17 15:57:11 +03:00
Nikolay Krasko
f7391f6c1a Minor: refactoring 2017-02-17 15:57:11 +03:00
Nikolay Krasko
d58707972d Keep empty bodies for declarations with comments (KT-16078)
#KT-16078 Fixed
2017-02-17 15:57:11 +03:00
Denis Zharkov
e16b0524b6 Fix inline codegen on local functions inside inlined lambda
The problem was that anonymous classes wasn't regenerated
although they capture another anonymous class that is a subject
for regeneration

 #KT-8689 Fixed
2017-02-17 13:48:19 +03:00
Alexey Tsvetkov
dfb60ba4ac Minor: remove the word 'experimental' from Gradle IC description 2017-02-16 21:27:04 +03:00
Alexey Tsvetkov
62a15e803b Avoid storing absolute paths in SyncOutputTask
#KT-16003 fixed
2017-02-16 21:26:50 +03:00
Alexey Tsvetkov
6e0f3b7f1f Avoid having -d and -module set at the same time
#KT-14619 fixed
2017-02-16 21:26:50 +03:00
Alexey Tsvetkov
667c00e3ed Copy compiler arguments from compile task to kapt task
#KT-15994 fixed
2017-02-16 21:26:50 +03:00
Dmitry Jemerov
3225c93ce0 Don't pass paths to non-existing metadata files from dependent modules 2017-02-16 19:16:19 +01:00
Mikhail Glukhikh
797813a8d4 Change log update (final) for 1.1-RC 2017-02-16 18:55:14 +03:00
Dmitry Jemerov
6aa3c26f78 Disable facet detection; force detection of API/language level from dependencies on project opening 2017-02-16 16:51:09 +01:00
Dmitry Jemerov
58713270bb Ask to update runtime library when increasing language version for module 2017-02-16 16:50:47 +01:00
Alexander Udalov
de2117663c Fix overload resolution ambiguity on *Array.clone() with runtime 1.0
#KT-16371 Fixed
2017-02-16 18:46:05 +03:00
Alexander Udalov
9d11f0b92f Minor, check every deserialized value in refsAreSerializable.kt 2017-02-16 18:00:19 +03:00
Alexander Udalov
1ee2053a16 Make callable references Serializable on JVM
#KT-11254 Fixed
2017-02-16 18:00:18 +03:00
Dmitry Jemerov
4d451356eb Quickfixes to enable unsupported and experimental features handle API level correctly and support updating the runtime library 2017-02-16 12:41:42 +01:00
Dmitry Jemerov
ea228a2fa8 Fix testdata for SimpleKotlinRenderLogTest 2017-02-16 11:43:16 +01:00
Alexander Udalov
612481f0f4 Fix stub builder for builtins after cdeabf26b4 2017-02-16 10:35:07 +03:00
Alexander Udalov
cdeabf26b4 Fix NPE from KotlinBuiltInDecompiler
This happened because of bae955aafd: similarly to the corresponding code in
the compiler, the IDE should also skip the metadata for kotlin.Cloneable when
decompiling built-ins because the deserializer is not going to resolve this
class from the metadata
2017-02-16 01:31:44 +03:00
Mikhail Glukhikh
4d4e2c5c94 Change log for 1.1-RC updated
(cherry picked from commit 4897af1)
2017-02-15 20:53:44 +03:00
Alexander Udalov
8e407d548a Suggest to provide explicit dependency on new kotlin-reflect
In case when there's kotlin-stdlib 1.1 and kotlin-reflect 1.0 in the classpath
2017-02-15 20:43:25 +03:00
Alexander Udalov
71fcb07fad Infer API version from older runtime in compiler's classpath
For example, if you invoke kotlinc 1.1 with kotlin-stdlib 1.0 in the classpath,
we now infer -api-version 1.0 automatically
2017-02-15 20:43:25 +03:00
Alexander Udalov
b56639a775 Filter out files with the same paths in runtime version checker
To prevent listing them several times in the diagnostic message
2017-02-15 20:43:25 +03:00
Alexander Udalov
8457ab7c58 Report warnings instead of errors in runtime version checker 2017-02-15 20:43:25 +03:00
Alexander Udalov
ba84338862 Support smart cast for nullability in LHS of class literal
#KT-16291 Fixed
2017-02-15 20:43:25 +03:00
Alexander Udalov
bae955aafd Serialize metadata for Cloneable and discard it during deserialization
#KT-16358 Fixed
2017-02-15 20:43:25 +03:00
Alexander Udalov
46bd64f59a Rename FunctionImpl -> FunctionBase, restore abstract class FunctionImpl
This fixes the IncompatibleClassChangeError which happens when kotlin-reflect
1.0.x and kotlin-stdlib 1.1.x are in the classpath

 #KT-16358 In Progress
2017-02-15 20:43:25 +03:00
Dmitry Jemerov
41f7950ab8 UAST tests: don't null out the application if we have a valid one that we restored from a previous test 2017-02-15 18:21:37 +01:00
Anton Bannykh
4c808e8691 JS: concat vararg arguments using Kotlin.concat and Kotlin.concatPrimitive functions in order to be binary compatible with (Kotlin PrimitiveArray -> JS TypedArrays) mapping. 2017-02-15 18:58:29 +03:00
Ilya Gorbunov
a903c4ab0e Change log clarifications regarding stdlib
(cherry picked from commit ba857a83ff)
2017-02-15 18:17:11 +03:00
Dmitry Jemerov
7704310359 Fix Kotlin facet autodetection so that it actually works and stores the correct language/API level based on project dependencies 2017-02-15 15:48:43 +01:00
Mikhail Glukhikh
3bc322c2ce Change log for 1.1-RC updated 2017-02-15 17:45:47 +03:00
Dmitry Jemerov
f06d46fe9a Advance until-build to 172.* 2017-02-15 14:43:53 +01:00
Yan Zhulanow
8e9536f61d Revert "Kapt3: Add generated source files to Java compile task after kapt execution. Filter only .java files."
This reverts commit 82c2ce3a33.
2017-02-15 16:28:33 +03:00
Yan Zhulanow
35b41b9401 Kapt3: Fix annotation processor option passing 2017-02-15 16:28:26 +03:00
Dmitry Jemerov
95bfe8668d UAST tests no longer leave a disposed application around 2017-02-15 12:56:21 +01:00
Alexey Sedunov
5d65e6bc9b Kotlin Facet: Facet migration workaround for the case pre-1.1-beta -> 1.1.rc+ (reset useProjectSettings to false for old configurations) 2017-02-15 14:40:09 +03:00
Alexey Sedunov
2e01f62afe Kotlin Facet: Detect language/API version by stdlib when "Use project settings" is enabled, but project-level language/api version is not specified explicitly 2017-02-15 14:40:04 +03:00
Alexey Sedunov
0d2122bb1d Kotlin Facet: Do not rewrite language/API version based on compiler arguments if they do not contain explicit language/API version 2017-02-15 14:30:41 +03:00
Alexey Sedunov
2790fcf4bd Kotlin Facet: Synchronize version info on opening the configuration editor 2017-02-15 14:30:40 +03:00
Dmitry Jemerov
060a865fb1 Use correct resolution facade for resolving cross-module links in KDoc comments
#KT-15647 Fixed
2017-02-15 12:08:18 +01:00
Mikhail Glukhikh
4b7380bea4 Change log for 1.1-RC added 2017-02-15 12:49:22 +03:00
Alexander Udalov
8e3cb912c7 Make Ref classes for shared vars Serializable
#KT-14566 Fixed
2017-02-15 10:46:48 +03:00
Alexander Udalov
c10524586a Use proguard to remove unused symbols from kotlin-reflect.jar
#KT-16268 Fixed
2017-02-15 10:46:48 +03:00
Alexander Udalov
2e8bfde2e7 Move -Xskip-metadata-version-check from JVM to common arguments
To be used in JS
2017-02-15 10:46:48 +03:00
Alexander Udalov
a1a71a01b1 Drop JvmMetadataVersion.skipCheck, support this correctly
Pass the value of this flag via DeserializationConfiguration
2017-02-15 10:46:48 +03:00
Alexey Sedunov
e1463f9e0f Kotlin Facet: Fix detection of pre-1.1-beta JS-stdlib dependencies 2017-02-14 18:28:44 +03:00
Mikhail Zarechenskiy
5515a63911 Replace KotlinBuiltIns.isBuiltIn with corresponding package checking
Method `isBuiltIn` may not work correctly as built-ins are becoming
more and more like a usual dependency. Also behaviour of this method is
depend on the target platform.
2017-02-14 16:21:17 +03:00
Alexey Sedunov
8c84717cbc Kotlin Facet: Reset all coroutine support flags before importing them frm Gradle 2017-02-14 16:19:21 +03:00
Vyacheslav Gerasimov
a2e429a912 Fixed exception in getUastLocation of class annotation argument
#KT-16326 Fixed
2017-02-14 15:56:37 +03:00
Stanislav Erokhin
b6fa10cf9e Disable some features when LV=1.1 API=1.0.
Feature list:
 - bound callable references
 - local delegated properties
 - coroutines.

#KT-16017 Fixed
2017-02-13 20:29:38 +03:00
Dmitry Jemerov
be0211cd49 Ugly deadlock workaround for KT-16149: members of DataBindingComponent are calculated via annotations search which causes resolve reentrering 2017-02-13 17:20:10 +01:00
Simon Ogorodnik
2490318f93 KT-16076 Completion inserts FQN kotlin.text.String
KT-14831 Don't add import statement and FQN on converting lambda to reference if typealias is used
KT-16088 Completion wrongly inserts FQN for `kotlin` package
 #KT-16076 fixed
 #KT-14831 fixed
 #KT-16088 fixed
2017-02-13 16:48:14 +03:00
Ilya Gorbunov
fee676a281 Introduce 'takeUnless' function which is like 'takeIf' but with the predicate inverted.
#KT-7858
2017-02-13 16:07:34 +03:00
Sergey Igushkin
9e1afe71f2 Fixed Kotlin2Js output not being the output of the compileKotlin2Js tasks.
Therefore, fixed Kotlin2Js output not present in JAR.
Reworked the clean behavior in regard to compileKotlin2Js tasks.
Fixed duplicate source roots passed to the compiler.

Issues:
- #KT-15829 Fixed
- #KT-16267 Fixed
- #KT-15902 Fixed
2017-02-13 15:44:05 +03:00
Anton Bannykh
ad313750e7 JS: Fixed lateinit property initialization 2017-02-13 14:56:50 +03:00
Alexey Sedunov
1452d7e4a6 Kotlin Gradle Plugin: Extend implicit argument set 2017-02-13 14:53:18 +03:00
Alexey Sedunov
75c56d58ae Line Markers: Do not attempt to resolve suspend call candidates which are not call-like expressions 2017-02-13 14:53:17 +03:00
Alexey Sedunov
add16dec3d Extract Function: Fix detection of suspend calls containing extracted parameters
#KT-16251 Fixed
2017-02-13 14:53:17 +03:00
Alexey Sedunov
574a0e629e Kotlin Facet: Fix stdlib dependency detection 2017-02-13 14:53:16 +03:00
Alexey Sedunov
7fbca4e122 Kotlin Facet: Scan classpath backwards when looking for kotlin-gradle-plugin dependency
#KT-15899 Fixed
2017-02-13 14:53:15 +03:00
Alexey Sedunov
330beebb2c Kotlin Facet: Check contradictory values of "coroutine support" option
#KT-16109 Fixed
2017-02-13 14:53:14 +03:00
Alexander Udalov
9397b16bb9 Minor, fix typo in comment 2017-02-13 14:10:19 +03:00
Alexander Udalov
407815449a Minor, improve error message 2017-02-13 14:09:58 +03:00
Alexander Udalov
57f2feb6fb Fix unreported deprecation on variables called as functions
#KT-16272 Fixed
2017-02-13 14:09:53 +03:00
Alexander Udalov
6793861fd4 Add target FIELD for SinceKotlin, annotate CallableReference.receiver/NO_RECEIVER 2017-02-13 14:09:43 +03:00
Alexander Udalov
20d856fa77 Minor, remove blank line in extra help 2017-02-13 14:09:38 +03:00
Alexander Udalov
8fee62a8c5 Minor, explain what CompilerMessageSeverity.STRONG_WARNING is 2017-02-13 12:11:16 +03:00
Alexander Udalov
4c9afb9d20 Move testable IS_PRE_RELEASE flag to KotlinCompilerVersion
It'll be used in the JS back-end as well soon, so
DeserializedDescriptorResolver is not the best place for it
2017-02-13 12:11:15 +03:00
Stanislav Erokhin
3efda0e45a Reserve yield if it isn't function call. 2017-02-13 02:53:37 +03:00
Ilya Chernikov
9eae929084 Fixes after review 2017-02-11 16:27:27 +01:00
Ilya Chernikov
39d204c550 Adjust test after introducing shutdown delay 2017-02-11 16:27:26 +01:00
Ilya Chernikov
cb7de0e262 Implement more reliable daemon election, fixes KT-15562
also making shutdown more reliable
2017-02-11 16:27:25 +01:00
Ilya Chernikov
ebf9e386b0 Add test reproducing "Service is dying" problem (KT-15562) 2017-02-11 16:27:24 +01:00
Alexey Andreev
7192529733 JS: drop support of old library format 2017-02-10 21:04:50 +03:00
Ilya Chernikov
82320bdf7d Make maven/aether dependencies optional in the script-util
(cherry picked from commit 8197240)
2017-02-10 16:03:06 +01:00
Ilya Chernikov
46894da981 Get rid of daemon-client dependency on openapi, making others "provided"
(cherry picked from commit 175d74c)
2017-02-10 16:02:55 +01:00
Ilya Chernikov
f6fd9441e9 Move scripting options into separate panel
(cherry picked from commit c06592e)
2017-02-10 14:44:36 +01:00
Dmitry Petrov
20dc1a047d KT-16250 Handle type alias as imported name qualifier
#KT-16250 Fixed
2017-02-10 16:32:07 +03:00
Denis Zharkov
5f843f6759 Fix intrinsic for String.plus for explicit calls
#KT-14567 Fixed
2017-02-10 16:05:15 +03:00
Denis Zharkov
fcb4db0226 Remove redundant ACC_VARARGS on methods generated with @JvmOverloads
#KT-15424 Fixed
2017-02-10 16:05:15 +03:00
Denis Zharkov
1f179a6f01 Add test on obsolete issue
#KT-15196 Obsolete
2017-02-10 16:05:15 +03:00
Denis Zharkov
b989bfce59 Fix VerifyError with @JvmStatic annotated getter
The problem was that for property getter 'context.getContextDescriptor()'
references the containing property, while 'context.getFunctionDescriptor()'
the accessor itself

 #KT-15594 Fixed
2017-02-10 16:05:15 +03:00
Denis Zharkov
dd275eda78 Minor. Refine class name: JvmStaticGenerator -> JvmStaticInCompanionObjectGenerator 2017-02-10 16:05:15 +03:00
Dmitry Jemerov
87187437ab Update UAST to version 1.0.11 2017-02-10 13:55:25 +01:00
Ilya Chernikov
da2f310895 Convert line endings when creating ReplCodeLine, fixes KT-15861
(cherry picked from commit 894ee4c)
2017-02-09 22:00:30 +01:00
Ilya Gorbunov
c6cb389591 JS kotlin.dom: deprecate asElementList harder.
Minor: correct exception message.
2017-02-09 22:15:51 +03:00
Ilya Gorbunov
9a7405adc6 Make javaClass extension property inline to remove further references from Kotlin. 2017-02-09 22:15:25 +03:00
Ilya Gorbunov
63f591bde9 Deprecate some utils and provide sensible replacements from stdlib. 2017-02-09 18:21:51 +03:00
Anton Bannykh
c7d4a4edf4 JS: test property inline through fake override 2017-02-09 15:46:06 +03:00
Stanislav Erokhin
58c2466a52 Minor. use when instead of if sequence. 2017-02-09 15:42:33 +03:00
Stanislav Erokhin
b616ef0a40 Do not force resolve descriptors for explicit imports. Create lazy scope instead. 2017-02-09 15:42:30 +03:00
Stanislav Erokhin
cc429cd865 Fix NewKotlinTypeChecker for case SimpleType with CapturedTypeConstructor.
Usually, we have only CapturedType with such constructor.
We should prevent creation such types in the future (KT-16147).
Also added test for KT-14740 where this problem originally appears.
2017-02-09 15:32:18 +03:00
Alexander Udalov
7147008e21 Fix functionFromStdlib.kt by making the member accessible
#KT-16263 Open
2017-02-09 14:56:27 +03:00
Dmitry Petrov
a4f9e46c08 Fix https://ea.jetbrains.com/browser/ea_reports/1337846:
Properly handle AbbreviatedTypeBinding for error types.
Get rid of code duplication.
2017-02-09 12:36:52 +03:00
Mikhael Bogdanov
b1e2db21d3 Fix for KT-16225: enumValues non-reified stub implementation references nonexistent method
#KT-16225 Fixed
2017-02-09 10:23:32 +01:00
Alexey Sedunov
ba73269ee0 Kotlin Facet: Do not show implicit compiler arguments in "Additional arguments" field 2017-02-09 11:41:05 +03:00
Alexey Sedunov
52102d359a Kotlin Gradle Plugin: Expose default compiler arguments via compilation task API 2017-02-09 11:41:04 +03:00
Ilya Gorbunov
ec01200997 Introduce ItemArrayLike interface and replace multiple asList adapters with the single one. 2017-02-08 23:31:58 +03:00
Ilya Gorbunov
41c980bcab Massive deprecations in kotlin.dom 2017-02-08 23:31:58 +03:00
Ilya Gorbunov
365f8d0256 Drop pre-1.0 deprecated dom helpers. 2017-02-08 23:31:58 +03:00
Simon Ogorodnik
a9f2f5c7d0 Fix for complete slowdown of DefaultImportProvider after introducing languageVersion for default imports
KT-16243 Very slow completion after variable of type `ArrayList`
 #KT-16243 fixed
2017-02-08 21:30:32 +03:00
Ilya Gorbunov
e9f40c41c2 Minor: refactor and rename parameters. 2017-02-08 20:16:10 +03:00
Ilya Gorbunov
31da36bedf Minor: Add test cases for adding and removing null value to/from set.
Fix unused value in removeAll test.
2017-02-08 20:13:22 +03:00
Ilya Gorbunov
c37540c727 Minor: fix missing angle bracket. 2017-02-08 20:13:22 +03:00
Ilya Gorbunov
287a513f23 Provide KDoc for js collection implementations. 2017-02-08 20:13:22 +03:00
Ilya Gorbunov
2269b9839f Restrict visibility of AbstractMap.SimpleEntry in JS 2017-02-08 20:13:22 +03:00
Ilya Gorbunov
fc7b1c8611 KDoc for mutable abstract collections.
Document abstract overrides.
2017-02-08 20:13:22 +03:00
Ilya Gorbunov
ef5e53b37b KDoc for read-only abstract collections 2017-02-08 20:13:22 +03:00
Ilya Gorbunov
7c54c48e00 Add a note about generic parameter variance to Iterable, Collection, List, Set, Map and their mutable counterparts.
Minor: correct docs, code formatting.
2017-02-08 20:13:22 +03:00
Alexander Udalov
ccbfa2e81d Fix Member.getKPackage and temporarily revert functionFromStdlib.kt 2017-02-08 20:02:49 +03:00
Alexander Udalov
6d16ea0a3a Fix reflection on top level declarations from other modules
The main problem here is that moduleName that is being passed to KPackageImpl
is useless: as can be seen in
ClosureCodegen.generateCallableReferenceDeclarationContainer, the name of the
current module is always written to the class file for a callable reference,
not the name of the module of the referenced declaration. This resulted in
reflection not loading the correct .kotlin_module file and subsequently not
finding the required file facade for a top-level function.

The commit does not fix the issue with the incorrect module name written in the
back-end, but workarounds it. It turns out, reflection can figure out the name
of the module of the referenced declaration itself by parsing the header from
the given java.lang.Class object for a single-file/multi-file package facade
and extract the package_module_name protobuf extension. Similar code was
already there in Member.getKPackage() in ReflectJvmMapping.kt but it did not
support multi-file classes, of which there are a lot in the standard library;
this is now supported

 #KT-12630 Fixed
 #KT-14731 Fixed
2017-02-08 19:23:18 +03:00
Alexander Udalov
8a79482c5c Minor, rename packageFacadeProvider -> packagePartProvider 2017-02-08 19:23:18 +03:00
Yan Zhulanow
131570080d Kapt3: Generate import statements in stubs 2017-02-08 19:01:17 +03:00
Yan Zhulanow
69a063b0b2 Kapt3: Serialize annotation processor options to base64 to support spaces in option values 2017-02-08 19:01:16 +03:00
Yan Zhulanow
8479618632 Kapt3: Invoke integration tests with the Kotlin runtime in the compile classpath (this fixes integration tests, nullability annotations from org.jetbrains were not found) 2017-02-08 19:01:15 +03:00
Yan Zhulanow
823781ea6c Kapt3: "$annotations" are not always ACC_PRIVATE now (see also KT-15993) 2017-02-08 19:01:14 +03:00
Yan Zhulanow
2553513205 Kapt3: Allow users to disable error type correction (and now it's disabled by default) 2017-02-08 19:01:13 +03:00
Yan Zhulanow
297f8d4161 Kapt3: Use the javac's finalCompiler log to determine if there were any annotation processing errors (KT-16176) 2017-02-08 19:01:13 +03:00
Yan Zhulanow
62092f31cc Minor: Update test data because of KT-15697 2017-02-08 19:01:12 +03:00
Yan Zhulanow
de3cb4567f Minor: Remove obsolete JAVA_FILE_PARSING_ERROR constant, fix corresponding test 2017-02-08 19:01:11 +03:00
Yan Zhulanow
08b98f7133 Kapt3: Ignore declarations with illegal Java identifiers (KT-16153) 2017-02-08 19:01:10 +03:00
Yan Zhulanow
7296d9cb7c Kapt3: Fix working in verbose mode (NPE in JavacFiler.java:597) (KT-16146) 2017-02-08 19:01:09 +03:00
Yan Zhulanow
43a377d3e1 Kapt: Fix error messages map name 2017-02-08 19:01:08 +03:00
Yan Zhulanow
1819194a4c Kapt3: Allow annotations with Kotlin-only targets, such as PROPERTY (KT-15697) 2017-02-08 19:01:07 +03:00
Yan Zhulanow
6ded5939eb Kapt: Fix javac error reporting in Kotlin daemon, also fix parsing error reporting (KT-15524) 2017-02-08 19:01:06 +03:00
Yan Zhulanow
cde7cb1076 Kapt3: Write Intellij annotations (NotNull/Nullable) to stubs 2017-02-08 19:01:05 +03:00
Yan Zhulanow
5a46c01f76 Kapt3: Add generated source files to Java compile task after kapt execution. Filter only .java files.
This is needed to generate Kotlin files using kapt.
2017-02-08 19:01:04 +03:00
Yan Zhulanow
1797ea62f4 NoArg: Support @Embeddable JPA annotation (KT-15946) 2017-02-08 19:01:03 +03:00
Yan Zhulanow
349095cd14 Maven: Make compiler plugin option reporting more user-friendly 2017-02-08 19:01:03 +03:00
Yan Zhulanow
277490b903 AllOpen, NoArg: Use presets in Maven plugins 2017-02-08 17:36:19 +03:00
Yan Zhulanow
52ecd05301 AllOpen, NoArg: Use presets in Gradle plugins 2017-02-08 17:36:19 +03:00
Yan Zhulanow
feb5397f6f AllOpen, NoArg: Refactoring, support presets in order to hold special annotations for Spring and JPA in one place 2017-02-08 17:36:19 +03:00
Denis Zharkov
f4690ebff9 Initialize JvmBuiltins for module configuration used in test
This method is only used within tests, and they didn't fail
mostly by coincidence.

But because of more eager reading of
JvmBuiltIns.isAdditionalBuiltInsFeatureSupported (that checks if built-ins
have been initialized) these tests started failing
2017-02-08 16:04:19 +03:00
Denis Zharkov
1bb40afada Simplify compatibility mode with ll=1.0 on JDK dependent built-ins
A lot of problem arise with current solution
(loading them with lowpriority annotation + additional call checkers):
- We errorneously treated ArrayList.stream as an existing method, while
  it's just a fake override from List
- The same problem arises when creating a class delegating to List.
  Also the latter case is failing with codegen internal error
  (see issue KT-16171)

The negative side of this solution is that instead of reporting meaningful
diagnostic, there will be UNRESOLVED_REFERENCE.
But it seems to be better than having strange problems like ones described above.

 #KT-16073 Fixed
 #KT-16171 Fixed
2017-02-08 16:04:19 +03:00
Mikhail Zarechenskiy
d84c303029 Do not report 'const' inapplicability on property of error type
#KT-12477 Fixed
2017-02-08 15:42:48 +03:00
Mikhail Zarechenskiy
e7ea076093 Do not apply constant folding for non built-in functions
#KT-15872 Fixed
2017-02-08 15:42:39 +03:00
Mikhail Zarechenskiy
935f7b1cc1 Add warning if constant conforms to infinity or zero
#KT-3805 Fixed
2017-02-08 15:42:33 +03:00
Sergey Igushkin
292f010e59 Fixed Kotlin2JsCompile not picking dependencies from configurations other than compile.
Example:

	apply plugin: 'kotlin2js'

    dependencies {
    	...
    	testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
    }

Here, the `:compileTestKotlin2Js` task did not pick the dependency and used the `compile` classpath.
This has been fixed.

Also, fixed `testCompileTestCouldAccessProduction` and added `testJsCustomSourceSet`.
2017-02-08 14:36:18 +03:00
Mikhail Glukhikh
607e205ad4 Resolve to descriptor: call safe version in background (~ isApplicable) #KT-12261 Fixed
Also #KT-11010 Fixed
Also #KT-12881 Fixed
Also #KT-16162 Fixed
2017-02-08 13:55:34 +03:00
Dmitry Jemerov
00003684e8 Add test for converting a string literal to UAST 2017-02-08 11:29:53 +01:00
Dmitry Jemerov
5dc178460e Update UAST to 1.0.10; move uast-kotlin tests to Kotlin project 2017-02-08 11:29:53 +01:00
Alexander Udalov
cfe159181d Deprecate kotlin.reflect.findAnnotation with ERROR 2017-02-08 13:05:27 +03:00
Alexander Udalov
5987e8a47c Annotate findAnnotation and IllegalPropertyDelegateAccessException with SinceKotlin(1.1) 2017-02-08 13:05:27 +03:00
Alexander Udalov
845d6526b0 Annotate new API in runtime.jvm with SinceKotlin(1.1) 2017-02-08 13:05:27 +03:00
Dmitry N. Petrov
5e10a9d506 Merge pull request #1027 from JetBrains/rr/matveev
Override acceptChildren method in IrSetterCallImpl
2017-02-08 12:38:29 +03:00
Alexey Sedunov
615c316262 Kotlin Gradle Plugin: Postpone friend dependency collection until the actual compilation as it may cause an error during Gradle-IDEA project synchronization
#KT-16174 Fixed
2017-02-08 11:57:00 +03:00
Alexey Sedunov
4325632b3e Kotlin Facet: Always parse argument string to proper compiler arguments bean
#KT-16137 Fixed
 #KT-16157 Fixed
 #KT-16206 Fixed
2017-02-08 11:56:59 +03:00
Alexey Andreev
9d6f4d7770 JS: don't treat library without JS metadata as error, report warning and continue instead. See KT-16158 2017-02-08 11:29:30 +03:00
Alexey Andreev
ffca68d85e JS: escape quotes in some diagnostics with parametrized messages 2017-02-08 11:29:29 +03:00
Mikhael Bogdanov
37a94eaf07 Use appropriate ApiVersion if LanguageVersion is specified in test 2017-02-08 09:10:22 +01:00
Mikhael Bogdanov
5095ef1ea4 Revert 'Temporary disable new intrinsics usage in ieee754 arithmetic' 2017-02-08 09:10:22 +01:00
Denis Zharkov
80638ebc99 Prohibit unsupported suspend operators
contains/get/set operators don't work properly on both backends

Also add box test checking that 'compareTo' operator works just fine

 #KT-16219 Fixed
2017-02-08 11:07:27 +03:00
Denis Zharkov
4921bd822d Mark as UNSUPPORTED suspension points in default parameters
#KT-16124 Fixed
 #KT-16218 Open
2017-02-08 11:07:26 +03:00
Denis Zharkov
4ee818addf Add callee name to diagnostic about illegal suspension call
#KT-15938 Fixed
2017-02-08 11:07:26 +03:00
Anton Bannykh
a74fffeac8 JS: companion object dispatch receiver translation fixed (KT-16160); imported function inlining fixed. 2017-02-08 09:21:18 +03:00
Anton Bannykh
a2431f0d85 JS: fixed inlining functions called through inheritor ("fake" override) from another module (#KT-16144) 2017-02-08 09:19:50 +03:00
Dmitry Jemerov
0709561869 Add missing required type checks; correctly skip elements which have no UAST equivalents when converting an element together with parent; correctly convert string template entries (they aren't expressions) 2017-02-07 19:18:05 +01:00
Simon Ogorodnik
be7158eeb2 KT-16110 Missing suspend keyword completion inside generic arguments
#KT-16110 fixed
2017-02-07 19:48:05 +03:00
Roman Elizarov
5895c211a1 Fixed corotine context performance by using reference equality for contexts and keys
Added documentation explaining that keys are compared by reference
2017-02-07 19:33:46 +03:00
Ilya Matveev
0759ff7bc2 Override acceptChildren method in IrSetterCallImpl 2017-02-07 18:20:33 +03:00
Nikolay Krasko
2f0e7b54d5 Return old hack with returning null as file scope for standard scripts
(cherry picked from commit ef55bd1)
2017-02-07 15:16:04 +01:00
Ilya Gorbunov
b8de78dd43 Deprecate javaClass with replacement this::class.java.
Suppress deprecation in diagnostics tests.
2017-02-07 16:30:22 +03:00
Sergey Igushkin
d6a60424a9 Weakened testSuppressWarnings() so that it doesn't fail on the environment STRONG_WARNING. 2017-02-07 16:19:40 +03:00
Ilya Chernikov
99b902f5f2 Fix version calculation code
(cherry picked from commit fb74040)
2017-02-07 13:45:22 +01:00
Ilya Chernikov
f6ce74edb3 Set jvmTarget property for repl compilation from sys prop or java version, fixes KT-16126
(cherry picked from commit 4cf2bce)
2017-02-07 13:45:12 +01:00
Alexey Sedunov
396e9afffd Compiler Configuration: Minor UI improvements 2017-02-07 15:36:39 +03:00
Alexey Sedunov
0c331a3846 Kotlin Facet: Support multiple configuration editor
#KT-15914 Fixed
2017-02-07 15:36:38 +03:00
Alexey Sedunov
8849d0e2a3 Kotlin Facet: Combine "General" and "Compiler" tabs 2017-02-07 15:36:37 +03:00
Ilya Gorbunov
03cdc20d64 Update public API dump: new coroutine builder intrinsics 2017-02-07 14:42:00 +03:00
Denis Zharkov
52f1194247 Update public API dump: areEqual helpers for ieee 754 comparisons 2017-02-07 14:41:58 +03:00
Ilya Gorbunov
d4d647ab00 Remove public synthetic annotation holder methods from public API dump. 2017-02-07 14:41:56 +03:00
Ilya Gorbunov
970490e097 Revert "Update rendered public API". This reverts commit a10c6f00f9.
Revert "Update stdlib reference and binary compatibility test data". This reverts commit 2d02e5106f.
2017-02-07 14:41:31 +03:00
Mikhail Zarechenskiy
d7093db5c5 Allow to use emptyArray in annotation as argument
#KT-14236 Fixed
2017-02-07 14:07:20 +03:00
Mikhail Zarechenskiy
9f0403f72c Fix exception at accidentally wrong annotation argument type
#KT-13740 Fixed
2017-02-07 14:07:13 +03:00
Mikhail Zarechenskiy
655cf82534 Copy compileTimeInitializer for const property descriptor
#KT-15802 Fixed
2017-02-07 14:07:06 +03:00
Denis Zharkov
81c3edfc00 Refine cc7f0e2d83
getDispatchReceiver/getExtensionReceiver always return not-null value,
but in the absence of receiver this value is equal StackValue.none(), i.e.
has a size 1

The tests were passing because of the problems with the test framework:
4b9e20ab8c
2017-02-07 13:12:02 +03:00
Denis Zharkov
4b9e20ab8c Rethrow boxError in case of test failure 2017-02-07 12:48:06 +03:00
Denis Zharkov
cc7f0e2d83 Fix codegen problem with safe-call on suspension point with two receivers
#KT-16145 Fixed
2017-02-07 11:56:37 +03:00
Denis Zharkov
a10c6f00f9 Update rendered public API 2017-02-07 11:32:10 +03:00
Denis Zharkov
9697196473 Put startCoroutineUninterceptedOrReturn header to common stdlib 2017-02-07 11:08:27 +03:00
Denis Zharkov
4f6a77cf38 Introduce createCoroutineUnchecked intrinsic
Also use it for buildSequence implenentation

 #KT-16155 Fixed
2017-02-07 11:08:27 +03:00
Roman Elizarov
9a71a20ad6 Docs for startCoroutineUninterceptedOrReturn 2017-02-07 11:07:04 +03:00
Denis Zharkov
230564fb4a Minor. Get rid of code duplications for resume call wrapping in stdlib
Use processBareContinuationResume instead
2017-02-07 11:07:04 +03:00
Denis Zharkov
6dde567be4 Optimize startCoroutine impls, move them to common stdlib
Do not wrap initial continuation for startCoroutine in SafeContinuation

This changes leaves only internal declarations and intrinsics as platform
dependent parts of the coroutine library, the rest parts (public API)
is implemented through them in common module
2017-02-07 11:07:04 +03:00
Denis Zharkov
a65d86293b Improve coroutines library layout
- Split CoroutinesLibrary into common and JVM parts
- Get rid of startCoroutine duplications
- Make suspendCoroutine implementation to be platform independent
2017-02-07 11:07:04 +03:00
Denis Zharkov
258ee0db75 Introduce startCoroutineUninterceptedOrReturn coroutine intrinsic
#KT-15716 Fixed
2017-02-07 11:07:04 +03:00
Denis Zharkov
29b0b30031 Make createCoroutine return a safe continuation
#KT-15718 Fixed
2017-02-07 11:06:50 +03:00
Alexander Udalov
b780e6d374 Do not import "kotlin.comparisons" by default for language version 1.0
#KT-16199 Fixed
2017-02-07 10:15:57 +03:00
Alexander Udalov
8014000bd1 Update light analysis test data 2017-02-06 19:41:32 +03:00
Alexander Udalov
85e55810a7 Merge light-analysis tests into black box codegen tests
#KT-15382 Fixed
2017-02-06 19:41:29 +03:00
Alexander Udalov
5bd1a35eb1 Refactor bytecode listing & light analysis tests
Simplify AbstractLightAnalysisModeCodegenTest so that its logic can be merged
with black box codegen tests
2017-02-06 19:41:20 +03:00
Alexander Udalov
2d02e5106f Update stdlib reference and binary compatibility test data
After 0db60bf and 5cffb38
2017-02-06 19:39:15 +03:00
Alexander Udalov
e58baa51ae Rename DoubleColonLHS.Expression.isObject -> isObjectQualifier 2017-02-06 19:39:15 +03:00
Alexander Udalov
478352b7e7 Fix callable reference to constructor of nested class in object
#KT-15951 Fixed
2017-02-06 19:39:15 +03:00
Alexander Udalov
ca1ed850b8 Improve error on runtime of version different than API version
Include the actual runtime version in the error message
2017-02-06 19:39:15 +03:00
Alexander Udalov
57f8ef372f Report different runtime versions earlier than incompatibility with API version
Previously if you had kotlin-reflect 1.0 and kotlin-runtime 1.1 in the
classpath, checkCompatibleWithApiVersion was invoked first, and an error was
reported that suggested to pass "-api-version" to the compiler. However, no
correct "-api-version" can be passed in this case, because
checkMatchingVersions would then report that the two libraries have different
versions anyway. So, now we first ensure that all libraries have the same
version, and only then do check if the version is correct
2017-02-06 19:39:15 +03:00
Alexander Udalov
3a7eec8635 Check API version instead of language in JVM runtime versions checker
It should be a valid case to invoke the 1.1 compiler with the 1.0 runtime in
the classpath and "-api-version 1.0". However, previously it was an error and
the message suggested to specify "-language-version 1.0". Language version 1.0
implies API version 1.0, so this effectively made the "-api-version" option
useless
2017-02-06 19:39:15 +03:00
Dmitry Petrov
e0cea468fa KT-15862 Inline generic functions can unexpectedly box primitives
Previous version of the boxing/unboxing analysis treated merging boxed and non-boxed values as a hazard.
If such merged values are not used (e.g., early return + local variables reused in inlined calls),
corresponding boxing/unboxing operations still can be optimized out.

All information related to boxed value usage by instructions is moved to 'BoxedValueDescriptor'.
Introduce "tainted" (and "clean") boxed values, with the following rules:

  merge(B, B) = B, if unboxed types are compatible,
                T, otherwise

  merge(B, X) = T

  merge(T, X) = T

  where
    X is a non-boxed value,
    B is a "clean" boxed value,
    T is a "tainted" boxed value.

Postpone decision about value merge hazards until a "tainted" value is used.
2017-02-06 16:22:26 +03:00
Simon Ogorodnik
98269c10d8 KT-15744 Intention to import sleep wrongly suggests Thread.sleep
#KT-15744 fixed
2017-02-06 14:56:18 +03:00
Alexander Udalov
389ddf26b3 Do not use LanguageVersionSettings.languageVersion directly 2017-02-03 19:35:17 +03:00
Alexander Udalov
b784680fe2 Fix NPE on equals/hashCode for callable references without kotlin-reflect
#KT-11316 Fixed
 #KT-15847 Fixed
2017-02-03 19:35:16 +03:00
Alexander Udalov
0db60bf6cb Do not always generate synthetic "$annotations" as private
Since annotations are a part of the declaration, they must have the same
visibility as the declaration in the bytecode. Otherwise obfuscators like
Proguard might strip the "$annotations" method and no annotations would be
found via Kotlin reflection

 #KT-15993 Fixed
2017-02-03 19:35:15 +03:00
Mikhail Glukhikh
81e083a133 Join declaration and assignment: extra descriptor check for assignment of the same property 2017-02-03 19:26:51 +03:00
Mikhail Glukhikh
153bc79c08 Join declaration & assignment: do not suggest for non-first line of init / constructor #KT-15545 Fixed 2017-02-03 19:26:49 +03:00
Mikhail Glukhikh
ea6e3c828d Join declaration & assignment: treat assignment with this. correctly #KT-16000 Fixed 2017-02-03 19:26:48 +03:00
Ilya Gorbunov
84f324e04f Add deprecated parseInt overload without radix parameter to provide better replacement. 2017-02-03 18:39:24 +03:00
Mikhail Glukhikh
6db698f5aa Correct order added for 'suspend' modifier #KT-16104 Fixed 2017-02-03 18:24:47 +03:00
Vyacheslav Gerasimov
1452129b60 Fixed InvalidMirrorException in uast while getting annotation argument location 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov
bad15249e7 Fixed exception in android lint 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov
1ea2e8c1d1 Fixed KotlinLintTestGenerated.testJavaPerformance 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov
6699b03c0b Fixed error reporting in AnnotationDetector
#KT-14920 Fixed

(cherry picked from commit 3647d53)
2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov
10517c16ee Uast 1.0.9 2017-02-03 18:06:04 +03:00
Denis Zharkov
5888c75d41 Minor. Refine implicit receiver for destructuring scope
Actually it should not be very important, but for sake of consistency
we should use null receiver even if we have one in an outer scope

This is a post-review fix
2017-02-03 17:58:52 +03:00
Ilya Gorbunov
da81fb32a6 Add LowPriority annotation to deprecated functions to allow star-importing their replacements from kotlin.reflect.full. 2017-02-03 17:53:16 +03:00
Ilya Gorbunov
af443ac046 Search java version in java.specification.version, prepare to that starting from java 9 it will contain only a single component. 2017-02-03 17:52:13 +03:00
Alexey Tsvetkov
62e42d6f45 Fix kapt1 with stubs test to main internal references 2017-02-03 17:16:08 +03:00
Alexey Tsvetkov
de24e68adc Revert "Avoid having -d and -module set at the same time"
This reverts commit ac241e2676.
2017-02-03 17:16:08 +03:00
Denis Zharkov
2d88419c38 Fix annotation deserialization on suspend functions
Use proper initial/frontend version of suspend descriptor
when writing METHOD_FOR_FUNCTION, because serializer uses this version

Also this commit contains adjustments of neighboring code to the describe
change

 #KT-16093 Fixed
2017-02-03 16:44:22 +03:00
Sergey Igushkin
2516583ecf Fixed empty -libraries passed from Gradle plugin in CLI. 2017-02-03 13:20:53 +03:00
Anton Bannykh
f0e3c87b84 JPS: fixed duplicate meta.js in case of multiple source roots in the same module. 2017-02-03 13:03:12 +03:00
Anton Bannykh
289a7a9cc3 JS: fixed support for test source roots (KT-6627) 2017-02-03 13:03:12 +03:00
Alexey Andreev
97b6c3013a JS: fix destructuring declaration and increment in coroutines. See KT-16058 2017-02-03 11:09:10 +03:00
Alexey Andreev
b929db1b07 JS: don't generate object literal for local delegated properties, generate call to getValue/setValue on each use site instead. 2017-02-03 11:09:10 +03:00
Alexey Andreev
0f049a90aa JS: prohibit nested classes, objects and enums in external interface. See KT-16012 2017-02-03 11:09:09 +03:00
Denis Zharkov
cc28fecacd Fix VerifyError in coroutines caused by null spilling
While within a method by the JVM spec null-value has a special
Nothing-like type, when we spill it for a coroutine, we must choose
some real type to CHECKCAST to after restoring the variable's value.

But the problem is that such a real type depends on usage of that null value,
and there may be more than one usage.

The solution is not to spill such variables into fields, but instead
init them with ACONST_NULL after each suspension point

 #KT-16122 Fixed
2017-02-03 10:32:28 +03:00
Denis Zharkov
60c2579436 Allow destructuring in suspend lambda with suspend componentX
#KT-16113 Fixed
2017-02-03 10:32:28 +03:00
Alexey Sedunov
59fe7444d1 Rename/Find Usages: Disable text occurrence search for KtParameter 2017-02-02 19:09:20 +03:00
Alexey Sedunov
79e67f4e50 Kotlin Facet: Support multiple artifact Ids corresponding to target platform 2017-02-02 19:09:19 +03:00
Mikhael Bogdanov
aa3f64bc93 Temporary disable new intrinsics usage in ieee754 arithmetic 2017-02-02 16:31:49 +01:00
Mikhael Bogdanov
560226cc84 Use proper type for nullability check in 'calcTypeForIEEE754ArithmeticIfNeeded' 2017-02-02 16:31:49 +01:00
Mikhael Bogdanov
5cffb3892d Added intrinsics for nullable Double/Float equals check 2017-02-02 16:31:49 +01:00
Mikhael Bogdanov
87529f957d Update for "Fix for KT-15868: NPE when comparing nullable doubles" 2017-02-02 16:31:49 +01:00
Denis Zharkov
529b526763 Support parameter destructuring in suspend lambdas
#KT-16092 Fixed
2017-02-02 18:09:19 +03:00
Denis Zharkov
0878049f15 Support tailrec suspend functions in JVM backend
The main problem is that inside a state machine for a named suspend
function parameters of it's owner are available as a usual captured
closure parameters (i.e. through synthetic fields), while
TailRecursion codegen expects that parameters are straight local
variables.

So, the solution is just to define local var for each of real parameters
(all but the last continuation parameters) for tailrec functions.

 #KT-15759 Fixed
2017-02-02 18:09:19 +03:00
Denis Zharkov
d7403ca185 Minor. Simplify ClosureCodegen.calculateConstructorParameters 2017-02-02 18:09:19 +03:00
Denis Zharkov
a167539d2e Minor. Move recordField call into Closure.captureVariable 2017-02-02 18:09:19 +03:00
Mikhail Glukhikh
212f6e0432 Stub creation from cls fixed for suspend function types
(cherry picked from commit f49ef8e)
2017-02-02 17:54:06 +03:00
Stanislav Erokhin
a4272caa8c Fix serialization for suspend function types.
Since now `suspend (Int) -> String` will be serialized as `(Int, Continuation<String>) -> Any?` + suspend flag.

Before this change such type serialized like this: Function2<Int, String> + suspend flag. And yes, type `Function2<Int, String>` isn't correct, because Function2 expect 3 type arguments.
We have special logic for this case and we deserialize such error-written types correctly.

(cherry picked from commit 3518cbe)
2017-02-02 16:48:59 +03:00
Stanislav Erokhin
382122470f Use LanguageVersionSettings from project instead of LanguageVersionSettingsImpl.DEFAULT for sdk and library resolver.
General effect will be the following:
- all member scopes for libraries and JDK will be constructed with -language-version/-api-version specified in project settings
- for modules with another (not like in project settings) -api-version or -language-version we will have not correct member scope -- for example we will see typealiases from such libraries.

#KT-15979 Fixed

(cherry picked from commit 0001865)
2017-02-02 16:47:53 +03:00
Dmitry Jemerov
ac4be88627 Prevent duplicate addition of "org.jetbrains.kotlin" prefix when copying sources to Maven projects 2017-02-02 14:06:55 +01:00
Mikhail Glukhikh
4c2ae5e3dd Generate test support: error hints moved out of write action 2017-02-02 15:33:18 +03:00
Mikhail Glukhikh
d8f0167d1f Let implement interface: create write action manually to avoid AWT events inside 2017-02-02 15:29:31 +03:00
Mikhail Glukhikh
b839e522e9 Generate equals or hash code: do not run in write action to avoid AWT events inside 2017-02-02 15:29:30 +03:00
Mikhail Glukhikh
a204e57877 Move file to package matching directory: run write action manually to avoid AWT events inside 2017-02-02 15:29:29 +03:00
Mikhail Glukhikh
72b8b85563 Create kotlin sub class: run write action manually to avoid AWT events inside 2017-02-02 15:29:27 +03:00
Mikhail Glukhikh
9664a066a4 Generate test support: ask everything before write action to avoid AWT events inside 2017-02-02 15:29:26 +03:00
Mikhail Glukhikh
70c5d8b9ad Create test intention: do not start in write action to avoid AWT events inside 2017-02-02 15:29:25 +03:00
Mikhail Glukhikh
07f06352d7 if-then --> safe access: run write action manually to avoid AWT events inside 2017-02-02 15:29:23 +03:00
Mikhail Glukhikh
834c3f5d62 if-then --> elvis: run write action manually to avoid AWT events inside 2017-02-02 15:29:22 +03:00
Dmitry Jemerov
9594147c55 Find Usages checks that the signature of the method a property usage resolves to matches the signature of the method being searched
#KT-15291 Fixed
2017-02-02 12:44:54 +01:00
Alexey Sedunov
dbfe3370aa Kotlin Facet: Ignore invalid platform-specific compiler arguments 2017-02-02 13:40:11 +03:00
Mikhael Bogdanov
1e2b50332d Test data update 2017-02-02 09:39:03 +01:00
Mikhail Glukhikh
5f6d65cd44 Change log: last-shot issues for 1.1-Beta2 2017-02-01 21:06:51 +03:00
Mikhail Glukhikh
a15454429d Change log: 1.1-RC --> 1.1-Beta2
(cherry picked from commit 7ee259d)
2017-02-01 21:01:21 +03:00
Dmitry Jemerov
bc9c40883c Avoid repeated reading of file contents from disk while building stubs 2017-02-01 18:14:57 +01:00
Dmitry Jemerov
66f7382e3a Advance binary stub version due to coroutine metadata format changes 2017-02-01 18:10:50 +01:00
Mikhael Bogdanov
a2c5c94ee6 Fix for KT-15868: NPE when comparing nullable doubles
#KT-15868 Fixed
2017-02-01 17:43:56 +01:00
Alexey Tsvetkov
79bea6710f Increment data container cache version
Reason: coroutines metadata format has been changed (since 1.1-beta-1)
2017-02-01 18:50:06 +03:00
Alexey Tsvetkov
1818289772 Avoid checking incremental caches versions if corresponding property is set 2017-02-01 18:50:06 +03:00
Alexey Tsvetkov
2eeb7e36b9 Refactoring: extract checking caches versions to function 2017-02-01 18:50:06 +03:00
Anton Bannykh
385a02ea55 Added forgotten kt8666.txt for LightAnalysisModeCodegenTestGenerated 2017-02-01 18:20:30 +03:00
Dmitry Petrov
7600f89f0b KT-15574 Can't instantiate Array through Type Alias
Array instatiation code should handle type alias constructors properly.

So far, we don't have constructors with type parameters
different from the type parameters of the resulting type,
so we can safely take type arguments of the underlying type.
2017-02-01 17:14:50 +03:00
Anton Bannykh
f5a431490c JS: verified that String concatenation with large Long's is fixed (KT-8666) 2017-02-01 15:36:02 +03:00
Sergey Mashkov
20f9e67244 KT-16043 IDL: mark inline helper function as InlineOnly (generate) 2017-02-01 14:44:48 +03:00
Sergey Mashkov
4c2edd54a6 KT-16043 IDL: mark inline helper function as InlineOnly 2017-02-01 14:44:48 +03:00
Mikhail Glukhikh
5fbb3211de Minor change log fix
(cherry picked from commit ef519dc)
2017-02-01 14:42:09 +03:00
Natalia Ukhorskaya
68f722b337 Debugger: fix evaluate expression when breakpoint is set on function without body inside object
#KT-15855 Fixed
2017-02-01 14:31:35 +03:00
Dmitry Jemerov
faac1c3156 When calculating import candidates, skip redundant deduplication performed by PsiShortNamesCacheImpl
#KT-16071 Fixed
2017-02-01 12:23:16 +01:00
Dmitry Jemerov
1d37c8cfea Calculate autoimport candidates in daemon thread when import fix is created, not in EDT 2017-02-01 12:23:16 +01:00
Denis Zharkov
e9262b875b Implement makeNullableAsSpecified for TypeTemplate properly
This change fixes an SOE in isCastErased:
    @JvmStatic
    fun isCastErased(supertype: KotlinType, subtype: KotlinType, typeChecker: KotlinTypeChecker): Boolean {
        if (supertype.isMarkedNullable || subtype.isMarkedNullable) {
            return isCastErased(TypeUtils.makeNotNullable(supertype), TypeUtils.makeNotNullable(subtype), typeChecker)
        }

TypeUtils.makeNotNullable(TypeTemplate) should not return the same object
if isMarkedNullable returned true on the instance


 #KT-15516 Fixed
2017-02-01 11:51:15 +03:00
Mikhail Glukhikh
dc57f97196 1.1-RC change log polishing 2017-01-31 19:01:03 +03:00
Ilya Gorbunov
3be8558a1a Edit 1.1-RC changelog regarding Standard Library and JS 2017-01-31 18:45:53 +03:00
Mikhail Glukhikh
8d48452c1a 1.1-RC: change log (final?) update 2017-01-31 17:31:03 +03:00
Alexey Tsvetkov
c57dac159b Avoid having -d and -module set at the same time
#KT-14619 fixed
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov
9b5129a0f3 Fix annotation processors outputting to classes dir with kapt 3
#KT-15915 fixed

 Annotation processor can access a classes directory provided by AP environment.
Previously kapt 3 was using kotlin-classes directory as a a classes directory.
However compileKotlin task does not expect this.
Also having multiple tasks with the same output dir is a bad practise in Gradle.

This change introduces a separate directory for classes generated by kapt 3.
Its output is copied to a resulting classes dir (just as a kotlin-classes dir).
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov
34f04f3482 Fix downgrading from 1.1 to 1.0.x in Gradle
If @Input property is added in new plugin version
and this property has a new type (a class/enum which is not presented in previous plugin)
then downgrading leads to an exception,
because Gradle tries to deserialize the property value from its caches,
but the type of value does not exist.

Workaround: add new String property.
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov
49d0f69227 Fix exception when Groovy lazy string (GString) is in freeCompilerArgs
#KT-15500 fixed

GString is an object that represents string literal like `"${project.name}"`
in Groovy. It is not an instance of string.
Groovy automatically converts GString to String when it is passed where String is expected.
However freeCompilerArgs is a List<String>, so type parameter info is lost at runtime.
When iterating freeCompilerArgs in Kotlin as a list of string, an exception
is thrown because GString cannot be casted to String (toString should be called instead).
2017-01-31 16:53:34 +03:00
Dmitry Jemerov
fa6bfe932e More efficient implementation of containsFilesWithExactPackage() (don't materialize KtFile instances we don't actually need) 2017-01-31 14:44:28 +01:00
Dmitry Jemerov
62e1d49def Make sure that we don't have multiple coroutine status flags in the facet settings if one flag was set before parsing the command line options and another is specified through the command line options.
#KT-16075 Fixed
2017-01-31 14:32:09 +01:00
Alexander Udalov
464820458e JS: rename "-library-files" argument to "-libraries" and change separator
Use the system separator (':' or ';') instead of commas

 #KT-16083 Fixed
2017-01-31 16:26:35 +03:00
Dmitry Jemerov
fd24031a69 Don't read file content to see if file is Kotlin-compiled if we have cached attribute but don't have complete data 2017-01-31 13:50:35 +01:00
Dmitry Jemerov
ffa3cf0027 Don't show "Convert lambda to reference" for lambdas passed to suspend functions
#KT-16072 Fixed
2017-01-31 13:42:38 +01:00
Mikhail Glukhikh
7021b0bf15 Change log update for 1.1.0 2017-01-31 15:21:13 +03:00
Simon Ogorodnik
c2ba4e3ab9 KT-14252 Completion could suggest constructors available via typealiases
#KT-14252 fixed
2017-01-31 15:14:18 +03:00
Denis Zharkov
39fc1789e0 Prohibit inline lambda parameters of suspend function type
#KT-16068 Fixed
2017-01-31 14:55:48 +03:00
Stanislav Erokhin
67835b642d Do not show url for multi platform projects. 2017-01-31 13:07:54 +03:00
Mikhail Zarechenskiy
f3385e093e Introduce language feature for type inference on generics for callable references
#KT-16061 Fixed
2017-01-31 01:15:02 +03:00
Nikolay Krasko
563196a8aa Stop in the method with suitable name if no descriptor found
Absence of descriptor is possible when sources are outdated or absent.
Early stop is better than iterating in step into till the program end.
2017-01-30 21:28:59 +03:00
Nikolay Krasko
c8999c4141 Fix in test bad behaviour of smart step into for stored lambda
When lambda is stored and not executed immediately, smart step into
doesn't work.
2017-01-30 21:28:59 +03:00
Nikolay Krasko
4a4a8250fd Fix smart step into functions call with suspend lambdas (KT-14700)
#KT-14700 Fixed
2017-01-30 21:28:59 +03:00
Nikolay Krasko
2add36ef32 Exclude errors descriptors from the set of conflicting declarations
Resolve hanging in evaluate expression
2017-01-30 21:28:59 +03:00
Alexander Udalov
ad0178ee64 Increase SOURCE_STUB_VERSION
Because of a974ed1 and b9f9894
2017-01-30 20:27:17 +03:00
Alexander Udalov
8811165de8 Report error on callable reference or class literal with "-no-stdlib"
Also workaround the NoSuchElementException that was happening because error
type never has any type arguments

 #KT-14547 Fixed
2017-01-30 20:27:17 +03:00
Alexander Udalov
7371dc9b54 Minor, fix typo in assertion message 2017-01-30 20:27:17 +03:00
Alexander Udalov
424afba246 Add hint to use "-language-version", when applicable, in JVM runtime checker 2017-01-30 20:27:17 +03:00
Alexander Udalov
7167139c2e Refactor JvmRuntimeVersionsConsistencyChecker for readability 2017-01-30 20:27:16 +03:00
Alexander Udalov
9e877b4a9e Do not report error on libraries that bundle Kotlin runtime in classpath
Instead, report a strong warning, suggesting to remove such libraries from the
classpath

 #KT-15995 Fixed
2017-01-30 20:27:16 +03:00
Alexander Udalov
2d975d74cb Slightly refactor inline functions at serializationUtils.kt
Extract large bodies to separate functions, use KType.classifier instead of
KClass.createType
2017-01-30 20:22:54 +03:00
Alexander Udalov
f6c3aa0807 Fix JvmBuildMetaInfoTest.testSerialization
Do not check against hard-coded values of parameters, because they might be
changed a lot in the future
2017-01-30 20:22:54 +03:00
Mikhail Glukhikh
8bf233e686 Change log update for 1.1.0 2017-01-30 20:21:13 +03:00
Yan Zhulanow
1b337e1a48 Generate enum values with bodies properly (KT-15803) 2017-01-30 20:13:08 +03:00
Yan Zhulanow
18e0baa13e Kapt: Allow empty .kt files list in kapt in order to support kapt with Java-only source files. (KT-15675) 2017-01-30 20:13:08 +03:00
Ilya Gorbunov
38b79a51d5 Fix tests after introducing exlcusions to default imports of kotlin.js package. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov
33f3106157 Do not use Math in common code. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov
66abea1f19 Add explicit imports of kotlin.js.* to stdlib where required. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov
25c3064554 Add explicit imports of kotlin.js.* to generated files. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov
cd5f68f119 Add exclusions to JS platform default imports 2017-01-30 19:44:51 +03:00
Alexey Andreev
d0b7dc8f4e JS: don't fail when generating signature for function which refers to undefined type 2017-01-30 19:26:24 +03:00
Ilya Gorbunov
f4ef98c327 Remove test for named native 2017-01-30 19:21:41 +03:00
Ilya Gorbunov
c4a0bb727d Change LoadBuiltinsTest testData, add runtime and import to box tests.
#KT-16030
2017-01-30 18:55:05 +03:00
Ilya Gorbunov
4ac7be9fa5 Retract bitwise operators from builtins for Byte and Short and add them as extensions in kotlin.experimental package in stdlib.
#KT-16030
2017-01-30 18:54:59 +03:00
Dmitry Jemerov
9b820202b5 Don't run decompiler to check whether reference is in copied fragment
#KT-16038 Fixed
2017-01-30 16:32:46 +01:00
Dmitry Jemerov
8968d5663d Minor fixes for stdlb kdoc 2017-01-30 16:13:49 +01:00
Alexey Sedunov
60edc46d8c Spring Support: Consider declaration open if it's supplemented with a preconfigured annotation in corresponding compiler plugin
#KT-15444 Fixed
2017-01-30 17:54:53 +03:00
Dmitry Jemerov
f73d32afeb Look at parent project when checking whether the Kotlin Maven plugin is applied in a module
#KT-15954 Fixed
2017-01-30 15:53:37 +01:00
Alexey Andreev
06e8f7b328 JS: don't report error when FAKE function overrides external function with optional parameters. Report only when it overrides at least two such functions. See KT-15961 2017-01-30 17:26:07 +03:00
Simon Ogorodnik
d117b0210f Revert "KT-14252 Completion could suggest constructors available via typealiases"
Reverted due problems with tests
This reverts commit 55eeb74c08.
2017-01-30 16:46:38 +03:00
Anton Bannykh
77aa685496 JS: char boxing 2017-01-30 16:31:44 +03:00
Simon Ogorodnik
55eeb74c08 KT-14252 Completion could suggest constructors available via typealiases
#KT-14252 fixed
2017-01-30 16:24:12 +03:00
Alexander Udalov
167155388d Rename JsBinaryVersion -> JsMetadataVersion
For consistency with JvmMetadataVersion
2017-01-30 16:05:46 +03:00
Alexander Udalov
e9a737b85a Promote severity of configuration warnings to STRONG_WARNING
The reason is that these configuration problems may be the reason of
compilation errors, but they were hidden from the output because warnings are
not reported when there's at least one error
2017-01-30 16:01:29 +03:00
Alexander Udalov
7ac96163ac Introduce CompilerMessageSeverity.STRONG_WARNING
This is a severity for mandatory warnings, i.e. those which should be reported
in any case, even if there are compilation errors
2017-01-30 16:01:27 +03:00
Alexander Udalov
268d10d3f0 Advance JvmMetadataVersion to 1.1.4, change IS_PRE_RELEASE to false
Kotlin 1.1 is no longer considered a pre-release
2017-01-30 16:00:05 +03:00
Alexander Udalov
1025fe9307 Minor, remove unnecessary logging for valid erroneous case
It seems that it's normal for VirtualFile in this place to be invalid in this
way
2017-01-30 15:57:51 +03:00
Alexander Udalov
933bcb3511 JS: do not require "id" in the File protobuf message 2017-01-30 15:55:20 +03:00
Denis Zharkov
88b82d5fa2 Exclude coroutine inrinsics and internal packages
#KT-16018
2017-01-30 15:45:02 +03:00
Denis Zharkov
b0ebbe99d6 Fix coroutine-related VerifyError
The problem was that we spilled the `origin` variable (see test) as Object, because
we determined the type of merge(null, String) incorrectly.

 #KT-15973 Fixed
2017-01-30 15:45:02 +03:00
Zalim Bashorov
0dd3f11175 KJS: mark as inline only some functions form js stdlib 2017-01-30 15:35:45 +03:00
Zalim Bashorov
a49ad3ca69 KJS: change visibility of subSequence helper function to internal to avoid to use it directly from kotlin 2017-01-30 15:35:45 +03:00
Zalim Bashorov
d5dca38d68 KJS: rename baseClass field in metadata to interfaces since we plan to store there only implemented interfaces (see KT-15037) 2017-01-30 15:35:45 +03:00
Zalim Bashorov
1b8b6bea43 KJS: turn Json class into external interface
#KT-12712 Fixed
2017-01-30 15:35:45 +03:00
Dmitry Jemerov
3a3cf048a6 Register ControlFlowFactory in KotlinCoreProjectEnvironment
#KT-16047 Fixed
2017-01-30 13:22:47 +01:00
Dmitry Jemerov
f0e890797a Disable "Create type alias from usage" fix when language level doesn't support type aliases
#KT-16036 Fixed
2017-01-30 12:37:31 +01:00
Dmitry Jemerov
17c73cea7f Disable "Introduce type alias" refactoring when type aliases aren't supported by the current language level 2017-01-30 12:37:31 +01:00
Dmitry Jemerov
720da176db Exclude keywords from completion if the corresponding feature is unsupported by the language level selected for the module 2017-01-30 12:32:41 +01:00
Alexander Udalov
eb61a1c5a8 Make KTypeProjection's constructor public
To make it easier to create a KTypeProjection instance given a KVariance
instance (otherwise you currently need to do a "when" on it). Also it's exposed
via automatically generated "copy" anyway
2017-01-30 11:31:20 +03:00
Alexander Udalov
e5680565b3 JS: drop "-kjsm" flag, merge logic with "-meta-info"
#KT-16049 Fixed
2017-01-30 11:31:03 +03:00
Alexander Udalov
17b0b7704f JS: minor, drop obsolete VFS_PROTOCOL 2017-01-30 11:31:02 +03:00
Alexander Udalov
ef42e3e4aa JS: write full version (major.minor.patch) to .meta.js 2017-01-30 11:31:02 +03:00
Alexander Udalov
038e4da83c Do not crash JS decompiler on non-existing .jar entries
See the comment for clarification
2017-01-30 11:31:02 +03:00
Alexander Udalov
b5fef84e9c Update tests on decompiled text for JS
Because .kjsm files now contain all declarations from the package (contrary to
the JVM decompiler which produces one file for one class/package facade), some
common decompiled text tests started to behave differently on JVM and JS.
Update two of them (Modifiers, ClassWithClassObject) to make results the same,
copy another (TypeAliases) to JVM-/JS-specific tests with different outputs
2017-01-30 11:31:02 +03:00
Alexander Udalov
805e3e4d0f Drop tests on JS decompiled text / stub consistency
They're no longer needed because the logic of the decompiler / stub builder is
now trivial (see KotlinJavaScriptDeserializerForDecompiler,
KotlinJavaScriptStubBuilder) and after it's merged to the decompiler for
built-ins, it's going to be tested anyway with BuiltInDecompilerConsistencyTest
2017-01-30 11:31:02 +03:00
Alexander Udalov
1045689911 JS: simplify KotlinJavascriptSerializationUtil
Inline recently introduced SerializerCallbacks
2017-01-30 11:31:02 +03:00
Alexander Udalov
63c24c56ec JS: serialize .kjsm package-wise, adapt decompiler & stub builder
Instead of multiple .kjsm files for different classes and .kotlin_string_table,
.kotlin_file_table, .kotlin_classes files for each package, serialize the
contents of each package to a single foo/bar/baz/baz.kjsm file. The short name
of the file is the last segment in the FQ name of the package, or
"root-package" if the package is root.

There are two main reasons for this change:
1) Such structure takes less space, is more IO-friendly and will not cause
   multiple exceptions as the old one, where we sometimes tried to read
   non-existing files
2) This is exactly the same format that is used to serialize built-in
   declarations (.kotlin_builtins) at the moment, which will allow us to reuse
   some code

Also write a separate Header protobuf message to the beginning of the .kjsm
file. This will be used as arguments of the kotlin.Metadata annotation are used
in the JVM-specific parts of the compiler: to be able to provide some general
information about the binary file without parsing the whole protobuf data.

This commit breaks decompiled text & stub builder consistency tests. This is OK
because they're removed in a future commit.

Fixes EA-79605, EA-81947, EA-84277 and maybe EA-86787

 #KT-10894 Fixed
 #KT-14124 Fixed
 #KT-15755 Fixed
2017-01-30 11:31:02 +03:00
Alexander Udalov
46bf057b47 JS: do not generate .meta.js and .kjsm for built-ins 2017-01-30 11:31:02 +03:00
Alexander Udalov
4b81dfb7c1 JS: improve binary representation format of metadata in .meta.js
Instead of writing many different files and serializing this "virtual file
system" to a byte array in a protobuf message, just write the needed stuff
directly, as fields in the Library message. Make it consist of many Part
messages, where the Part message is equivalent to the BuiltIns message in
builtins.proto. The next step would be to combine Library.Part and BuiltIns,
which will allow us to simplify some serialization-related code soon.

In this commit, no changes happened to the .kjsm format. But since the code
that serialized the abovementioned files was shared, a temporary abstraction
over two serialization formats was made, see SerializerCallbacks.

This commit temporarily breaks .kjsm decompiler and stub builder
2017-01-30 11:31:01 +03:00
Dmitry Petrov
77ea0614f9 Fix testData in smart completion test
(abbreviation is preserved for 'arrayListOf').
2017-01-30 10:51:47 +03:00
Vyacheslav Gerasimov
7bd6314ee1 Implemented building Kotlin Android projects with Jack toolchain enabled
#KT-13275 Fixed
Implemented KotlinJillTask for converting kotlin classes to jace format which could be consumed by Jack transform task
2017-01-29 23:39:53 +03:00
Zalim Bashorov
29ac01f2e2 KJS: allow to use packages with names starting with "kotlin" only if the -Xallow-kotlin-package command line option is specified
#KT-14668 Fixed
2017-01-29 17:21:01 +03:00
Ilya Gorbunov
7195e26ae2 Rollback Closeable.use implementation as it was in 1.0 in order not to call functions that were introduced in 1.1 from this inline function.
#KT-16026
2017-01-29 02:41:12 +03:00
Ilya Gorbunov
36436ae240 Maven build: change module build order. 2017-01-29 01:15:14 +03:00
Simon Ogorodnik
b422b0e24d KT-14722 completion list isn't filled up for typealias to object
#KT-14722 fixed
2017-01-28 21:42:39 +03:00
Stanislav Erokhin
e38ca44595 Create different KotlinBuiltIns for modules with different language feature settings.
For sdkModule we create builtIns with default language feature settings.
Also when we create sdkModuleResolverProvider we create builtIns cache.
Then for every other module we get builtIns cached by value isAdditionalBuiltInsFeatureSupported.
2017-01-28 19:13:48 +01:00
Ilya Chernikov
7c0cdf90cf Move daemon session flag files to daemon discovery dir by default + minor fixes:
- Move flag files from the temp dir, because right now JPS cleans temp dir on each build start. Should fix KT-15707, also may affect KT-15562.
- change compiler runner to allow the fix above
- Fix flag file name filtering
- Fix ifAlive handling on the new compile method in the daemon.
2017-01-28 15:36:06 +01:00
Dmitry Jemerov
ddbb476211 Add quickfix to increase language level by editing build.gradle 2017-01-28 13:14:39 +01:00
Dmitry Jemerov
c170c7b98f Add quickfix to enable coroutines by editing build.gradle
#KT-15955 Fixed
2017-01-28 13:14:39 +01:00
Dmitry Jemerov
da6640971f Import new Gradle coroutines DSL setting into Kotlin facet 2017-01-28 13:14:39 +01:00
Dmitry Jemerov
c7115e7233 Copy language and API version from compiler options to version info 2017-01-28 13:14:39 +01:00
Stanislav Erokhin
6ef96017e8 Mute test and create issue KT-15972. 2017-01-28 03:25:47 +03:00
Stanislav Erokhin
ec2eec33e3 Added hint url for coroutines and multiplatform diagnostics. 2017-01-28 03:25:45 +03:00
Stanislav Erokhin
b033ad1b2b Add positioning strategy DECLARATION_NAME for DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE. 2017-01-28 03:25:44 +03:00
Stanislav Erokhin
2aa2df75ae Make property java available on KClass<T> where T is type parameter without upper bounds. 2017-01-28 03:25:43 +03:00
Ilya Chernikov
bd47337be2 Using stdlib instead of runtime in the JSR 223 engines 2017-01-27 22:20:45 +01:00
Ilya Chernikov
b8b044c6b0 Reuse script args substitution for replacing bindings in JSR 223 sample engines, fixes KT-15450 2017-01-27 22:20:44 +01:00
Ilya Chernikov
b86ed0c5d9 Comment out failing test part - temporary, see TODO 2017-01-27 22:20:44 +01:00
Ilya Chernikov
0b689a4ecb PR-1021 review: minor fixes
# Conflicts:
#	compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplCompilingEvaluator.kt
#	compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplEvaluator.kt
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt
2017-01-27 22:20:44 +01:00
apatrida
5ad06e1e92 PR-1021: Merge Keplin project scripting code into Kotlin core.
Overhauls the scripting layers (GenericRepl and related, and JSR223 and related)
Adds repeating modes (none, only latest eval'd line, or random order)
Also adds better thread-safe IO capturing, default imports, SimpleRepl wrapper, more unit tests

NOTE: the script-util part of the pull request was rejected due to various problems and incompatibilities.
It may be incorporated into the code later.

(originally cherry picked from commit 6f7d517)
2017-01-27 22:20:44 +01:00
Ilya Chernikov
8caf607378 PR-1021 preparations: prepare files to preserve important history
- Split GenericRepl.kt into separate files
- Rename Repl.kt
2017-01-27 22:20:44 +01:00
mglukhikh
34dd259900 Changelog 1.1.0: issue 15790 removed 2017-01-27 23:40:25 +03:00
Mikhail Glukhikh
d8a4a32e9f Do not report UNUSED_PARAMETER in function literal for 1.0 compatibility mode #KT-16010 Fixed 2017-01-27 23:39:08 +03:00
Mikhail Glukhikh
9fdf16e5d7 Quick-fix to add 'suspend' to the receiver of startCoroutine / createCoroutine #KT-15738 Fixed 2017-01-27 23:39:04 +03:00
Mikhail Glukhikh
5f455bbe3a Do not suggest renaming to underscore in 1.0 compatibility mode #KT-16019 Fixed 2017-01-27 23:39:01 +03:00
Mikhail Glukhikh
67e207acb0 Do not suggest destructuring in function literal in 1.0 compatibility mode #KT-15134 Fixed 2017-01-27 23:38:59 +03:00
Mikhail Glukhikh
3cd4d7cbfe Operator to function: rem or mod depending on version #KT-15969 Fixed 2017-01-27 23:38:57 +03:00
Roman Elizarov
a1571657f3 Updated test to experimental package 2017-01-27 23:24:13 +03:00
Roman Elizarov
8dc318dd92 Fixed KT-15963 (coroutines machinery should not use equals on results) 2017-01-27 23:24:13 +03:00
Denis Zharkov
c362a9154b Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED 2017-01-27 23:24:13 +03:00
Denis Zharkov
246946bc18 Move buildSequence/buildIterator to kotlin.coroutines.experimental 2017-01-27 23:24:13 +03:00
Denis Zharkov
35e9f0a89a Update a test result temporary
Currently common stdlib doesn't contain Continuation interface
2017-01-27 23:24:13 +03:00
Denis Zharkov
68fc6fa217 Support non-CoroutineImpl instances in createCoroutine 2017-01-27 23:24:13 +03:00
Denis Zharkov
463af85f78 Minor. Update light-classes test data after coroutine-related changes 2017-01-27 23:24:13 +03:00
Denis Zharkov
1d5144b168 Move coroutine-related diagnostic tests to run them with stdlib
It's necessary because all coroutine related declarations (Continuation, etc)
are now in the stdlib
2017-01-27 23:24:13 +03:00
Denis Zharkov
8fa8ba7055 Move coroutine-related runtime parts to kotlin.coroutines.experimental package
#KT-15975 Fixed
2017-01-27 23:24:13 +03:00
Denis Zharkov
cb4914ab56 Make 'suspendCoroutineOrReturn' inline-only 2017-01-27 23:24:13 +03:00
Denis Zharkov
0e132b9857 Move all coroutine-related declarations from built-ins to stdlib
Also move internal declarations from runtime.jvm module into new package
kotlin.coroutines.jvm.internal in stdlib

The necessity of these declarations being in built-ins is controversial,
but also it will complicate the migration of current coroutine runtime
to a separate jar if we ever need this
2017-01-27 23:24:13 +03:00
Denis Zharkov
b61c152b4e Minor. Drop a couple of unused properties 2017-01-27 23:24:13 +03:00
Zalim Bashorov
4a72404ac2 Support a larger set of symbols as module name in "MODULE" directive 2017-01-27 23:15:43 +03:00
Zalim Bashorov
66fd566df0 KJS: fix inlining from modules with non valid identifier name 2017-01-27 23:13:53 +03:00
Zalim Bashorov
487419e762 KJS: don't export inline functions with InlineOnly annotation and inline functions with reified generic parameter 2017-01-27 22:47:10 +03:00
Zalim Bashorov
16405d080d Minor: remove outdated references form jslib_files.xml 2017-01-27 22:47:09 +03:00
Ilya Gorbunov
267703e6b7 Change references to kotlin-stdlib-js.jar in plugin.
Change test projects for js project configurator.
#KT-15940
2017-01-27 22:19:49 +03:00
Ilya Gorbunov
0df31f1223 Build kotlin-stdlib-js.jar in ant
#KT-15940
2017-01-27 22:19:40 +03:00
Ilya Gorbunov
d0e917e7f9 Fix maven references to stdlib-js in IDEA project
#KT-15940
2017-01-27 22:19:35 +03:00
Ilya Gorbunov
078f606cdc List artifacts required for maven plugin IT in extraArtifacts rather than in dependencies.
#KT-15940
2017-01-27 22:19:31 +03:00
Ilya Gorbunov
ea9be01034 Fix maven references to stdlib-js
#KT-15940
2017-01-27 22:19:26 +03:00
Ilya Gorbunov
ba1d7104a3 Rename JS standard library artifact #KT-15940 2017-01-27 22:09:46 +03:00
Simon Ogorodnik
2a08e3c679 KT-14767 typealias to annotation class should appear in the completion list
#KT-14767 fixed
2017-01-27 21:29:23 +03:00
Alexey Andreev
4c831cab9e JS: regenerate stdlib files from IDL 2017-01-27 20:54:43 +03:00
Alexey Andreev
72bcdf8869 JS: add enum emulation to IDL2K 2017-01-27 20:54:43 +03:00
Alexey Andreev
04e9405082 JS: regenerate stdlib files from IDL 2017-01-27 20:54:42 +03:00
Alexey Andreev
68d14de000 JS: add support of Promise<T> in IDL2K 2017-01-27 20:54:42 +03:00
Alexey Andreev
563a3a25cb JS: add Promise class 2017-01-27 20:54:41 +03:00
Mikhail Glukhikh
f5d5079b0d 1.1.0 change log update 2017-01-27 20:19:13 +03:00
Alexey Sedunov
be3e33051e Kotlin Facet: Fix Gradle import without "module per source set" option
#KT-15812 Fixed
2017-01-27 20:05:01 +03:00
Alexey Sedunov
34b0e175ca Configuration: Prohibit api-version > language-version in Facet and Project Settings
#KT-16015 Fixed
2017-01-27 20:05:00 +03:00
Alexey Tsvetkov
1420bd1b33 Add Kotlin Gradle DSL to configure coroutines from build.gradle 2017-01-27 19:04:49 +03:00
Mikhail Glukhikh
08caf0a011 Object literal to lambda: handle last comment correctly #KT-15670 Fixed 2017-01-27 18:15:56 +03:00
Mikhail Glukhikh
c0f5cafbd8 Set type reference: destructuring support #KT-14994 Fixed 2017-01-27 18:15:54 +03:00
Mikhail Glukhikh
f4513e9c70 Remove explicit lambda parameter types: destructuring support #KT-15162 Fixed
Also #KT-14993 Fixed
2017-01-27 18:15:52 +03:00
Nikolay Krasko
2c17773715 Minor: better name 2017-01-27 18:00:14 +03:00
Nikolay Krasko
370e7cd9f5 Stop considering injected files as Kotlin source roots (KT-15032)
We should have a special facade for them as descriptors are not
present in ordinal project facade.

Caused by change in idea 171 (b3527d9a20)

 #KT-15032 Fixed
2017-01-27 18:00:14 +03:00
Dmitry Jemerov
1361d5e915 EA-85853 - (KT-13415) AIOOBE: LightClassUtilsKt.toPsiTypeParameters 2017-01-27 14:48:05 +01:00
Dmitry Jemerov
59e2645293 EA-82902 - IOOBE: KtLightAnnotation$LightExpressionValue.unwrapArray 2017-01-27 14:48:05 +01:00
Kirill Rakhman
956094e062 Add Merge ifs intention (#975)
Fixes #KT-9912
2017-01-27 14:20:11 +01:00
Mikhael Bogdanov
456037a30d Generate proper annotaions on parameters for @JvmOverloads;
Fix for KT-15743: Overloaded Kotlin extensions annotates wrong parameters in java

 #KT-15743 Fixed
2017-01-27 14:09:13 +01:00
Mikhael Bogdanov
ab464ea86e Fix for KT-15726: Kotlin can't compile nested try-catch with return
#KT-15726 Fixed
2017-01-27 14:09:13 +01:00
Dmitry Jemerov
2c1c3d1f31 Workaround for compilation issue: don't use a Java shim to access token name, use toString() instead (for all relevant tokens, it will return the name, and for all others, the return value won't match the Java keyword filter regexp) 2017-01-27 13:32:20 +01:00
Dmitry Petrov
de14d4abc8 KT-15748 Type alias constructor return type should have a corresponding abbreviation 2017-01-27 15:16:04 +03:00
Ilya Gorbunov
dbaf31effe sourceDirs exclude the original test dir, so add it explicitly. 2017-01-27 14:53:33 +03:00
Ilya Gorbunov
01f53d0173 Return NaN as an average of an empty collection.
#KT-15399 Fixed
2017-01-27 14:53:33 +03:00
Dmitry Jemerov
6704ba05de Don't try to get siblings of PsiDirectory either (EA-94811 - assert: FileManagerImpl.findDirectory) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
731aeac04f Delete quick fix which was needed to migrate users to the version of Kotlin which was the latest in 2014 (EA-93982 - assert: PsiModificationTrackerImpl.fireEvent) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
6cbb2a4491 Replace incorrect assertion with explicit check (EA-93946 - assert: UnusedSymbolInspection.hasNonTrivialUsages) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
7236aa45f2 Fix IAE when rendering unknown type (EA-89031 - IAE: SmartTypeRenderer.render) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
2342aeef49 Don't try to resolve a class with no containing file (such as LightBRClass) to descriptor (EA-91890 - (AS only, no containing file, from Java light classes) LET: GetModuleInfoKt$getModuleInfo$.invoke) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
1337a5216c Don't try to get text for invalid file (EA-86393 - PIEAE: PsiFileImpl.getText) 2017-01-27 12:47:41 +01:00
Dmitry Jemerov
b987e37e82 Diagnostics for EA-86712 2017-01-27 12:47:41 +01:00
Ilya Gorbunov
661ff81e67 Specify names for parameters of functional types with two or more parameters to ease lambda completion.
#KT-13826
2017-01-27 14:46:29 +03:00
Kirill Rakhman
96d0f91afc Implement Smart Enter handler for class body (#1022)
Fixes #KT-9011
2017-01-27 12:35:33 +01:00
Dmitry Jemerov
e6a7808d8e Fix ConfigureKotlinUtilTest 2017-01-27 12:27:39 +01:00
Mikhail Zarechenskiy
0c6a860a22 ReplaceWith annotation resolver: use module from resolution facade to build imports scope
#KT-15873 Fixed

Using module from original element may lead to exceptions as it could be
<built-ins module> (after deprecation of `mod` operator)
2017-01-27 14:13:13 +03:00
Dmitry Petrov
e05f2eaff6 KT-15017 Throwing exception in the end of inline suspend-functions lead to internal compiler error
Suspend function call with a reachable (alive) begin marker and unreachable (dead) end marker
is an exit point for the corresponding coroutine.
It isn't a suspension point, and doesn't introduce a new state in the coroutine FSM.
2017-01-27 10:43:00 +03:00
Ilya Gorbunov
3be1174824 Replace @native with external in tests 2017-01-27 01:29:15 +03:00
Ilya Gorbunov
20f175d091 Soften back deprecation level for nativeGetter/Setter/Invoke annotations. 2017-01-27 00:48:46 +03:00
Simon Ogorodnik
4202abac63 Fix test 2017-01-26 23:19:42 +03:00
Ilya Chernikov
4bb5e978a7 Implement SamWithReceiverAnnotations annotation and it's handling (KT-15848)
TODO: tests
2017-01-26 20:53:24 +01:00
Simon Ogorodnik
f1c4230a68 KT-14680 import statement to typealias reported as unused when using only TA constructor
#KT-14680 fixed
2017-01-26 21:18:20 +03:00
Dmitry Jemerov
46bb636cea Fix ConfigureProjectTestGenerated 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
c4032908c0 Don't show "Kotlin not configured" notifications while Gradle sync is running
#KT-15279 Fixed
2017-01-26 19:08:57 +01:00
Dmitry Jemerov
ac35b182b5 KotlinConfigurationCheckerComponent: J2K 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
c6a20d39b4 KotlinConfigurationCheckerComponent: rename to .kt 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
c7ea4eead7 Add Gradle JavaScript configurator 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
c6251fdad7 Add JS variant of Gradle framework support provider
#KT-13632 Fixed
2017-01-26 19:08:57 +01:00
Dmitry Jemerov
e76cd15e5b Update different stdlib/gradle inspection to handle kotlin-stdlib-jre* 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
163cef6457 Configuring project with Maven adds kotlin-stdlib-jre7 or kotlin-stdlib-jre8 if the selected JDK is of a high enough version
#KT-15712 Fixed
2017-01-26 19:08:57 +01:00
Dmitry Jemerov
7eea8f3849 Configuring project with Gradle adds kotlin-stdlib-jre7 or kotlin-stdlib-jre8 if the selected JDK is of a high enough version 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
acc19f2ab6 Don't add 'kotlin' source root to build.gradle by default
#KT-14830 Fixed
2017-01-26 19:08:57 +01:00
Dmitry Jemerov
85a74f4cca Detect version 1.1.0-beta as 1.1 prerelease 2017-01-26 19:08:57 +01:00
Dmitry Jemerov
56bbb8ec78 Disable incompletely implemented Inline Function refactoring 2017-01-26 19:05:47 +01:00
Dmitry Jemerov
68bd5bd323 Fix project leak due to not disposed dialog 2017-01-26 18:55:17 +01:00
Dmitry Jemerov
d4af75bc50 Add write action which is required in 171 branch 2017-01-26 18:26:14 +01:00
Yan Zhulanow
bb0b70d27b Kapt: Fix extending configurations in Gradle, create "main" configuration if it does not exist yet. Also fix checking kapt configuration dependencies, use allDependencies instead (KT-15814) 2017-01-27 02:01:04 +09:00
Yan Zhulanow
3b4a8e0f33 Kapt3: Write qualified name of classes on error type conversion, handle declaration-site variance properly. 2017-01-27 01:20:01 +09:00
Yan Zhulanow
72bbf9697b Kapt3: As javac now reads stubs from Java files, not from AST, we should provide the valid names for all identifiers (at least names should not clash with Java keywords).
Rename identifiers if it clashes with Java keywords. (KT-15838)
2017-01-27 01:20:01 +09:00
Yan Zhulanow
e28b4dfbc7 Kapt3: Do not check type for star projection, it causes the infinite recursion. Also limit recursion depth to 10. (KT-15841) 2017-01-27 01:20:00 +09:00
Dmitry Jemerov
48a66c9d41 Generate Markdown documentation for Gradle options 2017-01-26 17:03:30 +01:00
Alexey Sedunov
deb9258994 Misc: Reverted 1fb90ac0fd 'Copy compiler arguments from iml even if "Use project settings" checkbox is checked' as it's rendered obsolete due to "Use project settings" being turned off by default in Gradle/Maven projects 2017-01-26 18:06:19 +03:00
Alexey Sedunov
6e8d0b520e Kotlin Facet: Import Gradle properties defined in gradle.properties file 2017-01-26 18:06:17 +03:00
Alexey Sedunov
f8349da608 Kotlin Facet: Import compiler arguments from Maven project model 2017-01-26 18:06:16 +03:00
Alexey Sedunov
74bfaa4ffe Quick Fixes: Change API level as well as language level in "Enable unsupported feature fix"
#KT-15918 Fixed
2017-01-26 18:06:15 +03:00
Alexey Sedunov
591910a216 Kotlin Facet: Import compiler arguments from Gradle project
#KT-15819 Fixed
 #KT-15929 Fixed
2017-01-26 18:06:14 +03:00
Alexey Sedunov
dafb6f8b3c Kotlin Gradle Plugin: Provide serialized list of compiler arguments in compilation tasks 2017-01-26 18:06:13 +03:00
Mikhail Glukhikh
bb54f23472 Change log updated for 1.1 2017-01-26 16:45:10 +03:00
Mikhael Bogdanov
25d75bcd8b Delegates to java defaults methods in compatibility mode 2017-01-26 14:32:33 +01:00
Mikhael Bogdanov
0006a04b01 Report warning on hided override by delegation when compile to 1.0 version 2017-01-26 14:32:33 +01:00
Alexey Tsvetkov
09a8a999c8 Correct construction of UnicastRemoteObject
#KT-15837 fixed
2017-01-26 16:07:44 +03:00
Alexey Tsvetkov
470a7706aa Fix build 2017-01-26 15:49:40 +03:00
Mikhail Zarechenskiy
462aed35d3 Don't exclude callable references with type parameters from completion 2017-01-26 14:48:37 +03:00
Alexey Tsvetkov
e04d18f3de Minor: make functions public to avoid error on teamcity 2017-01-26 14:23:21 +03:00
Alexey Tsvetkov
f46217129b EA-95293: do not report OUTPUT messages to message collector if outputs collector is specified 2017-01-26 13:38:52 +03:00
Alexey Tsvetkov
b9dbe69232 Rebuild all kotlin files when EAP flag is changed 2017-01-26 13:38:52 +03:00
Alexey Tsvetkov
4a63e47aa0 Save JvmBuildMetaInfo to file after build 2017-01-26 13:38:52 +03:00
Alexey Tsvetkov
6dbc4ff303 Introduce JvmBuildMetaInfo to hold last build settings 2017-01-26 13:38:52 +03:00
Simon Ogorodnik
82a70283b5 KT-15789 Kotlin plugin incorrectly converts for-loops from Java to Kotlin
#KT-15789 fixed
2017-01-26 13:33:06 +03:00
Simon Ogorodnik
bf3d4471cd KT-14710 Sample references aren't resolved in IDE
#KT-14710 fixed
2017-01-26 13:27:57 +03:00
Simon Ogorodnik
cd73d17bd4 KT-15311 "Add Import" intention generates incorrect code
#KT-15311 fixed
2017-01-26 13:24:41 +03:00
Dmitry Petrov
1613ad0505 KT-15898 Cannot use type alias to qualify enum entry
Type alias static scope includes enum entries for underlying enum class.
2017-01-26 10:23:56 +03:00
Dmitry Petrov
a974ed1049 Support custom accessors for top-level properties in scripts. 2017-01-26 10:12:13 +03:00
Dmitry Petrov
ab2448307e Functions imported from objects should be properly mapped to "real" suspend function descriptors. 2017-01-26 09:39:53 +03:00
Dmitry Petrov
9d4047f5e4 Calls for suspend functions imported from object should be checked in CoroutineSuspendCallChecker. 2017-01-26 09:39:53 +03:00
Dmitry Petrov
500667ff45 Function and property descriptors imported from object should keep track of the original imported descriptor,
otherwise they break an assumption that 'getOriginal()' chain would eventually converge on some callable descriptor.
2017-01-26 09:39:53 +03:00
Ilya Gorbunov
b1b295f00f Fix variance of Map.minus in expected diagnostics output. 2017-01-26 07:27:00 +03:00
Ilya Gorbunov
c00d684ece Fix deprecared API usages in test 2017-01-26 04:31:20 +03:00
Mikhail Zarechenskiy
b0c3c7463b Fix internal compiler error about arithmetic exception
#KT-8264 Fixed
2017-01-26 03:39:50 +03:00
Kirill Rakhman
ca86dbee72 Android: Add intention to generate View constructor convention
Fixes #KT-15150
2017-01-26 00:56:33 +03:00
Kirill Rakhman
f74c0950d2 use property syntax 2017-01-26 00:56:33 +03:00
Ilya Gorbunov
384b6410f2 New minus overloads appears in quickfix test data 2017-01-25 22:08:48 +03:00
Ilya Gorbunov
2e0209395a Restore Map.minus(key/keys) and Map.minusAssign(key/keys) operators.
#KT-13353
2017-01-25 22:08:46 +03:00
Ilya Gorbunov
288e0b3c7e Allow to use Regex matches CharSequence and CharSequence matches Regex in infix form
#KT-14279
2017-01-25 21:31:42 +03:00
Ilya Gorbunov
387564d140 JS: Rewrite RegExpMatch without @nativeGetter 2017-01-25 21:29:53 +03:00
Ilya Gorbunov
03019dc638 Deprecate qunit (with ERROR) and jquery (with WARNING) 2017-01-25 21:29:53 +03:00
Ilya Gorbunov
70f3cee9ff Harden deprecations to prepare for cleanup. 2017-01-25 21:29:53 +03:00
Ilya Gorbunov
1ccc655cdc Harden deprecation level on remaining API in java.util in kotlin-stdlib-js 2017-01-25 21:29:53 +03:00
Simon Ogorodnik
3948c1e007 KT-15153 Support typeAlias extensions in completion and add import
#KT-15153 fixed
2017-01-25 20:47:48 +03:00
Dmitry Jemerov
9bc45a9c91 Correctly dispose KotlinCoreEnvironment after use 2017-01-25 17:30:10 +01:00
Alexey Andreev
1c8478e46b JS: fix translation of enum entries without parentheses that call secondary constructors, constructors with default parameters and varargs. See KT-15900, KT-14097 2017-01-25 18:09:23 +03:00
Alexey Andreev
0f87320f9e JS: regenerate test data 2017-01-25 18:09:23 +03:00
Alexey Andreev
31c758994d JS: remove diagnostic about callable reference to built-in 2017-01-25 18:09:22 +03:00
Alexey Andreev
ad4fb44827 JS: report about using of external interfaces in class literals 2017-01-25 18:09:22 +03:00
Alexey Andreev
deaac83e70 JS: report about wrong module usage in class literals. See KT-15253 2017-01-25 18:09:21 +03:00
Alexey Andreev
f52eebd302 Add extension point for back-ends to perform platform-specific checks of class literals 2017-01-25 18:09:21 +03:00
Alexey Andreev
9000d54d8a JS: when checking calls to JsModule declarations, check arguments passed to reified type parameters. See KT-15253 2017-01-25 18:09:20 +03:00
Mikhael Bogdanov
4c7a07bed6 Optimize defaults format: avoid reduntant stack normalization operations 2017-01-25 15:56:56 +01:00
Mikhael Bogdanov
fc4be17623 Fix for KT-14966: Regression: VerifyError on access super implementation from delegate
#KT-14966 Fixed
2017-01-25 15:56:55 +01:00
Mikhael Bogdanov
11578c602e Added inline tests for jvm 8 target 2017-01-25 15:56:55 +01:00
Simon Ogorodnik
32f1ce7551 Added "kotlin.reflect.jvm.internal" to excluded from completion and auto imports list 2017-01-25 17:45:59 +03:00
Simon Ogorodnik
e220a20eed KT-15796 Import of class referenced only in KDoc not preserved after copy-paste
#KT-15796 fixed
2017-01-25 17:41:26 +03:00
Simon Ogorodnik
4ca10c61fd KT-11308 Hide kotlin.jvm.internal package contents from completion and auto-import
#KT-11308 fixed
2017-01-25 17:39:36 +03:00
Simon Ogorodnik
5c52bdc684 KT-14859 "Parameter Info" doesn't work properly in one case
#KT-14859 fixed
2017-01-25 17:32:57 +03:00
Ilya Chernikov
e3338c1e31 Fix testdata 2017-01-25 15:29:15 +01:00
Ilya Chernikov
ec7e8873f4 Update daemon client with wrappers for basic compiler API
Other changes to extract results for compiler, tests.
2017-01-25 15:29:15 +01:00
Nikolay Krasko
afd0655776 Fix after review 2017-01-25 17:19:53 +03:00
Nikolay Krasko
c525a59df8 Make breakpoints work in suspend functions 2017-01-25 16:46:35 +03:00
Nikolay Krasko
649ec9a73d Check that breakpoints work in suspend function without suspension points 2017-01-25 16:46:33 +03:00
Nikolay Krasko
1a3d333da1 Add diagnostic for null error in KotlinClsStubBuilder 2017-01-25 16:46:32 +03:00
Mikhail Glukhikh
d13978e64f Change log 1.1-RC (preliminary) 2017-01-25 15:27:19 +03:00
Alexey Sedunov
983ad55357 Code Insight: Preserve identifier quotes in "Generate equals()/hashCode()/toString()" actions
#KT-15883 Fixed
2017-01-25 14:24:51 +03:00
Alexey Sedunov
7382d7c7d6 Extract Function: Add 'suspend' modifier if extracted function contains suspend-calls
#KT-14704 Fixed
2017-01-25 14:24:49 +03:00
Alexey Sedunov
41f5a3e864 Support "Change parameter type" for parameters with type-mismatched default value
#KT-15627 Fixed
2017-01-25 14:24:48 +03:00
Denis Zharkov
ba0f8b908f Fix Kotlin bytecode toolwindow showing wrong code for suspend functions
Use binding context from the full resolve, because otherwise control-flow
analysis is not being run, that is very important for suspend functions
(tail-call optimizations)

 #KT-15827 Fixed
2017-01-25 14:22:40 +03:00
Alexey Andreev
e15b2b0dd0 Fix compilation of project 2017-01-25 14:15:23 +03:00
Mikhail Glukhikh
426619e47c Change log from 1.1-Beta added to master branch 2017-01-25 14:02:05 +03:00
Denis Zharkov
9ce3880ac6 Support getValue/setValue/provideDelegate suspend functions in JVM backend
- Determine if there are non-tail calls to getValue/setValue simply
by existance of such a property
(it might be too strict, but implementing more granular check may be rather hard)

- Change in ExpressionCodegen is relevant for provideDelegate,
that in case of local variables uses OnStack as StackValue
(see the comment near these changes)

 #KT-15933 Fixed
2017-01-25 13:54:01 +03:00
Denis Zharkov
9ca9a988a6 Fix accessor generation for suspend functions
1. JVM view of suspend accessors must be also an instance of AccessorForFunctionDescriptor,
thus `createSubstitutedCopy` should be correctly overidden.

2. accessibleFunctionDescriptor should unwap the initial suspend descriptor,
for the same reasons as for type aliases constructors and etc:
these descriptors are used as keys of the map of accessors, so
to avoid duplication for suspend view and initial suspend descriptor,
we always use the latter one as a key.

 #KT-15907 Fixed
 #KT-15935 Fixed
2017-01-25 13:54:01 +03:00
Denis Zharkov
0693bd6b62 Fix codegen issue on suspend functions with receiver
When the extension receiver of a named suspend function was marked as used
from the inner lambda, codegen used to throw a "Don't know how to generate outer expression for class" exception.

It may seem quite tricky, but currently for suspend lambda body
its extension receiver is treated as it's defined inside the relevant "doResume"
(there is an actual bytecode part that fills the relevant local variable)

The problem was that inside ExpressionCodegen for "doResume" of named
suspend function we couldn't determine that original function has
an extension receiver.

 #KT-15821 Fixed
 #KT-15820 Fixed
2017-01-25 13:54:01 +03:00
Denis Zharkov
131c008ba3 Minor. Refine naming for original suspend lambda descriptors
Also inline some methods with single usage
2017-01-25 13:54:01 +03:00
Denis Zharkov
02b40326cc Fix incorrect coroutines codegen behavior
If all the suspension calls in a suspend function were "hidden"
under the for-convention (iterator/next/hasNext) calls,
control-flow didn't find them, thus supposing that there is no
suspension points and there is no need to generate a coroutine state machine

The solution is to add relevant calls to CFG

 #KT-15824 Fixed
2017-01-25 13:54:01 +03:00
Alexey Andreev
8cbea903f4 JS: add checker that checks if JsQualifier has wrong format 2017-01-25 13:52:19 +03:00
Alexey Andreev
ba65e58fdd JS: add checker to detect non-external declarations in files marked by JsModule or JsQualifier annotation 2017-01-25 13:52:19 +03:00
Alexey Andreev
cc67f6c9f7 JS: add support of JsQualifier annotation. See KT-15905 2017-01-25 13:52:18 +03:00
Alexey Andreev
6624736ccf JS: fix is check on Throwable instances 2017-01-25 13:52:18 +03:00
Alexey Andreev
aef7b83932 JS: fix toString in case of kotlin.Throwable 2017-01-25 13:52:17 +03:00
Alexey Andreev
6b2f1ba4e4 JS: move couple of helper functions from TranslationUtils to JsDescriptorUtils 2017-01-25 13:52:17 +03:00
Alexey Andreev
115f6ced87 JS: fix support of throwable constructors without message and/or cause parameters 2017-01-25 13:52:16 +03:00
Alexey Andreev
6f4d8decc7 JS: add support of custom exceptions inherited from kotlin.Throwable that call super constructor from secondary constructor 2017-01-25 13:52:16 +03:00
Alexey Andreev
f34093db9f JS: make kotlin.Throwable = Error. See KT-15312 2017-01-25 13:52:13 +03:00
Alexey Andreev
c565697e77 JS: refactor FunctionIntrinsic 2017-01-25 13:51:54 +03:00
Alexey Andreev
0a9c536c01 JS: make defensive copy of argument list in JsInvocation and JsNew constructor 2017-01-25 13:51:53 +03:00
Alexey Andreev
51e5b5aac7 JS: allow to inherit external class from kotlin.Throwable. See KT-15336 2017-01-25 13:51:53 +03:00
Anton Bannykh
847ec9e550 JS: fixed subSequence in CharSequence descendants (KT-14035) + added support for function intrics in delegation 2017-01-25 12:59:53 +03:00
Vyacheslav Gerasimov
4fe040eeb9 Fixed several bugs in Android lint ApiDetector (KT-15002, KT-12024, KT-14737, KT-14825, KT-12023, KT-15018)
Merged IntelliJApiDetector to ApiDetector

#KT-15002 Fixed
#KT-12024 Fixed
#KT-14737 Fixed
#KT-14825 Fixed
#KT-12023 Fixed
#KT-15018 Fixed

(cherry picked from commit e830e8b55f)
2017-01-25 10:50:36 +03:00
Vyacheslav Gerasimov
d0f1b81bfa Fixed bugs in Kotlin Android Lint CleanupDetector
#KT-14780 Fixed
#KT-14677 Fixed

(cherry picked from commit f591b4958e)
2017-01-25 10:50:35 +03:00
Mikhail Zarechenskiy
68b223211c Fix bogus integer overflow warning for 'mod' operator
#KT-15875 Fixed
2017-01-25 02:24:28 +03:00
Ilya Gorbunov
f9e552e3c2 Build kotlin-stdlib in addition to kotlin-runtime in ant build. 2017-01-24 22:38:05 +03:00
Ilya Gorbunov
a2bd3bfc7b List artifacts explicitly for test. 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
43003cffbb Make kotlin-runtime dependency optional for kotlin script executor for maven, but still add if it's found. 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
070f9d9d17 Binary compatibility validation: dump public API of merged stdlib to another file 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
4da4de1104 Replace kotlin-runtime with kotlin-stdlib, where it was used as a dependency. 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
e025050dd9 Replace kotlin-runtime with kotlin-stdlib in kotlin-script-util and its tests 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
19dd7ee09e Build kotlin-test after kotlin-stdlib, build kotlin-test sources with kotlin-stdlib tests again 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
a0cfd8d35e Change builtins module name to kotlin-runtime to match that of maven built artifact. 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
7ccaa77c5b Shade kotlin-runtime into kotlin-stdlib 2017-01-24 22:04:46 +03:00
Ilya Gorbunov
8e9bbe276c JS: Make Date.getTime return Double instead of Int.
#KT-4141 Fixed
2017-01-24 21:55:48 +03:00
Alexey Andreev
46d251df1b JS: deprecate noImpl 2017-01-24 20:18:42 +03:00
Alexey Andreev
5243b451f7 JS: replace noImpl with definedExternally in hand-written stdlib 2017-01-24 20:18:42 +03:00
Alexey Andreev
c05870b461 JS: regenerate stdlib 2017-01-24 20:15:22 +03:00
Alexey Andreev
a9069d8973 JS: replace noImpl with definedExternally in stdlib generator 2017-01-24 20:15:21 +03:00
Alexey Andreev
c9a190b405 JS: regenerate stdlib sources from IDL 2017-01-24 20:15:19 +03:00
Alexey Andreev
e3da9066c4 JS: replace noImpl with definedExternally in IDL2K 2017-01-24 20:14:32 +03:00
Alexey Andreev
26abc19aa6 JS: replace noImpl with definedExternally in diagnostics and their messages 2017-01-24 20:14:32 +03:00
Alexey Andreev
aedf8bd232 JS: replace noImpl with definedExternally in tests 2017-01-24 20:14:31 +03:00
Alexey Andreev
71a5d8a4ee JS: add definedExternally property as a replacement for noImpl, support it in checkers. See KT-15144 2017-01-24 20:14:31 +03:00
Alexey Andreev
26a3ac5a9b JS: fix translation of delegated local variables in coroutines. See KT-15834 2017-01-24 20:13:53 +03:00
Alexey Andreev
8040d781b4 JS: fix translation of suspend lambda when it's not passed to another function 2017-01-24 20:13:53 +03:00
Alexey Andreev
1a5e0e4b06 JS: improve performance of suspend function calling suspen function when no suspension ever occur. 2017-01-24 20:12:12 +03:00
Alexey Andreev
bf55744e64 JS: fix translation of safe calls if suspend functions. See KT-15892 2017-01-24 20:11:55 +03:00
Alexey Andreev
2adaaf5e9f JS: recognize LANGUAGE_VERSION directive in testData 2017-01-24 20:11:30 +03:00
Alexey Andreev
9aeba1d5cf JS: fix names in stdlib and tests WRT to new mangling algorithm 2017-01-24 20:11:29 +03:00
Alexey Andreev
2ae46ceb4b JS: change how signature for mangling is generated, taking into account more information. See KT-15285 2017-01-24 20:10:17 +03:00
Alexey Andreev
119bf52adf JS: fix translation of callable reference to property of outer class with private setter 2017-01-24 20:09:32 +03:00
Alexey Andreev
d35ddc1017 JS: unmute tests that now pass 2017-01-24 20:09:32 +03:00
Alexey Andreev
d261f8eddf Move generation of fake call to common CodegenUtil to share between JS and JVM 2017-01-24 20:09:31 +03:00
Alexey Andreev
c100826629 JS: reduce number of functions to create callable references 2017-01-24 20:09:31 +03:00
Alexey Andreev
dcb8b7b92c JS: fix inlining of callable references 2017-01-24 20:09:30 +03:00
Alexey Andreev
7a0f75f164 JS: refactor generation of callable references to functions 2017-01-24 20:09:29 +03:00
Alexey Andreev
1b0648a926 JS: refactor generation of property callable references 2017-01-24 20:09:29 +03:00
Sergey Mashkov
66de78e82a kotlin-test: migrate multiplatform integration test to use common test module 2017-01-24 19:39:05 +03:00
Sergey Mashkov
e500eba59f Maven: test js compiler test scope dependencies 2017-01-24 19:39:05 +03:00
Ilya Gorbunov
5a28e8cc20 Install kotlin-test artifacts to local repo when testing maven plugin 2017-01-24 19:39:05 +03:00
Ilya Gorbunov
609405b8d4 Add kotlin-test-js dependency where required. 2017-01-24 19:39:05 +03:00
Ilya Gorbunov
7d9554b6b8 Remove sources.xml and maven-assembly-plugin execution. 2017-01-24 19:39:05 +03:00
Ilya Gorbunov
d3ed55549a Make dependency on kotlin-test-common optional, i.e. non-transitive. 2017-01-24 19:39:05 +03:00
Ilya Gorbunov
9b9852cdc9 kotlin-test: rename shared module to common.
Do not use shared kotlin-test while building js stdlib.
2017-01-24 19:39:05 +03:00
Dmitry Petrov
5ef27f7ad3 KT-15010 Missing error on an usage non-constant property in annotation default argument 2017-01-24 17:52:52 +03:00
Mikhael Bogdanov
df8394bcd2 Fix for KT-14597: "When" over smartcasted enum is broken and breaks all other "when"
#KT-14597 Fixed
2017-01-24 15:17:47 +01:00
Dmitry Petrov
ee9a174c1f KT-7897 Do not require to call enum constructor for each entry if all parameters have default values
Do not report an error on enum entry without initializer if all parameters have default values
(error is still reported if there is no such constructor, or if the constructor call is ambiguous).

Record resolved call on KtEnumEntry.

NB is the enum entry has a corresponding subclass, we still have to generate the "default" constructor call,
because FE doesn't know about the platform-specific representation of that class and its constructors.

See also KT-14097, KT-15900
2017-01-24 16:59:47 +03:00
Nikolay Krasko
d13c34200b Remove method deprecated in 171 and explicitly set mainClass before calling toCommandLine() 2017-01-24 16:43:22 +03:00
Mikhail Glukhikh
fb913bc071 Operator to function: mod --> rem, modAssign --> remAssign #KT-15874 Fixed 2017-01-24 15:19:36 +03:00
Mikhail Glukhikh
bfb31a465f Quick-fix to add 'suspend' to the containing function #KT-15800 Fixed 2017-01-24 15:17:55 +03:00
mglukhikh
96cddb6b7b False positive in "Remove redundant let" fixed #KT-15884 Fixed 2017-01-24 15:17:48 +03:00
mglukhikh
be75ef919e Change visibility modifier: now works on no-modifier type aliases #KT-15066 Fixed 2017-01-24 15:17:41 +03:00
Mikhail Glukhikh
60fcdeb5ee Test added: suppress on function reference #KT-15839 Obsolete 2017-01-24 14:59:53 +03:00
shiraji
d9ec8a92f2 KT-15553 Support compile constant for "Copy concatenation text to clipboard"
#KT-15553 Fixed
2017-01-24 14:33:52 +03:00
Kirill Rakhman
909007d984 Add inspection for private primary constructors in data classes
Fixes #KT-15709
2017-01-24 14:08:05 +03:00
mglukhikh
f64345634b WHEN_ENUM_CAN_BE_NULL_IN_JAVA is no more reported after smart cast to not-null #KT-15201 Fixed 2017-01-24 13:51:15 +03:00
mglukhikh
b53ebd115b Pattern matching: work-around for smart cast target type instability #KT-14705 Fixed 2017-01-24 13:51:14 +03:00
Alexey Andreev
bc0550d7b7 JS: don't report about inline modifier on inline extension fun to external class 2017-01-24 12:27:02 +03:00
Alexey Andreev
0ca2ae7279 JS: regenerate Kotlin JS bindings from IDL files with new rules 2017-01-24 12:27:01 +03:00
Alexey Andreev
36d2a91057 JS: prevent IDL2K from generating @nativeGetter/@nativeSetter annotations, generate inline extension function with asDynamic() instead 2017-01-24 12:27:01 +03:00
Alexey Andreev
c1838d423b JS: transfer all empty statement simplifications RedundantLabelRemoval to EmptyStatementElimination, so that empty statements can be eliminated everywhere, not in labeled blocks only. 2017-01-24 12:26:21 +03:00
Alexey Andreev
ac0df8eef9 JS: when recursive local function does not capture variables, give it name from top-level scope. See KT-15770 2017-01-24 12:25:23 +03:00
Alexander Udalov
70d2296e61 Update public API dump after adding KPropertyN.getDelegate 2017-01-24 10:59:44 +03:00
Ilya Gorbunov
a603de8bd7 Ensure string to number conversion fails on empty and blank inputs.
#KT-4497
2017-01-24 07:22:58 +03:00
Ilya Gorbunov
4018d10bf6 Deprecate parseInt and parseFloat. Replace deprecated usages in tests.
#KT-4497
2017-01-24 07:22:51 +03:00
Ilya Gorbunov
4e5e14c9a0 Provide string-to-number conversions in JS and common stdlib.
Relates to #KT-8286
#KT-4497 Fixed
2017-01-24 07:20:57 +03:00
Mikhail Zarechenskiy
2cac6a9e7d Improve inference on generics for callable references
#KT-10711 Fixed
 #KT-12802 Fixed
 #KT-12964 Fixed
 #KT-15439 Fixed

Analyze callable references in `dependent` mode, then complete them with
respect to expected types
2017-01-24 02:15:26 +03:00
Anton Bannykh
07bb7ef4d3 JS: extension lambdas translated same as local lambdas (KT-13312 fixed) 2017-01-23 20:09:36 +03:00
Dmitry Petrov
5021be351d KT-15878 Extension shadowed by member shouldn't be reported for infix/operator extensions when member is non-infix/operator 2017-01-23 16:46:43 +03:00
Sergey Mashkov
98075c17c9 kotlin-test: extract from JS library, convert to multiplatform 2017-01-23 15:43:02 +03:00
Alexey Sedunov
c264de5795 Project Settings: Expose API version setting in Kotlin compiler configuration UI 2017-01-23 15:16:14 +03:00
Alexey Sedunov
57c27299dd JPS: Use facet configuration to determine if module should be compiled to JS 2017-01-23 15:16:12 +03:00
Alexey Sedunov
7b12a66b21 Kotlin Facet: Warn about libraries configured for non-current platform
#KT-15628 Fixed
2017-01-23 15:16:11 +03:00
Alexey Sedunov
597068a704 Kotlin Facet: Import API version from Maven
#KT-15772 Fixed
2017-01-23 15:16:10 +03:00
Alexey Sedunov
fc9b001ccd Kotlin Facet: Use project settings by default
#KT-15624 Fixed
2017-01-23 15:16:09 +03:00
Alexey Sedunov
b35eba0621 Kotlin Facet: Annotate CompilerSettings properties with @JvmField to make them available for copyBean()
#KT-15621 Fixed
 #KT-15623 Fixed
2017-01-23 15:16:08 +03:00
Roman Elizarov
07dc937e2e typo if start/createCoroutine docs fixed 2017-01-23 14:25:04 +03:00
Zalim Bashorov
76a20fc104 Minor: fix copyright in polyfills.js 2017-01-23 14:14:16 +03:00
Zalim Bashorov
4f36e9af08 Minor: remove extra comment block with copyright 2017-01-23 14:14:15 +03:00
Zalim Bashorov
cd04e794ee KJS: class MathClass -> object Math 2017-01-23 14:14:13 +03:00
Zalim Bashorov
cb210b6c78 KJS: fix stub consistency test which was broken after JsonClass was renamed and transformed to object
`kotlin.js.Console` is used instead of `kotlin.js.JSON` to avoid problems on case-sensitive filesystems since right now we also have `kotlin.js.Json` (will be removed later)
2017-01-23 14:13:58 +03:00
Mikhail Glukhikh
b7fb45f36e DFA: only stable values or qualified with stable receiver can be bound in x = y #KT-15792 Fixed 2017-01-23 13:38:24 +03:00
Mikhail Glukhikh
905e67e713 Data flow information: take language version into account while processing safe calls and bound values #KT-14350 Fixed 2017-01-23 13:38:24 +03:00
Alexander Udalov
ebd577e52a Introduce KProperty{1,2}.getExtensionDelegate
These two functions are supposed to fix an inconvenience in the design of
KProperty{1,2}.getDelegate for extension properties, where you have to pass an
instance of the extension receiver which is going to be completely ignored

 #KT-8384 Fixed
2017-01-23 12:25:36 +03:00
Alexander Udalov
78f2515e95 Introduce KProperty{0,1,2}.getDelegate
#KT-8384 In Progress
2017-01-23 12:25:35 +03:00
Alexander Udalov
f1cd2ee6fd Introduce PropertyDescriptor.isDelegated, write new flag to metadata
#KT-8384 In Progress
2017-01-23 12:25:34 +03:00
Alexander Udalov
76fc3b40d5 Do not consider Kotlin compiler as library in runtime versions checker
Otherwise because there's no Kotlin-Version in its manifest, it's regarded as a
1.0 runtime library which conflicts with 1.1 libraries
2017-01-23 11:30:53 +03:00
Dmitry Petrov
e31e12474f KT-15844
Property with type inferred from getter could access primary constructor parameters inside the getter
(which is incorrect, and caused problems in compilation).
Fix scopes for property descriptor resolution.
'getScopeForMemberDeclarationResolution' in AbstractLazyMemberScope should always return member declaration resolution scope.
Two scopes are required, because both property initializer and property accessors should see property type parameters.
2017-01-23 10:22:34 +03:00
Denis Zharkov
2edcd369a8 Fix inference issue with Stream.collect
See doNotCaptureSupertype test for clarification:
When resolving b.collect(toList()) we're building a common system with
two variables T and R.

The problem was that when introducing the constraint
C<T, Inv<T>> <: C<in String, R> we then were seeing the constraint
T <= in String, and add the constaint T=Captured(in String)

That lead to R=Inv<T>=Inv<Captured(in String)>, and after approximation
R=Inv<in String>, that is not the desirable result (Inv<String> suits here)

But the root problem was that we add captured constaint when projection was from supertype,
that seems to be wrong, and for example Java doesn't do that in the similar situation.

 #KT-11259 Fixed
2017-01-22 13:29:08 +03:00
Alexander Udalov
a18720154c Fix diagnostic test data 2017-01-21 12:59:01 +03:00
Alexander Udalov
fc637eb420 Change runtime component from "Core" to "Main"
This is needed to allow the old compiler have the new runtime libraries in the
classpath. See the previous commit for a more elaborate explanation
2017-01-21 12:57:15 +03:00
Alexander Udalov
139d37cfd0 Support "Main" component in JVM runtime version consistency checker
The point here is to disable the "checkNotNewerThanCompiler" check because it
breaks a real life use case of compiling with an old compiler against the new
runtime library (that may come implicitly as a transitive dependency of another
library). However, to keep the possibility of restoring this check in the
future without backporting the needed changes into the old branches, we now
only perform this check for the "Core" runtime components, and all other checks
-- for "Core" and "Main" runtime components. In the follow-up commit, we change
the runtime component of our libraries to "Main". If we decide we need the
"checkNotNewerThanCompiler" behavior in the future, we can change the runtime
component to "Core", effectively restoring this check in the old compilers
2017-01-21 12:57:14 +03:00
Alexander Udalov
7b4e826650 Enable JVM runtime version consistency checker in 1.1 2017-01-21 12:57:14 +03:00
Ilya Gorbunov
3a1ed41436 Create deprecated MutableList.sort extensions to guide how to replace them.
#KT-15790 Fixed
2017-01-21 03:14:42 +03:00
Dmitry Petrov
6e2ebaa300 KT-12846 Forbid vararg of type 'Nothing' and 'Nothing?' 2017-01-20 17:50:19 +03:00
Mikhail Glukhikh
1f573bb115 EA-92388: Fix of exception in import action creation 2017-01-20 17:39:14 +03:00
Mikhael Bogdanov
818773b7e2 Updated android test configuration 2017-01-20 13:16:58 +01:00
Mikhael Bogdanov
da1b8a02ed Exclude builtins members mapped to java default methods from delegation 2017-01-20 13:16:58 +01:00
Dmitry Petrov
03a697a707 Prohibit renaming operator to another operator on import. 2017-01-20 13:01:39 +03:00
Mikhail Glukhikh
9625c32527 Exhaustive when on sealed trees implemented #KT-13130 Fixed
Also #KT-13227 Fixed
2017-01-20 11:04:54 +03:00
Ilya Gorbunov
3d7bcbdff9 Minor: add two cases for Map.getOrDefault test
Relates to #KT-15610
2017-01-19 22:33:20 +03:00
Ilya Gorbunov
3ec48ab244 Add kotlin.comparisons package to default imports. 2017-01-19 18:21:14 +03:00
shiraji
ad9bf1626f Fix the problem with ConvertPrimaryConstructorToSecondaryIntention for enum #KT-15406 Fixed 2017-01-19 17:57:33 +03:00
Alexey Andreev
245f23e7c2 JS: fix translation of references to external nested classes in files marked with @JsModule. See KT-15797 2017-01-19 16:30:57 +03:00
Dmitry Petrov
5fc8208504 KT-13355: fix Kotlin compilation. 2017-01-19 16:09:29 +03:00
Dmitry Petrov
b36e3bc083 KT-13355
An overridden abstract member with a more specific "return type" than an overridden concrete member
should be explicitly overridden even if the class in question can have abstract members.
2017-01-19 16:09:29 +03:00
Dmitry Petrov
f89de02ff0 OverrideResolver: convert to Kotlin & cleanup. 2017-01-19 16:09:29 +03:00
Dmitry Petrov
7f2085b4e4 OverrideResolver: .java -> .kt 2017-01-19 16:09:29 +03:00
Denis Zharkov
bbb5d4eb0f Fix 1.0-compatibility mode for JDK dependendent built-ins
Do not report UNSUPPORTED_FEATURE if there is no overridden descriptors
E.g. in case of property accessors
2017-01-19 15:20:57 +03:00
Ilya Gorbunov
7696d20adf Deprecate moved reflection 1.1 api with ERROR 2017-01-19 14:07:17 +03:00
Alexey Andreev
af1b7c49b4 JS: insert dummy initializers for property that initialized on init block or in secondary constructors. See KT-8211 2017-01-19 13:20:24 +03:00
Alexey Andreev
a927770935 JS: fix scope of function generated for primary constructor. See KT-15678 2017-01-19 13:09:59 +03:00
Alexey Andreev
daac24b62e JS: prohibit referencing noImpl property from non-external declarations. See KT-15306 2017-01-19 13:09:06 +03:00
Alexey Andreev
199790276b JS: prohibit dynamic values as handlers of property delegates. Prohibit delegation of classes by dynamic values. See KT-15283 2017-01-19 13:07:58 +03:00
Alexey Andreev
a4b2abc7d5 JS: prohibit spread operator and destructuring declaration in dynamic values. See KT-15283 2017-01-19 13:07:57 +03:00
Alexey Andreev
31d0e0b7c4 JS: prohibit .. operation on dynamic type. See KT-15184 2017-01-19 13:07:56 +03:00
Alexey Andreev
e6be418dd3 JS: prevent optimizer from removing access to dynamic property access. See KT-15278 2017-01-19 13:07:56 +03:00
Mikhael Bogdanov
e1bec0df2e Proper generate interval for catch block variable; Fix for KT-15646: InconsistentDebugInfoException when stepping over throw
#KT-15646 Fixed
2017-01-19 09:33:10 +01:00
Denis Zharkov
4ab6b6954d Fix false positive "Null can not be a value of a non-null type"
Inferred type of receiver of orElse  is Optional<T & Any>
Generic descriptor is orElse(E!): E!
Substituted descriptor is orElse(T): T , and that is the problem.

Seems that E!  => (T & Any)!  gets expanded to just T  or T & Any , however it should be expanded to
(T & Any) .. (T & Any)?  => T & Any .. T & Any

T & Any is NotNullTypeParameter(T)

The problem is that (T & Any)?  is expanded to T & Any,
that is seems to be wrong.

 #KT-15236 Fixed
2017-01-19 10:20:35 +03:00
Denis Zharkov
5d4f51d9b6 Refine 1.0-compatibility mode for JDK dependent members
- calls must be prohibited iff they refer to some additonal built in member
- override must be prohibited iff all of the overridden descriptors are additional

Other usages were able to be successfully compiled by 1.0.x

Solution with @Deprecated(level=Error) doesn't work properly, because
deprecation propagates to overridden, thus call 'java.util.ArrayList<String>().stream()'
becomes invalid, while it was correct in 1.0.x

 #KT-15794 Fixed
2017-01-19 10:20:35 +03:00
Dmitry Petrov
b9f9894310 KT-15677 KT-15775
Update parser & descriptor renderer to handle parenthesized types and function types properly.
Resolve annotations in parenthesized types.

AnnotationsImpl.isEmpty() returned false for targeted annotations only
(e.g., 'fun @receiver:Ann C?.foo()').
Properly keep track of targeted annotations.
2017-01-19 09:53:17 +03:00
Ilya Gorbunov
a429992e81 Do not generate headers for JS-only functions. 2017-01-18 22:16:49 +03:00
Łukasz Wojtów
be15dea6b5 Fix typo 2017-01-18 21:51:31 +03:00
Ilya Gorbunov
ed9b9d972c Make 'add' function abstract in AbstractMutableSet in JVM 2017-01-18 20:07:24 +03:00
Mikhail Glukhikh
b6443eed9e Data flow information: stable complex expressions introduced back for brackets / elvis / if / when #KT-13468 Fixed
This reverts commit e515d7f773 and
also commit 1c9f08e986

(cherry picked from commit 9fa155b)
2017-01-18 18:54:08 +03:00
Mikhail Glukhikh
86bc49558d Tests for KT-13468 / KT-13765
(cherry picked from commit 2e4c0b4)
2017-01-18 18:53:55 +03:00
Nikolay Krasko
ffc1624484 Stop using idea isNullOrEmpty function (KT-15786)
#KT-15786 Fixed
2017-01-18 18:36:19 +03:00
Alexander Udalov
4f36376291 Do not report KCLASS_WITH_NULLABLE_ARGUMENT_IN_SIGNATURE anymore
It was only reported in already erroneous cases
2017-01-18 18:21:30 +03:00
Alexander Udalov
d02404b07b Report error on expression of nullable type in class literal
#KT-15740 Fixed
2017-01-18 18:21:29 +03:00
Alexander Udalov
6a352a1da7 Report error on nullable type alias in class literal
#KT-15736 Fixed
2017-01-18 18:21:28 +03:00
Zalim Bashorov
284b9d2ba6 KJS: make deep copy of additional arguments before expose them in KotlinFunctionIntrinsic 2017-01-18 14:43:33 +03:00
Zalim Bashorov
ca2930600a KJS: introduce $kotlin_test_internal$ to expose some helper functions in the tests 2017-01-18 14:42:40 +03:00
Zalim Bashorov
bbd69a05dc KJS: make JSON object and allow to pass null to stringify methods 2017-01-18 14:41:22 +03:00
Zalim Bashorov
1b09fa29fb Fix maven build 2017-01-18 14:40:57 +03:00
Zalim Bashorov
8cf44e9f36 KJS: increase ABI version 2017-01-18 14:40:56 +03:00
Zalim Bashorov
cfba99c704 KJS: remove unused polyfill String.prototype.contains 2017-01-18 14:40:55 +03:00
Zalim Bashorov
264e319487 KJS: type -> kind 2017-01-18 14:40:54 +03:00
Zalim Bashorov
70423e8129 KJS: remove obsolete classIndex 2017-01-18 14:40:51 +03:00
Zalim Bashorov
be694d53ef KJS: trait -> interface 2017-01-18 14:40:50 +03:00
Zalim Bashorov
c6f0d0fa59 KJS: split kotlin_* files to several files 2017-01-18 14:40:49 +03:00
Zalim Bashorov
d635d7859e KJS: remove obsolete kotlin.modules 2017-01-18 14:40:48 +03:00
Zalim Bashorov
3ef1321841 KJS: implement throw* functions in Kotlin 2017-01-18 14:40:47 +03:00
Zalim Bashorov
6f56079f7e KJS: add external declaration for parseFloat; remove obsolete safeParseInt and safeParseDouble 2017-01-18 14:40:46 +03:00
Zalim Bashorov
d0c7c8022e KJS: remove obsolete functions from kotlin_lib.js 2017-01-18 14:40:44 +03:00
Zalim Bashorov
6b38b5f5ba KJS: implement array factory function intrinsics in Kotlin 2017-01-18 14:40:42 +03:00
Zalim Bashorov
a71fbda8a1 KJS: remove deprecated splitWithRegex and it's implementation in kotlin_lib.js 2017-01-18 14:25:36 +03:00
Zalim Bashorov
d985d30f91 KJS: reimplement collectionSort in Kotlin 2017-01-18 14:25:36 +03:00
Zalim Bashorov
20c482598a KJS: reimplement Json.add in Kotlin 2017-01-18 14:25:36 +03:00
Zalim Bashorov
edf1c2da0f KJS: reimplement deleteProperty in Kotlin 2017-01-18 14:25:36 +03:00
Zalim Bashorov
6ea6e4ab98 KJS: move println to kotlin.io; import kotlin.io by default in Default platform 2017-01-18 14:25:36 +03:00
Zalim Bashorov
7f10ce072f KJS: move js part of "kotlin.js" and related files to "js.libraries" module 2017-01-18 14:25:36 +03:00
Zalim Bashorov
08e1f757a9 Minor: fix typo 2017-01-18 14:25:36 +03:00
Zalim Bashorov
45b92be1ae KJS: extract string polyfills to separate file 2017-01-18 14:25:36 +03:00
Zalim Bashorov
12a1c63bda KJS: move some files inside js.libraries module 2017-01-18 14:25:36 +03:00
Mikhael Bogdanov
de52a5bc20 Fixed diagnostic message 2017-01-18 11:19:36 +01:00
Denis Zharkov
22ddfed911 Do not load PlatformDependent annotated built-in members with lv=1.0
#KT-15780 Fixed
2017-01-18 13:00:32 +03:00
Mikhael Bogdanov
591de36666 Added deprecated diagnostic for invoking default methods within jvm-target 1.6 2017-01-18 10:50:59 +01:00
Mikhael Bogdanov
7a27a9d51f Propagate 'CompilerConfiguration' to frontend checkers 2017-01-18 10:23:40 +01:00
Mikhael Bogdanov
9b1c258cdf Android test fix 2017-01-18 10:23:40 +01:00
Denis Zharkov
37b364a70a Fix processing of uninitialized instances for coroutines
The problem is that code in the attached test led to VerifyError at runtime
because the Bar's uninitialized instance created in 'map' was being stored
to the field (leaked from the JVM point of view).

The actual problem was that after repeating visiting of NEW operation
we used to drop the set of already visited copy usages.

For clarification see the comment before 'processUninitializedStores'

 #KT-15016 Fixed
2017-01-18 12:00:46 +03:00
Denis Zharkov
630fab1952 Fix signature of accessor for suspend function
It must be a suspend function too to have an additional Continuation parameter

 #KT-15715 Fixed
2017-01-18 12:00:45 +03:00
Denis Zharkov
d0d617b44e Fix signature mapping for default suspend function from interface
Use jvm suspend function view in function codegen.
Also use SUSPEND_FUNCTION_TO_JVM_VIEW slice if the value exists
for the given key

 #KT-15552 Fixed
2017-01-18 12:00:45 +03:00
Denis Zharkov
fae9cc1c63 Fix codegen issue of safe-qualified suspension points
#KT-15527 Fixed
2017-01-18 12:00:44 +03:00
Denis Zharkov
8cf8e0fce0 Minor. Extract method 2017-01-18 11:44:21 +03:00
Alexey Tsvetkov
f024f14c1e Fix passing friend paths from Gradle to Kotlin daemon when compiling with IC 2017-01-17 19:18:23 +03:00
Alexey Tsvetkov
58fd2530d2 Pass compiler args from facets when compiling in fallback mode from JPS 2017-01-17 19:18:18 +03:00
Ilya Chernikov
3fcbc7bfa3 Rollback commit with native platform lib relocation - it seems breaks functionality on Windows
(cherry picked from commit d3ff19e)
2017-01-17 14:30:28 +01:00
Alexander Udalov
8499db1f42 Update JvmMetadataVersion to 1.1.3
This is needed because 1.1.2 binaries are considered pre-release (see
DeserializedDescriptorResolver), so it wasn't possible to compile
non-pre-release binaries with -language-version 1.0
2017-01-17 15:00:52 +03:00
Yan Zhulanow
5adc3bacff SamWithReceiver: Call onContainerComposed() properly for module dependencies as well. Inject SamWithReceiverResolver by instance. 2017-01-17 20:39:28 +09:00
Alexey Sedunov
75e76dda54 Kotlin Facet: Do not reset configuration if "Use project settings" is switched on
#KT-15735 Fixed
2017-01-16 18:27:30 +03:00
Alexey Sedunov
aeb6af546f Kotlin Facet: Switch off "Use project settings" on Maven/Gradle import
#KT-15682 Fixed
2017-01-16 18:27:29 +03:00
Denis Zharkov
9f217de10b Write kotlin metadata on class-files for coroutine state machines
Otherwise it breaks JPS assumptions, that leads to exceptions like:
Error:Kotlin: [Internal Error] java.lang.AssertionError: Couldn't load KotlinClass from /Users/jetbrains/IdeaProjects/KotlinPlaygroundBeta11/out/production/KotlinPlaygroundBeta11/Counter$both$1.class; it may happen because class doesn't have valid Kotlin annotations
    at org.jetbrains.kotlin.build.GeneratedJvmClass.<init>(generatedFiles.kt:36)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.getGeneratedFiles(KotlinBuilder.kt:469)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.doBuild(KotlinBuilder.kt:241)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.build(KotlinBuilder.kt:140)
...
2017-01-16 17:53:15 +03:00
mglukhikh
93b2c56bb4 Fixed KNPE in convert primary constructor to secondary #KT-14745 Fixed 2017-01-16 17:35:51 +03:00
Dmitry Petrov
cd33a40612 KT-15734
Combine nullability for nested type alias expansion result.
2017-01-16 17:26:28 +03:00
Dmitry Petrov
954204da82 KT-1560
Report warning on extensions shadowed by members.
2017-01-16 17:25:13 +03:00
Nikolay Krasko
ded7d5911b Fix tests
Addition to 5d08e82aaf
2017-01-16 16:05:02 +03:00
Roman Elizarov
25739a08ea CoroutineContext Key and Element are now inside CoroutineContext interface itself (just like Map.Entry)
ContinuationInterceptor companion object is named Key
CoroutineContext.Element property for key is named just key
AbstractCoroutineContextElement implements all of CoroutineContext.Element, including key
2017-01-16 14:33:02 +03:00
Nikolay Krasko
ea7fac07c4 Ban import member intentions from import directives (KT-13710)
#KT-13710 Fixed
2017-01-16 13:00:50 +03:00
Nikolay Krasko
ad72918ff9 Remove deprecated ConcurrentWeakValueHashMap 2017-01-16 13:00:48 +03:00
Nikolay Krasko
5d08e82aaf Fix look up for breakpoint in crossinline lambdas in android (KT-15282)
#KT-15282 Fixed
2017-01-16 13:00:46 +03:00
Mikhail Glukhikh
b94c62649a Create header implementation: select among modules only with configured source roots #KT-15641 Fixed 2017-01-16 11:31:07 +03:00
Ilya Gorbunov
07e529c8ec Fix completion test: expected appearance of 'takeIf' and 'also' 2017-01-16 09:32:17 +03:00
Ilya Gorbunov
914c55b57f Refactor: use new functions in stdlib code 2017-01-16 09:31:45 +03:00
Ilya Gorbunov
1ae56c374f Introduce new function 'takeIf' to replace value with null if it doesn't match the predicate.
#KT-7858
2017-01-16 05:58:51 +03:00
Ilya Gorbunov
1ac9815d76 Introduce new scope function: 'also'. Works like 'apply' but with 'it' instead of 'this' inside lambda.
#KT-6903
2017-01-16 05:58:51 +03:00
Stanislav Erokhin
0ef1234f2e Added special error for incorrect KClass type in signatures. 2017-01-16 05:44:46 +03:00
Ilya Gorbunov
3d70d73964 Rename file class CoroutinesLibraryKt to CoroutinesKt 2017-01-15 20:57:11 +03:00
Yan Zhulanow
1fb90ac0fd Copy compiler arguments from iml even if "Use project settings" checkbox is checked. This is deadly needed for the compiler plugins no-arg and all-open, assuming that the default state of the checkbox is "on". (KT-15686, KT-15686).
This is a temporary fix, and it should be reverted when "Use project settings" will be disabled by default in modules imported from external build tools (Maven, Gradle).
2017-01-15 22:11:11 +09:00
Yan Zhulanow
50a7164efe Kapt3, Gradle: Fix kapt execution in tests. Check filtered dependencies list properly (KT-15459) 2017-01-15 22:11:11 +09:00
Yan Zhulanow
ec291455fa Kapt3: Replace error/NonExistentClass with the actual type (from PSI) (KT-15421) 2017-01-15 22:11:11 +09:00
Yan Zhulanow
ee57446397 Kapt3, Gradle: Prevent circular dependency between kapt and kotlinCompile tasks (KT-15713) 2017-01-15 22:11:11 +09:00
Yan Zhulanow
c136498cc0 Minor: Add uast-kotlin to 'idea' module classpath (fix failing Lint tests) 2017-01-15 22:11:10 +09:00
Ilya Gorbunov
9f303ed06e Migrate to new coroutines API, rename Iterator implementation, annotate new API with SinceKotlin. 2017-01-14 20:14:06 +03:00
Ilya Gorbunov
ffb183a2f3 Move a bit of bytecode out of next() 2017-01-14 20:14:05 +03:00
Ilya Gorbunov
560c184fd4 Merge AbstractIterator and SequenceBuilder, remove hasNext call from next. 2017-01-14 20:14:03 +03:00
Ilya Gorbunov
141ad43039 Introduce buildSequence and buildIterator functions based on coroutines. 2017-01-14 20:14:01 +03:00
Ilya Gorbunov
3225ec8935 Provide headers for coroutine building blocks 2017-01-14 20:14:00 +03:00
Denis Zharkov
14f942aca7 Refine ABI for coroutine lambdas
Make their invoke work in the same way as any other suspend function:
it should return SUSPENDED_MARKER iff. it indeed became suspended
2017-01-14 19:51:05 +03:00
Denis Zharkov
85a3fefcc6 Get rid of SuspendFunctionX interfaces
Use a pair of effectively abstract methods in CoroutineImpl instead
2017-01-14 15:13:37 +03:00
Denis Zharkov
d346cbbe61 Update test data for light-analysis/coroutines 2017-01-14 15:13:37 +03:00
Denis Zharkov
c7f76d7ec8 Minor. Fix tests after CoroutineContext introduction 2017-01-14 15:13:36 +03:00
Denis Zharkov
6a1ad3a279 Get rid of unnecessary additional declarations in tests 2017-01-14 13:24:53 +03:00
Ilya Gorbunov
2dfcb490a5 Fix CoroutineContext tests, update public API dump 2017-01-14 13:24:53 +03:00
Roman Elizarov
8d6a913cee CoroutineContext and ContinuationInterceptor (instead of dispatcher) 2017-01-14 13:24:53 +03:00
Denis Zharkov
f611e39a69 Fix return keyword completetion tests
Now suspendOrReturn is toplevel, so we should explicitly choose "return" item
2017-01-14 13:24:53 +03:00
Denis Zharkov
f56d9cfb26 Ignore failing coroutine related tests on JS 2017-01-14 13:24:53 +03:00
Denis Zharkov
10e67a9b4e Minor. Run Generate tests 2017-01-14 13:24:53 +03:00
Denis Zharkov
c479aa7d65 JS: simplify how suspend functions inlined 2017-01-14 13:24:53 +03:00
Denis Zharkov
2fcc2bbae0 JS: allow to call suspend function from any position within another suspend function 2017-01-14 13:24:53 +03:00
Denis Zharkov
1f0d0028b2 Minor. Simplify coroutine related code in ExpressionCodegen
After previous change (treating suspend function as they return j/l/Object)
most of existing hacks concerning suspend functions' return type
became unnecessary
2017-01-14 13:24:53 +03:00
Denis Zharkov
2286027bed Fix verify error with 'return when/if/try' in suspend function
The problem appears for tail-optimized suspend functions,
we erroneously assumed that when/if/try expressions in tail-call
position have simple types like `I` while actually, they can return SUSPENDED
object, i.e. must have `java/lang/Object` as return type.

But this only concerns branching operations in tail-call position,
so we have to make an additional analysis for remembering whether
a given expression is in a tail-call position.

Also, it's important here that we now assume
the return type of the current function  as `java/lang/Object`
that is necessary to avoid wrong checkcasts.

 #KT-15364 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
de9c41c412 Fix overridability rules for suspend functions
Treat suspend and non-suspend functions as conflicting

 #KT-15413 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
978f53414f Prohibit local suspend functions
#KT-15392 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
d43a4199f8 Prohibit suspend function type in supertype list
#KT-15391 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
f12409504f Prohibit callable references to suspend functions
#KT-15662 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
695b6d9e67 Minor. Add test on local vars of suspend function type 2017-01-14 13:24:53 +03:00
Denis Zharkov
7837d736f7 Merge RestrictedCoroutineImpl into CoroutineImpl 2017-01-14 13:24:53 +03:00
Denis Zharkov
d487c1ef0f Refine dispatching convention
Dispatching happens only via `suspendWithCurrentContinuation` calls
instead of each `resume` call

 #KT-15657 Fixed
2017-01-14 13:24:53 +03:00
Denis Zharkov
0240ab0738 Support non-tail suspend calls in JVM back-end
#KT-15597 In Progress
2017-01-14 13:24:53 +03:00
Denis Zharkov
a048dde7a5 Support non-tail suspend calls in front-end
#KT-15597 In Progress
2017-01-14 13:24:53 +03:00
Denis Zharkov
2cb9d3a8ad Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER

 #KT-15698 Fixed
2017-01-14 13:24:53 +03:00
Alexey Tsvetkov
e0fa11b0c1 Fix handling OUTPUT message from daemon in JPS client 2017-01-13 22:17:41 +03:00
SuperVlad
5edb872224 Fix for KT-9594 J2K: null cast incorrect conversion.
#KT-9594 fixed
2017-01-13 22:03:24 +03:00
Mikhael Bogdanov
e5b8943d41 Added 'languageVersion' parameter to DiagnosticTestLanguageVersionSettings 2017-01-13 18:01:05 +01:00
Mikhael Bogdanov
b88a9025e0 Don't check DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE when compiling to 1.0 2017-01-13 18:01:05 +01:00
Ilya Gorbunov
80f2efb625 joinTo/joinToString: Do not call toString on elements that are already CharSequence or Char.
#KT-15557
2017-01-13 19:49:57 +03:00
Ilya Gorbunov
0c27e07e8c Improve headers of Appendable and StringBuilder 2017-01-13 19:41:59 +03:00
Ilya Gorbunov
afdc7b94da Add headers for print and println.
#KT-15458 fixed
2017-01-13 19:41:59 +03:00
Ilya Gorbunov
be95f66b13 Minor: remove unnecessary header. 2017-01-13 19:41:59 +03:00
Ilya Gorbunov
cdfb72ab76 Provide protected toArray implementation in AbstractCollection.
Relates to #KT-13898
2017-01-13 19:38:28 +03:00
Mikhael Bogdanov
bbf61664ea Test fix 2017-01-13 14:30:01 +01:00
Mikhael Bogdanov
d8b7c7bc34 Added run configuration for Java 8 test on jdk 9 2017-01-13 13:52:58 +01:00
Mikhael Bogdanov
09eeb414fe New test for jvm8 nondefaults target 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov
d278a5c6d5 Move java 8+defaults tests to separate folder 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov
0a363fd1a5 Introduced test flag: JVM8_TARGET_WITH_DEFAULTS 2017-01-13 13:52:56 +01:00
Mikhael Bogdanov
7f8acbb759 Use proper flag for interface method invocation 2017-01-13 13:52:55 +01:00
Mikhael Bogdanov
0f2139f27d InstructionAdapter.invokeX updated to non-deprecated ones 2017-01-13 13:52:55 +01:00
Mikhael Bogdanov
62514e126d Enable jvm 1.8 platform in cli 2017-01-13 13:52:54 +01:00
Mikhael Bogdanov
b6bf53f96f Revert ' Temporary remove JVM_1_8 target from facet settings' 2017-01-13 13:52:54 +01:00
Sergey Mashkov
a3f5d8e68a KT-15673 Couldn't use header function in 3rd module 2017-01-13 15:34:14 +03:00
Sergey Mashkov
39ad8fb22c Maven: tests support for multiplatform projects 2017-01-13 15:34:13 +03:00
Alexey Sedunov
a9645e1ae9 Extract Superclass: Drop inapplicable modifiers when converting property-parameter to ordinary parameter
#KT-15674 Fixed
2017-01-13 15:17:45 +03:00
Alexey Sedunov
ea7bf6b7c1 Extract Interface: Red-highlight members inherited from a super-interface when that interface reference itself is not extracted
#KT-15598 Fixed
2017-01-13 15:17:44 +03:00
Alexey Sedunov
57d364e7d4 Extract Superclass/Interface: Fix bogus visibility warning inside a member when it's being moved as abstract
#KT-15635 Fixed
2017-01-13 15:17:43 +03:00
Alexey Sedunov
65b9049d59 Extract Interface/Pull Up: Warn about private members with usages in the original class
#KT-15606 Fixed
2017-01-13 15:17:42 +03:00
Alexey Sedunov
1c16d2af1a Extract Superclass/Interface/Pull Up: Reformat modifier lists of generated declarations (to add spaces where needed)
#KT-15639 Fixed
2017-01-13 15:17:41 +03:00
Alexey Sedunov
e10b50a648 Extract Interface/Pull Up: Drop 'final' modifier when moving to an interface
#KT-15640 Fixed
2017-01-13 15:17:39 +03:00
Alexey Sedunov
66f1925f16 Extract Interface/Pull Up: Disable internal/protected members when moving to an interface
#KT-15607 Fixed
2017-01-13 15:17:38 +03:00
Alexey Sedunov
c9781f5014 Extract Interface/Pull Up: Disable "Make abstract" and assume it to be true for primary constructor parameter when moving to an interface
#KT-15643 Fixed
2017-01-13 15:17:37 +03:00
Alexey Sedunov
52e9117e9d Extract Superclass/Interface: Allow extracting class with special name (and quotes)
#KT-15353 Fixed
2017-01-13 15:17:37 +03:00
Alexey Sedunov
5de4e9fdac Pull Up/Extract Interface: Disable "Make abstract" and assume it to be true for abstract members of an interface
#KT-15355 Fixed
2017-01-13 15:17:36 +03:00
Alexey Sedunov
8c882f0d27 Override Members: Allow overriding virtual synthetic members (e.g. equals(), hashCode(), toString(), etc.) in data classes
#KT-15563 Fixed
2017-01-13 15:17:35 +03:00
Alexey Sedunov
862966fd33 Override/Implement Members: Support all nullability annotations respected by the Kotlin compiler
#KT-12704 Fixed
 #KT-15583 Fixed
2017-01-13 15:17:34 +03:00
Alexey Sedunov
d94243ac7b Extract Interface: Disable inline/external/lateinit members 2017-01-13 15:17:33 +03:00
Alexey Sedunov
e67d10c028 Extract Interface/Superclass: Disable "Make abstract" for inline/external/lateinit members
#KT-15602 Fixed
2017-01-13 15:17:32 +03:00
Alexey Sedunov
edf5d7da10 Pull Up: Fix subclass map initialization which prevents pull-up from object to superclass 2017-01-13 15:17:31 +03:00
Alexey Sedunov
6fb943765d Extract Interface/Superclass: Disable const-properties
#KT-15611 Fixed
2017-01-13 15:17:30 +03:00
Alexey Tsvetkov
3d07c40887 Minor: rename CompilationResultSink->CompilationResults 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
bdae0b5efb Fix the build 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
41c5568b74 Minor: add comment 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
7a29c00ec3 Minor: fix typo EventManger->EventManager 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
39b37b85e3 Minor: rename Storage->Sink 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
f027860ac0 Minor: rename CompilationResult->CompilationResultCategory 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
a3415d8d0e Minor: move CompilerMode 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
072edf4b5a Minor: introduce EXCEPTION report category 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
c2a125ff1c Minor: fix naming 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
a56c92f28d Minor rename parameters to match parent constructor 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
2ec9773e15 Minor: fix CompilerMessageSeverity order 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
16352ff2e5 Refactor messages sending 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
e44cc43ada Move CompilerMode and TargetPlatform to CompilationOptions 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
c5a5463f50 Rename AdditionalCompilerArguments->CompilationOptions 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
bf50a23221 Remove operations tracer from compile() interface 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
99c72b6dff Refactor JPS daemon client 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
73f7b76b5d Enable verbose messages when debug is enabled 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
c9a874cba9 Refactor gradle daemon client 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
d4d1d5ad0f Refactor daemon interface 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
d19a92bab5 Make ICReporter interface 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
d80c1ad10d Add integer value to compiler message severity 2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
1fcd7d07e2 Make compiler arguments serializable 2017-01-13 15:08:12 +03:00
Dmitry Petrov
8756f00849 Fix testData for debugger test. 2017-01-13 13:54:07 +03:00
Ilya Chernikov
1e68b2436f Relocate non-native/jni part of net.rubygrapefruit.platform in attempt to fix #KT-15570 2017-01-13 10:48:29 +01:00
Alexander Udalov
2ba18beb89 Report JVM runtime version inconsistency as errors instead of warnings
(cherry picked from commit f8fc7e94ac)
2017-01-13 11:53:52 +03:00
Alexander Udalov
e3f4b6e77e Do not allow to use suspend functions in 1.0.6+ 2017-01-13 11:53:52 +03:00
Dmitry Petrov
4dd100122b Explicitly remove NOPs inserted for bytecode analysis in post-conditional loops.
Remove redundant NOPs during bytecode optimization.

NOP instruction is required iff one of the following is true:
(a) it is a first bytecode instruction in a try-catch block (JVM BE assumption);
(b) it is a sole bytecode instruction in a source code line (breakpoints on that line will not work).
All other NOP instructions can be removed.

Note that it doesn't really affect the performance for mature JVM implementations.
However, the perceived quality of the generated code is somewhat improved :).

Related: KT-15609
2017-01-13 10:31:07 +03:00
Dmitry Petrov
ba933fa887 KT-15112, KT-15631
Revert changes for "tolerant to uninitialized values" in OptimizationBasicInterpreter:
this approach doesn't converge for some specific cases where local variable is reused
(e.g., in several inlined functions - see https://youtrack.jetbrains.com/issue/KT-15112).

Instead, treat fake always-false conditional jump in the beginning of the post-condition loop as a "reference point" for stack on loop break / continue.
This requires an extra abstraction layer in FixStackAnalyzer, since we can't perform fine-grain manipulations on Frames
(such as "combine frame C from local variables of frame A and stack of frame B").

NB additional NOPs will be generated for post-condition loops.
Should make a separate bytecode postprocessing pass to get rid of unnecessary NOPs
(several YT issues for perceived quality of the generated bytecode are about such NOPs).
2017-01-13 10:31:07 +03:00
Mikhail Glukhikh
c09a71b178 Multi-platform refactoring: get rid of PlatformKind (replace with MultiTargetPlatform) 2017-01-12 18:58:13 +03:00
Mikhail Glukhikh
aeb6bff145 Create header implementation fix: check import directive, change / add it if needed 2017-01-12 18:58:07 +03:00
Alexey Andreev
f33d421bab JS: make JS parser to store function's name in AST. See KT-15475 2017-01-12 18:12:40 +03:00
Alexey Andreev
a016147a79 JS: fix translation of return statement surrounded by try..finally block in suspend lambda. See KT-15625 2017-01-12 18:12:39 +03:00
Alexey Andreev
2907eafa18 JS: make functions called call to inline properly. See KT-7004 2017-01-12 18:12:39 +03:00
Alexey Andreev
10a3fbf53f JS: disable TemporaryAssignmentElimination, fix KT-15512 2017-01-12 18:12:39 +03:00
Alexey Andreev
7d170c0fcd JS: fix translation of reassignment of inline properties. See KT-15590 2017-01-12 18:12:38 +03:00
Alexey Andreev
4eed7c1fcb JS: fix translation of augmented assignment in class initializer. See KT-15569 2017-01-12 18:12:38 +03:00
Alexey Andreev
ee74342fbe JS: fix compiler crash when optimizing JS AST with empty do..while statement. See KT-15513 2017-01-12 18:12:37 +03:00
Alexey Andreev
bad6f41d6e JS: make some JVM tests compatible with JS BE 2017-01-12 18:12:37 +03:00
Alexey Andreev
70176dfacc JS: translate call arguments in the order the occur in source code, not in order of parameters in descriptor. See KT-15506 2017-01-12 18:12:36 +03:00
Alexey Andreev
e6b78f68cd JS: support case when class inherits method from superclass and both implements same method (but with optional parameter) from superinterface. 2017-01-12 18:12:36 +03:00
Alexey Andreev
d2050ace72 JS: refactor generation of functions with optional parameters. Fix #KT-7302, #KT-13888 2017-01-12 18:12:35 +03:00
Simon Ogorodnik
4b3cf432dc KT-5629 Quickfix to import extension method when arguments of non-extension method do not match
#KT-5629 fixed
2017-01-12 18:06:31 +03:00
Dmitry Jemerov
f8f73d338b Use UTryStatement.isResources() instead of getting the resource list (for which there is no portable API ATM) 2017-01-12 14:30:49 +01:00
Simon Ogorodnik
0cf02dcb7b KT-15092 Suppress inspection "use property access syntax" for some getters and fix completion for them
#KT-15092 fixed
2017-01-12 14:53:38 +03:00
Nikolay Krasko
c1538aea43 Get annotation for injection from reference descriptor (KT-15548)
#KT-15548 Fixed
2017-01-12 14:21:47 +03:00
Nikolay Krasko
0cbe19b930 Remove unused files 2017-01-12 13:49:31 +03:00
Alexander Udalov
abe2ad155c Sanitize names for script class files
Use the same process that is done for package parts in the JVM back-end, except
adding the "Kt" suffix

 #KT-15225 Fixed
2017-01-12 11:24:24 +03:00
Alexander Udalov
6ffa56b640 Move name sanitization utilities to module 'descriptors' 2017-01-12 11:24:23 +03:00
Alexander Udalov
f4d59304e2 Fix JvmPackageTableTest by preserving package order in ModuleMapping.create 2017-01-12 11:08:23 +03:00
Svyatoslav Scherbina
d9023bdf70 backend: move some JVM lowering to common 2017-01-12 11:56:32 +07:00
Svyatoslav Scherbina
5a5f4fc224 backend: extract common lowering utils 2017-01-12 11:56:31 +07:00
Svyatoslav Scherbina
f85538129d backend: introduce common backend context 2017-01-12 11:56:30 +07:00
Svyatoslav Scherbina
2e88dd0675 backend: fix minor bug in LocalFunctionsLowering
extension receiver parameter should be remapped too
(e.g. to support lambda with receiver)
2017-01-12 11:56:29 +07:00
Svyatoslav Scherbina
e6c9a709b2 backend: fix minor bug in SharedVariablesLowering 2017-01-12 11:56:28 +07:00
Simon Ogorodnik
c5e3f0ad01 KT-15141 Bogus import popup for when function call cannot be resolved fully
#KT-15141 fixed
2017-01-11 22:41:09 +03:00
Simon Ogorodnik
db8edb01c3 KT-14815 alt + enter -> "import" over a constructor reference is not working
#KT-14815 fixed
2017-01-11 22:41:09 +03:00
Simon Ogorodnik
f9b2929bca KT-15154 IllegalStateException on attempt to convert import statement to * if last added import is to typealias
#KT-15154 fixed
2017-01-11 22:41:08 +03:00
Ilya Gorbunov
6273ab5d43 Hold back eachSumOf for a while: fixups.
Remove unneeded import.
2017-01-11 20:04:00 +03:00
Alexander Udalov
edb4fd1dfd Do not emit pre-release flag if -Xskip-metadata-version-check is used
The -Xskip-metadata-version-check command line argument is supposed to be used
to avoid getting errors only; the side effect that it also caused compiler to
write the pre-release flag to binaries was a mistake and is fixed now
2017-01-11 19:28:52 +03:00
Alexander Udalov
8f9ce5d0f2 Fix some issues in script constructor param/arg matching 2017-01-11 19:28:51 +03:00
Alexander Udalov
453c5267ad Fix detection of scripts in cls stub builder 2017-01-11 19:28:51 +03:00
Alexander Udalov
e860d620c6 Add script flag to kotlin.Metadata
This will allow to distinguish compiled scripts from ordinary classes in the
compiler, reflection, IDE, etc.

 #KT-13382 Fixed
2017-01-11 19:28:51 +03:00
Mikhail Glukhikh
7c6d5c825c Join declaration & assignment is no more suggested in case of potential smart cast available #KT-15412 Fixed 2017-01-11 19:10:09 +03:00
Mikhail Glukhikh
31a8689999 Do not count 'impl' or 'header' with implementations as unused #KT-15305 Fixed 2017-01-11 18:37:55 +03:00
Mikhail Glukhikh
586246002c Create header implementation fix: do not use Swing inside write action 2017-01-11 18:37:50 +03:00
Mikhail Glukhikh
b0a333456e Platform header IDE annotation: do not report suppressed error #KT-15601 Fixed 2017-01-11 18:37:44 +03:00
Mikhail Glukhikh
76ee6d7712 Minor: multi-platform highlighting tests rename 2017-01-11 18:37:38 +03:00
Sergey Mashkov
892e36412d IDL2K: KT-15436 js stdlib: org.w3c.fetch.RequestInit has 12 parameters, all required 2017-01-11 18:07:47 +03:00
Sergey Mashkov
099cd819f7 IDL2K: KT-15436 js stdlib: org.w3c.fetch.RequestInit has 12 parameters, all required 2017-01-11 18:07:46 +03:00
Ilya Gorbunov
4816474d70 Hold back eachSumOf for a while. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov
0dfcbdf072 Improve docs, use consistent naming for parameters, rename unused parameters of lambdas to _. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov
04a0f0a036 Rename Grouping.elementIterator to sourceIterator 2017-01-11 16:49:45 +03:00
Ilya Gorbunov
6d3a71c691 Minor refactoring: use mapValuesInPlace optimization, delegate aggregate implementation to aggregateTo. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov
d73744f1c0 Tests for group-and-fold operations 2017-01-11 16:49:45 +03:00
Ilya Gorbunov
2a2b417025 KEEP-23 implement group and fold operations
Docs for group-and-fold operations

Fix implementation for countEach and sumEachBy

countEach and sumEachBy implementations for JS

Rename keySelector to keyOf

Generate additional sources for groupingBy + headers

Rename countEach and sumEachBy to eachCount and eachSumOf.
2017-01-11 16:49:45 +03:00
Mikhail Glukhikh
43a4035390 Clearer diagnostic message for platform type inspection #KT-14630 Fixed 2017-01-11 16:24:10 +03:00
Ilya Gorbunov
3bf38e62c8 Add a note about NaN propagation for floating point specializations. 2017-01-11 14:45:21 +03:00
Ilya Gorbunov
897e9658ac Do not run total order tests on JS 2017-01-11 14:45:19 +03:00
Ilya Gorbunov
0bf2ba8701 Introduce new overloads of max and min to fix NaN propagation behavior on JVM. 2017-01-11 14:45:18 +03:00
Ilya Gorbunov
74331f8eaa Add NaN propagation and total ordering tests. 2017-01-11 14:45:16 +03:00
Ilya Gorbunov
6041a7d6c8 Add tests for normal cases of maxOf/minOf 2017-01-11 14:45:14 +03:00
Ilya Gorbunov
eb07d9407d Unexpected appearance of minOf/maxOf for T: Comparable<T> in smart completion tests 2017-01-11 14:42:36 +03:00
Ilya Gorbunov
18245c5b73 Expected appearance of minOf/maxOf for T: Comparable<T> in one of smart completion tests 2017-01-11 14:42:36 +03:00
Ilya Gorbunov
844c68286a Refactor: replace Math.min with minOf in common code.
Add temporary import of kotlin.comparisons where required.
2017-01-11 14:42:36 +03:00
Ilya Gorbunov
51c24a0c3c Introduce minOf/maxOf in kotlin.comparisons. #KT-7417 2017-01-11 14:42:36 +03:00
Ilya Gorbunov
35d433160e Move more logic of 'use' into 'closeSuppressed', rename the latter to 'closeFinally', that will result in more compact inline call expansions. 2017-01-11 14:35:38 +03:00
Ilya Gorbunov
a71b68268d Refactor exception suppression to provide Throwable.addSuppressed extension in kotlin-stdlib.
Place Closeable and AutoCloseable extensions to separate files (CloseableKt and AutoCloseableKt).
#KT-15477 Fixed
2017-01-11 14:35:38 +03:00
Ilya Gorbunov
dcd7f3eb57 Fix test data after introducing overloads #KT-15630 2017-01-11 14:33:17 +03:00
Ilya Gorbunov
076a94f7f2 Provide parameterless mutable collection factory functions.
#KT-15630
2017-01-11 14:33:17 +03:00
Mikhael Bogdanov
ec42b58877 Fix @PublishedApi checking 2017-01-11 11:50:34 +01:00
Mikhael Bogdanov
2931c316a3 Fix for KT-15575: VerifyError: Bad type on operand stack
#KT-15575 Fixed
2017-01-11 11:50:33 +01:00
Alexander Udalov
a3f6fbe0c1 Add test on contents of .kotlin_module files 2017-01-11 13:15:59 +03:00
Alexander Udalov
7b5c90ebaf Correctly load multifile package parts from binaries
JvmPackagePartProvider should not just blindly load all multifile parts from
all libraries on the classpath, but only those from multifile classes which
shadow (come earlier on the classpath) other classes with the same name.
Otherwise if you have different versions of the same library (which uses
multifile classes) on the classpath, the compiler will see parts from both
versions. If some declaration have moved from one part to another, it's
possible to observe an overload resolution ambiguity error

 #KT-15287 Fixed
2017-01-11 13:15:58 +03:00
Alexander Udalov
69bfc5b4bb Write multifile part->facade mapping to .kotlin_module 2017-01-11 13:15:57 +03:00
Alexander Udalov
6c1cadf273 Refactor PackageParts: add explicit mutating methods 2017-01-11 13:15:57 +03:00
Alexander Udalov
db3fa8eaca Refactor JvmPackagePartProvider
Make code more imperative than functional, preserve the information about the
original root where the module mapping was discovered
2017-01-11 13:15:56 +03:00
Alexander Udalov
0dbb02ec6a Fix generic signature for KFunctionN types on JVM
#KT-15473 Fixed
2017-01-11 13:15:24 +03:00
Svyatoslav Scherbina
bf3b5281a9 ir.tree: add trivial building utils 2017-01-11 14:54:13 +07:00
Svyatoslav Scherbina
d0a166ffec psi2ir: move IR building utils to ir.tree 2017-01-11 14:54:12 +07:00
Svyatoslav Scherbina
feb0dee563 psi2ir: untie IR building utils from PSI 2017-01-11 14:54:11 +07:00
Svyatoslav Scherbina
4c3fb9a21f psi2ir: improve backing field usage generation
Also update corresponding tests data.
2017-01-11 14:54:10 +07:00
Svyatoslav Scherbina
0189faec2e ir.tree: fix IrTry.transformChildren:
transform `finallyExpression` too.
2017-01-11 14:54:09 +07:00
Dmitry Petrov
7a8ec86cb9 KT-11398
- turn INACCESSIBLE_TYPE into a warning;
- improve diagnostic message for INACCESSIBLE_TYPE.
2017-01-11 10:23:01 +03:00
Nikolay Krasko
80af30fb4f Always remove extension from script file
Fix for 35631dc2df refactoring.
Extension was actually always removed before refactoring.
2017-01-11 00:39:16 +03:00
Alexey Sedunov
e89ffbf916 Convert Property to Function: Wrap usage search in read action (EA-1280778) 2017-01-10 21:16:14 +03:00
Alexey Sedunov
23ec8f0813 Quick Fixes: Implement "Create label" quick fix
#KT-8855 Fixed
2017-01-10 21:16:13 +03:00
Alexey Sedunov
534a773816 Intentions: Implement intention which converts object literal to class
#KT-15056 Fixed
2017-01-10 21:16:12 +03:00
Alexey Sedunov
7def536751 Project View: Fix presentation of Kotlin files and their members when @JvmName having the same name as the file itself 2017-01-10 21:16:11 +03:00
Alexey Sedunov
612dffb893 Highlighting: Add line markers for suspend function calls in coroutines
#KT-14689 Fixed
2017-01-10 21:16:10 +03:00
Alexey Sedunov
9e79293a12 Quick Fixes: Implement quickfix which enables/disables coroutine support in module or project 2017-01-10 21:16:09 +03:00
Alexey Sedunov
6b57a3e338 Intentions: Implement intention which rename file according to the top-level class name
#KT-15068 Fixed
2017-01-10 21:16:08 +03:00
Alexey Sedunov
c7aefa2842 Quick Fixes: Implement quick-fix for increasing module language level to enable unsupported language features
#KT-15205 Fixed
2017-01-10 21:16:07 +03:00
Sergey Mashkov
e647f56124 Maven: multiplatform integration test 2017-01-10 19:55:05 +03:00
Sergey Mashkov
c7ed7cc6e4 Maven: add source roots automatically from dependency multiplatform modules (with metadata goal) 2017-01-10 19:36:45 +03:00
Sergey Mashkov
3ccb7416f4 Maven: kotlin facet platform detection 2017-01-10 19:36:44 +03:00
Sergey Mashkov
9490ed22d5 Maven: metadata mojo initial implementation 2017-01-10 19:36:44 +03:00
Sergey Mashkov
60f95e078f Maven: metadata mojo initial implementation 2017-01-10 19:36:43 +03:00
Mikhail Glukhikh
b81268cca1 Control-flow analysis: do-while scope is ended after condition but before jump #KT-15334 Fixed 2017-01-10 17:57:43 +03:00
Simon Ogorodnik
b7a5ff456f Reformatted testData 2017-01-10 16:20:58 +03:00
Simon Ogorodnik
347c6e100b Fix for KT-14736 J2K Incorrect conversion of back ticks in javadoc {@code} tag
#KT-14736 fixed
2017-01-10 16:20:58 +03:00
Simon Ogorodnik
41aaaa6a0d Fix for KT-6790 J2K: Static import of Map.Entry is lost during conversion
#KT-6790 fixed
2017-01-10 16:20:58 +03:00
Simon Ogorodnik
73ea0e8460 Fix for KT-15027 J2K: Annotations are set on functions, but not on property accessors
#KT-15027 fixed
2017-01-10 16:20:58 +03:00
Mikhael Bogdanov
5071baf970 Support increment and '*=' operations on inline properties 2017-01-10 14:09:42 +01:00
Mikhael Bogdanov
043f3199c7 Fix for KT-15446: Property reference on an instance of subclass causes java.lang.VerifyError
#KT-15446 Fixed
2017-01-10 14:09:42 +01:00
Mikhael Bogdanov
ff734ce9ea 'isInlineOnlyOrReified' renamed to 'isInlineOnlyOrReifiable' 2017-01-10 14:09:41 +01:00
Mikhael Bogdanov
dc4cdbf82d Fix for KT-14162: Support @InlineOnly on inline properties
#KT-14162 Fixed
2017-01-10 14:09:41 +01:00
Simon Ogorodnik
e920166879 Fix for KT-13067 Syntax colouring doesn't work for KDoc tags
#KT-13067 fixed
2017-01-10 16:04:31 +03:00
Simon Ogorodnik
d0cf1b0c5f Fix for KT-14819 Quick documentation for special Enum functions doesn't work
#KT-14819 fixed
2017-01-10 16:04:18 +03:00
Simon Ogorodnik
fa01a4efad Fix for KT-12872 Don't show "defined in <very long qualifier here>" in quick doc for local variables
#KT-12872 fixed
2017-01-10 16:03:30 +03:00
Mikhail Zarechenskiy
d89afc419d Fix tests because of automatic optimize imports 2017-01-10 14:28:31 +03:00
Mikhail Zarechenskiy
101ad11db5 Regenerate all automatically-generated data 2017-01-10 14:24:01 +03:00
Alexander Udalov
32d2faf3d1 Fix KAnnotatedElement.findAnnotation when no annotation is found
#KT-15540 Fixed
2017-01-10 12:23:26 +03:00
Alexander Udalov
f4200e02bc Do not mark class files as pre-release if compiled with -language-version 1.0
#KT-15584 Fixed
2017-01-10 12:23:26 +03:00
Alexander Udalov
74880a7e8e Do not fail on SinceKotlinInfo table in incremental binaries 2017-01-10 12:23:26 +03:00
Alexander Udalov
7107ee2eeb Write/load subclasses of sealed classes in metadata
Note that now DeserializedClassDescriptor.getSealedSubclasses works a lot
faster than before, for all newly compiled sealed classes except empty ones. It
may be optimized further if we look at the metadata version of the file the
class was loaded from, however it's not easy currently because
DeserializedClassDescriptor is declared in common (non-JVM) code and has no
direct access to the binary version information.

This will also allow to add a reflection API to get subclasses of a sealed
class

 #KT-12795 Fixed
2017-01-10 12:23:26 +03:00
Alexander Udalov
75a4958144 Introduce ClassDescriptor.getSealedSubclasses
#KT-12795 In Progress
2017-01-10 12:23:25 +03:00
Alexander Udalov
164c72e877 Prefer package with class files to class with the same name
See comments in JvmDependenciesIndexImpl and in the test

 #KT-15464 Fixed
2017-01-10 12:23:25 +03:00
Mikhail Zarechenskiy
6cccad9647 Update year in license and regenerate tests 2017-01-10 12:01:17 +03:00
Mikhail Zarechenskiy
cff0865c87 Fix error type for implicit invoke with function literal argument
#KT-11401 Fixed
2017-01-10 11:44:51 +03:00
Nikolay Krasko
9ff8192aff Name script run configuration after script file name
This makes more evident difference between script and non-script run configurations.
2017-01-09 19:58:03 +03:00
Nikolay Krasko
139ec8c920 Get script dependencies from script manager 2017-01-09 19:58:01 +03:00
Nikolay Krasko
9f94caeb39 Resolve standard library calls in Kotlin scripts (KT-15383)
#KT-15383 Fixed
2017-01-09 19:58:00 +03:00
Nikolay Krasko
9f11564708 Deprecate version field and preserve order of script providers in extension point
It's impossible to guess the order of the final list when there're
providers from different vendors as they might have different versioning systems.

com.intellij.openapi.extensions.LoadingOrder constants can be used by plugins authors to
resolve priority issues.
2017-01-09 19:57:58 +03:00
Nikolay Krasko
0c2247ca41 Remove \r before lexer pass
\r aren't recognized by lexer and cause "Error: could not match input" warnings.
2017-01-09 19:57:56 +03:00
Nikolay Krasko
9ce74dd18c A better toString for KotlinScriptDefinitionFromAnnotatedTemplate 2017-01-09 19:57:54 +03:00
Nikolay Krasko
7abcf3cec2 Minor: suppress warnings 2017-01-09 19:57:53 +03:00
Nikolay Krasko
35631dc2df Minor: rewrite with standard functions 2017-01-09 19:57:51 +03:00
Mikhail Zarechenskiy
76b0b785c5 Prohibit to use enum entry as a type
#KT-14179 Fixed
2017-01-09 18:30:32 +03:00
Zalim Bashorov
316da8331f KJS: relocate com.google.dart.compiler -> org.jetbrains.kotlin 2017-01-09 17:14:19 +03:00
Zalim Bashorov
cb4c3ed686 KJS: rename "js.dart-ast" module to "js.ast" 2017-01-09 17:13:23 +03:00
Kirill Rakhman
a0491d5258 Add quickfix for changing primitive cast to primitive conversion method
Fixes #KT-15564
2017-01-09 16:36:56 +03:00
Kirill Rakhman
2b54f1ac72 "Add names to call arguments" shouldn't appear when the only argument is a trailing lambda
Fixes #KT-15501
2017-01-09 16:34:13 +03:00
shiraji
44e69d8adc Quick fix for applying spread operator where vararg is expected #KT-6824 Fixed 2017-01-09 16:32:23 +03:00
Peter Tripp
6ae4b42164 Change all readme links from http to https where supported. (#1009) 2017-01-09 12:22:58 +01:00
Ilya Zorin
c5677f0428 Format spaces around :: 2017-01-09 12:19:29 +01:00
Kirill Rakhman
406bac684c Fix Quickfix for missing operator adds infix modifier to created function (#1012)
Fixes #KT-14907
2017-01-09 12:03:22 +01:00
Dmitry Jemerov
af1ed78e17 Add Scala license (kotlinc runner scripts are derived from Scala) 2017-01-09 11:54:11 +01:00
Ilya Zorin
ffe80dd549 Format spaces around by keyword (#1016) 2017-01-09 11:19:44 +01:00
mglukhikh
238eaf0d0e Build fix: multi-module quick fix test file rename 2017-01-05 22:30:31 +03:00
Ilya Gorbunov
5db75c993b Introduce array-like list instantiation functions.
#KT-14935 Fixed
2016-12-30 20:00:45 +03:00
Ilya Gorbunov
d7885e699c Update public API dump of kotlin-runtime, relates to #KT-15449 2016-12-30 20:00:44 +03:00
Yan Zhulanow
85450955b6 Allopen, Noarg: Implement old classpath elements filtering correctly (KT-15448) 2016-12-30 18:41:48 +03:00
Yan Zhulanow
f1b7d30363 Update uast-kotlin to Uast 1.0.8 2016-12-30 18:41:47 +03:00
Yan Zhulanow
1d9fe685ac Update lint diagnostics to Uast 1.0.8 2016-12-30 18:41:46 +03:00
Yan Zhulanow
7152c9c789 Use uast-common and uast-java as an external dependency 2016-12-30 18:41:45 +03:00
Yan Zhulanow
ff6ff108ad Uast: Abort converting KotlinType to PsiType if it contains anonymous types (KT-15483) 2016-12-30 18:41:44 +03:00
Alexey Andreev
069711c3d5 JS: fix translation of float constants. See KT-8413 2016-12-30 16:22:07 +03:00
Alexey Andreev
900adcf29b JS: prohibit stable (public) names with non-identifier chars. Rewrite unstable (private) names with non-identifier chars. See KT-4160 2016-12-30 16:21:18 +03:00
Alexey Andreev
7f0166623d JS: when none of exhaustive when clauses match, generate code that throws exception. See KT-12194 2016-12-30 16:20:00 +03:00
Mikhael Bogdanov
3384c6f603 Updated test data 2016-12-30 10:19:57 +01:00
Yan Zhulanow
433dfdd1e8 Check the backing field before checking accessors in KotlinAnnotatedElementsSearcher. This should be faster, and it fixes the problem with IDEA hangs in DataBinding. 2016-12-29 21:01:54 +03:00
Mikhael Bogdanov
e775cc697e Fix for KT-15447: Compiler backend error: "Don't know how to generate outer expression for class"
#KT-15447 Fixed
2016-12-29 16:57:03 +01:00
Mikhael Bogdanov
2566a7a25e Rename receiver$0 in CallableReference to receiver
#KT-15449 Fixed
2016-12-29 16:57:02 +01:00
Mikhail Glukhikh
4774d19890 Quick-fix for header without implementation + a set of tests #KT-14908 Fixed 2016-12-29 17:42:26 +03:00
Alexey Andreev
07de819377 Regenerate tests and test data 2016-12-29 16:15:49 +03:00
Alexey Andreev
175d37fdc8 JS: add test to prove that KT-13523 is no more reproducible 2016-12-29 16:00:54 +03:00
Alexey Andreev
27c2a4f6a8 JS: disable mangling for PublishedApi. Export declarations marked with PublishedApi. See KT-15442 2016-12-29 16:00:51 +03:00
Alexey Andreev
ed7ac7cea9 JS: do not report declaration clash when common redeclaration diagnostic applies. See KT-14577 2016-12-29 16:00:36 +03:00
Alexey Andreev
1af01d0ecb JS: make call to suspend lambda to resume it immediately. See KT-15379 2016-12-29 16:00:35 +03:00
Alexey Andreev
79ba6a57d6 JS: report errors on different external items:
* data classes
* val/var parameters of primary constructors
* enum entry with body
* anonymous `init {}` block in classes
2016-12-29 16:00:35 +03:00
Alexey Andreev
03682ee849 JS: fix how module checker handles super classes 2016-12-29 16:00:34 +03:00
Alexey Andreev
60aac8feee JS: regenerate stdlib files from IDL, without delegated constructor calls 2016-12-29 16:00:34 +03:00
Alexey Andreev
e4b4c19b87 JS: prevent IDL2K from generating delegated constructor calls 2016-12-29 16:00:33 +03:00
Alexey Andreev
1a7e8b0690 JS: allow to omit delegated constructor call for external classes in common FE. Prohibit delegated constructor call for external classes in JS FE. 2016-12-29 16:00:33 +03:00
Alexey Andreev
02ea1a4d64 JS: split error diagnostic about body of external declaration into three different diagnostics (additional ones: wrong initializer, wrong default value of parameter). 2016-12-29 16:00:32 +03:00
Alexey Andreev
de664de0bf JS: regenerate stdlib files from IDL 2016-12-29 16:00:32 +03:00
Alexey Andreev
b1561bd9ab JS: update IDL2K to generate correct declarations WRT new restrictions for external declarations 2016-12-29 16:00:32 +03:00
Alexey Andreev
e8a1b7d6ff JS: update stdlib to respect new restrictions for external declarations 2016-12-29 16:00:31 +03:00
Alexey Andreev
06e83e895f JS: update backend tests to respect new front-end rules for external declarations 2016-12-29 16:00:31 +03:00
Alexey Andreev
6ef4a3389e JS: prohibit external functions and accessors with bodies other than noImpl. Prohibit to use anything except noImpl for default parameters initializers in external functions. See KT-13892 2016-12-29 16:00:30 +03:00
Alexey Andreev
55d4c0e439 JS: prohibit non-abstract members of external interfaces, except for nullable properties. See KT-15308 2016-12-29 16:00:30 +03:00
Alexey Andreev
403753f5b5 JS: prohibit inline external declarations. See KT-15307 2016-12-29 16:00:29 +03:00
Alexey Andreev
84f094c770 JS: prohibit to implement functional interfaces. See KT-15136 2016-12-29 16:00:29 +03:00
Ilya Gorbunov
822e58ad83 Map.getOrImplicitDefault is exposed public as Map.getValue
#KT-11851
2016-12-29 07:49:27 +03:00
Ilya Gorbunov
0a840d0174 Migrate 1.1 reflection API usages in tests. 2016-12-29 06:51:01 +03:00
Ilya Gorbunov
405a79549a Migrate 1.1 reflection API usages 2016-12-29 06:51:00 +03:00
Yan Zhulanow
78a3dae314 Kapt3: Always write Kotlin stubs to .java files, and make javac always parse them from source files, not from JCTree (in order to support incremental compilation). 2016-12-28 22:28:35 +03:00
Yan Zhulanow
9b9b36e332 Kapt3: Kapt task should depend on all Java task dependencies 2016-12-28 22:28:34 +03:00
Yan Zhulanow
fdb568f86d Kapt3: Generate incremental compilation metadata (light classes with Kotlin metadata) 2016-12-28 22:28:33 +03:00
Yan Zhulanow
aa84cc4911 Kapt3: Fix stack trace reporting (KT-15433) 2016-12-28 22:28:32 +03:00
Yan Zhulanow
8953e33417 Kapt3: Force annotation processing classpath entries to be unique 2016-12-28 22:28:31 +03:00
Yan Zhulanow
5844f3cf1b Kapt3: Write stub class files with metadata (needed for incremental compilation) 2016-12-28 22:28:30 +03:00
Yan Zhulanow
400759826f Add DataBindingComponentShortNamesCache and DataBindingShortNamesCache to ignored caches for Java callables sources. Extract filteredShortNamesCaches property 2016-12-28 22:18:06 +03:00
Yan Zhulanow
6bff4a4ed4 Exclude BrShortNamesCache from processJvmCallablesByName() because of the severe lags in Java static member import quickfix. (KT-14308)
Also exclude Kotlin light classes cache because light classes are filtered out anyway.
2016-12-28 22:18:06 +03:00
Yan Zhulanow
4667947315 Kapt3: Nested class inside an interface should always be public and static (KT-15145) 2016-12-28 22:18:06 +03:00
Yan Zhulanow
d918015c30 Kapt3: Attach additional compiler plugins to kapt<sourceSetName>Compile task 2016-12-28 22:18:05 +03:00
Yan Zhulanow
3f638b8677 Kapt: Fix kapt3 on Linux (KT-15375) 2016-12-28 22:18:05 +03:00
Yan Zhulanow
8a9c858d78 Minor: review changes 2016-12-28 22:18:05 +03:00
Yan Zhulanow
a4b21f3b08 Android Gradle plugin: Fix compatibility with Android Studio 2.3 (KT-15376) 2016-12-28 22:18:05 +03:00
Yan Zhulanow
142496c00f Kapt: Parse generic signatures with inner class types correctly 2016-12-28 22:18:04 +03:00
Mikhail Glukhikh
5f3c1dfc41 More accurate check of repeated use-site annotations #KT-13859 Fixed 2016-12-28 19:01:20 +03:00
shiraji
778289fefe Add inspection that reports unused equals expression #KT-6217 Fixed 2016-12-28 16:41:22 +03:00
Alexander Udalov
73845bfc27 Fix light-analysis test data 2016-12-27 18:19:49 +03:00
Mikhail Zarechenskiy
e448695578 Introduce language feature for refined sam adapters priority 2016-12-27 16:44:23 +03:00
Alexander Udalov
b4051c4577 Do not generate unnecessary super-call checks for functions with defaults
Such check should only be generated for a function in an open class

 #KT-11962 Fixed
2016-12-27 16:22:12 +03:00
Alexander Udalov
3d9c264d63 Do not generate CHECKCAST after 'null' literal
#KT-15411 Fixed
2016-12-27 16:22:12 +03:00
Mikhael Bogdanov
4c9bac084c Fix for KT-15437: VerifyError: Bad local variable type on simplest provideDelegate
#KT-15437 Fixed
2016-12-27 14:07:37 +01:00
Mikhael Bogdanov
b5ec30666b Fix for KT-15410: "Protected function call from public-API inline function" for protected constructor call
#KT-15410 Fixed
2016-12-27 14:07:37 +01:00
Mikhael Bogdanov
f1c1fcf0fc Fix for KT-11969: ProGuard issue with private interface methods
#KT-11969 Fixed
2016-12-27 14:07:37 +01:00
Alexander Udalov
6444ccc962 Do not skip .kotlin_metadata files with only type aliases in them 2016-12-27 14:25:06 +03:00
Alexander Udalov
64e9c85c14 Do not build file stubs for nested classes from .kotlin_metadata files
Stubs for nested classes are going to be built inside the stubs for the
corresponding outer classes, building them on the top level is just going to
break everything (see EA-93105)
2016-12-27 14:21:59 +03:00
Alexander Udalov
f8a88bdffb Fix "Rewrite at slice LEXICAL_SCOPE" for callable references
For special calls (when-expressions, if-expressions, etc.), do not attempt to
get type of the argument expression, which is the block with the callable
reference, instead get type of the callable reference itself. The difference
matters because for block expressions, a new lexical scope is created for each
getTypeInfo (see ExpressionTypingServices.getBlockReturnedType), and we do not
support rewrites of this value in the binding trace

 #KT-12044 Fixed
2016-12-27 10:45:46 +03:00
Mikhail Zarechenskiy
38a2518498 Fix computation of erased receiver for intersection types
#KT-9630 Fixed
2016-12-26 22:34:40 +03:00
Ilya Gorbunov
f7d64ac807 Migrate exceptions to kotlin.reflect.full package and KotlinReflectInternalError to kotlin.reflect.jvm.internal package. 2016-12-26 20:05:54 +03:00
Ilya Gorbunov
9614404914 Move all extensions from kotlin.reflect package to kotlin.reflect.full in order not to have kotlin-reflect package split between kotlin-stdlib and kotlin-reflect modules.
Leave old API deprecated with a replacement provided and make those functions/properties inline pointing to moved ones.
2016-12-26 19:12:13 +03:00
Ilya Gorbunov
85232ffa07 Drop deprecated pre-1.0 API. Remove remaining usages in tests. 2016-12-26 19:07:20 +03:00
Ilya Gorbunov
72e461e2d5 Allow test invocations like Kotlin.isType or Kotlin.throwCCE with CHECK_NOT_CALLED_IN_SCOPE directive. 2016-12-26 19:01:45 +03:00
Alexander Udalov
c4f731b987 Write Kotlin-Version to runtime artifacts built with Maven
Add a test that checks that Kotlin-Version and Kotlin-Runtime-Component have
been written to all relevant runtime libraries
2016-12-26 17:46:36 +03:00
Alexander Udalov
21f79cd737 Fix test data 2016-12-26 17:11:32 +03:00
Alexander Udalov
e4e50017d0 Render header/impl on properties in tests and diagnostic messages
As a side effect, header/impl and some other modifiers on functions are now
rendered in a different, more natural, order
2016-12-26 17:06:24 +03:00
Alexander Udalov
5556c59fc9 Render platform name in multiplatform diagnostic tests
Prepend the platform name to the diagnostic in a common module, which is
reported when sources of that common module are analyzed as a part of the
platform source set: "<!JVM:...!> ... <!>". Fix some existing tests, mostly by
adding "impl" to implementations
2016-12-26 17:06:15 +03:00
Alexander Udalov
e4d85ac527 Support header annotation classes in common modules
Properties are only allowed to be declared in a header class' primary
constructor if that class is an annotation class. However, we did not correctly
determine that such properties are also "header". The test passed because the
diagnostic was lost
2016-12-26 17:01:24 +03:00
Alexander Udalov
7d3628b9be CheckerTestUtil: introduce ActualDiagnostic to encapsulate Diagnostic 2016-12-26 17:01:20 +03:00
Alexander Udalov
6cfc42666c Refactor CheckerTestUtil
Simplify code somewhat, prepare for a larger refactoring
2016-12-26 16:49:58 +03:00
Alexey Andreev
11ce184d8e JS: add suspendCoroutine function 2016-12-26 12:45:14 +03:00
Alexey Andreev
2edb1ff081 JS: optimize imports in some unrelated files 2016-12-26 12:45:14 +03:00
Alexey Andreev
f50f9dc22e JS: improve how base class for coroutines is implemented: 1) use JVM-like style of passing dispatcher 2) instead of flag, use additional "facade" continuation when dealing with dispatchers 2016-12-26 12:45:13 +03:00
Alexander Udalov
cf2839a088 Fix light-analysis test data 2016-12-24 14:37:24 +03:00
Ilya Gorbunov
9619e08c9b Use emptyArray in orEmpty. 2016-12-24 02:03:48 +03:00
Ilya Gorbunov
05dcaccf09 Do not require array extensions being reified to create new array.
#KT-15377
2016-12-24 01:55:33 +03:00
Alexander Udalov
510295475b Batch script: allow to pass JAVA_OPTS from outside
Similarly to the Bash version

 #KT-14917 Fixed
2016-12-23 22:31:11 +03:00
Alexander Udalov
dee70abf70 Update kdoc for KClass and KClassifier 2016-12-23 22:30:53 +03:00
Alexander Udalov
5402d50ea3 Light analysis tests: do not render empty lines between classes and in the beginning 2016-12-23 22:30:48 +03:00
Alexander Udalov
8fb7a70972 Fix manifest entries for kotlin-script-runtime and its sources
See target "script-runtime" in build.xml
2016-12-23 22:30:33 +03:00
Alexander Udalov
3719a0619d Merge definitions of build-helper-maven-plugin in runtime/pom.xml 2016-12-23 22:30:31 +03:00
Alexander Udalov
7146a6db74 Minor, drop unused DiagnosedRange#file 2016-12-23 22:30:16 +03:00
Alexander Udalov
0e11615780 J2K diagnostic tests: prettify 2016-12-23 22:30:06 +03:00
Alexander Udalov
8c0be58f56 J2K diagnostic tests: convert to Kotlin 2016-12-23 22:30:01 +03:00
Alexander Udalov
4e4f9312bb J2K diagnostics tests: rename .java -> .kt 2016-12-23 22:29:57 +03:00
Alexey Tsvetkov
afa6aed699 Add test for multiplatform project import from gradle 2016-12-23 20:41:43 +03:00
Ilya Gorbunov
f07323715f Provide some docs for dynamic.iterator() 2016-12-23 20:16:23 +03:00
Ilya Gorbunov
b2a4c27709 Provide extension unsafeCast for dynamic.
#KT-15310
2016-12-23 20:16:21 +03:00
Ilya Gorbunov
c43e4f6682 Uncomment some assertions for overflow behavior that now can pass in JS 2016-12-23 18:14:32 +03:00
Ilya Gorbunov
6b509892cb Remove manual overflow for JS arithmetic operations 2016-12-23 18:14:32 +03:00
Ilya Gorbunov
d3c82a2741 Minor: optimize imports. 2016-12-23 18:14:32 +03:00
Mikhail Glukhikh
194ff4ee76 Check possible smart cast to enum in when subject #KT-14705 Fixed 2016-12-23 15:10:56 +03:00
Mikhail Glukhikh
0e70e3f80e USELESS_ELVIS_RIGHT_IS_NULL is no more reported for flexible left argument #KT-13593 Fixed 2016-12-23 15:10:49 +03:00
Dmitry Petrov
8d16bd1215 Method can be hidden if it is annotated with kotlin.internal.PlatformDependent,
or is a Java method from a Kotlin built-in class (transitively).

https://github.com/Kotlin/KEEP/blob/master/proposals/jdk-dependent-built-ins.md#backward-compatibility-of-overrides
2016-12-23 13:51:08 +03:00
Dmitry Petrov
d9271b54fb Fix IR generation: temporary variable in 'hashCode()' for data class should be 'var' 2016-12-23 10:44:14 +03:00
Dmitry Jemerov
514fc02938 Propagate 'implement' dependencies from Gradle to IDEA project model 2016-12-22 20:57:24 +03:00
Alexey Andreev
9b4b7960d3 JS: prevent compiler from importing module more than once if not necessary. See KT-15260 2016-12-22 17:19:25 +03:00
Alexey Andreev
1ecd957981 JS: fix translation of delegated constructor call from secondary constructor when argument is a complex expression which translates to multiple statements. See KT-15357 2016-12-22 17:19:24 +03:00
Alexey Andreev
1ab78dffe5 JS: fix translation of for statement when either next or hasNext method translates to multiple statements. Fix KT-15367 2016-12-22 17:19:24 +03:00
Alexey Andreev
cef32b3327 JS: initialize fields of coroutine state machine with undefined value so that they match local variable semantics. Fix KT-15366 2016-12-22 17:19:23 +03:00
Alexey Andreev
8ef284daf4 JS: improve temporary variable elimination in some cases. Apply redundant statement elimination when statement in not synthetic, but its expression is 2016-12-22 17:19:23 +03:00
Alexey Andreev
35ab41e900 JS: when removing unused temporary variable, process its RHS value. Fix KT-15325 2016-12-22 17:19:22 +03:00
Nikolay Krasko
49d57124c1 Take new name when layout rename started from reference 2016-12-22 16:20:29 +03:00
Nikolay Krasko
da5f2a0784 Always return identifier from handleElementRename() (KT-14358)
Returning reference will lead to replacing identifier with reference, that result bad psi, bad stubs, and failure at some point.

 #KT-14358 Fixed
2016-12-22 16:20:29 +03:00
Nikolay Krasko
8a49a017ff Use JavaRegExpHost for Kotlin RegExp injection (KT-15329)
#KT-15329 Fixed
2016-12-22 16:20:29 +03:00
Mikhail Glukhikh
a78694e9be Test fix: spring test for gutter 2016-12-22 15:03:09 +03:00
Mikhail Glukhikh
4a1e6d3ef9 Inspection to convert two comparisons to range check #KT-5045 Fixed 2016-12-22 15:02:49 +03:00
Mikhail Glukhikh
67788e39d3 Fold initializer & if to elvis: search for variable usage inside if first #KT-14889 Fixed 2016-12-22 14:56:38 +03:00
Mikhail Glukhikh
ee1b741e84 More accurate handling of Elvis in areParenthesesNecessary #KT-15227 Fixed 2016-12-22 14:56:32 +03:00
shiraji
6d6a16f399 KT-5045: intention to convert between two comparisons and range check and vice versa 2016-12-22 14:56:10 +03:00
Mikhael Bogdanov
1040c97196 Fix for: KT-14011 Compiler crash when inlining: lateinit property allRecapturedParameters has not been initialized
#KT-14011 Fixed
2016-12-22 09:44:26 +01:00
Mikhael Bogdanov
fa77dd62c4 InlineResult convertion to Kotlin 2016-12-22 09:44:25 +01:00
Mikhael Bogdanov
7688237973 InlineResult.java->kt 2016-12-22 09:44:25 +01:00
Mikhael Bogdanov
ef825a7559 Fix for KT-14868: CCE in runtime while converting Number to Char
#KT-14868 Fixed
2016-12-22 09:44:24 +01:00
Denis Zharkov
ce333b0a58 Minor. Remove exception handling part from CoroutineMethodTransformer
There is no handleException operator anymore
2016-12-22 11:19:08 +03:00
Denis Zharkov
8475869fb3 Support common calls on suspend function typed values
Also support multiple value parameters in suspend function type

 #KT-15379 Fixed
 #KT-15380 Fixed
2016-12-22 11:15:52 +03:00
Denis Zharkov
d0ba048342 Refine coroutine/suspend functions ABI
- `invoke` method must always start a suspend functions
- For creation of coroutine that has not been started yet, there are
two special internal interfaces `SuspendFunction0`/`SuspendFunction1`
2016-12-22 11:08:42 +03:00
Denis Zharkov
75174b4fba Fix issue on dumping override of suspend function
The meaning of `setDropOriginalInContainingParts()` call is that
it makes copyBuilder forget the original parts, in particular
the valueParameter.original.containingDeclaration does not reference
original descriptor no more

Otherwise the following exception is happening:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt:192)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt)
	at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:98)
	at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:99)
	at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:27)
	at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:37)
	at org.jetbrains.kotlin.utils.DFS.ifAny(DFS.java:47)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.hasDefaultValue(DescriptorUtils.kt:189)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameter(DescriptorRendererImpl.kt:803)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameters(DescriptorRendererImpl.kt:767)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderFunction(DescriptorRendererImpl.kt:683)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.access$renderFunction(DescriptorRendererImpl.kt:42)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1039)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1002)
	at org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl.accept(FunctionDescriptorImpl.java:760)
2016-12-22 11:08:42 +03:00
Denis Zharkov
90c8e35331 Minor. Drop unused parts 2016-12-22 11:08:42 +03:00
Ilya Chernikov
a9e9f36e1c Put native-platform-uberjar.jar into compiler embeddable and remove dependency from the compiler runner 2016-12-22 05:37:13 +03:00
Alexey Sedunov
12f2c04a0b Misc: Fix argument copying 2016-12-22 02:47:34 +03:00
Alexey Andreev
f42a15bc4f Fix test data for light analysis test 2016-12-21 17:31:29 +03:00
Nikolay Krasko
2500dc9bb1 "Go to Type Declaration" is broken for stdlib types (KT-13001)
#KT-13001Fixed
2016-12-21 13:13:10 +03:00
Nikolay Krasko
6ca5ba3615 Don't call getClassDescriptor for local declarations (KT-15259)
#KT-15259 Open
2016-12-21 13:13:10 +03:00
Dmitry Petrov
8fe9de1d35 Generate toArray methods defined in classes inherited from collections as public even if they are declared with different visibility in Kotlin. 2016-12-21 10:50:17 +03:00
Ilya Chernikov
c5d03578a3 Update changelog with 1.1-M04 2016-12-20 18:31:20 +01:00
Alexey Tsvetkov
2ba28618ec Remove reference to removed dependency from pom.xml 2016-12-20 20:24:46 +03:00
Ilya Gorbunov
6ee8a23ddd JS: Drop native map get/set intrinsics altogether.
MutableMap.set extension operator is now common among stdlib and stdlib-js.
#KT-2323
2016-12-20 18:00:19 +03:00
Alexander Udalov
e8c9e81235 Minor, move and rename test data directory 2016-12-20 17:29:30 +03:00
Alexander Udalov
ca886ecb8d Do not report "delegation member hides override" when hidden member is final
This situation is erroneous because OVERRIDING_FINAL_MEMBER_BY_DELEGATION is
already reported, no need to report another error
2016-12-20 17:29:17 +03:00
Alexander Udalov
482b43631c Refactor DelegationChecker and related code
- move getDelegates from CodegenUtil to DelegationResolver, reuse it in
  DelegationChecker
- use getAllOverriddenDescriptors + filterOutOverridden instead of a manual DFS
2016-12-20 17:28:50 +03:00
Denis Zharkov
2dd7d89048 Fix built-ins overridability issue
See the comment for clarification

 #KT-15097 Fixed
2016-12-20 16:35:26 +03:00
Alexey Andreev
e02d281ed4 JS: don't use strict comparison (===) for enums when both left-hand side and right-hand side are nullable. See KT-12598 2016-12-20 15:47:39 +03:00
Alexey Andreev
c285e5ba3b JS: add tests too prove that operator conventions are correctly inlined. Support inlining of invoke operator. See KT-7588 2016-12-20 15:47:39 +03:00
Alexey Andreev
d3d406356c JS: use optimized emulation of int32 multiplication. Add test for emulated int32 multiplication 2016-12-20 15:47:39 +03:00
Alexey Andreev
7d8df5c81c JS: optimize integer overflow emulation when possible 2016-12-20 15:47:38 +03:00
Alexey Andreev
eb5c79c70d JS: support int overflow behaviour in augmented assignment 2016-12-20 15:47:38 +03:00
Alexey Andreev
c411a8febe JS: update tests 2016-12-20 15:47:37 +03:00
Alexey Andreev
c854b81a09 JS: trying to implement integer overflow for increment and decrement 2016-12-20 15:47:37 +03:00
Alexey Andreev
446c4c0a33 JS: provide overflow behaviour for int binary operations (see KT-7733) 2016-12-20 15:47:36 +03:00
Mikhail Zarechenskiy
24d5bdd62c Fix test data after migration to 'rem' 2016-12-20 15:20:47 +03:00
Mikhail Zarechenskiy
1baf719cb4 Update operations map, remove TODO 2016-12-20 15:20:38 +03:00
Nikolay Krasko
c076ad5a8d Don't assign type parameters from original proto if type is substituted with Any (KT-15128)
#KT-15128 Fixed
2016-12-20 15:16:23 +03:00
Alexey Tsvetkov
e9e1b3fea1 Fix getting daemon connection in JPS 2016-12-20 14:46:23 +03:00
Mikhail Zarechenskiy
35e732a97f Place inference from getters under the language feature 2016-12-20 14:14:19 +03:00
Ilya Gorbunov
c6a812b11c Fix some API holes in headers 2016-12-20 14:02:01 +03:00
Ilya Chernikov
4f2410ffe0 Fix TC compilation and kapt3 tests compilation 2016-12-20 10:02:01 +01:00
Mikhael Bogdanov
5222768ba1 Adedd quickfix check if @PublishedApi stub already exists 2016-12-20 09:42:14 +01:00
Mikhael Bogdanov
c38b55612b Support properties in @PublishedApi bridge quickfix 2016-12-20 09:42:13 +01:00
Mikhael Bogdanov
6ca1d47207 Published-api checker refactoring, support java package-protected visibility 2016-12-20 09:42:13 +01:00
Dmitry Petrov
0fa2c54ae8 Identity comparison for primitives is deprecated (warning).
Identity comparison for primitive vs non-primitive is a warning (due to implicit boxing).
2016-12-20 11:00:58 +03:00
Alexey Tsvetkov
434f33f9e9 Minor: remove default value of retryOnConnectionError parameter 2016-12-19 22:55:28 +03:00
Alexey Tsvetkov
254d051a1f Minor: replace map().flatten()->flatMap() 2016-12-19 22:55:27 +03:00
Alexey Tsvetkov
c89e62c45a Minor: rename enableIC->withIC 2016-12-19 22:55:27 +03:00
Alexey Tsvetkov
54d0a6b8e4 Minor: fix snapshot version used in kapt test kt15001 2016-12-19 22:55:26 +03:00
Alexey Tsvetkov
69d1ee7b11 Run kapt with daemon 2016-12-19 22:55:26 +03:00
Alexey Tsvetkov
865c6d887c Report messages from kapt using MessageCollector
This allows to print messages when daemon is used.
System out is not copied to daemon client,
because multiple compilations can occur in parallel.
2016-12-19 22:55:25 +03:00
Alexey Tsvetkov
b39cefe5d1 Optimize searching for compiler jar 2016-12-19 22:55:25 +03:00
Alexey Tsvetkov
de2736489b Unify Gradle and Kotlin daemon cache version checking 2016-12-19 22:55:25 +03:00
Alexey Tsvetkov
d5e42e3271 Clear jar cache with daemon 2016-12-19 22:55:24 +03:00
Alexey Tsvetkov
69e8cf6a25 Compile multiplatform projects with daemon 2016-12-19 22:55:24 +03:00
Alexey Tsvetkov
d303bdaa0e Minor: add missing import 2016-12-19 22:55:23 +03:00
Alexey Tsvetkov
fcf23706c0 Fix gradle subplugin example 2016-12-19 22:55:23 +03:00
Alexey Tsvetkov
8228d5828e Fix multiproject Gradle IC with daemon 2016-12-19 22:55:22 +03:00
Alexey Tsvetkov
fb869277d9 Set property "idea.plugins.compatible.build" every time production environment is created
Gradle can wipe system properties between the build.
If this property is not set, "idea.properties is not found exception"
can be thrown when creating KotlinCoreEnvironment.
2016-12-19 22:55:22 +03:00
Alexey Tsvetkov
51a8f6ee4f Implement server side IC 2016-12-19 22:55:21 +03:00
Alexey Tsvetkov
f411bb0b4b Refactoring: extract withDaemon 2016-12-19 22:55:21 +03:00
Alexey Tsvetkov
9654607f42 Refactoring: pass MessageCollector, OutputItemsCollector in CompilerEnvironment 2016-12-19 22:55:20 +03:00
Alexey Tsvetkov
3f91df4c84 Minor: move GradleCompilerEnvironment to separate file 2016-12-19 22:55:20 +03:00
Alexey Tsvetkov
145608ec0f Minor: remove redundant call 2016-12-19 22:55:20 +03:00
Alexey Tsvetkov
c1812d7d92 Move IC tests to compiler
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2016-12-19 22:55:19 +03:00
Alexey Tsvetkov
cbe680d876 Move file utils
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2016-12-19 22:55:17 +03:00
Alexey Tsvetkov
8bd8f5eacf Make IC classes public
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2016-12-19 22:55:14 +03:00
Alexey Tsvetkov
a569f7e75a Remove remaining gradle api references
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2016-12-19 22:55:06 +03:00
Alexey Tsvetkov
939020ec60 Replace org.jetbrains.kotlin.com.intellij with com.intellij
Fixing IC after moving it from Gradle to the compiler in commit f40a3eff20
2016-12-19 22:54:38 +03:00
Alexey Tsvetkov
f40a3eff20 Move IC from Gradle to compiler
Reasons for moving:
1. Integration with Kotlin daemon for Gradle.
Gradle bundles Kotlin compiler (kotlin-compiler-embeddable) since Gradle 3.2.
There is no plugin isolation in Gradle, so strange compilation errors/exceptions may happen.
We decided to fix this problem by compiling out-of-process using Kotlin daemon.

Reasons for moving IC to the compiler:
* Better isolation from Gradle process.
* Incremental compilation logic is not scattered across two process and multiple modules.
* Makes it possible to implement standalone CLI IC
2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
377912f42d Replace Gradle logger with ICReporter 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
599f11b431 Refactoring: extract interface AnnotationFileUpdater 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
fdd3bc31f1 Rename: IncReporter->ICReporter 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
4fdca24db4 Remove source annotations removing (not needed with KAPT3) 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
190c038ad8 Minor: log compiler arguments 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
c7c2a93d1f Use daemon when compiling Kotlin to JS 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
25816b2ccf Use ProcessLauncher from native platform for out-of-process compilation 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
5082e8f236 Add a way to customize compiler file in build.gradle 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
75133bdfb9 Implement fallback strategies 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
d636803d2f Run compiler via Kotlin daemon in Gradle plugin 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
0be4299c8a Refactoring: extract JPS specific code from compiler-runner 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
1f21a0ec90 Add compiler daemon client and runner to maven build 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
eac76915be Minor: remove ImmutableMapBuilder reference from CompilerOutputParser 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
c8394cd0cc Convert CompilerOutputParser: convert to kotlin 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
d587c3091c Convert CompilerOutputParser: rename file 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
896d81143c Introduce compiler-runner module 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
e3550c5ea2 Convert CompilerEnvironment to Kotlin: actual conversion 2016-12-19 22:46:12 +03:00
Alexey Tsvetkov
f98dde4543 Convert CompilerEnvironment to Kotlin: rename file 2016-12-19 22:46:12 +03:00
Stanislav Erokhin
04fddc7139 Discriminate header classes in member scope.
We made it because of non-stable name resolution when project is multi platform. For such projects in platform module we have two classifiers with the same name, but impl class or type alias should win!
2016-12-19 22:43:10 +03:00
Dmitry Jemerov
5f124e9781 Don't show "Kotlin not configured" notification for projects that have Kotlin common runtime in scope
#KT-15331 Fixed
2016-12-19 19:21:10 +01:00
Yan Zhulanow
568523b065 Kapt3: Set correct compiler options when the annotation processing classpath is empty (KT-15146). Disable annotation processing in Javac task a bit earlier 2016-12-19 21:18:17 +03:00
Yan Zhulanow
f8edf51c1b Allopen, Noarg: Support transitive meta-annotations 2016-12-19 21:18:11 +03:00
Yan Zhulanow
82dbba838a Allopen, minor: Add test for anonymous object 2016-12-19 21:18:06 +03:00
Dmitry Jemerov
bc22b67995 Index and locate .kotlin_metadata files in IDE 2016-12-19 17:40:13 +01:00
Ilya Gorbunov
2209631f1a Add SinceKotlin to new coerceIn method. 2016-12-19 18:36:52 +03:00
Ilya Gorbunov
10f8e70322 Rename ClosedComparableRange to ClosedFloatingPointRange 2016-12-19 18:36:52 +03:00
Ilya Gorbunov
919c77b950 Minor: run configuration for binary compatibility tests, clean build 2016-12-19 18:36:52 +03:00
Alexey Sedunov
a84275b057 Minor: Rename "Default" platform to "Common" 2016-12-19 18:31:46 +03:00
Alexey Sedunov
332d1f6405 Multi-platform Projects: Enable multi-platform projects for platform modules which depend on common modules 2016-12-19 18:27:49 +03:00
Alexey Sedunov
df33455b95 Kotlin Facet: Detect module platform using Gradle plugin id/stdlib
artifact id (Gradle import)
2016-12-19 18:27:48 +03:00
Alexey Sedunov
eac0c9b2ed Kotlin Facet: Add "Use project settings" option 2016-12-19 18:27:47 +03:00
Alexey Sedunov
4ed030d7c5 Kotlin Facet: Do not serialize default values of facet configuration 2016-12-19 18:27:46 +03:00
Mikhail Glukhikh
8f57869fc5 Line marker tests for header <----> impl 2016-12-19 17:39:16 +03:00
Mikhail Glukhikh
84ebca06bc AbstractMultiHighlightingTest extracted (to provide both multi file / multi module tests) 2016-12-19 15:46:34 +03:00
Mikhail Glukhikh
a846e41b46 Cleanup: KotlinLineMarkerProvider 2016-12-19 15:46:27 +03:00
Mikhail Glukhikh
39ca78f584 Multi-platform navigation fix: from class to type alias & vice versa 2016-12-19 14:56:02 +03:00
Mikhail Glukhikh
b363d34fd7 MemberDescriptor ancestor extracted to ClassifierDescriptorWithTypeParameters 2016-12-19 14:55:56 +03:00
Mikhail Glukhikh
5947d49dee Multi-platform fix: no more errors for top-level impl fun / val / var in IDE 2016-12-19 14:55:49 +03:00
Alexander Udalov
63cc5d872d Minor, fix test data 2016-12-19 12:15:59 +03:00
Alexander Udalov
da6c3c3231 Support header/impl enum classes
- prohibit constructors for header enum classes
- prohibit bodies for header enum entries
- all entries from header enum must be present in impl enum
2016-12-19 11:54:40 +03:00
Alexander Udalov
56d4ff0cad Support nested header/impl classes 2016-12-19 11:54:38 +03:00
Alexander Udalov
a57455ce62 Relax requirements on function modifiers in multiplatform projects
Allow to implement header functions with external/tailrec/inline/infix/operator
functions
2016-12-19 11:53:39 +03:00
Alexander Udalov
64867409b7 Do not report errors on 'impl' declarations with -Xno-check-impl
Allow 'impl' modifier on a declaration even if it's not an implementation of
any header declaration
2016-12-19 11:50:54 +03:00
Alexander Udalov
0634782e47 Allow open impl class for final header class 2016-12-19 11:50:49 +03:00
Alexander Udalov
546e47dc44 Allow fake overrides and delegates to be impl for header declarations
Also fix a bug with matching supertype lists of header/impl classes
2016-12-19 11:50:40 +03:00
Alexander Udalov
7deaf8cc41 Allow impl class to be data class, allow impl constructor properties 2016-12-19 11:50:30 +03:00
Alexander Udalov
3e97c9fff9 Rename platform->header, definition->impl in test data 2016-12-19 11:50:21 +03:00
Denis Zharkov
a1ac77d382 Support async iterator case with coroutines
Not all the `hasNext` operators return types is exactly Z,
suspend operators return boxed versions.

So the fix is just coercing result value after invoked function to Z
2016-12-19 11:07:33 +03:00
Denis Zharkov
1076397530 Minor. Simplify suspension point processing
Move type coercing logic from transformer to ExpressionCodegen.

For suspension points it's always guaranteed that values
returned from suspension points are always can be successfully casted
to appropriate type, because they cannot return SUSPENDED marker
(it gets processed via CoroutineTransformerMethodVisitor).
2016-12-19 11:07:32 +03:00
Denis Zharkov
5dbc04abbb Refine returns codegen for suspend functions
This change should make the logic a bit more simple.
For all suspend functions/coroutines treat them in expression codegen
like they return boxed version of the original type.

Everything works fine then, except Unit type functions:
their bodies must be generated just like they're VOID and then load
Unit on stack manually.
2016-12-19 11:07:32 +03:00
Dmitry Petrov
33ed98a0d3 Update typing rules for class literal expressions.
C::class : KClass<C>
expr: T => expr::class : KClass<out T>

NB: this means Obj::class : KClass<out Obj> for object Obj.
2016-12-19 10:41:49 +03:00
Alexey Tsvetkov
9fc3d0838e Fix references from test to main in Gradle JS plugin with default output file 2016-12-17 21:46:13 +03:00
Alexey Tsvetkov
b14a0d543f Add references from test to main in multiplatform test project 2016-12-17 21:32:36 +03:00
Alexey Tsvetkov
6974cdf167 Avoid adding common sources to platform source set
If common sources are added to a platform source set,
then IDE sees common src dir as a source root in a platform project,
which is incorrect.
2016-12-17 21:32:32 +03:00
Alexey Tsvetkov
c6586f2ac8 Fix mapping kotlin properties in JS plugin 2016-12-17 21:32:28 +03:00
Alexander Udalov
f57bbeed58 Disable runtime versions consistency checker temporarily
It should be enabled back as soon as Kotlin-Version attribute is written to
manifests of runtime jars in the Maven build
2016-12-17 20:57:05 +03:00
Alexey Andreev
22ff7c6c45 JS: when translating content of js() function, rename all free references if they point to Kotlin local variable with the same name. See KT-15212 2016-12-17 12:12:36 +03:00
Ilya Gorbunov
5ee61702ee Do not deploy examples as artifacts to maven 2016-12-17 02:25:28 +03:00
Denis Zharkov
5ec62108ee Rename RestrictsSuspendExtensions -> RestrictsSuspension 2016-12-16 18:56:30 +03:00
Dmitry Jemerov
63785b5f66 Migration for JS extension functions and properties marked with @native/external
#KT-15269 Fixed
2016-12-16 15:36:55 +01:00
Dmitry Jemerov
ace4407032 Add 1.1 EAP repository when creating a new Gradle project with 1.1 EAP
#KT-15293 Fixed
2016-12-16 14:49:18 +01:00
Mikhael Bogdanov
0949f55921 Uast update due to new diagnostic for delegation by 2016-12-16 13:17:29 +01:00
Mikhael Bogdanov
547704c179 'SubpackagesImportingScope' class update due to new diagnostic 2016-12-16 13:17:29 +01:00
Mikhael Bogdanov
761aa9df09 Report error when delegation method hides superttype override
#KT-12531 Fixed
2016-12-16 13:17:28 +01:00
Mikhael Bogdanov
686b698d80 Test data update 2016-12-16 13:17:27 +01:00
Denis Zharkov
fa013f0bbf Add test on inference with SAM adapter
#KT-12144 Fixed
2016-12-16 15:01:19 +03:00
Denis Zharkov
01ff975cc0 Minor. Update tests on coroutines 2016-12-16 13:27:11 +03:00
Mikhael Bogdanov
004ff86bec Fix for KT-14774: Incorrect inner class modifier generated for sealed inner classes
#KT-14774 Fixed
2016-12-16 11:22:40 +01:00
Nikolay Krasko
654cecde69 Invalidate Script class finder caches as soon script classpath caches are invalidated (KT-14538)
#KT-14538 Fixed
2016-12-16 13:19:58 +03:00
Nikolay Krasko
f7b60e64c9 Run invalidating script caches when reindexing is ready (KT-14538)
Explanation why it leads to red code after new project opening

 1. No script files are found after project initialization.
 2. KotlinScriptDependenciesIndexableSetContributor triggers caching classpath via getAllScriptsClasspath(). Empty classpath is cached.
 3. KotlinScriptDependenciesClassFinder.calcClassRoots() always get empty classpath.

 #KT-14538 In Progress
2016-12-16 13:19:56 +03:00
Nikolay Krasko
9759319da3 Revert "Filter out first dependency from module dependencies"
This reverts commit 868495437c.
2016-12-16 13:19:53 +03:00
Alexander Udalov
49de52e7ef Fix kotlinFunction for inline reified methods in reflection
Inline functions with reified type parameters are generated as private (see
AsmUtil.specialCaseVisibility), so we should treat them as "declared" in
reflection to look them up via getDeclaredMethod, not getMethod

 #KT-14721 Fixed
2016-12-16 13:12:41 +03:00
Alexander Udalov
3a0100f604 Minor, move isInlineOnlyOrReified to module descriptors 2016-12-16 13:12:40 +03:00
Ilya Gorbunov
b2ccea87f3 Temporary workaround to generate functions with optional parameters with bodies in common code. 2016-12-16 04:36:30 +03:00
Ilya Gorbunov
b72e5c038d Generate common headers to common/src/generated 2016-12-16 04:36:29 +03:00
Ilya Gorbunov
4f2593fb99 Add preprocessed JVM stdlib sources as common sources 2016-12-16 04:36:27 +03:00
Ilya Gorbunov
88a14056b7 Add hand-written headers for common stdlib 2016-12-16 04:36:25 +03:00
Ilya Gorbunov
d381b56d47 Add module for common stdlib 2016-12-16 04:36:23 +03:00
Ilya Gorbunov
75992173b6 Unify Array.plus and plusElements function templates between JVM and JS. 2016-12-16 04:36:21 +03:00
Ilya Gorbunov
202cd81134 Unify Array.copyOf and copyOfRange function templates between JVM and JS. 2016-12-16 04:36:20 +03:00
Ilya Gorbunov
572a63f0e2 Unify Array.sort and sortWith function templates between JVM and JS.
Introduce new inline-only overload Array<out T: Comparable<T>>.sort().
2016-12-16 04:36:18 +03:00
Ilya Gorbunov
e890cb137f Unify MutableList.reverse function template between JVM and JS 2016-12-16 04:36:16 +03:00
Ilya Gorbunov
085f476d22 Unify content[ToString, Equals, HashCode] function templates between JVM and JS 2016-12-16 04:36:14 +03:00
Ilya Gorbunov
f3df648f4a Unify toTypedArray and asList templates between JVM and JS 2016-12-16 04:36:12 +03:00
Ilya Gorbunov
3d7e6e1996 Refactor stdlib generator: introduce platform-specialized properties.
Use Kotlin 1.1-M03 to utilize new language features.
2016-12-16 04:31:07 +03:00
Ilya Gorbunov
c097f326fb Generate common headers of stdlib functions. What constitutes the header is yet to be decided. 2016-12-16 04:31:07 +03:00
Ilya Gorbunov
6ea1cde449 Generate additional sources for JS instead of copying them from JVM 2016-12-16 04:31:07 +03:00
Ilya Gorbunov
bc2d7dda2c kotlin-stdlib-generator: Allow to generate top-level functions by specifying empty custom receiver. Allow to parametrize primitive specialization bodies with the type of primitive. 2016-12-16 04:31:07 +03:00
Ilya Gorbunov
236333e475 Update public API dump for coroutines rev. 2 2016-12-16 04:28:32 +03:00
Stanislav Erokhin
d7566d84d0 Fixed testdata. 2016-12-16 02:01:12 +03:00
Stanislav Erokhin
ab53978793 Allowed ast access for some tests. 2016-12-16 00:57:04 +03:00
Alexey Andreev
bba5c16653 JS: change how coroutine start intrinsic gets detected 2016-12-16 00:57:02 +03:00
Alexey Tsvetkov
3af0840512 Test coroutines setting in Gradle plugin 2016-12-15 23:58:32 +03:00
Alexey Tsvetkov
3e1edf006f Set coroutines setting for JS in Gradle plugin 2016-12-15 23:58:31 +03:00
Mikhail Zarechenskiy
c0a3d3568a Add test on using kotlin.coroutines property in gradle 2016-12-15 23:58:30 +03:00
Mikhail Zarechenskiy
6697c902fc Attempt to add property go kotlin gradle plugin 2016-12-15 23:58:29 +03:00
Stanislav Erokhin
957af61464 Regenerate test generated. 2016-12-15 23:58:28 +03:00
Denis Zharkov
f0cda8ac8d Fix indexing of suspend function types 2016-12-15 23:58:27 +03:00
Stanislav Erokhin
b527a4d158 Global rename in test data for coroutines
(cherry picked from commit 132f97b)
2016-12-15 23:58:26 +03:00
Stanislav Erokhin
8968bc3dd6 RestrictSuspension -> RestrictsSuspendExtensions
(cherry picked from commit 9e0c733)
2016-12-15 23:58:24 +03:00
Denis Zharkov
c73b0d7b76 Move coroutine intrinsics to object (backend's) 2016-12-15 23:58:23 +03:00
Roman Elizarov
7b079bd1f7 Renaming after DM 2016-12-15 23:58:22 +03:00
Denis Zharkov
31081c6702 Minor. Revert some hacks that became unnecessary after interceptResume removal 2016-12-15 23:58:21 +03:00
Alexey Andreev
e2d969d8b0 JS: implement new coroutine convention 2016-12-15 23:58:20 +03:00
Dmitry Petrov
9fd1ac72a9 Purge remaining traces of @AllowSuspendExtensions. 2016-12-15 23:58:19 +03:00
Stanislav Erokhin
5a353412e4 Fixed KeywordCompletionTests. 2016-12-15 23:58:18 +03:00
Mikhail Zarechenskiy
2ff04f2bc5 Import kotlin.coroutines property from gradle to facet 2016-12-15 23:58:17 +03:00
Dmitry Petrov
f19581dc4d Suspend lambdas can't have value parameters (UNSUPPORTED in M04). 2016-12-15 23:58:16 +03:00
Stanislav Erokhin
c5aeaae8e6 Support explicit this receiver (this.foo()) for RestrictSuspension function call. 2016-12-15 23:58:15 +03:00
Dmitry Petrov
8e3fd0efc3 If the last argument of a function is a suspend function,
suggest trailing lambda variant in completion.
2016-12-15 23:58:14 +03:00
Stanislav Erokhin
f9d550732e Minor. remove useless call. 2016-12-15 23:58:13 +03:00
Mikhail Zarechenskiy
4b892b1c9c Report corresponding diagnostic on suspend lambda 2016-12-15 23:58:13 +03:00
Stanislav Erokhin
b88c8ea2e7 Support checks for annotation RestrictSuspension. 2016-12-15 23:58:12 +03:00
Mikhail Zarechenskiy
d1a3c4c48b Fix description of -Xcoroutines key 2016-12-15 23:58:11 +03:00
Mikhail Zarechenskiy
feefe8d6ff Propagate coroutine settings support from facet into the language version settings 2016-12-15 23:58:10 +03:00
Mikhail Zarechenskiy
091756b221 Adapt facet, map coroutine settings on three keys 2016-12-15 23:58:09 +03:00
Alexey Sedunov
9460426d26 Kotlin Facet: Add coroutine support setting 2016-12-15 23:58:08 +03:00
Mikhail Zarechenskiy
664485f4bb Introduce keys to control applicability of coroutines
By default now we produce warnings on coroutines
2016-12-15 23:58:07 +03:00
Dmitry Petrov
30710955dc Minor: 'vararg' is a modifier on value parameters of functional types. 2016-12-15 23:58:06 +03:00
Dmitry Petrov
80bd916f5d 'SuspendFunction$n' should not be visible in member scopes (should be unresolved).
'SuspendFunction$n' class descriptors are created on demand by KotlinBuiltIns (and cached).
On serialization, types constructed with 'SuspendFunction$n' are written as 'Function$n' with extra flag (SUSPEND_TYPE).
On deserialization, corresponding 'SuspendFunction$n' classes are used.
2016-12-15 23:58:05 +03:00
Roman Elizarov
a70ac0160d fixed runWithCurrentContinuation 2016-12-15 23:58:04 +03:00
Denis Zharkov
85db356611 Minor. Drop test on coroutine applicability 2016-12-15 23:58:03 +03:00
Denis Zharkov
4737b3dd7f Update stubBuilder/deserialization tests on coroutines 2016-12-15 23:58:02 +03:00
Dmitry Petrov
a3338b2230 Allow only 'out' modifier for value parameter modifiers in functional type
(comments also mention 'lazy' and 'ref'; these value parameter modifiers are unsupported, anyway).
2016-12-15 23:58:02 +03:00
Dmitry Petrov
eec96f1954 Extension functions & inference. 2016-12-15 23:58:01 +03:00
Denis Zharkov
845e116aa9 Update bytecodeText and bytecodeListing tests on coroutines 2016-12-15 23:58:00 +03:00
Denis Zharkov
8387d04425 Revert "Add special tests for interceptRun support"
This reverts commit 01c21e218a.
2016-12-15 23:57:59 +03:00
Denis Zharkov
7ffefb515f Update test data for LightAnalysis/Coroutines 2016-12-15 23:57:58 +03:00
Stanislav Erokhin
6b4cdee887 Fix deserialization for SuspendFunction. 2016-12-15 23:57:57 +03:00
Stanislav Erokhin
42440f50dc Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor. 2016-12-15 23:57:56 +03:00
Stanislav Erokhin
55983a7808 Support type inference for coroutines. 2016-12-15 23:57:55 +03:00
Stanislav Erokhin
509a504318 Update test data for LookupTracker (removed package kotlin.coroutines from default imports) 2016-12-15 23:57:54 +03:00
Stanislav Erokhin
34a4159a94 Added coroutine import to front-end tests. 2016-12-15 23:57:53 +03:00
Stanislav Erokhin
e014fb7181 Added coroutine import to back-end test. 2016-12-15 23:57:52 +03:00
Stanislav Erokhin
0132f3eea7 Remove kotlin.coroutine package from default imports. 2016-12-15 23:57:51 +03:00
Stanislav Erokhin
7d1b883171 Replace @Suspend to suspend in box tests. 2016-12-15 23:57:50 +03:00
Stanislav Erokhin
90586a5a22 Minor. Add some new test cases for suspend function type inside suspend function type. 2016-12-15 23:57:49 +03:00
Stanislav Erokhin
2671826ed1 Fix front-end test data: replace @Suspend -> suspend. 2016-12-15 23:57:49 +03:00
Stanislav Erokhin
3ea24cbe08 Regenerate DiagnosticsTestGenerated 2016-12-15 23:57:48 +03:00
Stanislav Erokhin
642ea81625 Remove annotation Suspend. Use modificator instead. 2016-12-15 23:57:47 +03:00
Dmitry Petrov
6d73e13798 Generic type arguments inference for lambdas as suspend functions. 2016-12-15 23:57:46 +03:00
Dmitry Petrov
bf987cff5f Tests for basic SuspendFunction-related restrictions (already implemented within type system) 2016-12-15 23:57:45 +03:00
Dmitry Petrov
bc069cd686 Lambda in position with suspend function expected type:
simple case - val initializer.
2016-12-15 23:57:44 +03:00
Dmitry Petrov
9dc458375a Build proper modifier list stubs for 'SuspendFunction$n<...>' types. 2016-12-15 23:57:43 +03:00
Dmitry Petrov
cf4fb1eb25 Since '@A R.() -> T' is now parsed as '@A (R.() -> T)',
receiver type with modifiers or annotations should be surrounded in parentheses on rendering: '(@A R).() -> T'

This also fixes stub builder tests (which check that stubs are consistent with rendered descriptors).
2016-12-15 23:57:42 +03:00
Dmitry Petrov
6e1340da82 Introduce 'SuspendFunction$n<...>' types. 2016-12-15 23:57:41 +03:00
Dmitry Petrov
a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Denis Zharkov
6649f64e9f Support new coroutine convention in JVM backend 2016-12-15 23:57:40 +03:00
Denis Zharkov
5a6b4a3224 Fix compilation 2016-12-15 23:57:22 +03:00
Denis Zharkov
1ab003c029 Support another one coroutine convention in front-end
- There will be no `coroutine` keyword for builders
- They accept a special suspend function type instead
  (it's return type is straightforward, not Continuation<Unit>)
- Instances of these types may be run with special built-in functions
- These built-ins functions are parametrized
  with handleResult/handleException/interceptResume, so these operators
  become unnecessary (and controllers too)

NB: `@Suspend` annotation is subject to replace with the `suspend` modifier
on types
2016-12-15 23:32:11 +03:00
Denis Zharkov
66c2333eb5 Drop checks related to 'coroutine' modifier 2016-12-15 23:32:10 +03:00
Denis Zharkov
b1d1128466 Minor. Move createFunctionType to core
As it will be used in the type mapper soon
2016-12-15 23:32:09 +03:00
Denis Zharkov
72401efb9f Update coroutine related runtime parts 2016-12-15 23:32:08 +03:00
Roman Elizarov
852a5ee064 New coroutine builder convention API 2016-12-15 23:32:07 +03:00
Dmitry Jemerov
b4af532cf0 Remove "experimental" tag from JS features in the UI
#KT-15175 Fixed
2016-12-15 18:03:00 +01:00
Alexey Andreev
1bcb225afa JS: fix translation of invoke convention call when it is declared as extension member inside class. See KT-15073 2016-12-15 19:53:37 +03:00
Alexey Andreev
91aeeb20e8 JS: add test to prove that anonymous function that declares lambda is translated correctly. See KT-11589 2016-12-15 19:53:37 +03:00
Alexey Andreev
c82f8213b0 JS: extract outer class reference as dispatchReceiver from ResolvedCall, to include it into UsageTracker mechanism. This allows to capture outer class of super class in local classes. See KT-13166 2016-12-15 19:05:34 +03:00
Alexey Andreev
87f4e53544 JS: when translating nested classes of local classes, capture closure variables via outermost local class. See KT-12566 2016-12-15 19:05:34 +03:00
Alexey Andreev
b50bfaf071 JS: add test to prove that KT-14419 is not more reproducible. Add test to prove that extension delegate with extension getValue is translated correctly. 2016-12-15 19:05:33 +03:00
Alexey Andreev
b21f906856 JS: add tests to prove that compiler does not optimize RTTI and safe calls based on type information. Remove corresponding optimization for !! operation. See KT-14033 2016-12-15 19:05:33 +03:00
Alexey Andreev
e6501591fa JS: serialize type of local anonymous class as its denotable supertype. See KT-14888 2016-12-15 19:05:32 +03:00
Alexey Andreev
b08afb0e93 JS: prohibit overriding external functions with optional parameters by non-external fake functions 2016-12-15 19:05:32 +03:00
Alexey Andreev
e2dab5ab5c JS: prohibit overriding external functions with optional parameters by non-external functions. See KT-13889 2016-12-15 19:05:32 +03:00
Yan Zhulanow
f3d001077b Move Maven subplugin test to kotlin-maven-plugin-test module 2016-12-15 18:36:17 +03:00
Anton Bannykh
1957ac347a JS: make enum valueOf() throw if not found. 2016-12-15 17:58:40 +03:00
Anton Bannykh
e0c75f1fb8 JS: initialize enum 'name' and 'ordinal' properties before translating other property initializers. 2016-12-15 17:58:40 +03:00
Anton Bannykh
addd24955b JS: support enumValues<E>() and enumValueOf<E>("name") intrinsics. 2016-12-15 17:58:40 +03:00
Alexey Tsvetkov
c31f91c28a Introduce Gradle multiplatform plugin 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov
d1156211a8 Make JS header/impl name clash checks independent of sources order
If an impl source was placed before a header in a sources list,
the JS_NAME_CLASH error would be reported.
2016-12-15 16:43:35 +03:00
Alexey Tsvetkov
34b740e2f7 Minor: add debug test util 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov
93fa27a195 Provide default output JS file in Kotlin Gradle plugin 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov
232b40eb36 Extract throwGradleExceptionIfError 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov
5a846f94fc Rename: SourceRoots.ForJs->KotlinOnly 2016-12-15 16:43:35 +03:00
Mikhail Glukhikh
295360ad3e Navigation from header to implementation and vice versa #KT-15204 Fixed 2016-12-15 15:50:19 +03:00
Zalim Bashorov
2277239ab3 KJS: don't export declarations marked as external or annotated by native or library annotations 2016-12-15 14:49:31 +03:00
Zalim Bashorov
b42fe06933 KJS: fix compiler crash when using inline function inside string template
#KT-12586 Fixed
2016-12-15 14:49:31 +03:00
Zalim Bashorov
8ccc00f3d4 KJS: deprecate enumerable annotation since it's no longer has any effect and rewrite test which checks enumerability of members 2016-12-15 14:49:31 +03:00
Nikolay Krasko
d0d583e8ee Do indent adjustment on the fly only for the first element in the line (KT-15123)
Don't interfere spacing for dot in range operator.

 #KT-15123 Fixed
2016-12-15 14:33:18 +03:00
Nikolay Krasko
ab04f900df Add name of script file to script module info 2016-12-15 14:33:16 +03:00
Nikolay Krasko
868495437c Filter out first dependency from module dependencies 2016-12-15 14:33:14 +03:00
Nikolay Krasko
e359b9b6de Remove the code for idea 144 2016-12-15 14:33:13 +03:00
Nikolay Krasko
88b3d9ff3f Make sdk info and library info difference more clear in debugger 2016-12-15 14:33:11 +03:00
Ilya Gorbunov
9acfde7c5a Revert changes from daac46b since kotlin.Comparator now has lower priority than explicit star-import of java.util.* 2016-12-15 13:39:10 +03:00
Ilya Gorbunov
3bedbfae33 Move kotlin.comparisons.Comparator to kotlin package and remove the former from default imports. 2016-12-15 13:39:10 +03:00
Alexander Udalov
9218965821 Minor, add an enlightening comment to plugins/verify.groovy at Maven plugin tests 2016-12-15 13:07:22 +03:00
Alexander Udalov
954db037dc Minor, fix warning by adding a TODO 2016-12-15 12:12:07 +03:00
Alexander Udalov
90eb229036 Extract compiler-for-maven target in build.xml
To be used after "compiler-quick" to quickly test changes to the compiler in
the Maven build
2016-12-15 12:11:31 +03:00
Alexander Udalov
afdeb3339f Run Make without error check before "Generate Tests"
This is needed to simplify merge conflict resolution in case when only
generated tests have conflicts
2016-12-15 11:46:18 +03:00
Alexander Udalov
e50b102e89 Treat absence of version in SinceKotlinInfo as infinite version
This may be needed in the future to make some declarations erroneous for all
versions of compilers
2016-12-15 11:46:18 +03:00
Alexander Udalov
ede60efda5 Support SinceKotlinInfo for deserialized classes 2016-12-15 11:46:18 +03:00
Alexander Udalov
6393ac5871 Check language version for deprecation via SinceKotlinInfo 2016-12-15 11:46:17 +03:00
Alexander Udalov
5c1adb1258 Serialize SinceKotlinInfo and SinceKotlinInfoTable 2016-12-15 11:46:17 +03:00
Alexander Udalov
feeed98323 Introduce SinceKotlinInfo, load from serialized metadata
This is a way for future compilers to cause previous compilers to report
diagnostics on usages of some declarations. Diagnostic can have a message
(and/or error code), level (error, warning, or completely hide the declaration
from the resolution), and Kotlin version, since which the diagnostic should no
longer be reported
2016-12-15 11:46:17 +03:00
Alexander Udalov
212240a008 Collect all deprecations, do not stop on the first found one
#KT-15245 In Progress
2016-12-15 11:46:17 +03:00
Alexander Udalov
82703d9cfd Minor refactoring in deprecationUtil.kt
Split getDeclaredDeprecatedAnnotation into two methods for clarity
2016-12-15 11:46:16 +03:00
Alexander Udalov
122c631fcf Refactor getDeprecation() -> getDeprecations()
In subsequent commits, another kind of deprecation is introduced which should
be reported alongside with deprecation by the `@Deprecated` annotation
2016-12-15 11:46:16 +03:00
Mikhail Glukhikh
3540bc008b Build fix: testPlatform3 from MultiModuleHighlightingTest 2016-12-15 11:07:33 +03:00
Ilya Chernikov
d78fc50e90 Fix after review 2016-12-15 07:26:08 +01:00
Ilya Chernikov
f036422ee9 Refactor eval code to avoid compiler (codegen) hangings on various loops inside RW locks 2016-12-15 07:26:08 +01:00
Ilya Chernikov
038491399b Copy (partly) context classpath extraction code from script-util to JSR223 4 Idea, use it there 2016-12-15 07:26:08 +01:00
Ilya Chernikov
632dba8228 minor: improve daemon test stability 2016-12-15 07:26:08 +01:00
Ilya Chernikov
fc416476a8 Move invokable parts to JSR223 only, remove unneeded code 2016-12-15 07:26:08 +01:00
Ilya Chernikov
aab1759dc5 Improve test in script-util (not fixed for TC yet) 2016-12-15 07:26:07 +01:00
Ilya Chernikov
b1cd98f2d5 Refactor and fix script annotation processing 2016-12-15 07:26:07 +01:00
Ilya Chernikov
1cc85df78e Refactor REPL infrastructure for passing evaluation/invoke wrapper to every eval/invoke function 2016-12-15 07:26:07 +01:00
Ilya Chernikov
cb7f22ffec Refactor JSR223 to support Compilable interface, drop daemon eval engine and sample, simplify 2016-12-15 07:26:07 +01:00
Ilya Chernikov
b19d61e2f4 Refactor annotation resolving, some tests fixed, more tests needed 2016-12-15 07:26:07 +01:00
Ilya Chernikov
7c8b6ddca4 Implement proper collection of script compilation classpath, use it in the JSR223 example factories
Fixes #KT-14713
2016-12-15 07:26:07 +01:00
Ilya Chernikov
f60eb42420 Add script runtime to maven, fixes #KT-14708 2016-12-15 07:26:07 +01:00
Ilya Chernikov
28b01126d9 Improve type boundaries for KotlinScriptDefinition interface 2016-12-15 07:26:07 +01:00
Ilya Chernikov
cfcd3b8186 Refactor script.util templates 2016-12-15 07:26:07 +01:00
Ilya Chernikov
eb3d8a1a4a Fix classpah update moment on script dependencies calculations 2016-12-15 07:26:06 +01:00
Ilya Chernikov
c01959333a Replace kotlin general runtime with script runtime in JSR223 sample factories, fixes tests 2016-12-15 07:26:06 +01:00
Ilya Chernikov
83420e26b6 Improve script template not found diagnostics
(preliminary, see also TODO)
2016-12-15 07:26:06 +01:00
Ilya Chernikov
c82e91eafe Implement Invocable on base evaluator and locally-evaluating JSR223 sample engines
fixes #KT-14707
2016-12-15 07:26:06 +01:00
Ilya Chernikov
fbd4c6eb61 Implement invokable/invoker interface on the generic repl evaluator, refactor reflection utils on the way 2016-12-15 07:26:06 +01:00
Ilya Chernikov
7a79fff9d6 Put lines history into all data structures returned by repl, refactor storage and passing of the history for that 2016-12-15 07:26:06 +01:00
Ilya Chernikov
125cc6ebfb Fix compiled line class loading in repl, fixes #KT-14706 2016-12-15 07:26:06 +01:00
Stanislav Erokhin
3600b51d90 Minor. fix test data. 2016-12-14 23:59:38 +03:00
Stanislav Erokhin
457918a6dd Changed name resolution for dynamic extension. Added annotation DynamicExtension. 2016-12-14 21:36:26 +03:00
Yan Zhulanow
91fcb15f3e Kapt3: Set javac codepage to UTF-8 (KT-15232) 2016-12-14 20:53:34 +03:00
Yan Zhulanow
e70c172deb Android Gradle plugin: Fix compatibility with Android Gradle Plugin 2.3 (KT-15246) 2016-12-14 20:53:14 +03:00
Ilya Gorbunov
bc944961f1 Use internal published-api function to validate radix in string-number conversion functions.
#KT-8286
2016-12-14 17:20:44 +03:00
Mikhail Zarechenskiy
2d08ff4862 Adapt JS translator to new operator rem 2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
5b5d09b6b2 Fix test data: rename 'mod' to 'rem' 2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
c15c00677e Add operator 'rem' as extension to BigDecimal
Deprecate 'mod' operator
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
5a829809d9 Add operator 'rem' as extension to BigInteger
#KT-14650 Fixed

 Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
e83568bcf3 Update test data after adding operator rem to builtIns 2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
e67543e08e Revert "Update test data as operator 'mod' became deprecated"
This reverts commit 040f4e90ce.
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
42d867b3bf Support number conversion for binary 'rem' operator 2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
62ac91a121 Add operator 'rem' to builtIns
Also deprecate operator 'mod'
2016-12-14 15:29:00 +03:00
Nikolay Krasko
2bb48fc802 Allow empty single-line bodies in property accessors 2016-12-14 13:40:44 +03:00
Nikolay Krasko
2841931ffa Do not force new line in body for empty functions and function expressions (KT-10828)
#KT-10828 Fixed
2016-12-14 13:35:31 +03:00
Mikhael Bogdanov
268d55104c Don't generate delegation to java default methods
#KT-15226  Fixed
2016-12-14 11:20:04 +01:00
Stanislav Erokhin
653d589f98 FIx tests after renaming platform to header. 2016-12-13 23:08:47 +03:00
Alexander Udalov
bd74ef4536 Minor, capitalize entry names in manifest 2016-12-13 21:09:00 +03:00
Alexander Udalov
d0fa9bac75 Introduce '-Xskip-runtime-version-check' command line option 2016-12-13 21:09:00 +03:00
Alexander Udalov
6aaf2c7c4d Decrease number of reported runtime version diagnostics
If there's at least one runtime newer than the compiler, do not report that
it's inconsistent with the correct runtime
2016-12-13 21:09:00 +03:00
Alexander Udalov
2c527d89ab Improve diagnostics for runtime versions consistency checker
- report the diagnostic on the actual problematic file
- output the list of all runtime jars if min version != max version
2016-12-13 21:09:00 +03:00
Alexander Udalov
d3e5580ab9 Use MavenComparableVersion in runtime version consistency checker
LanguageVersion is an enum consisting of the current and all previous versions
only, so with it we won't be able to detect the language version of a future
runtime
2016-12-13 21:08:59 +03:00
Dmitry Petrov
1866a33781 Check classpath version consistency.
Add 'Kotlin-version' attribute to kotlin-runtime and kotlin-reflect JARs.
2016-12-13 21:08:59 +03:00
Mikhail Glukhikh
ab72460f28 Rename: allDependentModules --> allDependencyModules 2016-12-13 19:07:07 +03:00
Mikhail Glukhikh
052a5033b5 PLATFORM_DECLARATION_WITHOUT_DEFINITION rendering changed (platform is included into diagnostic text now) 2016-12-13 19:06:08 +03:00
Mikhail Glukhikh
7649232f86 Platform header annotator: implementation + simple multi-platform highlighting tests #KT-14905 Fixed 2016-12-13 19:02:23 +03:00
Mikhail Glukhikh
9ec1c5dc35 Infrastructure change: each header module now knows implementing modules list 2016-12-13 18:54:01 +03:00
Mikhail Glukhikh
57da92b862 Infrastructure change: module descriptor now knows its platform kind & its sources kind 2016-12-13 18:53:55 +03:00
Mikhail Glukhikh
d32ab9d4d6 Cleanup: generate tests 2016-12-13 18:53:49 +03:00
Mikhail Glukhikh
04df23941f Minor fix of problem with non-existent ProjectFileIndex 2016-12-13 18:53:44 +03:00
Stanislav Erokhin
59efedf610 Rename platform to header. 2016-12-13 18:00:00 +03:00
Mikhael Bogdanov
facee84020 Temporary remove JVM_1_8 target from facet settings 2016-12-13 14:51:27 +01:00
Mikhael Bogdanov
dc5c3a478c Always use default 1.6 build target unless of 'jvm-target' option 2016-12-13 14:51:27 +01:00
Mikhail Zarechenskiy
ef662a5679 Declare intrinsic rem operator for primitives 2016-12-13 16:33:33 +03:00
Dmitry Jemerov
66f58c08b2 To avoid obtaining stub-based types with no underlying AST node, create class types from reference elements manually 2016-12-13 12:44:02 +01:00
Dmitry Jemerov
502e99e918 Don't expect library classes to be shown in hierarchy view when using production scope 2016-12-13 12:43:55 +01:00
Dmitry Jemerov
aad945e629 Run Gradle inspection test in EDT 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
5cd9c0f729 Recognize new class finder added in 2016.3 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
b8dc1b6771 Allow regex matching of available action names; accept both 2016.2 and 2016.3 names of static import quickfix 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
76b5eadbaa Mark file writable before creating intention delegate (change of writable property can increment out-of-code-block modification count, which recreates the cached resolve session) 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
16e648e333 More sensible implementation of caching quickfix data between multiple fixes 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
a3aa2ca81e Use BodyResolveMode.PARTIAL_WITH_DIAGNOSTICS for checking whether an auto-import is still required 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
4f916773c2 Add missing preparePsiElementForWrite() call 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
baad540516 Workaround for added @NotNull annotation on ProjectFileIndex.getInstance() 2016-12-13 12:40:03 +01:00
Dmitry Jemerov
24c1d9f90b Compilation fix due to added @NotNull annotation on MoveFilesOrDirectoriesUtil.doMoveFile 2016-12-13 12:40:03 +01:00
Alexey Andreev
d9cf15a665 JS: deparenthesize LHS of assignment before choosing appropriate AccessTranslator. Fix KT-15169 2016-12-13 14:05:25 +03:00
Alexey Andreev
52347aa901 JS: increase JS metadata version due to some breaking changes (JsModule, for example) 2016-12-13 14:00:10 +03:00
Alexey Andreev
9dc16f0564 JS: prohibit runtime annotations on external declarations. Warn about runtime annotation in remaining cases. See KT-13895 2016-12-13 13:58:41 +03:00
Stanislav Erokhin
dbe8edda5f Remove propertyDelegate and fix unused parameter checker for provideDelegate. 2016-12-12 23:14:09 +03:00
Stanislav Erokhin
9dc9fb578f Rename toDelegateFor to provideDelegate. 2016-12-12 23:14:07 +03:00
Stanislav Erokhin
db5250a614 Minor. Update Lookup test data. 2016-12-12 23:14:06 +03:00
Alexey Andreev
a01fac9d10 JS: support toDelegateFor in JS backend (see KT-15163) 2016-12-12 23:14:05 +03:00
Mikhael Bogdanov
937a933150 Support local 'toDelegatedFor' properties 2016-12-12 23:14:02 +03:00
Mikhael Bogdanov
c5e14a2059 Some new tests for 'toDelegateFor' 2016-12-12 23:14:01 +03:00
Dmitry Petrov
97d5bbf1c2 toDelegateFor: JVM BE implementation 2016-12-12 23:13:59 +03:00
Dmitry Petrov
e2b6d2d849 Drop 'propertyDelegated' convention (without additional deprecation ceremony). 2016-12-12 23:13:58 +03:00
Dmitry Petrov
5ddf8e60e6 Use delegate initializer expression resolution scope for 'toDelegateFor' resolution. 2016-12-12 23:13:57 +03:00
Dmitry Petrov
a6bc7271ae operator toDelegateFor: add front-end test for local delegate property 2016-12-12 23:13:56 +03:00
Dmitry Petrov
2ee31916c7 'createDelegate' operator renamed to 'toDelegateFor' 2016-12-12 23:13:55 +03:00
Dmitry Petrov
e2ba288323 'createDelegate' operator convention:
- resolution & inference
- additional diagnostic for language feature support
2016-12-12 23:13:54 +03:00
Dmitry Petrov
d3ab0f066e 'createDelegate' operator declaration 2016-12-12 23:13:53 +03:00
Dmitry Petrov
558e8aaebb DelegatedPropertyResolver: convert to Kotlin & cleanup. 2016-12-12 23:13:52 +03:00
Dmitry Petrov
85276c27f0 DelegatedPropertyResolver: .java --> .kt 2016-12-12 23:13:51 +03:00
Dmitry Jemerov
7e92cf2af7 Don't create light classes for platform declarations
#KT-15137 Fixed
2016-12-12 20:47:45 +01:00
Dmitry Jemerov
b4dd54f874 Add element validity check to KotlinRunConfigurationProducer.getStartClassFqName() (EA-86393 - PIEAE: PsiFileImpl.getText) 2016-12-12 17:50:28 +01:00
Dmitry Jemerov
2cc42ba151 Highlight code fragments only when they have a context (part of EA-84233 - assert: GetModuleInfoKt$getModuleInfo$.invoke) 2016-12-12 17:50:27 +01:00
Dmitry Jemerov
d6cd1486c6 Implement supertype access methods in KtLightClassForFacade without delegate access (EA-92490 - ISE: KtLightClassForFacade.getClsDelegate) 2016-12-12 17:50:27 +01:00
Dmitry Jemerov
48513c7b1d Better diagnostics for "no resolver for module descriptor" situation (EA-72838 - ISE: EmptyResolverForProject.resolverForModuleDescriptor) 2016-12-12 17:50:26 +01:00
Dmitry Jemerov
bd0aa5a358 Avoid committing document in KDoc beforeCharTyped handler (EA-88521 - assert: PsiDocumentManagerBase.commitDocument) 2016-12-12 17:50:20 +01:00
Dmitry Jemerov
7f02c67fbf Avoid NPE while calculating assertion message (EA-92384 - NPE: KtElementImpl.getContainingKtFile) 2016-12-12 17:50:19 +01:00
Dmitry Jemerov
d5e90b4123 Remove unnecessary uses of getContainingKtFile() (EA-83360 - CCE: KtElementImplStub.getContainingKtFile) 2016-12-12 17:50:11 +01:00
Dmitry Jemerov
b5ad1e1be5 Check for file validity before calling findFileByRelativePath() (EA-92325 - IVFAE: VirtualDirectoryImpl.doFindChild) 2016-12-12 17:50:10 +01:00
Roman Elizarov
8affb2726f Pluggable Synthetic Objects 2016-12-12 18:43:26 +03:00
Simon Ogorodnik
7a4b6a1462 Fix for EA-89556 - (from J2K) ROME: DocumentImpl.replaceString 2016-12-12 18:35:16 +03:00
Dmitry Jemerov
13b8494373 Remove unnecessary cyclic dependency between KtStubElementTypes and KtNodeTypes
#KT-15074 Fixed
2016-12-12 16:26:58 +01:00
Dmitry Jemerov
a7bd910dbb Don't try to calculate icon for invalid PSI elements
#KT-13443 Fixed
2016-12-12 16:24:51 +01:00
Simon Ogorodnik
fb5398cdcd Fix for KT-14885 J2K on paste adds duplicated imports 2016-12-12 18:16:17 +03:00
Alexey Andreev
39de1a7659 JS: generate temporary names for function parameters. Remove tests for js() function that references parameters. Remove such usages of js() function from stdlib 2016-12-12 14:30:45 +03:00
Alexey Andreev
b634c2cbe3 JS: declare names for native declaration in root scope, to avoid clashing between inner names and global native names. Fix KT-14806 2016-12-12 14:30:45 +03:00
Alexey Andreev
9c9b23a0fb JS: fix translation of local function in lambdas 2016-12-12 14:30:44 +03:00
Alexey Andreev
8ef72935a8 JS: fix translation of try statements with multiple catches 2016-12-12 14:30:44 +03:00
Alexey Andreev
d9e0e9f0b3 JS: don't resolve unused temporaries 2016-12-12 14:30:43 +03:00
Alexey Andreev
1db4765801 JS: unmute shared box test that now passes 2016-12-12 14:30:43 +03:00
Alexey Andreev
e54138b74f JS: use temporary names while translation, replace with fixed name during post-processing pass 2016-12-12 14:30:42 +03:00
Vyacheslav Gerasimov
9c78301008 Invoke rename handler with editor if possible in IllegalIdentifierInspection.RenameIdentifierFix
#KT-14760 Fixed
#KT-11646 Fixed
2016-12-12 13:47:58 +03:00
Mikhael Bogdanov
1f26c3098f Binary compatibility validator tests update according to new @PublishedApi annotation 2016-12-12 10:25:05 +01:00
Alexander Udalov
91cf09dc3b Fix test on IS_PRE_RELEASE
Use DeserializedDescriptorResolver.IS_PRE_RELEASE instead of
KotlinCompilerVersion.IS_PRE_RELEASE because the former is updated correctly in
tests

(cherry picked from commit 95b4b6e7d9)
2016-12-12 11:29:22 +03:00
Ilya Gorbunov
b3b2a5eb91 Update ranges codegen light-analysis testData. 2016-12-11 21:26:06 +03:00
Yan Zhulanow
2f50bd8c80 Minor: Fix light analysis tests (rebase to master) 2016-12-11 21:03:05 +03:00
Mikhail Zarechenskiy
40ff7c6e33 Fix test data 2016-12-09 21:08:29 +03:00
Yan Zhulanow
8afac55a90 Kapt3, Minor: Sort stubs output in tests 2016-12-09 20:53:48 +03:00
Yan Zhulanow
7644724cd3 Kapt3: Fix tests (parameter names are not provided for abstract methods in 1.1) 2016-12-09 20:48:24 +03:00
Yan Zhulanow
5061bab794 Kapt3: Add property annotation holder methods to Java stubs (KT-13767) 2016-12-09 20:40:35 +03:00
Yan Zhulanow
e3db014c27 Kapt3: Allow to use ':' in annotation processor option value (KT-15139) 2016-12-09 20:29:34 +03:00
Yan Zhulanow
3ecac1bbd3 Kapt3: Make 'kaptTest' configuration extend 'kapt' (KT-10190) 2016-12-09 20:29:29 +03:00
Yan Zhulanow
3f8accc2bf Kapt3: Fix '$' in function generic signatures (KT-15148) 2016-12-09 20:29:23 +03:00
Yan Zhulanow
d726d0de88 Kapt3: Use annotation processor options from variant data options. This fixes DataBinding on Android Gradle plugin 2.3 (KT-14816) 2016-12-09 20:29:19 +03:00
Yan Zhulanow
40ef487129 Kapt3, Minor: Flush logs before throwing parse error exception 2016-12-09 20:29:14 +03:00
Yan Zhulanow
c0b772a896 Kapt3: Fix signature clash (return type is different) for non-generic methods 2016-12-09 20:28:57 +03:00
Yan Zhulanow
5f0d270e9e Kapt3: Clear javac's boot classpath (KT-15001) 2016-12-09 20:28:52 +03:00
Yan Zhulanow
ada8bb63a4 Kapt3: Separate classpaths for compilation and for annotation processing 2016-12-09 20:28:46 +03:00
Yan Zhulanow
3c77242da2 Kapt3: Fix parameter names in JvmOverloads-generated methods (KT-15024) 2016-12-09 20:28:41 +03:00
Yan Zhulanow
77153f0926 Kapt3: Fix "Parameter names are clashing in inner class constructor" (KT-14998) 2016-12-09 20:28:36 +03:00
Yan Zhulanow
b9a0a4f3db Kapt3: Ensure that field types and method return types are not anonymous (KT-14997) 2016-12-09 20:28:31 +03:00
Yan Zhulanow
01c76153c7 Kapt3: Allow function overloads based on return type (KT-14996). Fix wrong facade class name inside the default package 2016-12-09 20:28:25 +03:00
Yan Zhulanow
6217d21c24 Kapt3: Kapt3 fails on several top-level functions in one package (KT-14991) 2016-12-09 20:28:20 +03:00
Yan Zhulanow
34316d09bf Kapt3: Close annotation processing ClassLoader (KT-9440) 2016-12-09 20:28:11 +03:00
Yan Zhulanow
de15003706 Minor: Add sam-with-receiver to Ultimate project classpath, fix cli plugin path in build.xml 2016-12-09 20:26:41 +03:00
Yan Zhulanow
cbef0250aa Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848) 2016-12-09 20:01:21 +03:00
Yan Zhulanow
fc8cc217dc Do not create local variables in an abstract class inside OptimizationMethodVisitor, MethodNode forbids this. 2016-12-09 20:01:19 +03:00
Yan Zhulanow
3b65cb1ef2 Check if modality is refined in "Redundant modifier" inspection 2016-12-09 20:01:18 +03:00
Yan Zhulanow
0a2b52c1ed Minor: Add allopen-ide and allopen-noarg to "idea" module test classpath 2016-12-09 20:01:16 +03:00
Yan Zhulanow
a22e5d446b NoArg: Add Maven plugin 2016-12-09 20:01:15 +03:00
Yan Zhulanow
c705f0c437 NoArg: Add IDE integration 2016-12-09 20:01:14 +03:00
Yan Zhulanow
be26246a3e Noarg: Add a kotlin-noarg Gradle plugin 2016-12-09 20:01:12 +03:00
Yan Zhulanow
e626b121ad NoArg: Add compiler plugin 2016-12-09 20:01:10 +03:00
Yan Zhulanow
6abde4223b AllOpen: Add IDE integration 2016-12-09 20:01:07 +03:00
Yan Zhulanow
4d638c2cfd Allopen: Add Maven plugin for all-open 2016-12-09 20:01:05 +03:00
Sergey Mashkov
0f5d51a5c2 Resolve dependency jars 2016-12-09 20:01:04 +03:00
Sergey Mashkov
3149c75130 Add integration test for Kotlin compiler plugin for Maven 2016-12-09 20:01:01 +03:00
Sergey Mashkov
f59377011c Initial Kotlin plugin support in Maven 2016-12-09 20:01:00 +03:00
Yan Zhulanow
ed7c38fb96 Allopen: Add allopen Gradle subplugin 2016-12-09 20:00:57 +03:00
Yan Zhulanow
f57df272ac Allopen: Handle allopen annotations on classes (KT-12149) 2016-12-09 20:00:56 +03:00
Yan Zhulanow
58f408e173 Allopen: Add allopen compiler plugin 2016-12-09 20:00:54 +03:00
Mikhail Zarechenskiy
d66fdc95fb Regenerate tests after rebase 2016-12-09 17:01:43 +03:00
Mikhail Zarechenskiy
373c1be7e4 Add quick fixes for mod/rem migration
- Remove 'operator' modifier
 - Rename operator 'mod/modAssign' to 'rem/remAssign'
2016-12-09 17:01:42 +03:00
Mikhail Zarechenskiy
7a0e44b8f9 Resolve '%' as 'mod' when LV=1.0 2016-12-09 17:01:41 +03:00
Mikhail Zarechenskiy
f37b7224da Fix test: do not propose to change 'mod' to '%' 2016-12-09 17:01:32 +03:00
Mikhail Zarechenskiy
7a09faa606 Fix test on JS conventions 2016-12-09 17:00:41 +03:00
Mikhail Zarechenskiy
d8330c3f14 Adapt JS translator to able work with deprecated 'mod' operator 2016-12-09 17:00:40 +03:00
Mikhail Zarechenskiy
bc4a492f4d Resolve for rem/modAssign and mod/remAssign
rem/remAssign always wins if it is possible
2016-12-09 17:00:27 +03:00
Mikhail Zarechenskiy
8e73a902e4 Additional tests on mod/rem migration 2016-12-09 16:59:26 +03:00
Mikhail Zarechenskiy
040f4e90ce Update test data as operator 'mod' became deprecated
Revert this commit after changing 'mod' to 'rem' in stdlib
2016-12-09 16:59:25 +03:00
Mikhail Zarechenskiy
5f71f1bcad Add warnings at declaration and call sites of operator 'mod' 2016-12-09 16:59:24 +03:00
Mikhail Zarechenskiy
97ca51381a Gradual migration of operator 'mod' to 'rem'
- Introduce new 'rem' operator convention
 - Prefer 'rem()' to 'mod()' when both are available, even if mod() is a
   member, and rem() -- an extension
 - Place operator 'rem' under the language feature
2016-12-09 16:43:35 +03:00
Alexey Andreev
2df9daab1f JS: prohibit private inline members of external classes, since KT-14031 was postponed 2016-12-09 15:13:10 +03:00
Alexey Andreev
df34e69d7d JS: prohibit inheritance of external classes from non-external (see KT-15130) 2016-12-09 15:13:09 +03:00
Alexey Andreev
fff1af4ff6 JS: allow to inherit external classes with overloaded functions in case we don't override them (see KT-13910). 2016-12-09 15:13:09 +03:00
Alexey Andreev
ecb498717a JS: rework diagnostics names. Prohibit external inner classes (see KT-14027) 2016-12-09 15:13:08 +03:00
Alexey Andreev
cf8161507c JS: prohibit private members of external classes (see KT-14029) 2016-12-09 15:13:08 +03:00
Alexey Andreev
212b9f37b3 JS: get rid of external extension functions and properties in stdlib 2016-12-09 15:13:08 +03:00
Alexey Andreev
3882bf7564 JS: prohibit native (external) extension properties and functions. See KT-13896 2016-12-09 15:13:07 +03:00
Alexey Andreev
cf25e17209 JS: add tests that emulates promises and wraps them in coroutines, using suspend functions outside of controller 2016-12-09 14:56:21 +03:00
Alexey Andreev
060f08a8dd JS: add support of interceptResume function in coroutine controller 2016-12-09 14:56:20 +03:00
Alexey Andreev
9eff193ea4 JS: support stack unwinding convention in coroutines 2016-12-09 14:56:20 +03:00
Alexey Andreev
bdda04243d JS: support new coroutine convention (see KT-15058) 2016-12-09 14:56:19 +03:00
Alexey Andreev
bf74400776 JS: re-enable coroutine tests for JS backend 2016-12-09 14:56:19 +03:00
shiraji
44ca45123d KT-15142 Remove redundant calls of the conversion method wrongly shown for Any?.toString
#KT-15142 Fixed
2016-12-09 14:33:55 +03:00
Mikhael Bogdanov
18cb734c58 Do not mangle internal @PublishedApi functions 2016-12-09 11:55:16 +01:00
Mikhael Bogdanov
5ffc0b36b0 Quickfix for published api 2016-12-09 11:55:16 +01:00
Mikhael Bogdanov
f4259c5f82 Added deprecation for protected call within inline functions 2016-12-09 11:55:16 +01:00
Mikhael Bogdanov
00e2463014 Effective visibility refactoring: calculate parent decriptor lazily, support checkPublishedApi flag 2016-12-09 11:55:15 +01:00
Mikhael Bogdanov
7af327c567 Added 'checkPublishedApi' to effective visibility checker 2016-12-09 11:55:15 +01:00
Mikhael Bogdanov
038065e827 Updated NON_PUBLIC_CALL_FROM_PUBLIC_INLINE diagnostic to support @PublishedApi 2016-12-09 11:55:15 +01:00
Mikhael Bogdanov
7ea29d3397 Wrong @PublishedApi usage diagnostic 2016-12-09 11:55:15 +01:00
Mikhael Bogdanov
58263c46cc Compatibility validator update 2016-12-09 11:55:15 +01:00
Mikhael Bogdanov
95a47e56f7 InlineExposed usages are changed to PublishedApi 2016-12-09 11:55:14 +01:00
Alexey Andreev
0f813d5cfe JS: fix compiling stdlib tests in JS 2016-12-09 12:04:32 +03:00
Alexey Andreev
cc819928de JS: prevent Any.equals from mangling 2016-12-09 12:04:31 +03:00
Alexey Andreev
a2d45153ba JS: prohibit dynamic on RHS of in and !in operators (see KT-6579) 2016-12-09 12:03:52 +03:00
Alexey Andreev
fc6eaa015f JS: prohibit using more than one argument in indexed access with dynamic receiver (see KT-6580) 2016-12-09 12:03:51 +03:00
Mikhael Bogdanov
627dd66ed5 New ieee754 arithmetic, Fix for KT-14651: Floating point comparisons shall operate according to IEEE754 2016-12-09 09:48:46 +01:00
Mikhael Bogdanov
f9b40585cd Partial fix for KT-14989: Missed null check for platform type 2016-12-09 09:46:38 +01:00
Alexander Udalov
88f0c32b2c Treat binaries with version 1.1.2 as pre-release
Metadata version is 1.1.2 since the start of Kotlin 1.1 EAP. Because the
pre-release flag was not written to class files compiled with 1.1 EAP, there's
no other way to figure out that they're pre-release except than to look at the
metadata version. This assumes that the version will be advanced to 1.1.3 once
Kotlin 1.1 is released
2016-12-09 01:59:37 +03:00
Alexander Udalov
513ebb9729 Suggest to use "-Xskip-metadata-version-check" on incompatible classes in classpath 2016-12-09 01:59:36 +03:00
Alexander Udalov
830d2f6603 Do not fail when deserializing incompatible metadata
Catch all exceptions when deserializing metadata with an incompatible version
to prevent the compiler from failing on discovering incompatible classes on the
classpath. Note that this is not the perfect solution: any invariant may be
broken in the incompatible metadata and it may result in a later exception
2016-12-09 01:59:36 +03:00
Alexander Udalov
789483e1eb Remove old mechanism of metadata version error reporting 2016-12-09 01:59:36 +03:00
Alexander Udalov
b943ed26f3 Report incompatible metadata version error correctly
Similarly to pre-release classes, load metadata for the class anyway and allow
the resolution to select it as the result and prohibit its usage in the end
with the special diagnostic reported in MissingDependencyClassChecker
2016-12-09 01:59:36 +03:00
Alexander Udalov
d204fa91cc Use "-Xskip-metadata-version-check" to load pre-release classes 2016-12-09 01:59:35 +03:00
Alexander Udalov
7de0cfde16 Report error on pre-release top level members 2016-12-09 01:59:34 +03:00
Alexander Udalov
11f975fe89 Add classifier usage checker for missing dependency classes
This has no effect for the original use case of mock class descriptors
(unresolved classes used in libraries), but is necessary for pre-release
classes in case the compiler is a release, because such classes end up in scope
and can be the result of the resolution
2016-12-09 01:59:33 +03:00
Alexander Udalov
4e99349f1f Write "pre-release" flag to class files, do not allow usages in release 2016-12-09 01:59:33 +03:00
Alexander Udalov
1342743001 Add KotlinVersion.IS_PRE_RELEASE and a flag to kotlin/Metadata 2016-12-09 01:59:33 +03:00
Ilya Gorbunov
3e69820907 Fix ClosedComparableRange.contains implementation, add docs. 2016-12-08 22:13:02 +03:00
Ilya Gorbunov
8ec2a2e6fe Add NaN-propagation in coerceIn(ClosedComparableRange<Double>) 2016-12-08 22:13:00 +03:00
Ilya Gorbunov
ea77673dde Reimplement coerceIn to range with new range functions: lessThanOrEquals. 2016-12-08 20:50:26 +03:00
Ilya Gorbunov
d60fc7d9a8 Introduce ClosedComparableRange interface which inherits ClosedRange to provide special comparison operation for double and float. 2016-12-08 20:50:11 +03:00
Ilya Gorbunov
5773594412 Reimplement ClosedRange.contains extensions to call interface contains method. 2016-12-08 20:50:07 +03:00
Ilya Gorbunov
4721dcd07c Add specialization overloads for Float.rangeTo and Double.rangeTo to resolve them statically. 2016-12-08 20:49:10 +03:00
Ilya Gorbunov
5765031209 Adjust Range.contains optimization for double and float ranges according to #KT-4481
#KT-5044 #KT-4481
2016-12-08 20:47:27 +03:00
Ilya Gorbunov
d91f3cba0b Add additional invariant to check in Range.contains optimization tests.
Change expectations for double and float ranges according to #KT-4481
 #KT-5044 #KT-4481

Custom 'rangeTo' might be unoptimized, but still 'in' should not diverge from 'contains'.
2016-12-08 20:47:25 +03:00
Ilya Gorbunov
f5cc53c157 Provide ComparableRange specializations for Double and Float.
#KT-4481
2016-12-08 20:47:24 +03:00
Ilya Gorbunov
1aad82bbaf Allow to specify generated function visibility, add capacity rank of primitive type 2016-12-08 20:47:22 +03:00
Ilya Gorbunov
e4ab3f3b93 Fix rendered descriptors in test data after enhancing signatures. 2016-12-08 20:34:59 +03:00
Ilya Gorbunov
eaf64fb225 MapTest: Uncomment cases that pass now, add more cases. 2016-12-08 20:34:57 +03:00
Ilya Gorbunov
459c5fed8c Tweak checks and type parameter heuristics in LazyJavaClassDescriptor.getPurelyImplementedSupertype to support cases of UnaryOperator and BinaryOperator enhancements. 2016-12-08 20:34:55 +03:00
Ilya Gorbunov
c3921d1e40 Docs: improve code formatting in PurelyImplements docs, fix MutableList fq-name in example. 2016-12-08 20:34:54 +03:00
Ilya Gorbunov
f66b4201d1 Refactor FakePureImplementationsProvider to use single map 2016-12-08 20:34:52 +03:00
Ilya Gorbunov
c66b3b8ef9 Nullability for java.lang.ref.Reference.get 2016-12-08 20:22:17 +03:00
Ilya Gorbunov
84a7e3c032 Add tests for enhanced java signatures based on AbstractResolvedCallsTest.
Refactor AbstractResolvedCallsTest to support multiple carets (multiple methods being tested  for resolve) in testdata file.
2016-12-08 20:22:17 +03:00
Ilya Gorbunov
15061ff125 Add known methods of collections and maps. 2016-12-08 20:22:17 +03:00
Ilya Gorbunov
14ec4c7acc Minor: refactor expression in signatureEnhancement for better debugging 2016-12-08 20:22:17 +03:00
Ilya Gorbunov
253a901bd3 Evolve DSL for defining enhanced nullability info for known JDK functions. Enhance nullability for java.util.Optional. 2016-12-08 20:22:17 +03:00
Alexey Sedunov
215d8b1e1a Intentions: Convert function type receiver to parameter
#KT-14246 Fixed
2016-12-08 17:56:57 +03:00
Alexey Sedunov
d4ed2d2022 Intentions: Convert function type parameter to receiver
#KT-14246 In Progress
2016-12-08 17:56:55 +03:00
Alexey Sedunov
9cadfd01ae Introduce Variable: Allow extraction to class body/file 2016-12-08 17:56:54 +03:00
Alexey Andreev
abca774422 Support external modifier on classes in descriptor renderer. Regenerate test data. 2016-12-08 15:41:44 +03:00
Alexey Andreev
85733b47f3 Add support of external modifier in classes and properties to IDEA stub builder 2016-12-08 15:41:44 +03:00
Alexey Andreev
dadffebe97 Support external modifier in descriptor renderer. Update test data. 2016-12-08 15:41:43 +03:00
Alexey Andreev
7e37d5d6fa Prohibit external modifiers on classes and properties in JVM target 2016-12-08 15:41:42 +03:00
Alexey Andreev
d0ffb5bd32 JS: add restrictions to external modifier according to KT-13893 2016-12-08 15:41:42 +03:00
Alexey Andreev
c0c6992ea6 JS: regenerate declarations from IDL 2016-12-08 15:41:42 +03:00
Alexey Andreev
c558b5d2b2 JS: regenerate stdlib 2016-12-08 15:41:41 +03:00
Alexey Andreev
1ebf81c3ff Don't report about unused parameters on external functions and constructors 2016-12-08 15:41:41 +03:00
Alexey Andreev
7a6b510ddb Include external modifier to serialized descriptors for classes and properties 2016-12-08 15:41:40 +03:00
Alexey Andreev
a7ce770cb4 Don't report error for properties and functions without body that either external by themselves or are members of external classes 2016-12-08 15:41:40 +03:00
Alexey Andreev
68412ae94f JS: replace all usages of @native annotation with external modifier, in tests, stdlib, etc 2016-12-08 15:41:39 +03:00
Alexey Andreev
e0cb56b3c3 JS: use external modifier instead of @native annotation 2016-12-08 15:41:39 +03:00
Alexey Andreev
0c2da93e5f Allow external modifier on classes and properties 2016-12-08 15:41:38 +03:00
Alexey Andreev
ba2443bcb3 Add external property to class and property descriptors 2016-12-08 15:41:38 +03:00
Nikolay Krasko
43948a0170 Wrap options for constructor parameters
#KT-12176 In Progress
2016-12-08 15:15:12 +03:00
Nikolay Krasko
300601da54 Indent () in if, when, while and do-while with continuation indent (KT-5897)
#KT-5897 Fixed
2016-12-08 15:15:11 +03:00
Nikolay Krasko
211cae2ad2 Refactoring: use when instead of if 2016-12-08 15:15:09 +03:00
Alexander Udalov
d5c75ae764 Minor refactoring in frontend/resolution
Fix typos, formatting, diagnostic message
2016-12-08 12:20:37 +03:00
Alexander Udalov
921694e13a Deduplicate code in JavaClassDataFinder 2016-12-08 12:20:36 +03:00
Alexander Udalov
41f2048f96 Minor, introduce DeserializedContainerSource 2016-12-07 21:46:37 +03:00
Alexander Udalov
228d0a1c43 Move "missing dependency class" diagnostic from JVM to common front-end 2016-12-07 21:46:37 +03:00
Alexander Udalov
3b18531b20 Add expectedVersion to IncompatibleVersionErrorData, move to deserialization 2016-12-07 21:46:36 +03:00
Alexander Udalov
c811c1bea5 Reflection: add KAnnotatedElement.findAnnotation
#KT-12250 Fixed
2016-12-07 21:45:24 +03:00
Alexander Udalov
414daef001 Rename KotlinVersion->KotlinCompilerVersion, move to module util.runtime
Rename to avoid confusion with the recently added kotlin.KotlinVersion
2016-12-07 21:11:15 +03:00
Alexander Udalov
65e01f2fdb Fix compilation of module generators 2016-12-07 21:11:15 +03:00
Alexander Udalov
751f546a70 Fix compilation of module android-tests 2016-12-07 21:11:14 +03:00
Denis Zharkov
dd392963ac Minor. Rename SyntheticExtensionFunctions -> SyntheticMemberFunctions 2016-12-07 21:04:57 +03:00
Denis Zharkov
035383285c Fix processing synthetic members in completion
Not all synthetic scope's descriptors are extensions (SAM adapters are not)

 #KT-11128 Fixed
2016-12-07 21:04:53 +03:00
Denis Zharkov
891a036b59 Change resolution priority level for SAM adapters
After this change SAM adapters are being resolved in the same group
as members, thus their overload resolution happens simultaneously.

But in the case of overload resolution ambiguity try to filter out all
synthetic members and run the process again.

See the issue and new test for clarification

 #KT-11128 In Progress
2016-12-07 21:04:44 +03:00
Denis Zharkov
a4adfb43d4 Minor. Refine substitution for SAM adapters
Introduce CompositionTypeSubstitution instead of manual composition of
two substitutions.

This change is necessary for the later changes where original substitution
will be able to contain outer type parameters

 #KT-11128 In Progress
2016-12-07 21:04:39 +03:00
Denis Zharkov
a52ae04aef Fix fast-path check when selecting most specific members
Obviously 'overridableGroup' cannot be both empty and having the single element.
'conflictedHandles' that is what meant to be empty instead
2016-12-07 21:04:08 +03:00
Denis Zharkov
83056c71c9 Minor. Extract FlatSignature factory 2016-12-07 21:04:08 +03:00
Denis Zharkov
c45edaa420 Minor. Extract CandidatesCollector as a type alias 2016-12-07 21:04:08 +03:00
shiraji
2815b5e62b KT-15030 Remove redundant calls of conversion methods: false positive for 'toList()'
#KT-15030 Fixed
2016-12-07 19:00:12 +03:00
Mikhail Glukhikh
268702e0cc "Change return type for enclosing fix" now handles TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH correctly #KT-14063 Fixed 2016-12-07 18:52:04 +03:00
Mikhail Glukhikh
2ac8e5b4a7 "Change return type fix" now handles data class properties correctly #KT-15028 Fixed 2016-12-07 18:51:58 +03:00
Mikhail Glukhikh
0994d46038 Convert reference to lambda: handle special case of extension functional type #KT-14985 Fixed 2016-12-07 18:51:53 +03:00
Mikhail Glukhikh
e904e56de3 Convert reference to lambda: correct handling of static method references #KT-14982 Fixed 2016-12-07 18:51:48 +03:00
Mikhail Glukhikh
ea8548c55b Simplify boolean == true / false is no longer applicable on flexible boolean #KT-15087 Fixed 2016-12-07 18:51:42 +03:00
Mikhail Glukhikh
4b86c4aa27 Infrastructure test for intention descriptions availability added 2016-12-07 18:51:37 +03:00
Nikolay Krasko
06172e7110 Refactoring: move runSynchronouslyWithProgress to ProgressUtil 2016-12-07 17:32:38 +03:00
Nikolay Krasko
fd8d616d35 Use lazy resolve for counting list of inlined function during step out (KT-14892)
#KT-14892 Fixed
2016-12-07 17:32:38 +03:00
Nikolay Krasko
fc5b493fd3 Run full resolve in debugger with write action priority (KT-14602)
#KT-14602 Fixed
2016-12-07 17:32:38 +03:00
Nikolay Krasko
45532e480f Remove repeating contexts in CompositeBindingContext creation 2016-12-07 17:32:38 +03:00
Nikolay Krasko
76916b0877 Avoid requesting line number for bad offset (EA-87678)
Example of stack trace:
java.lang.IndexOutOfBoundsException: Wrong offset: 14847. Should be in range: [0, 14846]
	at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:141)
	at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:919)
	at org.jetbrains.kotlin.idea.refactoring.KotlinRefactoringUtilKt.getLineCount(kotlinRefactoringUtil.kt:344)
	at org.jetbrains.kotlin.idea.debugger.KotlinPositionManager.getSourcePosition(KotlinPositionManager.kt:125)
2016-12-07 17:32:38 +03:00
Nikolay Krasko
ee1ce184f9 Don't resolve reference if result is useless 2016-12-07 17:32:38 +03:00
Ilya Gorbunov
7a019e80fe Exclude bundled org.jetbrains.annotations from kotlin-runtime. Add a dependency on org.jetbrains:annotations:13.0 instead. 2016-12-06 22:25:06 +03:00
Ilya Gorbunov
2e7456c56e Add non-compiled sources to runtime before packaging sources jar. 2016-12-06 21:31:41 +03:00
Ilya Gorbunov
2fa98323f1 Refactor: rename files. 2016-12-06 21:30:35 +03:00
Ilya Gorbunov
d5f5f88cda Add number to string conversion with the specified radix.
#KT-8286
2016-12-06 21:30:35 +03:00
Sergey Mashkov
2ca336fb32 KT-15120 Gradle JS test compile task doesn't pick up production code 2016-12-06 16:51:15 +03:00
Alexey Tsvetkov
7b3bc0235b Fix JS compiler jar search
#KT-15127 fixed
2016-12-06 16:07:43 +03:00
Alexey Andreev
0302fcbb72 JS: don't write native superclass to metadata. Fix KT-15007 2016-12-06 15:42:34 +03:00
Sergey Mashkov
e7d6711db3 IDL2K: properly handle clash or val and var attributes 2016-12-06 15:00:35 +03:00
Alexander Udalov
0d99801783 Revert "Add NonVolatileRef to runtime"
This reverts commit 1e9624901a.

For more information, see
https://discuss.kotlinlang.org/t/non-volatile-vs-volatile-captured-refs-by-default/

 #KT-14746 Fixed
2016-12-06 14:59:15 +03:00
Alexander Udalov
04d4351e30 Revert "Make Ref fields volatile"
This reverts commit 6b348bfc6e.

For more information, see
https://discuss.kotlinlang.org/t/non-volatile-vs-volatile-captured-refs-by-default/

 #KT-14746 In Progress
2016-12-06 14:59:14 +03:00
Mikhail Zarechenskiy
57ee8c878c Regenerate tests 2016-12-06 08:56:45 +03:00
Mikhail Zarechenskiy
0134b8819b Optimize const vals by inlining them at use sites
#KT-11734 Fixed
 #KT-13570 Fixed
2016-12-05 22:11:33 +03:00
Mikhail Zarechenskiy
8c1e165f18 Skip property accessors for constants
- Inline protected constants from Java at use sites
 - Do not create accessors for private constants in Kotlin

 #KT-11734 In Progress
2016-12-05 22:10:14 +03:00
Mikhail Zarechenskiy
bd14c24592 Allow LANGUAGE_VERSION directive in codegen tests 2016-12-05 22:10:08 +03:00
Ilya Gorbunov
4d3d8463dc Make tools.jar system dependency, since classpath property is readonly. 2016-12-05 20:10:33 +03:00
Yan Zhulanow
fcafaf5500 Update LightAnalysisModeCodegenTests for Kotlin 1.1 2016-12-05 20:10:32 +03:00
Yan Zhulanow
e31a39386e Minor: Fix testDeprecatedJvmOverloads test (Kotlin runtime is not enabled by default now in bytecode listing tests) 2016-12-05 19:58:06 +03:00
Yan Zhulanow
e39a8f2900 Kapt3, Minor: Add tools.jar to kotlin-annotation-processing classpath (Maven) 2016-12-05 19:58:05 +03:00
Yan Zhulanow
75aaf6e797 Minor: Update tests for light analysis mode (rebase) 2016-12-05 19:58:02 +03:00
Yan Zhulanow
d246bd8cff Kapt3: Fix literal expressions for byte and short 2016-12-05 19:57:59 +03:00
Yan Zhulanow
de0e4ac340 Kapt3: Add tests for primitive values and NonExistentClass 2016-12-05 19:57:57 +03:00
Yan Zhulanow
582f85f303 Kapt3: Generate stub for error.NonExistentClass to make javac happy 2016-12-05 19:57:56 +03:00
Yan Zhulanow
325245f996 Minor: Rebase to 1.0.6, re-generate tests 2016-12-05 19:57:55 +03:00
Yan Zhulanow
c2013c4d03 Kapt3: Add 'useLightAnalysis' option to compiler and Gradle plugins 2016-12-05 19:57:53 +03:00
Yan Zhulanow
e4de840b8a Kapt3: Add friend paths to kapt tasks 2016-12-05 19:57:52 +03:00
Yan Zhulanow
75a8088f65 Kapt3: Minor: Changes on review 2016-12-05 19:57:51 +03:00
Yan Zhulanow
95d1210317 Kapt3: Extract annotation processing to its own task in Gradle. Now the kotlinCompile task should know nothing about kapt, for the main task it's just a regular Java source root. 2016-12-05 19:57:49 +03:00
Yan Zhulanow
92282072fc Enable light class analysis mode for AbstractLightAnalysisModeCodegenTest. See also the previous commit.
Note that no test data files are changed, it means that light classes with the light analysis mode enabled are the same as with the full analysis.
2016-12-05 19:57:48 +03:00
Yan Zhulanow
328286ab14 Use box tests to check if the light analysis mode (without analyzing bodies when possible) produces the same result as the complete analysis. See also the next commit in which light analysis mode is applied. Note that no tests were changed. 2016-12-05 19:57:47 +03:00
Yan Zhulanow
8bdb54929b Fix @JvmMultifileClass in ClassBuilderMode=LIGHT_CLASSES 2016-12-05 19:57:46 +03:00
Yan Zhulanow
0914a65234 Kapt3: Support processor arguments. Add integration tests. 2016-12-05 19:57:45 +03:00
Yan Zhulanow
b54df7a945 Kapt3: Do not resolve declaration bodies if possible in kapt 2016-12-05 19:57:44 +03:00
Yan Zhulanow
d884830700 Allow to avoid declaration body resolution for function and property initializers if the return type is explicitly specified. This significantly reduces the analysis time in kapt3. 2016-12-05 19:57:43 +03:00
Yan Zhulanow
90cbf172d2 Kapt3: Use annotation simple name if the annotation declaration is inside the same package as the current source file's package 2016-12-05 19:57:42 +03:00
Yan Zhulanow
1f1491f1ca Kapt3: Fix a number of errors in ClassFileToSourceStubConverter:
1. Support strictfp modifier for methods.
2. Support Kotlin top-level methods and properties.
3. Fix visibility modifiers on enum methods.
2016-12-05 19:57:41 +03:00
Yan Zhulanow
e22ce14c36 Kapt3: Review fixes 2016-12-05 19:57:40 +03:00
Yan Zhulanow
3a29bf5e01 Minor: Add 'impls' to dictionary 2016-12-05 19:57:39 +03:00
Yan Zhulanow
86aa82da6c Kapt3: Minor: Refactor kapt3 module (move/rename) 2016-12-05 19:57:38 +03:00
Yan Zhulanow
e61a7c7f2c Kapt3: Minor: Annotation processor classes may be initialized only once, so SIMPLE_PROCESSOR became a factory method 2016-12-05 19:57:37 +03:00
Yan Zhulanow
03244123c9 Kapt3: Minor: Measure stub generation time 2016-12-05 19:57:36 +03:00
Yan Zhulanow
6b1fc6fc39 Kapt3: Output stubs to .java files in verbose mode 2016-12-05 19:57:35 +03:00
Yan Zhulanow
aa15e0ad67 Kapt3: Run Javac annotation processing in the kapt3 plugin.
There are two modes:
1. Run only annotation processing (like kapt1 with stubs + javac). Seems that it may be faster to process annotations once before Kotlin compilation than launching AP on each IC round.
2. Run AP, repeat analysis and compile Kotlin classes (like kapt2). This mode doesn't support IC for now.
2016-12-05 19:57:35 +03:00
Yan Zhulanow
bd9d33fe44 Kapt3: Replace kapt2 in Ant and Maven artifacts with kapt3 2016-12-05 19:57:34 +03:00
Yan Zhulanow
64046f1e40 Kapt3: Add simple AP test with Kotlin 2016-12-05 19:57:33 +03:00
Yan Zhulanow
5b780ec56c Kapt3: Parse generic signatures of methods and fields 2016-12-05 19:57:32 +03:00
Yan Zhulanow
efd25de13f Kapt3: Parse generic signatures of classes.
Refactoring (move TreeMaker helper functions to KaptTreeMaker, mapValues() and others to utils.kt).
2016-12-05 19:57:31 +03:00
Yan Zhulanow
e4158a5571 Kapt3: Number of bugfixes in JCTreeConverter:
Convert Java primitive and array types properly.
Enums: ignore first two synthetic constructor parameters, do not generate super class constructor call, add ACC_ENUM flag to enum values, do not generate "values" and "valueOf" methods.
Provide a JavaFileObject for JCCompilationUnit.
Handle DefaultImpls, ignore empty DefaultImpls classes.
Use a name table from Javac Names.
2016-12-05 19:57:30 +03:00
Yan Zhulanow
e131763cb0 Kapt3: Put static modifiers on nested non-inner classes.
Do not initialize synthetic and static fields in constructor.
2016-12-05 19:57:29 +03:00
Yan Zhulanow
68c2e8d71d Kapt3: Do not generate body for abstract methods.
Add java.lang.Override annotation for overrides.
Ignore java.lang.Synthetic annotation.
2016-12-05 19:57:28 +03:00
Yan Zhulanow
10cfde4ab9 Kapt3: Call super class constructor with some default parameters.
Allow interface, annotation, enum modifiers on class.
2016-12-05 19:57:27 +03:00
Yan Zhulanow
edaadb0d48 Kapt3: Initialize final fields in class constructors 2016-12-05 19:57:27 +03:00
Yan Zhulanow
666a522fed Kapt3: Generate empty body for constructor and void methods 2016-12-05 19:57:26 +03:00
Yan Zhulanow
4305706c16 Kapt3: Filter only relevant modifiers 2016-12-05 19:57:25 +03:00
Yan Zhulanow
5f45b41d53 Kapt3: Initial implementation of JCTreeConverter 2016-12-05 19:57:24 +03:00
Yan Zhulanow
f07f367ff6 Kapt3: Add kapt3 compiler plugin 2016-12-05 19:57:23 +03:00
Yan Zhulanow
fc0b17c453 Kapt3: Replace "my/package/Class$Inner" to "my/package/Class/Inner" in kapt3 class builder mode 2016-12-05 19:57:21 +03:00
Yan Zhulanow
65a9d9e8d2 Kapt3: Handle exceptions while annotation processing gracefully 2016-12-05 19:57:20 +03:00
Yan Zhulanow
aae80fa4ab Kapt3: Add Kapt runner 2016-12-05 19:57:19 +03:00
Nikolay Krasko
726471d98e Avoid loading psi for compiled kotlin file if it's possible to get declaration by name from stubs 2016-12-05 17:22:42 +03:00
Mikhail Glukhikh
299f477a1b Call method references search in UnusedSymbolInspection.hasReferences to fix secondary constructor search
Makes #KT-12500 Fixed
Makes #KT-12501 Fixed
2016-12-05 10:58:21 +03:00
Alexey Andreev
784fe31053 JS: fix translation of calls with aliased labeled lambda arguments. Fix KT-14999 2016-12-05 09:19:06 +03:00
Ilya Gorbunov
a6fb61f5c3 Fix various maven pom problems:
- Add relativePath to samples pom.
- Specify versions of plugins
2016-12-04 14:15:34 +03:00
Alexey Andreev
df88ebb1b3 KT-12877: don't throw exception when @JsModule annotation is improperly used 2016-12-03 17:15:11 +03:00
Alexey Andreev
d40e923722 KT-12877: minor fixes and cleanup 2016-12-03 17:15:10 +03:00
Alexey Andreev
d1820b42ef KT-12877: fix code formatting in tests 2016-12-03 17:15:10 +03:00
Alexey Andreev
d63a727474 KT-12877: support plain reference to declaration in UMD wrapper, support plain reference to package 2016-12-03 17:15:09 +03:00
Alexey Andreev
495c876b3b KT-12877: add tests for UMD modules 2016-12-03 17:15:09 +03:00
Alexey Andreev
31a1d6ca66 KT-12877: add diagnostics on JsModule/JsNonModule:
1) for all cases of misusing of JsModule report on JsNonModule as well
2) report about non-top-level declarations with JsModule/JsNonModule
3) report about JsModule/JsNonModule declarations inside file marked with JsModule/JsNonModule
4) report about usages of declarations not marked with both JsModule and JsNonModule from UMD module
2016-12-03 17:15:08 +03:00
Alexey Andreev
08a7f9c298 KT-12877: reorganize JS module tests to support different module systems. Test JsModule in conjunction with JsNonModule and plain module type 2016-12-03 17:15:08 +03:00
Alexey Andreev
0238b182cc KT-12877: add JsNonModule with support on front-end 2016-12-03 17:15:07 +03:00
Alexey Andreev
3f2ec6871d KT-12877: add some front-end diagnostics for JsModule 2016-12-03 17:14:30 +03:00
Alexey Andreev
7be872ebca KT-12877: modify tests to check whether mutable top-level properties of JsModule files are supported 2016-12-03 17:14:29 +03:00
Alexey Andreev
b1d8f91212 KT-12877: fix how native calls and property references are translated to be make them work with JsModule annotation 2016-12-03 17:14:29 +03:00
Alexey Andreev
ac703dfda6 KT-12877: serialize information about file annotations. For each top-level declaration store containing file. Use this information to properly handle file-targeted JsModule. 2016-12-03 17:14:29 +03:00
Alexey Andreev
6df40559f0 KT-12877: initial simple implementation of JsModule. Remove unnecessary ModuleDescriptor from several classes in pipeline 2016-12-03 17:14:28 +03:00
Ilya Gorbunov
75d80acac9 Rework existing unit tests used as samples. 2016-12-02 22:41:25 +03:00
Ilya Gorbunov
57cef391ac Create a separate project for stdlib samples. 2016-12-02 22:41:25 +03:00
Mikhail Zarechenskiy
160d43fe2e Introduce new feature: division by zero in constant expressions 2016-12-02 17:42:56 +03:00
Anton Bannykh
3e4376f4ba JS: don't omit guard for catch with Throwable type (KT-13616); don't generate guard for catch with dynamic type (KT-13615) 2016-12-02 17:13:02 +03:00
Alexey Sedunov
475ae0d638 Rename: Suggest respective parameter name for the local variable passed to function
#KT-14792 Fixed
2016-12-02 14:14:10 +03:00
Alexey Sedunov
b6d4bb4921 Create from Usage: Support adding type parameters to the referenced type
#KT-11760 Fixed
2016-12-02 14:14:09 +03:00
Alexey Sedunov
c773afdbfa Intentions: Implement "Add names to call arguments" intention
#KT-14729 Fixed
2016-12-02 14:14:08 +03:00
Alexey Sedunov
890578a6a0 Introduce Type Alias: Forbid unchecking of required type arguments 2016-12-02 14:14:06 +03:00
Alexey Sedunov
2a594a5bcc Create from Usage: Support generation of abstract members for superclasses. Skip non-abstract superclasses when generating abstract member
#KT-14019 Fixed
2016-12-02 14:14:05 +03:00
Alexey Sedunov
25cebbab4b Extraction Engine: Do not wrap companion member references inside of the with call if it's disabled in extraction options
#KT-13781 Fixed
2016-12-02 14:14:04 +03:00
Alexey Sedunov
61210d6ba2 Move: Fix callable reference processing when moving to another package
#KT-14197 Fixed
2016-12-02 14:14:03 +03:00
Mikhail Glukhikh
0e9b024720 Plugin fix: intention description ConvertFinallyToUseCallIntention --> ConvertTryFinallyToUseCallIntention 2016-12-02 14:04:55 +03:00
Anton Bannykh
6301e3ec30 JS: Fix capturing class construction function for lambdas inside inline functions with reified type parameters (KT-13522). 2016-12-02 13:42:42 +03:00
Mikhail Glukhikh
729a3a34b8 Cleanup: remove empty primary constructor applied 2016-12-02 13:38:47 +03:00
Mikhail Glukhikh
f71ea8858b Cleanup: remove empty constructor body applied 2016-12-02 13:38:42 +03:00
Mikhail Glukhikh
d5638dffaa Cleanup: redundant if statement applied 2016-12-02 13:38:37 +03:00
Mikhail Glukhikh
96ae881c16 Cleanup: join declaration & assignment applied 2016-12-02 13:38:32 +03:00
Dmitry Petrov
e63abff7e8 Recognize possible generic property call chain ('a.b<T>.c') on '::' LHS. 2016-12-02 10:20:05 +03:00
Mikhail Glukhikh
4af9b274a1 KT-12100 convert try / finally to use: select use parameter after application 2016-12-01 20:39:19 +03:00
Mikhail Glukhikh
9ea326870d KT-12100 convert try / finally to use: report intention only at try { 2016-12-01 20:39:14 +03:00
Mikhail Glukhikh
0cc52e2ff8 KT-12100 convert try / finally to use: safe close() is allowed in finally + correct new lines 2016-12-01 20:39:08 +03:00
Mikhail Glukhikh
0ac443066e KT-12100 convert try / finally to use: 'this' receiver is now left as is 2016-12-01 20:39:03 +03:00
Mikhail Glukhikh
f513514c53 KT-12100 convert try / finally to use: 'this' cases, implementation via resolved call 2016-12-01 20:38:57 +03:00
Mikhail Glukhikh
468e975580 KT-12100 related: convert try / finally to use() call inspection introduced 2016-12-01 20:38:52 +03:00
Mikhail Glukhikh
59b2608354 "Convert try / finally to .use { } call intention introduced" #KT-12100 Fixed 2016-12-01 20:38:46 +03:00
Ilya Gorbunov
1f1403d31d Minor: run configuration for binary-compatibility-validator uses maven build instead of JPS 2016-12-01 17:46:15 +03:00
Nikolay Krasko
6ea2526af8 Fix multiplatform tests on Windows 2016-12-01 17:38:07 +03:00
Mikhail Zarechenskiy
25c3b43858 Support Infinity and NaN in constant evaluator
This allows to store infinities and NaNs inside const vals
2016-12-01 16:08:53 +03:00
Nikolay Krasko
57964845ad Check no runtime markers are misused in quick fix tests
(cherry picked from commit bab26d4)
2016-12-01 14:33:37 +03:00
Nikolay Krasko
dbe32b98ef Filter also by kind to avoid getting enum descriptors from compiled code 2016-12-01 14:33:37 +03:00
Nikolay Krasko
6a9c368532 Auto-import does not suggest enum constant (KT-14100)
#KT-14100 Fixed

(cherry picked from commit 61730ee)
2016-12-01 14:33:37 +03:00
Denis Zharkov
cbebb06574 Do not return star-projections during approximation
See comment in test for clarification

 #KT-14453 Fixed
2016-12-01 13:39:38 +03:00
Denis Zharkov
b8e1ce7a05 Report error on non-tail suspend-calls
It only concerns calls inside another suspend function

 #KT-14924 In Progress
2016-12-01 10:11:37 +03:00
Denis Zharkov
aa50f1d824 Report error when suspend call is illegal in the scope
Namely when it's not contained inside coroutine or another suspend function

 #KT-14924 In Progress
2016-12-01 10:11:37 +03:00
Mikhail Zarechenskiy
240d82d167 Move reified type parameter checker to additional checkers to able turn it off by demand 2016-12-01 10:06:38 +03:00
Ilya Gorbunov
dc57d69085 Improve onEach templates.
Add new functions to reference API.
Add tests for onEach
  #KT-8220
2016-11-30 16:46:56 +03:00
Christian
5bde230d4a Add onEach template. #KT-8220 2016-11-30 16:46:26 +03:00
Ilya Gorbunov
65a7410eca Allow receiver to be generic type constrained by SELF. Receiver itself now can be referenced with RECEIVER. 2016-11-30 16:46:26 +03:00
Ilya Chernikov
5a25bd5e2d Fix script configuration manager startup, fixes #EA-86126 2016-11-30 13:09:22 +01:00
Ilya Chernikov
4e6e3a3403 Check for script file validity on cache changes, fixes #EA-90318, #EA-87672 2016-11-30 13:09:21 +01:00
Ilya Chernikov
0e7413b5b1 Generalizing error handling when working with (potentially 3rd-party) script templates, fixing #EA-91412 and alike 2016-11-30 13:09:20 +01:00
Ilya Chernikov
c51da7d8c1 Refactor daemon sessions container, attempt to fix #EA-87285 and alike 2016-11-30 13:09:19 +01:00
Ilya Chernikov
014e43e50a Generalize error processing on daemon connection, attempt to fix #EA-82064 again 2016-11-30 13:09:18 +01:00
Ilya Chernikov
c88b11aa27 Generalize error processing in retrieving gradle settings, fixes #EA-87096, #EA-87129, #EA-87275 and alike 2016-11-30 13:09:17 +01:00
Alexey Sedunov
313d838f1b Unused Symbol Inspection: Fix exception on deleting unused declaration in IDEA 2016.3 2016-11-30 14:35:41 +03:00
Alexey Sedunov
1bde0e12fd Rename: Fix exceptions on moving file with facade class to another package
#KT-14325 Fixed
2016-11-30 14:35:40 +03:00
Alexey Sedunov
cedbac6b43 Safe Delete: Fix exception on deleting Java class used in Kotlin import directive(s)
#KT-14596 Fixed
2016-11-30 14:35:39 +03:00
Alexey Sedunov
465138cfa1 Initialize with Constructor Parameter Intention: Fix IDE freeze on properties in generic class
#KT-14459 Fixed
2016-11-30 14:35:38 +03:00
Alexey Sedunov
b29c704a92 Rename: Do not report redeclaration conflict for private top-level declarations located in different files
#KT-14361 Fixed
2016-11-30 14:35:37 +03:00
Alexey Sedunov
a2d3592228 Project Settings: Expose language version setting in IntelliJ IDEA plugin compiler configuration UI
#KT-12410 Fixed
2016-11-30 14:35:36 +03:00
Alexey Sedunov
21c6e97731 Project Settings: Expose JVM target setting in IntelliJ IDEA plugin compiler configuration UI
#KT-13811 Fixed
2016-11-30 14:35:35 +03:00
Alexey Sedunov
740f769487 Rename: Fix renaming of .kts file to .kt and vice versa
#KT-14814 Fixed
2016-11-30 14:35:34 +03:00
Alexey Sedunov
ddb5308993 Extract Interface: Fix NPE on dialog opening
#KT-14854 Fixed
2016-11-30 14:35:34 +03:00
Alexey Sedunov
24035d2c83 Introduce Type Alias: Forbid nested/local type aliases 2016-11-30 14:35:33 +03:00
Alexey Sedunov
752ae87591 Introduce Type Alias: Support callable references/class literals
#KT-14861 Fixed
2016-11-30 14:35:32 +03:00
Alexey Sedunov
9967d4c4e2 Move: Fix EA-1266148 2016-11-30 14:35:31 +03:00
Alexey Sedunov
0f58e2eef2 Introduce Type Alias: Replace type usages in constructor calls. Do not replace usages of existing type aliases
#KT-14685 Fixed
2016-11-30 14:35:30 +03:00
Alexey Sedunov
7a38dfadba Introduce Type Alias: Fix NPE during dialog repaint
#KT-14696 Fixed
2016-11-30 14:35:29 +03:00
Alexey Sedunov
939532b6f3 Introduce Type Alias: Do not suggest type qualifiers
#KT-14693 Fixed
2016-11-30 14:35:28 +03:00
Alexey Sedunov
9a4fa3a871 Presentation: Add icons for type aliases 2016-11-30 14:35:27 +03:00
Natalia Ukhorskaya
01d4ec4187 Debugger: ability to set breakpoint to lambda in return statement (KT-14615)
#KT-14615 Fixed
2016-11-30 13:56:29 +03:00
Nikolay Krasko
730e561177 Navigation to inline functions doesn't work for thread dump captured using "Get thread dump" (KT-14916)
#KT-14916 Fixed
2016-11-30 13:53:12 +03:00
Ilya Gorbunov
21fba92c93 Annotate new number parsing functions with SinceKotlin.
#KT-8286, #KT-7930
2016-11-30 02:33:51 +03:00
Ilya Gorbunov
9b421eb7a4 Throw IllegalArgumentException instead of NumberFormatException on incorrect radix. 2016-11-30 02:20:33 +03:00
Ilya Gorbunov
3c80a7056a Refactor local test dsl.
Add several cases and arabic digits conversion test.
2016-11-30 02:19:43 +03:00
Ilya Gorbunov
1b9dfffc13 Minor: normalize casing of Test annotation 2016-11-30 02:19:40 +03:00
Ilya Gorbunov
410e85ef79 Minor: extract a couple of platform-specific functions. 2016-11-30 02:19:38 +03:00
Ilya Gorbunov
4d6c5bcdcf Split API to separate overloads with radix parameter and without.
Remove unused radix parameter from toFloat and toDouble.
Update public API dump.
#KT-8286, #KT-7930
2016-11-30 02:19:36 +03:00
Ilya Gorbunov
ce50c7f13d Fix in test to deal with java 6 not accepting leading plus. 2016-11-30 02:19:33 +03:00
voddan
a8bd174cd0 Added tests for parsing with radix.
#KT-8286
2016-11-30 02:19:31 +03:00
voddan
0a939a647f Added optional radix parameter to string-parsing functions: String.toInt, String.toIntOrNull etc.
#KT-8286
2016-11-30 02:19:29 +03:00
voddan
87d010e038 Introduce local dsl for number parsing tests, improve test coverage.
#KT-7930
2016-11-30 02:19:27 +03:00
voddan
ce9c981e26 Implemented String.toIntOrNull , String.toLongOrNull.
Rewrote `String.toShortOrNull` and `String.toByteOrNull` by delegating to `String.toIntOrNull`.
Added a regEx check into `String.toDoubleOrNull` to prevent throwing exceptions mostly.
#KT-7930
2016-11-30 02:19:26 +03:00
voddan
3d050322e0 Added String.toIntOrNull, etc
#KT-7930
2016-11-30 02:17:35 +03:00
voddan
fb51d21888 Extracted string-parsing extensions and their tests into separate files. 2016-11-30 02:17:35 +03:00
Denis Zharkov
fcd9ee037e Support coroutines stack-unwinding in JVM backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
27e4caf046 Temporary disable coroutine tests in JS backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
2c3b0aeddb Add 'suspendWithCurrentContinuation' and 'Suspend' object in built-ins
They are part of the new suspension convention, relevant
support in backends will be added in later commits

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
a34c9c2580 Support new suspend convention in frontend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Simon Ogorodnik
e4a383f3e2 Fix for KT-10665, now only signature + deprecation info shown in quick navigation tooltip
Fix tests, to use full documentation mode instead of quick navigate
2016-11-29 14:08:10 +03:00
Simon Ogorodnik
1c75c02dfe Fix for KT-13699 Quick documentation doesn't show supertype docs for overridden Java 2016-11-29 14:08:09 +03:00
Simon Ogorodnik
b93c37faa2 Added tests to prove, that KT-8547 fixed 2016-11-29 14:08:09 +03:00
Simon Ogorodnik
2824c8d4cd Fix for KT-11032 Samples not rendered in Quick Doc
Now samples included as code blocks into quick doc
2016-11-29 14:07:47 +03:00
Simon Ogorodnik
94770f8447 Fix for KT-13197 Markdown indented code blocks are not recognized by quick doc
Expanded code blocks lexer test, to cover indented code blocks
2016-11-29 14:07:34 +03:00
Simon Ogorodnik
3376dbb10d Fix for KT-7995 Quick doc should show deprecation info and ReplaceWith 2016-11-29 14:07:32 +03:00
Simon Ogorodnik
1a211ee7b0 Completion for fqNames in KDoc links
Tests, also proved that KT-14432 are fixed
Added completion and tests for extension functions.
2016-11-29 14:06:54 +03:00
Simon Ogorodnik
62077dafc3 Fix resolving of packages in FQN kdoc links
Assume link [pack.SomeType], pack no more will be marked as unresolved reference
2016-11-29 14:06:51 +03:00
Simon Ogorodnik
c93e47febf Feature KT-7739 Type names in Quick Documentation should be clickable and navigate to their documentation
Filter out 'boring builtin classifiers' (kotlin.Int for ex) from signature hyperlinks
2016-11-29 14:06:37 +03:00
Simon Ogorodnik
68d4a7abce Fix for KT-13400, KT-13389 Resolving FQN in quick doc
Problem related to not complete fix in KT-10398
2016-11-29 14:06:35 +03:00
Simon Ogorodnik
b007d9b60f Fix for KT-13038 Quick doc should escape HTML entities in code blocks 2016-11-29 14:06:35 +03:00
Dmitry Petrov
2cd6c85cc7 Syntax forms 'a<T>::foo', 'a?::foo' have special cases resolved for future releases.
'a<T>::foo' is reserved if 'a' is a simple name and can be resolved as an expression
(this can be extended to 'a.b.c<T>::foo' case, although that is rather hard to implement using PSI).

 'a?::foo' is reserved if 'a' can be resolved as an expression.
2016-11-29 13:10:01 +03:00
Dmitry Petrov
5d1b848658 KT-14196 Do not allow class literal with expression in annotation arguments 2016-11-29 13:10:01 +03:00
Mikhail Glukhikh
904ea33291 KT-12633 related test fix 2016-11-28 17:32:01 +03:00
Anton Bannykh
159df7964a JS: bound callable references (KT-13573). 2016-11-28 16:33:58 +03:00
Nikolay Krasko
dc1e3ae441 Allow to search builtins descriptors in stubs by name 2016-11-28 14:38:34 +03:00
Nikolay Krasko
3537673417 Don't enable search stub declaration by name if file doesn't contain descriptor key
This might cause irrelevant declarations found with the same name.
2016-11-28 14:38:34 +03:00
Nikolay Krasko
b816c182f0 Try to avoid loading ast for decompiled files (KT-14804)
#KT-14804 Fixed
2016-11-28 14:38:34 +03:00
Kirill Rakhman
68df8c55e7 Intention "Specify type explicitly" should offer all bounds for platform types #KT-12633 Fixed 2016-11-28 11:21:38 +03:00
shiraji
ba92dcb737 KT-14890 Fix the problem with RemoveEmptyClassBodyIntention for nested class followed by a secondary constructor
#KT-14890 Fixed
2016-11-28 11:07:53 +03:00
Dmitry Petrov
b7f27b86fe Update golden data for public API test. 2016-11-28 10:23:10 +03:00
Ilya Gorbunov
78a89ef30a Add a hint how to regenerate API dump 2016-11-27 13:50:14 +03:00
Natalia Ukhorskaya
d14136b0b6 Debugger: cannot call member extension in an object in Evaluate Expression
#KT-14822 Fixed
2016-11-26 00:20:43 +03:00
Alexander Udalov
204873edf2 Support "-Xno-check-impl" argument, check only real declarations
Use "-Xno-check-impl" to suppress checking whether the platform declaration
implementation has the "impl" modifier.

Do not check presence of fake overrides from platform class in the impl class,
otherwise there would be a lot of errors about the fact that
equals/hashCode/toString are not marked with the "impl" modifier
2016-11-25 20:50:29 +03:00
Alexander Udalov
bbafb7c013 Check platform<->impl compatibility for class members
When matching platform and impl classifiers, ensure that each declaration from
the platform class scope is present in the impl class scope.

Note that the presence of the 'impl' modifier is not checked yet
2016-11-25 20:50:29 +03:00
Alexander Udalov
8d3f6f1ce7 Check platform<->impl declaration compatibility
For each platform declaration, there must be at least one impl declaration in
the module with the compatible signature; similarly, for each impl declaration,
there must be at least one platform declaration with the compatible signature.

Note that currently the presence of the 'impl' modifier is not checked yet.

Also, the sad fact is that if you have platform and impl declarations which are
not compatible, you get two errors: on the platform delcaration and on the impl
declaration. This needs to be addressed as well
2016-11-25 20:50:26 +03:00
Alexander Udalov
ad59d5a1c8 Define applicability for platform/impl modifiers 2016-11-25 20:50:24 +03:00
Alexander Udalov
a3cfd3962c Discriminate 'platform' declarations in resolution
Otherwise calls to functions which are declared twice (platform and impl) would
result in an error "conflicting overloads" in platform-specific modules
2016-11-25 20:50:24 +03:00
Alexander Udalov
926b81fb35 Use DefaultAnalyzerFacade for common code in diagnostic tests
Because of incomplete infrastructure, introduce a few dirty hacks to make
diagnostic tests analyze the common code via DefaultAnalyzerFacade, and also
add common module sources to analysis of platform-specific modules.

Also do not render 'platform' declarations from platform-specific modules to
the .txt file, since they are very likely to be exact copies of the same
declaration in the common module (see RecursiveDescriptorComparator)
2016-11-25 20:50:23 +03:00
Alexander Udalov
a4169416ad Support platform modifier in back-ends, add multi-platform integration test
Skip 'platform' declarations completely in back-ends
2016-11-25 20:50:22 +03:00
Alexander Udalov
c1eebacd55 Do not render declarations from other modules in diagnostic tests
Because PackageViewDescriptor may consist of several package fragments from
different modules (see LazyPackageViewDescriptorImpl#fragments), we now filter
out fragments from irrelevant modules before rendering them into the .txt
2016-11-25 20:50:21 +03:00
Alexander Udalov
a8bd82e863 Support only simple declarations for 'impl' type aliases
E.g. 'impl typealias Foo<A, B> = Bar<A, B>' is allowed; everything else
(variance, changing order of parameters, etc.) is pretty much disallowed.

This is done for simplicity: otherwise matching the platform/impl class scopes
would be not so straightforward
2016-11-25 20:50:20 +03:00
Alexander Udalov
751949db69 Support platform/impl modifiers for classes
Do not report "unused parameter" for parameters of platform declarations. Do
not allow platform class constructors to have val/var parameters or have an
explicit delegation call to another constructor. Do not allow platform classes
to have 'init' blocks.

Also suppress the "supertype not initialized" error for platform classes: the
supertype should be initialized in the impl class
2016-11-25 20:50:19 +03:00
Alexander Udalov
ce9691cd2b Support platform/impl modifiers for properties
Do not allow platform properties to have backing fields, initializers, be
delegated, lateinit or const, or have accessors with bodies
2016-11-25 20:50:18 +03:00
Alexander Udalov
af1264a46d Support platform/impl modifiers for functions
Also add a new capability for ModuleDescriptor, which is used to obtain the
platform in the multi-platform scenario in tests.

Suppress the following errors for platform functions: "function has no body"
and "nothing to inline". Also do not report redeclaration between platform and
non-platform functions because this is the case when the common +
platform-specific code are analyzed together.

Note that some diagnostics reported in tests are not yet implemented in this
commit, they appear in subsequent commits
2016-11-25 20:50:17 +03:00
Alexander Udalov
6e2ef9b1d2 Add platform/impl soft keywords, add isPlatform/isImpl to MemberDescriptor 2016-11-25 20:50:17 +03:00
Alexander Udalov
0dc31af73d Introduce KotlinMetadataFinder#hasMetadataPackage
Before creating a MetadataPackageFragment, check that the corresponding
directory (across the classpath) contains at least one .kotlin_metadata file.
Otherwise we're creating packages for every simple name queried during the
resolution and sometimes prefer a (empty) package to the existing class, for
example when the latter class is star-imported
2016-11-25 20:50:15 +03:00
Alexander Udalov
bfb7b21472 Load definitions of symbols from .kotlin_metadata files
Extract AbstractDeserializedPackageFragmentProvider out of
JvmBuiltInsPackageFragmentProvider and implement it a little bit differently in
MetadataPackageFragmentProvider. The main difference is in how the package
fragment scope is constructed: for built-ins, it's just a single scope that
loads everything from one protobuf message. For metadata, package scope can
consist of many files, some of which store information about classes and others
are similar to package parts on JVM, so a ChainedMemberScope instance is
created.

Introduce a bunch of interfaces/methods to deliver the needed behavior to the
'deserialization' module which is not JVM-specific and does not depend on the
compiler code: MetadataFinderFactory,
PackagePartProvider#findMetadataPackageParts, KotlinMetadataFinder#findMetadata.
Note that these declarations are currently only implemented in the compiler; no
metadata package parts/fragments will be found in IDE or reflection
2016-11-25 20:50:13 +03:00
Alexander Udalov
32792c5ce4 Store .kotlin_module files in MetadataSerializer
Compilation of top level functions/properties/typealiases results in a bunch of
different .kotlin_metadata files, so we need to store names of these files to
avoid scanning the file system in the compiler when loading code compiled by
K2MetadataCompiler.

For this, we reuse the PackageTable protobuf message, which is already used for
exactly the same purpose in the JVM back-end
2016-11-25 20:50:12 +03:00
Alexander Udalov
1d71c19b42 Serialize .kotlin_metadata binary files per source file
Do not serialize everything in the same package to the same file (as is done
for built-ins) because this approach is unfriendly to incremental compilation,
which is going to be supported in the future. Instead, similarly to JVM
serialize each class to its own file, and each source file with top-level
callables/typealiases to its own file.

E.g. if a file named test.kt contains a class Foo and some
functions/properties, the output will contain two files: TestKt.kotlin_metadata
and Foo.kotlin_metadata. Each one of this files contains the serialized
BuiltIns message (see builtins.proto)
2016-11-25 20:50:10 +03:00
Alexander Udalov
ec03c6decb Introduce K2MetadataCompiler, extract MetadataSerializer out of BuiltInsSerializer
K2MetadataCompiler is a compiler facade similar to K2JVMCompiler and
K2JSCompiler and it produces .kotlin_metadata files. Each .kotlin_metadata file
contains the binary data which is a serialized BuiltIns protobuf message.

There's no 'kotlinc-***' script yet though, so to run this compiler currently
invoke this:

    KOTLIN_COMPILER=org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler kotlinc
2016-11-25 20:50:09 +03:00
Nikolay Krasko
b007306740 Make breakpoints work inside nameless function bodies in inline calls 2016-11-25 18:06:36 +03:00
Nikolay Krasko
89ac89f0c6 Fix breakpoints in secondary constructors 2016-11-25 18:06:36 +03:00
Dmitry Petrov
3d2696c81b KT-13440 Bound callable references in reflection 2016-11-25 16:11:18 +03:00
Dmitry Petrov
5879e201cd Proper equality comparison for bound callable references represented as reflection objects
(including references to property accessors).
2016-11-25 14:49:24 +03:00
Dmitry Petrov
3dd0c9d1c7 Equality comparison for bound callable references takes into account bound receiver.
Fixed KT-14939: use expected receiver type when generating receiver code in get/set methods for bound property references.
Otherwise we have VerifyError for bound receiver 'null' of type 'Nothing?', which is mapped to 'java.lang.Void'.

TODO: proper equality comparison for property accessors ('x::prop.getter', 'x::prop.setter').
2016-11-25 14:49:24 +03:00
Alexey Andreev
ce6cf6475c JS: fix compilation of project 2016-11-25 14:43:48 +03:00
Alexey Andreev
66c78be10f JS: don't optimize RTTI when possible, i.e. don't remove is and as when object is known at compile time to have type in RHS of expression. Substitute kotlin.Any with Object. Fix #KT-7665, #KT-7664 2016-11-25 14:08:13 +03:00
Alexey Andreev
c581ec6dd6 JS: fixes after code review 2016-11-25 14:07:31 +03:00
Alexey Andreev
46242f4430 JS: when RHS of as cast is non-nullable native interface, check LHS for null 2016-11-25 14:07:30 +03:00
Alexey Andreev
e17321e1f6 JS: fix some code in stdlib that attempts to to is check against native interface 2016-11-25 14:07:30 +03:00
Alexey Andreev
2eb54f234c JS: prohibit passing native interfaces to reified type parameters 2016-11-25 14:07:29 +03:00
Alexey Andreev
acf7fcaebf JS: prohibit is checks against native interfaces. Warn about casts to native interfaces. Fix #KT-14037, fix #KT-14038 2016-11-25 14:07:29 +03:00
Mikhail Glukhikh
2bb81e6a18 Simplify boolean with constants intention supports now == (!=) true (false) cases #KT-13777 Fixed 2016-11-24 18:05:36 +03:00
Alexey Andreev
20669c1b97 JS: fix building stubs for JS library that contains classes in default package 2016-11-24 17:49:11 +03:00
Nikolay Krasko
efeccd0929 Filter out variables with null values (EA-87276) 2016-11-24 17:22:33 +03:00
Mikhail Glukhikh
5c09e1ca98 KT-13393 related: convert reference to lambda inspection (off by default) introduced 2016-11-24 15:26:38 +03:00
Mikhail Glukhikh
9c75324188 Minor: rename in KtPsiFactory 2016-11-24 15:26:30 +03:00
Mikhail Glukhikh
b111d1ba69 Convert reference to lambda intention introduced #KT-13393 Fixed 2016-11-24 15:26:18 +03:00
Mikhail Glukhikh
27df76b02d Minor: typo fixed 2016-11-24 15:26:07 +03:00
Mikhail Glukhikh
c6997a1213 Redundant if inspection supports now assignments and just if (...) true else false #KT-13259 Fixed 2016-11-24 15:25:56 +03:00
Mikhail Glukhikh
14787e3583 VarianceChecker: correct handing of nested classes and their methods #KT-14733 Fixed 2016-11-24 14:22:23 +03:00
Sergey Mashkov
1954cffd01 IDL2K: regenerate stubs 2016-11-24 12:14:34 +03:00
Sergey Mashkov
379afa187b IDL2K: consider attribute ignores (from config.kt) before merge 2016-11-24 12:14:33 +03:00
Sergey Mashkov
ae69233d9c IDL2K: render dictionaries as interfaces, always use nullable types 2016-11-24 12:14:32 +03:00
Sergey Mashkov
d3afb683a3 Update tests expected files 2016-11-24 12:14:31 +03:00
Sergey Mashkov
ecbf2c023d Upgrade example 2016-11-24 12:14:31 +03:00
Sergey Mashkov
3285728391 IDL2K: generate declarations for partial interfaces 2016-11-24 12:14:30 +03:00
Sergey Mashkov
25461b42b9 IDL2K: manually fix SVGUseElementShadowRoot due to error in the SVG 2 specification 2016-11-24 12:14:29 +03:00
Sergey Mashkov
44335901c5 IDL2K: rename trait to interface, render NoInterfaceObject as native interface 2016-11-24 12:14:28 +03:00
Sergey Mashkov
5e01d4c993 IDL2K: update downloaded IDLs 2016-11-24 12:14:28 +03:00
Sergey Mashkov
f098d6881e IDL2K: better logging 2016-11-24 12:14:27 +03:00
Sergey Mashkov
b0414fe905 IDL2K: better property duplicates handling, better reserved words handling 2016-11-24 12:14:26 +03:00
Sergey Mashkov
3c60e73d19 IDL2K: map array literal 2016-11-24 12:14:26 +03:00
Sergey Mashkov
df21b8bb7e IDL2K: remove dfn-panel class during IDL extraction 2016-11-24 12:14:25 +03:00
Sergey Mashkov
2496f24817 IDL2K: update download urls 2016-11-24 12:14:24 +03:00
Sergey Mashkov
453cd943e4 IDL2K: fix grammar for better generic types supprt 2016-11-24 12:14:23 +03:00
Sergey Mashkov
d4c7831edd IDL2K: upgrade antlr 2016-11-24 12:14:23 +03:00
Alexey Andreev
9c8b58b8bf JS: when possible, treat WebIDL interfaces as abstract classes, not interfaces 2016-11-24 12:14:22 +03:00
Dmitry Petrov
f415050913 Suppress TOPLEVEL_TYPEALIASES_ONLY in decompiler and stubBuilder tests. 2016-11-24 10:41:50 +03:00
Ilya Gorbunov
03bbe875d4 Fix the links to the language docs from JvmStatic and JvmName annotations. Add a link from JvmField annotation.
#KT-14953 Fixed
2016-11-23 23:41:16 +03:00
Vyacheslav Gerasimov
663d999ac4 Fixed testOnDestroyFragment 2016-11-23 23:30:28 +03:00
Dmitry Jemerov
7f80a1faff Workaround for Android databinding issue: apply extra scope filtering to classes returned from getClassesByName() (part of EA-75803 assert: ResolverForProjectImpl.descriptorForModule) 2016-11-23 18:29:26 +01:00
Dmitry Jemerov
1570886be3 Don't throw exception when resolving out-of-content-root PSI elements to descriptors (EA-92177 assert: ResolverForProjectImpl.descriptorForModule) 2016-11-23 18:29:25 +01:00
Dmitry Jemerov
763782083c Implement KtLightTypeParameter.isEquivalentTo() without referencing delegate (this is faster and more correct) 2016-11-23 18:29:25 +01:00
Dmitry Jemerov
956e1c70dc Provide toString() for classes that extend GlobalSearchScope (to diagnose package fragment errors) 2016-11-23 18:29:24 +01:00
Dmitry Jemerov
32be1940be KtFile.getPackageFqNameByTree() never tries to access stub (EA-82168) 2016-11-23 18:29:24 +01:00
Dmitry Jemerov
c56a72d442 Retrieve virtual file for PsiFile via FileViewProvider, which always has a non-null vFile (EA-89047 - assert: LightClassDataProvider.getRepresentativeVirtualFile) 2016-11-23 18:29:23 +01:00
Dmitry Jemerov
89313b3495 Fix exception when companion object is on the top level of a file (EA-89388 - CCE: LightClassUtil$getWrappingClasses$.invoke) 2016-11-23 18:29:23 +01:00
Dmitry Jemerov
ebbbe1b801 Include exception in report, not only log it (EA-90231 - assert: ClsJavaStubByVirtualFileCache.createStub) 2016-11-23 18:29:22 +01:00
Dmitry Jemerov
58d725dac0 Don't store PsiElement in LocalQuickFix instance (EA-90970 - PIEAE: PsiInvalidElementAccessException.createByNode) 2016-11-23 18:29:22 +01:00
Dmitry Jemerov
f9f590d270 More diagnostics for EA-85926 and EA-77163 2016-11-23 18:29:21 +01:00
Dmitry Jemerov
2d2f439a78 Restore element after running postprocess (EA-91562 - PIEAE: ASTDelegatePsiElement.getManager) 2016-11-23 18:29:20 +01:00
Dmitry Jemerov
d803831548 A facade light class inherits only java.lang.Object (EA-91597 - NPE: KtLightClassForFacade.getClsDelegate) 2016-11-23 18:29:20 +01:00
Dmitry Jemerov
b696f9ee8d Handle INRE in breadcrumbs tooltip calculation (EA-91631 - INRE: FileBasedIndexImpl.handleDumbMode) 2016-11-23 18:29:19 +01:00
Dmitry Jemerov
56cb448e8a Use ModalityState.NON_MODAL for invokeLater() actions (EA-91730 - assert: PsiModificationTrackerImpl.fireEvent) 2016-11-23 18:29:19 +01:00
Vyacheslav Gerasimov
da87efed6b Added ACC_SYNTHETIC flag to generated by kotlin Android extensions onDestroyView method
#KT-14610 Fixed
2016-11-23 18:28:43 +03:00
Ilya Gorbunov
db1d2bf76f Deprecate all java.util.* stuff in JS library 2016-11-23 17:58:52 +03:00
Nikolay Krasko
60e3c8eecd Make breakpoints work in local functions in secondary constructors 2016-11-23 17:29:28 +03:00
Nikolay Krasko
1889f4f7b1 Fix breakpoints in function literals in inline calls (KT-11521, KT-12734, KT-12470)
#KT-11521 Fixed
 #KT-12734 Fixed
 #KT-12470 Fixed
2016-11-23 17:29:28 +03:00
Nikolay Krasko
59a349a4ae Test breakpoint is hit inside crossinline lambda called from anonymous object (KT-12612)
#KT-12612 Fixed
2016-11-23 17:29:28 +03:00
Alexey Andreev
23428c9544 JS: fix coroutine test. Fix hanging IDEA tests 2016-11-23 17:01:03 +03:00
Alexey Andreev
ea1e196e9a JS: remove unused imports from generated JS. Fix KT-14748 2016-11-23 12:19:04 +03:00
Alexey Andreev
cf89e24b49 JS: fix removal of unused lambdas after inlining 2016-11-23 12:19:04 +03:00
Alexey Andreev
40e00a62f5 JS: fix translation of augmented assignment when RHS changes value of LHS 2016-11-23 12:19:03 +03:00
Alexey Andreev
be196789d2 JS: fix bug in temporary variable elimination 2016-11-23 12:19:03 +03:00
Alexey Andreev
dc8e90809c JS: coroutines: fix handling of throw statement inside try/catch block when controller has handleSuspend function 2016-11-23 12:19:02 +03:00
Alexey Andreev
e44edf12e0 JS: coroutines: fix inlining of suspend functions 2016-11-23 12:13:54 +03:00
Alexey Andreev
8b9852edec JS: remove Kotlin.createClass/definePackage/etc functions from stdlib. Reimplement some classes in Kotlin 2016-11-23 12:13:54 +03:00
Alexey Sedunov
3eea735b4a Kotlin Facet: Access Gradle files under read action (fixes failure of GradleInspectionTest) 2016-11-23 11:27:41 +03:00
Ilya Gorbunov
0eba06405a Use InputStream as another guess for estimated size in InputStream.readBytes() 2016-11-22 23:37:29 +03:00
Ilya Gorbunov
e41cbe6fe1 Check that the length of a file can be represented as Int. 2016-11-22 23:37:27 +03:00
Ilya Gorbunov
c90ee13656 Performance: use byte array buffer directly to read the entire contents of a file.
#KT-14883 Fixed
2016-11-22 23:37:05 +03:00
Alexey Tsvetkov
5eaa23ec60 Minor: fix test data
dummy.kt was added for Gradle test (it does not start otherwise).
Old IC recompiles this file, so new and old IC logs are different.
2016-11-22 23:31:39 +03:00
Ilya Gorbunov
a8cc04d433 Use JRE7 for tests in other modules employing selenium. 2016-11-22 22:59:08 +03:00
Dmitry Jemerov
e7cf64631b Don't offer updates for @snapshot@ plugin version 2016-11-22 20:04:06 +01:00
Dmitry Jemerov
0cfc4db2d4 Check for plugin update before allowing to submit exception 2016-11-22 20:03:22 +01:00
Alexey Sedunov
6881d071e5 Minor: Use mutable empty list (as IDEA may attempt to modify it after calling detector) 2016-11-22 19:55:36 +03:00
Alexander Udalov
22e1221c75 Support "default platform" in IDE via facet settings 2016-11-22 18:19:02 +03:00
Alexander Udalov
c0b5fd193a Refactor DeserializedPackageFragment and subclasses
Push loadResource and loadResourceSure down to KotlinJavascriptPackageFragment,
as it's no longer needed in BuiltInsPackageFragment
2016-11-22 18:19:02 +03:00
Alexander Udalov
19520bf29c Extract KotlinMetadataFinder interface out of KotlinClassFinder 2016-11-22 18:19:02 +03:00
Alexander Udalov
5f4313223e Use a specific message collector in built-ins serializer
It's going to be needed to be able to report configuration errors when running
built-ins serializer (e.g. no output destination is passed as an argument)
2016-11-22 18:19:01 +03:00
Alexander Udalov
fcb094cd90 Introduce DefaultAnalyzerFacade, use it to analyze built-ins 2016-11-22 18:19:01 +03:00
Alexander Udalov
73f872172f Add multi-platform projects as experimental language feature 2016-11-22 18:19:01 +03:00
Alexander Udalov
525e6e53fe Do not report unhelpful diagnostic for unresolved call inside inline function
#KT-14887 Fixed
2016-11-22 18:19:01 +03:00
Alexander Udalov
eacf64e4db Report initializer block-related diagnostic on 'init' keyword 2016-11-22 18:19:01 +03:00
Ilya Chernikov
68cf4bf440 Update changelog for 1.1-M03 release 2016-11-22 16:00:54 +01:00
Mikhail Glukhikh
45e28bef1c Enhancement for "join declaration and assignment": now can handle also local variables, relevant inspection added #KT-12095 Fixed 2016-11-22 16:41:37 +03:00
Mikhail Glukhikh
c44ecded42 Refactoring: MoveAssignmentToInitializer --> JoinDeclarationAndAssignment 2016-11-22 16:41:27 +03:00
Mikhail Glukhikh
d4995c07f7 Convert primary constructor to secondary: KNPE fixed #KT-14745 Fixed 2016-11-22 16:35:28 +03:00
Dmitry Jemerov
13b2c2cd24 Add test for highlighting escape sequences in character literals 2016-11-22 13:24:13 +01:00
Dmitry Jemerov
d565e18889 Show enum constants in Goto Symbol
#KT-6535 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
ab8abc9c62 Delete paired > after deleting < after any identifier, not just a class-like one
#KT-13279 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
baf321a193 Highlight escape sequences in character literals
#KT-13795 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
2fe2e1802e Fix quote handler for character literals
#KT-12385 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
b742c8a63d Implement "Show non-public" filter for Kotlin structure view
#KT-14217 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
f586eebe16 KotlinStructureViewModel: cleanup after J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
4b591bf41f KotlinStructureViewModel: J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
bf97e64c1d KotlinStructureViewModel: rename to .kt 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
f4ce63f6d7 Collect local declarations under properties (KT-14215); improve presentation of object declarations
#KT-14215 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov
45077023bb KotlinStructureElementPresentation: cleanup after J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
75a5b0ee0c KotlinStructureElementPresentation: J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
6225867cae KotlinStructureElementPresentation: rename to .kt 2016-11-22 13:20:35 +01:00
Dmitry Jemerov
4cc6b98e1b Run configuration producer for Gradle tests (KT-10700) 2016-11-22 13:19:13 +01:00
Dmitry Petrov
fc2a965d2a Fix decompiler tests. 2016-11-22 14:40:02 +03:00
Denis Zharkov
01c21e218a Add special tests for interceptRun support
Basically they're built upon basic coroutine tests, but for each of them
different interceptResume implementation are injected
(currently there are 12 of them).

It might be more simple just to generated additional testData, but I see this
more problematic in a sense of further maintenance

Note that all tests add idempotent 'interceptRun' operators,
which just execute given lambda in the current thread

 #KT-14891 Fixed
2016-11-22 14:33:40 +03:00
Denis Zharkov
5ff71e1330 Support 'interceptResume' operator in JVM backend
#KT-14891 In Progress
2016-11-22 14:33:40 +03:00
Denis Zharkov
c2e6f92aa5 Minor. Extract several methods in coroutine codegen 2016-11-22 14:33:40 +03:00
Denis Zharkov
caf6634fd3 Minor. Cleanup CoroutineCodegen 2016-11-22 14:33:40 +03:00
Denis Zharkov
5276c3c755 Support 'interceptResume' operator in frontend
#KT-14891 In Progress
2016-11-22 14:33:40 +03:00
Dmitry Jemerov
99bfbd0a26 Never set isScript flag for stubs of file facade and multifile facade classes (scripts are always generated with ClassKind.CLASS) 2016-11-22 10:26:16 +01:00
Alexey Sedunov
075a0bc7f1 Kotlin Facet: Configure facet automatically on Gradle project import 2016-11-22 11:54:09 +03:00
Alexey Sedunov
e59754e86c Kotlin Facet: Configure facet automatically on Maven project import 2016-11-22 11:54:09 +03:00
Alexey Sedunov
dc33436c64 Kotlin Facet: Implement automatic facet configuration 2016-11-22 11:54:08 +03:00
Alexey Sedunov
4613eed406 Kotlin Facet: Track configuration version 2016-11-22 11:54:07 +03:00
Alexey Sedunov
27aaac5a96 Kotlin Facet: Infer 1.6 platform version for modules with JDK 1.7 dependency
#KT-14741 Fixed
2016-11-22 11:54:06 +03:00
Alexey Sedunov
b1fbf9f6b6 Kotlin Facet: Fix platform detection for Gradle project 2016-11-22 11:54:05 +03:00
Dmitry Petrov
e6fcf20cf2 No variance elision in type alias substitution.
Add test with cyclic inheritance via type alias.
2016-11-22 10:04:47 +03:00
Dmitry Petrov
67fe28b8d8 Combine type annotations for arguments of type aliases. 2016-11-22 10:04:47 +03:00
Dmitry Petrov
063bce23d2 Prohibit constructing projected types via type aliases. 2016-11-22 10:04:47 +03:00
Dmitry Petrov
bab9cde280 Type alias projections & substitution rules.
1. Substitution variance (sv) is a substitution composition of type alias argument variance (av)
and corresponding expanding type argument variance (ev):
sv =
  | av == ev -> av
  | av == INVARIANT -> ev
  | ev == INVARIANT -> av
  | else -> (variance conflict error; av)

2. Resulting variance (rv) is a type argument composition of sv and type parameter variance (pv):
rv =
  | sv == tv => INVARIANT
  | sv == INVARIANT => INVARIANT
  | tv == INVARIANT => sv
  | else -> (variance conflict error; sv)
2016-11-22 10:04:47 +03:00
Ilya Gorbunov
427c6386a9 Remove java.lang from default imports in JS target platform 2016-11-21 18:22:05 +03:00
Ilya Gorbunov
8b77430af4 Remove java.util package from js decompiler tests 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
49756a897e Just refactor tests that require further investigation 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
62fe89b536 Make several tests running on JS backend. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
0899a0fdda Make some tests JVM only 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
38840bb529 Do not reference java.util in tests that run on JS backend. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
491ca582b3 Include collection type aliases into mock-runtime as they are used extremely often in tests 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
6a70761783 Minor: normalize '@Test' annotation casing in all tests. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
50cd620f92 Remove java.util.* imports from common code. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov
b4fbedbc9e Update selenium to 2.52.0 to fix strange behavior in one of js tests.
This selenium requires jre7 to run.
2016-11-21 17:27:11 +03:00
Vyacheslav Gerasimov
60bc35b787 Implemented suppress lint intention action for android lint (KT-12020)
#KT-12020 Fixed
2016-11-21 17:16:27 +03:00
Dmitry Jemerov
6a8f78d7c1 Don't add script files to facade indices
#KT-12445 Fixed
2016-11-21 14:35:00 +01:00
Anton Bannykh
2bec54924f Android tests: use directives from tests-common to determine if the test is supposed to pass on JVM (adds support for IGNORE_BACKEND and IGNORE_BACKEND_WItHOUT_CHECK" directives). 2016-11-21 14:06:29 +03:00
Alexey Andreev
85a775375a JS: when deciding whether inner class of a local class captures this, don't check for subtyping, since frontend generates strict classes in descriptors. Remove fix for #KT-13583, since it's no more needed. Fix #KT-13792 2016-11-21 12:57:59 +03:00
Alexey Andreev
0a240b2a3a KT-12976: add code to generated JS modules that detects wrong module order and produces human-friendly error message. Fix #KT-12976 2016-11-21 12:57:11 +03:00
Dmitry Petrov
d665193c20 Type alias constructors for inner classes in expressions ans supertype lists. 2016-11-21 10:25:51 +03:00
Dmitry Petrov
9ac3dbceca Prohibit nested & local type aliases in 1.1: don't suggest to introduce typealias in a class or a function. 2016-11-21 10:25:51 +03:00
Dmitry Petrov
4c47d77a9f Report error on non-top-level type aliases (unsupported in 1.1).
Get rid of nested type aliases in project.
2016-11-21 10:25:51 +03:00
Ilya Gorbunov
87c9d4e84e Introduce unsafeCast function. Provide more JS-idiomatic emptyArray() implementation.
#KT-14034 Fixed
2016-11-19 03:37:47 +03:00
Alexey Tsvetkov
18d50b930d Minor: add Throws(Exception) to avoid override issues in java 2016-11-18 23:17:34 +03:00
Alexey Tsvetkov
ea93ec3eec Ensure jps caches are always cleared in tests 2016-11-18 23:17:30 +03:00
Alexey Tsvetkov
72fdb77628 Minor: fix js runtime error in gradle test 2016-11-18 23:06:45 +03:00
Alexey Tsvetkov
94b0f3839e Minor: set apiVersion equal to languageVersion in gradle test 2016-11-18 23:06:45 +03:00
Alexey Tsvetkov
c15e878808 Minor: remove inner type alias from gradle test 2016-11-18 23:06:45 +03:00
Alexey Tsvetkov
f70ba8b18d Gradle: run k2js out-of-process if Gradle >= 3.2 is used 2016-11-18 23:06:45 +03:00
Alexey Tsvetkov
38445aca8f Gradle: use builtins workaround only when Gradle >= 3.2 is used 2016-11-18 23:06:45 +03:00
Alexey Tsvetkov
df910a7801 Gradle: load builtins from dependencies
#KT-14798 Fixed
2016-11-18 23:06:45 +03:00
Anton Bannykh
68b35aa0ac JS inliner: Don't treat 'bar' as unused in the presence of 'bar.call' expressions 2016-11-18 20:55:07 +03:00
Ilya Gorbunov
b7b320e4ce @JvmOverloads-generated overloads of final methods are also final: update public API tests. 2016-11-18 19:53:24 +03:00
Ilya Gorbunov
1defc10add Minor fix: pass message to superconstructor of NoSuchElementException 2016-11-18 19:12:05 +03:00
Ilya Gorbunov
ac2c2aa959 Remove collectionsMax once again. 2016-11-18 19:12:05 +03:00
Ilya Gorbunov
0dbaf2a605 Make toTypedArray reified again and thus inline, rewrite copyToArray and copyToArrayImpl in kotlin. 2016-11-18 19:12:05 +03:00
Ilya Gorbunov
698bc7bd31 Internal visiblity for hacks.kt declarations.
Explicit public visibility.
2016-11-18 19:12:05 +03:00
Zalim Bashorov
4374d353ba IDE: don't exclude external system libraries (e.g. from gradle) when getting library version in facetUtils 2016-11-18 17:18:16 +03:00
Dmitry Jemerov
5a533a521b Don't consider a directory to be a package if there's a .java or .class file with the same name in its parent directory
#KT-12664 Fixed
2016-11-18 14:00:44 +01:00
Zalim Bashorov
7dbcbeb794 IDE: fix detecting target platform for module when it contains js stdlib without regular name
Don't use fixed library name to detect JS stdlib.
2016-11-18 15:57:46 +03:00
Anton Bannykh
2f0bccfb09 JS: chained reified function calls (KT-12527) fixed 2016-11-18 13:48:16 +03:00
Dmitry Jemerov
a57748f4f4 @JvmOverloads-generated overloads of final methods are also final; test to verify that overloads of deprecated methods are deprecated 2016-11-18 11:05:03 +01:00
Dmitry Jemerov
b8525de726 Disallow @JvmOverloads on any interface methods
#KT-12224 Fixed
2016-11-18 11:05:02 +01:00
Dmitry Jemerov
79e90b32e8 @JvmOverloads on local declarations is now an error 2016-11-18 11:05:01 +01:00
Dmitry Jemerov
140c7351a8 Add quickfix for incorrect @JvmOverloads annotation
#KT-12701 Fixed
2016-11-18 11:05:00 +01:00
Dmitry Jemerov
12e4cf9a4f Report @JvmOverloads errors on annotation, not on entire declaration (KT-12701) 2016-11-18 11:05:00 +01:00
Dmitry Jemerov
d3ccbe8172 Generate correct varargs flag for @JvmOverloads-generated methods
#KT-14186 Fixed
2016-11-18 11:04:59 +01:00
Dmitry Jemerov
16a133bf5c Generate default constructor also for private classes when all parameters have default values
#KT-14408 Fixed
2016-11-18 11:04:51 +01:00
Dmitry Jemerov
248185943c Handle @JvmOverloads on inner class constructors correctly
#KT-14678 Fixed
2016-11-18 11:04:49 +01:00
Dmitry Petrov
8b99141030 KT-14839 Do not coerce after remapped variable store. 2016-11-18 09:35:31 +03:00
Mikhail Zarechenskiy
4b23c50bf8 Parse expressions like '1._foo()' after dot as references 2016-11-17 22:58:40 +03:00
Ilya Chernikov
c7c6a1998b Update 1.1-M03 section of the changelog 2016-11-17 20:24:49 +01:00
Ilya Chernikov
6e481c8111 Update 1.1-M03 section of the changelog 2016-11-17 17:59:06 +01:00
Zalim Bashorov
ef11393462 KJS: add multimodule version of inheritFromRenamedNativeClass 2016-11-17 16:22:31 +03:00
Zalim Bashorov
8c630954a8 Minor: fix typo in file name 2016-11-17 16:22:30 +03:00
Zalim Bashorov
e1248f8f0b KJS: don't copy members from native interfaces 2016-11-17 16:22:29 +03:00
Zalim Bashorov
01d10a9592 KJS: remove no longer valid test 2016-11-17 16:22:28 +03:00
Zalim Bashorov
aa2a4f0794 KJS: implement Throwable in Kotlin instead of use it as alias of JS Error
* Make it an inheritor of JS Error. Otherwise, Chakra engine doesn't fill stack trace of exception; In other engines inheritance has some good effects too.
* Copy all properties from internally created instance of JS Error

 #KT-6985 Fixed
 #KT-2328 Fixed
 #KT-8019 Fixed
 #KT-10911 Fixed
2016-11-17 16:22:27 +03:00
Zalim Bashorov
1f4d95eaa7 Minor: rename kotlin.kt -> Enum.kt 2016-11-17 16:22:26 +03:00
Zalim Bashorov
a03e22e774 KJS: fix refering to native nested class 2016-11-17 16:21:16 +03:00
Zalim Bashorov
bd90b4e051 KJS: don't overwrite prototype of native classes when inheriting from them 2016-11-17 16:17:44 +03:00
Zalim Bashorov
c25dfe997c KJS: fix inheritance from renamed native classes 2016-11-17 16:17:43 +03:00
Anton Bannykh
0dc9121a91 JS property accessors inlining (KT-13456) 2016-11-17 15:25:29 +03:00
Nikolay Krasko
56ef09c09c Fix null pointer in evaluate expression (EA-87276) 2016-11-17 14:57:34 +03:00
Dmitry Petrov
0205a122f4 Treat nested mock type aliases as inner (same as for mock classes). 2016-11-17 14:42:32 +03:00
Alexey Andreev
f4011ecb3d JS: regenerate tests 2016-11-17 14:41:17 +03:00
Nikolay Krasko
6f95667f54 Better diagnostic for inlined line under dex on step over 2016-11-17 13:47:27 +03:00
Nikolay Krasko
2817e1a5f1 Avoid failure on first() call 2016-11-17 13:47:23 +03:00
Nikolay Krasko
a13e878c9b Pre-count line numbers
(cherry picked from commit 5412723e023768d308190f43edd5378476ad35c4)
2016-11-17 13:47:21 +03:00
Nikolay Krasko
0032818ec6 Step over locations after return in dex debug when no return position found by locations 2016-11-17 13:47:20 +03:00
Nikolay Krasko
a2652832e3 Step over locations after return in dex debug 2016-11-17 13:47:18 +03:00
Nikolay Krasko
f07b5eaea1 Refactorings: clean smapUtil, moves, renames 2016-11-17 13:47:17 +03:00
Nikolay Krasko
1c955a64f3 Cache debug information from bytecode in Android debug 2016-11-17 13:47:15 +03:00
Nikolay Krasko
78c76a2ca4 Allow to place breakpoints in inline functions defined in android tests 2016-11-17 13:47:13 +03:00
Nikolay Krasko
ae2e857843 Refactoring: remove lambda parameter from readClassFile() 2016-11-17 13:47:11 +03:00
Nikolay Krasko
623ee316c0 Fix step over for inlined functions in Android Studio (KT-14374)
#KT-14374 Fixed
2016-11-17 13:47:10 +03:00
Nikolay Krasko
f87779bfb0 Fail if it was impossible to delete cache directory
For example it can be caused by open handler to file on Windows.
2016-11-17 13:47:08 +03:00
Alexey Andreev
f2d7b1a5fd JS: unmute shared box tests 2016-11-17 13:29:26 +03:00
Anton Bannykh
5b078fb236 JS: augmented assignments and increments (KT-14810) fixed 2016-11-17 13:21:49 +03:00
Alexey Andreev
d2fdc7ffc0 JS: when both clauses of if become empty during optimization, remove if entirely. Make condition and then clause of JsIf non-nullable. Fix #KT-13912 2016-11-17 12:20:37 +03:00
Alexey Andreev
b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Alexey Andreev
e2dc7ba37e JS: coroutines: fixes after code review 2016-11-16 19:29:39 +03:00
Alexey Andreev
43525abda3 JS: don't treat return, break and continue as split points when possible 2016-11-16 19:29:38 +03:00
Alexey Andreev
14729b0f0e JS: fix exception handling in coroutines when initializing via resumeWithException 2016-11-16 19:29:38 +03:00
Alexey Andreev
bb61fb0a91 JS: refactor coroutine transformer 2016-11-16 19:29:37 +03:00
Alexey Andreev
d41d09ffc4 JS: add metadata for generated continuation classes to properly implement RTTI 2016-11-16 19:29:37 +03:00
Alexey Andreev
6860b2c057 JS: prevent generation of excessive updates of state fields 2016-11-16 19:29:36 +03:00
Alexey Andreev
4c0eb8fc31 JS: prevent generation of excessive this.$result statements in coroutines 2016-11-16 19:29:36 +03:00
Alexey Andreev
2d315c3df8 JS: coroutines: fix translation of try/finally block without catch 2016-11-16 19:29:35 +03:00
Alexey Andreev
0015f7518e JS: improve dead code elimination to handle switch case bodies 2016-11-16 19:29:35 +03:00
Alexey Andreev
22aea1cf12 JS: fix translation of return statement surrounded by finally block. Temporarily suppress corresponding test case for JVM backend 2016-11-16 19:29:34 +03:00
Alexey Andreev
eae0ceed86 JS: add coroutines tests 2016-11-16 19:29:34 +03:00
Alexey Andreev
2cc299fb40 JS: refactor coroutines to support inlining of suspend functions 2016-11-16 19:29:34 +03:00
Alexey Andreev
e56d735723 JS: refactor how last argument to suspend call is substituted 2016-11-16 19:29:33 +03:00
Alexey Andreev
050a1e782e JS: fix translation of call to suspend function with optional parameters 2016-11-16 19:29:33 +03:00
Alexey Andreev
3e436d42bf JS: allow to call non-suspend controller functions from coroutine lambda 2016-11-16 19:29:32 +03:00
Alexey Andreev
e7f044be92 JS: enable coroutine tests that don't enter infinite loop anymore 2016-11-16 19:29:32 +03:00
Alexey Andreev
d5a808dff6 JS: implementing try/finally in coroutines 2016-11-16 19:29:31 +03:00
Alexey Andreev
23bddac4fe JS: fix translation of catch blocks so that all references to exception variable are referentially equivalent to each other 2016-11-16 19:29:31 +03:00
Alexey Andreev
674e5df7f1 JS: make coroutine tests cross-platform 2016-11-16 19:29:30 +03:00
Alexey Andreev
c5999e8375 JS: prototyping coroutines 2016-11-16 19:29:27 +03:00
Alexander Udalov
be8b1b7dfd Exclude org.jetbrains.kotlin.container.** from proguard
To mitigate #KT-14824
2016-11-16 19:07:03 +03:00
Ilya Gorbunov
4769ed5f79 Fix imports in tests: do not use java.util.* stuff 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
ae903e9ce7 QuickDocNavigationTest: use stdlib members instead of JDK ones. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
8f3e6f38ed Select runtime with directive in test data file instead of test name in PsiChecker tests 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
d103657e07 Fix JS completion tests: remove unneeded imports, take care about type aliases looking different in completion. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
e787930673 Fix completion handler tests: use tail specifier to select one of multiple completion variants (eg 'kotlin.collections.ArrayList' vs 'java.util.ArrayList').
Replace aliased types imported by default with something else.
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
a62cda8365 Replace types that are imported by default via typealiases such as java.util.ArrayList with something else as it conflicts now with kotlin.collections.ArrayList and has to imported explicitly. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
b7e2649b91 Tests: ArrayList is now available by default, so change the type being imported.
Improve test to ensure it's found before removing import directive.
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
daac46bce5 Fix rendering in test output after introducing type aliases for the types used in those tests. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
ed3c54dbd0 Include new type aliases into mock runtime. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
b556adf8db Move/alias Appendable and StringBuilder to kotlin.text
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
5c2fe13a89 Refer to java.util.Arrays fully-qualified in generated code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
fae5c88f22 Remove java.util references from the common code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
63535393e7 Move Comparator to kotlin.comparisons and make it imported by default.
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
090bd76ac9 Introduce type aliases for jvm collections in kotlin.collections
#KT-2084
2016-11-16 18:47:42 +03:00
Stanislav Erokhin
3d7d6e4204 Fix EA-86841 and EA-79267.
(cherry picked from commit fcf9bfd)
2016-11-16 18:13:05 +03:00
Vyacheslav Gerasimov
c6d668e243 Fixed "should not analyze element" problem with destructuring declarations in uast 2016-11-16 18:05:31 +03:00
Vyacheslav Gerasimov
55f14ba8c0 Fixed method parameter default value processing in uast 2016-11-16 18:05:22 +03:00
Vyacheslav Gerasimov
d90ec3e777 Fixed KotlinLintTestGenerated.testJavaPerformance + refactoring
Moved android lint tests from uast-kotlin to idea-android
2016-11-16 18:05:09 +03:00
Alexander Udalov
3d75b78dc5 Use IOUtil instead of DataOutput for readUTF/writeUTF in file based index
It uses less space and also may be a little bit faster
2016-11-16 16:30:34 +03:00
Natalia Ukhorskaya
0fb5a18a26 Debugger: refactor smart step into to use descriptors instead of psi elements (KT-13485)
#KT-13485 Fixed
2016-11-16 15:20:00 +03:00
Dmitry Petrov
f7203da2d6 Type inference SHOULD NOT work for type alias constructor in supertypes list
(same as for classes: type arguments should be provided explicitly).
2016-11-16 14:11:14 +03:00
Dmitry Petrov
cd8b5dcb00 Constructors for inner type aliases: add a failing test (no way to invoke such constructor at the moment). 2016-11-16 14:11:14 +03:00
Dmitry Petrov
718e8ebf9e Inner type aliases.
Type alias is considered "inner" if it captures outer class type parameters (implicitly or explicitly).
2016-11-16 14:11:14 +03:00
Mikhael Bogdanov
63fed20249 Fix VerifyError on android with 'inv' operation on Byte and Short 2016-11-16 09:42:26 +01:00
Dmitry Jemerov
5b44343d15 Fix compilation: add required transitive dependency 2016-11-15 22:05:35 +01:00
Zalim Bashorov
eda8749b91 Mute without checks all diagnostic tests for tailrec since it's not supported in JS yet and it takes too much time when muted with checks 2016-11-15 22:11:09 +03:00
Zalim Bashorov
bde9f99d7c Unmute already worked tests and regenerate tests 2016-11-15 22:11:09 +03:00
Zalim Bashorov
8c3d2872c3 Generate right code to check that muted test is failed 2016-11-15 22:11:09 +03:00
Dmitry Jemerov
cc6722ad78 fix build script 2016-11-15 16:49:47 +01:00
Dmitry Jemerov
3d3c3b9ebb add Gradle wrapper to project 2016-11-15 16:42:57 +01:00
Dmitry Jemerov
b7ff16757a Allow to specify path to upload plugins from 2016-11-15 16:25:18 +01:00
Dmitry Jemerov
bc4d7b2a6e Remove cyclic dependency between idea-maven and idea modules: move constants for stdlib IDs to shared code 2016-11-15 15:33:20 +01:00
Anton Bannykh
b185715aeb Removed reified to fix the bootstrap. The @library annotation prevents from making the function inline. 2016-11-15 16:50:58 +03:00
Ilya Gorbunov
09072f6cdc Remove toInt() conversion as it's hardly required.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov
8de67d039b Expose maximum version component value as a constant, increase it to 255.
Add tests for KotlinVersion, document remaining parts of API.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov
5f7d779370 Introduce KotlinVersion API
#KT-14789
2016-11-15 16:38:52 +03:00
Mikhail Zarechenskiy
7103624308 Do not force resolve from type constructor
In case of creating context for something like 'class Foo(f: Bar)'
there is no need in resolving supertypes/annotations of Bar type
2016-11-15 14:57:50 +03:00
Dmitry Jemerov
53cb559440 Fix exception on databinding-generated classes in AS 2.3 (https://ea.jetbrains.com/browser/ea_reports/1261189) 2016-11-15 12:47:45 +01:00
Anton Bannykh
334ae72957 Moved checking that reified is used in inlines only to the main frontend (KT-12695, KT-13697 fixed) 2016-11-15 13:44:48 +03:00
Alexey Andreev
08f0636d39 JS: fix AMD emulation in Maven tests 2016-11-15 12:28:33 +03:00
Alexander Udalov
eedad9194e Drop KParameter.isNoinline, KParameter.isCrossinline
There seems to be no valuable use cases for them at the moment
2016-11-15 11:01:17 +03:00
Alexander Udalov
7e82d139cf Drop KFunction.isTailrec
The fate of this modifier seems unclear, and there doesn't seem to be any
valuable use cases for it in reflection
2016-11-15 11:01:16 +03:00
Denis Zharkov
5e73dc4a4c Minor. Invert 'notLocal' boolean value parameter
- Mainly to avoid double negations (!notLocal)
- Also swap last parameters (to allow use of named arguments)
2016-11-15 09:30:13 +03:00
Denis Zharkov
b5a6cbd188 Adjust "Remove explicit type" intention to properties with getters
#KT-14794 Fixed
2016-11-15 09:30:13 +03:00
Denis Zharkov
e25c4b96ad Add test for specify type explicitly when it can be inferred from getter
#KT-14794 In Progress
2016-11-15 09:30:13 +03:00
Denis Zharkov
6fca46a452 Allow inferring property type from its getter
#KT-550 Fixed
2016-11-15 09:30:13 +03:00
Denis Zharkov
51a5bf9f7e Minor. Drop redundant parameters of 'inferReturnTypeFromExpressionBody'
Both storageManager and expressionTypingServices must be the same instances
inside the resolution session and can be obtained from the DescriptorResolver fields
2016-11-15 09:30:13 +03:00
Denis Zharkov
77c524de33 Minor. Remove redundant if
'inType' var is guaranteed to be not-null
2016-11-15 09:30:13 +03:00
Denis Zharkov
96fa04569a Minor. Simplify variable type resolution 2016-11-15 09:30:13 +03:00
Denis Zharkov
e21ecbe702 Minor. Split method VariableTypeResolver.process
It looks much natural to differ type resolution and setting
compile time initializer to descriptor
2016-11-15 09:30:13 +03:00
Nikolay Krasko
bce023c8ad Make patch of obfuscated field in ThreadTracker more stable 2016-11-14 21:25:50 +03:00
Dmitry Jemerov
7beee33f05 Read bundled runtime version from build.txt in 'kotlinc' directory, not from plugin version 2016-11-14 18:51:36 +01:00
Ilya Gorbunov
e1cf89a956 Remove also Long/Char mixing binary operation intrinsics 2016-11-14 20:40:32 +03:00
Ilya Gorbunov
61e83a4db5 Remove obsolete range-related intrinsics from JS translator. 2016-11-14 20:40:32 +03:00
Mikhail Glukhikh
b850d71e17 Replace single line let: application on IDEA + front-end modules 2016-11-14 18:47:23 +03:00
Mikhail Glukhikh
09ae1f1a5d False positive removed in replace single line let intention #KT-14791 Fixed 2016-11-14 18:47:18 +03:00
Mikhael Bogdanov
61da8be260 Generate parameters metadata for java 8 reflection 2016-11-14 14:27:08 +01:00
Mikhael Bogdanov
7721aa189f Update proguard to 5.3 version 2016-11-14 14:27:08 +01:00
Dmitry Jemerov
3f7b9745b4 Fix race condition with synthetic files facade calculation in Upsource (UP-8046) 2016-11-14 12:56:34 +01:00
Ilya Gorbunov
b96deac09c Annotate TYPEALIAS annotation target being available since Kotlin 1.1 2016-11-14 01:04:31 +03:00
Alexey Tsvetkov
f381f1e699 Revert default value for "main" parameter for Gradle JS plugin to "call"
#KT-14724 fixed
2016-11-11 21:25:05 +03:00
Dmitry Jemerov
ab0af43a6a Update proguard file for compatibility with new Snappy version in IDEA 162-SNAPSHOT 2016-11-11 18:15:29 +01:00
Dmitry Jemerov
978b70e50b Add test for KT-14751 2016-11-11 18:15:24 +01:00
Dmitry Jemerov
13a17b8bd7 Use 162.SNAPSHOT builds for IDEA to pick up fix for IDEA-162379 2016-11-11 18:14:54 +01:00
Alexander Udalov
0b6ad3bc07 Use target platform configured in facet in module analysis 2016-11-11 19:00:12 +03:00
Alexander Udalov
26a6ce9a31 Rename JVMPlatform and JSPlatform and make them nested in TargetPlatformKind
To avoid confusion with JvmPlatform and JsPlatform from frontend.java and
js.frontend respectively
2016-11-11 19:00:12 +03:00
Alexander Udalov
d0f31a2bc2 Minor, rename targetPlatformKindKind -> targetPlatformKind 2016-11-11 19:00:11 +03:00
Alexander Udalov
1ce8ed907c Use TargetPlatformDetector.getPlatform instead of ProjectStructureUtil.isJsKotlinModule
The reason for this is to make the choice of the platform more explicit now
that there are more platforms than just JVM and JS (default platform, and also
possibly native in the future)
2016-11-11 19:00:10 +03:00
Alexander Udalov
0d4bd2a673 Use OperatorNameConventions constants instead of hardcoded literals 2016-11-11 19:00:09 +03:00
Alexander Udalov
61767bb0ea Minor, annotate visibility constants with NotNull
To avoid nullability warnings on ClassDescriptor#getVisibility and
implementations
2016-11-11 19:00:08 +03:00
Alexander Udalov
65882579bc Minor, add toString() for debug 2016-11-11 19:00:08 +03:00
Alexander Udalov
9e9c548ca3 Minor, print more debug info on serializing error annotation 2016-11-11 19:00:07 +03:00
Valentin Kipyatkov
0ef5f662ad KT-14732 Slow typing, copy-pasting, highlighting in Kotlin files due to auto-import suggestion calculation in EDT
#KT-14732 Fixed
2016-11-11 16:45:14 +03:00
Dmitry Jemerov
3d3a202601 KotlinWithGradleConfigurator: cleanup after J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
47c80a1ad1 KotlinWithGradleConfigurator: J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
11c9dff97a KotlinWithGradleConfigurator: rename to .kt 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
3d01e92dd6 use DOM instead of MavenProjectsManager to detect whether Kotlin is configured (KT-9275) 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
ebbf8888bb Change KotlinProjectConfigurator API to return module status as a single enum instead of two distinct boolean values 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
d8c7f2ffdb KotlinProjectConfigurator: J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
7d442f9ca2 KotlinProjectConfigurator: rename to .kt 2016-11-11 14:39:18 +01:00
Alexey Andreev
f2c392d4e7 JS: minor fix after rebase 2016-11-11 16:26:41 +03:00
Alexey Andreev
6649e0cb82 JS: remove intrinsics for progressions 2016-11-11 16:26:40 +03:00
Alexey Andreev
dcb95eb9f0 JS: refactor range and progression related intrinsics 2016-11-11 16:26:40 +03:00
Alexey Andreev
5ef8879aae JS: fixes after code review 2016-11-11 16:26:39 +03:00
Alexey Andreev
a72ea64142 JS: fix translation of lambdas in public inline functions; fix AMD emulation for Ant test 2016-11-11 16:26:39 +03:00
Alexey Andreev
6791ed7bf3 JS: fix obsolete tests 2016-11-11 16:26:38 +03:00
Alexey Andreev
a452260da6 JS: simplify merging kotlin.js 2016-11-11 16:26:38 +03:00
Alexey Andreev
ac4bfc645e JS: refactor translation of callable references to top-level properties 2016-11-11 16:26:38 +03:00
Alexey Andreev
0252fe57af JS: refactor flat declaration generator. Add more tests on inter-module dependencies 2016-11-11 16:26:37 +03:00
Alexey Andreev
cc38bd3146 JS: refactor code that exports local declaration from current module 2016-11-11 16:26:37 +03:00
Alexey Andreev
f244bbaae3 JS: change how declarations are exported from modules. Change how parts of kotlin.js merged 2016-11-11 16:26:36 +03:00
Alexey Andreev
3d9beb15da JS: fix translation of !! operation 2016-11-11 16:26:36 +03:00
Alexey Andreev
cacd917350 JS: fix translation of extension properties 2016-11-11 16:26:36 +03:00
Alexey Andreev
0f87703c87 JS: rewrite code that copies interface members with implementation to subtypes 2016-11-11 16:26:35 +03:00
Alexey Andreev
8eca8efae5 JS: fix some bugs:
1. Fix translation of FQN in inline lambdas
2. Fix StringBuilder.length
3. Workaround order of declaration of names for imported declarations
2016-11-11 16:26:35 +03:00
Alexey Andreev
fd158a6922 JS: refactor Dart AST 2016-11-11 16:26:34 +03:00
Alexey Andreev
bec1e526a1 JS: fix generation of bridge methods for non-abstract methods inherited from interfaces 2016-11-11 16:26:34 +03:00
Alexey Andreev
bb57eaef96 JS: fix some minor issues in new flat translator 2016-11-11 16:26:34 +03:00
Alexey Andreev
06476402a2 JS: support enums in flat JS structure 2016-11-11 16:26:33 +03:00
Alexey Andreev
54925e7f83 JS: remove test for reserved words 2016-11-11 16:26:33 +03:00
Alexey Andreev
38a3f4af80 JS: fix Kotlin.isType for case of traits 2016-11-11 16:26:32 +03:00
Alexey Andreev
20396b0e5f JS: fix inlining in a new flat JS generator 2016-11-11 16:26:32 +03:00
Alexey Andreev
e13d34e08d JS: rewrite stdlib to compile with new flat structure 2016-11-11 16:26:31 +03:00
Alexey Andreev
f9a392fdec JS: introduce new flat JS declaration structure 2016-11-11 16:26:31 +03:00
Zalim Bashorov
f1ae9949fe Regenerate tests 2016-11-11 15:49:09 +03:00
Dmitry Petrov
b429f7bc86 KT-14581 Make FixStackAnalyzer tolerant to uninitialized values 2016-11-11 13:30:15 +03:00
Alexey Andreev
71ef8c4f89 JS: fix exception in JS front-end when checking JsName that was resolved with errors 2016-11-11 11:11:19 +03:00
Ilya Chernikov
d2ba25e758 Fix script util test 2016-11-10 23:37:09 +01:00
Dmitry Petrov
6876f0e4d2 Support type aliases as bare types after 'is/as'. 2016-11-10 18:33:50 +03:00
Mikhael Bogdanov
21f2febf82 Fix for KT-13557: VerifyError with delegated local variable used in object expression
#KT-13557 Fixed
2016-11-10 15:12:16 +01:00
Dmitry Jemerov
e68dcdcc1e Fix companion object definition in the grammar (KT-8566) 2016-11-10 13:40:57 +01:00
Dmitry Jemerov
2c989b5671 Fix enumEntries definition in grammar (KT-14261) 2016-11-10 13:40:49 +01:00
Dmitry Jemerov
a0b6b3c248 Fix labelDefinition link in grammar (KT-14262) 2016-11-10 13:40:31 +01:00
Dmitry Petrov
37eedc3703 Hack: do not add trivial constraints (t <: Any?) for constituent types,
otherwise nested calls handling logic in old inference wouldn't work for type alias constructors.
2016-11-10 14:54:11 +03:00
Dmitry Petrov
549ae59562 Inference for type alias constructor type arguments: better error reporting. 2016-11-10 14:54:11 +03:00
Dmitry Petrov
94d7bd7a6b KT-14641: Nested type alias reference via an instance is an error. 2016-11-10 14:54:11 +03:00
shiraji
a662d777e8 Implement "Remove redundant '.let' call" binary operator support #KT-14396 Fixed 2016-11-10 14:26:14 +03:00
Mikhail Glukhikh
ce72337ebd Effective visibility is now considered private for invisible fake #KT-14469 Fixed 2016-11-10 13:42:58 +03:00
Zalim Bashorov
afa58599ec Specify target backend as JVM for SAM tests; mute other failed tests and regenerate tests. 2016-11-10 13:27:54 +03:00
Denis Zharkov
24819a079b Change resolution scope for componentX in lambda parameters
Component-functions are resolved in the same scope as the first statement of the lambda, but lambda receiver was not available

 #KT-14692 Fixed
2016-11-10 10:33:42 +03:00
Mikhail Zarechenskiy
6656bf835f Perform resolve of constructor parameters during partial constructor resove
#KT-13354 Fixed
2016-11-09 23:00:25 +03:00
Zalim Bashorov
41bd276814 Mute some new tests for JS and regenerate tests 2016-11-09 21:51:33 +03:00
Zalim Bashorov
4c8f5e4540 Regenerate ultimate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
6db0eec6cc Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
5500f80d0b Support ignoring by target backend for single generated classes 2016-11-09 21:41:12 +03:00
Zalim Bashorov
af4ec9815b Add ability to ignore test for backend w/o checks
It used for the tests from this commit becouse they was failing during setup.
2016-11-09 21:41:12 +03:00
Zalim Bashorov
a27572af49 Fix failed tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
1dedb38481 Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
8e480e275b Ignore files with incompatible target when check that all test are presented 2016-11-09 21:41:12 +03:00
Zalim Bashorov
0ecb13b150 Move TargetBackend to tests-common module 2016-11-09 21:41:12 +03:00
Zalim Bashorov
a1730f98ba Don't generate test when target backend is not suitable 2016-11-09 21:41:12 +03:00
Zalim Bashorov
f382f938c7 Fail when ignored test success in generated tests
#KT-14618 Fixed
2016-11-09 21:41:12 +03:00
Zalim Bashorov
afe6ec92a4 Break infinity loop in the test 2016-11-09 21:41:12 +03:00
Zalim Bashorov
584798d3cd Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
ee129bebb6 Automatically mute failed generated tests from compiler/testData/codegen/box/ranges 2016-11-09 21:41:12 +03:00
Zalim Bashorov
596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
a35a1f6f5a KJS: run all codegen/box tests 2016-11-09 21:41:12 +03:00
Denis Zharkov
55508afb8c Make initial continuation able to be resumed with exception
#KT-14719 Fixed
2016-11-09 16:26:32 +03:00
Denis Zharkov
ae70a60a0a Validate label value of coroutine in case of no suspension points
#KT-14718 Fixed
2016-11-09 16:26:32 +03:00
Dmitry Jemerov
46b91365ba Script for uploading the Kotlin plugin to plugins.jetbrains.com 2016-11-09 13:57:40 +01:00
Ilya Chernikov
6e96d192bf Move incremental components to compller util to reduce dependencies of compiler interface modules 2016-11-09 11:09:32 +01:00
Denis Zharkov
da5c81448b Add CoroutineImpl to rendered public API 2016-11-09 12:25:31 +03:00
Denis Zharkov
50a5c08603 Optimize visibility for controller field in CoroutineImpl
While it's impossible to declare a property with protected field and public
getter we split these entities

- `_controller` field is used inside coroutines
- `controller` getter is used for accesing controller from noinline lambdas
 (also it can be used to obtain controller from continuation by explicit cast)
2016-11-09 12:25:31 +03:00
Denis Zharkov
020bab1d7c Minor. Get rid of possible exception when no runtime in class-path
This change is made under the assumption that some version of built-in
classes will always be available through `module.builtIns.getBuiltInClassByFqName`
2016-11-09 12:25:31 +03:00
Denis Zharkov
bd5c08f598 Make fields for storing lambda parameters non-final
Because they get assigned within `invoke` call that contradicts with JVM spec
where it's told that they must not be assigned outside of constructors
2016-11-09 12:25:31 +03:00
Denis Zharkov
e54b466010 Make fields representing variables in coroutines non-volatile
#KT-14636 Fixed
2016-11-09 12:25:31 +03:00
Denis Zharkov
7e49db8768 Introduce CoroutineImpl as a common super class for coroutines
The main benefit are class-files sizes for them
(not repeating the same declaration for each coroutine)
Also it helped to simplify coroutine codegen code a little

Note that controller/label field become non-volatile (see KT-14636)

 #KT-14636 In Progress
2016-11-09 12:25:31 +03:00
Denis Zharkov
fc9605b94e Minor. Drop unused property in GenerationState 2016-11-09 12:25:31 +03:00
Dmitry Petrov
03d8aa272b Infer type arguments of type alias constructors. 2016-11-09 10:48:07 +03:00
Valentin Kipyatkov
9b55ad82a0 KT-14370 Completion inserts fully qualified name for any Java interface with single abstract method (SAM-interface)
#KT-14370 Fixed
2016-11-08 19:14:41 +03:00
Valentin Kipyatkov
b8981ec546 Minor 2016-11-08 19:14:41 +03:00
Valentin Kipyatkov
869b177823 Introduced KtExpression.analyzeAsReplacement() utility 2016-11-08 19:14:40 +03:00
Valentin Kipyatkov
e850446f17 Introduced BindingContext.DATA_FLOW_INFO_BEFORE 2016-11-08 19:14:40 +03:00
Mikhail Zarechenskiy
3df5efb236 Introduce language feature: underscores in numeric literals
#KT-2964 Fixed
2016-11-08 19:04:53 +03:00
Mikhail Zarechenskiy
a77290e572 Lexer: support underscores in numeric literals 2016-11-08 18:46:51 +03:00
Mikhail Zarechenskiy
c956428d96 Update JFlex to 1.7.0
Previous patched version (1.4.3) from Itellij was dropped. As we are using skeleton from Intellij, we should update our jflex version accordingly
2016-11-08 18:46:51 +03:00
Ilya Gorbunov
8feaaf4df0 Allow to annotate generated API with SinceKotlin and annotate new array functions. 2016-11-08 18:08:59 +03:00
Ilya Gorbunov
dceec89572 JS: Array.toString is const, Array.contentToString is shallow, Array.contentDeepToString is deep and self-reference aware
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
f3da656d6e contentEquals, contentHashCode, contentToString: Add js implementation and tests
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
a868eecb1a Introduce contentEquals/HashCode/ToString for Arrays. Different methods for deep equals/hashCode/toString rather than overloads with a parameter, because most of the time it would be constant, and make these methods inline-only.
Make `contentEquals` infix function.
Add docs.
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
ab2facf030 Remove special source generation for js stdlib, use same template, rename generated file. 2016-11-08 17:23:45 +03:00
Valentin Kipyatkov
8cd35f67fd More correct implementation of addImportingScopes 2016-11-08 12:51:34 +03:00
Valentin Kipyatkov
109ec11d51 Changes after rebase on master 2016-11-08 12:46:46 +03:00
Valentin Kipyatkov
4915b049c4 Extracted methods 2016-11-08 12:46:46 +03:00
Valentin Kipyatkov
85e1e53354 Checking for unsupported return's 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
779ed32a4b Renames + merged all back into module idea 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
e5748f7a86 Renames 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
4c4c85e37a Supported unit return type functions 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
152e77bad3 Added comment 2016-11-08 12:46:44 +03:00
Valentin Kipyatkov
553bb6281b Extracted method 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
a42be4f60f Refactoring 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
6168e50e7d Other way of handling post-insertion actions 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
08c6a21ac1 Handling safe calls of multi-statement function 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
330d3a255a introduceValue() always adds statement before except for safe call case 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
8f9f2027f2 Adding block to control structure when needed 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
a4aa9bab8d Very basic version of inline function for block body 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
66c815968b Refactoring 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
3b97a3feb1 Supported case when explicit function type is used 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
9490d1bb1c Reused code of analyzeInContext 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
129b4b507f Made not data class 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
7df3c577f5 Refactored ConstructedExpressionWrapper into ConstructedExpressionHolder merging it with CallKindHandler 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
ca28d02300 Minor 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
1e9ce5b10f Moved nested classes out 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
dc04263aeb Minor 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
0932e178e2 Made private 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
57411b4d5e Supported inline function for expression body case 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
67e5ed802f More correct 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
7324ae145e Refactoring 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
f2b32f6d90 Minor refactoring 2016-11-08 12:45:29 +03:00
Valentin Kipyatkov
02f4b883f9 One more code refactoring 2016-11-08 12:45:28 +03:00
Valentin Kipyatkov
29175e96e9 Code refactoring 2016-11-08 12:45:28 +03:00
Alexander Udalov
8c65379711 Support injecting custom module into KotlinBuiltIns
Provide a command-line option to load built-ins from the module and its
dependencies instead of looking for them in kotlin-compiler.jar; built-ins must
be found this way, or an error will be reported (or, most likely at this
moment, an exception will be thrown).

Note that this does not affect whether built-ins (loaded from one place or the
other) are added to the _dependencies_ of the module, this is controlled by
another option. The option added in this commit only makes the KotlinBuiltIns
instance which is used via ModuleDescriptor throughout the compiler front-end
(and also injected in a bunch of places) a sort of "helper" which always goes
to that same module to find descriptors for built-in classes
2016-11-08 12:14:24 +03:00
Alexander Udalov
7898e2447d Minor, rename JVMConfigurationKeys.ADD_BUILT_INS_TO_DEPENDENCIES 2016-11-08 12:14:24 +03:00
Alexander Udalov
5cd9e11f44 Refactor initialization of JvmBuiltIns instance
Use lazy val instead of lateinit var + implicit dependency on the code in
KotlinBuiltIns constructor
2016-11-08 12:14:23 +03:00
Alexander Udalov
5adb22ed65 Do not evaluate anything eagerly in KotlinBuiltIns constructor 2016-11-08 12:14:23 +03:00
Simon Ogorodnik
2be4800307 Fix for KT-14604 J2K Yet another floating point with exponent format 2016-11-08 12:04:05 +03:00
Simon Ogorodnik
7e82dd9adc Fix for KT-14585 J2K, ConvertJavaCopyPasteProcessor shows a dialog under write action 2016-11-08 12:04:04 +03:00
Ilya Gorbunov
61ef26614d Fixup after merge (temporary until collection typealiases are introduced in stdlib) 2016-11-08 03:56:39 +03:00
Ilya Gorbunov
a067888fed Provide no-op members in JS ArrayList to work with capacity.
#KT-14637
2016-11-07 21:58:43 +03:00
Ilya Gorbunov
fbcf7c146b Remove JavaPackage from common completion tests, move to java-specific tests 2016-11-07 21:39:42 +03:00
Ilya Gorbunov
6656d10c67 Fix tests: do not refer to removed things. 2016-11-07 21:39:41 +03:00
Ilya Gorbunov
660dc94f7c Move Closeable to its usage, move internal Serializable to kotlin package in JS, introduce internal typealias in kotlin.io in JVM. 2016-11-07 21:39:36 +03:00
Ilya Gorbunov
a895702730 Remove js classes that should not be there 2016-11-07 21:35:27 +03:00
Alexey Sedunov
2ff8e922f0 Create from Usage: Add test for KT-14500 2016-11-07 20:03:37 +03:00
Alexey Sedunov
a414843f54 Control-Flow Analysis: Use PSI to generate pseudocode if nested resolved call is confused with outer one (e.g. a {} when invoke() is missing)
#KT-14500 Fixed
2016-11-07 20:03:36 +03:00
Alexey Sedunov
e8b5387384 Create from Usage: Support array access expressions/binary expressions with type mismatch errors
#KT-14501 Fixed
2016-11-07 20:03:35 +03:00
Alexey Sedunov
0159ddbc49 Control-Flow Analysis: Do not skip pseudocode for value arguments if they are matched with errors 2016-11-07 20:03:34 +03:00
Alexey Sedunov
df38c70278 Quick Fixes: Replace strong references to PSI elements with smart pointers
#KT-14552 Fixed
2016-11-07 20:03:33 +03:00
Alexey Sedunov
8ceeff0211 Change Signature: Use new signature when looking for redeclaration conflicts
#KT-14583 Fixed
2016-11-07 20:03:32 +03:00
Alexey Sedunov
f4e8242a22 Convert Property to Function Intention: Search occurrences using progress dialog
#KT-14569 Fixed
2016-11-07 20:03:31 +03:00
Alexey Sedunov
30d08c989d Kotlin Facet: Use facet configuration to provide language version for IDE analyzer 2016-11-07 20:03:30 +03:00
Alexey Sedunov
6dd950cd5a Kotlin Facet: Use facet configuration in JPS build 2016-11-07 20:03:29 +03:00
Alexey Sedunov
d0de9dd43c Kotlin Facet: Get rid of copy constructors for compiler arguments/settings and use reflection-based copying instead 2016-11-07 20:03:29 +03:00
Alexey Sedunov
a2948a624f Kotlin Facet: Reuse JvmTarget and LanguageVersion in facet configuration 2016-11-07 20:03:28 +03:00
Alexey Sedunov
b6de7d3503 Convert to Kotlin: Compiler arguments/settings JPS serializers 2016-11-07 20:03:27 +03:00
Alexey Sedunov
9e4fcf9731 Convert to Kotlin: Compiler arguments/settings JPS serializers (rename to .kt) 2016-11-07 20:03:26 +03:00
Alexey Sedunov
b88573e6a8 Convert to Kotlin: JpsKotlinCompilerSettings.java 2016-11-07 20:03:25 +03:00
Alexey Sedunov
7cb2f04d24 Convert to Kotlin: JpsKotlinCompilerSettings.java (rename to .kt) 2016-11-07 20:03:24 +03:00
Alexey Sedunov
a6dbdbd3e5 Refactoring: Move facet configuration classes to idea-jps-common module 2016-11-07 20:03:23 +03:00
Alexey Sedunov
68e293baac Kotlin Facet: Validate dialog on language/API version change 2016-11-07 20:03:23 +03:00
Valentin Kipyatkov
3d5d2d8258 KT-14376 ClassCastException from object with vals
#KT-14376 Fixed
2016-11-07 18:31:04 +03:00
Valentin Kipyatkov
3fb64f4fa6 Fixed completion list sorting so that "shouldCompleteTopLevelCallablesFromIndex" not be first when typing "st" 2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
eefa409a1d Fixed "Offset ... is not registered" exceptions when running under IDEA 2016.3 2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
0af142edb3 KT-14410 Autopopup completion is triggered in string literals for packages
#KT-14410 Fixed
2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
a2ebf07a93 KT-14386 Smart completion: add "<parameter name> = true/false" choices
#KT-14386 Fixed
2016-11-07 18:28:23 +03:00
Dmitry Jemerov
54f28cab45 allow to pass compiler version number externally 2016-11-07 14:33:59 +01:00
Anton Bannykh
283d16b7f4 Updated example test path in the test.html (used to debug JS box tests) to match the current state. 2016-11-07 15:32:26 +03:00
Mikhail Glukhikh
a6d17132b3 Build fix: forgotten inspection descriptions was added for new inspections 2016-11-07 14:55:36 +03:00
Alexander Udalov
3db459c1d8 JS: drop Collections.reverse and java.util.Collections altogether 2016-11-07 12:27:54 +03:00
Alexander Udalov
e8fecea871 JS: drop Collections.max 2016-11-07 12:27:52 +03:00
Alexander Udalov
316fbd820b JS: drop Collections.sort 2016-11-07 12:27:13 +03:00
Alexander Udalov
30a7790dca Minimize references to java.util.Collections in stdlib sources
Only three usages are left in platform-independent code: in reverse, sort and
sortWith for mutable lists
2016-11-07 12:20:14 +03:00
Alexander Udalov
b52f67132e Fix some warnings in JS-specific stdlib sources 2016-11-07 12:20:14 +03:00
Alexander Udalov
52511845fc Minor reformat in JS libraries + remove commented out code 2016-11-07 12:20:14 +03:00
Ilya Gorbunov
766a28c5f8 Update builtin deserialization tests. 2016-11-04 04:36:02 +03:00
Ilya Gorbunov
1a471d7f6b Annotate new enum-related API with SinceKotlin. 2016-11-04 04:18:51 +03:00
Ilya Gorbunov
11bb10e7f7 Annotate new DslMarker annotation with SinceKotlin 2016-11-03 22:34:59 +03:00
Denis Zharkov
77e2b12566 Add kotlin.DslMarker to binary public API 2016-11-03 17:55:41 +03:00
Vyacheslav Gerasimov
2a0557f742 Added missing KtLambdaArgument to UElement conversion in KotlinUastLanguagePlugin
#KT-14470 Fixed
2016-11-03 17:21:39 +03:00
Vyacheslav Gerasimov
9534934f43 Implemented kotlin quick fix provider for create android resource quick fixes
#KT-10465 Fixed
#KT-12880 Fixed
2016-11-03 17:21:28 +03:00
Vyacheslav Gerasimov
29b9521596 Android lint check for api requirements for classes in catch clause (KT-13243)
Added test for #KT-14047, #KT-13243 Fixed, #KT-14047 Fixed
2016-11-03 17:21:17 +03:00
Vyacheslav Gerasimov
387d5ffd73 Added call to ImportFilter in import quickfix (KT-14439)
#KT-14439 Fixed
2016-11-03 17:20:57 +03:00
Michael Bogdanov
fd6d4c352c Special enum function support; Fix for KT-10569: Cannot iterate over values of an enum class when it is used as a generic parameter
#KT-10569 Fixed
2016-11-03 14:27:13 +03:00
Valentin Kipyatkov
6a3597fa0f Minor changes on code review 2016-11-02 19:25:28 +03:00
Valentin Kipyatkov
6d3dd5d9b7 More uses of partial body resolve 2016-11-02 19:25:28 +03:00
Valentin Kipyatkov
68174470c3 Add BodyResolveMode parameter to resolveToDescriptor() 2016-11-02 19:25:27 +03:00
Valentin Kipyatkov
a10272b236 Optimization: do not use resolveToDescriptor() which uses full body resolve 2016-11-02 19:25:26 +03:00
Valentin Kipyatkov
c0d89e67a9 Do not resolve all bodies of anonymous objects and local classes in partial body resolve 2016-11-02 19:25:25 +03:00
Valentin Kipyatkov
23c22984e8 Optimization: look for callables at first when prefix starts uppercase and the opposite otherwise 2016-11-02 19:25:25 +03:00
Valentin Kipyatkov
dbaaee7d0b Refactoring: step 1 2016-11-02 19:25:24 +03:00
Valentin Kipyatkov
6c3d2c62b4 Minor 2016-11-02 19:25:23 +03:00
Valentin Kipyatkov
9f1cdde20b Better modifier order 2016-11-02 19:25:22 +03:00
Valentin Kipyatkov
f6a73e756e Refactoring 2016-11-02 19:25:22 +03:00
Valentin Kipyatkov
6c17fa7736 Performance optimization for completion after "ge", "se", etc 2016-11-02 19:25:21 +03:00
Valentin Kipyatkov
2b2ef5a349 Performance optimization: do not invoke DescriptorToSourceUtilsIde.getAnyDeclaration() on creating LookupElement - do it lazily
#KT-14606 In Progress
2016-11-02 19:24:46 +03:00
Denis Zharkov
8aefc0db7c Do not suggest "Rename to _" quick-fix for parameter of named function
#KT-14586 Fixed
2016-11-02 15:38:03 +03:00
Yan Zhulanow
951868f590 Explicitly filter out classes found by DataBindingClassFinder and DataBindingComponentClassFinder for scope without sources (KT-12402)
This change is temporary, and it should be reverted when the original problem in DataBinding IDE support is fixed.
2016-11-01 19:36:33 +03:00
Yan Zhulanow
4188ef6e53 Fix conformance test 2016-11-01 19:36:32 +03:00
Yan Zhulanow
7338980d00 Lint: Add several checkCancelled() checks to UElementVisitor 2016-11-01 19:36:32 +03:00
Yan Zhulanow
65cea7e92c Lint: Use IntellijApiDetector in IDE 2016-11-01 19:36:32 +03:00
Yan Zhulanow
6ff29f473b Uast: Migrate to UAnnotation 2016-11-01 19:36:32 +03:00
Yan Zhulanow
fee54d9b86 Lint: Remove SdkWrapper and AnroidModelFacade (was needed in Android Studio 1.5) 2016-11-01 19:36:31 +03:00
Yan Zhulanow
7404b91cb3 Lint: Fix diagnostic tests 2016-11-01 19:36:31 +03:00
Yan Zhulanow
565ca0f7a3 Lint: Fix compilation errors after replacing diagnostics 2016-11-01 19:36:31 +03:00
Vyacheslav Gerasimov
2be9a083ad Lint: Android Lint diagnostics fixes 2016-11-01 19:36:31 +03:00
Yan Zhulanow
c2ddd943f9 Lint: Update diagnostics because of the new Uast. Also, these diagnostics are from AS 2.2. 2016-11-01 19:36:31 +03:00
Yan Zhulanow
4c4d6a4ad4 Temporary remove outdated Uast tests 2016-11-01 19:36:30 +03:00
Yan Zhulanow
d5d491e6b2 Lint: Update Uast implementation (the new version is without declaration level) 2016-11-01 19:36:30 +03:00
Denis Zharkov
6491d3fbac Do not report DSL scope violation error when language-version is 1.0
#KT-11551 Fixed
2016-11-01 15:58:14 +03:00
Denis Zharkov
7553d3f72b Intoduce and support DslMarker annotation
#KT-11551 In Progress
2016-11-01 15:58:14 +03:00
Denis Zharkov
b8e8206c4f Minor. Remove redundant parameter
LexicalWritableScope.implicitReceiver is always null for all constructor's usages
2016-11-01 15:58:14 +03:00
Kirill Rakhman
8a73a1da2c Implement Intention + Inspection to remove empty secondary constructor body #KT-14326 Fixed 2016-11-01 14:11:28 +03:00
Kirill Rakhman
495dd3641c Add Inspection to remove empty primary constructor #KT-14521 Fixed 2016-11-01 14:11:14 +03:00
Kirill Rakhman
ba7f60040a clean up psi package 2016-11-01 14:11:07 +03:00
Kirill Rakhman
e10d10c49e Add quick fix to remove single lambda parameter if it's unused #KT-14593 Fixed 2016-11-01 14:11:02 +03:00
Anton Bannykh
2fb7b01320 Fix capturing variables declared via destructuring (#KT-14535 fixed). 2016-11-01 14:00:24 +03:00
Anton Bannykh
bb4d8f9223 Cleaned up AliasingContext.java 2016-11-01 13:55:09 +03:00
Ilya Gorbunov
49ea0f5984 Relax generic variance in Array.flatten 2016-10-31 22:05:38 +03:00
Ilya Gorbunov
adaad58cc7 Add required builtins when building tests. Either as reference to kotlin-runtime, or resort to those from the compiler with the -Xadd-compiler-builtins argument. 2016-10-31 22:03:16 +03:00
Ilya Ryzhenkov
f79116a6d8 Optimize reflection by using Class.getName instead of Class.getCanonicalName 2016-10-31 20:17:33 +03:00
shiraji
e7575599eb Correct handling of "Redundant if" for negation case #KT-14575 Fixed 2016-10-31 12:35:00 +03:00
shiraji
62f81e795c Redundant calls of conversion methods: do not suggest for flexible receiver types #KT-14570 Fixed 2016-10-31 12:24:43 +03:00
Alexander Udalov
f9a48857f5 Add IR sources to kotlin-compiler-sources.jar 2016-10-31 11:27:04 +03:00
Vyacheslav Gerasimov
2f859f6996 fix KotlinAndroidAddStringResource: correct generic extension function processing + minor refactoring 2016-10-30 22:56:37 +03:00
Alexey Tsvetkov
2ffb0abb59 Fix caches closing/flushing when IC builds non-incrementally 2016-10-28 23:55:03 +03:00
Dmitry Jemerov
91f76ada04 build fix: don't use API not available in IDEA 161 2016-10-28 21:16:29 +02:00
Ilya Gorbunov
ed2a218ec2 Add new bitwise operations to constant evaluator map. #KT-13554 2016-10-28 20:50:13 +03:00
Dmitry Petrov
ed60674d13 KT-14498: Properly check variance in expanded types. 2016-10-28 18:02:15 +03:00
Alexey Tsvetkov
49bf1e5917 Fix forcing java to compile if kotlin classes are compiled 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fa6ed71fbd Fix running gradle tests on windows 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
2c1699bc89 Minor: remove js-library dependency from jvm module 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7642314780 Always flush caches 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fc1af746c6 Gradle IC: treat companion object change as class signature change 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
f01a956a8b Gradle IC: fix converting class to package facade 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
151cf7d073 Gradle IC: support multifile classes 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
f25d948b3f Gradle IC should fail if duplicating class is added
#KT-14554 fixed
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
67b3d54b37 In case of IC failure rebuild all files since last build
Before this change only files from last iteration were rebuilt.
It is correct and optimal, but there are many diffs with JPS/Gradle
logs.
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7c16d086aa Groundwork for using IC without Gradle 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7c1ebba57a Minor: do not print index in parametrized test name 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
6191fd87ec Minor: shorten references after move 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
68a7d88673 Refactoring: reorder IncrementalJvmCompilerRunner constructor parameters 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
3fabe6e4a7 Minor: update copyright in Gradle plugin 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
4a48c30f02 Cleanup: optimize imports in Gradle plugin 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
4ea9216672 Minor: replace File::isFile with File::exists 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
b0411de5c6 Minor: make Rebuild object 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
417f4f821b Minor: remove duplicated logger utils 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
368e48780e Refactoring: move IC classes into separate package 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
3bcd6e9a93 Refactoring: do not pass properties as parameters 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
c283515922 Refactoring: pass classpath and destination in K2JVMCompilerArguments 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
90dbf6c5fc Refactoring: delegate IC files management to IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
d569651099 Refactoring: split GradleMessageCollector and remove Gradle Logger from IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
78c115523c Refactoring: move all IC logic to IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
0d1c803f71 Rebuild on cache corrupted exception
#KT-14055 fixed
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fafde1e948 Refactoring: introduce IncReporter to report IC progress 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
e32c19ce4e Refactoring: extract calculateSourcesToCompile 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
388dd9c2a6 Refactoring: return removed dirty files from calculateSourcesToCompile 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
b4c17dabf4 Refactoring: introduce class ChangedFiles 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
e9d4d85af2 Refactoring: extract parts of IC 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
26373d4952 Refactoring: pass incremental compilation state explicitly 2016-10-28 17:58:10 +03:00
Dmitry Jemerov
35130e7e5f Don't calculate property name if we aren't going to search for property accessors in Kotlin sources (KT-14508) 2016-10-28 16:47:35 +02:00
Dmitry Jemerov
127db98bbc Fix Kotlin definitions search for classes which can only be used in a local search scope (KT-13753) 2016-10-28 16:47:35 +02:00
Dmitry Jemerov
e93f6e97cb KotlinDefinitionsSearcher: cleanup after J2K 2016-10-28 16:47:34 +02:00
Dmitry Jemerov
2fc601832c KotlinDefinitionsSearcher: J2K 2016-10-28 16:47:34 +02:00
Dmitry Jemerov
4281c13c28 KotlinDefinitionsSearcher: rename to .kt 2016-10-28 16:47:33 +02:00
Dmitry Jemerov
237504c3c7 Classes with no parent are top-level (EA-90570 - assert: KtPsiUtil.getOutermostClassOrObject) 2016-10-28 16:47:33 +02:00
Dmitry Jemerov
395bdf47e6 Use correct FQ name for running inner classes (KT-14153) 2016-10-28 16:47:27 +02:00
Dmitry Jemerov
f783ba7573 Exclude local variables from file structure grouping (KT-14363) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
5d6f1cf3fa Fix handling of underscores in Markdown links (KT-14452) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
25c7dccd3b Don't consider function names as candidates for "Show expression type" (KT-14384) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
4246fcf256 "Show expression type" no longer shows elements which enclose the element at caret (KT-14436) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
57680ae003 Don't show literals in "show expression type" popup 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
e6c05c3a19 Don't show type for reference expressions inside KtCallableReference (KT-14530) 2016-10-28 16:40:27 +02:00
Mikhail Glukhikh
4f82958309 If then to elvis: do not report inspection if not used as expression
(cherry picked from commit 2adcb27)
2016-10-28 17:21:12 +03:00
Mikhail Glukhikh
d1554217d3 Minor: if then to elvis
(cherry picked from commit 7703994)
2016-10-28 17:20:59 +03:00
Dmitry Jemerov
be13aa0a3b Separate targets for writing compiler version and plugin version to template files 2016-10-28 15:14:08 +02:00
Vyacheslav Gerasimov
3ce1703ced Extract string resource intention action for android (KT-11715)
#KT-11715 Fixed
2016-10-28 15:30:22 +03:00
Mikhail Glukhikh
53ea5a2dbb Minor refactoring: if then to elvis 2016-10-28 15:00:55 +03:00
Mikhail Glukhikh
f3c25c728e If then to elvis: no more allowed for if expressions with Unit result 2016-10-28 15:00:50 +03:00
Mikhail Glukhikh
8edd33ee92 If then to elvis: applied in IDEA, front-end & J2K modules 2016-10-28 15:00:21 +03:00
Mikhail Glukhikh
e7cef79709 If then to elvis: now not applicable for is with type unrelated to original #KT-14520 Fixed 2016-10-28 15:00:09 +03:00
Mikhail Glukhikh
87d265dc1b If then to elvis: now not applicable for is with nullable type #KT-14545 Fixed 2016-10-28 15:00:04 +03:00
Mikhail Glukhikh
89e908dab5 If then to elvis: now not applicable for calls with nullable result #KT-14542 Fixed 2016-10-28 14:59:58 +03:00
Mikhail Glukhikh
f390b9159a Minor refactoring: if then to elvis 2016-10-28 14:59:53 +03:00
Mikhail Glukhikh
7b316f72dc Lambda to reference: correct handling of named arguments using resolved call #KT-14550 Fixed 2016-10-28 14:59:48 +03:00
Mikhail Glukhikh
7d242c5c77 Minor: surround with null check: partial analysis 2016-10-28 14:59:42 +03:00
Valentin Kipyatkov
046c55a7ac Caching for PARTIAL_FOR_COMPLETION resolve too (because it's used not only in completion) 2016-10-28 09:47:27 +03:00
Valentin Kipyatkov
13ca110430 Refactoring 2016-10-28 09:47:26 +03:00
Valentin Kipyatkov
0fbbf1a340 Performance fix for postfix completion: 1. Don't use PARTIAL_FOR_COMPLETION resolve mode 2. Attempt to use resolve in physical file instead of synthetic one 2016-10-28 09:42:47 +03:00
Valentin Kipyatkov
8c99b0e64c Performance fix for Import Member 2016-10-28 09:42:47 +03:00
Nikolay Krasko
d9ef8aa96f Do nothing for disposed projects 2016-10-27 23:36:54 +02:00
Ilya Chernikov
2e03a6f1fd Add script dependencies modification tracker, some optimizations 2016-10-27 23:36:54 +02:00
Simon Ogorodnik
3382ab3d9c Fix for KT-14141: Go to Symbol shows Kotlin extensions from Java's point of view 2016-10-27 20:38:05 +03:00
Simon Ogorodnik
0462a3d3b6 Workaround KT-14531, Partial fix for KT-13600, KT-11620 J2K: Invalid conversion context on plain text pasting
For detailed info see KT-14531
2016-10-27 20:02:27 +03:00
Simon Ogorodnik
f8b7ce1011 Fix for KT-13695, KT-13159 J2K: Invalid conversion context setup for plain text pastes
Extending, Implementing, imports from paste target file previously not implemented
2016-10-27 20:02:26 +03:00
Simon Ogorodnik
b802ca0af5 Fix for non-resolving of KtReference, which getTargetDescriptors returning multiple descriptors to same element 2016-10-27 20:02:25 +03:00
Simon Ogorodnik
7c8fdc42b4 Fix for KT-12892 J2K: Wrong placing of comments when constructor converted to primary constructor & init 2016-10-27 20:02:24 +03:00
Simon Ogorodnik
b51f5c5bd9 Fix for KT-14248 J2K: Invalid constructor formatting after conversion
Caused by `\n\n long mLong = 0;` leading line breaks
2016-10-27 20:02:23 +03:00
Simon Ogorodnik
f1c371143c Fix for KT-5312 J2K: Correct bit operations priority after conversion
Now `PolyadicExpression` breaks down to BinaryExpression`s
2016-10-27 20:02:23 +03:00
Simon Ogorodnik
1069257e95 Fix for KT-5410 J2K: someObject + "someString" should be converted to someObject.toString() + "someString"
Otherwise `+` operator will not resolve
2016-10-27 20:02:21 +03:00
Simon Ogorodnik
0cebcc9f3c Fix for KT-12677. J2K: Invalid SAM constructor redundancy detection
Now all J2kPostProcessing's executing in fixed order, dependent on it index in J2kPostProcessingRegistrar._processings
2016-10-27 20:02:20 +03:00
shiraji
0b57d8eb49 Do not use "Remove redundant '.let' call" when receiver is used #KT-14390 Fixed 2016-10-27 19:10:14 +03:00
Anton Bannykh
6a1b0b9cbc withNonLocalReturn.kt was disabled for a wrong reason; reported the actual issue and fixed the comment 2016-10-27 17:27:03 +03:00
Michael Bogdanov
fd2655fd4a Bridge support 2016-10-27 16:43:02 +03:00
Michael Bogdanov
7989a0ff25 Use original descriptor on delegating to DefaultImpls 2016-10-27 16:43:01 +03:00
Michael Bogdanov
4cbc5cc958 Remove variables from frame on block leaving 2016-10-27 16:43:00 +03:00
Michael Bogdanov
afe0b8a0b6 Switch to general codegen in 'Bytecode tool window' 2016-10-27 16:41:15 +03:00
Mikhail Glukhikh
2130164d9b EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT is now reported on property if accessor is external #KT-9297 Fixed
Also fixes EA-89227
2016-10-27 16:25:43 +03:00
Nikolay Krasko
e053b77ede Test for "Code folding doesn't work in kotlin lambdas after some declatation" (KT-14411)
Fixed in previous commit

 #KT-14411 Fixed
2016-10-27 14:26:12 +03:00
Nikolay Krasko
08d628537c Assign trailing and preceding whitespaces to lambda block until the last comment in parser 2016-10-27 14:26:10 +03:00
Nikolay Krasko
0261385681 Report file name for getDefaultPlatform() information 2016-10-27 14:26:07 +03:00
Anton Bannykh
7ee3baa020 Replaced when appropriate 'TARGET_BACKEND: JVM' -> 'IGNORE_BACKEND: JS'. Enabled some succesfully working decompiledText tests. 2016-10-27 14:17:25 +03:00
Anton Bannykh
dc151c1d84 Implemented specifying specific ignored backend (e.g. '// IGNORE_BACKEND: JS' instead of '// TARGET_BACKEND: JVM') 2016-10-27 14:17:25 +03:00
Dmitry Jemerov
38a448ebbd use a non-deprecated API 2016-10-27 12:50:39 +02:00
Michael Bogdanov
0910f166a5 Make default methods for inlineOnly and reified functions package private 2016-10-27 11:03:35 +03:00
Alexander Udalov
455fef90c0 Fix codefen test case by adding stdlib 2016-10-27 10:44:33 +03:00
Ilya Gorbunov
a6783534f0 Add required *.kotlin_builtins to classpath for stdlib tests 2016-10-26 21:41:54 +03:00
Alexander Udalov
c49c019250 Add option to restore fallback to compiler built-ins + resurrect Maven build 2016-10-26 19:02:31 +03:00
Anton Bannykh
a3566174d6 Support destructuring in lambda parameters (KT-14422) and skipping some components in a destructuring declaration (KT-14507). 2016-10-26 18:29:13 +03:00
Ilya Gorbunov
1c7196a1fb Allow to reference internal API in stdlib tests 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
8d76617094 Merge ReversedViews tests in one file as they can all run now in JS.
Make SynchronizedLazyValTest jvm-only.
2016-10-26 17:47:15 +03:00
Ilya Gorbunov
badbcd08de Annotate explicitly stdlib tests, which must be excluded from JS stdlib tests with @JvmVersion, do not use file naming convention, use preprocessor instead. 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
baccac30fb Annotate explicitly stdlib sources, which must be excluded from JS stdlib with @JvmVersion, do not use file naming convention. 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
98f7c61333 Reuse JVM box tests for binary operations in JS, excluding those that can't pass now. 2016-10-26 16:36:09 +03:00
Ilya Gorbunov
19922135fd JS: Add intrinsics for bitwise ops. #KT-13554 2016-10-26 16:36:07 +03:00
Ilya Gorbunov
62fb47d137 Introduce bitwise operations and/or/xor/inv for Byte and Short. #KT-13554
Annotate new bitwise operations with SinceKotlin.
2016-10-26 16:35:46 +03:00
Alexander Udalov
7f86ce0a20 Introduce fallback option to add built-ins in position manager test
In AbstractPositionManagerTest, built-ins could no longer be resolved because
JvmIDEVirtualFileFinder is used in IDE tests (even when the compilation is
called through JvmResolveUtil/GenerationUtils as in compiler tests), which is
not yet able to locate .kotlin_builtins files
2016-10-26 16:31:09 +03:00
Alexander Udalov
e0989caf46 Load built-ins from module dependencies in JVM compiler
Introduce a new method KotlinClassFinder#findBuiltInsData, which is only
implemented correctly in the JvmCliVirtualFileFinder because it's only used in
the compiler code at the moment.

Introduce JvmBuiltInsPackageFragmentProvider, the purpose of which is to look
for .kotlin_builtins files in the classpath and provide definitions of
built-ins from those files.

Also exclude script.runtime from compilation because, as other excluded
modules, it has no dependency on the stdlib and is no longer compilable from
the IDE now, because it cannot resolve built-ins from anywhere
2016-10-26 16:31:09 +03:00
Alexander Udalov
0b59c71340 Add mock runtime to KotlinJpsBuildTest test cases
To prevent test failures once the JVM compiler stops loading definitions of
built-in declarations from itself and starts to rely on their presence in the
library, that the compiled source code depends on
2016-10-26 16:31:07 +03:00
Alexander Udalov
88add3e06d Get rid of some KotlinBuiltIns#getBuiltInsModule usages
There will be no separate module for built-ins soon, they will be resolved as
normal dependencies
2016-10-26 16:31:06 +03:00
Alexander Udalov
484b0e36fb Add KotlinBuiltIns#isBuiltIn, use it instead of other utilities 2016-10-26 16:31:05 +03:00
Alexander Udalov
4effe42f1d Use JvmResolveUtil#createContainer in KotlinOverloadTest and KotlinOverridingTest 2016-10-26 16:31:05 +03:00
Alexander Udalov
8a5c8da757 Simplify module configuration and built-ins dependency in some tests
- In tests on built-ins with no sources, just call
  JvmResolve.analyze(environment) and inspect the resulting module
- In AbstractLocalClassProtoTest, create container via
  TDAForJVM.createContainer
- Inline single module container creation into AbstractDiagnosticsTest
2016-10-26 16:31:04 +03:00
Alexander Udalov
2b34d62848 Extract superclass from FunctionClassScope and CloneableClassScope 2016-10-26 16:31:03 +03:00
Alexey Sedunov
416569c2d2 Introduce Type Parameter: Disable shortcut (to avoid interference with IntelliJ API Watcher plugin) 2016-10-26 15:03:45 +03:00
Alexey Sedunov
dc9c988287 Kotlin Facet: Fix serialization/deserialization 2016-10-26 15:03:44 +03:00
Alexey Sedunov
3fcdda2805 Kotlin Facet: Refactor TargetPlatform to sealed class. Move settings-related classes to top level 2016-10-26 15:03:43 +03:00
Alexey Sedunov
ea13456bba Kotlin Facet: Add compiler settings to facet configuration 2016-10-26 15:03:42 +03:00
Alexey Sedunov
03f4d9f574 Kotlin Facet: Add extension point for compiler/stdlib version info with implementations for Maven and Gradle project models 2016-10-26 15:03:42 +03:00
Alexey Sedunov
e0285b9955 Kotlin Facet: Extract VersionInfo class and getVersionInfo() utility function 2016-10-26 15:03:41 +03:00
Alexey Sedunov
37286d5b06 Kotlin Facet: Add API version setting 2016-10-26 15:03:40 +03:00
Alexey Sedunov
2326e3ed12 Kotlin Facet: Add custom settings and configuration extension point 2016-10-26 15:03:39 +03:00
mglukhikh
73b24f2b20 Build fix: "If then to elvis" inspection test 2016-10-26 14:15:07 +03:00
Michael Bogdanov
eaf9c2e8b0 Fix for KT-13890: IllegalAccessError when invoking protected method with default arguments
#KT-13890 Fixed
2016-10-26 12:13:20 +03:00
Michael Bogdanov
1e59161e8f Fix for KT-14201: UnsupportedOperationException: Don't know how to generate outer expression for anonymous object with invoke and non-trivial closure
#KT-14201 Fixed
2016-10-26 12:13:19 +03:00
Nikolay Krasko
e41cddd870 Allow to select single word on double click in one line doc comment (KT-14327)
(cherry picked from commit 184d39a)

 #KT-14327 Fixed
2016-10-25 18:18:07 +03:00
Mikhail Glukhikh
ba0e36cdb1 (1.1 only) Var can be val: correct handling of delegated local variables #KT-14409 Fixed 2016-10-25 17:57:40 +03:00
Mikhail Glukhikh
66f3e266d9 Var can be val: correct handling of initialization in lambda #KT-14065 Fixed 2016-10-25 17:57:36 +03:00
Mikhail Glukhikh
fd9e59ac7b Surround with null check for unsafe things: find first parent statement to surround (which is not used as expression) #KT-13958 Fixed 2016-10-25 17:57:32 +03:00
Mikhail Glukhikh
e56a10aa41 "Surround with null check" is now a high-priority action 2016-10-25 17:57:29 +03:00
Mikhail Glukhikh
35d104782e Minor: primary constructor to secondary: do not specify independent property type explicitly 2016-10-25 17:57:25 +03:00
Mikhail Glukhikh
a74f010e0f Primary constructor to secondary: always try to build constructor body #KT-14475 Fixed 2016-10-25 17:57:21 +03:00
Mikhail Glukhikh
d6eee65d72 Object literal to lambda: more precise shorten references #KT-14289 Fixed 2016-10-25 17:57:17 +03:00
Mikhail Glukhikh
dc76f2a62f Lambda to reference: check potential reference arguments by descriptors and not by names #KT-14420 Fixed 2016-10-25 17:57:13 +03:00
Mikhail Glukhikh
97b45569fc Lambda to reference: not-null types are now preferred for platform type receivers #KT-14394 Fixed 2016-10-25 17:57:09 +03:00
Mikhail Glukhikh
a901de5112 KT-14084 related : replaceFirstReceiver now replaces ALL calls to safe calls if necessary
Fixes relevant "replace let" and "if to elvis" cases
2016-10-25 17:57:06 +03:00
Mikhail Glukhikh
2117b30b76 If expression to elvis now handles call chains #KT-14084 Fixed 2016-10-25 17:57:02 +03:00
Alexander Udalov
1cfb8f2aef Use OverridingUtil#overrides instead of CodegenUtil#doesOverride
This may be more correct in case of complex cross-module inheritance, where
overridability should be detected by structural equality of signatures instead
of referential equality of constructed descriptors (no test added because it's
not so easy to come up with an example)
2016-10-25 15:42:34 +03:00
Alexander Udalov
4e7542b07d Filter out non-builtin package fragments from module when needed
In subsequent commits, a JVM module will be able to have up to two package
fragments for a given package FQ name. For example, for package "kotlin" in
kotlin-runtime.jar there will be a LazyJavaPackageFragment with binary
(Kotlin+Java) dependencies, and a BuiltInsPackageFragment for built-ins
metadata (which is loaded from kotlin/kotlin.kotlin_builtins)
2016-10-25 15:42:33 +03:00
Alexander Udalov
9ce211fe87 Use FQ names instead of descriptor equality in RangeCodegenUtil
This is safer in cases when descriptors for the same declaration can come from
different package fragment providers
2016-10-25 15:42:33 +03:00
Alexander Udalov
ccd480236a Add mock JDK and mock runtime to light class tests 2016-10-25 15:42:33 +03:00
Alexander Udalov
035d6156a7 Drop Cloneable in JS, synthesize it at compile-time on JVM
Use the same approach that is used for creating function type classes
(Function{0,1,...}) + add Cloneable to supertypes of Array and primitive arrays

 #KT-5537 Fixed
2016-10-25 15:42:33 +03:00
Alexander Udalov
0f4b10d37d Add JavaToKotlinClassMap#isJavaPlatformClass
Use it instead of mapPlatformClass where we only need to check emptiness
because mapPlatformClass requires built-ins and it's not always easy to come up
with the correct instance of built-ins.

In KotlinEvaluationBuilder, use the nullable function
findClassAcrossModuleDependencies instead of mapPlatformClass which uses the
throwing resolveClassByFqName. This is necessary because DefaultBuiltIns, which
are used there, are not always able to find classes mapped by a _Java_ to
Kotlin class map. (The correct solution would be not to use DefaultBuiltIns at
all, instead obtaining the correct instance of built-ins, which are almost
certainly going to be JvmBuiltIns, from the project configuration.)
2016-10-25 15:42:32 +03:00
Alexander Udalov
2f81d48f5e Use ClassId instead of FqName in JavaToKotlinClassMap
Extract mapJavaToKotlin which returns ClassId and needs no KotlinBuiltIns
instance
2016-10-25 15:42:32 +03:00
Alexander Udalov
0e9f29fdba Make ClassDescriptor#classId nullable
Local classes or anonymous objects do not have a class id. Use "!!" almost
everywhere to make assertion explicit
2016-10-25 15:42:32 +03:00
Alexander Udalov
17e54b6d2d Add ClassDescriptorFactory#getAllContributedClassesIfPossible
Currently a no-op, will be used soon to make Cloneable a synthesized class,
visible in scope's getContributedDescriptors()
2016-10-25 15:42:32 +03:00
Alexander Udalov
c0147860bd Allow multiple ClassDescriptorFactory instances in deserialization 2016-10-25 15:42:32 +03:00
Nikolay Krasko
cdabef51ed Add nullability to receiver type 2016-10-25 13:30:38 +03:00
Nikolay Krasko
22999fe67d Set hasValueArguments in KotlinAnnotationEntryStub to 'true' only if some arguments exist
Currently '()' is used for resolving ambiguity in parsing when annotating function types. This way a decompiled code
will need brackets, but compile code will have annotation without parameters. This commit will allow to make both stub-trees consistent.

Tested in ClsStubBuilderTestGenerated.testAnnotationsOnNullableTypes()
2016-10-25 13:30:37 +03:00
Nikolay Krasko
a344ad0644 Fix absence of annotation for function type in cls stubs and ignore @ExtensionFunctionType 2016-10-25 13:30:35 +03:00
Nikolay Krasko
d1dfcfaca1 Fix stub-psi mismatch exception on restoring annotation for nullable types
(cherry picked from commit 1aa37f1125)

Conflicts:
	compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt
2016-10-25 13:22:53 +03:00
Mikhail Glukhikh
e53940f4af KT-8442 related: correct handling of erroneous destructuring references, fixes EA-90434 2016-10-25 13:13:15 +03:00
Mikhail Glukhikh
e7e56ab85c KT-8442 related: destructuring declarations aren't taken into account during light classes generation, fixes EA-81204 2016-10-25 13:13:11 +03:00
Denis Zharkov
b7e8071a7d Do not use BasicInterpreter for bytecode analysis
The problem with BasicInterpreter is the following:
it creates BasicValue objects that should be replaced in favor of StrictBasicicValue

See commit message in 25c6ac1 for clarification

 #KT-14447 Fixed
2016-10-25 10:14:52 +03:00
Denis Zharkov
e9efc9e892 Replace usages of BasicValue constants in master with StrictBasicValue 2016-10-25 10:14:52 +03:00
Denis Zharkov
d279ded714 Add license and links to rewritten ASM classes 2016-10-25 10:14:52 +03:00
Denis Zharkov
3a197e8d7e Fix NPE caused by nullability checks optimizations
Mostly this commit replaces instances of original BasicValue from ASM
with ones of StrictBasicValue having strict equals implementation

Optimization issue was related to non-symmetric 'equals':
- NotNullBasicValue("java/lang/Object").equals(BasicValue("java/lang/Object")) == false
- BasicValue("java/lang/Object").equals(NotNullBasicValue("java/lang/Object")) == true

 #KT-14242 Fixed
2016-10-25 10:14:52 +03:00
Valentin Kipyatkov
18f10860df KT-14336 for to stdlib to takeWhile: propose conversion into takeWhile if break is located in else branch
#KT-14336 Fixed
2016-10-24 18:32:05 +03:00
Valentin Kipyatkov
5c8db294df Fixed index variable case 2016-10-24 18:32:05 +03:00
Valentin Kipyatkov
e5fcfae969 KT-13998 Loop to call chain converter produces 'none' instead of 'all'
#KT-13998 Fixed
2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
89099b93b1 Split or glue together checks for not null and is instance + more intelligent use of filter vs filterTo
#KT-14284 Fixed
 #KT-14286 Fixed
 #KT-14287 Fixed
 #KT-14303 Fixed
2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
53220b980e More correct checking of forEach requiring asSequence() 2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
a87ca8432e KT-14341 for to stdlib to forEach: if the loop variable is not used in the last/innerest statement the conversion is not proposed
#KT-14341 Fixed
2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
5ca7688b7c Correct handling of explicit variable type 2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
9326dfa048 Honor errors in code before when checking smart casts 2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
eae23b548f KT-14294 for to stdlib to firstOrNull/lastOrNull: intention is absent if there is additional var before for loop
#KT-14294 Fixed
2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
a89ef54578 KT-14210 for loop to stdlib: max/min is not recognized if there is additional if
#KT-14210 Fixed
2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
35ed689b9f any() and other find operations to work with checks for not null and is instance 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
49ef880f3a Moved matcher 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
b28d016709 count() to merge with filterNotNull and filterIsInstance + changed test for KT-14191 to use sum() 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
afd25548a2 KT-14209 for loop to stdlib: sum is not recognized if before was check for type
#KT-14209 Fixed
2016-10-24 18:32:01 +03:00
Valentin Kipyatkov
f5d4b1dc8d KT-14191 FormattingModelInconsistencyException Exception on applying intention Replace with count()
#KT-14191 Fixed
2016-10-24 18:32:01 +03:00
Denis Zharkov
10861e57ff Fix NDFDE for single underscore named property in primary constructor
NDFDE = NoDescriptorForDeclarationException

See the comment in change
2016-10-24 18:00:02 +03:00
Denis Zharkov
09dc207052 Add SingleUnderscoreForParameterName language feature 2016-10-24 18:00:02 +03:00
Denis Zharkov
1f0293eb42 Check modifiers applicability on destructured lambda parameters
#KT-14502 Fixed
2016-10-24 18:00:02 +03:00
Nikolay Krasko
8865c0be34 Step into functions with local variable on first line under "Skip simple getters" (KT-14488)
(cherry picked from commit 9423d65)

 #KT-14488 Fixed
2016-10-24 16:28:17 +03:00
Alexander Udalov
3f5d3e5dbc Fix errors and indent in built-ins sources 2016-10-24 15:30:40 +03:00
Alexander Udalov
2076a31094 Improve Collection/Array/String detection logic in intentions
Use static methods from KotlinBuiltIns and check all supertypes, support cases
of Collection, Map and CharSequence
2016-10-24 15:30:39 +03:00
Alexander Udalov
a5a422fc4d Use TypeConstructor equality instead of ClassDescriptor in CollectionStubMethodGenerator
Equals/hashCode are meaningful for TypeConstructor instances (see
AbstractClassTypeConstructor.java) in contrast to ClassDescriptor where
equality is referential
2016-10-24 15:30:39 +03:00
Alexander Udalov
08398178e0 Make class descriptors in JvmRuntimeTypes lazy
The main reason currently is to avoid eager construction of
defaultContinuationSupertype long before it's needed, which could fail without
built-ins in the classpath
2016-10-24 15:30:39 +03:00
Alexander Udalov
e1aaccaec1 J2K JvmRuntimeTypes: prettify 2016-10-24 15:30:39 +03:00
Alexander Udalov
32b672490f J2K JvmRuntimeTypes: convert 2016-10-24 15:30:39 +03:00
Alexander Udalov
9e4ffd9225 J2K JvmRuntimeTypes: rename .java -> .kt 2016-10-24 15:30:38 +03:00
Alexander Udalov
d9f248ccf4 Minor refactoring in JvmDependenciesIndexImpl
Make SearchResult a sealed class, inline local function & trivial utility
2016-10-24 15:30:38 +03:00
Alexander Udalov
76523cc175 Split JvmDependenciesIndex to several files, move to 'index' package 2016-10-24 15:30:38 +03:00
Alexander Udalov
cdf6567375 Drop TypeConstructor.getAnnotations(), uninherit TypeConstructor from Annotated
The method was unused on TypeConstructor instances, and almost all
implementations returned EMPTY anyway
2016-10-24 15:30:38 +03:00
Alexander Udalov
6b6ddf5f75 Import classes from kotlin.coroutines by default, add to default imports in JS 2016-10-24 15:30:38 +03:00
Mikhail Glukhikh
44d10672be KT-7929 related: KtDestructuringDeclarationEntry is not resolved to descriptor in OverridingDeprecatedMemberInspection 2016-10-24 15:17:56 +03:00
Mikhail Glukhikh
6b9252a5d3 KT-7929 related: incorrect KtDestructuringDeclarationEntry is not resolved to descriptor, fixes EA-76715 2016-10-24 15:17:52 +03:00
Mikhail Glukhikh
1c8a2bb4cc No more attempts to resolve KtDestructuringDeclaration to descriptor #KT-7929 Fixed
Also #KT-8442 Fixed
2016-10-24 15:17:48 +03:00
Denis Zharkov
7d89869c02 Do not suggest "Remove parameter" quick-fix on lambdas
Only "Rename to _" should work in the case.

The problem is that removing lambda's parameter may lead behaviour changes.
This quick-fix was not being invoked run before KT-14347 had been implemented

# Conflicts:
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java
2016-10-24 10:19:25 +03:00
Denis Zharkov
5e1b219784 Implement quick-fix replacing parameter name with _
This quick-fix is registered for UNUSED_* diagnostic in places
where it can be applied (destructured declarations/lambda parameters)

 #KT-14431 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
51f4244980 Report UNUSED_DESTRUCTURED_PARAMETER_ENTRY
on destructured lambda parameters

 #KT-14347 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
9716d2ad54 Minor. Extract method in ControlFlowProcessor 2016-10-24 10:19:25 +03:00
Denis Zharkov
8a2c9ec7fe Minor. Extract method from the huge when entry 2016-10-24 10:19:25 +03:00
Denis Zharkov
4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00
Denis Zharkov
a9fcee098d Support single-underscore named variables in JVM backend
There are mainly two kind of changes:
- skipping 'componentX' calls for destructuring entries named _
- fixing local variable table for them
 - skip entries for destructuring entries named _
 - use $noName_<i> format for lambda parameters named _

 #KT-3824 Fixed
 #KT-2783 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
544d8f5b66 Minor. Extract method for retreiving variable descriptor in codegen 2016-10-24 10:19:25 +03:00
Denis Zharkov
4041c702b3 Minor. Get rid of code duplication
For initialization of destructuring entries in loops use the same logic
as for common local destructuring

The behavior may change a little: variable start label in a table
becomes less precise (now it starts a little bit earlier than it become initialized),
but it can't be very important as the same logic works for common
destructuring
2016-10-24 10:19:25 +03:00
Denis Zharkov
dbca310d8c Support single-underscore variable names partially
Currently only parameters of lambdas/function expressions
and destructuring entries are allowed

 #KT-3824 In Progress
 #KT-2783 In Progress
2016-10-24 10:19:25 +03:00
Ilya Gorbunov
82364ad3e5 Filter out typealiases invisible due to API_VERSION < their SinceKotlin version, when determining excluded imports. 2016-10-21 18:19:03 +03:00
Ilya Gorbunov
11b03ebbb3 Annotate type aliases in kotlin-runtime with SinceKotlin 2016-10-21 18:19:03 +03:00
Alexander Udalov
47498ef835 Move ImportPath from 'descriptors' to 'frontend' 2016-10-21 17:10:41 +03:00
Alexander Udalov
4c52ce37d2 Drop TargetPlatform in utilities for module creation 2016-10-21 17:10:40 +03:00
Alexander Udalov
56e2173b3c Extract platform-independent default imports to TargetPlatform.Default.defaultImports
This is needed because SourceNavigationHelper uses default platform and it
needs default imports to be able to resolve references (otherwise
NavigateToLibrarySourceTestGenerated breaks)
2016-10-21 17:10:39 +03:00
Alexander Udalov
9ec781e859 Get rid of ModuleDescriptor#defaultImports, use DefaultImportProvider 2016-10-21 17:04:59 +03:00
Alexander Udalov
43c2b21987 Move import exclusion logic from ModuleDescriptorImpl to frontend 2016-10-21 17:04:58 +03:00
Alexey Tsvetkov
2bf0eb9e69 Fix pom.xml 2016-10-21 16:22:38 +03:00
Alexey Tsvetkov
0af7017836 Introduce common interface for common gradle options
This might be useful for future kotlin build scripts
2016-10-21 16:22:38 +03:00
Alexey Tsvetkov
b7d97a3aa2 Do not remove annotations.txt (kapt1) file before kotlin compiler is called
#KT-14250 fixed

 Before this change the following could happen:
 0. Successful build.
 1. Only java files are changed.
 2. CompileKotlin task starts because java files are also input files for kotlin.
 3. annotations.txt file is deleted, but kotlin compiler is not called, so it is not regenerated.
 4. Javac fails.
2016-10-21 16:22:38 +03:00
Nikolay Krasko
770ea75138 Regenerate formatter tests 2016-10-21 15:58:29 +03:00
Mikhail Glukhikh
bfaa9cf56f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed 2016-10-21 10:31:50 +03:00
Dmitry Petrov
4fc135709e Inner classes lowering: remap old constructor parameters. 2016-10-21 10:05:41 +03:00
Dmitry Petrov
2986e7b508 Check for repeated annotations in type alias expansion. 2016-10-21 09:56:10 +03:00
Dmitry Petrov
5531762ab1 Check for repeated annotations in type alias declaration. 2016-10-21 09:56:10 +03:00
Ilya Gorbunov
c2554bd30e Use stable kotlin (1.0.x) for kotlin-stdlib-gen to compile with and compile against.
Makes it easy for kontributors to run the generator.
2016-10-21 04:35:00 +03:00
Nikolay Krasko
355dca2a97 Add toString for KotlinStubBaseImpl
Try to simplify "Stub and PSI element type mismatch" exception analyze.

(cherry picked from commit 11aa71e)
2016-10-21 00:18:27 +03:00
Mikhail Glukhikh
1e04945609 CFG refactoring: get rid of mergeWithLocalDeclarations (always true) + minor style fixes 2016-10-20 19:52:52 +03:00
Mikhail Glukhikh
cce3a77e5e Minor cleanup 2016-10-20 19:52:48 +03:00
Mikhail Glukhikh
a19d178867 Initialization analysis : more accurate handling of non-local variables while merging data #KT-14304 Fixed 2016-10-20 19:52:44 +03:00
Mikhail Glukhikh
bba34e0caa Minor style fix 2016-10-20 19:52:40 +03:00
Nikolay Krasko
e41886c1e7 J2K: actual convert for AbstractStubBuilderTest
(cherry picked from commit 33fa19b)
2016-10-20 19:22:07 +03:00
Nikolay Krasko
17e4cfd400 J2K: rename AbstractStubBuilderTest
(cherry picked from commit 31a356a)
2016-10-20 19:22:05 +03:00
Nikolay Krasko
2b231f7e31 Auto-indent line with chain-call continuation
(cherry picked from commit fdb4120)
2016-10-20 19:22:02 +03:00
Dmitry Neverov
3cc3ad2b9e Fix spaces in labeled expression (KT-14131)
https://github.com/JetBrains/kotlin/pull/978

(cherry picked from commit fdd5ba7)
2016-10-20 19:22:00 +03:00
Zalim Bashorov
bdecb661e3 KJS: fix wrongAbiVersion test after abi version was increased. Make it less fragile with the hack for JS tests. 2016-10-20 13:47:50 +03:00
Alexey Andreev
f22a507e39 JS: add test to prove that #KT-5051 is no more reproducible 2016-10-20 12:16:30 +03:00
Alexey Andreev
6d230aad35 Suppress tests marked by TARGET_BACKEND directive when running Android codegen tests 2016-10-20 12:15:40 +03:00
Dmitry Petrov
c41ec1ddfb KT-14400: Properly handle TypeAliasConstructorDescriptor in KotlinTypeMapper.mapToCallableMethod(...)
Implement getDefaultType() in TypeAliasDescriptor subclasses.
2016-10-20 09:56:03 +03:00
Dmitry Petrov
7dce1f438f Inner classes lowering. 2016-10-19 19:13:40 +03:00
Dmitry Jemerov
f933cf5395 Specify test framework to use explicitly in generate test tests 2016-10-19 17:04:42 +02:00
Denis Zharkov
4793f71da2 Properly generate indices for destructured parameters in inline case
#KT-14399 Fixed
2016-10-19 16:05:50 +03:00
Dmitry Jemerov
32290ec1d3 add missing prepareForWrite() calls 2016-10-19 13:24:42 +02:00
Nikolay Krasko
33f01ca5f3 Ignore not-prepared classes and add diagnostics for not-prepared classes for getting fields (EA-85900)
(cherry picked from commit 2ce6069)
2016-10-19 14:05:15 +03:00
Nikolay Krasko
67cc6bb004 Insert '()' under write action in finishing anonymous object template (EA-82700)
(cherry picked from commit 3234d76)
2016-10-19 14:05:06 +03:00
Zalim Bashorov
3513cef779 KJS: increase JS binary version since name mangling slightly changed 2016-10-19 12:57:46 +03:00
Alexander Udalov
7b2a80ffa4 Fix incremental recompilation of JvmMultifileClass with top level function
See 53b584f and previous changes where this behavior was broken (this was
untested, however). Fixes EA-90065
2016-10-19 12:50:10 +03:00
Ilya Gorbunov
0ac461927c Minor: Fix TODOs in stdlib tests 2016-10-18 17:13:17 +03:00
Ilya Gorbunov
68411aaa69 Add instruction how to run binary compatibility validator, share run configuration with its tests 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
23c6f6b5ee Report more details about update checker exceptions. 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
5db67ba2df diagnostics for EA-79913 - AIOOBE: ByDescriptorIndexer.getDeclarationForDescriptor$idea_analysis 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
221b55550c handle elements with null containing file (EA-84533 - IAE: KtPsiFactoryKt.getModuleInfo) 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
ada6e2a906 catch I/O exceptions from prepareToInstall() (EA-86183 - SE: AppInputStream.read) 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
0a8f01c6b2 EA-89031 - IAE: SmartTypeRenderer.render 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
1144a5e136 EA-87284 - KNPE: KotlinTestRunLineMarkerContributor.getInfo 2016-10-18 16:48:09 +03:00
Alexey Sedunov
8c3fcf69f2 Convert Receiver to Parameter Intention: Update function descriptor after template is finished (otherwise some references may be processed incorrectly) 2016-10-18 16:48:09 +03:00
Alexey Sedunov
51566942f6 Add Library Quick-fix: Fix exception due to resolution being run in the "dumb mode"
#KT-14199 Fixed
2016-10-18 16:48:09 +03:00
Alexey Sedunov
cf69f1a946 Rename: Do not suggest type-based names for functions with primitive return types
#KT-14234 Fixed
2016-10-18 16:48:09 +03:00
Alexey Sedunov
394859afc5 Light Classes: Avoid empty scope on KtLightParameter
#KT-13882 Fixed
2016-10-18 16:48:09 +03:00
Dmitry Petrov
d397ef1ff8 Minor: Update generated tests for IR back-end. 2016-10-18 16:10:59 +03:00
Nikolay Krasko
74f0bb3d4e Remove mentioning KT-11395 from the wrong test
(cherry picked from commit c4fb0e9)

 #KT-11395 Open
2016-10-18 15:41:18 +03:00
Nikolay Krasko
b76ae9b35d Stop wrapping ProcessCanceledException into KotlinFrontEndException (EA-86153)
(cherry picked from commit 0ec664b)
2016-10-18 15:41:16 +03:00
Nikolay Krasko
a30d0d0f1e Commit all documents after J2K (KT-13584, EA-82451)
New Kotlin file will be generated after converting, they are created for virtual files that were renamed from Java.
The exception happens when Java file was previously opened in editor, in that case text is restored through getLastCommittedText(document) where
document is resored for virtual file.

See: SingleRootFileViewProvider.VirtualFileContent.getText()

Exception descriptions also mention "Create Test" action as a problem source. The issue was reproduced when J2K convertion was performed
on test creation.

(cherry picked from commit e44260a)

 #KT-13584 Fixed
2016-10-18 15:41:15 +03:00
Michael Bogdanov
c5e8139236 Test data fix 2016-10-18 15:26:24 +03:00
Denis Zharkov
aa281a659a Update ChangeLog.md 2016-10-18 14:40:21 +03:00
Dmitry Neverov
c3c5805a5f Fix indent in constructor delegate call (KT-7718)
(cherry picked from commit 5699b14)

 #KT-7718 Fixed
2016-10-18 14:01:51 +03:00
Zalim Bashorov
5f2ba70745 KJS: use cached KClass instead create new each time when getting it from JsClass 2016-10-18 13:26:05 +03:00
Zalim Bashorov
a085df914f KJS: allow to use KClass::isInstance; implement isInstance in KClassImpl 2016-10-18 13:26:05 +03:00
Denis Zharkov
6caf3c1c0f Update ChangeLog.md
- Fix formatting
- Refine some description notes
2016-10-18 13:18:43 +03:00
Valentin Kipyatkov
7ab2d0c951 KT-13810 Kotlin code completion missing last character
#KT-13810 Fixed
2016-10-18 11:56:59 +03:00
Michael Bogdanov
d48ef2efc7 Fix for KT-14012: Back-end (JVM) Internal error every first compilation after the source code change
#KT-14012 Fixed
2016-10-18 10:46:51 +03:00
Denis Zharkov
783e5e9083 Remove irrelevant notes from ChangeLog.md
KT-12707: is already in 1.0.5
KT-13836: as type aliases were unsupported there's no sense to mention
the issue
2016-10-18 09:56:47 +03:00
Dmitry Petrov
b5d81d8e31 Preparations to push to master branch.
Introduce tests-ir-jvm module (for IR-based JVM BE tests).
2016-10-18 09:15:19 +03:00
Michael Bogdanov
555f3e903e Rebase fixes 2016-10-18 09:10:20 +03:00
Michael Bogdanov
406fbfdba8 Synthetic accessors support 2016-10-18 09:10:20 +03:00
Michael Bogdanov
20c4f47253 Properly lower ImplicitClassReceiver 2016-10-18 09:10:19 +03:00
Dmitry Petrov
a93f929615 Minor: IrElementVisitorVoid#visitGetVariable -> visitGetValue 2016-10-18 09:10:19 +03:00
Dmitry Petrov
703110c0e2 Update after rebase on master. 2016-10-18 09:10:18 +03:00
Dmitry Petrov
6c9b8792c7 Minor: cleanup, use PropertyDescriptorImpl.initialize(...) 2016-10-18 09:10:18 +03:00
Dmitry Petrov
8d7c201339 Refactor special descriptors. 2016-10-18 09:10:17 +03:00
Dmitry Petrov
9b1e87ec84 Minor fixes. 2016-10-18 09:10:17 +03:00
Dmitry Petrov
a96aac090e Shared variables lowering: skip irrelevant variables. 2016-10-18 09:10:16 +03:00
Dmitry Petrov
fb5298237a Shared variables lowering. 2016-10-18 09:10:16 +03:00
Dmitry Petrov
fedfd3de16 Suggest names for captured receivers. 2016-10-18 09:10:15 +03:00
Michael Bogdanov
1658e110f2 Support default values for annotation properties 2016-10-18 09:10:15 +03:00
Michael Bogdanov
4b6ddc4a9d Initial annotation support 2016-10-18 09:10:15 +03:00
Michael Bogdanov
0bc3cc5e20 Object, enum processing on delegation generation 2016-10-18 09:10:14 +03:00
Michael Bogdanov
289cc8fed7 Added extension receiver procesing on interface lowering 2016-10-18 09:10:14 +03:00
Michael Bogdanov
f0d09288a8 Initial KCallableNameProperty support 2016-10-18 09:10:13 +03:00
Michael Bogdanov
b72d7557d1 KClassJavaProperty support 2016-10-18 09:10:13 +03:00
Dmitry Petrov
5ee2f87c4a Closure conversion: simple tests work. 2016-10-18 09:10:12 +03:00
Michael Bogdanov
6bd27e52bc Don't wrap return and error expressions into returns 2016-10-18 09:10:12 +03:00
Michael Bogdanov
72eb317164 Further try/catch/finally support 2016-10-18 09:10:11 +03:00
Michael Bogdanov
f1ea31450e Remove private methods from interface on lowering 2016-10-18 09:10:11 +03:00
Michael Bogdanov
59fc5befad !is support 2016-10-18 09:10:10 +03:00
Michael Bogdanov
12235faa39 Return proper type after cast 2016-10-18 09:10:10 +03:00
Michael Bogdanov
171e607250 Spread support 2016-10-18 09:10:10 +03:00
Michael Bogdanov
e965a2b3b5 Further SyntheticJavaPropertyDescriptor support 2016-10-18 09:10:09 +03:00
Michael Bogdanov
d6b5e48b2a Wrap Nothing type into return expression 2016-10-18 09:10:09 +03:00
Michael Bogdanov
5121fcb287 Initial try/catch/finally support 2016-10-18 09:10:08 +03:00
Michael Bogdanov
4bcd3d1bdb Support break/continue 2016-10-18 09:10:08 +03:00
Michael Bogdanov
e5bccf0963 Support do while cycles 2016-10-18 09:10:07 +03:00
Michael Bogdanov
70dbccb95e Sealed modality support 2016-10-18 09:10:07 +03:00
Michael Bogdanov
29d1231b97 Empty vararg support and SyntheticJavaPropertyDescriptor properties 2016-10-18 09:10:06 +03:00
Michael Bogdanov
45ebe354ee Initial support of const and @JvmField properties 2016-10-18 09:10:06 +03:00
Michael Bogdanov
e543972dad Properly calculate safe call receivers 2016-10-18 09:10:05 +03:00
Michael Bogdanov
bc6f691405 DefaultImpls fixes 2016-10-18 09:10:05 +03:00
Michael Bogdanov
c22bfaeefb Annotation class support 2016-10-18 09:10:04 +03:00
Michael Bogdanov
3fe84bba6c Initial IMPLICIT_NOT_NULL support 2016-10-18 09:10:04 +03:00
Michael Bogdanov
03ebf06cf8 Proper type for default parameters 2016-10-18 09:10:03 +03:00
Michael Bogdanov
e40c434c57 Write inner class attributes 2016-10-18 09:10:03 +03:00
Michael Bogdanov
0b45655b7b Support exhaustive when 2016-10-18 09:10:02 +03:00
Michael Bogdanov
a0d9d24c1f Introduced IrElseBranch 2016-10-18 09:10:01 +03:00
Michael Bogdanov
26b2a069fd Initial KClassJavaProperty support 2016-10-18 09:10:01 +03:00
Michael Bogdanov
607cf4c86d Support Nothing return type 2016-10-18 09:10:00 +03:00
Michael Bogdanov
24863a84c4 Return only onStack/none stackValues in results 2016-10-18 09:10:00 +03:00
Dmitry Petrov
a51efaacc9 Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable. 2016-10-18 09:09:59 +03:00
Dmitry Petrov
8efe326904 Introduce ValueDescriptor as a common super-interface
of ParameterDescriptor and VariableDescriptor.
2016-10-18 09:09:59 +03:00
Dmitry Petrov
b6c63a7823 Ignore type aliases in code generation. 2016-10-18 09:09:58 +03:00
Dmitry Petrov
2ead71ff86 Enum class is 'abstract' if it contains abstract members. 2016-10-18 09:09:58 +03:00
Michael Bogdanov
3a9f1e267b Anonymous object support 2016-10-18 09:09:57 +03:00
Michael Bogdanov
567b174e15 Funther default impl support 2016-10-18 09:09:57 +03:00
Dmitry Petrov
608d6a37d2 Some enum-related fixes
(NB: testEnumClass3 doesn't work yet, effective modality required for enum class)
2016-10-18 09:09:57 +03:00
Dmitry Petrov
de2bef910b Assertion error on singleton values in ExpressionCodegen. 2016-10-18 09:09:56 +03:00
Dmitry Petrov
f423369327 Objects (singletons) lowering. 2016-10-18 09:09:56 +03:00
Michael Bogdanov
866def0d20 Intrinsic fixes 2016-10-18 09:09:55 +03:00
Dmitry Petrov
fc754e533d Enum classes lowering. 2016-10-18 09:09:55 +03:00
Michael Bogdanov
af76840826 Support some new intrinsics 2016-10-18 09:09:54 +03:00
Michael Bogdanov
1cda60fcd1 Cast return expression to function return type 2016-10-18 09:09:54 +03:00
Michael Bogdanov
f30027b4de Generate ir-accessors for interface properties 2016-10-18 09:09:53 +03:00
Michael Bogdanov
011ed60eee Support default impls 2016-10-18 09:09:53 +03:00
Dmitry Petrov
7950235df3 Lowering for constructors & initializers. 2016-10-18 09:09:52 +03:00
Michael Bogdanov
6d575c1437 'Throw' support 2016-10-18 09:09:52 +03:00
Michael Bogdanov
a721876b67 Implicit cast support 2016-10-18 09:09:51 +03:00
Mikhail Glukhikh
9609c8af90 IR CFG: IrStatement is now used for CFG representation instead of IrElement 2016-10-18 09:09:51 +03:00
Mikhail Glukhikh
07eae1d206 IR to CFG: type operator unrolling 2016-10-18 09:09:50 +03:00
Mikhail Glukhikh
ea13386d0b IR to CFG: member access unrolling 2016-10-18 09:09:50 +03:00
Mikhail Glukhikh
5a04c72e75 Break / continue implementation, test with break / continue, related changes in loop & loop tests 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh
e03e13af43 Do..while loop implementation and first test 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh
bcf2b410ba While loop implementation && first loop test 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh
979f2231a1 IR to CFG: when implementation in function generator, some when tests 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh
eaf10a4675 IR to CFG test generator, sequential function tests 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
65db7aa1ba CFG renderer 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
bab0abeee6 IR to CFG: function generator (initial version) 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
ae96afb1dc CFG: function builder 2016-10-18 09:09:46 +03:00
Mikhail Glukhikh
59cdcdba28 CFG: interfaces implementation and builders 2016-10-18 09:09:46 +03:00
Mikhail Glukhikh
db810e55d3 Basic CFG interfaces 2016-10-18 09:09:45 +03:00
Mikhail Glukhikh
779d4f7f3e Module compiler/ir/ir2cfg added 2016-10-18 09:09:45 +03:00
Dmitry Petrov
45c999788a Deep copy for IR elements.
NB: we can transform descriptors during copying.
2016-10-18 09:09:44 +03:00
Michael Bogdanov
31d971a302 Get rid of impl classes 2016-10-18 09:09:44 +03:00
Michael Bogdanov
bdecffa1e1 Support singleton access 2016-10-18 09:09:43 +03:00
Michael Bogdanov
58ba5ed37b Default args support 2016-10-18 09:09:43 +03:00
Michael Bogdanov
bf822daa3b INSTANCEOF support 2016-10-18 09:09:42 +03:00
Michael Bogdanov
869f60a053 When and safe cast support 2016-10-18 09:09:42 +03:00
Michael Bogdanov
c34d140a53 Intrinsics update 2016-10-18 09:09:41 +03:00
Dmitry Petrov
e8c7c821a7 FileClassDescriptor should provide all information required for TypeMapper. 2016-10-18 09:09:41 +03:00
Dmitry Petrov
ce8bdef746 Minor: rename. 2016-10-18 09:09:40 +03:00
Dmitry Petrov
d66d582f25 Update to origin/master.
IrReturn should return 'Unit' for "return without value".
2016-10-18 09:09:40 +03:00
Michael Bogdanov
97dbec06e5 Codegen impl classes moved to 'codegen' package 2016-10-18 09:09:39 +03:00
Michael Bogdanov
29bd7c3804 Experimental 'CompareTo' intrinsic 2016-10-18 09:09:39 +03:00
Michael Bogdanov
0c92174e42 FunctionCodegen -> JvmFunctionCodegen 2016-10-18 09:09:39 +03:00
Dmitry Petrov
8551bcf103 Refactor IrWhen. 2016-10-18 09:09:38 +03:00
Michael Bogdanov
aca71dea22 Constuctors support, refactoring 2016-10-18 09:09:38 +03:00
Michael Bogdanov
204a8c5c14 Initial intrinsic implementation 2016-10-18 09:09:37 +03:00
Michael Bogdanov
95c88e4445 infrastructure 2016-10-18 09:09:37 +03:00
Michael Bogdanov
ca97f17cb6 Hack: intrinsic package support in typeMapper 2016-10-18 09:09:36 +03:00
Michael Bogdanov
b07fc09dac Added experimental coercion 2016-10-18 09:09:36 +03:00
Michael Bogdanov
7ad69bbea1 Add IR black box tests 2016-10-18 09:09:35 +03:00
Michael Bogdanov
978a4db07b Introduced IR CodegenFactory, added configuration key to enable it 2016-10-18 09:09:35 +03:00
Michael Bogdanov
0c60b21cca Package part support 2016-10-18 09:09:34 +03:00
Michael Bogdanov
1d8b9c5a58 Initial implementation of ExpressionCodegen 2016-10-18 09:09:34 +03:00
Michael Bogdanov
99e7df7035 Remove duplicated line from build.xml 2016-10-18 09:09:33 +03:00
Michael Bogdanov
fa5095977f JvmClassGenerator->JvmClassCodegen 2016-10-18 09:09:33 +03:00
Michael Bogdanov
fe51c35298 Fix for 'getNthResult' in IfThenElse expression impl 2016-10-18 09:09:32 +03:00
Dmitry Petrov
f4aee6cab5 Update testData. 2016-10-18 09:09:32 +03:00
Dmitry Petrov
7e7bc127d1 Coerce finally expression to Unit 2016-10-18 09:09:31 +03:00
Dmitry Petrov
663eb21990 Coerce loop body to Unit. 2016-10-18 09:09:31 +03:00
Dmitry Petrov
291d535de7 Fix IR generation for string templates containing single entry. 2016-10-18 09:09:30 +03:00
Dmitry Petrov
1c2a676cd6 Make coercion to Unit explicit in IR. 2016-10-18 09:09:30 +03:00
Dmitry Petrov
233a979932 Source element for file classes. 2016-10-18 09:09:29 +03:00
Dmitry Petrov
16334771ad Minor: comment for IrMemberAccessExpression::getTypeArgument 2016-10-18 09:09:29 +03:00
Dmitry Petrov
7ae6c55ddb IrMemberAccessExpression::getTypeArgument 2016-10-18 09:09:28 +03:00
Dmitry Petrov
89de2a2ebe Drop IrGeneralCall, pull up corresponding members to IrMemberAccessExpression. 2016-10-18 09:09:28 +03:00
Dmitry Petrov
d67d8016d3 Lowering for property declarations. 2016-10-18 09:09:27 +03:00
Dmitry Petrov
b19bcc0587 IrElementTransformerVoid 2016-10-18 09:09:27 +03:00
Dmitry Petrov
e0129ef33b IrDeclaration.transform(transformer, data) returns IrStatement.
Declaration containers assume that transformers maintain declaration structure.
2016-10-18 09:09:26 +03:00
Dmitry Petrov
65dcdaecfb Minor: irFile. 2016-10-18 09:09:26 +03:00
Dmitry Petrov
2b5cb0f722 Make statement containers mutable. 2016-10-18 09:09:26 +03:00
Dmitry Petrov
4c88ad408f Make declaration containers mutable. 2016-10-18 09:09:25 +03:00
Dmitry Petrov
4b9c5effd3 Minor: irElement rendering 2016-10-18 09:09:25 +03:00
Dmitry Petrov
90119880c5 IrCatch element. 2016-10-18 09:09:24 +03:00
Michael Bogdanov
c02ae4a4a5 Initial implemetation of JvmClassGenerator 2016-10-18 09:09:23 +03:00
Michael Bogdanov
4e258df26b Extract super class info calculation to utility class, make 'signature' static 2016-10-18 09:09:23 +03:00
Michael Bogdanov
709bc08fbd Add IR->JVM output to bytecode tool window 2016-10-18 09:09:22 +03:00
Michael Bogdanov
0838b28e10 Add IR modules to build.xml 2016-10-18 09:09:22 +03:00
Dmitry Petrov
001b95473a Drop 'parent' and 'slot'. 2016-10-18 09:09:21 +03:00
Dmitry Petrov
a8a6477ce5 IrOperator -> IrStatementOrigin 2016-10-18 09:09:21 +03:00
Dmitry Petrov
5386d27284 File class lowering 2016-10-18 09:09:20 +03:00
Dmitry Petrov
a25e781ee9 Minor: IrFieldAccessExpression, visitor methods. 2016-10-18 09:09:19 +03:00
Dmitry Petrov
c699e2d24c Include declaration origin in testData. 2016-10-18 09:09:19 +03:00
Dmitry Petrov
c2a7890ac4 JvmBackendFacade (initial import) 2016-10-18 09:09:18 +03:00
Dmitry Petrov
c4391ebce5 Minor: add test for suppressed error. 2016-10-18 09:09:18 +03:00
Dmitry Petrov
3fa33b5969 Fix compound assignment on arbitrary expression in LHS
(with a convention compound assignment operator defined).
2016-10-18 09:09:17 +03:00
Dmitry Petrov
0cdf831bf0 IrDeclarationContainer as a super-interface for IrFile and IrClass.
Builder for IrDeclarationContainer (initial implementation; TODO more flexible builders).
2016-10-18 09:09:16 +03:00
Dmitry Petrov
1a3dedaf1c Minor: add test for primary constructor default parameter values. 2016-10-18 09:09:16 +03:00
Dmitry Petrov
201d2414bc Properties declared in primary constructors should have proper accessors in IR. 2016-10-18 09:09:15 +03:00
Dmitry Petrov
5c720845a8 Drop IrPropertyAccessor (and subclasses).
Drop IrLocalPropertyAccessor (and subclasses).
Introduce IrField.
2016-10-18 09:09:15 +03:00
Dmitry Petrov
121e949a33 Minor: LocalVariableAccessorDescriptor modality should be FINAL
(otherwise it breaks MemberDescriptor contract).
2016-10-18 09:09:14 +03:00
Dmitry Petrov
aee2a58385 Drop assertDetached, unneeded ceremony. 2016-10-18 09:09:14 +03:00
Dmitry Petrov
00093ac901 Move IR tests to module 'compiler-tests'
(due to dependencies on classes from 'compiler-tests').

Minor: remove unused imports.
2016-10-18 09:09:13 +03:00
Dmitry Petrov
00a74699e2 SourceLocationManager -> SourceManager 2016-10-18 09:09:13 +03:00
Dmitry Petrov
1e00561b6f IrModule -> IrModuleFragment 2016-10-18 09:09:13 +03:00
Dmitry Petrov
e8bacad62b backend: introduce 'CodegenFactory' interface with default implementation
creating PackageCodegen and MultifileClassCodegen from an existing JVM back-end.
2016-10-18 09:09:12 +03:00
Dmitry Petrov
838b639692 IrComposite - block introducing immediate declarations to the surrounding scope.
E.g., destructuring declaration is represented as IrComposite.
2016-10-18 09:09:12 +03:00
Dmitry Petrov
aaa5fa4209 Minor: cleanup in 'backend.jvm' 2016-10-18 09:09:11 +03:00
Dmitry Petrov
da4079bfe7 Move implementation classes to 'impl' packages. 2016-10-18 09:09:11 +03:00
Dmitry Petrov
d6a3246586 Use throwNoSuchSlot consistently. 2016-10-18 09:09:10 +03:00
Dmitry Petrov
40a60e430f - Compact representation for empty blocks.
- Fix some issues in IrBlockImpl.
2016-10-18 09:09:10 +03:00
Dmitry Petrov
09c52696a5 Unique numbers for "special" slots. 2016-10-18 09:09:09 +03:00
Dmitry Petrov
4e270ef487 Store file-level annotations in IrFile (should be on some descriptor, really). 2016-10-18 09:09:09 +03:00
Dmitry Petrov
e23325b014 Bound callable references. 2016-10-18 09:09:08 +03:00
Dmitry Petrov
0da4c08520 Handle unresolved break/continue expressions as error expressions. 2016-10-18 09:09:08 +03:00
Dmitry Petrov
c0ac607a1d Additional tests for integer literal type promotion. 2016-10-18 09:09:07 +03:00
Dmitry Petrov
0c0dac4822 Some additional secondary constructor examples. 2016-10-18 09:09:07 +03:00
Dmitry Petrov
3e96f7b015 Do not generate those 2300+ tests for now. 2016-10-18 09:09:06 +03:00
Dmitry Petrov
8fc16345e6 Property initializers from primary constructor parameters
are generated as property initializer expressions
and should not be repeated in primary constructor.
2016-10-18 09:09:06 +03:00
Dmitry Petrov
a9dbaca473 AbstractPsi2IrDiagnosticsTest 2016-10-18 09:09:05 +03:00
Dmitry Petrov
88e0fed5d3 Minor: AbstractPsi2IrBoxTestCase.kt 2016-10-18 09:09:05 +03:00
Dmitry Petrov
4eda19b36a Do not generate constructors for annotation classes. 2016-10-18 09:09:04 +03:00
Dmitry Petrov
4e112b3f88 testData format update: detailed descriptor rendering. 2016-10-18 09:09:04 +03:00
Dmitry Petrov
993c3fe51e - Render IrModule.
- Dump IR for box tests to .txt.
2016-10-18 09:09:03 +03:00
Dmitry Petrov
15ed21ebae Stable order for delegated members. 2016-10-18 09:09:03 +03:00
Dmitry Petrov
ec2cfd2389 AbstractClosureAnnotator for IR. 2016-10-18 09:09:02 +03:00
Dmitry Petrov
ceeccfa1b7 Properties without accessors are generated as
IrGetBackingField / IrSetBackingField expressions.
2016-10-18 09:09:01 +03:00
Dmitry Petrov
a1ad828ea8 IrElementVisitorVoid 2016-10-18 09:09:01 +03:00
Dmitry Petrov
e29b8e356c Do not hold PsiFile in PsiFileEntry. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
513ef0c1c8 Add test for SAM adapter. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
a4b9f6b215 Handle empty lambdas properly. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
539d7ccf6f Support configuration directives FULL_JDK, WITH_RUNTIME, WITH_REFLECT in Psi2Ir tests. 2016-10-18 09:08:59 +03:00
Dmitry Petrov
d623c70778 Handle break/continue in loop header (condition for 'while', range for 'for'). 2016-10-18 09:08:59 +03:00
Dmitry Petrov
b3866d53cd Handle arbitrary variable as assignment LHS
(e.g., conventional compound assignment for a parameter value).
2016-10-18 09:08:58 +03:00
Dmitry Petrov
1e3cdf300a Generate default super constructor calls for secondary constructors. 2016-10-18 09:08:58 +03:00
Dmitry Petrov
4cc5fb7454 Always generate temporary variables for receivers in a property compound assignment
(emulate 'resolve' behavior).
2016-10-18 09:08:57 +03:00
Dmitry Petrov
28b3ea27f3 Generate explicit call to 'Any()' if no superclass found.
Generate call super-constructor calls as IrDelegatedConstructorCall.
2016-10-18 09:08:57 +03:00
Dmitry Petrov
535ddd639f 'ignoreErrors' as a PSI2IR configuration parameter. 2016-10-18 09:08:56 +03:00
Dmitry Petrov
ea83407dce Multiple minor fixes. 2016-10-18 09:08:56 +03:00
Dmitry Petrov
da93f57afb Default getter/setter bodies. 2016-10-18 09:08:55 +03:00
Dmitry Petrov
fed09f059b Byte and Short literals. 2016-10-18 09:08:55 +03:00
Dmitry Petrov
66f6ce7f26 --- testdata for unresolvedReference 2016-10-18 09:08:54 +03:00
Dmitry Petrov
5cb7566975 Psi2IR acceptance test (failing). 2016-10-18 09:08:54 +03:00
Dmitry Petrov
a3dadd9e3f Callable references now can have receivers and arguments
(for bound references implementation).
2016-10-18 09:08:53 +03:00
Dmitry Petrov
fe397eddbe Handle erroneous code (initial drop, TBD). 2016-10-18 09:08:53 +03:00
Dmitry Petrov
bf03be97a1 Minor: workaround for IDE exception (1186485). 2016-10-18 09:08:52 +03:00
Dmitry Petrov
3c0cce4c48 Reflection literals (no bound member references yet). 2016-10-18 09:08:52 +03:00
Dmitry Petrov
8b95992af1 Generate get/set for local delegated properties as accessor calls. 2016-10-18 09:08:51 +03:00
Dmitry Petrov
f2e778d2d0 Some more tests. 2016-10-18 09:08:51 +03:00
Dmitry Petrov
42988383e0 Local delegated properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov
e42116bb6a Delegated implementations for properties and extension properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov
d27f22ae0e Delegated implementations for functions and extension functions. 2016-10-18 09:08:49 +03:00
Dmitry Petrov
2438876173 Implementing interface by delegation: creating delegates in class. 2016-10-18 09:08:49 +03:00
Dmitry Petrov
264c8afc78 Type aliases. 2016-10-18 09:08:48 +03:00
Dmitry Petrov
1b5dd50359 Represent class instance initialization "as from resolve". 2016-10-18 09:08:48 +03:00
Dmitry Petrov
c3c758c7cc Do not generate underlying classes for enum entries without member declarations. 2016-10-18 09:08:47 +03:00
Dmitry Petrov
759f0168c2 Delegated properties. 2016-10-18 09:08:47 +03:00
Dmitry Petrov
865d2c43c7 Default arguments stored in function declarations. 2016-10-18 09:08:46 +03:00
Dmitry Petrov
2d2100b1b5 IrSyntheticBody (for 'values', 'valueOf'). 2016-10-18 09:08:46 +03:00
Dmitry Petrov
c47e82f965 Cleaner IrBuiltIns. 2016-10-18 09:08:45 +03:00
Dmitry Petrov
93618ebb12 IrClassReference 2016-10-18 09:08:45 +03:00
Dmitry Petrov
9eeb492fe3 Underlying classes for enum entries. 2016-10-18 09:08:44 +03:00
Dmitry Petrov
bd76e39a8c Enum entries generation (no underlying classes yet) 2016-10-18 09:08:44 +03:00
Dmitry Petrov
917e7bffbd Property accessors are now children of IrProperty. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
ed68b3ecd0 Use builder API in OperatorExpressionGenerator. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
600fdf7eee Use builder API in increment/decrement desugaring. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
1022725fd1 Data class members generation.
Builder-style API for desugaring expressions.
2016-10-18 09:08:42 +03:00
Dmitry Petrov
dc169e98d5 Local classes. 2016-10-18 09:08:42 +03:00
Dmitry Petrov
41d772d636 Object literal expressions. 2016-10-18 09:08:41 +03:00
Dmitry Petrov
86a52e6426 Character literals and string templates. 2016-10-18 09:08:41 +03:00
Dmitry Petrov
f83237498f Minor: DeclarationsGenerator can take care of secondary constructor delegating to 'super'. 2016-10-18 09:08:40 +03:00
Dmitry Petrov
a140d75016 Minor: IrSyntheticPropertyAccessorDescriptor.Kind. 2016-10-18 09:08:40 +03:00
Dmitry Petrov
7adf173a66 Add tests for companion objects and various kinds of classes
(no representation for enum entries yet).
2016-10-18 09:08:39 +03:00
Dmitry Petrov
a6bee7a22b Generate delegating constructor calls as IrDelegatingConstructorCall expressions
(they have different platform-level representation in JVM and JS).
2016-10-18 09:08:39 +03:00
Dmitry Petrov
6fbac2ed40 Minor: ir.backend.jvm -> backend.jvm 2016-10-18 09:08:38 +03:00
Dmitry Petrov
fe46a02885 Support all primitive literal types.
Apply simple unary operators to constants.
2016-10-18 09:08:38 +03:00
Dmitry Petrov
b3f605c4c4 Generate synthetic getter & setter descriptors for static properties in Java classes
(recognized as properties defined in classes without dispatchReceiver and extensionReceiver).
Fix 'when' generation for else-only case.
2016-10-18 09:08:37 +03:00
Dmitry Petrov
05b9eda809 Generate "raw" IR in Psi2IrTranslator. 2016-10-18 09:08:37 +03:00
Dmitry Petrov
ba85e714e3 Generate nested initializers for class. 2016-10-18 09:08:36 +03:00
Dmitry Petrov
415265276a Minor: CallGenerator is StatementGeneratorExtension. 2016-10-18 09:08:36 +03:00
Dmitry Petrov
8d86c0a2dd Representation for nested initializers in a class & nested initializers call. 2016-10-18 09:08:35 +03:00
Dmitry Petrov
8528c23194 Constructors represented "as in Java".
TODO: extract nested initializers somehow.
2016-10-18 09:08:35 +03:00
Dmitry Petrov
57c1b3e0e2 '!!' operator 2016-10-18 09:08:34 +03:00
Dmitry Petrov
92a7ecfac7 Render return target for IrReturn in tests.
Add tests for non-local returns from lambdas.
2016-10-18 09:08:34 +03:00
Dmitry Petrov
e459105128 Primary constructor generation. 2016-10-18 09:08:34 +03:00
Dmitry Petrov
225d792939 Secondary constructors in classes. 2016-10-18 09:08:33 +03:00
Dmitry Petrov
ac80195597 Anonymous function expressions ('fun(...) { ... }') and local functions (no closures yet). 2016-10-18 09:08:33 +03:00
Dmitry Petrov
83c3bdd788 Lambda expressions (no closures yet). 2016-10-18 09:08:32 +03:00
Dmitry Petrov
0b647ac358 Basic class members generation.
Split testData into 'classes' and 'expressions'.
2016-10-18 09:08:32 +03:00
Dmitry Petrov
703d3405ed Generate class members (functions, properties, nested classes). 2016-10-18 09:08:31 +03:00
Dmitry Petrov
19e95d232a Classes & type aliases, initial import. 2016-10-18 09:08:31 +03:00
Dmitry Petrov
b17e3b0299 Varargs. 2016-10-18 09:08:30 +03:00
Dmitry Petrov
d45811a5da Empty loops. 2016-10-18 09:08:30 +03:00
Dmitry Petrov
179a06672b IrExpression.type is no longer nullable.
Change expression typing contract.
2016-10-18 09:08:29 +03:00
Dmitry Petrov
be86739d3a IrBlockBody
Change block typing contract.
2016-10-18 09:08:29 +03:00
Dmitry Petrov
8bef05703e Inline rematerializable safe call receivers. 2016-10-18 09:08:28 +03:00
Dmitry Petrov
1ff12b4cb6 Loops and break/continue can have labels (as strings) (for KJS & other transpilers). 2016-10-18 09:08:28 +03:00
Dmitry Petrov
dc4bb3015c Inline safe call chains. 2016-10-18 09:08:27 +03:00
Dmitry Petrov
3f256fab67 Variable as function calls. 2016-10-18 09:08:27 +03:00
Dmitry Petrov
b3407de1e6 Array access expression. 2016-10-18 09:08:26 +03:00
Dmitry Petrov
54e6bbd007 Don't introduce additional variables for simple array assignment. 2016-10-18 09:08:26 +03:00
Dmitry Petrov
abb106c885 Fix operator markup for '!==' and '!in'. 2016-10-18 09:08:25 +03:00
Dmitry Petrov
6830a7db43 PregeneratedCall -> CallBuilder 2016-10-18 09:08:25 +03:00
Dmitry Petrov
17758d8c00 'try' 2016-10-18 09:08:24 +03:00
Dmitry Petrov
ebd8f1266d IrOperatorExpression -> IrPrimitiveCall
All "primitives" have their descriptors now.
2016-10-18 09:08:24 +03:00
Dmitry Petrov
c79b9c12d6 'throw' 2016-10-18 09:08:24 +03:00
Dmitry Petrov
4709aaafaa 'for' 2016-10-18 09:08:23 +03:00
Dmitry Petrov
03a666690b 'break' & 'continue' 2016-10-18 09:08:23 +03:00
Dmitry Petrov
87c7b4834b 'while' & 'do-while' loops 2016-10-18 09:08:22 +03:00
Dmitry Petrov
8bba49cba6 Block expressions & types. 2016-10-18 09:08:22 +03:00
Dmitry Petrov
594a553a04 Safe calls. 2016-10-18 09:08:21 +03:00
Dmitry Petrov
985f3b20c7 Unary operators. 2016-10-18 09:08:21 +03:00
Dmitry Petrov
97593fa19e Make 'when' great again. 2016-10-18 09:08:20 +03:00
Dmitry Petrov
f787f8ecbf Refactor desugaring (& operator conventions generation), step 1. 2016-10-18 09:08:20 +03:00
Dmitry Petrov
c0d521266b Use ternary 'if' for 'when' (and also '||' as ',' in 'when'). 2016-10-18 09:08:20 +03:00
Dmitry Petrov
c36a0d04ce Shrinking IR: introduce IrBuiltIns (as a container for special operator descriptors) 2016-10-18 09:08:19 +03:00
Dmitry Petrov
70dfb75f82 Shrinking IR: GetProperty / SetProperty expressions are now generated as calls. 2016-10-18 09:08:19 +03:00
Dmitry Petrov
8500f5ddb2 Preliminary work on loops. 2016-10-18 09:08:18 +03:00
Dmitry Petrov
de5181d642 More tests for 'when' 2016-10-18 09:08:18 +03:00
Dmitry Petrov
b96626fd4c When expression.
Fix object & enum references.
2016-10-18 09:08:17 +03:00
Dmitry Petrov
d6040d8570 Type operators. 2016-10-18 09:08:17 +03:00
Dmitry Petrov
5709826096 Refactoring.
'if' expressions (represented as 'when' without subject).
2016-10-18 09:08:16 +03:00
Dmitry Petrov
1ddf889d8a Comparisons:
- for primitive types and kotlin.String, use IrBinaryOperatorExpression
- for others, use call to 'compareTo'
2016-10-18 09:08:16 +03:00
Dmitry Petrov
ace98b91cc Handle infix function calls in binary expressions. 2016-10-18 09:08:16 +03:00
Dmitry Petrov
3614b0a06c Generate IMPLICIT_NOTNULL for (nullability flexible type) -> (non-null type) implicit conversion. 2016-10-18 09:08:15 +03:00
Dmitry Petrov
2b6171057e Fix type of increment/decrement for array element.
Minor cleanup.
2016-10-18 09:08:15 +03:00
Dmitry Petrov
64d630faa3 Detailed "operator" convention information (for JS). 2016-10-18 09:08:14 +03:00
Dmitry Petrov
4a62a6b7c3 Prefix increment / decrement.
Refactor IrLValue.
2016-10-18 09:08:14 +03:00
Dmitry Petrov
68cdcfa853 Minor: assertion in IrSingleExpressionValue to ensure that corresponding expression is detached and instantiated once. 2016-10-18 09:08:13 +03:00
Dmitry Petrov
8de21aadfa '?:' (currently represented as binary expression with operator ELVIS) 2016-10-18 09:08:13 +03:00
Dmitry Petrov
0d94c3aeb4 'in' and '!in' operators. 2016-10-18 09:08:12 +03:00
Dmitry Petrov
96e3c52878 Equality and identity operators. 2016-10-18 09:08:12 +03:00
Dmitry Petrov
db5843adc8 Desugar comparison operators as IrBinaryOperatorExpression.
They are not exactly 'compareTo' calls (although annotated with a related 'compareTo' function),
and require special treatment in BEs.
2016-10-18 09:08:11 +03:00
Dmitry Petrov
1b018a6ead Desugar basic binary operators (+, -, *, /, %, ..).
Fold String.plus calls to IrStringConcatenationExpression.
2016-10-18 09:08:11 +03:00
Dmitry Petrov
287d804131 Rematerialize simple expressions (local variables, literals, $this, $receiver) when generating calls. 2016-10-18 09:08:11 +03:00
Dmitry Petrov
c1583c4368 Complex augmented assignment test.
Fix string literal creation for empty string template.
2016-10-18 09:08:10 +03:00
Dmitry Petrov
64d7a97145 IR, testing framework: if no tree labels were provided in source file, use default golden file. 2016-10-18 09:08:10 +03:00
Dmitry Petrov
aee83f5a77 Minor: IrIndexedLValue can use IrExpression's, since its subexpressions should be evaluated once. 2016-10-18 09:08:09 +03:00
Dmitry Petrov
888b1685ed Introduce name hints for temporary variables.
Split IrValue.kt into a subpackage.
2016-10-18 09:08:09 +03:00
Dmitry Petrov
177acaabf5 Refactor top-down generation. 2016-10-18 09:08:08 +03:00
Dmitry Petrov
278dc14124 IrSingleExpressionValue 2016-10-18 09:08:08 +03:00
Dmitry Petrov
d7412c449e IR: augmented assignment for array access expressions 2016-10-18 09:08:07 +03:00
Dmitry Petrov
0a57eb8ea4 IR:
- smart casts handling separated from expression generation
- improved infrastructure for desugaring
2016-10-18 09:08:07 +03:00
Dmitry Petrov
ecf6ab9e25 IR:
- Redo smart casts handling (yet again).
Front-end typing information can't be used for expressions in IR,
since it provides inferred type for PSI expressions for the last corresponding resoled call.

- Assignments handling, initial implementation.
2016-10-18 09:08:07 +03:00
Dmitry Petrov
c4bbcadb34 IR: Collapse desugared blocks as a postprocessing pass. 2016-10-18 09:08:06 +03:00
Dmitry Petrov
aa7bf4637b IR:
- function with expression bodies are desugared to blocks with return statement;
- property initializers are generated as regular expression bodies.
2016-10-18 09:08:06 +03:00
Dmitry Petrov
2707d33ca7 IR: dummy declarations for class/object and typealias 2016-10-18 09:08:05 +03:00
Dmitry Petrov
f903fb8ad3 IR: destructuring declarations in regular statements 2016-10-18 09:08:05 +03:00
Dmitry Petrov
37cce98d19 Simplify IrElement hierarchy.
IrDeclaration can be now hosted under IrExpression (as IrStatement).
2016-10-18 09:08:04 +03:00
Dmitry Petrov
55eb79febf Make IrExpression.type nullable. 2016-10-18 09:08:04 +03:00
Dmitry Petrov
030111b130 IrBody is no longer a declaration owner.
Local declarations in expression tree.
Call generator supports argument reordering.
2016-10-18 09:08:03 +03:00
Dmitry Petrov
b1af1af8a4 IR test tests: use that magical '<<<' everywhere. No need for 'IR_FILE_TXT'. 2016-10-18 09:08:03 +03:00
Dmitry Petrov
4ccf3c3590 Refactor calls and related expressions 2016-10-18 09:08:02 +03:00
Dmitry Petrov
3e11f35918 Qualified expressions and safe calls 2016-10-18 09:08:02 +03:00
Dmitry Petrov
b80782c295 Testing framework: allow comparing subtrees starting at a given line with expected dump text. 2016-10-18 09:08:02 +03:00
Dmitry Petrov
c93666f6f1 - IR expressions for calls & references
- first calls "parsed"
2016-10-18 09:08:01 +03:00
Dmitry Petrov
c09ba962c4 minor: refactor TypeAliasQualifier, it doesn't have to provide type alias descriptor 2016-10-18 09:07:43 +03:00
Dmitry Petrov
dc7a90a081 Minor: IrFileElementFactory -> IrDeclarationFactory 2016-10-18 09:06:57 +03:00
Dmitry Petrov
7b3ae8ffec Use source offset ranges instead of source locations. 2016-10-18 09:06:56 +03:00
Dmitry Petrov
5e609c7de4 Declaration IR refactoring. 2016-10-18 09:06:56 +03:00
Dmitry Petrov
4f469c798c Mutable expressions IR. 2016-10-18 09:06:55 +03:00
Dmitry Petrov
cb79f377f0 Mutable declarations IR. 2016-10-18 09:06:55 +03:00
Dmitry Petrov
64abecf996 IR elements fixes & refactorings 2016-10-18 09:06:55 +03:00
Dmitry Petrov
7879fb7084 IR: first somewhat meaningful expression IR generation 2016-10-18 09:06:54 +03:00
Dmitry Petrov
ad405f26fd IR: first smoke test 2016-10-18 09:06:54 +03:00
Dmitry Petrov
520a3133bc minor: allow specifying indentation unit in Printer 2016-10-18 09:06:53 +03:00
Dmitry Petrov
1600037625 KT-14307, KT-14377: Run declaration checks on local type aliases. 2016-10-17 16:22:04 +03:00
Nikolay Krasko
6a72cebe88 Add indent before colon of super types list on new line (KT-13981, KT-5117)
#KT-13981 Fixed
 #KT-5117 Fixed

(cherry picked from commit dfea3af)
2016-10-17 15:16:48 +03:00
Nikolay Krasko
944b9b5b6c Evaluate overloaded toString() in watches for Kotlin classes with delegate properties (KT-14068)
(cherry picked from commit 7774d2c)

 #KT-14068 Fixed
2016-10-17 15:16:46 +03:00
Denis Zharkov
440bdea736 Update ChangeLog.md 2016-10-17 14:06:56 +03:00
shiraji
a1f1716044 Add inspection/intention for redundant calls of conversion methods #KT-10871 Fixed
Also #KT-12625 Fixed
2016-10-17 12:05:18 +03:00
Dmitry Petrov
a5d6559056 KT-14360 Microoptimizations in RedundantCoercionToUnitTransformer 2016-10-17 10:13:03 +03:00
Dmitry Petrov
753a558bcb KT-14352 Record short reference to companion object via type alias,
so that it would be checked properly.
2016-10-17 10:11:58 +03:00
Dmitry Petrov
ac675784c1 KT-14357 Run RedundantCoercionToUnitTransformer before DeadCodeEliminatingMethodTransformer.
Remove empty try-catch blocks in DeadCodeEliminatingMethodTransformer.
2016-10-17 10:10:46 +03:00
Ilya Gorbunov
932e6753e5 Update changelog: standard library and JS sections. 2016-10-15 07:32:09 +03:00
Nikolay Krasko
87fb6dd3b8 Minor: rename ForkJoinPoolPatcherForTeamCityTesting -> ThreadTrackerPatcherForTeamCityTesting
(cherry picked from commit c6b128e)
2016-10-14 21:06:28 +03:00
Nikolay Krasko
8c2e61604e Test for "Debugger: "Step over" dives into recursive call" (KT-12924)
Fixed in 7992df7b93

(cherry picked from commit 78e2f05)

 #KT-12924 Fixed
2016-10-14 21:06:27 +03:00
Zalim Bashorov
c21e1eb857 Report error when try to use unsupported reflection API in Kotlin JS; allow to use kotlin.Any members on reflection classes for both platforms. 2016-10-14 19:44:58 +03:00
Zalim Bashorov
11b2c5fe59 JS: change visibility to internal for library and marker annotations 2016-10-14 19:44:57 +03:00
Zalim Bashorov
77ceb3efb9 Don't render descriptors outside of modules directly mentioned in tests, e.g. descriptors from libraries. 2016-10-14 19:44:56 +03:00
Zalim Bashorov
279b4dc03c Remove obsolete test about class literals is not supported 2016-10-14 19:44:55 +03:00
Zalim Bashorov
71235eebd0 Minor: fix warnings in Namer 2016-10-14 19:44:54 +03:00
Zalim Bashorov
3c520a3ce3 JS backend: basic support for class literals.
Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed
2016-10-14 19:44:53 +03:00
Zalim Bashorov
ace10f46b2 Minor: move reflection/light/* -> reflection/* 2016-10-14 19:40:36 +03:00
Zalim Bashorov
d31f18137d JS: make Any as upper bound of type parameter of JsClass and helpers 2016-10-14 19:40:35 +03:00
Ilya Gorbunov
e6887ea4e5 Use abstract readonly collections as base classes for implementing collection properties of regex MatchResult 2016-10-14 19:06:25 +03:00
Ilya Gorbunov
703ee6bd78 Have mutable collection interfaces specified explicitly to get rid of platform types in parameter and return types. 2016-10-14 19:06:25 +03:00
Nikolay Krasko
06b72e608e Do an ordinal step over while stepping over inlined calls in dex
(cherry picked from commit d741895)
2016-10-14 18:57:38 +03:00
Ilya Gorbunov
b6460e6280 binary-compatibility-validator, minor: refactor annotation utilities. 2016-10-14 18:53:54 +03:00
Alexey Tsvetkov
01e0bc8d5e Ensure task build directory always exist
#KT-14253 fixed
2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
d79679e647 Provide a way to force stdout output in Gradle tests 2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
229e63f5c5 Minor: rename file its name is the same as class it contains 2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
a0fa69c000 Do not check the content of JS file in Gradle test 2016-10-14 17:33:54 +03:00
Kirill Rakhman
09d6e2e0c0 Add quick-fixes for lateinit-related errors #KT-14342 Fixed 2016-10-14 16:14:00 +03:00
Alexey Tsvetkov
86cb7eea4a Test that kotlin gradle options are up to date
#KT-14317 fixed
2016-10-14 15:55:41 +03:00
Alexey Tsvetkov
0097e14ba1 Fix test dependencies for gradle integration tests 2016-10-14 15:55:24 +03:00
Denis Zharkov
48c33333ee Do not add special names to scopes even partially
See 7a41d13b41
It's may be dangerous to call `addDescriptor` and then
not to add descriptor into the variablesAndClassifiersByName map
2016-10-14 15:50:31 +03:00
Nikolay Krasko
fe901e9516 Use Dex suffix instead of dex prefix for better test sorting
(cherry picked from commit 7f3a9c1)
2016-10-14 14:52:56 +03:00
Nikolay Krasko
2511ef2c45 Refactoring: extract KotlinStepOverInlineFilter class
(cherry picked from commit 27b0e7d)
2016-10-14 14:52:51 +03:00
Nikolay Krasko
7510ff4864 Check current behaviour of stepping over inline 'hasNext' and 'next' in for
(cherry picked from commit 008e574)

 #KT-14296 Open
2016-10-14 14:52:44 +03:00
Nikolay Krasko
40d810ce60 Make step over for single thread work in Ultimate
(cherry picked from commit a220e64)
2016-10-14 14:52:39 +03:00
Nikolay Krasko
7992df7b93 Change the way 'step over' over inline calls works (KT-13751)
Previously it worked by invoking 'Run To Cursor' for the last position of inline function. As there's only one 'run to cursor' breakpoint
available in Idea framework, it couldn't work when inline function call was was used in conditions of control flow statements.

A new approach works through multiple step over operation and controlling stop position. In other words we try to "step over" inlined lines.
Same thing is actually done in "Smart Step Into" action.

(cherry picked from commit 2e8775d)

 #KT-13751 Fixed
2016-10-14 14:52:31 +03:00
Nikolay Krasko
9594316b0a Test for "Breakpoint inside lambda argument of InlineOnly function doesn't work" (KT-11395)
(cherry picked from commit d0ffe06)

 #KT-11395 Fixed
2016-10-14 14:52:22 +03:00
Nikolay Krasko
87b628a3f7 Generate 'nop' instruction on lambda call when everything on line is going to be eliminated by inliner (KT-6477)
(cherry picked from commit 462bdb2)

 #KT-6477 Fixed
2016-10-14 14:52:06 +03:00
Yoshinori Isogai
708a0e3b5d KT-14329 Do not report inspection "Remove empty class body" for anonymous objects (#972) 2016-10-14 13:00:55 +02:00
Valentin Kipyatkov
2b2042860d Fixed ParameterName annotation target 2016-10-14 12:24:43 +03:00
Michael Bogdanov
050139220d Fix for KT-14330 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ... parameter value
#KT-14330 Fixed
2016-10-14 10:56:15 +03:00
Dmitry Petrov
fbe3f1537f Make static initializer classes for inheriting multifile class parts annotated as SYNTHETIC_CLASS. 2016-10-14 10:41:20 +03:00
Zalim Bashorov
0a0a05d211 Add tasks to download node.js (platform independently) and tasks to publish packages to npm; extract some common things to common.xml 2016-10-13 23:22:36 +03:00
Zalim Bashorov
96830e306a JS: add templates for kotlin and kotlin-compiler packages 2016-10-13 23:22:36 +03:00
Valentin Kipyatkov
76fe1ec0d9 KT-14353 ClassCastException during offline inspections
#KT-14353 Fixed
2016-10-13 21:51:38 +03:00
Alexey Sedunov
3eb5076a7c Rename: Fix in-place rename on non-overriding functions 2016-10-13 19:01:00 +03:00
Alexey Sedunov
c6c65b1a20 Kotlin Facet: Initial implementation 2016-10-13 19:00:59 +03:00
Alexey Sedunov
5c2ad48375 Introduce Variable: Do not replace assignment left-hand sides
#KT-14240 Fixed
2016-10-13 19:00:58 +03:00
Alexey Sedunov
ec00b9f3ea Intentions: Implement "Convert sealed class to enum" intention
#KT-14245 Fixed
2016-10-13 19:00:57 +03:00
Alexey Sedunov
2187a77646 Intentions: Implement "Convert enum to sealed class" intention
#KT-14245 In Progress
2016-10-13 19:00:56 +03:00
Alexey Sedunov
02e8d58acd Rename: Forbid on backing field reference
#KT-14285 Fixed
2016-10-13 19:00:55 +03:00
Alexey Sedunov
c23c16f1a3 Extract Superclass/Interface: Add filename field to the dialog 2016-10-13 19:00:54 +03:00
Simon Ogorodnik
e14a043b0a Fix for KT-10885
Assignment as expression conversion: e.g int i = j = 0
2016-10-13 18:52:44 +03:00
Simon Ogorodnik
d731f97c7d Fix KT-13021, KT-13020, Test for already fixed KT-6941
Fixes on javadoc to kdoc comments convert
2016-10-13 18:52:31 +03:00
Simon Ogorodnik
155cfcb1f8 Fix for KT-6424
Remove "SuppressWarnings" and "//noinspection" on java to kotlin conversion
2016-10-13 18:51:48 +03:00
Dmitry Petrov
47b3420a65 Minor: testData fix after rebase 2016-10-13 18:03:00 +03:00
Dmitry Petrov
e7ca00d91b Support @SinceKotlin annotation for type aliases. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
8d634f6003 KT-14274: resolve type alias constructors calls in supertypes list as type alias constructors.
Support @Deprecated for type aliases, including type alias constructors.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
bee0e783f8 Minor cleanup. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
3d0288ffed Annotations on type aliases: generate synthetic method for type alias annotations. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
d2d8f72ffc Annotations on type aliases: typealias is not a "default target".
Add diagnostic test for annotations on type aliases.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
344bb03e8c Annotations on type aliases: add annotation target TYPEALIAS,
use it for @Deprecated and @Suppress.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
c6350e1afb Concatenate annotations in type alias expansion. 2016-10-13 17:44:14 +03:00
Mikhail Glukhikh
7a41d13b41 Do not add special names to scopes #KT-14319 Fixed 2016-10-13 17:17:05 +03:00
Dmitry Jemerov
7263109413 advance until-build to 171.* 2016-10-13 16:15:07 +02:00
Dmitry Jemerov
b1b171fbc5 correct way to check if intention is applicable; revert: Delete test that is transformed syntax error 2016-10-13 15:45:55 +02:00
takahirom
925c48c2f0 Fix 'in' operator intention for Strings (KT-13974) 2016-10-13 15:45:30 +02:00
takahirom
93c2e7dfc0 KT-13550 Fix Boolean.TYPE does not compile (#969)
* Fix Boolean.TYPE does not compile
2016-10-13 15:02:06 +02:00
Valentin Kipyatkov
29fe63d5a9 More correct code - ensure that equals works correctly! 2016-10-13 15:56:18 +03:00
Valentin Kipyatkov
0399772ee6 KT-9835 Completion thinks receiver is nullable when it is not
#KT-9835 Fixed
2016-10-13 15:11:19 +03:00
Valentin Kipyatkov
7b12dd498f KT-13780 No completion and assertion error in log
#KT-13780 Fixed
2016-10-13 15:10:53 +03:00
Ilya Chernikov
09a3741eb9 Add missing script runtime jar to plugin's lib folder 2016-10-13 10:36:51 +02:00
Dmitry Petrov
71362d6b0a Cleanup and unify RangeCodegenUtil functions. 2016-10-13 10:11:32 +03:00
Vsevolod
e788ef408f KT-5044 code cleanup, test added 2016-10-13 10:11:32 +03:00
Vsevolod
bd6f83b9b7 KT-5044 intrinsify all contains calls for primitive ranges from stdlib 2016-10-13 10:11:32 +03:00
Vsevolod
d7ad27ac3b KT-5044 implement missing Range#contains tests and move it to separate package 2016-10-13 10:11:32 +03:00
Ilya Gorbunov
0b3fb41eeb Do not include $DefaultImpls inner classes in public API when they do not contain any public members (i.e. used only as a container to hold synthetic methods with annotations for properties or typealiases) 2016-10-13 09:52:42 +03:00
Ilya Gorbunov
2c9b2652c1 kotlin-maven-plugin: Add apiVersion parameter linked with kotlin.compiler.apiVersion property.
Test apiVersion parameter is applied as explicitly and as implicitly inferred from languageVersion.
 #KT-14298
2016-10-13 08:37:34 +03:00
Ilya Gorbunov
ea51070446 Refactor: make languageVersion configuration parameter common for jvm and js kotlin maven compiler plugin. 2016-10-13 08:37:33 +03:00
Ilya Gorbunov
2a7717214b Annotate new API with @SinceKotlin in kotlin-runtime except reflection and type aliases. 2016-10-13 08:37:31 +03:00
Ilya Gorbunov
a57321dea8 Annotate all new API with SinceKotlin in kotlin-stdlib and kotlin-test 2016-10-13 08:37:30 +03:00
Ilya Gorbunov
a8f381cabc Annotate with SinceKotlin all in stdlib-jre7 and jre8 2016-10-13 08:37:28 +03:00
Ilya Gorbunov
70c3a0a244 Include new annotations (SinceKotlin, ParameterName) in public API reference. 2016-10-13 08:10:37 +03:00
Ilya Chernikov
0d73d9acc9 Update changelog: add scripting part to 1.1-M02 2016-10-12 22:59:33 +02:00
Alexander Udalov
321a19a247 Make JvmPlatform.defaultImports a stored property
It was incorrectly made a getter-only property in 2f616bdd
2016-10-12 23:30:03 +03:00
Ilya Chernikov
ebc8002eb2 Fix output comparison in tests under windows in libraries project as well 2016-10-12 20:29:49 +02:00
Ilya Chernikov
d8ecd2641d Fix script tests output comparison and idea jsr223 test dependency on windows 2016-10-12 20:16:15 +02:00
Simon Ogorodnik
e7635652bc Fix for KT-14205
If detected unfinished expression it passed through, added warning on action "Convert Java to Kotlin", if Java files contains syntax errors.
2016-10-12 19:01:58 +03:00
Alexander Udalov
efc0763c2f Add module dependency script.runtime -> builtins
To prevent balloons that propose to configure Kotlin in the project
2016-10-12 18:54:50 +03:00
Simon Ogorodnik
2a95a4a970 Test for KT-7332, already fixed 2016-10-12 18:16:15 +03:00
Simon Ogorodnik
4710f709ce Fix for KT-10545
//TODO unfix: see KT-14305
2016-10-12 18:10:55 +03:00
Simon Ogorodnik
2c99aac5a9 Post-review fixes, added support for octal escaping definition for char 2016-10-12 17:54:43 +03:00
Simon Ogorodnik
a64c45c9fe Fix KT-8091: J2K string with octal escaped chars 2016-10-12 17:54:43 +03:00
Alexander Udalov
383b7f89a6 Annotate ParameterName with SinceKotlin("1.1") 2016-10-12 17:07:10 +03:00
Alexander Udalov
ed1490dbc4 Add SinceKotlin("1.1") annotation to new reflection API 2016-10-12 17:07:10 +03:00
Alexander Udalov
8828e671f5 Refactor class lookup in deserialized scopes
Move the logic to DeserializedMemberScope; drop NestedClassDescriptors
2016-10-12 17:07:10 +03:00
Alexander Udalov
e1ce6f88d5 Remove extra cache of nested classes from DeserializedClassDescriptor
ClassDescriptor instances are already cached in ClassDeserializer
2016-10-12 17:07:09 +03:00
Alexander Udalov
2f616bdd33 Drop ModuleParameters, inline defaultImports everywhere 2016-10-12 17:07:09 +03:00
Ilya Chernikov
d335aea682 Add script runtime to ultimate project 2016-10-12 15:38:52 +02:00
Ilya Chernikov
846797ff61 Switch to templates in the separate script runtime 2016-10-12 15:38:52 +02:00
Ilya Chernikov
c2b5c11781 Fix all small and medium-sized issues after review 2016-10-12 15:37:54 +02:00
Ilya Chernikov
9617fc7d6b Add kotlin-daemon-client.jar to the lib folder of plugin artifact 2016-10-12 15:37:53 +02:00
Ilya Chernikov
e03601317b Attempt #2 to fix kotlin-script-util test on TeamCity 2016-10-12 15:37:53 +02:00
Ilya Chernikov
16897f4935 Remove usage of getLocalHost, other minor changes related to localhost connections in daemon
- attempt to fix behaviours similar to #IDEA-161962, #KT-14042
2016-10-12 15:37:53 +02:00
Ilya Chernikov
ea4a1df839 Refactor session accounting in daemon, add REPL to it, write a test 2016-10-12 15:37:53 +02:00
Ilya Chernikov
3a52c68973 Attempt to fix kotlin-script-util test on TeamCity 2016-10-12 15:37:53 +02:00
Ilya Chernikov
101d85fc0b Fix binary compatibility test data after adding more templates to the runtime 2016-10-12 15:37:52 +02:00
Ilya Chernikov
1a24d37e7f Rename back the file to avoid breaking compatibility with gradles-script-kotlin without real necessity 2016-10-12 15:37:52 +02:00
Ilya Chernikov
10d259771c Refactor repl and JSR 223 support code, add separate example jars for each type of JSR 223 repl (with tests) 2016-10-12 15:37:52 +02:00
Ilya Chernikov
079fece9b4 Add daemon client jar to libraries project 2016-10-12 15:37:52 +02:00
Ilya Chernikov
bf0d5b6237 Add basic bindings support to IDEA JSR223 scripting, fix evaluator 2016-10-12 15:37:51 +02:00
Ilya Chernikov
bdaaf4fb09 Add more basic script templates to runtime 2016-10-12 15:37:51 +02:00
Ilya Chernikov
063fbed75e Fix params handling in JSR 223 for Idea, add simple test 2016-10-12 15:37:51 +02:00
Ilya Chernikov
6da7276510 minor: Fix and relax error handling on script template loading 2016-10-12 15:37:51 +02:00
Ilya Chernikov
759f6f3ded Fix script tests with output capture 2016-10-12 15:37:51 +02:00
Ilya Chernikov
439622187f Move Jsr223 engine from compiler jar to script-util.jar (libraries part) 2016-10-12 15:37:50 +02:00
Ilya Chernikov
52f291f372 Implement tests for generic and remote repls 2016-10-12 15:37:50 +02:00
Ilya Chernikov
43037373d7 Implement params to pass args to generic and remote repls to support script templates with params 2016-10-12 15:37:50 +02:00
Ilya Chernikov
f0d2f458e0 Fix script codegen for REPL lines with ScriptTemplate with parameters 2016-10-12 15:37:50 +02:00
Ilya Chernikov
fe69185cd4 Refactor script definition and related parts:
- simplify script definition interface, convert it to class
 - create simple definitions right from base
 - refactor (rename and simplify) script definition with annotated template
 - simplify usages of script definition in many places
2016-10-12 15:37:50 +02:00
Ilya Chernikov
6bc488d95d Implement JSR 223 engine and factory for IDEA using daemon repl 2016-10-12 15:37:49 +02:00
Ilya Chernikov
1a137357e5 Add support for custom script compilation and execution to maven plugin, add simple test, relevant refactorings on the compiler side 2016-10-12 15:37:49 +02:00
Ilya Chernikov
86ece30330 Add remote repl support to the daemon, refactor repl classes accordingly, simple tests 2016-10-12 15:37:49 +02:00
Ilya Chernikov
042fc4fadc Add remote input stream support, plus minor tweaks 2016-10-12 15:37:49 +02:00
Ilya Chernikov
eaa332019a Prepare repl interfaces and generic implementation for separation into possibly remote parts 2016-10-12 15:37:48 +02:00
Ilya Chernikov
f992f91686 Add kotlin-script-util lib with tests
- collection of standard templates and resolvers
2016-10-12 15:37:48 +02:00
Ilya Chernikov
42a4f0ed70 Compile most test scripts with runtime 2016-10-12 15:37:48 +02:00
Ilya Chernikov
385aab8418 Add output checking to script tests 2016-10-12 15:37:48 +02:00
Ilya Chernikov
0b68f313ab minor: fix typos and terminology 2016-10-12 15:37:48 +02:00
Ilya Chernikov
ba4fab56a0 Implement basic JSR 223 scripting support 2016-10-12 15:37:47 +02:00
Ilya Chernikov
63c5133167 Remove support for xml-based script configs, other minor refactorings 2016-10-12 15:37:47 +02:00
Ilya Chernikov
0f31695a0b Convert error on retrieving gradle plugin settings to warning - fixes #KT-13975, #EA-87275, #EA-87677 and alike 2016-10-12 15:37:47 +02:00
Ilya Chernikov
9618863b72 Hide EA-86599 in a log warning 2016-10-12 15:37:47 +02:00
Ilya Chernikov
b127cc3941 Attempt to get more diagnostic from EA-86371 2016-10-12 15:37:46 +02:00
Alexander Udalov
777004a0e2 Fix test data after merge 2016-10-12 12:52:38 +03:00
Alexander Udalov
e37a20d6b3 Do not deserialize type aliases in compatibility mode
When "-language-version 1.0" is specified in command line arguments, the
compiler should not be able to see the declarations of type aliases in
libraries, because that corresponds to the behavior of the compiler of version
1.0. Note that type aliases are _completely invisible_ in this mode (i.e.
"unresolved reference" is reported) because they must not interfere with the
classifier resolution
2016-10-12 12:19:19 +03:00
Alexander Udalov
d96f10c7bd Refactor deserialization of nested type aliases
Do it exactly in the same way as with properties/functions, in
DeserializedMemberScope and nowhere else
2016-10-12 12:19:18 +03:00
Alexander Udalov
88af36001c Introduce DeserializationConfiguration
Will be used soon to deliver the language/API-version-related behavior to the
deserialization
2016-10-12 12:19:17 +03:00
Simon Ogorodnik
25b9542c06 Fix for KT-11375, KT-9710, KT-8161 2016-10-12 12:08:48 +03:00
Simon Ogorodnik
df0dddedc2 Fixes for test(@JvmStatic -> const), fix for prototype assign 2016-10-12 11:56:54 +03:00
Simon Ogorodnik
e84f56348c Fix KT-13750, J2K const val serialVersionUID 2016-10-12 11:56:54 +03:00
Denis Zharkov
05aa9a5682 Add a quickfix for warning on ambiguously annotated expression
#KT-14238 Fixed
2016-10-12 11:40:16 +03:00
Denis Zharkov
84153f9636 Add warning for ambiguous annotated expression syntax
#KT-14238 In Progress
2016-10-12 11:40:12 +03:00
Denis Zharkov
993d226c8f Minor. Extract method for annotations resolution on expression 2016-10-12 11:39:04 +03:00
Denis Zharkov
bec84b1d7b Change parsing of annotations on block level expressions
Attach annotations to the closest prefix expression instead of
whole statement if no new line found after annotations

The motivation is for a simple annotated expression like '@ann x + y'
its syntax form must not change after prepending 'val z = ' just before it
2016-10-12 11:39:04 +03:00
Denis Zharkov
9ff439e39e Change annotations parsing in bodies of operators
This change only matters in cases of if/when/for/while having braceless
blocks

Annotations on them are parsed now as on block-level expressions, i.e.
they're attached to the whole expression
2016-10-12 11:39:04 +03:00
Denis Zharkov
c01b4156d8 Minor. Rename methods in parser
Method that was called `parseControlStructureBody` is actually used for
loop bodies only, while `parseExpressionPreferringBlocks` used for
parsing body of control structure (i.e. it must be called
`parseControlStructureBody`)
2016-10-12 11:39:04 +03:00
Simon Ogorodnik
12efb20869 Regenerated tests 2016-10-12 11:08:49 +03:00
Simon Ogorodnik
1a7c507cc5 Fix for KT-13818
Javadoc @code conversion
2016-10-12 11:08:49 +03:00
Valentin Kipyatkov
452b77692d Incremented binary stub version because of changes with annotation rendering in decompiler 2016-10-11 23:43:45 +03:00
Valentin Kipyatkov
5e32589084 Do not take ParameterName annotations into implicit lambda signature 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
03320d6559 Use partial resolve 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
31a4c6671e Fixed incorrect test 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
968a6cfd04 DescriptorRenderer to skip @ExtensionFunctionType and @ParameterName only when it's redundant 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
8baa9ba1de No parameter names in type of lambda expression and anonymous function 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
d4050ee074 More correct way of replacing parameter names to preserve overrides 2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
4513f679de Fixed test data 2016-10-11 23:38:53 +03:00
Pavel V. Talanov
14f3e4c758 Cls stubs and decompiled text: Do not render parameter names in decompiled text and do not load ParameterName annotation in stubs
Add tests for decompiled text and stubs
2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
86495fd136 No parameter name in functional type of lambda with 'it' 2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
b2f215227d Fixed completion to not render functional types with parameter names in lookup items 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
7f0063013c Corrected test data 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
073845ebd4 Fixed test data 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
4a8b41c72c Do not render @ParameterName annotations for types 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
1b7f7fb799 Minor changes on code review 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
1f9e00b23f Added tests that surprisingly passed 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
a62a37f6d8 Added tests for parameter names in function type from SAM-adapter + fixed KT-13861
#KT-13861 Fixed
2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
59269ef1ae ParameterName annotation on type argument used to hold parameter name 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
3bd39df587 No parameter names in types for error messages 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
6527ada775 Changes on code review 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
c0ea237ba4 Added test with type alias 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
d8759fcbcc Optimizations 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
6b94e5fd34 Use parameter names from function type for invoke() function
#KT-435 Fixed
 #KT-9016 Fixed
2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
0abb2edb2b Corrected test 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
f335f32b48 Some use of parameter names in completion 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov
147d1da1ed Supported obtaining function type parameter names from KotlinType 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov
8d7b59777c Moved and renamed tests 2016-10-11 23:38:48 +03:00
Alexander Udalov
4eac12e350 Report warning when SinceKotlin value is greater than -api-version value
To prevent this diagnostic be reported in each test on SinceKotlin, disable it
when a diagnostic test contains the "!API_VERSION" directive
2016-10-11 17:46:14 +03:00
Alexander Udalov
167ab1f860 Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
2016-10-11 17:46:01 +03:00
Alexander Udalov
e3df8ed2fe Introduce SinceKotlin annotation, check validity of its value
#KT-14297 Fixed
2016-10-11 17:45:51 +03:00
Alexander Udalov
8d660c2f6e Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added
2016-10-11 17:30:15 +03:00
Alexander Udalov
2c66d4e59b Move LanguageVersionSettings and JvmTarget to module 'util'
To be used from cli-common in the subsequent commits
2016-10-11 17:30:14 +03:00
Alexander Udalov
aaeae8b948 Support deprecation level HIDDEN for classifiers
Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.

Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test

 #KT-13926 Fixed
2016-10-11 17:30:14 +03:00
Alexander Udalov
83c86d06ed Report error instead of warning for deprecation level HIDDEN
Since functions usually are hidden from resolution when they are
deprecated-hidden, the problem can only be reproduced for properties with
deprecated-hidden accessors, where DeprecatedCallChecker reported warnings
instead of errors
2016-10-11 17:30:13 +03:00
Alexander Udalov
6e0e8c6dc3 Pass LanguageVersionSettings instance to isHiddenInResolution
Unused at the moment, will be used later to check if the API version prohibits
the usage of the element
2016-10-11 17:30:12 +03:00
Alexander Udalov
59b29cf00d Minor, extract isDeprecatedHidden for usage in codegen
Also remove a hundred year old TODO
2016-10-11 17:30:11 +03:00
Alexander Udalov
2e4592c6dc Report error on bound callable references in compatibility mode
Previously examples were failing with IllegalStateException from JVM back-end
because there was an error type without any error reported
2016-10-11 17:30:10 +03:00
Valentin Kipyatkov
73dc5fefcb KT-12077 Code completion inserts FQN for annotations with use-site target inside primary constructor
KT-13009 Kotlin: annotation auto-import is broken in multiple ways

  #KT-12077 Fixed
  #KT-13009 Fixed
2016-10-11 17:26:52 +03:00
Valentin Kipyatkov
0c14058d13 Moved tests 2016-10-11 17:26:52 +03:00
Ilya Gorbunov
16a0c55c6c Since 'printStackTrace' now fallbacks to the extension in stdlib, change the test expecting it to be deprecated due to language-version 1.0 accordingly. 2016-10-11 16:46:14 +03:00
Ilya Gorbunov
a239231c75 Revert dropping inline-only extensions for Throwable, to be able to use runtime of 1.1 with language version of 1.0 which makes mapped builtin members unavailable again.
#KT-14213 Fixed
2016-10-11 16:46:14 +03:00
Dmitry Jemerov
fc46afc108 reduce ComponentRegistry memory use
#KT-13136 Fixed
2016-10-11 15:35:06 +02:00
Dmitry Petrov
2cd6b1d586 KT-14282 No error on unused type alias with -language-version 1.0
Always resolve descriptors for type aliases.
2016-10-11 16:33:21 +03:00
Mikhail Glukhikh
206374cd17 Minor refactoring: destructure intention 2016-10-11 16:13:21 +03:00
Mikhail Glukhikh
c6fefbc223 Rename: intention tests "ifNullToElvis" --> "foldInitializerAndIfToElvis" 2016-10-11 16:13:16 +03:00
Mikhail Glukhikh
0903402282 "If null to elvis" now converts to elvis also !is check right after initializer #KT-14032 Fixed 2016-10-11 16:13:11 +03:00
Mikhail Glukhikh
121f0ec810 KT-14032 related: if expression to elvis now handles also is and !is checks 2016-10-11 16:13:06 +03:00
Mikhail Glukhikh
8188bb1e54 Destructure intention: entries / entrySet are now removed only for kotlin.Map inheritors #KT-14244 Fixed 2016-10-11 16:13:01 +03:00
Mikhail Glukhikh
304f6a3b3a KT-13943 related: inspection is now always reported if manual destructuring is available 2016-10-11 16:12:56 +03:00
Mikhail Glukhikh
475d5548c4 Destructure intention now handles the case with manual destructuring inside #KT-13943 Fixed 2016-10-11 16:12:51 +03:00
Nikolay Krasko
c7ba19696a Refactoring: stop calling deprecated method
(cherry picked from commit 083656c)
2016-10-11 15:35:44 +03:00
Nikolay Krasko
11f8c904c4 Refactoring: inline method + inline variable
(cherry picked from commit 7e0f100)
2016-10-11 15:35:43 +03:00
Nikolay Krasko
bd2ddbafb3 Refactoring: call apply method without returning intermediate object
(cherry picked from commit a2f7e00)
2016-10-11 15:35:41 +03:00
Nikolay Krasko
78525ed7c6 Refactoring: make createCommand non-nullable
(cherry picked from commit 67cc9b5)
2016-10-11 15:35:40 +03:00
Nikolay Krasko
f7813263ee Refactoring: rename getStepOverPosition -> getStepOverAction
(cherry picked from commit 2b71909)
2016-10-11 15:35:38 +03:00
Denis Zharkov
194853b5c2 Fix backend issue related to JvmStatic val with accessor
Do not treat accessors to JvmStatic properties as having dispatch receiver

 #KT-11585 Fixed
2016-10-11 12:22:03 +03:00
Denis Zharkov
543cf7b265 Minor. Move isJvmStatic* functions to backend 2016-10-11 12:22:03 +03:00
Alexey Andreev
30c2c85c94 KT-13830: support case when LHS of augmented assignment is something different than qualified expression or array access 2016-10-11 11:54:04 +03:00
Yoshinori Isogai
afe8244183 KT-14241 Add Intention + Inspection to remove empty class body (#968) 2016-10-10 19:24:39 +02:00
Ilya Gorbunov
4236a4dd07 Farewell, excluded imports from the platform. If anyone ever needs them again, they are buried in this commit. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
f2c5fee1cf Consider only direct children of non-kotlin default imported packages when looking for aliased types. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
3baf2f8942 Use fully-qualified references to exceptions in kotlin-runtime 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
7e2e2b9f19 Use effectively excluded imports from file's module descriptor. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
ff01b3d41b Search java.lang aliases also in kotlin.text package (for aliases to Appendable and StringBuilder) 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
5042158df5 Determine automatically which types from java.lang is aliased in default imported kotlin packages and exclude them from imported java.lang.* scope. 2016-10-10 20:14:32 +03:00
Zalim Bashorov
45d42bdff8 JS: add inspection for the case when something with dynamic type implicitly casted to kotlin another type 2016-10-10 17:30:51 +03:00
Ilya Chernikov
d05cb9f894 Fix idea module file 2016-10-10 15:28:20 +02:00
Ilya Chernikov
1e59f96f6b Add missing idea module file 2016-10-10 13:57:41 +02:00
Valentin Kipyatkov
b84260f39f Fixed multiple bugs in optimize imports for JS-target
#KT-13689 Fixed
2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
45cd4f1e29 Refactoring 2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
326db55835 Used KtReference.resolvesByNames instead of own code 2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
5734f2ba9b KT-9950 IntelliJ IDEA does not suggest importing extension methods which have the same name as an instance method
#KT-9950 Fixed
2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
49ac6b99f6 Removed redundant 2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
c06e2d994e KT-13884 Exception "Invalid root block PSI element" on replacing trivial when-expression to if
#KT-13884 Fixed
2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
597cd04831 KT-13719 'var' can be made 'val' highlighting range with annotation before
#KT-13719 Fixed
2016-10-10 14:48:14 +03:00
Mikhail Glukhikh
8d48b0d2a0 UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed 2016-10-10 14:42:09 +03:00
Mikhail Glukhikh
126304c197 Destructure intention applied (compiler) 2016-10-10 14:42:04 +03:00
Michael Bogdanov
d911de20f9 Print bytecode on signature test fail 2016-10-10 14:17:51 +03:00
Michael Bogdanov
f8e9922c9e Don't generate generic signature for get/set methods in property reference class 2016-10-10 14:17:50 +03:00
Michael Bogdanov
5bd045c79c Fix for KT-14243: Wrong invocation descriptor on calling implicitly generated implementation in class
#KT-14243 Fixed
2016-10-10 14:17:50 +03:00
Dmitry Jemerov
ce0d81f670 to avoid running resolve under ClsTypeElement lock, return empty modifier list if we're currently calculating the return type (the modifier list is requested to apply type annotations, and we don't care about them anyway)
#KT-12966 Fixed
2016-10-10 12:48:51 +02:00
Dmitry Jemerov
e55c82d3f3 don't try to resolve declaration to descriptor if we don't have any annotations 2016-10-10 12:46:35 +02:00
Ilya Chernikov
b7a52dc685 Add more standard templates 2016-10-10 11:24:54 +02:00
Ilya Chernikov
5e5ebaa68b Create a script runtime jar with a copy of standard script template (renamed) 2016-10-10 11:24:53 +02:00
Alexey Andreev
61b429f2f0 JS: fix exception during translation of for expression with iterator having generic type constrained by Iterable. Fix #KT-8385 2016-10-10 11:22:21 +03:00
Alexey Andreev
977fd8f591 KT-12707: support case when secondary super constructor has optional parameters 2016-10-10 11:21:45 +03:00
Alexey Andreev
c1b8e50734 KT-12707: (JS) proper translation of a constructor in subclass that calls secondary constructor of parent class. Fix #KT-12707 2016-10-10 11:21:45 +03:00
Denis Zharkov
b1dc31a64e Minor. Invert if 2016-10-10 10:44:11 +03:00
Denis Zharkov
0905bf3e38 Refine redundant null checks interpreter
The main change here is addition of a check that NotNullBasicValue instances
are not being created for non-reference types

Exactly this change should be used instead of f25f0db10e
The latter commit lead to problem described in the KT-14242 issue:
v.getType().getSort() == w.getType().getSort() && (v.getType().getSort() != Type.OBJECT || v.equals(w))

Problem is that the condition above returns true without calling `v.equals(w)`,
because the sort of type is ARRAY, not OBJECT, so testArray was being treated
as NotNullable erroneously

So the second part of this change is effectively revering mentioned commit

 #KT-14242 Fixed
2016-10-10 10:44:11 +03:00
Denis Zharkov
2eece06d5c Minor. Add hashCode override after existing equals 2016-10-10 10:44:11 +03:00
Alexey Andreev
322f6fe7ac KT-2752: fix translation of call to internal function from subclass 2016-10-08 19:25:53 +03:00
Alexey Andreev
c814a9d1d2 KT-2752: fix support of typealiases 2016-10-08 19:25:52 +03:00
Alexey Andreev
831ac97ecd KT-2752: fix some tests and make them slightly less fragile 2016-10-08 19:25:51 +03:00
Alexey Andreev
9c7c82b151 KT-2752: refactor NameSuggestion, change rules for determining name stability and applying mangling 2016-10-08 19:25:50 +03:00
Alexey Andreev
6f7e7d8504 KT-2752: fixes after code review 2016-10-08 19:25:49 +03:00
Alexey Andreev
00867cb269 KT-2752: remove unnecessary hack that tries to treat annotation on property accessor as annotation on property itself; looks like FE has fixed that 2016-10-08 19:25:48 +03:00
Alexey Andreev
e7e6a917eb KT-2752: when simple name of class is a JS keyword or a well-known global name, add '$' to name of constructor function 2016-10-08 19:25:47 +03:00
Alexey Andreev
a4bf058be6 KT-2752: add hash-based suffix to private members of open/abstract public classes 2016-10-08 19:25:46 +03:00
Alexey Andreev
ba9c908875 KT-2752: export JsName on class via JS reflection 2016-10-08 19:25:45 +03:00
Alexey Andreev
aa5d15cff7 KT-2752: minor fixes after code review 2016-10-08 19:25:43 +03:00
Alexey Andreev
7956b038fd KT-2752: add test to prove that KT-13024 is no longer reproducible with new implementation of name mangling 2016-10-08 19:25:43 +03:00
Alexey Andreev
4e2b1d68cf KT-2752: deprecate parameter of @native annotation, prohibit simultaneous usage of parameterized @native and @JsName 2016-10-08 19:25:42 +03:00
Alexey Andreev
49022fd5bc KT-2752: move some diagnostics from entire declarations to their headers 2016-10-08 19:25:41 +03:00
Alexey Andreev
fb7f221158 KT-2752: add test to ensure that JsName affects classes 2016-10-08 19:25:40 +03:00
Alexey Andreev
b888d9e7d9 KT-2752: refactor NameSuggestion 2016-10-08 19:25:40 +03:00
Alexey Andreev
72ada61342 KT-2752: rename FQNPart to SuggestedName and FQNGenerator to NameSuggestion 2016-10-08 19:25:39 +03:00
Alexey Andreev
0c61f431ff KT-2752: add some docs to FQNGenerator 2016-10-08 19:25:38 +03:00
Alexey Andreev
c14795f66d KT-2752: refactor support of modules and root packages 2016-10-08 19:25:38 +03:00
Alexey Andreev
c657716ae0 KT-2752: minor fixes 2016-10-08 19:25:37 +03:00
Alexey Andreev
681a428473 KT-2752: prohibit JSName on extension properties 2016-10-08 19:25:36 +03:00
Alexey Andreev
33daf83f14 KT-2752: refactoring:
1. Get rid of most of ManglingUtils
2. Use simple mangling for delegated properties instead of stable mangling
3. Use stable mangling for public declarations of open non-public classes
4. When generating a fresh name in a JsScope, check it for clashing against parent scopes
5. JsFunctionScope does not generate fresh name instead of stable names
6. Function scopes inherit directly from global scope
7. Generate simple mangled names for backing fields of properties
2016-10-08 19:25:36 +03:00
Alexey Andreev
1dcb037aee KT-2752: remove diagnostic that reports about overridden method having several names from different sources. Generate proxies instead. Fix reporting name clash when two distinct fake overrides require same name. 2016-10-08 19:25:35 +03:00
Alexey Andreev
c5087779e4 KT-2752: add diagnostics that reports about conflicting overridden declarations 2016-10-08 19:25:34 +03:00
Alexey Andreev
16c172f053 KT-2752: add diagnostic that reports about applying JsName on overridden declarations 2016-10-08 19:25:33 +03:00
Alexey Andreev
725d13b72e KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets 2016-10-08 19:25:33 +03:00
Alexey Andreev
be0013d9f2 KT-2752: declare properties as a pair of functions when accessors are marked with @JsName 2016-10-08 19:25:32 +03:00
Alexey Andreev
6e1a0901ac KT-2752: add checkers for inconsistent usage of JsName 2016-10-08 19:25:31 +03:00
Alexey Andreev
638952e96e KT-2752: JsName renames native declarations 2016-10-08 19:25:31 +03:00
Alexey Andreev
7a7a6914a6 KT-2752: fix old tests, add test for clashing between class and its companion object 2016-10-08 19:25:30 +03:00
Alexey Andreev
50dd1e31c3 KT-2752: move tests, that check whether there's no name clash, to JS backend tests 2016-10-08 19:25:29 +03:00
Alexey Andreev
5ce158f297 KT-2752: add basic tests for JsName 2016-10-08 19:25:28 +03:00
Alexey Andreev
5e3aa33b13 KT-2752: add draft implementation of JsName annotation. Fix some tests using the annotation 2016-10-08 19:25:27 +03:00
Alexey Andreev
8738458c34 KT-2752: fix name clash diagnostic for case of extension property. Add more tests for the diagnostic 2016-10-08 19:25:27 +03:00
Alexey Andreev
8f829557c8 KT-2752: add diagnostic that checks whether Kotlin declarations produce conflicting names in generated JS 2016-10-08 19:25:26 +03:00
Alexey Andreev
f70b50b6e2 KT-2752: refactor generation of FQN in JS. Move backend-independent code to generic code in frontend. 2016-10-08 19:25:25 +03:00
Alexey Andreev
ed55923bb0 KT-2752: a new approach to compose fully-qualified names that does not depend on code generation and can be reused in JS front-end 2016-10-08 19:25:25 +03:00
Alexey Sedunov
d3c14ce7d6 Extract Function: Support implicit abnormal exits via Nothing-typed expressions 2016-10-07 20:20:39 +03:00
Alexey Sedunov
8e9f32db9e Search Everywhere: Render function parameter types. Render extension type in prefix position
#KT-13976 Fixed
 #KT-13977 Fixed
2016-10-07 20:20:38 +03:00
Alexey Sedunov
a6601b27e9 Move: Show error message on applying to enum entries
#KT-14182 Fixed
2016-10-07 20:20:37 +03:00
Alexey Sedunov
fad4944eee Rename: Use qualified class name when looking for occurrences in non-code files
#KT-14128 Fixed
 #KT-13862 Fixed
 #KT-6199 Fixed
2016-10-07 20:20:36 +03:00
Alexey Sedunov
da1178fe0c Create from Usages: Do not suggest on type-mismatched expressions which are not call arguments
#KT-14143 Fixed
2016-10-07 20:20:35 +03:00
Alexey Sedunov
e4dc2ae367 Rename: Implement popup chooser for overriding members
#KT-13963 Fixed
2016-10-07 20:20:34 +03:00
Alexey Sedunov
fe711da594 Rename: Rename do-while loop variables in the loop condition
#KT-14157 Fixed
2016-10-07 20:20:33 +03:00
Alexey Sedunov
140d0b61f1 Move: Fix exception on moving Kotlin file without declarations
#KT-14114 Fixed
2016-10-07 20:20:32 +03:00
Alexander Udalov
9004367f3c Minor refactoring in DeprecatedCallChecker 2016-10-07 20:14:54 +03:00
Alexander Udalov
8949ffbef1 Do not report deprecation on members of deprecated companion
This deprecation is reported on the companion itself anyway
2016-10-07 20:14:53 +03:00
Alexander Udalov
b08ed14f66 Rename PlatformTypesMappedToKotlinChecker -> PlatformClassesMappedToKotlinChecker
To prevent confusion with the term "platform type" which has gained a new
meaning since this class was introduced
2016-10-07 20:14:05 +03:00
Alexander Udalov
6ec868d84e Pass LanguageVersionSettings to ClassifierUsageChecker
To be used in future classifier usage checkers
2016-10-07 20:13:24 +03:00
Alexander Udalov
9fd698db36 Fix NPE in StorageManager on sanitizing stack trace
This could happen when running the compiler from the command line, where
MemoryBasedClassLoader is used which does not ever create Package instances.
2016-10-07 20:13:23 +03:00
Sergey Mashkov
17137f1c4f KT-13478 Error creating Maven project by archetype: The desired archetype does not exist
don't filter versions in internal mode or if all were filtered out
2016-10-07 17:56:05 +03:00
Sergey Mashkov
297248dc4f KT-13638 Update Maven configuration actions in IDE according to changes in https://github.com/JetBrains/kotlin-web-site/pull/458 2016-10-07 17:54:32 +03:00
Sergey Mashkov
dafe7e3539 KT-14003 kotlinc shebang should use env 2016-10-07 17:52:34 +03:00
Mikhail Glukhikh
375a2cc6ab Build fix (AdditionalResolveDescriptorRendererTestGenerated) 2016-10-07 17:04:29 +03:00
Yan Zhulanow
34efaea6ea Increment PsiModificationTracker counter in a write action
(cherry picked from commit 73307a2)
2016-10-07 16:28:34 +03:00
Yan Zhulanow
2f933cfcf2 Kapt: Handle exceptions during annotation processing gracefully
(cherry picked from commit ee26c19)
2016-10-07 16:28:33 +03:00
Yan Zhulanow
82160bc86d Parse enum arrays correctly
(cherry picked from commit 5f2b5cf)
2016-10-07 16:28:32 +03:00
Yan Zhulanow
f15f90a719 Kapt: Support apt options (KT-13984)
(cherry picked from commit b566a37)
2016-10-07 16:28:31 +03:00
Yan Zhulanow
0ae9a7a9d1 Add TransactionGuard application service to KotlinCoreEnvironment
(cherry picked from commit 3e0b79e)
2016-10-07 16:28:30 +03:00
Yan Zhulanow
46f3eae32c Kapt: Dispose every JeElement and JeTypeMirror because some annotation processors may store them in static fields. (KT-13917)
Hello, Data Binding, why you cache them? :(

(cherry picked from commit d86a30b)
2016-10-07 16:28:29 +03:00
Yan Zhulanow
f83e7509b2 Kapt: typeElement.asType() should preserve type parameters and propagate it to its supertypes (KT-13865)
(cherry picked from commit 92c9cea)
2016-10-07 16:28:28 +03:00
Yan Zhulanow
a22721fbd8 Kapt: Add test on Map<Key, Intf> and MutableMap<Key, Intf>
(cherry picked from commit 59cdbcb)
2016-10-07 16:28:28 +03:00
Yan Zhulanow
30ed279426 Kapt: Measure Annotation Processing time
(cherry picked from commit 2554d40)
2016-10-07 16:28:27 +03:00
Yan Zhulanow
e770b9ff60 Minor: add 'kapt' to dictionary
(cherry picked from commit 2f44b0b)
2016-10-07 16:28:26 +03:00
Yan Zhulanow
238340a143 Kapt: Simplify wrapper tests
(cherry picked from commit 1677984)
2016-10-07 16:28:25 +03:00
Yan Zhulanow
e04f834a0e Kapt: Support type parameters in asMemberOf() (KT-13804)
(cherry picked from commit 0d97d73)
2016-10-07 16:28:24 +03:00
Yan Zhulanow
415acfbd05 Kapt: asMemberOf() should also check the containing type itself, not only its supertypes (KT-13823)
(cherry picked from commit 9f9ffdf)
2016-10-07 16:28:23 +03:00
Yan Zhulanow
cb9dc21649 Dispose IntelliJ platform components after annotation processing complete.
Annotation processors may cache ProcessingEnvironment.

(cherry picked from commit bd7a9c6)
2016-10-07 16:28:22 +03:00
Yan Zhulanow
49926fda36 Use LightParameter from Kotlin light classes to add an inner class constructor parameter instead of calling addParameter(name, type). The latter tries to load an icon :( (KT-13798)
(cherry picked from commit cc86d79)

(cherry picked from commit de55de2)
2016-10-07 16:28:21 +03:00
Yan Zhulanow
f7f8cff00d Kapt: Return substituted supertypes in directSupertypes() for immediate class types (KT-13746)
(cherry picked from commit 3aae990)

(cherry picked from commit 198115b)
2016-10-07 16:28:20 +03:00
Yan Zhulanow
8d2a4c3f91 asMemberOf() should always substitute type parameters for methods using the relevant substitutor
(cherry picked from commit dfadd17)

(cherry picked from commit 49b07a7)
2016-10-07 16:28:19 +03:00
Yan Zhulanow
16a9941549 Kapt: Allow to make CompilerConfiguration mutable again
(cherry picked from commit 0780de8)

(cherry picked from commit 95dde72)
2016-10-07 16:28:18 +03:00
Nikolay Krasko
8d9e6f402c Enable using local caches by default for both TeamCity and local testing
(cherry picked from commit b028efa)
2016-10-07 13:06:04 +03:00
Nikolay Krasko
4fd0424b38 Auto-remove local debugger caches on test data modification
(cherry picked from commit 59c28e4)
2016-10-07 13:06:02 +03:00
Denis Zharkov
828ff87db4 Update rendered stdlib public API
Many redundant methods were optimized out in the previous commits
2016-10-07 11:59:15 +03:00
Denis Zharkov
1ad9f1c985 Fix serialVersionUID for EmptyMap and EmptySet
Otherwise removal of redundant special stubs
leads to InvalidClassException during deserialization
2016-10-07 11:59:15 +03:00
Denis Zharkov
dfb9b323ff Avoid generation of redundant abstract special stubs
#KT-13698 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
6e838f0adc Avoid generation of redundant toArray stubs
#KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
e05e0ec921 Optimize method count for collection stubs
Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
900c442efd Write generic signature for autogenerated toArray
#KT-14195 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
3a100d4139 Improve exception message in collection stubs 2016-10-07 11:59:15 +03:00
Denis Zharkov
8ee568105c Do not generate collection stubs for Kotlin-specific signatures
#KT-14188 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
d2de4579de Minor. Extract computation of collection mutable stub list
It's necessary in the next commits to obtain these signatures
without actually emitting any code
2016-10-07 11:59:15 +03:00
Ilya Gorbunov
56ecbe52b2 Add a test verifying #KT-14194 Fixed 2016-10-07 00:15:48 +03:00
Mikhail Glukhikh
70949d10da Refactoring + minor fixes: destructure intention 2016-10-06 21:16:46 +03:00
Mikhail Glukhikh
dd7d7a5fc7 Destructure inspection: do not apply on variable declarations or function literals without explicit parameters + name & severity changed 2016-10-06 21:07:58 +03:00
Mikhail Glukhikh
37debf4436 Destructure intention: use also for variable declarations #KT-7488 Fixed 2016-10-06 21:03:29 +03:00
Mikhail Glukhikh
de865c6d46 getUseScope() fixed for destructuring declarations #KT-14181 Fixed 2016-10-06 21:03:24 +03:00
Mikhail Glukhikh
e7d290f726 Refactor PSI for destructuring declarations in for: they are now children of KtParameter and not instead of it 2016-10-06 21:03:19 +03:00
Mikhail Glukhikh
48437d5965 KT-13941 related: "Simplify using destructuring declaration" is now applicable for function literals without parameter specification 2016-10-06 21:03:13 +03:00
Mikhail Glukhikh
df0cf3da84 "Simplify using destructuring declaration" is now applicable for function literals #KT-13941 Fixed 2016-10-06 21:03:08 +03:00
Mikhail Glukhikh
42aea59253 Simplify for intention refactoring: focus on the loop parameter, not on the loop itself 2016-10-06 21:03:03 +03:00
Mikhail Glukhikh
0a8006a395 Minor: destructing --> destructuring in SimplifyForIntention 2016-10-06 21:02:58 +03:00
Mikhail Glukhikh
3163d28b29 Minor: test fixed 2016-10-06 21:02:53 +03:00
Alexander Udalov
8ccc168b87 Include output of module daemon-common to compiler jar in compiler-quick
This fixes CompilerDaemonTest with the compiler built by "ant compiler-quick"
2016-10-06 14:40:21 +03:00
Alexander Udalov
a1584377bf Do not pack IDEA core libraries into one idea-core-all.jar in pack-compiler
This is no longer needed because there's no more jsr166e.jar in IDEA core
libraries, which was the reason for the original change.

This reverts commit 9a762e0fa2.
2016-10-06 14:40:21 +03:00
Alexander Udalov
8ffe379c92 Use separate module analysis in CliReplAnalyzerEngine 2016-10-06 14:40:21 +03:00
Alexander Udalov
1e51ba7d00 Run classifier usage checkers for ambiguous references when possible
See comment in getReferencedClassifier and importJavaSamInterface.kt for
explanation
2016-10-06 14:40:21 +03:00
Alexander Udalov
ec53efd869 Run classifier usage checkers after all imports are resolved
Otherwise the diagnostic was not reported on an unused import of a deprecated
class in diagnostic tests, see the test case
2016-10-06 14:40:20 +03:00
Alexander Udalov
f7b4d7d35b Move ClassifierUsageChecker and DeclarationChecker to checkers/ 2016-10-06 14:40:20 +03:00
Alexander Udalov
0905b361d0 Drop LazyTopDownAnalyzerForTopLevel
Replace it everywhere with LazyTopDownAnalyzer
2016-10-06 14:40:20 +03:00
Alexander Udalov
9c70094ceb Move resolveImportsInAllFiles to LazyTDA#analyzeDeclarations
This does not change the behavior: in the other usage of analyzeDeclarations,
a local class is being resolved and therefore TopDownAnalysisContext there does
not contain any files where imports would be resolved
2016-10-06 14:40:20 +03:00
Alexander Udalov
7070b88ea4 Move PlatformToKotlinClassMap out from ModuleParameters
Configure it in the same way as other platform-specific components instead,
simplify some code
2016-10-06 14:40:20 +03:00
Alexander Udalov
b77388bd48 Pass PlatformToKotlinClassMap instance to PlatformTypesMappedToKotlinChecker
The purpose of this change is to allow PlatformToKotlinClassMap to be removed
from ModuleDescriptor
2016-10-06 14:40:19 +03:00
shiraji
0360d0e4f6 Refactoring to use Utils#resolvedToArrayType 2016-10-06 14:36:27 +03:00
shiraji
32b7b5a092 Inspection/Intention replace size check with 'isNotEmpty' and 'isEmpty' #KT-13937 Fixed 2016-10-06 14:35:57 +03:00
Alexey Tsvetkov
5fa561eb70 Add test for freeCompilerArgs in kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
0944e9076d Add 1.1 language version to kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
8fa7e1f93e Minor: JS test fix 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
7d657a8c58 Don't warn about absence of kotlin files
#KT-10401 fixed
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
a474d75fe2 Avoid exception when getting relative path
#KT-14056 fixed Target versions 1.0.5
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
d293138c28 Refactoring: use same module name as Intellij 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
0d8fa69760 Refactoring: move gradle tests imported from jps to separate dir
This will allow skipping jps tests when running all tests in directory from Intellij
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
1cc423b163 Refactoring: move gradle integration tests to separate module 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
8cc384a6dd Refactoring: specify internal visibility where possible 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
617bc6c296 Refactoring: use daemon by default in gradle tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
c144191522 Minor, set Groovy indent to 4 spaces 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
b3ed04230d Refactoring: cleanup build.gradle files in tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
11d971c4bf Refactoring: extract kotlin_version constant for gradle tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
18ffb974c7 Refactoring: cleanup after merge 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
139cead7b4 Refactoring: merge modules 'kotlin-gradle-plugin-dsl', 'kotlin-gradle-plugin-core' into 'kotlin-gradle-plugin' 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
892fc63fd1 Generate gradle options from compiler arguments
#KT-13633 fixed
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
2c34088859 Track changes in java files generated by kapt2
#KT-13500 fixed
2016-10-05 22:50:46 +03:00
Nikolay Krasko
c70e9a6702 Create special parameter for branch version auto-increment
Can be used when bootstrap branch differs from the one used for auto-increment.

Auto-increment is guarded by branch parameter to avoid accidental enabling after branches auto-merge.

(cherry picked from commit 46791a3)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
019ba77e2b J2K: AbstractBytecodeTextTest.java fix compile errors
(cherry picked from commit 02b59be)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
32dff799ff J2K: AbstractBytecodeTextTest.java convert
(cherry picked from commit 93fce11)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
5a873432d9 J2K: AbstractBytecodeTextTest.java rename
(cherry picked from commit 8edd7be)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
aae0b85684 Refactoring: hide state of occurrence class
(cherry picked from commit 4f438bc)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
3d9d6e666d Test several line numbers are generated for one instruction
(cherry picked from commit 1ea9280)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
25051746d1 Refactoring: no need in DebugProcessImpl.ResumeCommand for getting command action
(cherry picked from commit 5638f31)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
7ba0436d7f Add cause exception to AssertionError
(cherry picked from commit 0b60cbb)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
3d6ac2f277 Refactoring: create step-over kotlin position and move counting step over specific to create action stage
(cherry picked from commit 4b08bbd)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
60fbcb7e38 Refactoring: extract top-level functions from KotlinSteppingCommandProvider
(cherry picked from commit 2daac45)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
dd42420a1e Revert using temp directory for building debugger application by default
(cherry picked from commit f131be0)
2016-10-05 18:49:38 +03:00
Dmitry Jemerov
b6e1327e89 allow to specify plugin.xml version number as build script parameter 2016-10-05 16:52:21 +02:00
Dmitry Jemerov
2bd948754e fix QualifiedNameTest 2016-10-05 11:35:06 +02:00
Alexey Sedunov
3f6e60fb51 Call Hierarchy: Show Kotlin usages of Java methods
#KT-12398 Fixed
2016-10-05 11:32:43 +03:00
Alexey Sedunov
5bb035282f Generate 'toString()': Permit for data classes
#KT-14122 Fixed
2016-10-05 11:32:42 +03:00
Alexey Sedunov
0616e869aa Quick Fixes: Implement "Remove unused assignment" quickfix
#KT-9931 Fixed
2016-10-05 11:32:41 +03:00
Alexey Sedunov
074ad6b5f0 Move out of Companion Object: Warn if traget class already contains function with the same signature
#KT-13877 Fixed
2016-10-05 11:32:40 +03:00
Alexey Sedunov
450d31b4bc Test Framework Support: Allow using whitespaces and other symbols in "Generate -> Test Function" dialog
#KT-12556
2016-10-05 11:32:39 +03:00
Alexey Sedunov
86c123164a Move Inner Class to Upper Level: Fix replacement of outer class instances used in inner class constructor calls
#KT-13928 Fixed
2016-10-05 11:32:38 +03:00
Alexey Sedunov
c76c834009 Rename: When renaming Kotlin file outside of source root do not rename its namesake in a source root
#KT-14096 Fixed
2016-10-05 11:32:37 +03:00
Alexey Sedunov
a5eee2d3d8 Move: Do not report accessibility conflicts on builtin declarations
#KT-13726 Fixed
2016-10-05 11:32:36 +03:00
Alexey Sedunov
ba1ee99e97 Navigation: Filter out candidate declarations coming from the wrong library
#KT-13726 In Progress
2016-10-05 11:32:36 +03:00
Alexey Sedunov
6c2d4ad8eb Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2) 2016-10-05 11:32:35 +03:00
Alexander Udalov
53b584f48c Simplify usages of IncrementalPackageFragment and related code
Since its scope is now empty, no descriptor now has a container that is an
instance of IncrementalPackageFragment -> a lot of code is not needed anymore
2016-10-05 11:24:30 +03:00
Alexander Udalov
7c6352a9f2 Refactor IncrementalPackageFragmentProvider 2016-10-05 11:24:30 +03:00
Denis Zharkov
4910024cdb Fix suppress at statement intention for asigmnents
There's no need now to consider precedence of element as
annotation preceding the beginning of block statement
is always now attached to the whole statement

 #KT-11673 Fixed
 #KT-12780 Fixed
2016-10-05 10:29:29 +03:00
Denis Zharkov
7353b08f09 Change parsing of statements starting with annotations
If a block statement starts with annotations treat them as they
belong to node of the statement rather than to the closest prefix expression

 #KT-10210 Fixed
2016-10-05 10:29:29 +03:00
Denis Zharkov
001a058529 Remove effectively dead code in parser
`parseLabeledExpression` can only be called from `parsePrefixExpression`,
but the latter in the beginning tries to parse annotated expression,
thus advances any number of AT symbols
2016-10-05 10:29:29 +03:00
Dmitry Jemerov
642027d790 fix find usages test 2016-10-04 22:20:54 +02:00
Dmitry Jemerov
d8b0c7aaec Binding trace filtering: do not calculate diagnostics if no one is going to query them 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
b365e547c4 DelegatingBindingTrace: remove unnecessary secondary constructor 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
bcde67dc91 DelegatingBindingTrace: J2K 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
9e6f03cd94 DelegatingBindingTrace: rename to .kt 2016-10-04 18:50:30 +02:00
Valentin Kipyatkov
75d56e4902 Better tooltip for try 2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
f1946ae154 No crash in dumb mode
#KT-13967 Fixed
2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
a2976ac281 Better presentation for property accessor 2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
af0b027952 All operator usages are searched with new searcher 2016-10-04 19:34:58 +03:00
Valentin Kipyatkov
ba76e4d24d Quick search of getValue/setValue operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
75a6b0ca5a Quick search of iterator operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
f2e5662154 Quick search of compareTo operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
ee64a1a2b7 Quick search of equals operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
309d82308f Optimization 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
4cc16e42b2 Use partial resolve multiple in operator reference search 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
f181458a58 More efficient way 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
5f8dca29aa Renames 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
32a436e893 Refactoring 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
c8260f8d98 Refactoring 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
7eac49be62 Added comments 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
73e3180699 More efficient way to check for Kotlin files 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
ee2d4870aa Added comments 2016-10-04 19:34:54 +03:00
Valentin Kipyatkov
ccc5d74649 Renames 2016-10-04 19:34:54 +03:00
Valentin Kipyatkov
c9bb3607ac More correct quickfix testing - do not include suppression actions not available at caret 2016-10-04 19:32:00 +03:00
Valentin Kipyatkov
aec2f19682 Renames 2016-10-04 19:28:54 +03:00
Valentin Kipyatkov
2f5e820afb KT-8664 Hide componentX() functions for data classes from completion
#KT-8664 Fixed
2016-10-04 19:28:53 +03:00
Valentin Kipyatkov
7263d0a056 KT-13728 Implicitly imported functions should be above in completion then non-imported
#KT-13728 Fixed
2016-10-04 19:28:53 +03:00
Valentin Kipyatkov
e8f4c65455 KT-13833 javascript: Smart type completion to lower priority of dynamic type
#KT-13833 Fixed
2016-10-04 19:28:53 +03:00
Dmitry Jemerov
dbbba45d63 show type of control statements used as expressions 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
02a5856ffd don't show function literals and selectors of qualified expressions in "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
256fd04e95 show detailed smart cast info in "Show expression type" (KT-8803) 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
2141cd268c don't include properties with declared return type and property accessors in "show expression type" popup 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
e8fcd194f9 add test for obsolete KT-11601 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
4f1f313b36 don't show type of statements if they are not used as expressions 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
6dccfd3b22 use short names in Show Expression Type
#KT-11310 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
4346afa19e test for handling smart casts in "show expression type"
#KT-10588 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
032d50bbbf handle multi-declarations in "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
fbd2c48fbd don't offer functions with block body and functions with declared return type as candidates for "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
7b644e2c52 support "show expression type" in variable declaration position
#KT-10095 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
752a7451e5 get rid of Kotlin specific "Show expression type" action
#KT-13142 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
39ab1e985a Java-compatible "Copy Reference" action for Kotlin
#KT-13140 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
cbb2e5c379 show context when invoking Show Implementations from Find Usages popup
#KT-13475 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
e462a97c64 show two levels of hierarchy when grouping find usages by file structure
#KT-9019 Fixed
 #KT-10178 Fixed
2016-10-04 18:23:32 +02:00
Denis Zharkov
a4978c794f Fix accidental overrides computation
Consider the whole overridden tree instead of only direct overridden

 #KT-14146 Fixed
2016-10-04 16:47:10 +03:00
Denis Zharkov
aca05003a9 Set up tests for postfix templates properly
If there are some other completion-like tests before these ones
it may lead to the situation when some value is already written by
`previouslySuggestedExpressions`, so it should be cleared in setUp
2016-10-04 14:16:12 +03:00
Alexander Udalov
df680305ba Improve diagnostic message for UNSUPPORTED_FEATURE
Render lowercase words separated by spaces instead of CamelCase in the
diagnostic message
2016-10-04 10:24:43 +03:00
Alexander Udalov
73652f309f Do not create synthesized equals/hashCode/toString in data classes in compatibility mode
To simplify migration from 1.0 to 1.1, do not allow data classes to
automatically implement abstract equals/hashCode/toString declared in
super-interfaces (KT-11306) if "-language-version 1.0" is specified
2016-10-04 10:24:41 +03:00
Alexander Udalov
597912824b Report error on declaring 'getClass' in class or package
#KT-14147 Fixed
2016-10-04 10:24:01 +03:00
Valentin Kipyatkov
dca094e971 Refactoring + preserving formatting in some more places where it was missing 2016-10-03 23:23:14 +03:00
Valentin Kipyatkov
5a6f068130 Some formatting preserving for special methods too 2016-10-03 23:23:14 +03:00
Valentin Kipyatkov
f4d9909f6f Code refactoring 2016-10-03 23:23:13 +03:00
Valentin Kipyatkov
badbcd4989 KT-13628 New line is not preserved when converting java to Kotlin
#KT-13628 Fixed
2016-10-03 23:23:13 +03:00
Alexander Udalov
8fe57c8e84 Minor, fix apostrophes in diagnostic message 2016-10-03 21:52:18 +03:00
Alexander Udalov
c1f55e8018 Make scope of incremental package fragment empty
It's only needed to create IncrementalMultifileClassPackageFragment instances
now
2016-10-03 21:52:10 +03:00
Ilya Gorbunov
adf2c5a5ac Classify explicitly imported names higher than default imported in completion. Related to #KT-13447 2016-10-03 20:46:46 +03:00
Ilya Gorbunov
1af3b50e3d Remove obsolete testData (Filter.kt — didn't run even once). 2016-10-03 17:25:26 +03:00
Ilya Gorbunov
2aa60adbca Remove 'import java.util' from js tests. 2016-10-03 17:25:26 +03:00
Michael Bogdanov
1eac6d47ed GenerationState in TypeMapper replaced with boolean flag 2016-10-03 14:13:17 +03:00
Michael Bogdanov
95a1c254e1 Added error diagnostic on inheriting target 6 interface 2016-10-03 14:13:17 +03:00
Michael Bogdanov
7a5c211e8b Throw jvm-specific error on file compilation 2016-10-03 14:06:02 +03:00
Michael Bogdanov
d9bb519b76 Don't generate delegation to jvm8 default methods 2016-10-03 14:06:01 +03:00
Michael Bogdanov
c19e035f91 Properly map super calls in typeMapper 2016-10-03 14:06:00 +03:00
Michael Bogdanov
5f1f4a067d Map proper owner for method with default args 2016-10-03 14:06:00 +03:00
Michael Bogdanov
0390cd6ee1 Added GenerationState to KotlinTypeMapper 2016-10-03 14:05:59 +03:00
Michael Bogdanov
dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +03:00
Michael Bogdanov
ca41f01468 Generate interface property annotations in interface class (not in DefaultImpls) 2016-10-03 13:50:12 +03:00
Michael Bogdanov
dfd5be1a33 Generate all bodies in interfaces as default methods 2016-10-03 13:50:11 +03:00
Michael Bogdanov
fb48f70273 Move 'generateMethod' to 'codegenUtil.kt' file 2016-10-03 13:47:09 +03:00
Dmitry Petrov
06101dba52 KT-13961 REDECLARATION not reported on private-in-file 'foo' vs public 'foo' in different file
Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.

Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).

Refactor redeclarations / conflicting overloads reporting.
2016-10-03 11:50:29 +03:00
Denis Zharkov
0120085443 Refine expression kind definition in postfix templates
- Do not treat if without else as values
- Some statements aren't contained in block (see tests)

 #KT-14107 Fixed
 #KT-14110 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
3c24996073 Refine default postfix templates selector
There is new settings checkCanBeUsedAsValue
Also expression filtering are split into to parts:
- getNonFilteredExpressions is trivially goes until it reaches
first block body of some declarations
- all additional filtering is merged into Condition that is passed into
PostfixTemplateExpressionSelectorBase super-call

Notable changes for users:
- do not suggest try for non-top-level expressions
- do not suggest var/par/etc for loops
2016-10-03 10:36:48 +03:00
Denis Zharkov
ba2d2a036e Suggest postfix templates on lambda expressions 2016-10-03 10:36:48 +03:00
Denis Zharkov
54d9b4bee6 Do not suggest assignment as a subject in postfix templates
#KT-14077 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
18146fafdf Allow if/when/try postfix templates in expression position
#KT-14078 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
bff9dd4ef5 Suggest assert/return postfix templates only for statements
#KT-14079 Fixed
 #KT-14090 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
ce128c5d6e Do not suggest operation references in postfix templates
#KT-14087 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
d5d18b2ad6 Enhance tests for postfix templates
Prohibit multiple suggested expressions in test mode
2016-10-03 10:36:48 +03:00
Alexander Udalov
4025bcb6e3 Use separate module mode for single-module diagnostic tests
More than 95% of diagnostic tests are single-module, and they'll use the same
two-module scheme that the normal compilation uses
2016-10-02 21:16:11 +03:00
Alexander Udalov
45190d9453 Support separate modules in compiler
Unless the compatibility option "-Xsingle-module" is passed, the compiler will
create two modules instead of one now (see TopDownAnalyzerFacadeForJVM): the
main module contains Kotlin and Java sources and binaries from the previous
compilation of the given module chunk, the dependency module contains all other
Kotlin and Java binaries. This fixes some issues where the compiler couldn't
detect that the used symbol was from another module, and did not forbid some
usages which are only possible inside the module (see KT-10001).

The ideal way to deal with modules here would be to exactly recreate the
project structure, for example as it's done in JvmAnalyzerFacade and usages.
This is postponed until later

 #KT-10001 Fixed
 #KT-11840 In Progress
2016-10-02 21:15:47 +03:00
Alexander Udalov
9d778711d2 Support rendering contents of different modules in load* tests
This is needed because otherwise with separate modules turned on in the
compiler, these tests do not display the contents of classes from the
dependency module in the rendered output
2016-10-02 21:03:38 +03:00
Alexander Udalov
3314725700 Pass GlobalSearchScope instance to JvmPackagePartProvider
Currently behavior is unchanged because the "all project" scope is passed,
however in the future this will allow to implement separate modules in the
compiler properly
2016-10-02 21:03:37 +03:00
Alexander Udalov
54dfe760c0 J2K JvmResolveUtil & GenerationUtils: convert & prettify 2016-10-02 21:03:36 +03:00
Alexander Udalov
12205016bc J2K JvmResolveUtil & GenerationUtils: rename .java -> .kt 2016-10-02 21:03:36 +03:00
Alexander Udalov
214abea4d6 Minor, introduce DeclarationProviderFactory.EMPTY 2016-10-02 21:03:35 +03:00
Alexander Udalov
0ed9897b03 Minor refactorings related to PackagePartProvider and implementations
- Document what exactly should findPackageParts return
- Make EMPTY a named object instead of a val in the companion
- Do not use JvmPackagePartProvider in tests where Empty works fine
- Add a couple default values to arguments of setupResolverForProject
2016-10-02 21:03:34 +03:00
Alexander Udalov
97f2051a03 Add debugName to ModuleMapping 2016-10-02 21:03:33 +03:00
Alexander Udalov
74ad6b1410 Drop obsolete logic related to obsolete package parts
Filtering out obsolete package parts in incremental compilation was necessary
before the big refactoring of package parts, when package parts had been
compiled together into a package class
2016-10-02 21:03:31 +03:00
Alexander Udalov
610c549225 Filter out equivalent calls before reporting "none applicable"
If a module is configured in such a way that the same function appears multiple
times via different dependencies, it's not helpful to report "none of the
following functions can be called", listing the same function multiple times
2016-10-02 21:03:30 +03:00
Alexander Udalov
5d37fab4f5 Minor, add toString for debug 2016-10-02 21:03:29 +03:00
Alexander Udalov
74d6ef73d4 Prevent double initialization in codegen tests, fix ScriptGenTest#testDependentScripts
Add an assertion to prevent duplicate initialization of CodegenTestFiles
instance in CodegenTestCase, which was happening in ScriptGenTest with multiple
invocation of loadFile()
2016-10-02 21:03:28 +03:00
Alexander Udalov
9fb9c12f5e Inline LazyTopDownAnalyzerForTopLevel#analyzeFiles
To make module initialization more explicit and configurable (especially in
TopDownAnalyzerFacadeForJVM)
2016-10-02 21:03:27 +03:00
Alexander Udalov
a5a874f23f Move module creation into TopDownAnalyzerFacadeForJVM#analyzeFilesWithJavaIntegration
The only place where the logic has changed is in AbstractDiagnosticsTest, where
modules are already created and sealed before the analysis. Copy-paste the
container creation logic there (it's almost fine because it's also present in a
bunch of other tests), and simplify it: get rid of incremental compilation and
other stuff irrelevant for diagnostic tests.

This is needed to make analyzeFilesWithJavaIntegration configure the module
properly before sealing it
2016-10-02 21:03:27 +03:00
Alexander Udalov
596fdab2f2 Extract container for single-module top-down analysis 2016-10-02 21:03:26 +03:00
Alexander Udalov
2699356ce3 Simplify JavaClassFinderPostConstruct, inline javaAnalysisInit 2016-10-02 21:03:25 +03:00
Alexander Udalov
278941a8a1 Deduplicate code in container creation for JVM analysis 2016-10-02 21:03:24 +03:00
Alexander Udalov
0250ea861c Simplify return types of createContainer* functions 2016-10-02 21:03:23 +03:00
Alexander Udalov
9cfe0be98e Prettify TopDownAnalyzerFacadeFor{JVM,JS} 2016-10-02 21:03:22 +03:00
Alexander Udalov
4467e127f0 J2K TopDownAnalyzerFacadeFor{JVM,JS}: convert to Kotlin 2016-10-02 21:03:21 +03:00
Alexander Udalov
b34150e1ce J2K TopDownAnalyzerFacadeFor{JVM,JS}: rename files 2016-10-02 21:03:21 +03:00
Alexander Udalov
be5e0f4275 Minor, improve exception when getting missing component from container 2016-10-02 21:03:20 +03:00
Alexander Udalov
87fe6c41df Drop ExternalDeclarationsProvider
It was added for Android extensions, but now another mechanism is used there
(PackageFragmentProviderExtension), and there were no other implementations of
ExternalDeclarationsProvider in the project
2016-10-02 21:03:19 +03:00
Alexander Udalov
1d6abc32bc Minor, delete ModuleContext#builtIns 2016-10-02 21:03:18 +03:00
Ilya Gorbunov
0180c614c0 Add parent pom reference to idl2k module.
Tie kotlin-version of dependencies to the version of parent project being built.
2016-10-01 01:19:15 +03:00
Valentin Kipyatkov
a55273646a Fixed check for convention operator 2016-09-30 21:37:48 +03:00
Valentin Kipyatkov
57faa5a39a Term changes 2016-09-30 21:37:48 +03:00
Valentin Kipyatkov
769943061e Changed String to Name 2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
17adee68cd Fixed optimize imports for operators 2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
95a3a29382 Optimize imports to prevent accedential changes in resolve because of import priorities
#KT-11640 Fixed
2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
7628fa1608 Checked that KT-13766 Fixed by some changes in resolve
#KT-13766 Fixed
2016-09-30 21:37:46 +03:00
Valentin Kipyatkov
f4c65da8f1 Minor 2016-09-30 21:37:46 +03:00
Zalim Bashorov
a07e80f5d9 Make IDEA run configuration compatible with IDEA 2016.3; minor auto changes in run configurations. 2016-09-30 17:58:30 +03:00
Mikhail Glukhikh
ee5202f2ea Minor refactoring: convert secondary constructor to primary
(cherry picked from commit 47446b7)
2016-09-30 16:40:19 +03:00
Mikhail Glukhikh
e417a85276 Minor: secondary constructor to primary is suggested only on keyword and value parameter list
(cherry picked from commit 9a3e6d3)
2016-09-30 16:40:08 +03:00
Mikhail Glukhikh
0a4542c6c0 KT-9839 related, secondary constructor to primary: inspection for the single constructor
(cherry picked from commit aec0090)
2016-09-30 16:39:58 +03:00
Mikhail Glukhikh
3508bea391 KT-9839 related, primary constructor to secondary: comment restoration
(cherry picked from commit 48a1853)
2016-09-30 16:39:46 +03:00
Mikhail Glukhikh
d1958be2a8 KT-9839 related, secondary constructor to primary: comment restoration
(cherry picked from commit 998e39e)
2016-09-30 16:39:36 +03:00
Mikhail Glukhikh
725df49c8c KT-9839: intention introduced: convert secondary constructor to primary one #KT-9839 Fixed
(cherry picked from commit f3fa779)
2016-09-30 16:39:24 +03:00
Mikhail Glukhikh
28b70faa99 KT-9839: convert primary constructor to secondary one: leave independent properties in class body as is
(cherry picked from commit b90414a)
2016-09-30 16:39:13 +03:00
Mikhail Glukhikh
7f50e6e70e KT-9839: intention introduced: convert primary constructor to secondary one
(cherry picked from commit 93aaa48)
2016-09-30 16:39:01 +03:00
Denis Zharkov
d4418d5686 Prohibit not-Unit suspend functions
#KT-13560 Fixed
2016-09-30 12:25:59 +03:00
Denis Zharkov
96186c6217 Prohibit star-projections in last parameter of suspend functions 2016-09-30 12:25:59 +03:00
Alexey Andreev
ea18ea0b8c KT-13825: write simple name of class to constructor.$metadata$.simpleName. 2016-09-30 12:00:49 +03:00
Dmitry Petrov
bd95d2ef4c KT-14071 Type alias cannot be used as a qualifier for super
Use corresponding class for type alias in super qualifier resolution.
2016-09-30 10:17:30 +03:00
Vsevolod
ff7c7538d4 KT-13931 generate IntRange#contains with awareness of inverse in operator 2016-09-29 17:56:18 +03:00
Vsevolod
1ac07340c9 KT-13931 generate IntRange#contains with respect to side-effects on argument loading, test added 2016-09-29 17:56:18 +03:00
Vsevolod
1f9b148a5d KT-13931 more compact inIntRange bytecode generation 2016-09-29 17:56:18 +03:00
Mikhail Glukhikh
f95dcad179 CFA minor: retain initialization state while analyzing variable declaration
(cherry picked from commit c89f4db)
2016-09-29 15:57:01 +03:00
Mikhail Glukhikh
436b0ec873 CFA merge for definition / initialization : more accurate handling of unknown variables #KT-13969 Fixed
(cherry picked from commit 4a96589)
2016-09-29 15:56:47 +03:00
Zalim Bashorov
797f7ab28e JPS: don't consider that the module is not Kotlin JS until check all libraries.
#KT-14082 Fixed
2016-09-29 14:52:51 +03:00
Alexey Andreev
9797a1c35c JS: move RTTI tests to proper location 2016-09-29 12:00:46 +03:00
Alexey Andreev
c1e13cc788 JS: describe how to run tests in node.js 2016-09-29 12:00:45 +03:00
Alexey Andreev
0c3c2af76d JS: fix remaining tests. Suppress extensionFromTopLevelUnitOneStringArg.kt, use another approach to check whether object's property accessed via this 2016-09-29 12:00:45 +03:00
Alexey Andreev
44f7a94380 JS: fix bugs in test environment for mocha.js 2016-09-29 12:00:45 +03:00
Alexey Andreev
aa1a0307a6 JS: make most of box tests running in mocha.js 2016-09-29 12:00:44 +03:00
Alexey Andreev
9da1a50cae JS: move more test to box tests 2016-09-29 12:00:44 +03:00
Alexey Andreev
34bf3e6e56 JS: move more test to box tests 2016-09-29 12:00:43 +03:00
Alexey Andreev
3801052460 JS: move more test to box tests 2016-09-29 12:00:43 +03:00
Alexey Andreev
7e2d5b04de JS: move more test to box tests 2016-09-29 12:00:42 +03:00
Alexey Andreev
9bf124af3f JS: move more test to box tests 2016-09-29 12:00:42 +03:00
Alexey Andreev
a18f5eca2d JS: move more test to box tests 2016-09-29 12:00:41 +03:00
Alexey Andreev
cdf2212c73 JS: move more test to box tests 2016-09-29 12:00:41 +03:00
Alexey Andreev
efb82a044f JS: move inline test to box tests 2016-09-29 12:00:40 +03:00
Alexey Andreev
b159049be8 JS: move expressions test to box tests 2016-09-29 12:00:40 +03:00
Alexey Andreev
2bf0199959 JS: create new common directory for all generated tests, migrate several tests there 2016-09-29 12:00:39 +03:00
Alexey Andreev
34a57f863b JS: refactor test classes 2016-09-29 12:00:39 +03:00
Alexey Andreev
db86d34699 JS: move InlineMultiModuleTestGenerated under new test class 2016-09-29 12:00:38 +03:00
Alexey Andreev
dc0d7114be JS: introduce a new base class for generated tests 2016-09-29 12:00:38 +03:00
Ilya Gorbunov
282629f618 Remove overrides of equals and hashCode from AbstractCollection and AbstractMap.values, making the equality referential again. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
976260bda6 Fix state check in ListIterator.set, improve diagnostics. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
8627547a63 Provide java.util.AbstractCollection and AbstractList as deprecated classes with implemented abstract methods rather than as typealiases to smooth migration.
This comes at price that `ArrayList is java.util.AbstractColleciton` is false.
2016-09-28 22:06:03 +03:00
Ilya Gorbunov
ec6dbe7441 JS: use read-only AbstractList as a base class for read-only collection implementations. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
7dde8df9ae Make mutation methods in AbstractMutable-collections abstract rather than implement them unsupported. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
74e964aabe Rename files to match class names. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
f88a009653 Do not recreate entries, keys and values collections on each access to property. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
c6654fc9d8 Remove unused/redundant implementation details. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
38f030dce4 Split AbstractMap into readonly and mutable. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
a5c0f11d60 Split AbstractCollection, List, Set in JS to readonly Abstract[Collection] and mutable AbstractMutable[Collection].
Update compatibility type aliases.
2016-09-28 22:06:03 +03:00
Ilya Gorbunov
2bb1d6d5b4 Provide implementation of read-only AbstractCollection, AbstractList and AbstractSet,
Alias AbstactMutableCollection to java.util.AbstractCollection.
Change inheritance hierarchy of reversed list views.
2016-09-28 22:06:03 +03:00
Dmitry Jemerov
53cd079333 download each IDEA version into separate directory 2016-09-28 14:42:38 +02:00
Simon Ogorodnik
18feb8f622 Return Kotlin fields and methods through KotlinShortNameCache
#KT-12205 Fixed
2016-09-28 13:36:20 +02:00
Simon Ogorodnik
b06bdcef75 Now possible to use // WITH_RUNTIME in multi file tests 2016-09-28 13:36:07 +02:00
Denis Zharkov
da2ebb1394 Revert erroneously applied changes in ChangeLog.md 2016-09-28 14:26:31 +03:00
Denis Zharkov
d5fd62fb40 Update 1.1-M02 section in ChangeLog.md 2016-09-28 14:20:29 +03:00
Dmitry Jemerov
a1acd04365 access archive.apache.org via plain HTTP 2016-09-28 10:52:42 +02:00
Denis Zharkov
bb1b8cca20 Fix AssertionError in CodegenUtil.getDelegates
Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
2016-09-28 11:40:35 +03:00
Denis Zharkov
49fee026fc Minor. Simplify CodegenUtil.getDelegates 2016-09-28 11:40:20 +03:00
Denis Zharkov
567b0cc8ea Add a couple of covariant necessary overrides
They become unavoidable after checking override conflicts
for delegation members
2016-09-28 11:40:20 +03:00
Denis Zharkov
c884cffeea Prohibit return type mismatch for delegation members
#KT-13952 Fixed
 #KT-13005 Fixed
2016-09-28 11:40:20 +03:00
Denis Zharkov
ddb7a6aa13 Minor. Extract subinterface for specific strategy
It contains only methods related to explicitly declared overrides
2016-09-28 11:40:20 +03:00
Dmitry Jemerov
0daa2d872a go back to archive.apache.org for Ant downloads 2016-09-28 10:30:56 +02:00
Alexey Sedunov
956c6eeec7 Push Down: Support moving members from Java to Kotlin class
#KT-9485 Fixed
2016-09-27 21:26:31 +03:00
Alexey Sedunov
924bb44862 Pull Up/Push Down/Extract Super: Support references to Java-declared superinterfaces 2016-09-27 21:26:30 +03:00
Alexey Sedunov
22271f0af0 Pull Up/Push Down/Extract Super: Show member dependencies in the refactoring dialog 2016-09-27 21:26:29 +03:00
Alexey Sedunov
8a5628cde5 Pull Up/Extract Super: Support members declared in the companion object of the original class 2016-09-27 21:26:28 +03:00
Alexey Sedunov
982d4d4ead Pull Up/Extract Super: Support properties declared in the primary constructor 2016-09-27 21:26:27 +03:00
shiraji
3aedf0d79f Add intention to replace Math.max/min with coerceAtLeast/coerceAtMost #KT-13945 Fixed 2016-09-27 20:05:11 +03:00
Mikhail Glukhikh
4522d2c7da Remove unnecessary lateinit intention / inspection removed (supported in compiler CFA instead)
(cherry picked from commit e17f222)
2016-09-27 18:49:51 +03:00
Mikhail Glukhikh
67cc83af05 Quick-fix for UNNECESSARY_LATEINIT
(cherry picked from commit 77f7bb0)
2016-09-27 18:49:13 +03:00
Mikhail Glukhikh
025d063b27 UNNECESSARY_LATEINIT: do not report if property is not initialized at use-site #KT-13806 Fixed
(cherry picked from commit 09c0865)
2016-09-27 18:49:02 +03:00
Mikhail Glukhikh
4da9a101cf UNNECESSARY_LATEINIT warning introduced #KT-13295 Fixed
(cherry picked from commit 88f9938)
2016-09-27 18:48:50 +03:00
Valentin Kipyatkov
b0ed6adce3 Fixed wrong test 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
6baf633a8d Fixed bug found because of incorrect test fixed 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
21c2268f70 Protection against "<caret>" missing in test data
Many incorrect tests fixed
2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
be8b31e82b Removed redundant and confusing .after files in negative tests 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
038068aa44 KT-13953 Import member popup should not suggest methods when only property or variable is valid
#KT-13953 Fixed
2016-09-27 18:05:25 +03:00
Dmitry Jemerov
e30c211b3e use plain HTTP for downloading AntForKotlin 2016-09-27 16:17:21 +02:00
Alexey Sedunov
d6b14ce480 Minor: Fix changelog 2016-09-27 13:27:57 +03:00
Alexey Sedunov
ca482c32c6 Introduce Variable: Fix exception on trying to extract variable of functional type
#KT-14004 Fixed
2016-09-27 13:27:56 +03:00
Alexey Sedunov
06936328ab Remove Redundant Receiver Parameter: Do not run refactoring inside write action
#KT-13878 Fixed
2016-09-27 13:27:55 +03:00
Alexey Sedunov
698660b9c6 Find Usages: Add special type for usages inside of type aliases
#KT-13955 Fixed
2016-09-27 13:27:54 +03:00
Alexey Sedunov
3adbe5515e Minor: Get rid of deprecated (as of IDEA 2016.2) method calls 2016-09-27 13:27:53 +03:00
Pavel V. Talanov
b275dacad8 Light classes: getOwnInnerClasses() filters out inner classes with null names
#KT-13927 Fixed
2016-09-26 19:51:57 +03:00
Pavel V. Talanov
827b56e277 Navigation to binaries: support navigation to type alias constructors
#KT-13479 Fixed
2016-09-26 18:34:19 +03:00
Pavel V. Talanov
24d805d2c1 Minor: remove code commited by mistake 2016-09-26 14:46:39 +03:00
Pavel V. Talanov
32daf048c2 PlatformConfigurator: create container for each platform (it contains static services, mostly checkers) ahead of time 2016-09-26 14:42:57 +03:00
Pavel V. Talanov
be00a6ec49 StorageComponentContainer: allow to specify parent container which can be reused to provide components to several child containers 2016-09-26 14:35:37 +03:00
Simon Ogorodnik
47bfb8133d KT-13146 J2K recursion while converting self-referenced anonymous functions (#956) 2016-09-26 13:47:31 +03:00
Alexander Udalov
33d33ab144 Exclude additional tests from Android codegen test runner 2016-09-24 11:31:59 +03:00
Alexander Udalov
9bc6d6ae92 Remove recursion workaround from DeprecatedClassifierUsageChecker 2016-09-24 11:26:57 +03:00
Alexander Udalov
dca99c3fd2 Move ClassifierUsageChecker invocation lower in LazyTopDownAnalyzer
Invoking checkers right after resolution of qualified expressions is too early:
DeprecatedClassifierUsageChecker tries to load the annotations of a referenced
classifier to report deprecation, and that may result in building light classes
for not yet analyzed declarations

 #KT-13954 Fixed
2016-09-24 11:26:56 +03:00
Ilya Gorbunov
35839695f7 Fix decompiled text consistency test to handle type aliases in JS.
by Alexey Andreev <Alexey.Andreev@jetbrains.com>
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
c508f75de4 Test data: change fully qualified type so that it's available as type (and not an alias) in both jvm and js runtimes to have the same output. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
ed70d1dfa6 Provide type aliases for collections in java.util to ease migration. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
b741c82a66 Fix completion tests after moving collection types in JS 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
bf56f04368 Simplify Kotlin.collectionsSort as it always being provided with MutableList. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
889040218b Rewrite ChainEntry not to be inner class. Cleanup unused code. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
54a640d733 Cleanup: remove unused code from HashMap, remove commented out specialization intrinsics. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d0b7ddfceb Minor cleanup, rename parameters to match supertype names. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
1ea02198e0 Add tests to ensure #KT-10786 Fixed and #KT-8724 Fixed 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
26cbad8e7f Provide message for UnsupportedOperationException thrown from AbstractCollection.add. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
23d2654afd Refactor Map-InternalMap to provide specialized linked string map and set 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
e342593d2e Flatten HashMap hierarhy, provide string-keyed map and set specializations. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
5833d32f25 Import StringMap from GWT 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d1a24de278 Consequences of map/set specializations removal:
- NaNs are no longer usable as keys in maps or elements in sets.
- Chars are stored as their underlying type string, and Longs are stored as objects.
Opened #KT-13610
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
ea82c20692 Remove js implementations of java.util maps and sets, disable intrinsic to select specialized implementations.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
5cd3417d4c Maps and sets: cleanup, simplify, refactor.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
b05c2c1f6a Import AbstractHashMap, HashMap, HashSet, LinkedHashMap, LinkedHashSet from GWT
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
f5e0c504d6 AbstractMap: cleanup and refactor
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
c54bc2ea18 Import AbstractMap implementation from GWT.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d900efb34e AbstractSet implementation.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
828e7f8744 Add tests to ensure #KT-7473 and #KT-13459 and #KT-13429 are Fixed. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
89388f1f83 Fixes in ArrayList after review.
Provide better implementations for some methods of AbstractList.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
472ef89baf AbstractList: cleanup and rename
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
75069143c7 Rewrite ArrayList, AbstractList, AbstractCollection in kotlin.
AbstractList is imported from GWT.
#KT-12386
2016-09-24 07:08:21 +03:00
Nikolay Krasko
0abf94c2f4 Allow to avoid rebuilding application in debugger tests on local machine
(cherry picked from commit 8b899a7)
2016-09-24 01:44:40 +03:00
Nikolay Krasko
520e187e46 Clean application after test in compiler tests
It's disposed after Disposer.dispose(myTestRootDisposable) in tearDown and mixing compiler tests
with non-compiler tests may ruin classes initialization with

"com.intellij.util.IncorrectOperationException: Sorry but parent: com.intellij.mock.MockApplicationEx@52439591 has already been disposed"

(cherry picked from commit f3badb6)
2016-09-24 01:44:38 +03:00
Alexey Tsvetkov
1c0be7f0ba Update changelog for 1.0.4 2016-09-23 20:55:49 +03:00
Denis Zharkov
217f033552 Prevent generation of delegations to interfaces private methods
#KT-13381 Fixed
 #KT-13996 Fixed
2016-09-23 14:51:14 +03:00
gitreelike
06c804787f Implement quick fix to convert a too long char literal to a string #KT-13635 Fixed 2016-09-23 13:04:41 +03:00
shiraji
391a0fdde5 Add "Copy concatenation text to clipboard" intention #KT-13744 Fixed 2016-09-23 12:46:22 +03:00
Valentin Kipyatkov
023c02deb3 Corrections on code review 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
e4f80e277f Better texts of change variable type quickfixes 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
80d82d2dee Made AddToStringFix low priority 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
7625672914 Better test data 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
dab6f7d13d Better texts for quickfixes to change return type 2016-09-23 10:07:14 +03:00
Ilya Gorbunov
8d67a65ed9 Build stdlib docs 3 times: one for each JDK 2016-09-22 22:32:02 +03:00
Ilya Gorbunov
47be8e664a Minor: replace var with val. 2016-09-22 22:28:14 +03:00
Ilya Gorbunov
2c0edf6652 Fix working directory where CompilerSmokeTest runs to be 'project.build.directory', otherwise it may vary depending on maven goals invoked. 2016-09-22 21:59:10 +03:00
Ilya Gorbunov
f60447328d Remove snapshot repository from idl2k module. 2016-09-22 21:52:33 +03:00
Ilya Gorbunov
0cd0f3caa0 Reorder maven project modules to run more tests earlier in build. 2016-09-22 21:52:33 +03:00
Alexey Tsvetkov
fc6773a416 Print gradle output only if test is failed 2016-09-22 20:43:01 +03:00
Alexey Sedunov
b412edf2a3 Extract Class: Implement 'Extract Interface' refactoring
#KT-11017 Fixed
2016-09-22 20:11:31 +03:00
Alexey Sedunov
af2de09840 Extract Class: Implement 'Extract Superclass' refactoring
#KT-11017 In Progress
2016-09-22 20:11:30 +03:00
Pavel V. Talanov
8f5725345f ModuleDescriptor: invert "friends" relation
Fixes memory leak caused by modules storing their friends (which can be potentially recreated many times)
2016-09-22 18:20:43 +03:00
Denis Zharkov
23c0bdbd05 Add filtering of suggested expressions for postfix templates
Do not suggest qualified expression's selector or a part of user type
because they aren't really independent expressions
2016-09-22 18:11:22 +03:00
Simon Ogorodnik
ab2b6743df KT-11990 J2K native to external conversion (#957) 2016-09-22 18:09:26 +03:00
Nikolay Krasko
293d3b4320 Remove toString() test for StorageManager
Storing place of creating was removed in cb32bc97dd
2016-09-22 16:28:46 +03:00
Denis Zharkov
5381c06936 Improve 1.0-compatibility mode for JDK dependent members
Just reporting error by call checker may be too restrictive
in case there are some extensions that can be used successfully

Solution is to annotate additional members with
@Deprecated(level=Error) + @kotlin.internal.LowPriorityInOverloadResolution
2016-09-22 15:40:37 +03:00
Denis Zharkov
a7dedfab70 Move JvmBuiltIns initialization after container setup
It will be used in the further commits to initilize built-ins instance
with components as arguments
2016-09-22 15:40:37 +03:00
Nikolay Krasko
63943c60d3 Patch ThreadTracker during Kotlin plugin init 2016-09-22 15:19:18 +03:00
Mikhail Glukhikh
68f0953b02 Random-order variable sets are no more in use in CFG #KT-13990 Fixed
(cherry picked from commit fc89385)
2016-09-22 13:32:01 +03:00
Alexander Udalov
b3803d6fe7 Exclude some codegen tests on Android
These tests rely on the fact that sources are located in the default package,
whereas Android tests alter the package name of each test
2016-09-22 13:03:26 +03:00
Dmitry Petrov
07198cf86d SAM constructors for type aliases. 2016-09-22 10:38:34 +03:00
Denis Zharkov
6663054f4d Fix false positive "Cannot capture" error reporting
There is no need to report an error in case of non-top-level
capture conversion, just don't add relevant capture type in the system instead

If system can be solved successfully without captured type, then it's just fine
(see KT-13950)
In case of contradiction TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR is reported

 #KT-13950 Fixed
2016-09-21 18:05:26 +03:00
Denis Zharkov
4431c6ad02 Fix inference when captured type is used as a lambda parameter type
Use lower approximation bound to obtain acceptable types for lambda parameters
those types depend on captured type

 #KT-12238 Fixed
 #KT-10627 Fixed
2016-09-21 18:05:26 +03:00
Nikolay Krasko
cb32bc97dd Remove logging in LockBasedStorageManager creation as it all the same useless
HEAD - 3 leads to "org.jetbrains.kotlin.storage.LockBasedStorageManager.createWithExceptionHandling(LockBasedStorageManager.java:65)" debug string
2016-09-21 15:54:42 +03:00
Nikolay Krasko
b7b6d319f1 Remove another place with mentioning bare plugin 2016-09-21 15:54:40 +03:00
Nikolay Krasko
37fb8d6306 Fix tests for looking implementations from Java - no search for Kotlin declaration from usages
Probably because of this commit: 7d95ff4d86
2016-09-21 15:52:16 +03:00
Alexander Udalov
621c6691d0 Support equals, hashCode, toString for annotations instantiated with reflection
#KT-13106 Fixed
2016-09-20 21:36:30 +03:00
Alexander Udalov
525937252d Support Java annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:30 +03:00
Alexander Udalov
aeba124bdb Support Kotlin annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:29 +03:00
Alexander Udalov
fb18e4bf4c Sort parameters of Java annotation constructors by name for stability 2016-09-20 21:36:29 +03:00
Alexey Sedunov
d6daaf0a85 Redundant 'toString()' in String Template: Disable for qualified expressions with 'super' receiver
#KT-13942 Fixed
2016-09-20 20:36:03 +03:00
Alexey Sedunov
85c45cf2fa Move Files/Directories: Fix behavior of "Open moved files in editor" checkbox
#KT-13909 Fixed
2016-09-20 20:36:02 +03:00
Alexey Sedunov
ad8b534e9c Move Nested Class to Upper Level: Preserve state of "Search in comments"/"Search for text occurrences" checkboxes
#KT-13904 Fixed
2016-09-20 20:36:01 +03:00
Alexey Sedunov
79f50975b1 Convert Parameter to Receiver: Do not qualify companion members with labeled 'this'
#KT-13933 Fixed
2016-09-20 20:36:00 +03:00
Alexey Sedunov
75481c34b4 Move to Companion Object: Warn if companion object already contains function with the same signature
#KT-13877 Fixed
2016-09-20 20:35:59 +03:00
Alexey Sedunov
72ff5dd2cc Move to Companion Object: Forbid for functions/properties referencing type parameters of the containing class
#KT-13876 Fixed
2016-09-20 20:35:58 +03:00
Alexey Sedunov
4cd4b8781d Move: Do not ignore target directory selected in the dialog (DnD mode)
#KT-13901 Fixed
2016-09-20 20:35:57 +03:00
Alexey Sedunov
65a1ecc464 Move Nested Class to Upper Level: Do not show directory selection dialog twice
#KT-13906 Fixed
2016-09-20 20:35:56 +03:00
Alexey Sedunov
6366383b31 Minor: Add test for KT-13916 2016-09-20 20:35:56 +03:00
Alexey Sedunov
951dc6a438 Move: Remove companion object which becomes empty after the move
#KT-13903 Fixed
2016-09-20 20:35:55 +03:00
Alexey Sedunov
11a7a242c8 Move to Companion Object: Fix exception when applied to class
#KT-13883 Fixed
2016-09-20 20:35:54 +03:00
Alexey Sedunov
64e5baade3 Move to Companion: Fix AssertionError on running refactoring from Conflicts View
#KT-13874 Fixed
2016-09-20 20:35:53 +03:00
Alexey Sedunov
6e8bcb987a Minor: Add tests for KT-13759 2016-09-20 20:35:52 +03:00
Alexey Sedunov
4313f249a4 Presentation: Add file name to the presentation of private top-level declaration
#KT-13838 Fixed
2016-09-20 20:35:51 +03:00
Nikolay Krasko
4adfb18990 Solve thread leaking problem in intellij idea ultimate with obfuscated fileds 2016-09-20 19:31:10 +03:00
Pavel V. Talanov
92b62f879b JavaClassImpl: add assertion on querying members of light classes
Hopefully this assertion happens before deadlock KT-12966
2016-09-20 19:09:05 +03:00
Pavel V. Talanov
631603c015 J2K JavaClassImpl: rename file 2016-09-20 19:09:04 +03:00
Pavel V. Talanov
724b0322c0 J2K JavaClassImpl: convert code 2016-09-20 19:09:03 +03:00
Mikhail Zarechenskiy
46ef1920d6 Update API listing after changes in runtime.jvm 2016-09-20 18:44:39 +03:00
Ilya Gorbunov
71af020beb Use explicit public visibility in kotlin-runtime. 2016-09-20 17:38:51 +03:00
Mikhail Zarechenskiy
2fc8f5d5e2 Move util function closer to its usage and remove empty file 2016-09-20 16:23:43 +03:00
Mikhail Zarechenskiy
8a0107ea5f Move property with template to script definition interface 2016-09-20 16:23:42 +03:00
Mikhail Zarechenskiy
7739677a06 Adapt ScriptCodegenTests to last changes
Get rid of possibility to configure script definition without template
class, therefore all tests now are using default script argument
2016-09-20 16:23:41 +03:00
Mikhail Zarechenskiy
f8774be8c3 Adapt ScriptGenTest to last changes
- Use script definitions created by script templates
 - Configure classpath before files were loaded
2016-09-20 16:23:40 +03:00
Mikhail Zarechenskiy
aa1368f4f3 J2K ScriptGenTest: convert and prettify 2016-09-20 16:23:39 +03:00
Mikhail Zarechenskiy
49e1603470 J2K ScriptGenTest: rename 2016-09-20 16:23:38 +03:00
Mikhail Zarechenskiy
b18cbc37c6 Do not generate properties from script constructor
From now all script parameter properties are generated by template class
2016-09-20 16:22:42 +03:00
Mikhail Zarechenskiy
0ba2d374bc Create standard script definition from standard template
Now each script without specified template has a StandardSriptTemplate
class as a base one. This allows to generalize script codegen and
resolve.
2016-09-20 15:44:44 +03:00
Nikolay Krasko
d69e7c7aec Problem: fix thread leaking check fail on teamcity for ultimate rename tests 2016-09-20 15:27:10 +03:00
Nikolay Krasko
ea1aac07ec Problem: workaround thread leaking problem 2016-09-20 15:27:08 +03:00
Nikolay Krasko
835474e5a1 Register TypeAnnotationModifier EP in environment for web demo converter 2016-09-20 15:27:07 +03:00
Nikolay Krasko
bf12908dfc Ignore irrelevant java classes in search results
It looks like JavaClassInheritorsSearcher started to give classes based on useScope
2016-09-20 15:27:05 +03:00
Nikolay Krasko
6cdb578f76 Fix goto implementation tests - deffered task should be executed 2016-09-20 15:27:04 +03:00
Nikolay Krasko
00db1c1490 Add standard inheritors to hierarchy test 2016-09-20 15:27:02 +03:00
Nikolay Krasko
89a1389512 Make caret left move not-applicable on first function parameter 2016-09-20 15:27:01 +03:00
Nikolay Krasko
5337fd05fb Update to 2016.2.3 2016-09-20 15:26:59 +03:00
Nikolay Krasko
7b19454d58 Don't run applicationEx.invokeAndWait in testing mode 2016-09-20 15:26:57 +03:00
Nikolay Krasko
058dbd3375 Test only: method signature changed 2016-09-20 15:26:56 +03:00
Nikolay Krasko
80bf0b9c3e Update compilation in 2016.2 2016-09-20 15:26:54 +03:00
Nikolay Krasko
4b9b3b07e7 Update to 162.1447.7 2016-09-20 15:26:53 +03:00
Denis Zharkov
329c1a1e72 Use editor instead of file in TypingIndentationTest
Nobody guarantees that changes in editor are saved immediately
2016-09-20 15:26:51 +03:00
Denis Zharkov
10c840327d Temporary move annotation to methods' modifier list
Java resolver ignores return type annotations if there are ones on modifier list

Related to this commit a2497edcee
2016-09-20 15:26:50 +03:00
Denis Zharkov
189705727f Implement a bunch of string based postfix templates
#KT-4710 Fixed
2016-09-20 15:26:48 +03:00
Denis Zharkov
1b391123e6 Implement for/iter postfix templates
#KT-4710 In Progress
2016-09-20 15:26:47 +03:00
Denis Zharkov
b702886f0d Introduce var/val postfix templates
#KT-4710 In Progress
2016-09-20 15:26:45 +03:00
Denis Zharkov
7ba914f92a Minor. Introduce 'isVar' parameter for KotlinIntroduceVariableHandler.doRefactoring 2016-09-20 15:26:44 +03:00
Denis Zharkov
4d28199cc2 Implement if/else/null/notnull/when/try postfix templates
#KT-4710 In Progress
2016-09-20 15:26:42 +03:00
Denis Zharkov
09266b222b Implement 'Surround expression with if' surrounder
#KT-3363 Fixed
2016-09-20 15:26:41 +03:00
Denis Zharkov
f18b9cceb3 Implement 'not' postfix template
#KT-4710 In Progress
2016-09-20 15:26:39 +03:00
Denis Zharkov
1eeec18303 Update IDEA version to 2016.2 2016-09-20 15:26:38 +03:00
Nikolay Krasko
3d0d82b862 Fix tests for move: check applicability from changed text
Presentation status has stopped working after 18ce2c6070
2016-09-20 15:26:36 +03:00
Nikolay Krasko
a471d8907a Register TypeAnnotationModifier as extension point 2016-09-20 15:26:34 +03:00
Nikolay Krasko
99a75021e1 Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly
Without such shutdown console program that gets PSI file will hang forever.

Introduced in 446b80077a

Stack example:

 java.lang.Thread.State: RUNNABLE
	  at com.intellij.util.concurrency.AppDelayQueue.<init>(AppDelayQueue.java:37)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.<init>(AppScheduledExecutorService.java:50)
	  at com.intellij.util.concurrency.AppScheduledExecutorService$Holder.<clinit>(AppScheduledExecutorService.java:41)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.getInstance(AppScheduledExecutorService.java:46)
	  at com.intellij.util.concurrency.AppExecutorUtil.getAppScheduledExecutorService(AppExecutorUtil.java:39)
	  at com.intellij.concurrency.JobScheduler.getScheduler(JobScheduler.java:43)
	  at com.intellij.psi.impl.source.AstPathPsiMap.<clinit>(AstPathPsiMap.java:45)
	  at com.intellij.psi.impl.source.PsiFileImpl.<init>(PsiFileImpl.java:76)
	  at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:39)
	  at org.jetbrains.kotlin.psi.KtFile.<init>(KtFile.java:48)
	  at org.jetbrains.kotlin.parsing.KotlinParserDefinition.createFile(KotlinParserDefinition.kt:73)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:407)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:348)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:326)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:171)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:155)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:121)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:100)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:56)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.doCreateFile(KtPsiFactory.kt:174)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.createFile(KtPsiFactory.kt:178)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processFileSingleEvaluator(Preprocessor.kt:82)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:105)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:135)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processSources(Preprocessor.kt:74)
	  at org.jetbrains.kotlin.preprocessor.PreprocessorCLI.main(PreprocessorCLI.kt:35)
2016-09-20 15:25:37 +03:00
Nikolay Krasko
cf63a77396 Update to idea 162.1024.1 2016-09-20 15:25:07 +03:00
Nikolay Krasko
e2860eb12a Tests only: fix compiler error because of changed nullability 2016-09-20 15:25:06 +03:00
Nikolay Krasko
22f3fe4784 Update to 162.844.8 2016-09-20 15:25:04 +03:00
Nikolay Krasko
dc35524fe1 Tests only: codeCleanup() method signature was changed 2016-09-20 15:25:03 +03:00
Nikolay Krasko
89175a0165 Compile error because of changed nullability 2016-09-20 15:25:01 +03:00
Nikolay Krasko
1a89d138fb API change: parameter became NotNull 2016-09-20 15:25:00 +03:00
Nikolay Krasko
6a11055389 Build against 162.646.4 2016-09-20 15:24:58 +03:00
Nikolay Krasko
ff9f3694f1 Problem: remove static import (temp workaround)
See KT-13954 for details
2016-09-20 15:24:55 +03:00
Nikolay Krasko
d5ae37d33a Problem: remove static import (temp workaround) 2016-09-20 15:10:57 +03:00
Nikolay Krasko
bfef8726bb Mock implementation for ExternalAnnotationsManager and InferredAnnotationsManager services 2016-09-20 15:10:56 +03:00
Nikolay Krasko
dc49f7f21b Update to idea 162 2016-09-20 15:10:54 +03:00
Nikolay Krasko
dba55ec34d More write action requirement remove
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-09-20 15:10:53 +03:00
Nikolay Krasko
7d1a5f1d2b Tests only: add new method in MockPsiManager.java 2016-09-20 15:10:51 +03:00
Nikolay Krasko
b05105e849 Problem: define idea.plugins.compatible.build setting explicitly to avoid exception about bad idea home path 2016-09-20 15:10:49 +03:00
Nikolay Krasko
72c6c66b48 API Change: Implement new method isSuppressAll() 2016-09-20 15:10:48 +03:00
Nikolay Krasko
db20daae88 API Change: remove explicit generic type information 2016-09-20 15:10:46 +03:00
Nikolay Krasko
9674e1a6c7 Tests only: No more WatchMessageNode
55029007ad
2016-09-20 15:10:45 +03:00
Nikolay Krasko
58ff7f53fa Tests only: Debugger test data modification: extra removed 2016-09-20 15:10:43 +03:00
Nikolay Krasko
c7ac8e1650 Tests only: implement new method 2016-09-20 15:10:42 +03:00
Nikolay Krasko
226735ae05 Tests only: Constructor for XWatchesViewImpl was changed
1a8de38449
2016-09-20 15:10:40 +03:00
Nikolay Krasko
99ed926554 Tests only: reparseRange parameters changed
94863a8df4
2016-09-20 15:10:38 +03:00
Nikolay Krasko
bea45ff2e5 registerUnresolvedError is in base class in idea from br146 2016-09-20 15:10:37 +03:00
Nikolay Krasko
06a0ebe352 No jsr166e.jar anymore in br146 2016-09-20 15:10:35 +03:00
Nikolay Krasko
5cecdddcb6 Add run configuration for downloading br146 2016-09-20 15:10:34 +03:00
Dmitry Petrov
bfcf7d9890 DM 19.09.2016: typealiases private in file are resolved as classes.
Add test for typealias private in file.
2016-09-20 14:42:29 +03:00
Denis Zharkov
42e85b07c9 Fix types in local var table for destructured variables 2016-09-20 13:44:44 +03:00
Mikhail Zarechenskiy
0792571256 Include default script template into mock-runtime 2016-09-20 11:29:10 +03:00
Mikhail Zarechenskiy
428763e886 Introduce default script template definition into runtime.jvm 2016-09-20 11:29:02 +03:00
Valentin Kipyatkov
f5a34ca5ae Fixed intentions 2016-09-20 10:55:36 +03:00
Dmitry Petrov
7b25331de1 Support type aliases in RecursiveDescriptorProcessorTest. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
dac9d8b845 Additional checks for type alias constructors. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
796d11c860 ClassDescriptor is now a super-interface for ClassConstructorDescriptor and TypeAliasConstructorDescriptor. 2016-09-20 10:55:36 +03:00
Valentin Kipyatkov
7d214c6e58 KT-13689 Typealias constructor usage counts as original type usage for optimize imports
#KT-13689 Fixed
(cherry picked from commit bde7e2b)
2016-09-20 10:55:36 +03:00
Dmitry Petrov
9d373fba67 (@alexey.andreev) JS BE should handle TypeAliasConstructorDescriptor accordingly. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
b31ab729de Containing declaration for TypeAliasConstructorDescriptor
is a corresponding TypeAliasDescriptor.
2016-09-20 10:55:36 +03:00
Denis Zharkov
1cc7f19d10 Fix AnnotationDescriptorResolver tests
Do not run annotation resolver tests on lambda parameters,
mostly because it's impossible to annotate them by now
(see KT-13900 and `val functionLiteral` in compiler/testData/resolveAnnotations/testFile.kt)

It was working before only because lambda parameter hadn't been parsed at all,
while after introduction of destructuring in lambda parameters
it gets parsed normally

 #KT-13900 Submitted
2016-09-19 20:22:57 +03:00
Denis Zharkov
6e12fe3a78 Fix parameter changing in refactorings
Do not try to create new identifier if inherited name is invalid,
e.g. it's a destructuring declaration.

See KotlinChangeSignatureTest.testSAMRenameParam
2016-09-19 20:22:57 +03:00
Denis Zharkov
72d027d968 Introduce language feature DestructuringLambdaParameters
#KT-5828 Fixed
2016-09-19 20:22:57 +03:00
Denis Zharkov
e75efc88ff Add support for desctructuring of lambda parameters in JVM backend
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
e975d32196 Implement resolution of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
ace3655824 Minor. Rename diagnostic tests: multiDeclarations -> destructuringDeclarations 2016-09-19 20:22:57 +03:00
Denis Zharkov
3df3187e25 Minor. Refine variable name: innerScope -> headerScope 2016-09-19 20:22:57 +03:00
Denis Zharkov
75a51d915f Implement parsing of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
000ba33f59 Minor. Prettify value parameters' resolution parts 2016-09-19 20:22:57 +03:00
Denis Zharkov
435cafed99 Minor. Cleanup KotlinParsing code 2016-09-19 20:22:57 +03:00
Nikolay Krasko
d96863da93 Fix severe freezes because of long lint checks on large files (KT-13071)
- Run lint analyze under indicator with write action priority. Otherwise ProgressManager.checkCanceled() checks doesn't work
 - Move ProgressManager.checkCanceled() up or they are not called in large files without lint warnings

 #KT-13071 Fixed
2016-09-19 18:53:52 +03:00
Nikolay Krasko
131e77927a Skip lazy parsable lambdas without actually parsing them 2016-09-19 18:53:51 +03:00
Alexander Udalov
c91f77f2a4 Rename LanguageFeatureSettings -> LanguageVersionSettings 2016-09-19 15:21:24 +03:00
Alexander Udalov
aec31bd88f Uninherit LanguageVersion from LanguageFeatureSettings
Introduce LanguageVersionSettingsImpl to store everything related to the
selected language version
2016-09-19 15:20:47 +03:00
Alexey Andreev
7dbada0d06 JS: repair serialization of type aliases 2016-09-19 12:30:32 +03:00
Alexey Andreev
9dd6c9a65c KT-13664: write values of long compile-time constants as constants. Fix #KT-13664 2016-09-19 12:29:58 +03:00
Mikhail Glukhikh
1e5fb91d7d Minor refactoring: convert to expression body 2016-09-19 11:45:38 +03:00
Mikhail Glukhikh
909b9b6463 J2K fix: do not use auto-conversion of accessors to = Unit format 2016-09-19 11:07:24 +03:00
Mikhail Glukhikh
4509cd43cb Convert to expression body fix: do not allow = Unit for constructors 2016-09-19 10:58:37 +03:00
Mikhail Glukhikh
24c7efd323 Minor: WITH_RUNTIME removed from a set of intention tests 2016-09-19 10:57:16 +03:00
Mikhail Glukhikh
9ad820205e Partial build fix (new convert to expression body opportunity in quick-fixes) 2016-09-19 10:37:39 +03:00
Mikhail Glukhikh
608368997c Add function to supertype immediately removes redundant modifiers #KT-12297 Fixed 2016-09-16 16:26:01 +03:00
Mikhail Glukhikh
32d11c35a4 KT-12297 related: make not open quick-fix for REDUNDANT_OPEN_IN_INTERFACE 2016-09-16 16:25:57 +03:00
Dmitry Petrov
34240e2ff9 Create special descriptor for an object corresponding to type alias. 2016-09-16 15:44:44 +03:00
shiraji
4f49444f3b Allow to convert empty Unit returning functions to expression form #KT-13588 Fixed 2016-09-16 15:31:13 +03:00
Alexey Sedunov
cf28dd04c8 Shorten References: Compare resolved calls when shortening receiver of qualified call expression
#KT-13660 Fixed
2016-09-16 13:13:30 +03:00
Mikhail Glukhikh
c1296e2134 Retain nullability information for type alias arguments which are in turn type aliases #KT-13835 Fixed 2016-09-16 10:30:43 +03:00
Alexander Udalov
090d157f86 Update test data for data classes 2016-09-15 16:45:48 +03:00
Alexander Udalov
fea116f14e Allow data classes to implement equals/hashCode/toString from base classes
#KT-11306 Fixed
2016-09-15 16:45:48 +03:00
Alexander Udalov
98f6ea577a Move data class-related functions to DataClassDescriptorResolver 2016-09-15 16:45:48 +03:00
Alexander Udalov
22f8e7db3b Use independent context to type-check LHS of '::'
#KT-13110 Fixed
2016-09-15 16:45:48 +03:00
Alexey Sedunov
84aa82e73c Misc: Move conflict checking to moveConflictUtils.kt 2016-09-15 16:22:52 +03:00
Alexey Sedunov
54faac1cee Pull Up: Drop 'override' modifier if moved member doesn't override anything 2016-09-15 16:22:51 +03:00
Alexey Sedunov
dddb4fd792 Introduce Lambda Parameter: Use IDEA-provided action 2016-09-15 16:22:50 +03:00
Alexey Sedunov
f0a298e27b Minor: Fix NPE in MoveKotlinTopLevelDeclarationsDialog
#KT-13856 Fixed
2016-09-15 16:22:49 +03:00
Mikhail Glukhikh
f973be22e2 IntentionBasedInspection minor refactoring: inspectionRange --> inspectionTarget 2016-09-15 14:26:40 +03:00
shiraji
e4c873dc6a Add inspection + intention to replace .let { it.foo() } with .foo() #KT-13551 Fixed 2016-09-15 14:26:06 +03:00
Mikhail Glukhikh
cdf4309e04 Speed search is enable in add import action #KT-13326 Fixed 2016-09-15 14:03:53 +03:00
Denis Zharkov
556df93ca7 Refine diagnostic about type arguments for an outer class
#KT-11263 Fixed
2016-09-15 10:33:19 +03:00
Denis Zharkov
7ca84649d7 Fix implicit type arguments resolution for inner classes
When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer

Relevant arguments are obtained from the first type found by
the algorithm above

Note that before this commit implicit arguments were only been searched
in containing classes

 #KT-11123 Fixed
2016-09-15 10:33:19 +03:00
Denis Zharkov
15c0901a72 Minor. Add covariant override for TypeParameterDescriptor.original 2016-09-15 10:33:19 +03:00
Ilya Gorbunov
3471b3311f Fix js RegExp test not to rely on array equality. #KT-8283 2016-09-14 20:41:41 +03:00
Alexey Tsvetkov
7b99730e39 Test that typealias works with Gradle
#KT-13204 Obsolete
2016-09-14 18:30:02 +03:00
Alexey Andreev
dd062bfd6d JS: add explanation to inline/arrayLiteralAliasing.kt test 2016-09-14 16:37:54 +03:00
Alexey Andreev
a9330057cc KT-8283: fix Kotlin.equals method to compare arrays by reference 2016-09-14 16:37:53 +03:00
Alexey Tsvetkov
a04d60406b Fix snapshot version in gradle tests 2016-09-14 14:13:59 +03:00
Alexey Tsvetkov
1bac872047 Do not try to remove source annotations from not .class file 2016-09-14 13:53:35 +03:00
Alexey Tsvetkov
d2677c0500 Change directory for sync task cache #KT-13732 fixed 2016-09-14 13:53:08 +03:00
Alexey Tsvetkov
508b965d88 Minor: fix gradle plugin order in test 2016-09-14 13:53:04 +03:00
Alexey Tsvetkov
6ebb50751c Remove source annotations when copy class with kapt2
Writing source annotations enables incremental compilation for kapt2.
However they are not needed in bytecode, so we remove them when
copying classes.

# Conflicts:
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
#	compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java
2016-09-14 13:52:56 +03:00
Alexey Andreev
5534350fd6 KT-7397: use reference comparison (===) when translating a is A, where A is an object. Use more sophisticated check for reified parameters. 2016-09-14 13:16:24 +03:00
Alexey Andreev
5d34f5fb75 KT-13836: fix generation of FQN of secondary constructor when it's called via typealias. Fix #KT-13836 2016-09-14 12:40:01 +03:00
Simon Ogorodnik
115d63a2f3 #KT-13750 fix (#951) 2016-09-13 18:12:22 +03:00
Valentin Kipyatkov
19ef29e96c KT-12949 Type aliases are not considered for import when there is an unresolved reference
#KT-12949 Fixed
2016-09-13 17:47:39 +03:00
Valentin Kipyatkov
e41ab2a270 Better presentation of aliases in completion list 2016-09-13 17:47:38 +03:00
Valentin Kipyatkov
50a0f9a4a7 KT-13266 Non-imported type aliases do not appear in completion
#KT-13266 Fixed
2016-09-13 17:47:38 +03:00
Valentin Kipyatkov
fcce1e3838 KT-12852 Support breadcrumbs for Kotlin
#KT-12852 Fixed
2016-09-13 17:46:16 +03:00
Dmitry Petrov
dae4521c68 KT-13822 Exception in the compiler for start-projection of a type alias
Use ClassifierWithTypeParameters in StarProjectionImpl.
2016-09-13 15:09:47 +03:00
Alexander Udalov
5b047684ab Use collections instead of sequences in KClassImpl.Data
Create less intermediate objects in extensions in KClasses.kt
2016-09-13 14:12:35 +03:00
Alexander Udalov
b9dec41ea0 Cache more stuff in reflection implementation
Delete KAnnotatedElementImpl because it's not possible to make it a class (its
subclasses have other classes in supertypes) to cache annotations in a property
2016-09-13 14:12:34 +03:00
Alexander Udalov
80db0e4b71 Minor, make KCallableImpl a class
This will allow to cache stuff common to all callables in KCallableImpl
2016-09-13 14:12:33 +03:00
Alexander Udalov
4d7d70db19 Regenerate public API reference after changes in runtime.jvm 2016-09-13 14:12:32 +03:00
Alexander Udalov
d128827a34 Inherit FunctionReference from CallableReference
This became possible now because FunctionImpl is no longer a class
2016-09-13 14:12:32 +03:00
Alexander Udalov
a10cf8a931 Support 'is/as FunctionN<...>' and 'invoke' for KFunction instances 2016-09-13 14:12:31 +03:00
Alexander Udalov
dcc66a6400 Drop KFunctionFromReferenceImpl, make FunctionImpl an interface
23 invokes in KFunctionFromReferenceImpl (and consequently, in FunctionImpl)
were needed before 1576160390: a wrapped function
reference must have had the necessary invoke to be called as an instance of a
specific function type. After 1576160390, this is
not needed anymore because KFunctionFromReferenceImpl is now an internal
implementation detail of reflection, and no invoke is ever called on it.
2016-09-13 14:12:30 +03:00
Alexander Udalov
fbfa61da5d Drop K(Mutable)Property{0,1,2}Augmented
Also store name in KPropertyImpl, so that calling 'name' on a KProperty
instance in the property delegate does not result in unnecessary descriptor
computation
2016-09-13 14:12:29 +03:00
Alexander Udalov
fc043c6e66 Drop KPropertyNFromReferenceImpl classes
The only place where their get/set methods were used was in
KPropertyNImpl.Getter.invoke, and it's fine if that results in a reflective
call instead (KPropertyN#getter is not available without kotlin-reflect.jar
anyway). The test data has been changed because a package local Java field is
not accessible via reflection
2016-09-13 14:12:29 +03:00
Alexander Udalov
b0af2581ae Drop unused get/set implementations from PropertyReference runtime classes
They are overridden in all subclasses anyway: either in the corresponding
(Mutable)PropertyReferenceNImpl class, or in the anonymous class for a
reference, generated by the compiler.
2016-09-13 14:12:28 +03:00
Alexander Udalov
d3abc83b4c Merge DescriptorBasedProperty into KPropertyImpl, make the latter a class 2016-09-13 14:12:27 +03:00
Alexander Udalov
cd703868d4 Inherit KPropertyImpl.Accessor from KCallableImpl
This is needed to make KCallableImpl a class
2016-09-13 14:12:26 +03:00
Alexander Udalov
304b5deacb Simplify KProperty implementations: get rid of KMutablePropertyImpl 2016-09-13 14:12:26 +03:00
Alexander Udalov
c7050ed445 Cache everything cacheable in KClassImpl
#KT-10651 Fixed
2016-09-13 14:12:19 +03:00
Alexander Udalov
6a97dc5f2c Cache declared/non-declared static/non-static KClass members
Making KClassImpl.Data, its superclass and ReflectProperties public was
required because they are accessed from other package in KClasses.kt
2016-09-13 14:01:52 +03:00
Alexander Udalov
f292ca3dad Simplify signature and usages of KDeclarationContainerImpl#getMembers 2016-09-13 14:01:52 +03:00
Alexander Udalov
b9067e6462 Introduce reflection cache in KClassImpl and KPackageImpl
Most of KClassImpl operations should be cached, but creating a lazy value for
each operation would significantly increase memory footprint of a KClassImpl
instance. Therefore we decide to store all lazy values under a single lazy
value named 'data' which is stored in KClassImpl. There's a minor overhead of
indirection on any operation now, however it'll allow us to substantially
increase reflection performance by caching everything we can
2016-09-13 14:01:52 +03:00
Valentin Kipyatkov
f6b471ac01 Better tests 2016-09-13 12:02:10 +03:00
Valentin Kipyatkov
5bf701ab03 KT-13047 Autocomplete inserts a fully-qualified variable name inside a String
KT-12083 String interpolation -- auto {} if there is a letter after cursor

 #KT-13047 Fixed
 #KT-12083 Fixed
2016-09-13 12:02:10 +03:00
Alexey Sedunov
6e02051be5 Rename: Rename all overridden members if user chooses to refactor base declaration(s)
#KT-8867 Fixed
2016-09-12 21:03:21 +03:00
Alexey Sedunov
a77e1dabce Move: Do not show directory selection dialog if target directory is already specified by drag-and-drop
#KT-13553 Fixed
2016-09-12 21:03:20 +03:00
Alexey Sedunov
bb859ea0f6 Misc: Do not use empty scope for KtParameter/KtTypeParameter (possible fix for EA-1185336) 2016-09-12 21:03:19 +03:00
Alexey Sedunov
23491afde2 Move to Companion Intention: Do not use qualified names as labels
#KT-11483 Fixed
2016-09-12 21:03:18 +03:00
Yan Zhulanow
78a4e90132 Minor: Fix Maven plugin compilation (configuration parameter is not required now in analyzeAndGenerate(), cherrypick problem) 2016-09-12 19:07:57 +03:00
Mikhail Glukhikh
222b964f3a Minor: intention message changed for if/when -> assignment/return 2016-09-12 15:01:17 +03:00
Mikhail Glukhikh
edacc7f8d7 Quick-fix for reassignment in try / catch (fold to assignment) #KT-13778 Fixed 2016-09-12 14:45:20 +03:00
Michael Bogdanov
69dc18b8b4 Proper concrete implementation filtering in java 8 interface case 2016-09-12 12:59:31 +03:00
Michael Bogdanov
4b0c272e19 'toString' implementation in DescriptorBasedFunctionHandle 2016-09-12 12:59:31 +03:00
Mikhail Glukhikh
babf61ec19 Minor: message fixed in diagnostics test 2016-09-12 12:57:48 +03:00
Mikhail Glukhikh
292384fb4c Merge pull request #948 from shiraji/quick_fix_for_final_upper_bound_2
KT-13674 Add quickfix to remove the final upper bound
2016-09-12 13:33:37 +04:00
Dmitry Jemerov
2a5f10855c Merge pull request #950 from shiraji/expand_brackets
KT-13693 Expand selection for array brackets
2016-09-12 12:17:50 +03:00
Dmitry Jemerov
cc29e28b2d Merge pull request #949 from calexHG/patch-1
Fix KtTypeReference.hasParentheses() to check for both LPAR and RPAR
2016-09-12 11:44:29 +03:00
Alexander Udalov
81556b1339 Fix AssertionError in notFoundClasses.kt on bad FQ names (EA-85046)
FQ names like "Foo." or "Foo..Bar" were causing this exception. No tests added:
no idea how to reproduce this exception
2016-09-12 10:39:21 +03:00
Alexander Udalov
90eafe0d71 Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed
2016-09-12 10:39:21 +03:00
Denis Zharkov
6845d0958a Refine AALOAD handling in OptimizationBasicInterpreter
See comment in test data for clarifications

 #KT-13289 Fixed
2016-09-12 10:26:06 +03:00
Denis Zharkov
6269f890c8 Minor. Regenerate tests for type aliases in JS 2016-09-12 10:26:06 +03:00
Yan Zhulanow
261a300299 Do not dex kapt2 test classes (it consumes too much memory while RR)
(cherry picked from commit 54f7ac4)
2016-09-10 17:36:54 +03:00
Yan Zhulanow
015130832b Kapt: allow to use Kapt from compileBunchOfSources() 2016-09-10 17:36:53 +03:00
Yan Zhulanow
fbf44aa9be Kapt: Fix erasure() for immediate class types (KT-13748)
(cherry picked from commit 5fe01f6)
2016-09-10 17:36:51 +03:00
Yan Zhulanow
ef375e66cd Kapt: calculate default values of Kotlin annotations correctly for annotations from binaries (KT-13733)
(cherry picked from commit fed9cb2)
2016-09-10 17:36:50 +03:00
Yan Zhulanow
30a29eaa46 Minor: Fix Gradle tests, update Kotlin artifact version to 1.1 2016-09-10 17:36:15 +03:00
Yan Zhulanow
025f861e76 Minor: Fix path separators check on Windows
(cherry picked from commit 974bbe7)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
c6c1673902 Kapt: load all annotations, even if annotation processors does not require it explicitly. Some annotation processors may want to process some more annotations (see DbFlow, Database annotation).
Blacklist some common-used Java and Kotlin annotations instead (like Deprecated, Nullable or Metadata).
(cherry picked from commit 6856a7c)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
975364b2ed Kapt: Provide SourceRetentionAnnotationHandler for incremental compilation.
Collect annotations with the "SOURCE" retention.
(cherry picked from commit 6ef66e7)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
c3ae66bc9c Minor: fix compilation exception (due to exception in kotlinc)
(cherry picked from commit 5f2d3c4)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
471ddc5a93 Kapt: Write annotations with the "SOURCE" retention if kapt2 is enabled
(cherry picked from commit 6177b2b)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
00355f3c52 Kapt: Remove generated output directory each time before annotation processing
(cherry picked from commit c4b772a)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
32d77e5226 Kapt: support incremental compilation in Gradle (KT-13500)
Kapt will process sources on each step of incremental compilation.
(cherry picked from commit 4cb2127)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
743be477ec Kapt: Add tests with Filer.
JavaFileObject.getName() now returns a path as required.
(cherry picked from commit c611f9b)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
824b778a7b Kapt: support multiple annotation processing steps (KT-13651)
(cherry picked from commit 880e183)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
6ceaac63dc Kapt: provide a default constructor if PsiClass does not have any
(cherry picked from commit 550b1c0)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
7a00b028af Kapt: Do not substitute type arguments for PsiClassReferenceType
(cherry picked from commit 3954c71)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
cacec67044 Kapt: Do not use PsiType comparison in equals() where possible
(cherry picked from commit 89ba634)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
18068c699d Kapt: Represent a single element as an array if the annotation method type is array type
(cherry picked from commit 19ce4cb)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
9127788f4a Kapt: Fix erasure() for executable types (KT-13629)
(cherry picked from commit 461c29d)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
941d016cef Kapt: abort compilation on error in annotation processing stage (KT-13622)
(cherry picked from commit f78b8b4)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
cc7eaeb910 Kapt: Allow passing primitive types and void to erasure() (KT-13617)
(cherry picked from commit 91444c5)
2016-09-10 17:36:15 +03:00
shiraji
d83b1747bb KT-13693 Expand selection for array brackets
#KT-13693 Fixed
2016-09-10 18:07:04 +09:00
Corey Hates Git
1d139d6b53 Fix KtTypeReference.hasParentheses() to check for both LPAR *and* RPAR, as was originally intended
Minor typo fix. A year old typo had this redundantly checking for LPAR twice, rather than checking once for LPAR and once for RPAR.
2016-09-10 02:39:44 -04:00
shiraji
7c3835bb77 KT-13674 Add quickfix to remove the final upper bound
#KT-13674 Fixed
2016-09-10 08:11:23 +09:00
Alexey Tsvetkov
3f2f79ef59 Update changelog for 1.0.4 2016-09-09 18:19:01 +03:00
Alexey Andreev
70c5f05f6e JS: fix compile-time failure when inheriting one local class from another local class 2016-09-09 17:52:42 +03:00
Denis Zharkov
fc5217f7fc Fix signature clash problems caused by special built-ins
Do not treat members with already changed signature as a reason
to create a hidden copy

See tests for clarification:
- There are `charAt` method in B that has different name in Kotlin - `get`,
  i.e. relevant descriptor has initialSignatureDescriptor != null
- When collecting methods from supertypes, `charAt` from A is also get
  transformed to `get`
- So it has effectively the same signature as B.get (already declared)
- If by an accident B.get had been declared with Kotlin signature
  we would have add A.charAt (after transformation) with special flag:
  HiddenToOvercomeSignatureClash (hides it from resolution)
- But here B.charAt was artificially changed to `get`, so no signature clash
  actually happened

 #KT-13730 Fixed
2016-09-09 16:33:32 +03:00
Denis Zharkov
aee2509bf2 Minor. Replace lambdas with callable references in LazyJavaClassMemberScope 2016-09-09 16:33:32 +03:00
Simon Ogorodnik
2b63bcaa19 Correct diagnostics and quick-fix for T::class with non-reified type parameter #KT-9590 fixed 2016-09-09 16:14:11 +03:00
Mikhail Glukhikh
998399bcd8 Change to star projection no longer applied for functional types #KT-13715 Fixed
Also EA-87648 Fixed
2016-09-09 15:00:02 +03:00
Mikhail Glukhikh
23132ad519 Convert lambda to reference intention: apply shorten references to callable reference only, not to the whole argument list 2016-09-09 14:59:57 +03:00
Mikhail Glukhikh
06b7881776 Refactoring: add braces to when entry intention is integrated into general add braces intention 2016-09-09 14:59:52 +03:00
Mikhail Glukhikh
cbc7f72f15 Minor: remove braces is now applicable for the whole loop or when entry 2016-09-09 14:59:47 +03:00
Mikhail Glukhikh
cf2839eb9a Refactoring: remove braces from when entry intention is integrated into general remove braces intention 2016-09-09 14:59:42 +03:00
Mikhail Glukhikh
7f955fd260 Convert lambda to reference has now INFO severity 2016-09-09 14:59:37 +03:00
Alexey Andreev
b91ed1e02a KT-13544: support typealiases in JS backend 2016-09-09 14:38:11 +03:00
Alexey Andreev
7510b7f080 JS: fix tests that don't fail due to lack of support of strict mode (multiValInIntFor, multiValInIntRangeFor). 2016-09-09 13:59:53 +03:00
Alexey Andreev
16af7d667f KT-12868: if a property initializer is a complex expression that emits additional statements, emit these statements directly before assignment to the property, not at the beginning of constructor 2016-09-09 13:54:03 +03:00
Alexey Andreev
80361bf2fb KT-13583: allow local classes to capture members of outer classes 2016-09-09 13:07:08 +03:00
Denis Zharkov
a29faf3f2d Minor. Rename MemberIndex -> DeclaredMemberIndex
Also replace super-calls with explicit calls to declaredMemberIndex().getMethods
2016-09-09 10:27:35 +03:00
Denis Zharkov
a30cb4ead6 Minor. Drop unused getNonDeclaredTypeAliasNames
Also cleanup type aliases related code in DeserializedMemberScope
2016-09-09 10:27:35 +03:00
Denis Zharkov
276bf950cf Write inner classes for annotation descriptors within the given class file
It's necessary for proper recovering of classId by plain string JVM descriptor when loading annotations
See FileBasedKotlinClass.convertAnnotationVisitor

Related tests are already exist in loadJava, but they stopped working
after the recent changes:
nested classes are not found anymore by name with '$' symbol
2016-09-09 10:27:35 +03:00
Denis Zharkov
44f5df00fe Do not return nested/local classes as a part of package fragment
#KT-13757 Fixed
2016-09-09 10:27:35 +03:00
Denis Zharkov
4bf61db9f9 Optimize class names computation in Java package for CLI
Use known class names' set if it exists
2016-09-09 10:27:35 +03:00
Denis Zharkov
5a2851308f Optimize computation of member names in Java scopes
Effectively all custom logic was moved from MemberIndex to JavaScope classes,
and as member names are being cached there, so it prevents repeating supertypes
traversal (see getAllMemberNames extension)
2016-09-09 10:27:35 +03:00
Denis Zharkov
cc0f2e87d4 Optimize java scope members computation for non-existing names
Do not use memoized function if member with given name is not contained in the scope

There are a lot of queries with names of non-existent functions, that leads to many
effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once
2016-09-09 10:27:35 +03:00
Denis Zharkov
e428ea8dd5 Minor. Refine return type Collection -> Set 2016-09-09 10:27:35 +03:00
Denis Zharkov
02d7cf9614 Minor. Rename get*Names -> compute*Names
To indicate that repeating calls to them may require additional computations

Also change second parameter to be nullable, this will be necessary in the next commits
2016-09-09 10:27:35 +03:00
Denis Zharkov
81682f0497 Optimize JvmBuiltinsSettings.getFunctionsNames 2016-09-09 10:27:35 +03:00
Denis Zharkov
2fb5b0e248 Simplify allDesciptors computation
Do not split descriptors into declared/non-declared groups

It should not be important as order of non-declared members' appearance
does not affect stub building, deserialization and other order-sensitive
stuff
2016-09-09 10:27:35 +03:00
Denis Zharkov
f0ba09ae40 Optimize deserialized scope members computation for non-existing names
Do not use memoized function if member with given name is not contained in the scope

There are a lot of queries with names of non-existent functions, that
leads to many effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once

Also drop unused 'location' parameter
2016-09-09 10:27:35 +03:00
Denis Zharkov
b1edb01dd4 Introduce getFunctionNames and getVariableNames into MemberScope
Also provide some basic implementation

The main purpose of these methods is optimization.
Most of the member scopes store mapping from names to descriptors
MemoizedFunction<Name, Collection<Descriptor>>

While there are 10 functions in class in average, there are a lot of
queries with names of non-existent functions, that leads to many
effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once
2016-09-09 10:27:35 +03:00
Denis Zharkov
8ee5f3de8f Minor. Use ArrayList instead of LinkedHashSet
Looks like there's no duplicates anyway
2016-09-09 10:27:35 +03:00
Denis Zharkov
e89c53d49f Minor. Extract common pattern in DeserializedMemberScope 2016-09-09 10:27:35 +03:00
Denis Zharkov
f50d0b63f0 Minor. Simplify type aliases computation
computeNonDeclaredTypeAliases is always empty
2016-09-09 10:27:35 +03:00
Denis Zharkov
2251e3b1e9 Minor. Replace explicit lazy calculation call with delegation convention 2016-09-09 10:27:35 +03:00
Denis Zharkov
a0a0d9b554 Get rid of DeserializedMemberScope.ProtoKey class
Only 'name' property matters, 'isExtension' is only needed for sorting
when computing all descriptors (can be replaced with additional sort)
2016-09-09 10:27:35 +03:00
Denis Zharkov
257417bc4a Minor. Lower type aliase declarations priority
There are several reasons for doing this:
- See org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.computeDescriptors,
  classifiers are being deserialized in the last turn, so it's necessary to preserve consistent order
- Their priority should be close to classes
2016-09-09 10:27:35 +03:00
Nikolay Krasko
5d65951938 Make removing artifacts work with rri branches 2016-09-08 21:46:41 +03:00
Mikhail Glukhikh
8b6cec6ba2 Test fix: typeFromJavaFlexibleRecursive 2016-09-08 18:54:57 +03:00
shiraji
9d768e2375 Add quickfix for FINAL_UPPER_BOUND: inline type parameter #KT-13773 Fixed 2016-09-08 17:48:01 +03:00
Nikolay Krasko
28d187ca1a More tests for ChangeVisibilityModifierIntention
(cherry picked from commit e7cdba7)
2016-09-08 17:32:40 +03:00
Nikolay Krasko
1e9db3c23e Restrict default applicability range for intentions to enclosing block
(cherry picked from commit bf2aade)
2016-09-08 17:32:38 +03:00
Nikolay Krasko
37492fcc78 Make KtLambdaExpression lazy parsable element
(cherry picked from commit 533fca1)
2016-09-08 17:32:37 +03:00
Valentin Kipyatkov
1d24fc3a7b Refactored to ensure use of correct options 2016-09-08 16:11:12 +03:00
Valentin Kipyatkov
32e4a033db Fixed use of options 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov
fc27212456 Shorten references to use analyze() for multiple elements 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov
6efb3ac009 Added TODO 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov
215b870946 Added TODO 2016-09-08 16:11:10 +03:00
Valentin Kipyatkov
dd6b5ab5a7 Used analyze to multiple elements for copy/paste 2016-09-08 16:11:10 +03:00
Valentin Kipyatkov
5a5a6d47b3 Minor 2016-09-08 16:11:09 +03:00
Valentin Kipyatkov
bcfa31de2b Implemented ability to analyze to multiple elements at once 2016-09-08 16:11:09 +03:00
Valentin Kipyatkov
36c2b01047 KT-13675 Ctrl-W: cannot select type argument in return type
#KT-13675 Fixed
2016-09-07 20:02:50 +03:00
Valentin Kipyatkov
73828d1411 Renamed file 2016-09-07 19:04:49 +03:00
Valentin Kipyatkov
8d16af41a9 Fixed test data 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
6d028fbcce Supported object value access expressions 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
e8471b4f32 Added TODO 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
77dfbda389 Added progress when searching invoke() by plain search 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
b1a6255ac2 Renamed class 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
29831f648d Added @TestOnly 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
82089da0cf Better test 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
5b638f51b0 Down-shift to plain search if reference in unknown language encountered 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
e314e22215 Minor refactoring 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
63ed93d1ac Minor optimization 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
a6a7075568 Fixed the case of public from private class inheritance in Java 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
904017eaff Covered case when variable of our type is multi-declaration entry 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
7b907e6518 Added comments 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
2322ecb032 Fixed test 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
4e0c3fcee7 Refactored reference searches to take read-actions when necessary 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
637da2e693 Converted to Kotlin and edited 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
843ff15943 Fixed assertion about read-action 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
d7a94ac470 Fixed find usages for Java's invoke() 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
478556890a KT-13605 Find Usages fails to find usages of component function defined in Java
#KT-13605 Fixed
2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
5e52e74963 Fixed test data 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
0158ff46f3 Fixed operator references search for functions declared in Java 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
f6fbd0b623 Fast search of contains operator 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
5ce780cafc Optimization 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
0f32574be0 Fast get/set operators search 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
eeea85c86a Fast search of assignment operations 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
cdf328475e Fast unary operators search 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
322df5b348 More correct operator treatment 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
43f8fbea2b More information in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
e1c1c5fb59 Minor change in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
8fd9b4a87b More information in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
1ca698cfc4 Implemented fast search for binary operators 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
f2c0d131e4 Refactored to avoid code duplication 2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
e3b37f9219 Implemented fast search for invoke operator calls
#KT-13643 Fixed
2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
e1c7d07189 Refactored component usages search extracted search for expressions of given type 2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
47d624ac66 Better test 2016-09-07 18:10:13 +03:00
Valentin Kipyatkov
c068bd3158 Fixed correct detection of bold members in case of multiple receivers (broken by previous changes) 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
d93525d7f8 Minor 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
835c60f2a5 More correct completion list sorting by receivers 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
a60d9d546d KT-12798 DSL-friendly completion
#KT-12798 Fixed
2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
efac7a11b3 Do not include "operator" and "infix" into completion item text for override 2016-09-07 18:10:11 +03:00
Michael Bogdanov
8d2ffb2dab Fix wrong "InlineProperties are unsupported at this language level" error on inline functions when inline properties are disabled 2016-09-07 17:39:09 +03:00
Mikhail Zarechenskiy
3ad451e33e Partly support generics and nullable types as parameters for script templates 2016-09-07 17:24:19 +03:00
Michael Bogdanov
7230965e62 Support for property reference inlining 2016-09-07 12:01:49 +03:00
Michael Bogdanov
237afb4b7c Mark linenumber in property reference 2016-09-07 12:01:48 +03:00
Michael Bogdanov
b4ae70139a PropertyReferenceCodegen refactoring 2016-09-07 12:01:48 +03:00
Michael Bogdanov
a12d7b6019 Check lambda inlining in package part files in test framework 2016-09-07 12:01:47 +03:00
Dmitry Petrov
f2b8569b4b KT-13735 NoSuchMethodError for generic typealias acces
Use underlying constructor descriptor for type alias constructor code generation.
2016-09-07 09:46:00 +03:00
Nikolay Krasko
727ff15af3 j2k: fix converter
(cherry picked from commit a21e85b)
2016-09-06 15:28:00 +03:00
Nikolay Krasko
9970289efb j2k: right after convert
(cherry picked from commit c0db343)
2016-09-06 15:27:58 +03:00
Nikolay Krasko
9606282d01 j2k: rename file
(cherry picked from commit 8deaa34)
2016-09-06 15:27:57 +03:00
Nikolay Krasko
acc7c3286c Extract base class for goto action tests
(cherry picked from commit 0b25723)
2016-09-06 15:27:55 +03:00
Nikolay Krasko
115bc7e73b Tests for GotoTypeDeclaration action
(cherry picked from commit 3cd100b)
2016-09-06 15:27:54 +03:00
Alexey Tsvetkov
eb22c94b6d Fix maven build 2016-09-06 14:48:07 +03:00
Alexey Andreev
43abdaa894 KT-13658: don't capture FakeCallableDescriptorForObject in closure 2016-09-06 10:59:56 +03:00
Denis Zharkov
6a22d75dd7 Drop TypeAliasDeserializer
Currently it's only used for local type aliases, while code in
'deserializeTypeAlias' works properly only for nested or top-level type
aliases.

Also it seems that serialization of types based on local type aliases
doesn't work now anyway (see KT-13692)
2016-09-05 17:54:36 +03:00
Denis Zharkov
86c1dbe7b5 Fix decompilation of types based on local classifiers
If deserializing a type with arguments based on a local class for
decompiler, then just return Any type (without arguments).

Previously Any constructor was used with serialized arguments, that lead
to exception

Note that in case of deserialization for compiler nothing changes about
local-classes-based types (LocalClassifierResolverImpl is just inlined)

 #KT-13408 Fixed
2016-09-05 17:54:36 +03:00
Alexander Udalov
1be3b9c192 Exclude more irrelevant maven-generated stuff in CodeConformanceTest 2016-09-05 16:44:54 +03:00
Alexander Udalov
dc689ff514 Fix concurrent access issues in CallableReference implementations
Because of multiple reads from the same non-volatile variable, NPE was possible
to achieve in a multi-threaded application
2016-09-05 16:44:54 +03:00
Alexander Udalov
8fb5858dae Fix occasional NPE from reflection initialization
This could happen when a .jar containing Kotlin stdlib and reflection classes
was launched with 'java -jar'
2016-09-05 16:44:54 +03:00
Alexander Udalov
9da1840523 Minor, rename ConsPStack$1 -> ConsPStack$Itr
To somewhat improve stack traces (see
http://stackoverflow.com/questions/34214290/kotlin-massive-amounts-of-conspstack-how-can-i-avoid/34214718#34214718)
2016-09-05 16:44:54 +03:00
Alexander Udalov
f4a1aa640e Optimize KClass creation from Class instance
Don't create unnecessary iterator every time in HashPMap.get (see
https://github.com/hrldcpr/pcollections/pull/41). Also fix a warning and remove
misleading comment
2016-09-05 16:44:54 +03:00
Alexander Udalov
d0d1824e7d Optimize argument array creation in reflection call 2016-09-05 16:44:54 +03:00
Alexey Tsvetkov
c422de7c3c Update changelog for 1.0.4 2016-09-05 14:55:22 +03:00
Alexey Tsvetkov
2afd79c977 Fix compatibility with AS 2.2 gradle plugin
#KT-13594 fixed
2016-09-05 14:52:43 +03:00
Alexey Tsvetkov
6e4bbfef86 Fix snapshot version for testModuleKind 2016-09-05 14:52:35 +03:00
Alexey Tsvetkov
ed7d31eb6c Assume cache format is always up-to-date when compiling non-incrementally 2016-09-05 14:52:27 +03:00
Alexey Tsvetkov
0b017aa3ca Support multi-project IC for android projects 2016-09-05 14:52:23 +03:00
Alexey Tsvetkov
9f6509cd8e Fixes after review 2016-09-05 14:52:20 +03:00
Alexey Tsvetkov
4e8deb9566 Implement multiproject IC in Gradle
#KT-13528 fixed
2016-09-05 14:52:17 +03:00
Alexey Tsvetkov
f967edfaeb Join paths to string for better assertion message in idea 2016-09-05 14:52:14 +03:00
Alexey Tsvetkov
4ceec37bfe Refactor version checking 2016-09-05 14:52:11 +03:00
Alexey Tsvetkov
eea01f468b Introduce KotlinGradleBuildServices that is created once per build 2016-09-05 14:52:07 +03:00
Alexey Tsvetkov
7fa32a886d Minor: remove outdated TODO 2016-09-05 14:52:04 +03:00
Alexey Tsvetkov
3922ebcd4b Refactor loading kotlin version in gradle plugin 2016-09-05 14:51:56 +03:00
Alexey Tsvetkov
8a5df120a5 Ensure java is forced to compile when kotlin is compiled incrementally
Previously java compilation was not forced when there were only
removed kotlin files.
2016-09-05 14:51:49 +03:00
Alexander Udalov
cb209074d3 Minor, add regression test on incomplete code with callable reference
#KT-13685 Fixed

(cherry picked from commit c8b30d3310)
2016-09-05 13:13:57 +03:00
Nikolay Krasko
67f353903e Show lint diagnostics even if there're errors in the file (KT-12022)
It also affects working with KotlinChangeLocalityDetector. Right after error is fixed in local context file is still reported as having errors and diagnostics are not counted.

 #KT-12022 Fixed
2016-09-02 13:41:24 +03:00
Nikolay Krasko
795fef20d7 Don't highlight declaration with WRAPPED_INTO_REF
Leave highlighting only for usage. This may allow to make highlighting more local and lazy.
Java follows the same rules for "Implicit anonymous class parameter".
2016-09-02 13:41:24 +03:00
Nikolay Krasko
f797d53343 Precheck method is called main in RunConfiguration check 2016-09-02 13:41:24 +03:00
Nikolay Krasko
9a54aa99fa Drop kotlin-bare-plugin (KT-11859) 2016-09-02 13:41:24 +03:00
Nikolay Krasko
4a0f14b64b Minor: toString() for NONE filter 2016-09-02 13:41:24 +03:00
Nikolay Krasko
52dd02fe08 Make changes in super call lambda not cause out-of-block modification (KT-13474)
#KT-13474 Fixed
2016-09-02 13:41:24 +03:00
Nikolay Krasko
64d511566e Test that out-of-block behaviour conforms running the analyze of the nearest expression
Mark as exceptions cases with field initialize expression and body of class init for now
2016-09-02 13:41:24 +03:00
Nikolay Krasko
ec6780b49c Use AtomicLong for modification stamp 2016-09-02 13:41:24 +03:00
Nikolay Krasko
82bcd8192b Re-highlight only single function after local modifications 2016-09-02 13:41:24 +03:00
Nikolay Krasko
043502f836 Minor: remove warnings and refactoring 2016-09-02 13:41:24 +03:00
Dmitry Petrov
e0cdad30e4 KT-13181 Unresolved reference when referencing a type alias from a different module
Add corresponding resolution code.
2016-09-02 10:18:23 +03:00
Dmitry Petrov
6428a7655d KT-13422 Type alias for Java exception class can be used as an object in 'throw' expression
Report NO_COMPANION_OBJECT for type aliases.
2016-09-02 10:18:22 +03:00
Mikhail Glukhikh
c7f87e655c Build fix (ConvertLambdaToReferenceIntention) 2016-09-01 18:45:42 +03:00
Stanislav Erokhin
9fa6fb213b Potential fix for some random errors about "cannot choose between equals invoke functions". 2016-09-01 18:01:56 +03:00
Stanislav Erokhin
bebc75c8ef Set reference target and report custom error instead unresolved reference for cases: interface, generic parameter, object + invoke, class without companion.
#KT-2787 Fixed.
2016-09-01 18:01:55 +03:00
Stanislav Erokhin
eb6f444c19 Minor. rename context -> candidateFactory 2016-09-01 18:00:23 +03:00
Stanislav Erokhin
0072d6004a Refactoring: rename TowerContext to CandidatesFactory, InvokeTowerContext to CandidateFactoryProviderForInvoke. 2016-09-01 18:00:22 +03:00
Stanislav Erokhin
c910646eda Refactoring: remove name from ScopeTower. 2016-09-01 18:00:21 +03:00
Stanislav Erokhin
aa5be2ec7b Refactoring remove scopeTower from TowerContext. 2016-09-01 18:00:21 +03:00
Stanislav Erokhin
ddb75abe30 Rename ScopeTower to ImplicitScopeTower. 2016-09-01 18:00:20 +03:00
Stanislav Erokhin
0c60cda22a Refactoring: replace ReceiverValue to ReceiverValueWithSmartCastInfo, Receiver to DetailedReceiver 2016-09-01 18:00:20 +03:00
Stanislav Erokhin
d4a2cad35c Refactoring move DataFlowValue back to frontend module. 2016-09-01 18:00:19 +03:00
Stanislav Erokhin
58fd24943d Refactor DataFlowDecorator. 2016-09-01 18:00:18 +03:00
Stanislav Erokhin
8d2d5ea211 Minor refactoring in NewKotlinTypeChecker 2016-09-01 18:00:18 +03:00
Stanislav Erokhin
ea2d95fa79 Minor. Change predicate type from KotlinType to UnwrappedType. 2016-09-01 18:00:17 +03:00
Stanislav Erokhin
ca6c6ae0f3 Refactoring. Move creation of functionProcessor into resolution module. 2016-09-01 18:00:17 +03:00
Ilya Gorbunov
5dc31d2614 Mock-runtime isn't available when this configurations is run on teamcity. 2016-09-01 15:07:23 +03:00
Denis Zharkov
cebe67d90c Fix default value generation after suspension point
Replace coercion from VOID with call 'pushDefaultValueOnStack'

It's necessary because coercion of VOID to java/lang/Object ends with Unit instance on stack
that makes variables spilling algorithm thinking that variable is Unit

 #KT-13409 Fixed
2016-09-01 15:03:31 +03:00
Denis Zharkov
1226d8fc2c Refine 'handleResult' calls generation within coroutines
Before this change everything works just fine for 'handleResult' methods
accepting non-Unit parameters

For other cases the same coercion-to-unit strategy is in plain lambdas:
- if last statement is not Unit type, execute it, pop from the stack, then put Unit instance
- for 'return@label' (no expression) just put Unit on the stack

 #KT-13531 Fixed
2016-09-01 15:03:31 +03:00
Denis Zharkov
12dad29336 Minor. Cleanup block codegen
- Clarify variable names
- Use explicit condition 'statements.isEmpty()' instead of implicit one 'answer == null'
2016-09-01 15:03:31 +03:00
Mikhail Glukhikh
2ab553243c Convert lambda to reference: use fully qualified type names if needed #KT-13438 Fixed
(cherry picked from commit e2e761e)
2016-09-01 14:44:36 +03:00
Mikhail Glukhikh
a41c4b9a0f Convert lambda to reference: flexible receiver types are handled correctly #KT-13411 Fixed
(cherry picked from commit ecad1c3)
2016-09-01 14:44:22 +03:00
Mikhail Glukhikh
863e4afc7b Convert lambda to reference: no more allowed for extension KFunction parameters #KT-13527 Fixed
(cherry picked from commit 84c4ff7)
2016-09-01 14:44:11 +03:00
Mikhail Glukhikh
ec41289664 Convert lambda to reference: range reduced to a call itself #KT-13661 Fixed
(cherry picked from commit f7b5d34)
2016-09-01 14:44:00 +03:00
Alexey Sedunov
a6e3aac7ca Convert to Kotlin: AbstractExpressionSelectionTest 2016-09-01 13:43:54 +03:00
Alexey Sedunov
96a2c97aa2 Convert to Kotlin: AbstractExpressionSelectionTest (rename to .kt) 2016-09-01 13:43:53 +03:00
Alexey Sedunov
b0a1eca1ce Convert to Kotlin: AbstractSmartSelectionTest 2016-09-01 13:43:52 +03:00
Alexey Sedunov
1ab40f6d88 Convert to Kotlin: AbstractSmartSelectionTest (rename to .kt) 2016-09-01 13:43:51 +03:00
Alexey Sedunov
f6d0fca57b Refactoring: Split KotlinRefactoringUtil2.kt to several files 2016-09-01 13:43:50 +03:00
Alexey Sedunov
b6a671c45f Convert to Kotlin: KotlinRefactoringUtil2 (replace object with top-level declarations) 2016-09-01 13:43:49 +03:00
Alexey Sedunov
16b4c2c70d Convert to Kotlin: KotlinRefactoringUtil2 (prettify) 2016-09-01 13:43:48 +03:00
Alexey Sedunov
fc9b28884d Convert to Kotlin: KotlinRefactoringUtil2 2016-09-01 13:43:48 +03:00
Alexey Sedunov
1f8dba9c89 Convert to Kotlin: KotlinRefactoringUtil2 (rename to .kt) 2016-09-01 13:43:47 +03:00
Alexey Sedunov
f47b416f2a Minor: Temporary rename of KotlinRefactoringUtil before conversion to Kotlin (to avoid conflict with existing kotlinRefactoringUtil.kt) 2016-09-01 13:43:46 +03:00
Alexey Sedunov
da273419b9 fixup! Introduce Type Parameter 2016-09-01 13:43:45 +03:00
Alexey Sedunov
2f9a911624 Introduce Type Parameter
#KT-13155 Fixed
2016-09-01 13:43:44 +03:00
Mikhail Glukhikh
cd717467f0 Nested classes are no more allowed inside any anonymous objects or local classes #KT-13510 Fixed
(cherry picked from commit 5c3ec6c)
2016-08-31 19:28:13 +03:00
Mikhail Glukhikh
f8039249c6 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00
Mikhail Glukhikh
43954699a7 KT-13612 KotlinPositionManager: fixed initialization in try / catch
(cherry picked from commit ecae5c6)
2016-08-31 19:28:05 +03:00
Mikhail Glukhikh
6a9d058db4 UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
(cherry picked from commit aac8e94)
2016-08-31 19:28:00 +03:00
Valentin Kipyatkov
e363809b37 Minor changes 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
05fae1d4db Optimization: don't search named arguments 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
29f61087ed More correct down-shifting to plain search 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
6562412bda Ignore usages in XML 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
06eea53246 Fixed bug with class using data class as type parameter in supers list 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
b332867b25 Use one KtDestructuringDeclarationReference per each entry - better highlight usages and other actions 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
9cd7e9d519 Down-shifting to plain search when operator usage search required 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
5682c917f9 Fixed infinite recursion 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
9022c71949 Better testing 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
d2ee10daa5 Fixed typo 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
8bfc746f4b Supported usage in super type list without parenthesis 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
5c1e42aa51 Class literal access supported 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
4cab04b24b Callable references handled 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
6af9567527 Extracted method 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
450d0dd5d1 Supported access to companion object members 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
63d4491eb8 More actions logged in tests 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
482225f622 Removed unused 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
724886c967 Better log 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
f447321e58 Split test for 'for' 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
c864fce035 Split one more test 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
1221b6bb67 Split test for whens 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
dc1f2d5b5f And one more split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
be94fe76f9 One more split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
0d9656d638 Split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
2ca163a375 Better testing via logging of performed operations 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
1e80ad3f98 Optimization 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
7a269a00af SAM-adapters supported 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
d0d8ea7c69 Added TODO 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
1183816b52 Disabled smart search for classes from library 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
6f21c07b66 Added TODO 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
e00c8d6e05 "!is" in when case 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
5b3102058c Handling of 2 more class of cases:
1. Function has parameter of functional type with our data class inside
2. Value of data class type used in a call with lambda
2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
ca2cd3d656 this@ClassName supported 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
7687c1646b Supported "is" in when entry condition 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
ecb1910bf2 Different modes of search
Down-shift to plain search in non-test mode if unknown reference encountered
Internal action to check search algorithm
2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
d13cdc67f0 Supported usages as doc-comments 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
696f382291 Supported usages as destructuring declaration for other class 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
80520b44c0 Plain search inside members and extensions 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
3910f31de9 Correct processing of "is" check 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
25ab66053b Added runReadAction (but it's incorrect anyway) 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
5d427d8d2e Support for 'as' and temporary support for 'is' 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
1674beb64b Initial implementation of faster component function usage search 2016-08-31 19:12:19 +03:00
Dmitry Jemerov
77bb9b8092 Update the pull request help link (#943) 2016-08-31 12:25:37 +02:00
Zalim Bashorov
e456fc540b Increase minimal version of ant (#941) 2016-08-31 13:15:25 +03:00
Alexey Sedunov
4e2c4d941d Rename: Support inplace rename on type parameters 2016-08-31 11:28:04 +03:00
Alexey Sedunov
34c268b08b Quick-Fixes: Do not show Change Signature dialog when applying "Remove parameter" quick-fix 2016-08-31 11:28:03 +03:00
Alexey Sedunov
c244baf087 Misc: Improve IDE rendering of type aliases 2016-08-31 11:28:02 +03:00
Alexey Sedunov
3405051bcc Misc: Use default presentation for KtTypeAlias
#KT-13611 Fixed
2016-08-31 11:28:02 +03:00
Morton Fox
61afc7e713 Update the pull request help link 2016-08-31 00:28:28 -04:00
Zalim Bashorov
8393c17df3 Increase minimal version of ant 2016-08-30 21:53:40 +03:00
Alexey Andreev
60a09ecb45 KT-12873: add temporary variables generated by delegation expression to class initializer. Fix #KT-12873 2016-08-30 12:26:06 +03:00
Yan Zhulanow
1a94e2202b Minor: Fix compilation error 2016-08-29 18:30:27 +03:00
Sergey Mashkov
8ae5ecf4ff KT-12810 IDL: support special modifiers(e.g. getter and setter) 2016-08-29 17:56:17 +03:00
Yoshinori Isogai
e1eba8f5c8 KT-5193 Make multiline strings foldable (#938)
* KT-5193 Make multiline strings foldable
 #KT-5193 Fixed

* Avoid multiple replace call
2016-08-29 16:52:29 +02:00
Yan Zhulanow
1a1eb7dcfa KT-12303 Pass only relevant annotations to annotation processors
(cherry picked from commit 01742aa)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
7810678389 Kapt: Fix type arguments in JeDeclaredType. In case of type variable, JeTypeVariableType should be returned
(cherry picked from commit ed34ec0)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
ebcc762ae9 Kapt: JeTypeElement getInterfaces() and getSuperClass() should provide reference type mirrors
(cherry picked from commit 5f50ab6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cd44540965 Kapt: Support String[] in annotation proxy
(cherry picked from commit 5e9eab9)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0042a59fb6 Kapt: Use also the compile classpath, not only apt classpath
(cherry picked from commit d810119)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
1b05c5fb0c Kapt, Gradle: The first dependency is kotlin-annotation-processing (we reuse the old configurations from kapt)
(cherry picked from commit f95a3d1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a8b577cd09 Kapt: Support nested annotations property.
Also do not rely on Java class comparison, check against qualified names.
(cherry picked from commit 7610945)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
49bd303988 Kapt: Fix broken assertion
(cherry picked from commit 36b0b52)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
46367d720c Kapt: Gradle integration tests for the new kapt
(cherry picked from commit 467d0fd)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9960e7f7cd Kapt: Get rid of the 'compiler-tests' dependency in 'plugins-tests'
(cherry picked from commit bb370f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a9de8ec89b Kapt: compile annotation-processing artifact with target "1.6"
(cherry picked from commit 1391e59)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
b13db88e6f Kapt: Make javaCompile parameter in KotlinGradleSubplugin non-null
(cherry picked from commit 9686344)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
46f9e02c06 Kapt: Fix type arguments order for JeDeclaredType, should not use substitutor
(cherry picked from commit a9c77e1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
d07e6c752b Kapt: Support default packages in Filer
(cherry picked from commit 3ced8a6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
8c4fb0a709 Kapt: Support inherited annotations
(cherry picked from commit 02a3e6b)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9d340e1b83 Kapt: Filter out kapt2 sources in KotlinCompile task
(cherry picked from commit b248b20)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
04db25a190 Kapt Gradle plugin: use the old configuration names
(cherry picked from commit 6e72dc8)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
407af3a0e5 Kapt: Gradle plugin for the new kapt
(cherry picked from commit f4fc8f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
399059729d Kapt: verbose output mode
(cherry picked from commit e6067d5)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
f5d58d9944 Kapt: Provide toString() implementations for no-types
(cherry picked from commit df9c825)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
badf8dbc53 Kapt: Fixes in KotlinElements:
1. 'overrides()' when 'type' extends containing(overrider) and implements containing(overridden). According to documentation, In this case the function should return true.
2. Handle both kotlin.Deprecated and java.lang.Deprecated for Kotlin in 'isDeprecated'.
3. Fix 'isFunctionalInterface'.
(cherry picked from commit a14d7ce)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
462c7d91d2 Kapt: Calculate constant values in the similar way.
Always use originalElement in JeAnnotationValue factory.
(cherry picked from commit 0ff9584)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
4710fab49f Kapt: Use the base types in KotlinProcessingEnvironment
(cherry picked from commit ed8e2e4)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
927280f7ce Kapt: add some JeElement tests
(cherry picked from commit 948a4b6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0fc92c784b Kapt: add JeElementRenderer
(cherry picked from commit 3eecf78)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cd09f2bcb8 Kapt: Minor, refactor JeAnnotationMirror:getElementValues()
(cherry picked from commit 649b938)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
23b343bb03 Kapt: annotation-processing is not dependent on 'cli' module anymore
(cherry picked from commit 4591f13)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
f61367df28 Kapt: Fixes on review
(cherry picked from commit be31262)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
5b8e6abdeb Kapt: Support Java source root processing.
Support resource file writing.
(cherry picked from commit 7a06a91)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9d2144f221 Kapt: Support "*" in supported annotation qualified names (all annotations)
(cherry picked from commit 27ec053)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a73cf65840 Kapt: Check DEFAULT modifier only in Java 8
(cherry picked from commit 71c8dfb)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
53921c3f74 Kapt: Drop custom annotation stub factory, implement it with AnnotationParser in sun.reflect as done in Javac
(cherry picked from commit 82dcbf3)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
6eb3d7e002 Kapt: Refactor kapt type wrappers. Now every ordinary (not NoType) type has a backed PsiType so it's easy to call utility functions from IntelliJ.
(cherry picked from commit 0a684aa)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
84d62f37eb Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->
Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
(cherry picked from commit 17ad807)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
884e653490 Kapt: Add ability to get constant value from KtLightAnnotation
(cherry picked from commit 7180961)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0181dd000d Kapt: Implement Annotation Processing plugin in Kotlin (KT-13499)
(cherry picked from commit 32c461a)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cc12a6c228 Kapt: Add APT wrappers for PSI elements
(cherry picked from commit 1214513)
2016-08-29 16:31:16 +03:00
Alexey Sedunov
89c39b9762 Misc: Use TODO() consistently in implementation stubs
#KT-13589 Fixed
2016-08-29 16:20:55 +03:00
Alexey Sedunov
639186ddae Convert Receiver to Parameter: Use template instead of the dialog
#KT-9490 Fixed
2016-08-29 16:20:52 +03:00
Alexey Sedunov
63092f6985 Create from Usage: Implement "Create type parameter" quickfix
#KT-11525 Fixed
2016-08-29 16:20:32 +03:00
Alexey Sedunov
6a2edabbd4 Create from Usage: Implement "Create type alias" quickfix
#KT-12904 Fixed
2016-08-29 14:13:56 +03:00
Valentin Kipyatkov
17edbac72b Fixed test data 2016-08-29 13:38:18 +03:00
Simon Ogorodnik
67c916a7d1 MultiFile tests now support java + kotlin testing. // FILE directive now accepts path in source root instead of just name 2016-08-29 13:38:18 +03:00
Valentin Kipyatkov
5f24b68368 Minor changes on code review 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
9cddd0d1a4 Renamed classes 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
cbae3d77df Don't use term "Static import" + refer quickfix by class name in negative tests 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
0072bf079d Changes on review of pull request 2016-08-29 13:38:17 +03:00
Simon Ogorodnik
939b4768f5 Added tests, and fixed some bugs using it 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
251d87fd22 Added ability to test quickfix with java dependencies 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
f40bb57d79 Refactored to use exiting impl of AutoImportBase 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
9d56716897 #KT-9009 fixed 2016-08-29 13:38:16 +03:00
Kevin Greene
ce1844a6c9 Updates link to JavaScript issues on YouTrack (#939) 2016-08-27 21:18:20 +03:00
Alexander Udalov
26156b137f Micro optimizations to type rendering in DescriptorRendererImpl
Do not create StringBuilder instances when the resulting String will be
appended to some other StringBuilder anyway. This, and a couple of micro
FqNameUnsafe-related optimizations, helps reduce memory traffic in Kotlin
reflection when rendering is involved (toString() is called on reflective
objects)
2016-08-26 15:17:02 +03:00
Alexander Udalov
3298649bd7 Support "-no-reflect" in "kotlin" command
#KT-13491 Fixed
2016-08-26 15:17:00 +03:00
Mikhail Glukhikh
902232c8ad CFG refactoring: extractVariableDescriptorFrom
(cherry picked from commit 95add79)
2016-08-26 14:15:08 +03:00
Ilya Gorbunov
25d8af3112 JS: Implement Long.hashCode function.
#KT-13756 Fixed
2016-08-26 05:28:48 +03:00
Ilya Gorbunov
813bee62e5 JS: Remove intrinsic for Long.equals, because it's applied incorrectly for nullable longs.
#KT-7500 Fixed
2016-08-26 05:28:20 +03:00
Ilya Gorbunov
9c4221cda8 Return EMPTY range [0, -1] when MIN_VALUE is specified as exclusive upper bound.
#KT-12762 Fixed
2016-08-26 05:19:51 +03:00
Ilya Gorbunov
ca8b284805 Use 1.8 JVM target bytecode version for kotlin-stdlib-jre8 module to prevent loading on previous JRE versions. 2016-08-26 05:19:06 +03:00
Alexey Tsvetkov
522520b722 Update link to jarjar 2016-08-26 05:07:53 +03:00
Nikolay Krasko
d9b116c6d6 Remove net/sf/cglib/ classes from Kotlin compiler (KT-13565)
(cherry picked from commit eb160a2)

 #KT-13565 Fixed
2016-08-25 15:35:10 +03:00
Nikolay Krasko
8b84b7158a Debugger doesn't step into 'for' body if there's inline function call in range expression (KT-13534)
#KT-13534 Fixed
2016-08-25 15:35:08 +03:00
Nikolay Krasko
ef602be98e More emulate debugging after dexing - dex removes several lines mapped to one instruction
(cherry picked from commit 1b7d4ef)
2016-08-25 15:35:07 +03:00
Dmitry Jemerov
9264c876f8 show primary constructor properties in project view when "Show members" is enabled
#KT-11776 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
1cf79d9495 KtClassOrObjectTreeNode: cleanup after J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
fceb626cf8 KotlinProjectViewUtil, KtClassOrObjectTreeNode: J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
a7d5b7c4f8 KtClassOrObjectTreeNode: rename to .kt 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
49c957364c KotlinProjectViewUtil: rename to .kt 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
3ec583bb16 show icon of class initializer
#KT-11775 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
8ff0814221 show local functions in structure view
#KT-13473 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
509142089c KotlinStructureViewElement: cleanup after J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
50b1951746 KotlinStructureViewElement: J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
2ebacb6969 KotlinStructureViewElement: rename to .kt 2016-08-25 14:19:59 +02:00
Mikhail Glukhikh
8e5b833cca Has platform type inspection: do not suggest !! for not-null types #KT-12820 Fixed
(cherry picked from commit 8830ff7)
2016-08-25 10:32:50 +03:00
Mikhail Glukhikh
0ee1102e24 KT-13536 related: correct handling of objects
(cherry picked from commit 7ae9b6b)
2016-08-25 10:32:40 +03:00
Mikhail Glukhikh
6ac4bf3f17 No more SOE in UnusedSymbolInspection #KT-13536 Fixed
(cherry picked from commit 23961ee)
2016-08-25 10:32:31 +03:00
Mikhail Glukhikh
605ac0b25e Invert if: more correct handling of empty returns #KT-13444 Fixed
(cherry picked from commit be2adaf)
2016-08-25 10:32:21 +03:00
Mikhail Glukhikh
25eefdb6ec Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:32:04 +03:00
Mikhail Glukhikh
08f8a2b75c PseudocodeLabel is extracted from PseudocodeImpl (now not an inner class), some its properties / functions are supported now by base Label
(cherry picked from commit 30dd52e)
2016-08-25 10:31:53 +03:00
Mikhail Glukhikh
41ff51ca8c Label.java converted to Kotlin
(cherry picked from commit 3891d76)
2016-08-25 10:30:49 +03:00
Mikhail Glukhikh
ea041661fb CFG: break and continue are now handled in the same (safe) way EA-85060 Fixed
(cherry picked from commit eec4b1b)
2016-08-25 10:30:41 +03:00
Mikhail Glukhikh
d33745b646 BreakableBlockInfo : converted to Kotlin
(cherry picked from commit 22c7ee5)
2016-08-25 10:30:32 +03:00
Mikhail Glukhikh
d4c40d9db0 BreakableBlockInfo.java -> BreakableBlockInfo.kt
(cherry picked from commit d5f7c3f)
2016-08-25 10:30:24 +03:00
Mikhail Glukhikh
52571f0fa9 LoopInfo: converted to Kotlin
(cherry picked from commit f64d60e)
2016-08-25 10:30:15 +03:00
Mikhail Glukhikh
751f96b648 LoopInfo.java --> LoopInfo.kt
(cherry picked from commit d952dbd)
2016-08-25 10:30:07 +03:00
Mikhail Glukhikh
c9f9ae7d2a EA-85060: BreakableBlockInfo is split into LoopInfo & SubroutineInfo to make code more clear
(cherry picked from commit 48faf4a)
2016-08-25 10:29:58 +03:00
Alexey Sedunov
64f0532934 Move: Forbid moving of enum entries
#KT-13215 Fixed
2016-08-24 11:27:22 +03:00
Alexey Sedunov
c50f38aa52 Intentions: Implement intention to replace camel-case test function name with a space-separated one
#KT-12489 Fixed
(cherry picked from commit 21e24a1)
2016-08-24 11:27:21 +03:00
Alexey Sedunov
d9698dfa4d Search: Optimize usage scope of class members
#KT-9285 Fixed
2016-08-24 11:27:20 +03:00
Alexey Sedunov
e908c6c1b2 Search: Restrict KtParameter usage scope to its containing declaration
#KT-13542 Fixed
 #KT-8672 Fixed
2016-08-24 11:27:19 +03:00
Alexey Sedunov
6480118da6 Move: Report separate conflicts for each property accessor
#KT-13216 Fixed
2016-08-24 11:27:18 +03:00
Alexey Sedunov
9607fd0620 Pull Up: Remove visibility modifiers on adding 'override'
#KT-13535 Fixed
2016-08-24 11:27:17 +03:00
Alexey Sedunov
47d4454590 Type Hierarchy: Support Type Hierarchy on references inside of super type call entries
#KT-9125 Fixed
2016-08-24 11:27:16 +03:00
Alexey Sedunov
cd1943c8b0 Convert to Kotlin: HierarchyUtils (prettify) 2016-08-24 11:27:16 +03:00
Alexey Sedunov
4622f08b5e Convert to Kotlin: HierarchyUtils 2016-08-24 11:27:15 +03:00
Alexey Sedunov
91cc22e599 Convert to Kotlin: HierarchyUtils (rename to .kt) 2016-08-24 11:27:14 +03:00
Alexey Sedunov
05abc0127b Convert to Kotlin: KotlinTypeHierarchyProvider (prettify) 2016-08-24 11:27:13 +03:00
Alexey Sedunov
23d9f923ac Convert to Kotlin: KotlinTypeHierarchyProvider 2016-08-24 11:27:12 +03:00
Alexey Sedunov
438777a0de Convert to Kotlin: KotlinTypeHierarchyProvider (rename to .kt) 2016-08-24 11:27:12 +03:00
Stanislav Erokhin
0cf7490500 Moved OverloadingConflictResolver into resolution module. 2016-08-24 11:11:45 +03:00
Stanislav Erokhin
f31493f80f Introduce SimpleConstraintSystem for OverloadChecker and OverloadingConflictResolver 2016-08-24 11:11:44 +03:00
Stanislav Erokhin
5ad0e4e9b8 Refactoring. Support in OverloadingConflictResolver any kind of ResolvedCalls. 2016-08-24 11:11:37 +03:00
Stanislav Erokhin
b695f5edd9 Refactoring. Some simplifications in OverloadingConflictResolver. 2016-08-24 11:10:34 +03:00
Valentin Kipyatkov
512fb3f191 Renamed method 2016-08-23 22:47:43 +03:00
Valentin Kipyatkov
f21f23744e Hopefully fixed EA-87200 - TCE: UtilsKt.tryChangeAndCheckErrors
#EA-87200 Fixed
2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
2d875e516e Groupped tests by folders 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
d0f6e25783 sum and sumBy supported 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
7c92f7974f Corrected comment 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
61d1826980 Better test 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
91954e131a Math.max/min pattern for min/max supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
84fd24a1a0 Another pattern for min/max supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
930f7960ea max()/minI() supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
26cdd0d5d5 KT-13482 "Loop can be replaced with stdlib operations" changes semantics
#KT-13482 Fixed
2016-08-23 22:47:40 +03:00
Valentin Kipyatkov
38edb58e60 Preserve formatting of parenthesis in calls too 2016-08-23 22:46:44 +03:00
Valentin Kipyatkov
87294207f9 Introduced Identifier.withNoPrototype() 2016-08-23 22:46:43 +03:00
Valentin Kipyatkov
0554e1702c KT-11804 J2K: incorrect closing parenthesis position for method split to several lines
#KT-11804 Fixed
2016-08-23 22:46:43 +03:00
Valentin Kipyatkov
20c17fc435 Use of Block.of() 2016-08-23 22:46:43 +03:00
Alexey Andreev
7016ce9b41 JS: refactor how cached access translators work. Fix cached access translator in case of arrays. Use cached access translator to translate reassignments 2016-08-23 18:06:51 +03:00
Alexey Andreev
cb2c8edaf9 JS: don't translate RHS of overloaded assignment operators twice. It can break compilation in some cases, for example, when there are lambdas in RHS.
Fix #KT-12808 #KT-12807
2016-08-23 18:06:51 +03:00
Alexey Andreev
996c1b6f87 JS: add support of JS module kind to Gradle task. Add tests of support of module kind to Maven tests 2016-08-23 17:12:37 +03:00
Mikhail Glukhikh
d08d8af407 USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
Alexey Andreev
df86840515 KT-13025: when receiver of call of 'invoke' method is a Function, check whether receiver is an extension function and generate additional '.call' invocation. Fix #KT-13025 2016-08-23 15:45:48 +03:00
Alexey Andreev
c767b3d0ac KT-13043: fix translation of super call from secondary constructor when base constructor has default arguments 2016-08-23 15:44:27 +03:00
Mikhail Glukhikh
b00b0caa9b Merge pull request #937 from shiraji/useless_elvis_with_null
KT-13521 Warning right part of "expression ?: null" is useless
2016-08-22 19:38:09 +03:00
shiraji
a3f131d6c6 KT-13521 Warning right part of "expression ?: null" is useless
#KT-13521 Fixed
2016-08-23 01:10:10 +09:00
Alexey Tsvetkov
ebf3c9404a Fix incremental build with kapt and gradle 2.14
#KT-13179 fixed
2016-08-22 19:05:06 +03:00
Valentin Kipyatkov
c9d335394d KT-13529 Java function is not always converted to Kotlin after paste
#KT-13529 Fixed
2016-08-22 17:52:48 +03:00
Dmitry Jemerov
ebd45a8c5c use less brute-force method for updating converted file content in J2K (may fix KT-13493 and friends) 2016-08-22 16:20:10 +02:00
Mikhail Glukhikh
c07906fac4 Replace with safe calls forbidden for comparisons #KT-13432 Fixed 2016-08-22 15:11:33 +03:00
Kirill Rakhman
1fbd6678a5 Add quickfix for "A type annotation is required on a value parameter" #KT-12804 Fixed 2016-08-22 15:11:28 +03:00
Kirill Rakhman
2dd4194a79 Clean up quick fix package 2016-08-22 15:11:23 +03:00
shiraji
1bbde54e9d Inspection to warn on using == with array types #KT-13384 Fixed 2016-08-22 15:11:19 +03:00
Yoshinori Isogai
7d35316d95 KT-4519 Show first line with content of block comment when collapsed (#928) 2016-08-22 13:08:44 +02:00
Yoshinori Isogai
4669fb3ca7 KT-12697 Expand selection action select ": Type" (#898) 2016-08-22 12:35:23 +02:00
Mikhail Glukhikh
b3b83e344b Added fake override search in unused symbol inspection #KT-13288 Fixed 2016-08-22 13:18:40 +03:00
Mikhail Glukhikh
8de68e3e87 Merge pull request #931 from cypressious/empty_parens
Add intention+inspection to remove empty parentheses from method call with single lambda parameter
2016-08-22 11:34:24 +03:00
Mikhail Glukhikh
3aee2f004e Merge pull request #932 from cypressious/kt13480
Fix "Can be replaced with comparison" false positive if extension method called 'equals' is used
2016-08-22 11:32:53 +03:00
Kirill Rakhman
1bc2af6436 Add intention+inspection to remove empty parentheses from method call with single lambda parameter
Fixes #KT-13519
2016-08-20 16:03:42 +02:00
Kirill Rakhman
e6e46809de fix "Can be replaced with comparison" false positive if extension method called 'equals' is used
Fixes #KT-13480
2016-08-20 14:11:57 +02:00
Kirill Rakhman
45b5157ecf Clean up intentions package 2016-08-20 13:53:32 +02:00
Pavel V. Talanov
a683c2b68d IntentionBasedInspection: Removing synchronizing on intention instances
Recreate intention instance in `buildVisitor`
Lock caused contention for UpSource
2016-08-19 18:54:15 +03:00
Dmitry Jemerov
742d7db953 diagnostics that helped catch KT-13381 2016-08-19 16:29:21 +02:00
Alexey Sedunov
9fd61b869e Find Usages: Do not duplicate containing declaration in super member warning dialog
#KT-10209 Fixed
2016-08-18 19:15:40 +03:00
Alexey Sedunov
c2b38cfa41 Create from Usage: Place extension properties after the usage and generate stub getter
#KT-11795 Fixed
2016-08-18 19:15:38 +03:00
Alexey Sedunov
99ba340236 Create from Usage: Make extension functions/properties 'private' by default
#KT-11799 Fixed
2016-08-18 19:15:37 +03:00
Alexey Sedunov
92b0c852dd Remove Unused Receiver: update function/property usages
#KT-8903 Fixed
2016-08-18 19:15:36 +03:00
Alexey Sedunov
0fc28fe0b2 Rename: Support rename of packages with non-standard quoted names
#KT-13488 Fixed
2016-08-18 19:15:35 +03:00
Alexey Sedunov
f6de6eac09 Rename: Do not search for component convention usages
#KT-9381 Fixed
2016-08-18 19:15:34 +03:00
Alexey Sedunov
f507eed42d Rename: Fix parameter rename when new name matches call selector
#KT-13476 Fixed
2016-08-18 19:15:33 +03:00
Alexey Sedunov
5e577c391c Rename: Quote parameter name when necessary
#KT-13463 Fixed
2016-08-18 19:15:32 +03:00
Alexey Sedunov
238f99aa3d Override/Implement: Make return type non-nullable (platform collection case) when overriding Java method
#KT-13455 Fixed
2016-08-18 19:15:31 +03:00
Dmitry Jemerov
ac6f0b5419 diagnostics for EA-86187 - KNPE: KDocElementFactory.createNameFromText 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
8a22e1ed7c don't try to walk over the siblings of PsiFile to check if "introduce variable" is enabled (EA-86136 - assert: SharedPsiElementImplUtil.getChildIndex) 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
7ee72f2ebc stop at file level when going up the tree in KtPsiUtil.areParenthesesNecessary() (EA-86495 - NPE: KtPsiUtil.areParenthesesNecessary) 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
ef791fedde check for project disposed in NewKotlinActivityAction (EA-82450 - assert: ComponentManagerImpl.getPicoContainer) 2016-08-18 17:27:43 +02:00
Nikolay Krasko
7e1d8fb8f5 Reformat main function templates
(cherry picked from commit d6d3846)
2016-08-18 17:25:38 +03:00
Nikolay Krasko
4d6206a7b5 Introduce 'maino' and 'psvmo' templates for generating main in object (KT-6520)
#KT-6520 Fixed
(cherry picked from commit cf1bdba)
2016-08-18 17:25:32 +03:00
Pavel V. Talanov
48d7e8c519 Implement navigation to type aliases in libraries 2016-08-18 16:34:37 +03:00
Mikhail Glukhikh
ac3dfd93bd More correct handling of compile time constant types #KT-13421 Fixed 2016-08-18 14:42:16 +03:00
Kirill Rakhman
354d047533 Add Intention to replace a..b-1 with a until b and vice versa #KT-13483 Fixed 2016-08-18 13:27:07 +03:00
Mikhail Glukhikh
d9358d44e7 KT-13426 related : added assertion to prevent smart cast type rewriting for (expression, call) or (expression, implicit receiver) pair 2016-08-18 09:50:27 +03:00
Zalim Bashorov
11107fd3fe Use target of current module when find libraries with incompatible binary format
#KT-12977 Fixed
(cherry picked from commit d975f21)
2016-08-17 20:42:14 +03:00
Kirill
1926825019 Make folding if to return/assignment work with if-else if-else #KT-13452 Fixed 2016-08-17 17:51:08 +03:00
Kirill
6bb4c28c2e Minor: make var val 2016-08-17 17:50:57 +03:00
Mikhail Glukhikh
1987187968 Build fix: IMPLICIT_RECEIVER_SMARTCAST and SMARTCAST slices in matchAndConvert.kt 2016-08-17 17:50:52 +03:00
Mikhail Glukhikh
ae856e834a Store map (Call to KotlinType) for SMARTCAST slice #KT-13426 Fixed
Also EA-86848 Fixed
2016-08-17 16:09:45 +03:00
Mikhail Glukhikh
dbff2be6fa Hack due to KT-678 was removed 2016-08-17 16:09:40 +03:00
Mikhail Glukhikh
cbcef67d82 KT-13426: store map from ImplicitReceiver into KotlinType for implicit receiver smart casts 2016-08-17 16:09:34 +03:00
Zalim Bashorov
33e96fcb9a JS: fix runtime type checking for native non-fake interfaces on WebKit (JavaScriptCore); add tests for object and object expressions. 2016-08-17 14:25:29 +03:00
Ilya Gorbunov
d845092b20 Take into account excluded fq-names when determining whether type has been imported by default.
Related to #KT-13447
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
e34bc30bd7 Exclude alias imported names from all-under imported packages when determining whether a type has been imported for completion.
#KT-13447 Fixed
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
b69661df8f Pseudocode and CFG changed after 'let' is resolved correctly. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
58a010464a Exception typealiases rendering in test output (CFG) 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
2a0076d9bd Test data: replace Exception with Throwable (in those tests where particular exception type is not crucial in order not to rename tests to have runtime dependency added with exception typealiases). 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
3115aa1dc2 Test data: replace Exception with Thread as the former is resolved not from java.lang anymore. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
570ac8b821 Add runtime dependency to tests where exception references are used. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
6f7b908dbb Test data: change fully qualified type so that it's available as type (and not an alias) in both jvm and js runtimes to have the same output. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0ebfba7a1a Test data: do not use exceptions from java.lang, as they are not available in JS 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
d943079557 Exception typealiases rendering in test output 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
403e2ab4ea Redefine configuration kinds, so that the most of test dependent on JDK_ONLY now use mock kotlin runtime:
MOCK_RUNTIME -> JDK_ONLY
JDK_ONLY -> JDK_NO_RUNTIME
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
7579111df1 Include exception typealiases into mock runtime. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
9e238d26f2 Exclude builtins module from idea project build 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
cf898ae357 Exclude exceptions from java.lang package for which type aliases exist in kotlin package.
Add relevant note to the type aliases.
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0d7819e011 Move exceptions to kotlin package in JS library, introduce type aliases for exceptions in kotlin package in JVM runtime.
#KT-18 Fixed
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
afe1b7eab1 Allow to exclude specific types from packages imported by default. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0f8bf310f2 Kotlin script execution for maven: include kotlin-runtime as explicit dependency for script.
Relates to #KT-11839
2016-08-17 12:40:50 +03:00
Alexey Sedunov
fbd6edce92 Light Classes: Support property accessors with non-conventional names
#KT-13032 Fixed
2016-08-17 12:28:46 +03:00
Alexey Sedunov
94c4b426f5 Pull Up: Skip super members without explicit declarations
#KT-13124 Fixed
2016-08-17 11:50:00 +03:00
Alexey Sedunov
6766494581 Push Down: Do not specifiy visibility on generated overriding members
#KT-12971 Fixed
2016-08-17 11:49:59 +03:00
Alexey Sedunov
ad3ffdab18 Rename: Use RenameKotlinParameterProcessor for constructor/lambda parameters
#KT-13253 Fixed
2016-08-17 11:49:58 +03:00
Alexey Sedunov
2e887ebcef Rename: Do not report shadowing conflict if redeclaration is detected
#KT-13240 Fixed
2016-08-17 11:49:58 +03:00
Alexey Sedunov
8232c66617 Move: Warn about accessibility conflicts when moving entire file
#KT-13175 Fixed
2016-08-17 11:49:57 +03:00
Alexey Sedunov
baa549e7c8 Move: Warn about accessibility conflicts due to moving to unrelated module
#KT-13174 Fixed
2016-08-17 11:49:56 +03:00
Alexey Sedunov
6a42802240 Rename: Warn about function name conflicts
#KT-13239 Fixed
2016-08-17 11:49:55 +03:00
Alexey Sedunov
385640c86f Rename: Fix name quoting for automatic renamers
#KT-13282 Fixed
 #KT-13283 Fixed
2016-08-17 11:49:54 +03:00
Alexey Sedunov
a5da9e81a0 Rename: Conflict detection for type parameters
#KT-13254 Fixed
2016-08-17 11:49:53 +03:00
Alexey Sedunov
562488b348 Create from Usage: Disable "Create property" (non-abstract) in interfaces. Make "Create function" (non-abstract) generate function body in interfaces
#KT-13365 Fixed
2016-08-17 11:49:52 +03:00
Alexey Sedunov
f4d9f33f48 Change Signature: Yield to other usage processor if target element is neither KtFunction, nor PsiMethod
#KT-13277 Fixed
2016-08-17 11:49:52 +03:00
Michael Bogdanov
e6d96be329 Removed redundant 'addThis' flag 2016-08-17 11:26:46 +03:00
Michael Bogdanov
e0d525b72a Support bound function reference inlining 2016-08-17 11:26:45 +03:00
Michael Bogdanov
439431e923 ParameterBuilder refactoring: allow to generate captured parameter between value ones 2016-08-17 11:26:45 +03:00
Valentin Kipyatkov
7f07890f6a KT-13298 Suggest names for overridden properties / functions in completion
#KT-13298 Fixed
2016-08-16 18:17:24 +03:00
Valentin Kipyatkov
7ebf001d25 Moved class 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
8e6a01fe0a arrayListOf, mutableListOf, hashSetOf and mutableSetOf supported 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
054558ad95 More correct checking of smart cast preserving 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
bfed954e85 Added tests 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
f5530c8bf0 Added comment 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
e32724330f Moved shouldUseInputVariable from Transformation to TransformationMatcher and changed its semantics a bit 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
a5c7d4f1fd Added comment 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
50cd61ec9f Minor refactoring 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
407a3ddc8a Used utility 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
dde397f34d Fixed bug 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
bdd4363802 Option to use 'asSequence()' 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
acdf9e82b4 Minor 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
77064c7937 Fixed bug with user data not cleared 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
f4a04f04f0 Minor 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
c753e332ed More clear code 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
1fece52170 Typo correction 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
128896fa43 Formatting of "?:" onto the next line 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
9890cebfd9 Code refactoring 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
c9fa95927b Added comments 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
dd50f55415 Removed warnings 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
7c0f9a76a8 Added one more test 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
e5903f90f2 Added test and asserts 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
8b4f8e8359 Corrected test data after rebase on master 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
da772e11c2 Minor changes on code review 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
d658d3b9cf "Use withIndex()" intention&inspection 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
46055dfd2d Refactoring 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
ebdff775f3 Supported index++ pattern as non-last statement and even inside expressions 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
2c90114d28 Added TODO 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
4094d77782 Supported forEachIndexed 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
f28dca1fd5 Supported forEach 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
394cce8e10 Checking type of the collection being iterated 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
89dab52a14 Minor changes on code review 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
c2103e2200 Supported indexOf/lastIndexOf 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
c080ecb0d1 Code simplification 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
87c9af532e Refactoring 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
834fe9d535 Supported contains() 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
833f62e9b9 Fixed some cases when smart cast problems were not detected 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
fe52bed74e Remove fq-name 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
e8904d7727 Merging loop with initialization before in more cases + better formatting 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
5ddac24cdd Refactoring 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
b65ecdd660 Supported indexOfFirst/indexOfLast 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
5ac2c48879 Merging subsequent filtering checks even when index variable is used 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
aa6240a0c5 Do not generate redundant .toList() 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
813060fef3 Added TODO 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
9ea6341d46 Minor 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
4efc8fa2b1 Merged all map-transformations into one class 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
b6e05e058e Supported mapIndexedTo and mapIndexedNotNullTo 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
2652ea4233 Supported mapNotNullTo 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
8c7cdf1bf8 Supported other patterns for mapNotNull 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
a6132c7db9 Prohibiting incorrect transformations of loops with expression-embedded break or continue + allowed "?: continue" pattern for mapNotNull 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
cfc82c55c7 Checking that target collection is always the same 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
3f563f7058 takeWhile supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
9ff0f4d736 filterNotTo supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
0a61e5b0b2 filterIsInstanceTo NOT supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
395e61ca57 filterNotNullTo supported 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
318f3dfdd8 Supported filterIndexedTo 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
7c473e7159 Reduced amount of ResultTransformation implementations 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
a07bbf4aa8 More correct and easy comment restoring range management 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
27063bcd9b Supported case when result variable initialization is not right before the loop 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
9b69c5c375 Split into more files 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
b24aee9c92 Moved classes into separate file 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
d61daed461 Recognizing manually incremented index 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
14e87b1f2c Initial support for indexed transformations 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
955e1166fd Transformation not necessary has real input variable 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
e0a7e1dbed Checking that input variable is really used 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
345f2b8a52 More usable caret position 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
db53794663 Supported "count()" 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
53e3a67a7f Better formatting in some cases 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
fe7ddbcc0d More informative intention action text 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
bbb6ef4fbc Check that "break" and "continue" do not produce false errors when using analyzeInContext 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
49f2c5f657 Sometimes shorter code with filterTo, mapTo and flatMapTo 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
744186402d One more case when mapTo can be generated 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
db0028c11e AddToCollectionTransformation checks that the result collection type cannot be changed 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
f51c5a19dd Basic support for "add" to collection used inside the loop 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
d3721e9462 flatMapTo supported 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
f3c760607b Consistent use of term "input variable" instead of "working variable" 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
df08493337 Moved check about old working variable not needed into common place 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
22fb397662 Initial support for "+=", filterTo and mapTo for collections 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
ac46684592 Supported initialization with assignment instead of declaration 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
1fe84b8a25 Refactoring 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
bd6b38962d Elvis operator supported for all cases of find 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
79800492a9 firstOrNull() ?: ... supported 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
14ef93a797 More relaxed checks for any() with return 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
ff0bb4fbb8 Generating more simple construct instead of "let" in some cases 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
a760ef3665 Generating "firstOrNull()?.let {...}" 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
fba9b123dd More cases supported for "any" 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
c0f3ab59ab Supported "lastOrNull" and "any" without break in the loop 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
0243efd8b5 Added comments 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
fcbf68617e Merging subsequent .filter()'s 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
6dbd9c944a Refactored API to allow merging ResultTransformation with any kind of previous transformation 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
d7762778a2 Cannot transform to flatMap if old working variable used in the nested loop 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
50bd766992 Minor changes after code review 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
863040700e Check for continue-statement of the inner loop! 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
8c498af3d8 Checking that smart casts will not be broken by conversion 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
978fc468fa Temporary fix 2016-08-16 17:37:55 +03:00
Valentin Kipyatkov
12b1a99a6a Initial implementation of loop-to-call-chain intention 2016-08-16 17:37:55 +03:00
Valentin Kipyatkov
c50cf13611 KtExpression.analyzeInContext uses correct context when analyzing return's 2016-08-16 17:37:55 +03:00
Pavel V. Talanov
340fe82fa0 Minor, KotlinScriptConfigurationManager: add TODO 2016-08-16 16:49:09 +03:00
Pavel V. Talanov
10660f35d7 Add tests for script configuration machinery, namely ScriptTemplateProvider EP
Test highlighting and navigation depending on provided script definition
2016-08-16 16:45:59 +03:00
Pavel V. Talanov
b4cb4f9191 KotlinLanguageInjector: only run for project or library source 2016-08-16 16:45:58 +03:00
Kirill Rakhman
e6d76a9b71 Allow suppressing warnings for secondary constructor (KT-12627)
(cherry picked from commit 41cf868)

 #KT-12627 Fixed
2016-08-16 13:04:42 +03:00
Nikolay Krasko
7a4d20b4cf Make quick evaluate work on receiver in qualified expressions (KT-13269)
(cherry picked from commit 970ac5a)

 #KT-13269 Fixed
2016-08-16 13:04:41 +03:00
Michael Bogdanov
7325baa06a Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation
#KT-13374 Fixed
2016-08-16 10:47:01 +03:00
Natalia Ukhorskaya
fca5834557 Eval4J: loadClass should return prepared class, otherwise ClassNotPreparedException fails in invokeMethod
#KT-12641 Fixed
2016-08-16 09:08:34 +03:00
Natalia Ukhorskaya
f6bb70aad1 Debugger: allow to evaluate 'this' and fields in java files 2016-08-16 09:08:34 +03:00
Alexander Udalov
18887f8bec Rename CompanionObjectMapping.hasMappingToObject -> isMappedIntrinsicCompanionObject 2016-08-15 19:41:47 +03:00
Alexander Udalov
7b8ee5fba1 Add test case for obsolete issue
#KT-13172 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
bd88b0941d Fix incorrect unsupported error on synthetic extension call on LHS of ::
#KT-13271 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
9dc7e90e12 Disable some reflection tests on Android 2016-08-15 19:41:47 +03:00
Alexander Udalov
4e8f88d580 Refactor comments in SpecialFiles 2016-08-15 19:41:47 +03:00
Alexander Udalov
5b1ee13db8 Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the
single type kotlin.Int in Kotlin, so inequality between the corresponding
KClasses was confusing here. To keep the old behavior, one may call 'k1.java ==
k2.java' instead of `k1 == k2`

 #KT-13462 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
3efa738bc0 Fix NPE on .companionObjectInstance for built-in classes
#KT-13370 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
611899e9d3 Minor, make CompanionObjectMapping a singleton 2016-08-15 19:41:47 +03:00
Stanislav Erokhin
85a951db52 Fixed exception AssertionError: Illegal resolved call to variable with invoke
#KT-13330 Fixed
#KT-13349 Fixed
2016-08-15 19:24:17 +03:00
Kirill Rakhman
926deebff5 Format spaces around !is and !in (KT-13314)
#KT-13314 Fixed
2016-08-15 16:21:01 +03:00
Mikhail Glukhikh
b53cb91e88 Do not suggest "Replace infix with safe call" inside conditions or binary / unary expressions #KT-13328 Fixed 2016-08-15 15:42:27 +03:00
shiraji
42969271ab Fix problem with appending literal to variable omitting braces #KT-13336 Fixed 2016-08-15 15:13:40 +03:00
Kirill
223fd9fad0 Implement intentions to add/remove braces to/from when entries #KT-12043 Fixed 2016-08-15 14:13:13 +03:00
Kirill Rakhman
d68a681db5 Highlight use of toString() inside string interpolation as redundant #KT-10731 Fixed 2016-08-15 13:28:47 +03:00
Mikhail Glukhikh
52dacd1d49 KT-13430 related: add non-null assertion works also for UNSAFE_INFIX_CALL 2016-08-12 17:43:31 +03:00
Mikhail Glukhikh
cf2d575eec Add non-null assertion: correct handling of unary expression unsafe calls #KT-13430 Fixed 2016-08-12 17:43:26 +03:00
Mikhail Glukhikh
13975778c5 Unused symbol: handling of import as alias not only for objects / enums #KT-11933 Fixed 2016-08-12 17:42:33 +03:00
Mikhail Glukhikh
e01e08402c Minor: convert to expression body is forbidden also for nested non-exhaustive whens 2016-08-12 17:41:33 +03:00
Mikhail Glukhikh
6a6c67dd5f Convert to expression body is forbidden for if without else #KT-12951 Fixed 2016-08-12 17:41:28 +03:00
Mikhail Glukhikh
1c5c6506ce Report of UNINITIALIZED_ENUM_COMPANION also for implicit receivers #KT-11769 Fixed 2016-08-12 15:06:43 +03:00
Mikhail Glukhikh
04f71bccf2 KT-11769 case with companion function call: error is now detected if companion receiver is stated explicitly 2016-08-12 15:06:38 +03:00
Sergey Mashkov
3c002625c6 KT-13211 KotlinCompileMojoBase could provide better compilation failure info 2016-08-12 13:59:58 +03:00
shiraji
3e58283d7e Add quickfix for adding 'inline' to a function with reified generic #KT-6975 Fixed 2016-08-12 12:15:40 +03:00
Mikhail Glukhikh
6cf90cfc4e Fix for SOE in VarianceChecker #KT-13401 Fixed 2016-08-11 13:04:58 +03:00
Ilya Chernikov
82a53912a9 Add two more options copying from gradle-visible option to compiler-visible ones 2016-08-11 09:11:11 +02:00
Ilya Chernikov
46a7c706e1 Fixes and refactorings after review 2016-08-11 09:11:11 +02:00
Ilya Chernikov
295f2fd40a Fix GeneratedClassloader creation in scripts compilation, fixes test 2016-08-11 09:11:11 +02:00
Ilya Chernikov
9f18ad606a Fix exception on incompatible resolver class - #EA-86599 2016-08-11 09:11:11 +02:00
Ilya Chernikov
e99697e3a2 Fix testdata for cli help tests 2016-08-11 09:11:11 +02:00
Ilya Chernikov
4d5b96ab8a Change error loading script template to warning - not to show an exception...
because it is not an exception e.g. in case of using old gradle
2016-08-11 09:11:11 +02:00
Ilya Chernikov
324b4544c6 Generate kotlin metadata for scripts - see TODO 2016-08-11 09:11:11 +02:00
Ilya Chernikov
e79d8014fa Add support for script templates settings in gradle plugin, add kts files to source sets 2016-08-11 09:11:11 +02:00
Ilya Chernikov
ce6966b486 Add settings to compiler to specify templates to load, add templates provider using the settings 2016-08-11 09:08:40 +02:00
Ilya Chernikov
c9441bd7b3 Update template(s) provider interface to support multiple templates, rename it appropriately 2016-08-11 09:08:40 +02:00
Ilya Chernikov
6c0b78fb01 Add script-templates option to compiler options, fix templates and definitions loading in compiler 2016-08-11 09:08:40 +02:00
Alexey Tsvetkov
4702842afd Revert replacing convention with extension
It seems that was wrong
2016-08-10 22:28:21 +03:00
Alexey Tsvetkov
791c7fe6e6 Invalidate jar cache at the end of a Gradle build
#KT-12912 fixed
2016-08-10 22:28:20 +03:00
Alexey Tsvetkov
fa0344a1b2 Add simple file modification util for gradle incremental tests 2016-08-10 22:22:54 +03:00
Alexey Tsvetkov
aff5dd1691 Refactoring: cleanup gradle plugin 2016-08-10 22:22:50 +03:00
Alexey Tsvetkov
81bc2701fa Refactoring: move util functions to gradleUtils.kt 2016-08-10 22:22:47 +03:00
Alexey Tsvetkov
f649ebfdba Refactoring: remove unused ScriptHandler 2016-08-10 22:22:43 +03:00
Alexey Tsvetkov
5f4e56c251 Refactoring: simplify KotlinSourceSet creation 2016-08-10 22:22:40 +03:00
Alexey Tsvetkov
cc585cf6f3 Refactoring: extract constants 2016-08-10 22:22:36 +03:00
Alexey Tsvetkov
eeed0a6eee Refactoring: stop using internal classes to create DSL extensions 2016-08-10 22:22:32 +03:00
Alexey Tsvetkov
d9c9fb11ea Refactoring: taskUtils.kt->gradleUtils.kt 2016-08-10 22:22:28 +03:00
Alexey Tsvetkov
6c80b33664 Refactoring: remove usages of ProjectInternal 2016-08-10 22:22:25 +03:00
Alexey Tsvetkov
f0ff0d0a18 Refactoring: inject FileResolver
This is part of refactoring to minimize using of internal API in gradle plugin
2016-08-10 22:22:21 +03:00
Ilya Gorbunov
2c1d90c79d Improve test coverage of map operations 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
dcd6e86cd3 Minor: rename type parameter from C to M as it stands for Map 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
bb774cea76 Minor: remove anonymous class for Map.asSequence 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
fb99919c59 Accept maps out-projected by key where possible. 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
738219d53e Make Map.toSortedMap accept Map out-projected by key type as the receiver.
Update related completion testData.
2016-08-10 21:52:24 +03:00
Ilya Gorbunov
9ff6a6260e Minor: explicit visibility and improved code formatting 2016-08-10 21:32:33 +03:00
Ilya Gorbunov
200f1c98ed Minor: fix formatting and improve docs 2016-08-10 18:23:32 +03:00
Laszlo Hornyak
6fda0816f3 buildString with initial capacity for the StringBuilder instance
this method helps save computation time when the developer knows or have a good
educated guess about the size of the generated string and have to use control
structures while filling the string builder

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2016-08-10 18:23:32 +03:00
Ilya Chernikov
4e18e91463 Attempt to fix EA-82064:
"java.lang.NoClassDefFoundError: Could not initialize class kotlin.Unit"
2016-08-10 14:18:03 +02:00
Zalim Bashorov
9ece62fa0f JS backend: fix runtime type checking for interfaces 2016-08-10 15:04:27 +03:00
Zalim Bashorov
060255e8f7 Fix printing file size of generated js files for TeamCity statistics 2016-08-10 15:03:56 +03:00
Dmitry Jemerov
f08a7f14e0 workaround for IDEA's issue that throws an exception when using union() on a LocalSearchScope with no elements (EA-82063 - AIOOBE: GlobalSearchScope.union) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
180f70b573 don't use document for checking whether a folding region is one-line, use only PSI, as it may not correspond to the state of the document (EA-81838 - IOOBE: LineSet.findLineIndex) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
a4aa3cdf57 don't crash if we don't have a descriptor for the declaration under caret (EA-86248 - KNPE: KDocNameCompletionSession.doComplete) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
ddb91cc0d9 correct fix for showing dialog from popup callback (EA-86138) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
5c113a4237 correct fix for invoking 'safe delete' refactoring outside of write action (EA-80766 - E: BaseRefactoringProcessor.run) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
5d92f655f7 one more missing read action in Find Usages (EA-81276 - assert: SharedImplUtil.getParent) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
f9d3804111 check element validity in KotlinSelectInProjectViewProvider (EA-84485 - PIEAE: OwnBufferLeafPsiElement.getContainingFile) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
8632790446 don't check intention availability on PsiFile (EA-85587 - assert: SharedPsiElementImplUtil.getChildIndex) 2016-08-10 13:26:13 +02:00
Mikhail Glukhikh
d21061ff60 CAST_NEVER_SUCCEEDS: some type alias tests (1.1 only!) 2016-08-10 12:23:09 +03:00
Mikhail Glukhikh
687698da9a Do not report USELESS_CAST when casting null to nullable (special case) 2016-08-10 12:23:02 +03:00
Mikhail Glukhikh
8d537d294a Minor: imports removed, formatting 2016-08-10 12:22:58 +03:00
Mikhail Glukhikh
098520de64 CAST_NEVER_SUCCEEDS: do not report when casting nullable to nullable #KT-260 Fixed 2016-08-10 12:22:53 +03:00
Alexey Sedunov
2b44335c27 Presentation: Render valid description for type aliases 2016-08-10 11:45:41 +03:00
Alexey Sedunov
3475a1fd1f Introduce Property: Fix duplicate count in popup window
#KT-13395 Fixed
2016-08-10 11:45:41 +03:00
Alexey Sedunov
ab7d48a34e Light Classes: Do not compute annotations for light elements with invalid
origin (possible fix for KT-13199)
2016-08-10 11:45:40 +03:00
Alexey Sedunov
4ab25bd0bb Move: Quote package name (if necessary) when moving declarations to new file
#KT-13385 Fixed
2016-08-10 11:45:39 +03:00
Alexey Sedunov
b793252a5f Extract Function: Skip callable reference selectors
#KT-13218 Fixed
2016-08-10 11:45:38 +03:00
Alexey Sedunov
6e3d1d726e Create from Usage: Do not suggest creating annotations/enum classes for unresolved type parameter bounds
#KT-13364 Fixed
2016-08-10 11:45:37 +03:00
Alexey Sedunov
1b546d18ff Override/Implement Members: Do not expand type aliases in the generated members. Retain abbreviated types during flexible type approximation
#KT-13244 Fixed
2016-08-10 11:45:36 +03:00
Alexey Sedunov
1a4ff598e3 Override/Implement Members: Do not make return type non-nullable if base
return type is explicitly nullable
 #KT-13383 Fixed
 #KT-13379 Fixed
2016-08-10 11:45:35 +03:00
Alexey Sedunov
75573bd6a5 Quick Fixes: Use simple class name in "Change function return type" quickfix
#KT-12919 Fixed
2016-08-10 11:45:35 +03:00
Alexey Sedunov
f57c9279f9 Override/Implement Members: Support "Copy JavaDoc" options for library classes
#KT-12997 Fixed
2016-08-10 11:45:34 +03:00
Alexey Sedunov
8a9a3285de Introduce Variable: Skip leading/trailing comments inside selection
#KT-13054 Fixed
2016-08-10 11:45:33 +03:00
Alexey Sedunov
00b6839e59 Introduce Variable: Retain entered name after changing "Specify type explicitly" option
#KT-13128 Fixed
2016-08-10 11:45:32 +03:00
Alexey Sedunov
792177f206 Extract Function: Extract Function: Fix generation of destructuring declarations
#KT-13010 Fixed
2016-08-10 11:45:31 +03:00
Alexey Sedunov
06e767279b Extract Function/Parameter/Type Alias: Automatically quote declaration name when necessary
#KT-13157 Fixed
2016-08-10 11:45:30 +03:00
Alexey Sedunov
59a714ca5c Presentation: Render function signature in RefactoringDescriptionLocation
#KT-12943 Fixed
2016-08-10 11:45:29 +03:00
Alexey Sedunov
892c8436f3 Introduce Variable: Do not suggest expressions without type
#KT-12922 Fixed
2016-08-10 11:45:28 +03:00
Alexey Sedunov
3cd35f8a3b Rename: Fix function description in super method warning dialog
#KT-12945 Fixed
2016-08-10 11:45:27 +03:00
Ilya Gorbunov
e35a214eaf Review fixes: special case of toMap for singleton map.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov
efc8f2c88a Provide extensions to copy maps.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov
0ce4bce4a5 Changelog for 1.0.4: stdlib changes 2016-08-09 19:05:32 +03:00
Ilya Gorbunov
ae985e24ca Docs: clarify docs for 'generateSequence'. 2016-08-09 17:43:12 +03:00
Ilya Gorbunov
fed24c2be6 Docs: preserve empty lines in the generated documentation to separate summary and paragraphs in the body. 2016-08-09 17:43:12 +03:00
Ilya Gorbunov
e31167e74f Improve FileTreeWalk documentation,
#KT-13297 Fixed
2016-08-09 17:43:12 +03:00
Ilya Gorbunov
e7d250b7d7 Document that sequences could be iterated multiple times.
#KT-13115 Fixed
2016-08-09 17:43:12 +03:00
Denis Zharkov
1df9724c0c Refine stack frames markup calculation
It fixes VerifyError with coroutines on Dalvik happening because of
variables spilling before/after suspension point

BasicInterpreter from ASM does not distinct 'int' types from other
int-like types like 'byte' or 'boolean', neither do HotSpot and JVM spec.
But it seems like Dalvik does not follow it, and spilling
boolean value into an 'int' field fails with VerifyError on Android 4,
so it's necessary to distinct int types for variables spilling

 #KT-13289 Fixed
2016-08-09 16:36:52 +03:00
Denis Zharkov
d8c3cefc7c Extract backward analysis framework 2016-08-09 16:36:52 +03:00
Alexander Udalov
0d26087040 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed
2016-08-09 11:24:24 +03:00
Mikhail Glukhikh
30fd22499b Test data fix (after cherry-pick from 1.0.4) 2016-08-09 10:32:15 +03:00
Mikhail Glukhikh
b668206aa7 Minor: test comment, relevant to KT-13322
(cherry picked from commit 7606b1d)
2016-08-09 10:28:49 +03:00
Mikhail Glukhikh
729de536de Rewrite slice error removed for LEAKING_THIS #KT-13371 Fixed
Also EA-86478 fixed
(cherry picked from commit 5ac3126)
2016-08-09 10:28:40 +03:00
Mikhail Glukhikh
13e64c18d9 Correct CFA order for enums: first own members, then entries, and at last companion object members #KT-6054 Fixed
(cherry picked from commit 94d3b4c)
2016-08-09 10:28:27 +03:00
Alexander Udalov
1bc7b4e363 Fix test data 2016-08-08 21:48:10 +03:00
Alexander Udalov
d14843cb0e Update API listing of built-in classes in kotlin.reflect 2016-08-08 17:54:11 +03:00
Alexander Udalov
7f142253bf Reflection: simplify KTypeProjection 2016-08-08 17:54:11 +03:00
Alexander Udalov
a7f4037206 Reflection: change order of arguments of inner generic type
As in KClassifier.createType and everywhere in the compiler, specify arguments
for the innermost type first. This is more convenient to use because generally
the construction/introspection of such type starts from the innermost class
anyway (i.e. something like generateSequence can be used, without the need to
call .reverse() in the end)
2016-08-08 17:54:11 +03:00
Alexander Udalov
89d69bc7eb Reflection: add KClass.createInstance 2016-08-08 17:54:11 +03:00
Alexander Udalov
0525b1e6c1 Reflection: add KClass.declaredMembers 2016-08-08 17:54:11 +03:00
Alexander Udalov
30b7334e48 Reflection: add utilities to filter parameters by kind and name 2016-08-08 17:54:11 +03:00
Alexander Udalov
d78988a12a Reflection: add KVisibility, KClass.visibility, KCallable.visibility 2016-08-08 17:54:11 +03:00
Alexander Udalov
7e317f7a7c Reflection: add API for declaration modifiers
#KT-10447 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
ada81923dc Reflection: add KClass.isInstance, KClass.cast, KClass.safeCast
#KT-11284 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
3702f4a7a7 Reflection: add KClass.{isSubclassOf,isSuperclassOf}, KType.{isSubtypeOf,isSupertypeOf}
The behavior in primitives.kt is likely to be reconsidered

 #KT-8998 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
4cd252d9d5 Reflection: add KClass.{supertypes,superclasses,allSupertypes,allSuperclasses}
Some things are not implemented yet for allSupertypes, such as KType->Type
mapping of types and generic substitution of built-in types
2016-08-08 17:54:11 +03:00
Alexander Udalov
486ea62c72 Reflection: add KType.withNullability 2016-08-08 17:54:11 +03:00
Alexander Udalov
f958483e56 Reflection: deprecate KClass.defaultType
Its semantics were unclear and its javaType was implemented incorrectly (it
should have returned ParameterizedType with star projections for generic type)
2016-08-08 17:54:11 +03:00
Alexander Udalov
6b79782951 Reflection: add KClassifier.starProjectedType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
1edf3c7809 Reflection: add KClassifier.createType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
153e837a84 Reflection: add KType.jvmErasure
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
e760b5ed53 Reflection: add KTypeParameter.toString
The test covers different type parameters with and without bounds, in case we
decide to also output upper bounds in toString
2016-08-08 17:54:11 +03:00
Alexander Udalov
170ea4dead Reflection: add KVariance, KTypeParameter.{variance,upperBounds,equals,hashCode} 2016-08-08 17:54:11 +03:00
Alexander Udalov
127e7ab5b7 Reflection: add KClass.typeParameters, KCallable.typeParameters
Inheritance from KCallable is removed in kt9078.kt because it was irrelevant to
the test and because it gets in the way of modification of KCallable
2016-08-08 17:54:11 +03:00
Alexander Udalov
f69cc01f8e Reflection: add KTypeProjection and KType.arguments
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
c1dd831e65 Reflection: add KType.classifier
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
2ab0f489b5 Reflection: add KClassifier, KTypeParameter, KTypeParameter.name
The ability to obtain classifier from types is going to be added later
2016-08-08 17:54:11 +03:00
Alexander Udalov
5e3efe0e58 Reflection: improve support of built-in classes in 'toJavaClass'
Also support mock class descriptor created for java.io.Serializable. This will
be needed (and covered with tests) later for correct implementation of advanced
reflection API
2016-08-08 17:54:11 +03:00
Mikhail Glukhikh
0c98231f53 Report UNINITIALIZED_VARIABLE also for qualified object property #KT-12809 Fixed
(cherry picked from commit 7b2857f)
2016-08-08 17:48:08 +03:00
Mikhail Glukhikh
35446037bb UNINITIALIZED_ENUM_ENTRY compiler warning introduced #KT-2349 Fixed
(cherry picked from commit 76ac6d1)
2016-08-08 17:47:56 +03:00
Mikhail Glukhikh
b7ed68db05 CFA: No more UNRESOLVED_CALL for object / enum entry qualifiers
(cherry picked from commit 4b09de8)
2016-08-08 17:47:40 +03:00
Mikhail Glukhikh
962c2e5dd2 ControlFlowInformationProvider: convert to Kotlin
(cherry picked from commit a1394bc)
2016-08-08 17:45:52 +03:00
Mikhail Glukhikh
16cf6379c1 ControlFlowInformationProvider.java --> ControlFlowInformationProvider.kt
(cherry picked from commit 28bb9ea)
2016-08-08 17:45:41 +03:00
Alexander Udalov
de68d96236 Minor, add test for obsolete issue
#KT-12843 Obsolete
2016-08-08 15:42:52 +03:00
Valentin Kipyatkov
6ff91d1399 KT-12793 Code completion doesn't suggest abstract protected extension methods
#KT-12793 Fixed
2016-08-05 19:36:52 +03:00
Zalim Bashorov
88ad00b0bc JS backend: add the ability to get JS constructor function by class name and from instance. Support it for reified type parameters too. Add ability to get name of class.
#KT-5987 Fixed
 #KT-4115 Fixed
2016-08-05 18:13:05 +03:00
Zalim Bashorov
e7eb35b169 JS backend: always (explicitly) generate constructor function for classes. Use name of class as name of constructor function when it isn't special.
#KT-4115 In Progress
2016-08-05 18:13:05 +03:00
Nikolay Krasko
bfb4c48785 Minor: rename variables 2016-08-05 16:46:25 +03:00
Nikolay Krasko
c137b0d740 Decrease xmx in tests 2016-08-05 16:46:23 +03:00
Nikolay Krasko
bc0d302760 Use nullable value and destroy it in tearDown for REPL tests 2016-08-05 16:46:22 +03:00
Alexey Andreev
19cea48637 JS: add tests to show that #KT-12865 fixed as well 2016-08-05 16:32:27 +03:00
Alexey Andreev
4ff2b62bc0 KT-12864: add Comparable interface to Enum metadata so that RTTI should handle is Comparable case correctly 2016-08-05 16:32:27 +03:00
Michael Bogdanov
67808ef7fc Disable kt13133 test on android 2016-08-05 14:11:00 +03:00
Nikolay Krasko
300e0acd27 Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
2016-08-05 13:16:05 +03:00
Mikhail Zarechenskiy
95ea191442 Fix handling after ScriptTest execution: clean up temporary files on exit hooks
Test "testStandardScriptWithSaving" uses classloader and prevents from
 deleting temporary files on windows
2016-08-04 15:19:15 +03:00
Mikhail Zarechenskiy
7679e49b25 Do not generate properties for script parameters if there is template definition 2016-08-04 15:19:15 +03:00
Alexey Tsvetkov
e4226fbe48 Update changelog for 1.0.4 2016-08-04 11:27:08 +03:00
Natalia Ukhorskaya
7087f10660 Fixes after review: get last statement in codeFragmetn using psi instead of findElementAt 2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
ed204e9bac Minor: extract similar parts to separate function 2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
6a04cd39b2 Debugger: allow to evaluate kotlin expressions in java files
#KT-7549 Fixed

 If the context is inside PsiJavaFile, get list of all local variables available in current frame (this logic was removed in 29778311e8 01.12.2015 Drop unnecesary logic about additional context for lambda in debugger). For each variable create KtProperty inside top-level KtFunction in KtFile and set it as contextElement for KtCodeFragment. This file should have all imports from PsiJavaFile. We do not create properties on top-level because they will be highlighted as top-level vals/vars.
2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
d823d6f4ab Debugger tests: mark objects using NodeDescriptorImpl.getMarkup. Primitive values cannot be marked. 2016-08-03 17:51:49 +03:00
Pavel V. Talanov
252b8ec6db Add assertions to prohibit creating LazyJavaClassDescriptor by KtLightClass
Diagnosing KT-12966
2016-08-03 17:29:08 +03:00
Pavel V. Talanov
30892e0154 KtLightClassForDecompiledDeclaration is now marked by KtLightClassMarker
Rename: KtJavaMirrorMarker -> KtLightClassMarker
Introduce code to be able to tell light classes from source and binaries apart in 'frontend.java'
2016-08-03 17:29:06 +03:00
Alexey Tsvetkov
d402a15049 Update changelog for 1.0.4 2016-08-03 15:09:20 +03:00
Alexey Tsvetkov
e0ebf2482b Configure KotlinCompile.destinationDir before evaluation
Previously it was possible to refer to destinationDir
in gradle scripts (evaluation phase), so in order to
preserve compatibility destinationDir should be configured
before evaluation.

This does not affect android plugin because in this case kotlin
tasks were created after evaluation anyway, so it
was not possible to refer to destinationDir
during evaluation anyway.
2016-08-03 13:09:56 +03:00
Ilya Chernikov
1248230c69 Fix after review, add logging for scripting-specific behavior 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
fbc5d64aab gradleScriptTemplateProvider: fix NPE 2016-08-03 09:51:40 +02:00
Ilya Chernikov
f73b8e80be Fixes after review 2016-08-03 09:51:40 +02:00
Ilya Chernikov
df64736192 Refactor script dependnecies template and resolver interfaces:
- get rid of obsolete interfaces and annotations
- rename actual resolver interface to ScriptDependenciesResolver
- make ScriptDependenciesResolverEx interface compatible with the one from 1.1-M01 to be able to support both on the provider side
- add possibility to override file patter in the script template provider
- construct resolver lazily, if possible
2016-08-03 09:51:40 +02:00
Ilya Chernikov
8024367915 Move KotlinScriptDefinitionFromTemplate to separate file...
leaving only interfaces in the scriptTemplate.kt. It could now be extracted into the separate lib if necessary.
2016-08-03 09:51:40 +02:00
Ilya Chernikov
c73ab6c0a1 Fix pathlist comparison - fixes too frequent caches updates 2016-08-03 09:51:40 +02:00
Ilya Chernikov
31d9da3d4f Update resolver interface - make it return Future and add message reporter function +
plus minor fixes
2016-08-03 09:51:40 +02:00
Ilya Chernikov
5117ecb817 Collect annotations lazily 2016-08-03 09:51:40 +02:00
Ilya Chernikov
80f7dda6c7 Update gradle script resolver environment:
- JVM options from IDEA config to connect/run daemon with appropriate options (need to be tested)
- A lexing function to allow gradle plugin to check whether dependency-defining part of the script is actually changed
2016-08-03 09:51:40 +02:00
Ilya Chernikov
3b1e7494b8 Change dependencies resolver API - it gets message reporter and returns Future now 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
464445c260 KotlinCacheServiceImpl: Add all sdks from project sdk table when building facadeForSdk
As of now facadeForSdk should contain all sdks that we can possibly reference while resolving including those that scripts depend on
More granular approach may be beneficial in the future
2016-08-03 09:51:40 +02:00
Ilya Chernikov
45ed340444 Add passing of allowKotlinPackage option from gradle plugin to compiler 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
bc0ccd4861 Refactor: move script module info related code to a separate file 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
a8416035b1 IDE Script support: use particular scripts dependencies when building analyzers
Use javaHome property to detect jdk to analyze script files against, use default jdk if it's null
2016-08-03 09:51:40 +02:00
Pavel V. Talanov
350abbe8cd KotlinScriptConfigurationManager, minor: Extract utility to get transform list of file to vfs roots 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
500554e58c Clarify API so that it's possible to get single KotlinScriptExternalDependencies per script file 2016-08-03 09:51:40 +02:00
Ilya Chernikov
59712d4bf8 Implement updatable dependencies index with usage API in the environment for using in REPL 2016-08-03 09:51:40 +02:00
Ilya Chernikov
210a37e08c Support for multiparam dependency annotations (with reservations)
Due to missing feature (#KT-13106) it works either with single argument
or with all named arguments.
2016-08-03 09:51:40 +02:00
Ilya Chernikov
5900cad8b3 Add possibility to pass script dependency resolver directly rather than via definition annotation
This may help to reduce dependencies in certain situations
2016-08-03 09:51:40 +02:00
shiraji
5fb79259f7 Intention / inspection for unnecessary lateinit #KT-13011 Fixed
(cherry picked from commit 45d82f1)
2016-08-03 09:31:03 +03:00
Mikhail Glukhikh
d868410093 Single-expression string template is inspection for strings and intention otherwise #KT-13113 Fixed
(cherry picked from commit 266f9d0)
2016-08-02 15:31:16 +03:00
shiraji
9b8c55d823 KT-13113: Add inspection to detect single-expression string template
(cherry picked from squashed commits 49a3ef3 and 4c7a42a)
2016-08-02 15:30:23 +03:00
Nikolay Krasko
a9ee10a8b7 Ignore intervals that has no mapping for origin line (KT-12896) 2016-08-02 01:05:08 +03:00
Nikolay Krasko
2dd7470cdc Better search for inlined strings in strata: there might me several file mappings to the same file (KT-12896)
#KT-12896 In Progress
2016-08-02 01:05:05 +03:00
Nikolay Krasko
ace58e8aa2 Refactorings: functions moves 2016-08-02 01:02:07 +03:00
Nikolay Krasko
5df7358dab Fix breakpoints in inline functions after dexing (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
64979ae190 Allow to step into inline functions while debugging Android app (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
2a2d7cd358 Emulate debugging after dexing for stepping tests with 'dex' prefix (KT-12896)
Remove SourceDebugExtension attribute from resulting class files

 #KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
ad1907f48d Refresh output dirs to make CompilerPaths.getModuleOutputDirectory() method work 2016-08-02 01:02:07 +03:00
Nikolay Krasko
64e034959f Refactoring: introduce constants with strata names and reuse them in debugger 2016-08-02 01:02:07 +03:00
Nikolay Krasko
66bbcf470c Refactoring: move smapUtil and DebuggerUtils to debugger package 2016-08-02 01:02:07 +03:00
Mikhail Glukhikh
39090113e9 KT-13262 related: surround with null check is applicable now also for qualified calls with argument type mismatch
(cherry picked from commit 8f13c84)
2016-08-01 12:24:49 +03:00
Mikhail Glukhikh
b7fd41844d Wrap with safe let call handles qualified calls correctly #KT-13262 Fixed
(cherry picked from commit 7044348)
2016-08-01 12:24:38 +03:00
Mikhail Glukhikh
77b7648f10 Build fix: replace call with comparison inspection test
(cherry picked from commit 7f6be5b)
2016-08-01 12:24:27 +03:00
Mikhail Glukhikh
475dc6541b Replace call with comparison inspection introduced #KT-11425 Fixed
(cherry picked from commit 042fc0d)
2016-08-01 12:24:14 +03:00
Mikhail Glukhikh
fc13b25ca4 KT-11425: convert a.compareTo(b) to binary comparison if possible
(cherry picked from commit 7219904)
2016-08-01 12:23:19 +03:00
Mikhail Glukhikh
f309021c9f KT-11425: convert !a.equals(b) to a != b
(cherry picked from commit 56c7786)
2016-08-01 12:23:07 +03:00
Mikhail Glukhikh
2850a7898d KT-11425: replace call with binary operator works now also with equals() and ==
(cherry picked from commit 5d47fdf)
2016-08-01 12:22:54 +03:00
Ilya Gorbunov
39d7d3381c Make unchecked cast in Map.getOrDefault extension that is covariant by K, since getOrDefault member now requires K as key.
Relates to #KT-13209.
2016-07-29 21:03:56 +03:00
Ilya Gorbunov
0a0bdbc8b3 Minor: fix test source root 2016-07-29 21:03:56 +03:00
Mikhail Glukhikh
d8bd90fb90 ReplaceInfixCallFix --> ReplaceInfixOrOperatorCallFix
(cherry picked from commit 679867b)
2016-07-29 20:12:21 +03:00
Mikhail Glukhikh
995a633229 Replace with safe call works now on UNSAFE_IMPLICIT_INVOKE #KT-12628 Fixed
(cherry picked from commit 208798d)
2016-07-29 20:12:11 +03:00
Mikhail Glukhikh
a9c30e878b KT-12628: !! is now correctly added to array expressions
(cherry picked from commit 56c9d7e)
2016-07-29 20:12:02 +03:00
Mikhail Glukhikh
47493c1a65 KT-12628: replace infix call supports now array accesses too
(cherry picked from commit 3d67f84)
2016-07-29 20:11:45 +03:00
Mikhail Glukhikh
c439a751ab KT-12628: new test for arg + something with nullable arg
(cherry picked from commit a7e4e2d)
2016-07-29 20:11:36 +03:00
Mikhail Glukhikh
9830140a15 Make constructor parameter a property: additional test for private property in superclass
(cherry picked from commit dd30bd5)
2016-07-29 20:11:27 +03:00
Mikhail Glukhikh
838cfc7dca Make constructor parameter a property: select 'private' to be able to remove it #KT-13187 Fixed
(cherry picked from commit dc8c195)
2016-07-29 20:11:18 +03:00
Mikhail Glukhikh
0278a6c8a4 Make constructor parameter a property: message shortened a bit
(cherry picked from commit 1938909)
2016-07-29 20:11:09 +03:00
Alexey Tsvetkov
e51f2457bf Add additional java source dir to source set in android test 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
ef70814f60 Refactoring: extract function to map classpath 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
2cae5f01cf Move call to kotlinTask.source to doTargetSpecificProcessing 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
ad1340caf3 Refactoring: move mapKotlinTaskProperties call to createKotlinJVMTask 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
048982cf36 Refactor classpath handling in KotlinCompile
#KT-13234 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
815e297328 Add test for code using internal compiled incrementally
The issue was fixed during refactoring

    #KT-12923 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
2e3b3da029 Track changes in generated source files
#KT-12962 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
7fe29a7e55 Refactoring: simplify source roots search 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
b13e1b451d Refactoring: use convention mapping for configuring classpath of kotlin tasks
#KT-12658 fixed
    #KT-12750 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d55a8f8054 Refactor source configuration for android 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d36de54aa9 Minor: cleanup 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d376e76e75 Refactoring: set task properties directly 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
54659fcacf Refactoring: remove extra property to pass stubs directory 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
92af1e9454 Refactoring: do not use extraProperties to pass kapt options to task 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
c838eed6a3 Refactoring: remove reflection calls 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
f297de401c Refactoring: remove remainings of custom classloader in gradle plugin 2016-07-29 17:56:30 +03:00
Stanislav Erokhin
aa91b5a1b0 KT-13264 IAE: Argument for @NotNull parameter 'errorClass' createErrorTypeConstructorWithCustomDebugName must not be null
#KT-13264 Fixed
2016-07-29 17:53:12 +03:00
Stanislav Erokhin
19e4dbc37c Refactoring. Move functionTypeResolveUtils.kt to resolution module. 2016-07-29 17:53:11 +03:00
Stanislav Erokhin
df461d6e7f Refactoring. Remove supertype TowerContext from class InvokeTowerContext. 2016-07-29 17:53:11 +03:00
Stanislav Erokhin
2c2f105c5d Do not add receiver for function expression by expected type. 2016-07-29 17:53:10 +03:00
Dmitry Petrov
2b63c6a2d5 Merge branch 'typealias_completion' of https://github.com/cypressious/kotlin into cypressious-typealias_completion 2016-07-28 18:07:43 +03:00
Pavel V. Talanov
3bb1ce7e1d Sync code in 'idea-ultimate' 2016-07-28 18:01:01 +03:00
Pavel V. Talanov
7273ef2754 Fix test data 2016-07-28 18:01:00 +03:00
Pavel V. Talanov
5600433baf KtLightClassForSourceDeclaration.create(): check for enum entry earlier 2016-07-28 18:00:59 +03:00
Pavel V. Talanov
82a2b94490 LightClassDataProvider: FqName calculation is redundant now 2016-07-28 18:00:58 +03:00
Pavel V. Talanov
ae0d450acf Light class test for classes with dollars in name 2016-07-28 18:00:58 +03:00
Pavel V. Talanov
e51957a431 PsiChecker test for classes with dollars in name 2016-07-28 18:00:57 +03:00
Pavel V. Talanov
4ee0f7052f StubClassBuilder: correctly calculate short name when building delegates for light classes 2016-07-28 18:00:56 +03:00
Pavel V. Talanov
c85ddc3da2 Do not build light classes for scripts
Supports old behaviour
2016-07-28 18:00:55 +03:00
Pavel V. Talanov
913a1baf56 FqName is not required to create source light classes 2016-07-28 18:00:54 +03:00
Pavel V. Talanov
5a1a1fc03a Drop KtLightClass#getFqName() and some usages of classFqName in KtLightClassForDecompiledDeclaration 2016-07-28 18:00:53 +03:00
Pavel V. Talanov
1fda24fbbf Local classes do not have qualified names
Mirros java psi
2016-07-28 18:00:52 +03:00
Pavel V. Talanov
85fb16ef1b Refactor: restructure light class hierarchy for sources
KtLightClassBase
	| KtLightClassForSourceDeclaration
		| KtLightClassImpl (new!) // top level or inner/nested of top level class
		| KtLightClassForInterfaceDefaultImpls
		| KtLightClassForLocalDeclaration (new!)
			| KtLightClassForAnonymousDeclaration
				| KtLightClassForEnumEntry
2016-07-28 18:00:52 +03:00
Pavel V. Talanov
252235787d Refactor: rename KtWrappingLightClass -> KtLightClassBase 2016-07-28 18:00:51 +03:00
Pavel V. Talanov
999c8e7486 Refactor: rename KtLightClassForExplicitDeclaration -> KtLightClassForSourceDeclaration 2016-07-28 18:00:50 +03:00
Pavel V. Talanov
b686b37cbf Refactor: move KotlinCodeBlockModificationListener to 'idea-analysis' module 2016-07-28 18:00:49 +03:00
Pavel V. Talanov
0294551433 Refactor: move OldPackageFacadeClassUtils to 'frontend.jvm' module 2016-07-28 18:00:48 +03:00
Pavel V. Talanov
cdbd7fbab0 Refactor: split classes in 'asJava' package into several subpackages to reflect their structure 2016-07-28 18:00:47 +03:00
Nikolay Krasko
033efbda41 Refactoring: move KtLightField interface to file with light elements 2016-07-28 18:00:46 +03:00
Pavel V. Talanov
0b4c6bd889 Drop PsiCodegenPredictor 2016-07-28 18:00:45 +03:00
Dmitry Petrov
a08e70879f KT-13161 java static methods call not working for typealias
Introduce special qualifier for type aliases with member scope
containing static class members only.
2016-07-28 17:38:36 +03:00
Nikolay Krasko
5a5cd0e760 Refactoring: extract DebuggerClassNameProvider 2016-07-28 15:33:43 +03:00
Nikolay Krasko
50e196dfb9 Minor: invert if, clean up 2016-07-28 15:33:43 +03:00
Nikolay Krasko
097288d15f Refactoring: fix weak warning about unnecessary escaped dot 2016-07-28 15:33:43 +03:00
Nikolay Krasko
e7ee0d1c5e Refactoring: extract pattern to variable and add language injection 2016-07-28 15:33:43 +03:00
Nikolay Krasko
071285fad7 Refactoring: additional changes in smap functions and KotlinExceptionFilter 2016-07-28 15:33:43 +03:00
Nikolay Krasko
f71e24403f Refactoring: working with smap methods 2016-07-28 15:33:43 +03:00
Nikolay Krasko
fcf0b7a66c Refactoring: extract functions working with smap to separate file 2016-07-28 15:33:43 +03:00
Mikhail Glukhikh
6e391854a0 Data flow values refactoring: removed DataFlowValue.kind.isStable, renamed DataFlowValue.isPredictable -> DataFlowValue.isStable 2016-07-28 15:14:48 +03:00
Kirill Rakhman
f378089b96 Fix Completion: keyword 'typealias' is not suggested
Fixes #KT-13242
2016-07-27 19:02:08 +02:00
Denis Zharkov
915e36cb02 Add Map.getOrDefault method as PlatformDependent declaration with refined signature
- First parameter should have type of K instead of Any
- Special bridge should return second parameter if a key has wrong type
- Special bridge may throw an exception if defaultValue has wrong type

 #KT-13209 Fixed
2016-07-27 18:46:13 +03:00
Denis Zharkov
169acf2f31 Refine method's contract and rename it
Basically what's it checked before is that
receiver is a valid override of raw version of builtinWithErasedParameters

While we need to check that method has the same JVM descriptor as builtinWithErasedParameters,
but it's not a valid override of latter

It's important for 'getOrDefault(Object k, V value)' ('getOrDefault(K k, V value)' in Kotlin):
'getOrDefault(Object k, V value)' is not override of 'getOrDefault(Object k, Object value)',
that leads to incorrect loading of former method (like it's not an override of declaration in Map)
2016-07-27 18:46:13 +03:00
Denis Zharkov
15b94bb8df Minor. Move method closer to it's usage and simplify it 2016-07-27 18:46:13 +03:00
Denis Zharkov
f2cb86c3f6 Minor. Fix testData 2016-07-27 18:46:13 +03:00
Alexey Andreev
efb5a9eca6 KT-13160: when decomposing assignment with lhs like array[index], extract array instead of supporting only qualifier.name` 2016-07-27 18:28:28 +03:00
Mikhail Glukhikh
4f7d8e34b0 Data flow values: initializers for local variables are now stored as "bound values" with inherited nullability #KT-6840 Fixed 2016-07-27 16:24:50 +03:00
Mikhail Glukhikh
7090abddcd Data flow values: variable-based are no more compared with taking kind into account 2016-07-27 16:24:46 +03:00
Mikhail Glukhikh
f96b9ddbf5 Minor: unused imports in IdentifierInfo 2016-07-27 16:24:41 +03:00
Mikhail Glukhikh
e515d7f773 Data flow analysis: unnecessary assignment removed (related to complex expressions) 2016-07-27 16:24:36 +03:00
Mikhail Glukhikh
1c9f08e986 Data flow values: STABLE_COMPLEX_EXPRESSION kind is removed, no use cases exist for them 2016-07-27 16:24:32 +03:00
Mikhail Glukhikh
c7af3f7865 Data flow values: more accurate handling of postfix ++ and -- 2016-07-27 16:24:27 +03:00
Mikhail Glukhikh
7c66f632ca Receiver smart casts: additional test for a?.b() when b is invokable property 2016-07-27 16:24:23 +03:00
Mikhail Glukhikh
692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Dmitry Petrov
26c8bc87fd KT-13241 Indices optimization leads to VerifyError with smart cast receiver
Use expected receiver type from the corresponding extension function.
2016-07-27 13:21:22 +03:00
Stanislav Erokhin
f3be1b8f1f Add assertion for variable as function call with explicit type parameters. 2016-07-27 13:17:15 +03:00
Mikhail Glukhikh
b56e84d47f Cast never succeeds: special 'Nothing' / 'Nothing?' case
(cherry picked from commit 63435b4)
2016-07-27 10:52:13 +03:00
Mikhail Glukhikh
bf4231d65a Standard library regenerated
(cherry picked from commit 68af26c)
2016-07-27 10:52:01 +03:00
Mikhail Glukhikh
94029393cb kotlin-stdlib-gen: UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS
(cherry picked from commit feab6f3)
2016-07-27 10:51:51 +03:00
Mikhail Glukhikh
a2b68f65be Suppress CAST_NEVER_SUCCEEDS removed from standard library code
(cherry picked from commit 7d9aa04)
2016-07-27 10:51:41 +03:00
Mikhail Glukhikh
b88282c0fc Suppress CAST_NEVER_SUCCEEDS removed from source code
(cherry picked from commit d448a92)
2016-07-27 10:51:30 +03:00
Mikhail Glukhikh
a902c4901a CAST_NEVER_SUCCEED: replace subtyping check with subclassing check #KT-13206 Fixed
(cherry picked from commit 5fc797a)
2016-07-27 10:51:13 +03:00
Mikhail Glukhikh
17c824f7f2 KT-13170 related: correct handling of inspection parameters in additional checker
(cherry picked from commit 47fd990)
2016-07-27 10:50:58 +03:00
Mikhail Glukhikh
ff2f49fa8f Has platform type inspection: do not report by default on Kotlin types with platform arguments #KT-13170 Fixed
Also #KT-12820 Obsolete
(cherry picked from commit 0589b48)
2016-07-27 10:50:45 +03:00
Mikhail Glukhikh
8600e7348c Can be val inspection: local functions are taken into account #KT-13151 Fixed
(cherry picked from commit 57eb4c1)
2016-07-27 10:50:31 +03:00
Alexander Udalov
0380b6cd88 Never resolve modality of members to SEALED 2016-07-26 21:16:15 +03:00
Alexander Udalov
b72293883d Fix algorithm of determining modality for fake overrides
Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed
2016-07-26 21:16:15 +03:00
22954 changed files with 736875 additions and 209174 deletions

21
.gitignore vendored
View File

@@ -7,17 +7,18 @@
/gh-pages
/ideaSDK
/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/
.gradle/
build/
!**/src/**/build

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,5 +18,6 @@
</properties>
</buildFile>
<buildFile url="file://$PROJECT_DIR$/TeamCityRelay.xml" />
<buildFile url="file://$PROJECT_DIR$/node_utils.xml" />
</component>
</project>

View File

@@ -1,27 +0,0 @@
<component name="ArtifactManager">
<artifact name="KotlinBarePlugin">
<output-path>$PROJECT_DIR$/out/artifacts/BareKotlin</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="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />
</element>
<element id="directory" name="lib">
<element id="archive" name="kotlin-bare-plugin.jar">
<element id="module-output" name="bare-plugin" />
<element id="module-output" name="descriptor.loader.java" />
<element id="module-output" name="frontend.java" />
<element id="module-output" name="descriptors" />
</element>
<element id="directory" name="jps">
<element id="artifact" artifact-name="KotlinJpsPlugin" />
</element>
</element>
</root>
</artifact>
</component>

View File

@@ -11,7 +11,6 @@
<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" />
@@ -25,6 +24,7 @@
<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

@@ -10,6 +10,7 @@
<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" />
@@ -24,11 +25,12 @@
<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.dart-ast" />
<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" />
@@ -53,28 +55,56 @@
<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 id="module-output" name="frontend.script" />
</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="archive" name="android-extensions-ide.jar">
<element id="module-output" name="android-extensions-idea" />
</element>
<element id="archive" name="kotlin-android-extensions-compiler-plugin.jar">
<element id="archive" name="android-extensions-compiler.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="uast-java" />
<element id="module-output" name="uast-common" />
<element id="module-output" name="lint-checks" />
<element id="library" level="project" name="guava" />
<element id="module-output" name="lint-api" />
<element id="module-output" name="uast-android" />
<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$/dependencies/bootstrap-compiler/Kotlin/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 id="library" level="project" name="kotlinx-coroutines-core" />
<element id="library" level="project" name="javaslang" />
</element>
<element id="directory" name="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />

View File

@@ -60,6 +60,9 @@
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
@@ -142,10 +145,6 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>

10
.idea/compiler.xml generated
View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<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>
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
@@ -18,14 +18,8 @@
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="android-studio" target="1.8" />
<module name="bare-plugin" target="1.8" />
<module name="idea" target="1.8" />
<module name="idea-analysis" target="1.8" />
<module name="idea-completion" target="1.8" />

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>crossinline</w>
<w>fqname</w>
<w>goto</w>
<w>gradle</w>
@@ -16,6 +17,7 @@
<w>preloading</w>
<w>preprocess</w>
<w>redeclarations</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>

View File

@@ -3,6 +3,7 @@
<words>
<w>ctor</w>
<w>interner</w>
<w>kclass</w>
<w>lookups</w>
<w>unescape</w>
</words>

View File

@@ -3,6 +3,7 @@
<words>
<w>decapitalize</w>
<w>delegator</w>
<w>elipsis</w>
<w>funs</w>
<w>immediates</w>
<w>initializers</w>
@@ -17,6 +18,7 @@
<w>renderers</w>
<w>rparenth</w>
<w>selectioner</w>
<w>smartcast</w>
<w>summand</w>
<w>unpluralize</w>
<w>weighers</w>

9
.idea/dictionaries/yan.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="yan">
<words>
<w>impls</w>
<w>kapt</w>
<w>uast</w>
</words>
</dictionary>
</component>

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">
@@ -236,6 +235,7 @@
<scope name="idea openapi" level="WARNING" enabled="true" />
<scope name="runtime.classes" level="ERROR" enabled="true" />
</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" />
@@ -342,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">
@@ -411,6 +412,7 @@
<inspection_tool class="UnnecessaryUnboxing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitNotInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitWhileHoldingTwoLocks" enabled="true" level="WARNING" enabled_by_default="true" />

4
.idea/kotlinc.xml generated
View File

@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
</component>
<component name="KotlinCompilerSettings">
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />
</component>

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

@@ -8,7 +8,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
</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

@@ -4,11 +4,11 @@
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-17.0.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/guava-19.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/guava-19.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -9,9 +9,9 @@
</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$/dependencies/guava-19.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/lib" recursive="false" />
</library>

View File

@@ -5,14 +5,25 @@
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/core" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/annotations.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/asm-all.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/guava-19.0.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/intellij-core.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/jdom.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/jna.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/log4j.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/picocontainer.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/snappy-in-java-0.5.1.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/trove4j.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/util.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/xpp3-1.1.4-min.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/core/xstream-1.4.8.jar!/" />
</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$/dependencies/guava-19.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm-src.zip!/" />
</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>

11
.idea/libraries/javaslang.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="javaslang">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/javaslang-2.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/javaslang-2.0.6-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,9 @@
<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

@@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="kotlinx-coroutines-core">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-core.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/kotlinx-coroutines-core-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -5,6 +5,7 @@
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/properties/lib/properties.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/properties/lib/resources_en.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

15
.idea/libraries/uast_java.xml generated Normal file
View File

@@ -0,0 +1,15 @@
<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>

3
.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>
@@ -49,7 +48,7 @@
<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">

31
.idea/modules.xml generated
View File

@@ -3,23 +3,29 @@
<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$/jps-plugin/bare-plugin/bare-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/bare-plugin/bare-plugin.iml" group="ide/jps" />
<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" />
@@ -35,6 +41,7 @@
<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$/compiler/frontend.script/frontend.script.iml" filepath="$PROJECT_DIR$/compiler/frontend.script/frontend.script.iml" group="compiler" />
<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" />
@@ -50,11 +57,18 @@
<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$/compiler/javac-wrapper/javac-wrapper.iml" filepath="$PROJECT_DIR$/compiler/javac-wrapper/javac-wrapper.iml" group="compiler" />
<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.dart-ast/js.dart-ast.iml" filepath="$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" group="compiler/js" />
<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.dce/js.dce.iml" filepath="$PROJECT_DIR$/js/js.dce/js.dce.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" />
@@ -62,10 +76,14 @@
<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" />
@@ -73,12 +91,15 @@
<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$/plugins/source-sections/source-sections-compiler/source-sections-compiler.iml" filepath="$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/source-sections-compiler.iml" group="plugins" />
<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$/plugins/lint/uast-android/uast-android.iml" filepath="$PROJECT_DIR$/plugins/lint/uast-android/uast-android.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-common/uast-common.iml" filepath="$PROJECT_DIR$/plugins/uast-common/uast-common.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-java/uast-java.iml" filepath="$PROJECT_DIR$/plugins/uast-java/uast-java.iml" group="plugins/lint" />
<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>

View File

@@ -13,7 +13,7 @@
<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="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -13,7 +13,7 @@
<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="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -13,7 +13,7 @@
<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 -Xmx1300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -8,7 +8,7 @@
<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="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -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" />

View File

@@ -6,7 +6,7 @@
<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" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

View File

@@ -3,7 +3,7 @@
<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="ALTERNATIVE_JRE_PATH" value="1.8" />
<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="" />

View File

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.6 on JDK 1.6" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.6 -Dkotlin.test.box.in.separate.process.port=5100 -Dkotlin.test.java.compilation.target=1.6 -ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -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="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.6 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.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.6 -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -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

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.8 on JDK 1.8" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -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="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 1.8 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.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -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

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Codegen Tests with JVM target 9 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.codegen.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="9-ea" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-Dkotlin.test.default.jvm.target=1.8 -Dkotlin.test.substitute.bytecode.1.8.to.1.9=true -ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -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

@@ -13,7 +13,7 @@
<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="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -11,7 +11,7 @@
<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" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
@@ -26,6 +26,9 @@
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
<method>
<option name="Make" enabled="false" />
<option name="MakeNoErrorCheck" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -1,8 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="Application" factoryName="Application" singleton="true">
<log_file path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" checked="true" skipped="true" show_all="false" alias="idea.log" />
<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="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -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" />
@@ -43,7 +44,6 @@
<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>

View File

@@ -1,12 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<log_file path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" checked="true" skipped="true" show_all="false" alias="idea.log" />
<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="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=128m -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" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

View File

@@ -13,7 +13,7 @@
<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="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Dkotlin.colors.enabled=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -0,0 +1,28 @@
<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=128m -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

@@ -8,7 +8,7 @@
<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="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true -Dkotlin.js.generateThreshold=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

File diff suppressed because it is too large Load Diff

View File

@@ -14,35 +14,63 @@
<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/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/annotation-processor-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/browser-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/browser-example-with-library/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/js-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-gradle-subplugin-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/examples/kotlin-js-library-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-jsr223-daemon-local-eval-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/examples/kotlin-jsr223-local-example/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/common/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/js/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/junit/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/kotlin.test/jvm/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/common/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/jre7/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/jre8/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/js/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/stdlib/js/node_modules" />
<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/binary-compatibility-validator/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/idl2k/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-allopen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-android-extensions/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-annotation-processing/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-annotation-processing-maven/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-build-common-test/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-compiler-client-embeddable/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-client-embeddable-test/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-embeddable/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-compiler-runner/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-daemon-client/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-api/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-gradle-plugin-integration-tests/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-allopen/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-maven-noarg/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" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-noarg/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-osgi-bundle/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-reflect/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-sam-with-receiver-compiler-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-script-util/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-source-sections-compiler-plugin/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/kotlin-stdlib-gen/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-jvm/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/native-platform/target" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/protobuf-lite/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/runtime/build" />
<excludeFolder url="file://$MODULE_DIR$/libraries/tools/script-runtime/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

127
ReadMe.md
View File

@@ -1,38 +1,38 @@
<a href="http://kotlinslackin.herokuapp.com"><img src="https://kotlinslackin.herokuapp.com/badge.svg" height="20"></a>
<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)
[![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)
# Kotlin Programming Language
Welcome to [Kotlin](http://kotlinlang.org/)! Some handy links:
Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin Site](http://kotlinlang.org/)
* [Getting Started Guide](http://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](http://try.kotlinlang.org/)
* [Kotlin Standard Library](http://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](http://youtrack.jetbrains.com/issues/KT)
* [Forum](http://devnet.jetbrains.net/community/kotlin?view=discussions)
* [Kotlin Blog](http://blog.jetbrains.com/kotlin/)
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [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](http://kotlinslackin.herokuapp.com/)
* [Public Slack channel](https://kotlinslackin.herokuapp.com/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Kotlin Eclipse Plugin](http://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin Eclipse Plugin](https://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin TextMate Bundle](https://github.com/vkostyukov/kotlin-sublime-package)
## Build environment requirements
In order to build Kotlin distribution you need to have:
- Apache Ant 1.8 and higher
- Apache Ant 1.9.4 and higher
- 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"
@@ -45,65 +45,49 @@ 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
ant -f build.xml
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](http://www.liferay.com/community/wiki/-/wiki/Main/Ant+opts).
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).
**OPTIONAL:** Maven distribution is built separately, run
**OPTIONAL:** Maven artifact distribution is built separately, go into `libraries` directory after building the compiler and run:
mvn package
./gradlew build install
mvn install
from 'libraries' directory after building the compiler. Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
> Note: on Windows type `gradlew` without the leading `./`
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.
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,
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.
If you are not dealing with Android, you may need to disable the Android Plugin in order to compile the project.
### <a name="installing-plugin"></a> Installing the latest Kotlin plugin
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).
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](http://devnet.jetbrains.net/docs/DOC-181) which describes how to have multiple IntelliJ IDEA installations using different configurations and plugin directories.
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
* 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.
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
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 setup IDEA to update the plugin directly from the build server.
Open:
Preferences -> Plugins -> Browse Repositories -> Manage Repositories...
@@ -113,10 +97,22 @@ and add the following URL to your repositories:
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.
If you want to keep an IntelliJ IDEA installation with that bleeding edge Kotlin plugin for working Kotlin project sources only separate to your default IntelliJ IDEA installation with the stable Kotlin
plugin [see this document](https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage), which describes how to have multiple IntelliJ IDEA installations using different configurations and plugin directories.
### 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
* 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.
# Contributing
We love contributions! There's [lots to do on Kotlin](http://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
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=%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://kotlinslackin.herokuapp.com/)
and let us know about your plans.
@@ -124,12 +120,12 @@ If you want to find some issues to start off with, try [this query](https://yout
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
A nice gentle way to contribute would be to review the [standard library docs](http://kotlinlang.org/api/latest/jvm/stdlib/index.html)
A nice gentle way to contribute would be to review the [standard library docs](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
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()`](http://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.
@@ -139,8 +135,8 @@ Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/maste
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)
* download a recent [IntelliJ IDEA](https://www.jetbrains.com/idea/?fromMenu#chooseYourEdition), Community edition is enough
* [install the Kotlin plugin](#installing-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
@@ -152,21 +148,24 @@ You can now run the various Run/Debug Configurations such as
## 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)
* download a recent [IntelliJ IDEA](https://www.jetbrains.com/idea/?fromMenu#chooseYourEdition), Community edition is enough
* [install the Kotlin plugin](#installing-plugin)
* open the [kotlin libraries project](https://github.com/JetBrains/kotlin/tree/master/libraries)
Then build via
cd libraries
./gradlew build install
mvn install
> Note: on Windows type `gradlew` without the leading `./`
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
The best way to submit a patch is to [fork the project on github](http://help.github.com/fork-a-repo/) then send us a
[pull request](http://help.github.com/send-pull-requests/) via [github](http://github.com).
The best way to submit a patch is to [fork the project on github](https://help.github.com/articles/fork-a-repo/) then send us a
[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
@@ -175,6 +174,6 @@ 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](http://youtrack.jetbrains.com/issues/KT), the issue will get automatically marked as fixed.
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

@@ -11,16 +11,15 @@
<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"/>
<property name="plugin.xml.version.number" value="${build.number}"/>
<property name="compiler.version.java" value="compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/KotlinVersion.java"/>
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinVersion.java.bk"/>
<property name="compiler.version.java" value="core/util.runtime/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java"/>
<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="bare.plugin.zip" value="${artifact.output.path}/kotlin-bare-plugin-${build.number}.zip"/>
<property name="kotlin.bare.plugin.xml" value="jps-plugin/bare-plugin/src/META-INF/plugin.xml"/>
<property name="kotlin.bare.plugin.xml.bk" value="${version_substitute_dir}/kotlin.bare.plugin.xml.bk"/>
<macrodef name="echoprop">
<attribute name="prop"/>
@@ -75,37 +74,36 @@
</sequential>
</macrodef>
<target name="writeVersionToTemplateFiles">
<target name="writeCompilerVersionToTemplateFile">
<mkdir dir="${version_substitute_dir}"/>
<substituteVersionInFile
target.file="${plugin.xml}"
target.file.bk="${plugin.xml.bk}"
target.file.versioned="${plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
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}"/>
</target>
<target name="writePluginVersionToTemplateFile">
<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;;"/>
<substituteVersionInFile
target.file="${kotlin.bare.plugin.xml}"
target.file.bk="${kotlin.bare.plugin.xml.bk}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
</target>
target.file="${plugin.xml}"
target.file.bk="${plugin.xml.bk}"
target.file.versioned="${plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"
version="${plugin.xml.version.number}"/>
</target>
<target name="revertTemplateFiles">
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
<copy file="${compiler.version.java.bk}" tofile="${compiler.version.java}" overwrite="true"/>
<copy file="${kotlin.bare.plugin.xml.bk}" tofile="${kotlin.bare.plugin.xml}" overwrite="true"/>
<delete dir="${version_substitute_dir}" quiet="true"/>
</target>
<target name="pre_build" depends="writeVersionToTemplateFiles, cleanupArtifacts"/>
<target name="pre_build" depends="writeCompilerVersionToTemplateFile, writePluginVersionToTemplateFile, cleanupArtifacts"/>
<target name="zipArtifacts">
<macrodef name="zipPlugin">
@@ -125,7 +123,6 @@
</macrodef>
<zipPlugin filename="${plugin.zip}" dir="Kotlin"/>
<zipPlugin filename="${bare.plugin.zip}" dir="BareKotlin"/>
</target>
<macrodef name="print-statistic">
@@ -149,15 +146,13 @@
</macrodef>
<target name="printStatistics">
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-runtime.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-reflect.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-jslib.jar"/>
<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="builtins.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="builtins.meta.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="stdlib.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="stdlib.meta.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"/>
@@ -170,14 +165,16 @@
<condition property="need.remove.artifacts" value="true">
<and>
<matches pattern="rr/.*" string="${teamcity.build.branch}"/>
<matches pattern="rri?/.*" string="${teamcity.build.branch}"/>
<not>
<matches pattern="rr/internal/.*" string="${teamcity.build.branch}"/>
<matches pattern="rri?/internal/.*" string="${teamcity.build.branch}"/>
</not>
</and>
</condition>
<target name="remove_internal_artifacts" description="Remove internal artifacts for rr/* branches, but store them for rr/internal/*" if="need.remove.artifacts">
<target name="remove_internal_artifacts"
description="Remove internal artifacts for rri?/* branches, but store them for rri?/internal/*"
if="need.remove.artifacts">
<echo message="Remove internal artifacts" />
<delete failonerror="false" verbose="true">

View File

@@ -82,13 +82,6 @@
plugin.subdir="Kotlin"
substituted.version="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-bare-plugin"
plugin.path="${relay.plugins.dir}/kotlin-bare-plugin-${relay.origin.version}.zip"
origin.version="${relay.origin.version}"
plugin.subdir="BareKotlin"
substituted.version="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-android-extensions"
plugin.path="${relay.plugins.dir}/kotlin-android-extensions-plugin-${relay.origin.version}.zip"

View File

@@ -22,7 +22,7 @@ import java.io.File
class Kotlin2JsTask : KotlinCompilerBaseTask() {
override val compilerFqName = "org.jetbrains.kotlin.cli.js.K2JSCompiler"
var library: Path? = null
var libraries: Path? = null
var outputPrefix: File? = null
var outputPostfix: File? = null
var sourceMap: Boolean = false
@@ -35,15 +35,9 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
*/
var main: String? = null
fun createLibrary(): Path {
val libraryPath = library
if (libraryPath == null) {
val t = Path(getProject())
library = t
return t
}
return libraryPath.createPath()
fun createLibraries(): Path {
val libraryPaths = libraries ?: return Path(getProject()).also { libraries = it }
return libraryPaths.createPath()
}
override fun fillSpecificArguments() {
@@ -51,9 +45,9 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
args.add(output!!.canonicalPath)
// TODO: write test
library?.let {
args.add("-library-files")
args.add(it.list().joinToString(separator = ",") { File(it).canonicalPath })
libraries?.let {
args.add("-libraries")
args.add(it.list().joinToString(File.pathSeparator) { File(it).canonicalPath })
}
outputPrefix?.let {

View File

@@ -26,6 +26,8 @@ class Kotlin2JvmTask : KotlinCompilerBaseTask() {
var includeRuntime: Boolean = true
var moduleName: String? = null
var noReflect: Boolean = false
private var compileClasspath: Path? = null
fun setClasspath(classpath: Path) {
@@ -68,6 +70,7 @@ class Kotlin2JvmTask : KotlinCompilerBaseTask() {
}
if (noStdlib) args.add("-no-stdlib")
if (noReflect) args.add("-no-reflect")
if (includeRuntime) args.add("-include-runtime")
}
}

View File

@@ -24,32 +24,29 @@ import java.io.File
import java.lang.ref.SoftReference
import java.net.JarURLConnection
object KotlinAntTaskUtil {
internal object KotlinAntTaskUtil {
private var classLoaderRef = SoftReference<ClassLoader?>(null)
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())
antTaskJarPath.parentFile
}
val compilerJar: File by lazy {
File(libPath, "kotlin-compiler.jar").assertExists()
}
val compilerJar: File by jar("kotlin-compiler.jar")
val runtimeJar: File by jar("kotlin-runtime.jar")
val reflectJar: File by jar("kotlin-reflect.jar")
val runtimeJar: File by lazy {
File(libPath, "kotlin-runtime.jar").assertExists()
}
private fun File.assertExists(): File {
if (!this.exists()) {
throw IllegalStateException("${name} is not found in the directory of Kotlin Ant task")
private fun jar(name: String) = lazy {
File(libPath, name).apply {
if (!exists()) {
throw IllegalStateException("File is not found in the directory of Kotlin Ant task: $name")
}
}
return this
}
@Synchronized
@@ -57,7 +54,7 @@ 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)
@@ -65,8 +62,7 @@ object KotlinAntTaskUtil {
return classLoader
}
}
val Task.defaultModuleName: String?
get() = owningTarget?.name ?: project?.name
internal val Task.defaultModuleName: String?
get() = owningTarget?.name ?: project?.name

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
@@ -31,6 +32,7 @@ class KotlinCompilerAdapter : Javac13() {
var additionalArguments: MutableList<Commandline.Argument> = ArrayList(0)
@Suppress("unused") // Used via reflection by Ant
fun createCompilerArg(): Commandline.Argument {
val argument = Commandline.Argument()
additionalArguments.add(argument)
@@ -43,6 +45,11 @@ class KotlinCompilerAdapter : Javac13() {
@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()
@@ -94,15 +101,22 @@ class KotlinCompilerAdapter : Javac13() {
}
private fun addRuntimeToJavacClasspath(kotlinc: Kotlin2JvmTask) {
for (arg in kotlinc.args) {
// If "-no-stdlib" was specified explicitly, probably the user also wanted the javac classpath to not have it
if ("-no-stdlib" == arg) return
}
// If "-no-stdlib" (or "-no-reflect") was specified explicitly, probably the user also wanted the javac classpath to not have it
val addStdlib = "-no-stdlib" !in kotlinc.args
val addReflect = "-no-reflect" !in kotlinc.args
if (!addStdlib && !addReflect) return
if (compileClasspath == null) {
compileClasspath = Path(getProject())
}
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
if (addStdlib) {
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
}
// "-no-stdlib" implies "-no-reflect", see K2JVMCompiler.Companion.getClasspath
if (addReflect && addStdlib) {
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.reflectJar.absolutePath))
}
}
private fun checkAntVersion() {

View File

@@ -14,5 +14,6 @@
<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" />
<orderEntry type="library" name="kotlin-reflect" level="project" />
</component>
</module>

View File

@@ -0,0 +1,75 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.ApiVersion
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
/**
* If you want to add a new field, check its type is supported by [serializeToPlainText], [deserializeFromPlainText]
*/
data class JvmBuildMetaInfo(
val isEAP: Boolean,
val compilerBuildVersion: String,
val languageVersionString: String,
val apiVersionString: String,
val coroutinesEnable: Boolean,
val coroutinesWarn: Boolean,
val coroutinesError: Boolean,
val multiplatformEnable: Boolean,
val metadataVersionMajor: Int,
val metadataVersionMinor: Int,
val metadataVersionPatch: Int,
val bytecodeVersionMajor: Int,
val bytecodeVersionMinor: Int,
val bytecodeVersionPatch: Int,
val ownVersion: Int = JvmBuildMetaInfo.OWN_VERSION,
val coroutinesVersion: Int = JvmBuildMetaInfo.COROUTINES_VERSION,
val multiplatformVersion: Int = JvmBuildMetaInfo.MULTIPLATFORM_VERSION
) {
companion object {
const val OWN_VERSION: Int = 0
const val COROUTINES_VERSION: Int = 0
const val MULTIPLATFORM_VERSION: Int = 0
fun serializeToString(info: JvmBuildMetaInfo): String =
serializeToPlainText(info)
fun deserializeFromString(str: String): JvmBuildMetaInfo? =
deserializeFromPlainText(str)
}
}
fun JvmBuildMetaInfo(args: CommonCompilerArguments): JvmBuildMetaInfo =
JvmBuildMetaInfo(isEAP = KotlinCompilerVersion.isPreRelease(),
compilerBuildVersion = KotlinCompilerVersion.VERSION,
languageVersionString = args.languageVersion ?: LanguageVersion.LATEST_STABLE.versionString,
apiVersionString = args.apiVersion ?: ApiVersion.LATEST_STABLE.versionString,
coroutinesEnable = args.coroutinesState == CommonCompilerArguments.ENABLE,
coroutinesWarn = args.coroutinesState == CommonCompilerArguments.WARN,
coroutinesError = args.coroutinesState == CommonCompilerArguments.ERROR,
multiplatformEnable = args.multiPlatform,
metadataVersionMajor = JvmMetadataVersion.INSTANCE.major,
metadataVersionMinor = JvmMetadataVersion.INSTANCE.minor,
metadataVersionPatch = JvmMetadataVersion.INSTANCE.patch,
bytecodeVersionMajor = JvmBytecodeBinaryVersion.INSTANCE.major,
bytecodeVersionMinor = JvmBytecodeBinaryVersion.INSTANCE.minor,
bytecodeVersionPatch = JvmBytecodeBinaryVersion.INSTANCE.patch)

View File

@@ -0,0 +1,71 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import kotlin.reflect.KClass
import kotlin.reflect.full.memberProperties
import kotlin.reflect.full.primaryConstructor
inline fun <reified T : Any> serializeToPlainText(instance: T): String = serializeToPlainText(instance, T::class)
fun <T : Any> serializeToPlainText(instance: T, klass: KClass<T>): String {
val lines = ArrayList<String>()
for (property in klass.memberProperties) {
val value = property.get(instance)
if (value != null) {
lines.add("${property.name}=$value")
}
}
return lines.joinToString("\n")
}
inline fun <reified T : Any> deserializeFromPlainText(str: String): T? = deserializeFromPlainText(str, T::class)
fun <T : Any> deserializeFromPlainText(str: String, klass: KClass<T>): T? {
val args = ArrayList<Any?>()
val properties = str
.split("\n")
.filter(String::isNotBlank)
.associate { it.substringBefore("=") to it.substringAfter("=") }
val primaryConstructor = klass.primaryConstructor
?: throw IllegalStateException("${klass.java} does not have primary constructor")
for (param in primaryConstructor.parameters.sortedBy { it.index }) {
val argumentString = properties[param.name]
if (argumentString == null) {
if (param.type.isMarkedNullable) {
args.add(null)
continue
}
else {
return null
}
}
val argument: Any? = when (param.type.classifier) {
Int::class -> argumentString.toInt()
Boolean::class -> argumentString.toBoolean()
String::class -> argumentString
else -> throw IllegalStateException("Unexpected property type: ${param.type}")
}
args.add(argument)
}
return primaryConstructor.call(*args.toTypedArray())
}

View File

@@ -16,16 +16,17 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ComparatorUtil;
import com.sampullara.cli.Argument;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
import org.jetbrains.kotlin.cli.common.arguments.ParseCommandLineArgumentsKt;
import org.jetbrains.kotlin.utils.StringsKt;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class ArgumentUtils {
private ArgumentUtils() {}
@@ -33,7 +34,7 @@ public class ArgumentUtils {
@NotNull
public static List<String> convertArgumentsToStringList(@NotNull CommonCompilerArguments arguments)
throws InstantiationException, IllegalAccessException {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
convertArgumentsToStringList(arguments, arguments.getClass().newInstance(), arguments.getClass(), result);
result.addAll(arguments.freeArgs);
return result;
@@ -60,27 +61,26 @@ public class ArgumentUtils {
continue;
}
if (ComparatorUtil.equalsNullable(value, defaultValue)) continue;
String name = getAlias(argument);
if (name == null) {
name = getName(argument, field);
}
if (Objects.equals(value, defaultValue)) continue;
Class<?> fieldType = field.getType();
if (fieldType.isArray()) {
Object[] values = (Object[]) value;
if (values.length == 0) continue;
//noinspection unchecked
value = StringUtil.join(values, Function.TO_STRING, argument.delimiter());
value = StringsKt.join(Arrays.asList(values), ",");
}
result.add(argument.prefix() + name);
result.add(argument.value());
if (fieldType == boolean.class || fieldType == Boolean.class) continue;
result.add(value.toString());
if (ParseCommandLineArgumentsKt.isAdvanced(argument)) {
result.set(result.size() - 1, argument.value() + "=" + value.toString());
}
else {
result.add(value.toString());
}
}
Class<?> superClazz = clazz.getSuperclass();
@@ -88,14 +88,4 @@ public class ArgumentUtils {
convertArgumentsToStringList(arguments, defaultArguments, superClazz, result);
}
}
private static String getAlias(Argument argument) {
String alias = argument.alias();
return alias.isEmpty() ? null : alias;
}
private static String getName(Argument argument, Field field) {
String name = argument.value();
return name.isEmpty() ? field.getName() : name;
}
}

View File

@@ -21,10 +21,11 @@ import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import java.io.File
import java.io.IOException
private val NORMAL_VERSION = 8
private val EXPERIMENTAL_VERSION = 3
private val DATA_CONTAINER_VERSION = 1
private val EXPERIMENTAL_VERSION = 4
private val DATA_CONTAINER_VERSION = 2
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val EXPERIMENTAL_VERSION_FILE_NAME = "experimental-format-version.txt"
@@ -40,8 +41,16 @@ class CacheVersion(
) {
private val isEnabled by lazy(isEnabled)
private val actualVersion: Int
get() = versionFile.readText().toInt()
private val actualVersion: Int?
get() = try {
versionFile.readText().toInt()
}
catch (e: NumberFormatException) {
null
}
catch (e: IOException) {
null
}
private val expectedVersion: Int
get() {

View File

@@ -0,0 +1,34 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.cli.common.ExitCode
import java.io.File
interface ICReporter {
fun report(message: ()->String)
// used in Gradle plugin
@Suppress("unused")
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
fun pathsAsString(files: Iterable<File>): String =
files.map { it.canonicalPath }.joinToString()
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
}

View File

@@ -16,10 +16,12 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.util.SmartList
import com.intellij.util.io.BooleanDataDescriptor
import com.intellij.util.io.EnumeratorStringDescriptor
import gnu.trove.THashSet
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.config.IncrementalCompilation
@@ -41,7 +43,6 @@ import org.jetbrains.kotlin.serialization.deserialization.TypeTable
import org.jetbrains.kotlin.serialization.deserialization.supertypes
import org.jetbrains.kotlin.serialization.jvm.BitEncoding
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
import org.jetbrains.kotlin.utils.singletonOrEmptyList
import org.jetbrains.org.objectweb.asm.*
import java.io.File
import java.security.MessageDigest
@@ -66,6 +67,7 @@ open class IncrementalCacheImpl<Target>(
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
private val INTERNAL_NAME_TO_SOURCE = "internal-name-to-source"
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
@@ -92,6 +94,8 @@ open class IncrementalCacheImpl<Target>(
private val subtypesMap = registerExperimentalMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerExperimentalMap(SupertypesMap(SUPERTYPES.storageFile))
private val classFqNameToSourceMap = registerExperimentalMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerExperimentalMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val dependents = arrayListOf<IncrementalCacheImpl<Target>>()
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } }
@@ -130,7 +134,11 @@ open class IncrementalCacheImpl<Target>(
fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
fun getSourceFileIfClass(fqName: FqName): File? = classFqNameToSourceMap[fqName]
fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
fun sourcesByInternalName(internalName: String): Collection<File> =
internalNameToSource[internalName]
fun isMultifileFacade(className: JvmClassName): Boolean =
className.internalName in multifileFacadeToParts
@@ -157,6 +165,10 @@ open class IncrementalCacheImpl<Target>(
sourceToClassesMap.add(it, className)
}
if (IncrementalCompilation.isExperimental()) {
internalNameToSource[className.internalName] = sourceFiles
}
if (kotlinClass.classId.isLocal) {
return CompilationResult.NO_CHANGES
}
@@ -179,12 +191,19 @@ open class IncrementalCacheImpl<Target>(
// the class' proto wouldn't ever be deleted,
// because we don't write proto for multifile facades.
// As a workaround we can remove proto values for multifile facades.
val additionalChangeInfo = if (className in protoMap) {
val info = ChangeInfo.SignatureChanged(className.fqNameForClassNameWithoutDollars, areSubclassesAffected = true)
CompilationResult(protoChanged = true, changes = sequenceOf(info))
}
else CompilationResult.NO_CHANGES
protoMap.remove(className)
classFqNameToSourceMap.remove(className.fqNameForClassNameWithoutDollars)
internalNameToSource.remove(className.internalName)
// TODO NO_CHANGES? (delegates only)
constantsMap.process(kotlinClass, isPackage = true) +
inlineFunctionsMap.process(kotlinClass, isPackage = true)
inlineFunctionsMap.process(kotlinClass, isPackage = true) +
additionalChangeInfo
}
KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> {
assert(sourceFiles.size == 1) { "Multifile class part from several source files: $sourceFiles" }
@@ -252,7 +271,7 @@ open class IncrementalCacheImpl<Target>(
ProtoBuf.Class::getPropertyList
) + classData.classProto.enumEntryList.map { classData.nameResolver.getString(it.name) }
val companionObjectChanged = createChangeInfo(classFqName.parent(), classFqName.shortName().asString().singletonOrEmptyList())
val companionObjectChanged = createChangeInfo(classFqName.parent(), listOfNotNull(classFqName.shortName().asString()))
val companionObjectMembersChanged = createChangeInfo(classFqName, memberNames)
listOf(companionObjectMembersChanged, companionObjectChanged)
@@ -310,6 +329,7 @@ open class IncrementalCacheImpl<Target>(
partToMultifileFacade.remove(it)
constantsMap.remove(it)
inlineFunctionsMap.remove(it)
internalNameToSource.remove(it.internalName)
}
removeAllFromClassStorage(dirtyClasses)
@@ -321,7 +341,7 @@ open class IncrementalCacheImpl<Target>(
override fun getObsoletePackageParts(): Collection<String> {
val obsoletePackageParts =
dirtyOutputClassesMap.getDirtyOutputClasses().filter { packagePartMap.isPackagePart(JvmClassName.byInternalName(it)) }
debugLog("Obsolete package parts: ${obsoletePackageParts}")
debugLog("Obsolete package parts: $obsoletePackageParts")
return obsoletePackageParts
}
@@ -346,10 +366,6 @@ open class IncrementalCacheImpl<Target>(
return partNames.filter { !dirtyOutputClassesMap.isDirty(it) }
}
override fun getMultifileFacade(partInternalName: String): String? {
return partToMultifileFacade.get(partInternalName)
}
override fun getModuleMappingData(): ByteArray? {
return protoMap[JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)]?.bytes
}
@@ -579,6 +595,23 @@ open class IncrementalCacheImpl<Target>(
override fun dumpValue(value: String) = value
}
inner class InternalNameToSourcesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
fun remove(internalName: String) {
storage.remove(internalName)
}
override fun dumpValue(value: Collection<String>): String =
value.dumpCollection()
}
private fun addToClassStorage(kotlinClass: LocalFileKotlinClass, srcFile: File) {
if (!IncrementalCompilation.isExperimental()) return
@@ -731,6 +764,8 @@ open class IncrementalCacheImpl<Target>(
}
}
private object PathCollectionExternalizer : CollectionExternalizer<String>(PathStringDescriptor, { THashSet(FileUtil.PATH_HASHING_STRATEGY) })
sealed class ChangeInfo(val fqName: FqName) {
open class MembersChanged(fqName: FqName, val names: Collection<String>) : ChangeInfo(fqName) {
override fun toStringProperties(): String = super.toStringProperties() + ", names = $names"
@@ -744,7 +779,7 @@ sealed class ChangeInfo(val fqName: FqName) {
protected open fun toStringProperties(): String = "fqName = $fqName"
override fun toString(): String {
return this.javaClass.simpleName + "(${toStringProperties()})"
return this::class.java.simpleName + "(${toStringProperties()})"
}
}

View File

@@ -50,5 +50,5 @@ class LocalFileKotlinClass private constructor(
override fun hashCode(): Int = file.hashCode()
override fun equals(other: Any?): Boolean = other is LocalFileKotlinClass && file == other.file
override fun toString(): String = "$javaClass: $file"
override fun toString(): String = "${this::class.java}: $file"
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,6 +46,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasSinceKotlinInfoTable() != new.hasSinceKotlinInfoTable()) return false
if (old.hasSinceKotlinInfoTable()) {
if (!checkEquals(old.sinceKotlinInfoTable, new.sinceKotlinInfoTable)) return false
}
if (old.hasExtension(JvmProtoBuf.packageModuleName) != new.hasExtension(JvmProtoBuf.packageModuleName)) return false
if (old.hasExtension(JvmProtoBuf.packageModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) return false
@@ -58,6 +63,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
PROPERTY_LIST,
TYPE_ALIAS_LIST,
TYPE_TABLE,
SINCE_KOTLIN_INFO_TABLE,
PACKAGE_MODULE_NAME
}
@@ -75,6 +81,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufPackageKind.TYPE_TABLE)
}
if (old.hasSinceKotlinInfoTable() != new.hasSinceKotlinInfoTable()) result.add(ProtoBufPackageKind.SINCE_KOTLIN_INFO_TABLE)
if (old.hasSinceKotlinInfoTable()) {
if (!checkEquals(old.sinceKotlinInfoTable, new.sinceKotlinInfoTable)) result.add(ProtoBufPackageKind.SINCE_KOTLIN_INFO_TABLE)
}
if (old.hasExtension(JvmProtoBuf.packageModuleName) != new.hasExtension(JvmProtoBuf.packageModuleName)) result.add(ProtoBufPackageKind.PACKAGE_MODULE_NAME)
if (old.hasExtension(JvmProtoBuf.packageModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) result.add(ProtoBufPackageKind.PACKAGE_MODULE_NAME)
@@ -114,11 +125,23 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassEnumEntry(old, new)) return false
if (!checkEqualsClassSealedSubclassFqName(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
if (old.hasSinceKotlinInfoTable() != new.hasSinceKotlinInfoTable()) return false
if (old.hasSinceKotlinInfoTable()) {
if (!checkEquals(old.sinceKotlinInfoTable, new.sinceKotlinInfoTable)) return false
}
if (old.hasExtension(JvmProtoBuf.classModuleName) != new.hasExtension(JvmProtoBuf.classModuleName)) return false
if (old.hasExtension(JvmProtoBuf.classModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) return false
@@ -139,7 +162,10 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
PROPERTY_LIST,
TYPE_ALIAS_LIST,
ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
TYPE_TABLE,
SINCE_KOTLIN_INFO,
SINCE_KOTLIN_INFO_TABLE,
CLASS_MODULE_NAME
}
@@ -176,11 +202,23 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassEnumEntry(old, new)) result.add(ProtoBufClassKind.ENUM_ENTRY_LIST)
if (!checkEqualsClassSealedSubclassFqName(old, new)) result.add(ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufClassKind.TYPE_TABLE)
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
}
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) result.add(ProtoBufClassKind.SINCE_KOTLIN_INFO)
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) result.add(ProtoBufClassKind.SINCE_KOTLIN_INFO)
}
if (old.hasSinceKotlinInfoTable() != new.hasSinceKotlinInfoTable()) result.add(ProtoBufClassKind.SINCE_KOTLIN_INFO_TABLE)
if (old.hasSinceKotlinInfoTable()) {
if (!checkEquals(old.sinceKotlinInfoTable, new.sinceKotlinInfoTable)) result.add(ProtoBufClassKind.SINCE_KOTLIN_INFO_TABLE)
}
if (old.hasExtension(JvmProtoBuf.classModuleName) != new.hasExtension(JvmProtoBuf.classModuleName)) result.add(ProtoBufClassKind.CLASS_MODULE_NAME)
if (old.hasExtension(JvmProtoBuf.classModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) result.add(ProtoBufClassKind.CLASS_MODULE_NAME)
@@ -231,6 +269,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
if (old.hasExtension(JvmProtoBuf.methodSignature) != new.hasExtension(JvmProtoBuf.methodSignature)) return false
if (old.hasExtension(JvmProtoBuf.methodSignature)) {
if (!checkEquals(old.getExtension(JvmProtoBuf.methodSignature), new.getExtension(JvmProtoBuf.methodSignature))) return false
@@ -289,6 +332,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (old.setterFlags != new.setterFlags) return false
}
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
if (old.hasExtension(JvmProtoBuf.propertySignature) != new.hasExtension(JvmProtoBuf.propertySignature)) return false
if (old.hasExtension(JvmProtoBuf.propertySignature)) {
if (!checkEquals(old.getExtension(JvmProtoBuf.propertySignature), new.getExtension(JvmProtoBuf.propertySignature))) return false
@@ -329,6 +377,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsTypeAliasAnnotation(old, new)) return false
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
return true
}
@@ -343,6 +396,12 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEquals(old: ProtoBuf.SinceKotlinInfoTable, new: ProtoBuf.SinceKotlinInfoTable): Boolean {
if (!checkEqualsSinceKotlinInfoTableInfo(old, new)) return false
return true
}
open fun checkEquals(old: ProtoBuf.TypeParameter, new: ProtoBuf.TypeParameter): Boolean {
if (old.id != new.id) return false
@@ -434,6 +493,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (old.abbreviatedTypeId != new.abbreviatedTypeId) return false
}
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
}
if (old.getExtensionCount(JvmProtoBuf.typeAnnotation) != new.getExtensionCount(JvmProtoBuf.typeAnnotation)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
@@ -456,6 +520,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsConstructorValueParameter(old, new)) return false
if (old.hasSinceKotlinInfo() != new.hasSinceKotlinInfo()) return false
if (old.hasSinceKotlinInfo()) {
if (old.sinceKotlinInfo != new.sinceKotlinInfo) return false
}
if (old.hasExtension(JvmProtoBuf.constructorSignature) != new.hasExtension(JvmProtoBuf.constructorSignature)) return false
if (old.hasExtension(JvmProtoBuf.constructorSignature)) {
if (!checkEquals(old.getExtension(JvmProtoBuf.constructorSignature), new.getExtension(JvmProtoBuf.constructorSignature))) return false
@@ -550,6 +619,35 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEquals(old: ProtoBuf.SinceKotlinInfo, new: ProtoBuf.SinceKotlinInfo): Boolean {
if (old.hasVersion() != new.hasVersion()) return false
if (old.hasVersion()) {
if (old.version != new.version) return false
}
if (old.hasVersionFull() != new.hasVersionFull()) return false
if (old.hasVersionFull()) {
if (old.versionFull != new.versionFull) return false
}
if (old.hasLevel() != new.hasLevel()) return false
if (old.hasLevel()) {
if (old.level != new.level) return false
}
if (old.hasErrorCode() != new.hasErrorCode()) return false
if (old.hasErrorCode()) {
if (old.errorCode != new.errorCode) return false
}
if (old.hasMessage() != new.hasMessage()) return false
if (old.hasMessage()) {
if (!checkStringEquals(old.message, new.message)) return false
}
return true
}
open fun checkEquals(old: ProtoBuf.Type.Argument, new: ProtoBuf.Type.Argument): Boolean {
if (old.hasProjection() != new.hasProjection()) return false
if (old.hasProjection()) {
@@ -757,6 +855,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsClassSealedSubclassFqName(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.sealedSubclassFqNameCount != new.sealedSubclassFqNameCount) return false
for(i in 0..old.sealedSubclassFqNameCount - 1) {
if (!checkClassIdEquals(old.getSealedSubclassFqName(i), new.getSealedSubclassFqName(i))) return false
}
return true
}
open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -817,6 +925,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsSinceKotlinInfoTableInfo(old: ProtoBuf.SinceKotlinInfoTable, new: ProtoBuf.SinceKotlinInfoTable): Boolean {
if (old.infoCount != new.infoCount) return false
for(i in 0..old.infoCount - 1) {
if (!checkEquals(old.getInfo(i), new.getInfo(i))) return false
}
return true
}
open fun checkEqualsTypeParameterUpperBound(old: ProtoBuf.TypeParameter, new: ProtoBuf.TypeParameter): Boolean {
if (old.upperBoundCount != new.upperBoundCount) return false
@@ -927,6 +1045,10 @@ fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfoTable()) {
hashCode = 31 * hashCode + sinceKotlinInfoTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.packageModuleName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.packageModuleName))
}
@@ -983,10 +1105,22 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + getEnumEntry(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..sealedSubclassFqNameCount - 1) {
hashCode = 31 * hashCode + fqNameIndexes(getSealedSubclassFqName(i))
}
if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
if (hasSinceKotlinInfoTable()) {
hashCode = 31 * hashCode + sinceKotlinInfoTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.classModuleName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.classModuleName))
}
@@ -1035,6 +1169,10 @@ fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
if (hasExtension(JvmProtoBuf.methodSignature)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.methodSignature).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1087,6 +1225,10 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + setterFlags
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
if (hasExtension(JvmProtoBuf.propertySignature)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.propertySignature).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1127,6 +1269,10 @@ fun ProtoBuf.TypeAlias.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int
hashCode = 31 * hashCode + getAnnotation(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
return hashCode
}
@@ -1144,6 +1290,16 @@ fun ProtoBuf.TypeTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int
return hashCode
}
fun ProtoBuf.SinceKotlinInfoTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
for(i in 0..infoCount - 1) {
hashCode = 31 * hashCode + getInfo(i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
fun ProtoBuf.TypeParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
@@ -1229,6 +1385,10 @@ fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + abbreviatedTypeId
}
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
for(i in 0..getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.typeAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1251,6 +1411,10 @@ fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
hashCode = 31 * hashCode + getValueParameter(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasSinceKotlinInfo()) {
hashCode = 31 * hashCode + sinceKotlinInfo
}
if (hasExtension(JvmProtoBuf.constructorSignature)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.constructorSignature).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1344,6 +1508,32 @@ fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (In
return hashCode
}
fun ProtoBuf.SinceKotlinInfo.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasVersion()) {
hashCode = 31 * hashCode + version
}
if (hasVersionFull()) {
hashCode = 31 * hashCode + versionFull
}
if (hasLevel()) {
hashCode = 31 * hashCode + level.hashCode()
}
if (hasErrorCode()) {
hashCode = 31 * hashCode + errorCode
}
if (hasMessage()) {
hashCode = 31 * hashCode + stringIndexes(message)
}
return hashCode
}
fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1

View File

@@ -19,7 +19,6 @@
package org.jetbrains.kotlin.incremental
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
@@ -42,7 +41,7 @@ import java.util.*
fun Iterable<File>.javaSourceRoots(roots: Iterable<File>): Iterable<File> =
filter { it.isJavaFile() }
filter(File::isJavaFile)
.map { findSrcDirRoot(it, roots) }
.filterNotNull()
@@ -54,6 +53,7 @@ fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToComp
sourcesToCompile,
javaSourceRoots.map { JvmSourceRoot(it) },
classpath,
null,
"java-production",
isTest,
// this excludes the output directories from the class path, to be removed for true incremental compilation
@@ -72,7 +72,8 @@ fun makeCompileServices(
compilationCanceledStatus: CompilationCanceledStatus?
): Services =
with(Services.Builder()) {
register(IncrementalCompilationComponents::class.java, IncrementalCompilationComponentsImpl(incrementalCaches, lookupTracker))
register(IncrementalCompilationComponents::class.java,
IncrementalCompilationComponentsImpl(incrementalCaches, lookupTracker))
compilationCanceledStatus?.let {
register(CompilationCanceledStatus::class.java, it)
}
@@ -144,7 +145,7 @@ fun LookupStorage.update(
filesToCompile: Iterable<File>,
removedFiles: Iterable<File>
) {
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker.javaClass}")
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker::class.java}")
removeLookupsFrom(filesToCompile.asSequence() + removedFiles.asSequence())
@@ -167,27 +168,28 @@ fun<Target> OutputItemsCollectorImpl.generatedFiles(
outputItem.sourceFiles.firstOrNull()?.let { sourceToTarget[it] } ?:
targets.filter { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false }.singleOrNull() ?:
representativeTarget
if (outputItem.outputFile.name.endsWith(".class"))
GeneratedJvmClass(target, outputItem.sourceFiles, outputItem.outputFile)
else
GeneratedFile(target, outputItem.sourceFiles, outputItem.outputFile)
when (outputItem.outputFile.extension) {
"class" -> GeneratedJvmClass(target, outputItem.sourceFiles, outputItem.outputFile)
else -> GeneratedFile(target, outputItem.sourceFiles, outputItem.outputFile)
}
}
}
data class DirtyData(
val dirtyLookupSymbols: Iterable<LookupSymbol>,
val dirtyClassesFqNames: Iterable<FqName>
val dirtyLookupSymbols: Collection<LookupSymbol> = emptyList(),
val dirtyClassesFqNames: Collection<FqName> = emptyList()
)
fun <Target> CompilationResult.getDirtyData(
caches: Iterable<IncrementalCacheImpl<Target>>,
log: (String)->Unit
reporter: ICReporter
): DirtyData {
val dirtyLookupSymbols = HashSet<LookupSymbol>()
val dirtyClassesFqNames = HashSet<FqName>()
for (change in changes) {
log("Process $change")
reporter.report { "Process $change" }
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
@@ -219,15 +221,14 @@ fun <Target> CompilationResult.getDirtyData(
fun mapLookupSymbolsToFiles(
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
log: (String)->Unit,
getLogFilePath: (File)->String = { it.canonicalPath },
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (lookup in lookupSymbols) {
val affectedFiles = lookupStorage.get(lookup).map(::File).filter { it !in excludes }
log("${lookup.scope}#${lookup.name} caused recompilation of: ${affectedFiles.map(getLogFilePath)}")
reporter.report { "${lookup.scope}#${lookup.name} caused recompilation of: ${reporter.pathsAsString(affectedFiles)}" }
dirtyFiles.addAll(affectedFiles)
}
@@ -237,8 +238,7 @@ fun mapLookupSymbolsToFiles(
fun <Target> mapClassesFqNamesToFiles(
caches: Iterable<IncrementalCacheImpl<Target>>,
classesFqNames: Iterable<FqName>,
log: (String)->Unit,
getLogFilePath: (File)->String = { it.canonicalPath },
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
@@ -248,7 +248,7 @@ fun <Target> mapClassesFqNamesToFiles(
val srcFile = cache.getSourceFileIfClass(dirtyClassFqName)
if (srcFile == null || srcFile in excludes) continue
log("Class $dirtyClassFqName caused recompilation of: ${getLogFilePath(srcFile)}")
reporter.report { ("Class $dirtyClassFqName caused recompilation of: ${reporter.pathsAsString(srcFile)}") }
dirtyFiles.add(srcFile)
}
}
@@ -256,12 +256,10 @@ fun <Target> mapClassesFqNamesToFiles(
return dirtyFiles
}
private fun File.isJavaFile() = extension.equals(JavaFileType.INSTANCE.defaultExtension, ignoreCase = true)
private fun findSrcDirRoot(file: File, roots: Iterable<File>): File? =
roots.firstOrNull { FileUtil.isAncestor(it, file, false) }
private fun <Target> withSubtypes(
fun <Target> withSubtypes(
typeFqName: FqName,
caches: Iterable<IncrementalCacheImpl<Target>>
): Set<FqName> {

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import java.io.File
fun File.isJavaFile() =
extension.equals("java", ignoreCase = true)
fun File.isKotlinFile(): Boolean =
extension.let {
"kt".equals(it, ignoreCase = true) ||
"kts".equals(it, ignoreCase = true)
}
fun File.isClassFile(): Boolean =
extension.equals("class", ignoreCase = true)

View File

@@ -190,6 +190,7 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
ProtoBufClassKind.COMPANION_OBJECT_NAME -> {
if (oldProto.hasCompanionObjectName()) oldProto.companionObjectName.oldToNames()
if (newProto.hasCompanionObjectName()) newProto.companionObjectName.newToNames()
isClassAffected = true
}
ProtoBufClassKind.NESTED_CLASS_NAME_LIST -> {
if (classIsSealed) {
@@ -216,9 +217,16 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
ProtoBufClassKind.ENUM_ENTRY_LIST -> {
isClassAffected = true
}
ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST -> {
// TODO
}
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.SINCE_KOTLIN_INFO,
ProtoCompareGenerated.ProtoBufClassKind.SINCE_KOTLIN_INFO_TABLE -> {
// TODO
}
ProtoBufClassKind.FLAGS,
ProtoBufClassKind.FQ_NAME,
ProtoBufClassKind.TYPE_PARAMETER_LIST,
@@ -267,6 +275,7 @@ private class DifferenceCalculatorForPackageFacade(oldData: ProtoMapValue, newDa
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.SINCE_KOTLIN_INFO_TABLE,
ProtoBufPackageKind.PACKAGE_MODULE_NAME -> {
// TODO
}

View File

@@ -46,7 +46,7 @@ abstract class BasicMap<K : Comparable<K>, V>(
fun dump(): String {
return with(StringBuilder()) {
with(Printer(this)) {
println(this@BasicMap.javaClass.simpleName)
println(this@BasicMap::class.java.simpleName)
pushIndent()
for (key in storage.keys.sorted()) {

View File

@@ -131,7 +131,7 @@ object ConstantsMapExternalizer : DataExternalizer<Map<String, Any>> {
output.writeByte(Kind.STRING.ordinal)
IOUtil.writeString(value, output)
}
else -> throw IllegalStateException("Unexpected constant class: ${value.javaClass}")
else -> throw IllegalStateException("Unexpected constant class: ${value::class.java}")
}
}
}

View File

@@ -39,6 +39,7 @@ class KotlinModuleXmlBuilder {
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
@@ -64,6 +65,10 @@ class KotlinModuleXmlBuilder {
processJavaSourceRoots(javaSourceRoots)
processClasspath(classpathRoots, directoriesToFilterOut)
if (modularJdkRoot != null) {
p.println("<", MODULAR_JDK_ROOT, " ", PATH, "=\"", getEscapedPath(modularJdkRoot), "\"/>")
}
closeTag(p, MODULE)
return this
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import junit.framework.TestCase
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.junit.Assert.assertNotEquals
import org.junit.Test
class JvmBuildMetaInfoTest : TestCase() {
@Test
fun testSerialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo(args)
val actual = JvmBuildMetaInfo.serializeToString(info)
val expectedKeys = listOf(
"apiVersionString",
"bytecodeVersionMajor",
"bytecodeVersionMinor",
"bytecodeVersionPatch",
"compilerBuildVersion",
"coroutinesEnable",
"coroutinesError",
"coroutinesVersion",
"coroutinesWarn",
"isEAP",
"languageVersionString",
"metadataVersionMajor",
"metadataVersionMinor",
"metadataVersionPatch",
"multiplatformEnable",
"multiplatformVersion",
"ownVersion"
)
assertEquals(expectedKeys, actual.split("\r\n", "\n").map { line -> line.split("=").first() })
}
@Test
fun testSerializationDeserialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo(args)
val serialized = JvmBuildMetaInfo.serializeToString(info)
val deserialized = JvmBuildMetaInfo.deserializeFromString(serialized)
assertEquals(info, deserialized)
}
@Test
fun testEquals() {
val args1 = K2JVMCompilerArguments()
args1.coroutinesState = CommonCompilerArguments.ENABLE
val info1 = JvmBuildMetaInfo(args1)
val args2 = K2JVMCompilerArguments()
args2.coroutinesState = CommonCompilerArguments.WARN
val info2 = JvmBuildMetaInfo(args2)
assertNotEquals(info1, info2)
assertEquals(info1, info2.copy(coroutinesEnable = true, coroutinesWarn = false))
}
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import junit.framework.TestCase
import org.junit.Test
class SerializationUtilsTest : TestCase() {
data class TestPropertyTypes(
val intNull: Int?,
val int: Int,
val stringNull: String?,
val string: String,
val boolNull: Boolean?,
val bool: Boolean
)
@Test
fun testPropertyTypes() {
val instance1 = TestPropertyTypes(null, 1, null, "abc", null, false)
val deserialized1 = deserializeFromPlainText<TestPropertyTypes>(serializeToPlainText(instance1))
assertEquals(instance1, deserialized1)
val instance2 = TestPropertyTypes(1, 2, "abc", "xyz", true, false)
val deserialized2 = deserializeFromPlainText<TestPropertyTypes>(serializeToPlainText(instance2))
assertEquals(instance2, deserialized2)
}
data class TestAddedField1(val x: Int)
data class TestAddedField2(val x: Int, val y: Int?)
@Test
fun testAddedField() {
val testAddedField1 = TestAddedField1(1)
val serialized = serializeToPlainText(testAddedField1)
val deserialized = deserializeFromPlainText<TestAddedField2>(serialized)
assertEquals(TestAddedField2(1, null), deserialized)
}
}

View File

@@ -144,7 +144,7 @@ private fun classFileToString(classFile: File): String {
out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}")
if (!classHeader!!.metadataVersion.isCompatible()) {
if (!classHeader.metadataVersion.isCompatible()) {
error("Incompatible class ($classHeader): $classFile")
}

View File

@@ -81,8 +81,8 @@ fun getModificationsToPerform(
val rules = mapOf<String, (String, File) -> Modification>(
newSuffix to { path, file -> ModifyContent(path, file) },
touchSuffix to { path, file -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, file -> DeleteFile(path) }
touchSuffix to { path, _ -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, _ -> DeleteFile(path) }
)
val modifications = ArrayList<Modification>()
@@ -130,7 +130,7 @@ fun getModificationsToPerform(
abstract class Modification(val path: String) {
abstract fun perform(workDir: File, mapping: MutableMap<File, File>)
override fun toString(): String = "${javaClass.simpleName} $path"
override fun toString(): String = "${this::class.java.simpleName} $path"
}
class ModifyContent(path: String, val dataFile: File) : Modification(path) {

890
build.xml

File diff suppressed because it is too large Load Diff

29
common.xml Normal file
View File

@@ -0,0 +1,29 @@
<project name="Commons">
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isLinux">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<property name="dependencies" value="${basedir}/dependencies"/>
<property name="output" value="${basedir}/dist"/>
<property name="js.stdlib.output.dir" value="${output}/js"/>
<target name="make-dependency-dirs">
<mkdir dir="${dependencies}"/>
<mkdir dir="${dependencies}/download"/>
</target>
</project>

View File

@@ -1,18 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
tested.project.dir=tested-module

View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -64,10 +64,27 @@ android {
dexOptions {
dexInProcess false
javaMaxHeapSize "600m"
javaMaxHeapSize "300m"
//default is 4 and Total Memory = maxProcessCount * javaMaxHeapSize
maxProcessCount 1
additionalParameters "--debug"
}
}
task jarTestFolders() {
println "Jar folders..."
new File("${projectDir}/libs/").listFiles().each { File file ->
if (file.isDirectory()) {
println "Jar '${file.name}' folder..."
ant.jar(basedir: "libs/${file.name}/", destfile: "libs/" + file.name + ".jar")
}
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn jarTestFolders
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'junit:junit:4.12'

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="testsForAndroid" default="help" basedir="">
<property file="local.properties"/>
<property file="ant.properties"/>
<loadproperties srcFile="project.properties"/>
<import file="custom_rules.xml" optional="true"/>
<import file="${sdk.dir}/tools/ant/build.xml"/>
<target name="pack_libraries">
<jar basedir="libs/codegen-test-output" destfile="libs/test.jar"/>
<delete dir="libs/codegen-test-output"/>
</target>
</project>

View File

@@ -0,0 +1,2 @@
#don't try to download android specific tools within gradle: licence acceptance will be required
android.builder.sdkDownload=false

View File

@@ -6,7 +6,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="cli" />
<orderEntry type="module" module-name="tests-common" />
@@ -17,5 +17,6 @@
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="descriptor.loader.java" scope="TEST" />
<orderEntry type="module" module-name="frontend.java" scope="TEST" />
<orderEntry type="module" module-name="jps-tests" scope="TEST" />
</component>
</module>

View File

@@ -20,7 +20,6 @@ import com.intellij.util.PlatformUtils;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.android.tests.ant.AntRunner;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import org.jetbrains.kotlin.android.tests.emulator.Emulator;
import org.jetbrains.kotlin.android.tests.gradle.GradleRunner;
@@ -83,8 +82,6 @@ public class CodegenTestsOnAndroidRunner {
downloader.unzipAll();
PermissionManager.setPermissions(pathManager);
AntRunner antRunner = new AntRunner(pathManager);
antRunner.packLibraries();
Emulator emulator = new Emulator(pathManager, Emulator.ARM);
GradleRunner gradleRunner = new GradleRunner(pathManager);
gradleRunner.clean();
@@ -151,7 +148,7 @@ public class CodegenTestsOnAndroidRunner {
for (int i = 0; i < testCases.getLength(); i++) {
Element item = (Element) testCases.item(i);
final NodeList failure = item.getElementsByTagName("failure");
NodeList failure = item.getElementsByTagName("failure");
String name = item.getAttribute("name");
String clazz = item.getAttribute("classname");

View File

@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.android.tests;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import java.io.File;
public class PathManager {
@@ -50,8 +52,8 @@ public class PathManager {
return getAndroidSdkRoot() + "/build-tools";
}
public String getOutputForCompiledFiles() {
return tmpFolder + "/libs/codegen-test-output";
public String getOutputForCompiledFiles(int index) {
return tmpFolder + "/libs/libtest" + index;
}
public String getLibsFolderInAndroidTestedModuleTmpFolder() {
@@ -75,17 +77,13 @@ public class PathManager {
}
public String getGradleBinFolder() {
return getDependenciesRoot() + "/gradle-2.12/bin";
return getDependenciesRoot() + "/gradle-" + SDKDownloader.GRADLE_VERSION + "/bin";
}
public String getRootForDownload() {
return getDependenciesRoot() + "/download";
}
public String getAntBinDirectory() {
return rootFolder + "/dependencies/ant-1.8/bin";
}
public String getAndroidModuleRoot() {
return rootFolder + "/compiler/android-tests/android-module";
}

View File

@@ -1,105 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.android.tests.ant;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.kotlin.android.tests.OutputUtils;
import org.jetbrains.kotlin.android.tests.PathManager;
import org.jetbrains.kotlin.android.tests.run.RunResult;
import org.jetbrains.kotlin.android.tests.run.RunUtils;
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
import java.util.ArrayList;
import java.util.List;
public class AntRunner {
private final List<String> listOfAntCommands;
public AntRunner(PathManager pathManager) {
listOfAntCommands = new ArrayList<String>();
String antCmdName = SystemInfo.isWindows ? "ant.bat" : "ant";
listOfAntCommands.add(pathManager.getAntBinDirectory() + "/" + antCmdName);
listOfAntCommands.add("-Dsdk.dir=" + pathManager.getAndroidSdkRoot());
listOfAntCommands.add("-buildfile");
listOfAntCommands.add(pathManager.getTmpFolder() + "/build.xml");
}
/* Pack compiled sources on first step to one jar file */
public void packLibraries() {
System.out.println("Pack libraries...");
RunResult result = RunUtils.execute(generateCommandLine("pack_libraries"));
OutputUtils.checkResult(result);
}
/* Clean output directory */
public void cleanOutput() {
System.out.println("Clearing output directory...");
RunResult result = RunUtils.execute(generateCommandLine("clean"));
OutputUtils.checkResult(result);
}
public void compileSources() {
System.out.println("Compiling sources...");
RunResult result = RunUtils.execute(generateCommandLine("debug"));
OutputUtils.checkResult(result);
}
public void installApplicationOnEmulator() {
System.out.println("Installing apk...");
RunResult result = RunUtils.execute(generateCommandLine("installt"));
String resultOutput = result.getOutput();
if (!isInstallSuccessful(resultOutput)) {
installApplicationOnEmulator();
return;
}
else {
if (result.getStatus()) {
System.out.println(resultOutput);
}
}
OutputUtils.checkResult(result);
}
public String runTestsOnEmulator() {
System.out.println("Running tests...");
RunResult result = RunUtils.execute(generateCommandLine("test"));
String resultOutput = result.getOutput();
OutputUtils.checkResult(result);
return resultOutput;
}
private static boolean isInstallSuccessful(String output) {
if (output.contains("Is the system running?")) {
System.out.println("Device not ready. Waiting for 20 sec.");
try {
Thread.sleep(20000);
}
catch (InterruptedException e) {
throw ExceptionUtilsKt.rethrow(e);
}
return false;
}
return true;
}
private GeneralCommandLine generateCommandLine(String taskName) {
GeneralCommandLine commandLine = new GeneralCommandLine(listOfAntCommands);
commandLine.addParameter(taskName);
return commandLine;
}
}

View File

@@ -43,6 +43,7 @@ public class SDKDownloader {
private static final String SDK_TOOLS = "25.1.1";
public static final String BUILD_TOOLS = "23.0.3";
private static final int ANDROID_VERSION = 19;
public static final String GRADLE_VERSION = "2.14.1";
public SDKDownloader(PathManager pathManager) {
@@ -53,7 +54,7 @@ public class SDKDownloader {
platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools.zip";
skdToolsZipPath = pathManager.getRootForDownload() + "/tools.zip";
buildToolsZipPath = pathManager.getRootForDownload() + "/build-tools.zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle.zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle" + GRADLE_VERSION + ".zip";
}
public void downloadPlatform() {
@@ -78,7 +79,7 @@ public class SDKDownloader {
}
public void downloadGradle() {
download("https://services.gradle.org/distributions/gradle-2.12-bin.zip", gradleZipPath);
download("https://services.gradle.org/distributions/gradle-" + GRADLE_VERSION + "-bin.zip", gradleZipPath);
}
private static String getDownloadUrl(String prefix) {
@@ -194,21 +195,18 @@ public class SDKDownloader {
}
try {
byte[] buf = new byte[1024];
ZipInputStream zipinputstream;
ZipEntry zipentry;
zipinputstream = new ZipInputStream(new FileInputStream(pathToFile));
zipentry = zipinputstream.getNextEntry();
try {
while (zipentry != null) {
String entryName = zipentry.getName();
ZipEntry zipEntry = null;
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(pathToFile))) {
zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
String entryName = zipEntry.getName();
int n;
File outputFile = new File(outputFolder + "/" + entryName);
if (zipentry.isDirectory()) {
if (zipEntry.isDirectory()) {
outputFile.mkdirs();
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
continue;
}
else {
@@ -219,23 +217,19 @@ public class SDKDownloader {
outputFile.createNewFile();
}
FileOutputStream fileoutputstream = new FileOutputStream(outputFile);
try {
while ((n = zipinputstream.read(buf, 0, 1024)) > -1) {
fileoutputstream.write(buf, 0, n);
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile)) {
while ((n = zipInputStream.read(buf, 0, 1024)) > -1) {
fileOutputStream.write(buf, 0, n);
}
}
finally {
fileoutputstream.close();
}
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
}
zipinputstream.close();
}
catch (IOException e) {
System.err.println("Entry name: " + zipentry.getName());
if (zipEntry != null) {
System.err.println("Entry name: " + zipEntry.getName());
}
e.printStackTrace();
}
}

View File

@@ -30,7 +30,7 @@ public class GradleRunner {
private final List<String> listOfCommands;
public GradleRunner(PathManager pathManager) {
listOfCommands = new ArrayList<String>();
listOfCommands = new ArrayList<>();
String cmdName = SystemInfo.isWindows ? "gradle.bat" : "gradle";
listOfCommands.add(pathManager.getGradleBinFolder() + "/" + cmdName);
listOfCommands.add("--build-file");
@@ -46,7 +46,9 @@ public class GradleRunner {
public void build() {
System.out.println("Building gradle project...");
RunResult result = RunUtils.execute(generateCommandLine("build"));
GeneralCommandLine build = generateCommandLine("build");
build.addParameter("--stacktrace");
RunResult result = RunUtils.execute(build);
OutputUtils.checkResult(result);
}

View File

@@ -29,7 +29,6 @@ public class PermissionManager {
public static void setPermissions(PathManager pathManager) {
if (!SystemInfo.isWindows) {
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() + "/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));

View File

@@ -86,22 +86,15 @@ public class RunUtils {
return run(settings);
}
public static void executeOnSeparateThread(@NotNull final RunSettings settings) {
public static void executeOnSeparateThread(@NotNull RunSettings settings) {
assert !settings.waitForEnd : "Use execute() instead";
Thread t = new Thread(new Runnable() {
@Override
public void run() {
RunUtils.run(settings);
}
});
t.start();
new Thread(() -> run(settings)).start();
}
private static RunResult run(final RunSettings settings) {
private static RunResult run(RunSettings settings) {
System.out.println("RUN COMMAND: " + settings);
final StringBuilder stdOut = new StringBuilder();
final StringBuilder stdErr = new StringBuilder();
StringBuilder stdOut = new StringBuilder();
StringBuilder stdErr = new StringBuilder();
OSProcessHandler handler;
try {
@@ -111,10 +104,7 @@ public class RunUtils {
}
close(handler.getProcessInput());
}
catch (ExecutionException e) {
return new RunResult(false, getStackTrace(e));
}
catch (IOException e) {
catch (ExecutionException | IOException e) {
return new RunResult(false, getStackTrace(e));
}

View File

@@ -16,12 +16,12 @@
package org.jetbrains.kotlin.android.tests;
import org.jetbrains.jps.builders.JpsBuildTestCase;
import org.jetbrains.kotlin.jps.build.BaseKotlinJpsBuildTestCase;
import java.io.File;
import java.io.IOException;
public class AndroidJpsBuildTestCase extends JpsBuildTestCase {
public class AndroidJpsBuildTestCase extends BaseKotlinJpsBuildTestCase {
private static final String PROJECT_NAME = "android-module";
private static final String SDK_NAME = "Android_SDK";
@@ -29,8 +29,8 @@ public class AndroidJpsBuildTestCase extends JpsBuildTestCase {
public void doTest() {
initProject();
rebuildAll();
makeAll().assertSuccessful();
rebuildAllModules();
buildAllModules().assertSuccessful();
}
@Override

View File

@@ -64,11 +64,8 @@ public class AndroidRunner extends TestSuite {
private static void writeAndroidSkdToLocalProperties() throws IOException {
System.out.println("Writing android sdk to local.properties: " + pathManager.getAndroidSdkRoot());
File file = new File(pathManager.getTmpFolder() + "/local.properties");
FileWriter fw = new FileWriter(file);
try {
try (FileWriter fw = new FileWriter(file)) {
fw.write("sdk.dir=" + pathManager.getAndroidSdkRoot());
} finally {
fw.close();
}
}
}

View File

@@ -32,13 +32,10 @@ import org.jetbrains.kotlin.config.CommonConfigurationKeys;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.config.JVMConfigurationKeys;
import org.jetbrains.kotlin.idea.KotlinFileType;
import org.jetbrains.kotlin.load.java.JvmAbi;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.name.NameUtils;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.test.ConfigurationKind;
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestJdkKind;
import org.jetbrains.kotlin.test.*;
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase;
import org.jetbrains.kotlin.utils.Printer;
import org.junit.Assert;
@@ -58,6 +55,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
private static final String generatorName = "CodegenTestsOnAndroidGenerator";
private static int MODULE_INDEX = 1;
private int WRITED_FILES_COUNT = 0;
private final List<String> generatedTestNames = Lists.newArrayList();
@@ -145,7 +143,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
private final boolean isFullJdkAndRuntime;
private final boolean inheritMultifileParts;
public List<KtFile> files = new ArrayList<KtFile>();
public List<KtFile> files = new ArrayList<>();
private KotlinCoreEnvironment environment;
private FilesWriter(boolean isFullJdkAndRuntime, boolean inheritMultifileParts) {
@@ -155,7 +153,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
}
private KotlinCoreEnvironment createEnvironment(boolean isFullJdkAndRuntime) {
ConfigurationKind configurationKind = isFullJdkAndRuntime ? ConfigurationKind.ALL : ConfigurationKind.JDK_ONLY;
ConfigurationKind configurationKind = isFullJdkAndRuntime ? ConfigurationKind.ALL : ConfigurationKind.NO_KOTLIN_REFLECT;
TestJdkKind testJdkKind = isFullJdkAndRuntime ? TestJdkKind.FULL_JDK : TestJdkKind.MOCK_JDK;
CompilerConfiguration configuration =
KotlinTestUtils.newConfiguration(configurationKind, testJdkKind, KotlinTestUtils.getAnnotationsJar());
@@ -178,7 +176,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
public void writeFilesOnDisk() {
writeFiles(files);
files = new ArrayList<KtFile>();
files = new ArrayList<>();
environment = createEnvironment(isFullJdkAndRuntime);
}
@@ -194,10 +192,15 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
private void writeFiles(List<KtFile> filesToCompile) {
if (filesToCompile.isEmpty()) return;
//1000 files per folder, each folder would be jared by build.gradle script
// We can't create one big jar with all test cause dex has problem with memory on teamcity
WRITED_FILES_COUNT += filesToCompile.size();
File outputDir = new File(pathManager.getOutputForCompiledFiles(WRITED_FILES_COUNT / 1000));
System.out.println("Generating " + filesToCompile.size() + " files" +
(inheritMultifileParts
? " (JVM.INHERIT_MULTIFILE_PARTS)"
: isFullJdkAndRuntime ? " (full jdk and runtime)" : "") + "...");
: isFullJdkAndRuntime ? " (full jdk and runtime)" : "") + " into " + outputDir.getName() + "...");
OutputFileCollection outputFiles;
try {
outputFiles = GenerationUtils.compileFiles(filesToCompile, environment).getFactory();
@@ -206,7 +209,6 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
throw new RuntimeException(e);
}
File outputDir = new File(pathManager.getOutputForCompiledFiles());
if (!outputDir.exists()) {
outputDir.mkdirs();
}
@@ -243,6 +245,15 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
else {
String fullFileText = FileUtil.loadFile(file, true);
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file)) {
continue;
}
//TODO: support LANGUAGE_VERSION
if (InTextDirectivesUtils.isDirectiveDefined(fullFileText, "LANGUAGE_VERSION:")) {
continue;
}
//TODO: support multifile facades
//TODO: support multifile facades hierarchies
if (hasBoxMethod(fullFileText)) {
@@ -278,7 +289,7 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
}
private String generateTestName(String fileName) {
String result = JvmAbi.sanitizeAsJavaIdentifier(FileUtil.getNameWithoutExtension(StringUtil.capitalize(fileName)));
String result = NameUtils.sanitizeAsJavaIdentifier(FileUtil.getNameWithoutExtension(StringUtil.capitalize(fileName)));
int i = 0;
while (generatedTestNames.contains(result)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,78 +22,106 @@ import java.util.Set;
public class SpecialFiles {
private static final Set<String> excludedFiles = Sets.newHashSet();
private static final Set<String> filesCompiledWithoutStdLib = Sets.newHashSet();
static {
fillExcludedFiles();
}
public static Set<String> getExcludedFiles() {
return excludedFiles;
}
private static void fillExcludedFiles() {
excludedFiles.add("native"); // Reflection is used to check full class name
// Reflection
excludedFiles.add("enclosing");
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("methodsFromAny");
excludedFiles.add("genericProperty.kt");
excludedFiles.add("kt3238.kt");
excludedFiles.add("kt1482_2279.kt");
excludedFiles.add("extensionMethod.kt");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("innerGeneric.kt");
excludedFiles.add("simpleCreateType.kt");
excludedFiles.add("equalsHashCodeToString.kt");
excludedFiles.add("arrayOfKClasses.kt");
excludedFiles.add("enumKClassAnnotation.kt");
excludedFiles.add("primitivesAndArrays.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");
excludedFiles.add("enclosing"); //reflection tests
excludedFiles.add("noReflectAtRuntime"); //reflection tests
excludedFiles.add("methodsFromAny"); //reflection tests
excludedFiles.add("genericProperty.kt"); //reflection tests
// Reflection is used to check full class name
excludedFiles.add("native");
excludedFiles.add("kt3238.kt"); // Reflection
excludedFiles.add("kt1482_2279.kt"); // Reflection
excludedFiles.add("extensionMethod.kt"); // Reflection loadClass
// "IOOBE: Invalid index 4, size is 4" for java.lang.reflect.ParameterizedType on Android
excludedFiles.add("innerGenericTypeArgument.kt");
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
excludedFiles.add("packageQualifiedMethod.kt"); // Cannot change package name
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
excludedFiles.add("assertionStackTrace.kt"); // Cannot change package name
excludedFiles.add("anonymousObjectReifiedSupertype.kt"); // Cannot change package name
excludedFiles.add("innerAnonymousObject.kt"); // Cannot change package name
excludedFiles.add("nestedReifiedSignature.kt"); // Cannot change package name
excludedFiles.add("recursiveInnerAnonymousObject.kt"); // Cannot change package name
excludedFiles.add("approximateCapturedTypes.kt"); // Cannot change package name
excludedFiles.add("classForEnumEntry.kt"); // Cannot change package name
excludedFiles.add("kt10143.kt"); // Cannot change package name
excludedFiles.add("internalTopLevelOtherPackage.kt"); // Cannot change package name
excludedFiles.add("noPrivateDelegation.kt"); // Cannot change package name
excludedFiles.add("platformTypeAssertionStackTrace.kt"); // Cannot change package name
excludedFiles.add("packages.kt"); // Cannot change package name
excludedFiles.add("kt10259.kt"); // Cannot change package name
excludedFiles.add("kt11081.kt"); // Cannot change package name
excludedFiles.add("kt6990.kt"); // Cannot change package name
excludedFiles.add("mainInFiles.kt"); // Cannot change package name
excludedFiles.add("noClassForSimpleEnum.kt"); // Cannot change package name
excludedFiles.add("simpleClassLiteral.kt"); // Cannot change package name
excludedFiles.add("jvmName.kt"); // Cannot change package name
excludedFiles.add("qualifiedName.kt"); // Cannot change package name
excludedFiles.add("topLevelProperty.kt"); // Cannot change package name
excludedFiles.add("typeParameters.kt"); // Cannot change package name
// Cannot change package name
excludedFiles.add("nestedInPackage.kt");
excludedFiles.add("packageQualifiedMethod.kt");
excludedFiles.add("classObjectToString.kt");
excludedFiles.add("assertionStackTrace.kt");
excludedFiles.add("anonymousObjectReifiedSupertype.kt");
excludedFiles.add("innerAnonymousObject.kt");
excludedFiles.add("nestedReifiedSignature.kt");
excludedFiles.add("recursiveInnerAnonymousObject.kt");
excludedFiles.add("approximateCapturedTypes.kt");
excludedFiles.add("classForEnumEntry.kt");
excludedFiles.add("kt10143.kt");
excludedFiles.add("internalTopLevelOtherPackage.kt");
excludedFiles.add("noPrivateDelegation.kt");
excludedFiles.add("platformTypeAssertionStackTrace.kt");
excludedFiles.add("packages.kt");
excludedFiles.add("kt10259.kt");
excludedFiles.add("kt11081.kt");
excludedFiles.add("kt6990.kt");
excludedFiles.add("mainInFiles.kt");
excludedFiles.add("noClassForSimpleEnum.kt");
excludedFiles.add("simpleClassLiteral.kt");
excludedFiles.add("jvmName.kt");
excludedFiles.add("qualifiedName.kt");
excludedFiles.add("topLevelProperty.kt");
excludedFiles.add("typeParameters.kt");
excludedFiles.add("kt13133.kt");
excludedFiles.add("genericOverriddenFunction.kt");
excludedFiles.add("genericOverriddenProperty.kt");
excludedFiles.add("genericProperty.kt");
excludedFiles.add("kt684.kt"); // StackOverflow with StringBuilder (escape())
// StackOverflow with StringBuilder (escape())
excludedFiles.add("kt684.kt");
excludedFiles.add("genericBackingFieldSignature.kt"); // Wrong signature after package renaming
excludedFiles.add("genericMethodSignature.kt"); // Wrong signature after package renaming
excludedFiles.add("kt11121.kt"); // Wrong signature after package renaming
excludedFiles.add("kt5112.kt"); // Wrong signature after package renaming
// Wrong enclosing info or signature after package renaming
excludedFiles.add("enclosingInfo");
excludedFiles.add("signature");
excludedFiles.add("genericBackingFieldSignature.kt");
excludedFiles.add("genericMethodSignature.kt");
excludedFiles.add("kt11121.kt");
excludedFiles.add("kt5112.kt");
excludedFiles.add("classpath.kt"); // Some classes are not visible on android
// Different format of inner signature on Android and JVM
excludedFiles.add("signatureOfDeepGenericInner.kt");
excludedFiles.add("signatureOfDeepInner.kt");
excludedFiles.add("signatureOfDeepInnerLastGeneric.kt");
excludedFiles.add("signatureOfGenericInnerGenericOuter.kt");
excludedFiles.add("signatureOfGenericInnerSimpleOuter.kt");
excludedFiles.add("signatureOfSimpleInnerSimpleOuter.kt");
excludedFiles.add("manyNumbers.kt"); // Out of memory
// Some classes are not visible on android
excludedFiles.add("classpath.kt");
excludedFiles.add("external"); //native methods
// Out of memory
excludedFiles.add("manyNumbers.kt");
excludedFiles.add("enclosingInfo"); // Wrong enclosing info after package renaming
excludedFiles.add("signature"); // Wrong signature after package renaming
// Native methods
excludedFiles.add("external");
excludedFiles.add("functionNtoStringNoReflect.kt"); // disabled cause test executed with reflection
// Additional nested class in 'Thread' class on Android
excludedFiles.add("nestedClasses.kt");
// No 'modifiers' field in 'java.lang.reflect.Field' class
excludedFiles.add("kt12200Const.kt");
excludedFiles.add("nestedClasses.kt"); // additional nested class in 'Thread' class on Android
excludedFiles.add("kt12200Const.kt"); // no 'modifiers' field in 'java.lang.reflect.Field' class
excludedFiles.add("closureOfInnerLocalClass.kt"); // KT-8120
excludedFiles.add("closureWithSelfInstantiation.kt"); // KT-8120
// KT-8120
excludedFiles.add("closureOfInnerLocalClass.kt");
excludedFiles.add("closureWithSelfInstantiation.kt");
}
private SpecialFiles() {

View File

@@ -16,66 +16,20 @@
package org.jetbrains.kotlin.backend.common
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.backend.common.bridges.findInterfaceImplementation
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.MemberComparator
import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsExpression
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.isDynamic
import org.jetbrains.kotlin.types.typeUtil.makeNullable
import org.jetbrains.kotlin.utils.keysToMapExceptNulls
object CodegenUtil {
// class Foo : Bar by baz
// descriptor = Foo
// toInterface = Bar
// delegateExpressionType = typeof(baz)
// return Map<member of Foo, corresponding member of typeOf(baz)>
@JvmStatic
fun getDelegates(
descriptor: ClassDescriptor,
toInterface: ClassDescriptor,
delegateExpressionType: KotlinType? = null
): Map<CallableMemberDescriptor, CallableDescriptor> {
if (delegateExpressionType?.isDynamic() ?: false) return emptyMap()
return descriptor.defaultType.memberScope.getContributedDescriptors().asSequence()
.filterIsInstance<CallableMemberDescriptor>()
.filter { it.kind == CallableMemberDescriptor.Kind.DELEGATION }
.asIterable()
.sortedWith(MemberComparator.INSTANCE)
.keysToMapExceptNulls { delegatingMember ->
val actualDelegates = DescriptorUtils.getAllOverriddenDescriptors(delegatingMember)
.mapNotNull { overriddenDescriptor ->
if (overriddenDescriptor.containingDeclaration == toInterface) {
val scope = (delegateExpressionType ?: toInterface.defaultType).memberScope
val name = overriddenDescriptor.name
// this is the actual member of delegateExpressionType that we are delegating to
(scope.getContributedFunctions(name, NoLookupLocation.FROM_BACKEND) +
scope.getContributedVariables(name, NoLookupLocation.FROM_BACKEND))
.firstOrNull {
(listOf(it) + DescriptorUtils.getAllOverriddenDescriptors(it))
.map(CallableMemberDescriptor::getOriginal)
.contains(overriddenDescriptor.original)
}
}
else null
}
assert(actualDelegates.size <= 1) { "Many delegates found for $delegatingMember: $actualDelegates" }
actualDelegates.firstOrNull()
}
}
@JvmStatic
fun getDelegatePropertyIfAny(
expression: KtExpression, classDescriptor: ClassDescriptor, bindingContext: BindingContext
@@ -106,7 +60,9 @@ object CodegenUtil {
if (declaration !is CallableMemberDescriptor) continue
val traitMember = findInterfaceImplementation(declaration)
if (traitMember == null || Visibilities.isPrivate(traitMember.visibility)) continue
if (traitMember == null ||
Visibilities.isPrivate(traitMember.visibility) ||
traitMember.visibility == Visibilities.INVISIBLE_FAKE) continue
assert(traitMember.modality !== Modality.ABSTRACT) { "Cannot delegate to abstract trait method: $declaration" }
@@ -135,7 +91,7 @@ object CodegenUtil {
else if (traitMember is PropertyDescriptor) {
for (traitAccessor in traitMember.accessors) {
for (inheritedAccessor in (copy as PropertyDescriptor).accessors) {
if (inheritedAccessor.javaClass == traitAccessor.javaClass) { // same accessor kind
if (inheritedAccessor::class.java == traitAccessor::class.java) { // same accessor kind
result.put(traitAccessor, inheritedAccessor)
}
}
@@ -145,21 +101,11 @@ object CodegenUtil {
}
@JvmStatic
fun getSuperClassBySuperTypeListEntry(specifier: KtSuperTypeListEntry, bindingContext: BindingContext): ClassDescriptor {
fun getSuperClassBySuperTypeListEntry(specifier: KtSuperTypeListEntry, bindingContext: BindingContext): ClassDescriptor? {
val superType = bindingContext.get(BindingContext.TYPE, specifier.typeReference!!)
?: error("superType should not be null: ${specifier.text}")
return superType.constructor.declarationDescriptor as? ClassDescriptor
?: error("ClassDescriptor of superType should not be null: ${specifier.text}")
}
@JvmStatic
fun isEnumValueOfMethod(functionDescriptor: FunctionDescriptor): Boolean {
val methodTypeParameters = functionDescriptor.valueParameters
val nullableString = functionDescriptor.builtIns.stringType.makeNullable()
return DescriptorUtils.ENUM_VALUE_OF == functionDescriptor.name
&& methodTypeParameters.size == 1
&& KotlinTypeChecker.DEFAULT.isSubtypeOf(methodTypeParameters[0].type, nullableString)
}
@JvmStatic
@@ -177,4 +123,43 @@ object CodegenUtil {
val document = file.viewProvider.document
return document?.getLineNumber(if (markEndOffset) statement.textRange.endOffset else statement.textOffset)?.plus(1)
}
// Returns the descriptor for a function (whose parameters match the given predicate) which should be generated in the class.
// Note that we always generate equals/hashCode/toString in data classes, unless that would lead to a JVM signature clash with
// another method, which can only happen if the method is declared in the data class (manually or via delegation).
// Also there are no hard asserts or assumptions because such methods are generated for erroneous code as well (in light classes mode).
fun getMemberToGenerate(
classDescriptor: ClassDescriptor,
name: String,
isReturnTypeOk: (KotlinType) -> Boolean,
areParametersOk: (List<ValueParameterDescriptor>) -> Boolean
): FunctionDescriptor? =
classDescriptor.unsubstitutedMemberScope.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND)
.singleOrNull { function ->
function.kind.let { kind -> kind == CallableMemberDescriptor.Kind.SYNTHESIZED || kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE } &&
function.modality != Modality.FINAL &&
areParametersOk(function.valueParameters) &&
function.returnType != null &&
isReturnTypeOk(function.returnType!!)
}
@JvmStatic
fun BindingContext.isExhaustive(whenExpression: KtWhenExpression, isStatement: Boolean): Boolean {
val slice = if (isStatement && !whenExpression.isUsedAsExpression(this)) {
BindingContext.IMPLICIT_EXHAUSTIVE_WHEN
}
else {
BindingContext.EXHAUSTIVE_WHEN
}
return this[slice, whenExpression] == true
}
@JvmStatic
fun constructFakeFunctionCall(project: Project, referencedFunction: FunctionDescriptor): KtCallExpression {
val fakeFunctionCall = StringBuilder("callableReferenceFakeCall(")
fakeFunctionCall.append(referencedFunction.valueParameters.map { "p${it.index}" }.joinToString(", "))
fakeFunctionCall.append(")")
return KtPsiFactory(project, markGenerated = false).createExpression(fakeFunctionCall.toString()) as KtCallExpression
}
}

View File

@@ -16,16 +16,17 @@
package org.jetbrains.kotlin.backend.common
import org.jetbrains.kotlin.backend.common.CodegenUtil.getMemberToGenerate
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.BindingContextUtils
import org.jetbrains.kotlin.types.KotlinType
/**
* A platform-independent logic for generating data class synthetic methods.
@@ -77,17 +78,20 @@ abstract class DataClassMethodGenerator(private val declaration: KtClassOrObject
}
private fun generateDataClassToStringIfNeeded(properties: List<PropertyDescriptor>) {
val function = getMemberToGenerate("toString", KotlinBuiltIns::isString, List<ValueParameterDescriptor>::isEmpty) ?: return
val function = getMemberToGenerate(classDescriptor, "toString",
KotlinBuiltIns::isString, List<ValueParameterDescriptor>::isEmpty) ?: return
generateToStringMethod(function, properties)
}
private fun generateDataClassHashCodeIfNeeded(properties: List<PropertyDescriptor>) {
val function = getMemberToGenerate("hashCode", KotlinBuiltIns::isInt, List<ValueParameterDescriptor>::isEmpty) ?: return
val function = getMemberToGenerate(classDescriptor, "hashCode",
KotlinBuiltIns::isInt, List<ValueParameterDescriptor>::isEmpty) ?: return
generateHashCodeMethod(function, properties)
}
private fun generateDataClassEqualsIfNeeded(properties: List<PropertyDescriptor>) {
val function = getMemberToGenerate("equals", KotlinBuiltIns::isBoolean) { parameters ->
val function = getMemberToGenerate(classDescriptor, "equals",
KotlinBuiltIns::isBoolean) { parameters ->
parameters.size == 1 && KotlinBuiltIns.isNullableAny(parameters.first().type)
} ?: return
generateEqualsMethod(function, properties)
@@ -99,23 +103,5 @@ abstract class DataClassMethodGenerator(private val declaration: KtClassOrObject
.map { bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, it)!! }
private val primaryConstructorParameters: List<KtParameter>
get() = (declaration as? KtClass)?.getPrimaryConstructorParameters().orEmpty()
// Returns the descriptor for a function (whose parameters match the given predicate) which should be generated in the data class.
// Note that we always generate equals/hashCode/toString in data classes, unless that would lead to a JVM signature clash with
// another method, which can only happen if the method is declared in the data class (manually or via delegation).
// Also there are no hard asserts or assumptions because such methods are generated for erroneous code as well (in light classes mode).
private fun getMemberToGenerate(
name: String,
isReturnTypeOk: (KotlinType) -> Boolean,
areParametersOk: (List<ValueParameterDescriptor>) -> Boolean
): FunctionDescriptor? =
classDescriptor.unsubstitutedMemberScope.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND)
.singleOrNull { function ->
!function.kind.isReal &&
function.modality != Modality.FINAL &&
areParametersOk(function.valueParameters) &&
function.returnType != null &&
isReturnTypeOk(function.returnType!!)
}
get() = (declaration as? KtClass)?.primaryConstructorParameters.orEmpty()
}

View File

@@ -23,6 +23,12 @@ interface FunctionHandle {
val isDeclaration: Boolean
val isAbstract: Boolean
/** On finding concrete super declaration we should distinguish non-abstract java8/js default methods from
* class ones (see [findConcreteSuperDeclaration] method in bridges.kt).
* Note that interface methods with body compiled to jvm 8 target are assumed to be non-abstract in bridges method calculation
* (more details in [DescriptorBasedFunctionHandle.isBodyOwner] comment).*/
val isInterfaceDeclaration: Boolean
fun getOverridden(): Iterable<FunctionHandle>
}
@@ -108,7 +114,7 @@ fun <Function : FunctionHandle> findConcreteSuperDeclaration(function: Function)
}
result.removeAll(toRemove)
val concreteRelevantDeclarations = result.filter { !it.isAbstract }
val concreteRelevantDeclarations = result.filter { !it.isAbstract && !it.isInterfaceDeclaration }
if (concreteRelevantDeclarations.size != 1) {
error("Concrete fake override $function should have exactly one concrete super-declaration: $concreteRelevantDeclarations")
}

Some files were not shown because too many files have changed in this diff Show More