Compare commits

...

6009 Commits

Author SHA1 Message Date
Igor Chevdar
3a35ba7e58 Fixed WrappedClassDescriptor 2019-01-23 11:16:19 +03:00
Pavel Punegov
d0fb059d58 Update K/N to 1.1.1-release-6082 2019-01-23 11:15:38 +03:00
Roman Artemev
27d3a1e534 Update 1.3.20 ChangeLog 2019-01-21 19:17:24 +03:00
Yan Zhulanow
2027d58ef3 Remove Android Extensions from the default JPS classpath 2019-01-21 18:50:51 +03:00
Pavel Punegov
8f5ca82b26 Update to 1.1.0-release-5988 for 1.3.20 2019-01-21 17:43:35 +03:00
Mikhail Glukhikh
0d9c30a311 Use correct project for settings.gradle manipulations #KT-29333 Fixed
Otherwise we get an error "Element from alien project".
See details in added comment.
2019-01-21 13:57:44 +03:00
Ilya Chernikov
76b8319fbe Change default jvmTarget for scripts compilation via jvmhost to 1.8
#KT-29319 fixed
2019-01-18 18:10:32 +01:00
Ilya Chernikov
069857c12c Implement test for #KT-29301, #KT-29296 and #KT-29293 2019-01-18 18:10:31 +01:00
Ilya Chernikov
5ab6472a4d Keep ivy resolvers in the main-kts.jar
#KT-29301 fixed
2019-01-18 18:10:31 +01:00
Ilya Chernikov
5306e3f88a Implement and use helpers for economical classpath update in script configs 2019-01-18 18:10:30 +01:00
Ilya Chernikov
97a8739182 Allow explicit nulls for props with default, allow null as base classloader for evaluation
and use proper default evaluation configuration if not supplied explicitly;
also add reset method to the properties builder and containsKey method to
the properties collection
#KT-29296 fixed
2019-01-18 18:10:29 +01:00
Ilya Chernikov
1623ed027d Add stdlib, etc. to the script dependencies on compilation
#KT-29293 fixed
2019-01-18 18:10:29 +01:00
Alexander Podkhalyuzin
e0226ce5dd Removed usages to deprecated API, which is going to be removed in 2019.1
(cherry picked from commit 36b2640ab7)
2019-01-18 18:33:24 +03:00
Ilya Gorbunov
e1734fbbda Document that sorting is stable in each platform
#KT-12473 Fixed

(cherry picked from commit 0ac85ad715)
2019-01-18 17:47:53 +03:00
Ilya Gorbunov
d2a0a2a0de Ensure stable sorting in MutableList.sort/sortWith
MutableList.sortWith now works correctly in JS_IR backend too

#KT-12473

(cherry picked from commit 56672c2564)
2019-01-18 17:47:53 +03:00
Ilmir Usmanov
59c5ab7d8e Do not mark fake inliner variables as alive
This prevents them from spilling.
 #KT-29317 Fixed

(cherry picked from commit e8c52e0a8f)
2019-01-18 17:05:47 +03:00
Ilmir Usmanov
8ed766e628 Add regression test
#KT-29327

(cherry picked from commit 7e4e1b9a4d)
2019-01-18 16:44:46 +03:00
Ilmir Usmanov
ad12184e14 Revert "Simplify tail-call optimisation check"
This reverts commit a5bcd3495e.

 #KT-27190: Open
 #KT-29327: Fixed

(cherry picked from commit dc6bb4cd08)
2019-01-18 16:44:12 +03:00
Ilmir Usmanov
4f6971339d Fix test data 2019-01-17 14:23:54 +03:00
Ilmir Usmanov
9ee4cab849 Put default value to vars iff they are not boxed
#KT-24672 Fixed
2019-01-17 14:23:47 +03:00
Alexander Udalov
e2de2fc059 Make CommonToolArguments.nullable
#KT-28974 Fixed

(cherry picked from commit 05c25342ad)
2019-01-16 14:58:32 +01:00
Pavel Punegov
eae3cf9f32 Update to 1.1.0-rc2-5686 2019-01-14 22:49:44 +03:00
Yan Zhulanow
825dd7abe9 Fix testJavacIsLoadedOnce() kapt integration test 2019-01-14 17:38:15 +03:00
Ilya Matveev
ffc235b730 Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
2019-01-14 20:45:08 +07:00
Dmitry Savvinov
9ff115514e Get rid of FUNCTOR slice, use lazy value in ContractDecription instead
Functor is an imperative representation of function's contract (contrary
to ContractDescription, which is a declarative one). ContractDescription
is convenient when we deal with sources of contracts declarations
(binaries, source), while Functors are convenient for analyzing code
with contracts.

It means that we have to convert ContractDescription into Functor when
we start working with contracts. This computation isn't trivial, and
Functor and ContractDescription are in 1-1 correspondence, so we would
like to cache Functor for each ContractDescription somewhere.

We used to do this in binding trace, in slice FUNCTOR.

Now, it turns out that this approach causes "Rewrite at slice"
exception, see KT-28847. We won't go into details of why that happens
here, you can see the issue comments for details (but be prepared for the
very long and nitty-gritty story)

This commit removes the problematic slice and introduces another
approach, where Functor is attached to the ContractDescription, computed
lazily and cached here.

^KT-28847 Fixed
2019-01-14 12:04:08 +03:00
Dmitry Savvinov
dc1e44813c Add test on rewrite at slice FUNCTOR 2019-01-14 12:04:07 +03:00
Alexander Podkhalyuzin
016e103755 Implemented KotlinResolveScopeEnlarger for modules
Before that we had dependency to iml file, which is incorrect

(cherry picked from commit 893479bd5e)
2019-01-14 10:55:05 +03:00
Ting-Yuan Huang
12e03c34c6 Allow specifying isolation mode for KAPT workers
There are a few isolation modes for Gradle workers. KAPT uses 2 of them.

IsolationMode.NONE is the default. It runs workers in Gradle daemon and
is more memory efficient.

IsolationMode.PROCESS forks workers into individual processes. This
keeps some resource leaking annotation processors from affecting the
rest of compilation.

Users can specify kapt.workers.isolation=process, if they need to use
some annotation processor that are known to be resource leaking.
2019-01-11 23:51:20 +03:00
Ilya Gorbunov
65c6dd9e1a Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including
 arrays of object and floating point numbers.

#KT-22942 Fixed

(cherry picked from commit 23950042f6)
2019-01-11 21:37:57 +03:00
Ilya Gorbunov
6c7cbfc09c Improve Any.equals/hashCode docs
- add code formatting
- remove 'reference' adjective, as Kotlin doesn't distinguish primitives from reference types
- add the requirement of inequality to null
- replace inaccurate note with a link to the reference (relates to KT-26604)

#KT-14866

(cherry picked from commit ef278ea030)
2019-01-11 21:37:55 +03:00
Ilya Gorbunov
74d06c63e6 Provide stable sorting when JS engine sorting doesn't look stable
#KT-12473

(cherry picked from commit 51eb21d44b)
2019-01-11 21:37:54 +03:00
Ilya Gorbunov
01a3accd53 Remove specialization of toTypedArray for LongArray and BooleanArray in JS
The default implementation for primitive arrays returns an array of correct type.

#KT-29187 Fixed

(cherry picked from commit 7c3c454654)
2019-01-11 21:37:52 +03:00
Ilya Gorbunov
da23ed15af Update copyright in generated stdlib sources
(cherry picked from commit fcef876c7e)
2019-01-11 21:37:51 +03:00
Sergey Igushkin
5cd7d6414d Fixes for review KOTLIN-CR-2599
* Move source artifacts to KotlinVariant classes (since joint Android
 variants may have multiple source artifacts, make it a set)

* Change lowerSpinalCaseName to dashSeparatedName (doesn't transform
 the strings to lower case inside)

* Don't transform the project name to lower case (in the future, it may
 be reasonable to stop transforming the target and component names, too)
 Still transform the target names and the component names.
 Currently, this is the way we don't break existing publications and may
 still reconsider this in the future.

* Add a workaround for a list of GString's assigned to
 publishLibraryVariants

* Check for Android library variants existence in a more strict way,
 report existing variants that are not library variants.

(cherry picked from commit 8bc7ac32f3)
2019-01-11 20:44:57 +03:00
Sergey Igushkin
0544745a5c Properly setup localToProject attribute in jvmWithJava (KT-29035)
A dependency on a multiplatform module with a jvmWithJava target failed
to resolve because the 'apiElements' and 'runtimeElements'
configurations didn't have the attribute 'localToProject' set to
'public'.

Those configurations need to have have the attribute set as per the
fix of KT-28795, but it doesn't happen.

Issue #KT-29035 Fixed

(cherry picked from commit 7e6527ca65)
2019-01-11 20:44:41 +03:00
Sergey Igushkin
1651e94bb8 Expose 'allKotlinSourceSets' in KotlinCompilation (KT-28749)
As KotlinCompilation only contains the directly added source sets in its
`kotlinSourceSets` property, we need to provide a convenient way to
collect the whole source sets hierarchy for a compilation.

We added internal `allKotlinSourceSets` some time ago, and it seems
reasonable to expose it as public API.

Issue #KT-28749 Fixed

(cherry picked from commit 0abd044800)
2019-01-11 20:44:14 +03:00
Sergey Igushkin
2c359a61ff Link the 'api' configuration to 'apiElements' (KT-28355)
As we introduced the 'api' configurations for Kotlin source sets, the
Java plugin did not link these configurations to its 'apiElements', and
those dependencies would only get published with the 'runtime' scope
through the 'implementation' configuration.

To fix this, manually specify that 'apiElements' extendsFrom 'api'.

Issue #KT-28355 Fixed

(cherry picked from commit 0cf95f84cb)
2019-01-11 20:43:59 +03:00
Sergey Igushkin
a5ef558355 Fix transitive dependencies overriding default Kotlin version (KT-28820)
In Gradle 5.0, the 'prefer' function semantics has changed, and now a
transitive dependency version wins over the 'preferred' one. Instead,
'require' has been introduced in 5.0 with the old semantics.

Our users expect that the default Kotlin dependency version will be
at least as new as the plugin version, so we now need to use 'require'
with Gradle 5.0+

Issue KT-28820 Fixed

(cherry picked from commit 82f13b90e6)
2019-01-11 20:43:40 +03:00
Sergey Igushkin
e9bfd0b3c2 Always rewrite dependencies in POMs when publishing an MPP (KT-28482)
As non-Gradle consumers and Gradle consumers with metadata disabled
cannot read Gradle metadata, in POMs (the only source of dependencies
for the consumers mentioned above), we should publish the dependencies
on modules with metadata as the target artifact IDs rather than the root
MPP module ID (e.g. 'foo-jvm' rather than 'foo').

To do that, we rewrite the POMs of the publications even when Gradle
metadata is enabled. Note: in the POMs, a project dependency is already
written in the form of the artifact ID of the root Kotlin software
component, so it complicates the dependencies rewriting a little.

To rewrite third-party dependencies, we detect dependencies that
resolved to no artifact and have a single child in the Gradle
dependencies graph of the resolved configuration – this is what a
dependency looks like which was redirected to another module via
'available-at'.

Issue #KT-28482 Fixed

(cherry picked from commit f9c45c30a2)
2019-01-11 20:43:13 +03:00
Sergey Igushkin
669d7ae9c3 Fix failure when creating a compilation in afterEvaluate (KT-28896)
To configure a compilation's sources, we run an action in
`whenEvaluated { ... }`, expecting that the compilation's task already
exists. This was not true with compilations created from a user build
script or a 3rd-party plugin in `afterEvaluate { ... }`.

Fix this by expecting that a task may possibly not exist at that point,
and also using `whenEvaluated { ... }` instead of
`afterEvaluate { ... }` in several places that are executed for each new
compilation as a workaround for
https://github.com/gradle/gradle/issues/1135.

Issue #KT-28896 Fixed

(cherry picked from commit 2fd524f1c0)
2019-01-11 20:42:54 +03:00
Sergey Igushkin
60d8f6eabd Publish Android variants from multiplatform projects
Also update the code for rewriting the dependencies, as Android variants
have their dependencies configurations formed a bit differently, and
also introduce the logic for choosing the right component by the
configuration name the dependency resolves to.

Issue #KT-27535 Fixed

(cherry picked from commit de5e86ae9f)
2019-01-11 20:42:32 +03:00
Sergey Igushkin
8791ce1685 Restructure source JARs logic, move it to components management
Move the logic of attaching a source JAR to a publication to the
components management part, as building a source JAR will be done
differently for Android.

(cherry picked from commit 9a2dce7ea5)
2019-01-11 20:42:19 +03:00
Sergey Igushkin
f42336950f Allow a target to have multiple publications, restructure the code
Instead of exposing a single `component` in a target, allow it to have a
set of `components`, then create a Maven publication for each of the
components.

Move `createUsageContexts` to private API since a target that has
multiple publications may need to create the usage contexts for those
publications differently.

Move some of the components technical stuff to interfaces
`DelegatedToPublication` and
`ComponentWithCoordinatesDelegatedToPublication` in order to reuse it
later for Android's components.

(cherry picked from commit d211bd53c9)
2019-01-11 20:41:54 +03:00
Sergey Igushkin
726901291e refactor: Support creating AndroidProjectHandler from outside the plugin
(cherry picked from commit a6b55cc5d7)
2019-01-11 20:41:32 +03:00
Ilya Gorbunov
f7712fc351 Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one.

Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.

#KT-29003

(cherry picked from commit 30c769c19a)
2019-01-11 19:33:57 +03:00
Pavel Punegov
4fa215eb47 Replace class instantiation with object in JS tests
(cherry picked from commit dc8cb103c5)
2019-01-11 17:45:00 +03:00
Pavel Punegov
84f173e75a DefaultAsserter object. Add function to replace constructor invoke.
(cherry picked from commit 1c4ecd287d)
2019-01-11 17:44:41 +03:00
Pavel Punegov
1a885cf1f4 Make kotlin.test asserter be ThreadLocal
(cherry picked from commit ac0f612781)
2019-01-11 17:44:24 +03:00
Pavel Punegov
898cbf974a Exclude native annotations in JS IR tests
(cherry picked from commit 4b3693bf37)
2019-01-11 17:42:53 +03:00
Pavel Punegov
386a3ee83e Add ThreadLocal and SharedImmutable native annotations as OptionalExpectation
to kotlin.native.concurrent

(cherry picked from commit 122ec85bf0)
2019-01-11 17:42:22 +03:00
Mikhael Bogdanov
392ab05f5f Delete dead code on last optimization step, otherwise ASM will split exception table on it.
ASM has logic that splits exception tables in MethodWriter.computeAllFrames:
     // Loop over all the basic blocks and visit the stack map frames that must be stored in the
     // StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
     // exception handler ranges.
     ...
     firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
     ...
  https://gitlab.ow2.org/asm/asm/issues/317867

  #KT-28546 Fixed

(cherry picked from commit 2bdf68ad67)
2019-01-11 15:29:57 +01:00
Mikhael Bogdanov
547c6ab897 Temporary disable line numbers generation for default values from expect declarations
Proper SMAP support for default values from expect declarations is required.
 Default value in expect declaration could has line number that
 exceed line count in actual file that causes an error

  #KT-23739 Fixed
  #KT-29174 Open

(cherry picked from commit 306a982722)
2019-01-11 15:29:50 +01:00
Andrey Uskov
231e5679b1 Create Kotlin SDK on load or import project with JS/Common modules
#KT-22590 Fixed
2019-01-11 17:05:24 +03:00
Andrey Uskov
03389cd249 Fix scope detection for MPP projects
#KT-27718 Fixed
#KT-28626 Fixed
2019-01-11 17:04:52 +03:00
Andrey Uskov
42c53b5d76 Change task creation with task registration in Kotlin plugin
#KT-27657 Fixed

(cherry picked from commit b6aed5b98a)
2019-01-11 17:03:56 +03:00
Mikhail Zarechenskiy
d303ae5c28 Fix dependency for Gradle integration tests module
After d5ebe2e6
2019-01-11 14:48:04 +03:00
Mikhail Glukhikh
b47636ba9d IDEA plugin: remove "Show FIR action" and fir-view without fir.enabled
#KT-28813 Fixed
(it's planned to include FIR in artifacts after 1.3.30)

(cherry picked from commit 4fd773a38b)
2019-01-11 13:50:15 +03:00
Sergey Rostov
911748fde2 JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed

(cherry picked from commit 75e59fdc46)
2019-01-11 13:18:01 +03:00
Dmitry Savvinov
682f15f248 Introduce specific version of NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY for KT-28061
In 1.3.0 there was introduced KT-28061 bug, which caused some of the
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostics to be lost (turning
"red" code into "green")

500dc11514 fixes the bug and returns
lost diagnostics back. This commit adds additional information for some
of the cases where diagnostics were list and then brought back (for the
user sanity).

The heuristic used for detecting cases which need additional information
is simple: if function has return in in-place called lambda, and
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY should be reported, then we
enhance it with additional information.

^KT-28061 Fixed
2019-01-11 11:46:30 +03:00
Ilya Matveev
91b08d374b Fix linkTaskName getters of K/N compilations 2019-01-11 13:23:05 +07:00
Ilya Matveev
0cc417c97b Support getting the default K/N test binary from a compilation
Fix for https://github.com/JetBrains/kotlin-native/issues/2487
2019-01-11 13:22:58 +07:00
Mikhail Zarechenskiy
169155d854 Reorganize dependencies around kotlin-compiler.jar
#KT-26807 Fixed
2019-01-11 00:19:44 +03:00
Ilya Gorbunov
3f8f53cb8c Remove redundant clause from 'until' function docs
(cherry picked from commit 9289a2c573)
2019-01-10 22:56:00 +03:00
Bernhard Posselt
6fc756c4c0 Add documentation on how merging works for toMap() for Iterables, Arrays and Sequences
(cherry picked from commits 300f68e0d8, 19906f13ea)
2019-01-10 22:54:39 +03:00
Denis Zharkov
6a8ef4ac1a Fix exception in ultra-light classes in case of complex mpp hierarchy
Without the introduced override, default implementation of isEquivalentTo
runs delegate computation of `another` that is illegal
for KtUltraLightClass

^KT-28912 Fixed
2019-01-10 14:12:10 +03:00
Ilya Matveev
4aaf36131f One more fix for MinGW path in K/N runner 2019-01-10 18:02:47 +07:00
Ilya Chernikov
f2e1b0bc22 Add import support to main-kts, with test 2019-01-10 10:56:37 +01:00
Ilya Chernikov
ec6b1dc1e5 Add shared script instances support, fix and refactor evaluation accordingly
also fix arguments order in the evaluator
2019-01-10 10:56:37 +01:00
Ilya Chernikov
aa2315f378 Add mapping function for transformations with ResultsWithDiagnostics
also improve chaining helpers
2019-01-10 10:56:37 +01:00
Ilya Chernikov
28b91ce848 [minor] add comment to the "Fix locking in script definition provider" commit 2019-01-10 10:56:36 +01:00
Ilya Chernikov
3c7e57d9c4 [minor] fix scripting test on windows 2019-01-10 10:56:36 +01:00
Yan Zhulanow
dfd163af34 Fix 'CommandLineProcessor' extension point calling, switch it to using ServiceLoaderLite 2019-01-09 22:05:53 +03:00
Yan Zhulanow
8b24dd98f6 Remove JPS support for Android Extensions 2019-01-09 22:05:49 +03:00
Ilya Matveev
4b4a709e86 Fix MinGW path in Kotlin/Native runner 2019-01-09 20:48:21 +07:00
Mikhael Bogdanov
0c4c6860be Add tests for Obsolete issues
#KT-18977 Obsolete

(cherry picked from commit f7ce8c18c6)
2019-01-09 10:22:08 +01:00
Mikhael Bogdanov
d6fcc35f17 Add test for Obsolete issues
#KT-15956 Obsolete
 #KT-15751 Obsolete
 #KT-16417 Obsolete
 #KT-21787 Obsolete

(cherry picked from commit 9a059809bf)
2019-01-08 14:05:05 +01:00
Mikhael Bogdanov
0602baa38e Avoid ConcurrentModificationException
#KT-26384 Fixed

(cherry picked from commit 6a19e45e27)
2019-01-08 13:58:30 +01:00
Mikhael Bogdanov
c9ac71dd8d Proper resort variables on inlining lowered ir closures
Original problem is that lowered ir closures doesn't meet inliner expectations
 about captured variable position in inlining method.
 E.g.: Call 'foo(valueParam) { capturedParam }' to
  inline function 'foo' with declaration

      inline fun foo(valueParam: Foo, inlineParamWithCaptured: Bar.() ->) ....

 is reorganized through inlining to equivalent call foo(valueParam, capturedParam1, cp2 ...).
 But lowered closure for lambda parameter has totally different parameters order:

     fun loweredLambda$x(extensionReceiver, captured1, cp2..., valueParam1, vp2...)

 So before inlining lowered closure should be transformed to

     fun loweredLambda$x(extensionReceiver, valueParam1, vp2..., captured1, cp2..)

 #KT-28547 Fixed

(cherry picked from commit 02d9c526e2)
2019-01-03 08:42:52 +01:00
Mikhael Bogdanov
e04959a939 Update copyright in generated FIR related stuff
(cherry picked from commit fcf8ea44b2)
2019-01-03 08:30:53 +01:00
Mikhael Bogdanov
a399539094 Regenerate builtins
(cherry picked from commit dfee1787e5)
2019-01-03 08:30:46 +01:00
Mikhael Bogdanov
d71e0fc7c3 Update copyright in generated non-compiler tests
(cherry picked from commit e963c52c80)
2019-01-03 08:30:38 +01:00
Mikhael Bogdanov
ac870129df Add test for obsolete KT-17431 issue
#KT-17431 Obsolete

(cherry picked from commit e0bcba5c0e)
2019-01-03 08:30:28 +01:00
Mikhael Bogdanov
7f485172a8 Update copyright in generated compiler tests
(cherry picked from commit cf47bc0130)
2019-01-03 08:29:53 +01:00
Mikhael Bogdanov
df4cbd50d6 Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
  E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
  where type of default lambda is '(Base) -> Child'.
  In such case we should find somehow actual invoke method in bytecode knowing
  only name, number of parameters and that's actual invoke is non-synthetic
  regardless of bridge one.

  #KT-21946 Fixed

(cherry picked from commit 6bf70a5dd2)
2019-01-03 08:29:09 +01:00
Ilmir Usmanov
066ecd5308 Fix test data 2018-12-28 20:02:27 +03:00
Ilmir Usmanov
30c7b3cc1d Support val initialization in non-inline function with EXACTLY_ONCE effect
by generating a box for the value.
 #KT-26126 Fixed
2018-12-28 15:22:24 +03:00
Ilmir Usmanov
38bc99d792 Put default value (null or zero) to slot for uninitialized values
This way range of the variable is correct in LVT.
 #KT-24672 Fixed
2018-12-28 15:22:20 +03:00
Alexander Udalov
88ed2e268f Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed

(cherry picked from commit 8ab9226805)
2018-12-28 13:03:34 +01:00
Alexander Udalov
720a35bc26 Use fast .class file reading implementation in boxAgainstJava tests
Since these tests compile Kotlin code against compiled Java code, it's
only reasonable to use the same .class file reading implementation as is
used in production for the same purpose

(cherry picked from commit 3fee84b966)
2018-12-28 13:03:32 +01:00
Ilmir Usmanov
e141441bf5 Update test data
#KT-28309
2018-12-28 14:42:05 +03:00
Ilmir Usmanov
f50f9d069f Do not spill fake variables
#KT-28309
2018-12-28 14:42:04 +03:00
Ilmir Usmanov
c4f99b850b Add continuation parameter of suspend lambda's invoke to frame map
thus it will not overlap with $i$a and $i$f fake variables.
 #KT-28309
2018-12-28 14:42:03 +03:00
Ilmir Usmanov
8e3eb04271 Set type of inliner's fake variable slots to int by storing 0
Otherwise, D8 drops the whole LVT.
 #KT-28309 Fixed
2018-12-28 14:42:02 +03:00
Nicolay Mitropolsky
75987697db Light-annotations: fix for reading class-literal varargs (KT-29027, IDEA-204252)
(cherry picked from commit ebd6caaa71)
2018-12-28 11:50:38 +03:00
Nikolay Krasko
1c93018db4 Remove assertion with selection in 1.3.20 2018-12-27 21:32:54 +03:00
Mikhail Glukhikh
6fa26c5356 Improve expect / actual markers on one line
Before this commit, only one-line enums and annotation classes were
considered. Now we can have enum header on one line and
some entries on another lines, and it still works.
Same with primary constructor parameters.

#KT-22637 Fixed

(cherry picked from commit 8de2ff2163)
2018-12-27 20:24:01 +03:00
Mikhail Glukhikh
e97009bd49 Do not report "redundant arrow" with parameters without expected type
#KT-29049 Fixed
Part of KT-29005

(cherry picked from commit cdef811c55)
2018-12-27 20:23:43 +03:00
Nikolay Krasko
6ae156c8a4 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-27 19:56:22 +03:00
Dmitry Petrov
595d55707c Support inline classes in javaObjectType/javaPrimitiveType
#KT-28290
2018-12-27 15:27:21 +03:00
Natalia Selezneva
9fbc71475b Scratch: move 'Make module' checkbox closer to modules combobox
(cherry picked from commit 022b21efa0)

^KT-28910
2018-12-27 09:01:29 +03:00
Natalia Selezneva
a13c744533 Set scratch file extension using API for IDEA 182 or higher
(cherry picked from commit 404c3ea57b)
2018-12-27 09:01:09 +03:00
Natalia Selezneva
f2f1e923ee Script tests: check that script is highlighted
(cherry picked from commit 6eff314b9d)
2018-12-27 09:00:53 +03:00
Natalia Selezneva
0905c6ba27 Refactoring: move scratch options to ScratchFile from ScratchPanel
(cherry picked from commit d389c9fd85)
2018-12-27 09:00:40 +03:00
Natalia Selezneva
0ebe31af73 Scratch: do not show error message when scratch execution is cancelled by user
(cherry picked from commit a408711f37)
2018-12-27 09:00:29 +03:00
Natalia Selezneva
846fb60c91 Refactoring: unify methods to report errors in scratches
(cherry picked from commit 2fbbf2400d)
2018-12-27 09:00:17 +03:00
Natalia Selezneva
ce36fc594f Refactoring: move test output handler to separate class
(cherry picked from commit 2f32c6e164)
2018-12-27 09:00:03 +03:00
Natalia Selezneva
9e6db690d5 Refactoring: add composite output handler to avoid multiple forEach calls
(cherry picked from commit 392e69c690)
2018-12-27 08:59:50 +03:00
Natalia Selezneva
1702c8df25 Scratch: implement stop action
(cherry picked from commit 2511f70bd9)

^KT-28643 Fixed
2018-12-27 08:59:38 +03:00
Natalia Selezneva
88fcbdd079 Scratch: get scratch panel from selected editor
CommonDataKeys.EDITOR key isn't present for some events (for example when user click on isRepl checkbox on scratch panel or there isn't any file open in the editor)

(cherry picked from commit d403514cee)

^KT-28045 Fixed
2018-12-27 08:59:13 +03:00
Natalia Selezneva
8015483db6 Refactoring: use output handlers to make action enabled or disabled
(cherry picked from commit 59a32ff94d)
2018-12-27 08:58:48 +03:00
Leonid Startsev
e644c05b31 Make serialization plugin for Maven consistent with all other plugins:
Use correct import handler because old one was not working in IDE
Change maven artifact id to match pattern from other plugins

(cherry picked from commit 662c1b6d4a)
2018-12-26 18:54:39 +03:00
Mikhail Glukhikh
1220ef51b5 Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed

(cherry picked from commit 8420fceb8c)
2018-12-26 18:43:54 +03:00
Mikhail Glukhikh
624a4802b4 Do not suggest cast for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
Related to KT-27590

(cherry picked from commit 73b6148407)
2018-12-26 18:43:39 +03:00
Mikhail Glukhikh
7aef1a9073 Suggest quick-fixes for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
#KT-27590 Fixed

(cherry picked from commit d7ce79cc76)
2018-12-26 18:43:24 +03:00
Mikhail Glukhikh
774b5408b6 More tests for KT-28997, fix isLocal for anonymous object in script
(cherry picked from commit a9147ff446)
2018-12-26 18:43:10 +03:00
Mikhail Glukhikh
ac867bb063 Fix light class generation for local classes in scripts
Before this commit, we used script context for all classes
defined in script. However, for local classes in scripts it's mistake,
and now we generate them as usual, despite of the fact we are in script.

#KT-28997 Fixed

(cherry picked from commit 661ac711c0)
2018-12-26 18:42:56 +03:00
Mikhail Glukhikh
9583b05160 Extract 'PsiElement.hasJavaResolutionFacade()' (related to KT-28199)
(cherry picked from commit 7d51be17c8)
2018-12-26 18:42:40 +03:00
Mikhail Glukhikh
a0e3340a03 Launch constructor delegation search only for elements from a file
This should fix EA-133791

(cherry picked from commit d599bb160f)
2018-12-26 18:42:22 +03:00
Mikhail Glukhikh
7b68e5b74e Launch convention method reference search only for elements from a file
#KT-28199 Fixed

(cherry picked from commit 399ec5c961)
2018-12-26 18:42:06 +03:00
Nikolay Krasko
debc248a78 Check file is valid before executing toPsiFile (EA-133882) 2018-12-26 15:47:07 +03:00
Nikolay Krasko
297f5eefb2 Consider qualified name is null if some part is null (EA-126499) 2018-12-26 15:46:59 +03:00
Natalia Selezneva
1751e7ca78 Kotlin code fragments in markdown should have script definition because they are parsed as scripts
(cherry picked from commit 9dc57567e4)
2018-12-26 08:59:40 +03:00
Natalia Selezneva
30b5535dc1 Create one instance of StandardIdeScriptDefinition per project
ScriptModuleInfo for scripts outside source roots in compared by virtualFile and script definition.
So when we use ScriptDefinitionsManaged.getDefaultScriptDefinition we shouldn't create a new one on each call

EA-132810 - assert: DiagnoseUnknownModuleInfoReporter.report

(cherry picked from commit 4e6fb84bae)
2018-12-26 08:59:05 +03:00
Natalia Selezneva
973622bc60 Remove ScriptModificationListener from 183 branch
Since 183 changes in .gradle.kts files are tracked correctly by platform and notification 'Gradle project needs to be imported' is shown when those files are modified

(cherry picked from commit ba2f211384)
2018-12-26 08:58:45 +03:00
Natalia Selezneva
cfa3422644 Scripts: fix NPE during accessing ScriptDependenciesCache
Getting value from SLRUMap needs write lock, because it can move value from one queue to another
EA-105195 Fixed

(cherry picked from commit 6042a3a0f7)
2018-12-26 08:58:28 +03:00
Natalia Selezneva
00a4365752 Fix 'Invalid file' exception during script dependencies update
Fix EA-125840 - assert: FileManagerImpl.findFile

(cherry picked from commit 8ceae8bd6d)
2018-12-26 08:58:11 +03:00
Natalia Selezneva
cfd030ac8d Fix order of initialization of project language version in ConfigureKotlinTest
Project.getLanguageVersion with contextModule == null returns latest stable version.
But Module.getLanguageVersion save it's version to project setting if useProjectSettings checkbox is selected.
So Project.getLanguageVersion can return different versions before and after invocation Module.getLanguageVersion

(cherry picked from commit 816a8d74a2)
2018-12-26 08:57:53 +03:00
Andrey Uskov
6230af0f3b Fix reimport of Kotlin projects created via wizard
#KT-27941 Fixed
2018-12-24 17:11:29 +03:00
Ilmir Usmanov
0fa22c3327 Obtain correct captured suspend local function
if we call the function inside, for example, lambda.
 #KT-28844 Fixed
2018-12-24 15:58:38 +03:00
Mikhail Zarechenskiy
9ba0202d59 Prohibit JvmOverloads on constructors of annotation classes
In LV >= 1.4 & -progressive

 #KT-25702 Fixed
2018-12-24 12:51:40 +03:00
Mikhail Zarechenskiy
a967c47d1c Prohibit type parameters for local variables in LV >= 1.4 & -progressive
#KT-8341 Fixed
2018-12-24 12:51:38 +03:00
Mikhail Zarechenskiy
e8fea9d4ef Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:51:36 +03:00
Ilya Chernikov
cc5cf643a8 Implement script filename extensions discovery via artifact transforms
to avoid using never-up-to-date task and make discovery cacheable and
checkable for up-to-dateness
#KT-28469 fixed
2018-12-21 15:48:38 +01:00
Ilya Chernikov
20a631a838 Fix script filename extension discovery from asm-readed class
and improve diagnostics on definition loading failure
2018-12-21 15:48:37 +01:00
Shagen Ogandzhanian
c6e5a5d72a Support named constructors in idl-backed code generation
this resolves https://youtrack.jetbrains.com/issue/KT-27361
2018-12-21 15:31:12 +01:00
Ilya Gorbunov
a6bad98241 Fix current Kotlin version to avoid changing it in local builds
(cherry picked from commit 7c7c11e916)
2018-12-21 17:24:34 +03:00
Ilya Gorbunov
7cf16d9af6 Fix link to sealed classes doc page
#KT-28829 Fixed

(cherry picked from commit 68f898153c)
2018-12-21 17:24:33 +03:00
Ilya Gorbunov
59eeb287c9 Minor: fix Random companion reference in docs
Random's companion is named 'Default' rather than 'Companion'

(cherry picked from commit 614139755c)
2018-12-21 17:24:31 +03:00
Ilya Matveev
2e14313bc8 Fix K/N test for windows: rename target usage 2018-12-21 13:04:41 +03:00
Ilya Matveev
1872b3dd1d Fix native binary tests for Windows 2018-12-21 13:04:41 +03:00
Ilya Chernikov
4c3ac350c9 [minor] use psi original file if virtual file is not available...
for script dependencies, fixes completion tests
2018-12-20 22:06:56 +01:00
Ilya Chernikov
44f8e92c6f Introduce script names and location ids, use them in diagnostics and...
for virtual file names. Also fix compiled script serialization.
2018-12-20 22:06:55 +01:00
Ilya Chernikov
f279ae5576 [minor] add missing dependency 2018-12-20 22:06:55 +01:00
Ilya Chernikov
e4f4619f37 Implement script dependencies collection tests 2018-12-20 22:06:54 +01:00
Ilya Chernikov
bff63fe902 [minor] refactor scripting tests: extract cli testdata into separate dir, remove annotation 2018-12-20 22:06:53 +01:00
Ilya Chernikov
7b6cd7305a Refactor core env: extract script compilation dependencies collection 2018-12-20 22:06:53 +01:00
Ilya Chernikov
7640718805 [minor] fix compilation - avoid proguarding of addToStdLib.kt 2018-12-20 22:06:52 +01:00
Ilya Chernikov
8830387118 Implement import test, fix import support in compiler and evaluator 2018-12-20 22:06:51 +01:00
Ilya Chernikov
908b8a4b4e Implement imported scripts evaluation and construction 2018-12-20 22:06:51 +01:00
Ilya Chernikov
3430aa24ec Implement script import support in the compiler 2018-12-20 22:06:50 +01:00
Ilya Chernikov
f3b206227a Implement simple "add to compilation" functionality for scripts
(incomplete import - scripts added to the compilation but not yet
imported into scope)
Base functionality needed for #KT-27960
2018-12-20 22:06:49 +01:00
Toshiaki Kameyama
a1d2a5ac82 Add "Convert to also" intention
#KT-28699 Fixed

(cherry picked from commit 6a4c6eacd7)
2018-12-20 15:04:49 +03:00
Mikhail Glukhikh
fc33aa9552 OverrideMemberChooserObject refactoring: introduce MemberGenerateMode
(cherry picked from commit 93882736ed)
2018-12-20 15:04:21 +03:00
Mikhail Glukhikh
2c0ecedb5a Create expect/actual class: fix inline class generation
#KT-28744 Fixed
#KT-28745 Fixed

(cherry picked from commit ca3d758fba)
2018-12-20 15:04:07 +03:00
Mikhail Glukhikh
3ba7339a46 MPP JVM/JS wizard: fix classpath of 'run' task #KT-28869 Fixed
(cherry picked from commit d3a5b0dcd6)
2018-12-20 15:03:27 +03:00
Mikhail Glukhikh
e449f18fc0 MPP wizard tests: use 1.3.20-eap-25
(cherry picked from commit 55666f3f03)
2018-12-20 15:03:08 +03:00
Vasily Levchenko
7def3c19dc Update Kotlin/Native: RC2 1.1.0.5323 2018-12-19 12:33:59 +03:00
Vasily Levchenko
fc46a7704c Update Kotlin/Native: RC2 1.1.0.5323 2018-12-19 00:12:46 +03:00
Shagen Ogandzhanian
4d06db6852 Support ClipboardEvent in definitions generated from idl 2018-12-18 15:11:06 +01:00
Shagen Ogandzhanian
883dbfe138 Introduce TrackEvent, MediaStreamTrackEvent-related IDL definitions 2018-12-18 15:10:58 +01:00
Alexey Tsvetkov
d6f388845d Refactor: move logging code to org.jetbrains.kotlin.gradle.logging 2018-12-18 15:29:55 +03:00
Alexey Tsvetkov
2e9a596b53 Report compiler messages from daemon in Gradle thread
#KT-28836 fixed

RMI messages are reported from RMI threads.
When Gradle logger is used from non-Gradle thread,
messages are not grouped in command-line
and they are not shown in build scans.
To fix this, we store all messages from Kotlin daemon
in a buffer, then report them from a Gradle thread.
2018-12-18 15:29:55 +03:00
Alexey Tsvetkov
da86804719 Use task's logger where appropriate
KT-28836

Using project's logger prevents messages
from showing in task's output (in command-line and build scans)
2018-12-18 15:29:55 +03:00
Ilya Matveev
2bbbf9677f Add a klib export method consuming a configure action 2018-12-18 18:08:20 +07:00
Ilya Matveev
543671227d Don't create run tasks for non-host targets 2018-12-18 18:08:20 +07:00
Ilya Matveev
5b5262eedf Change executable of a run task when binary's baseName is changed 2018-12-18 18:08:20 +07:00
Ilya Matveev
42ad282dee Add tests for new binaries DSL 2018-12-18 18:08:20 +07:00
Ilya Matveev
23b0143688 Fix existing MPP tests 2018-12-18 18:08:20 +07:00
Ilya Matveev
1e782311e5 Don't hardcode a toolchain path for K/N on Windows 2018-12-18 18:08:20 +07:00
Ilya Matveev
7eae8ccc09 Fix error message about incorrect kotlin.native.home property 2018-12-18 18:08:20 +07:00
Ilya Matveev
375e46b91f Support aggregate tasks to build binaries per compilation 2018-12-18 18:08:20 +07:00
Ilya Matveev
cfdfdcb954 Support free compiler args for binaries 2018-12-18 18:08:20 +07:00
Ilya Matveev
819c6e5a51 Allow changing base name for a Kotlin/Native binary 2018-12-18 18:08:20 +07:00
Ilya Matveev
2b1d2ea2fe Support bitcode embedding for frameworks 2018-12-18 18:08:20 +07:00
Ilya Matveev
e20444e441 Support -Xexport-library for K/N in the MPP plugin 2018-12-18 18:08:20 +07:00
Ilya Matveev
c71c2fba05 Provide aggregate link tasks 2018-12-18 18:08:20 +07:00
Ilya Matveev
fb5095f94e Provide an extended DSL for final native binaries
In 1.3.0 only basic settings for final native binaries (e.g.
executables or frameworks) are available. They allow a user to
specify what kinds of binaries should be produced from one or another
compilation but they don't allow specifying different options for
different binaries or creating more than 2 (debug and release)
binaries of the same kind (e.g. executable) from the same
compilation. Also link tasks for these binaries are created after
project evaluation thus they are inaccessible for a user outside
of an afterEvaluate block.

This patch adds an extended binary DSL allowing a user to declare
binaries independently from compilations and to specify different
options (e.g. linker arguments) for different binaries. Also
link tasks for binaries declared in this DSL are created at a
configuration time so user can access them outside of an
afterEvaluate block.

Also this patch adds creating run tasks for all executables
declared in the buildscript (KT-28106)

Initial DSL methods for binaries declaration are still supported.

Kotlin DSL example is the following:

kotlin {
    macosX64 {
        binaries {
            // Create debug and release executable with
            // a name prefix 'Foo'.
            // Two domain objects will be created:
            // fooDebugExecutable and fooReleaseExecutable
            executable("Foo", listOf(RELEASE, DEBUG)) {
                compilation = compilations["foo"]
                entryPoint = "foo.main"
                linkerOpts.add("-Llib/path")
                println(runTask.name)
            }

            // Name prefix and build types are optional.
            // debugFramework and releaseFramework are created here.
            framework()
        }
    }
}
2018-12-18 18:08:20 +07:00
Mikhail Zarechenskiy
ac77446657 Fix unbound class literals for inline classes
#KT-28361 Fixed
2018-12-18 11:37:54 +03:00
Denis Zharkov
7c66d0e3a6 Minor. Add a comment to KtLightElement::givenAnnotations 2018-12-18 09:32:27 +03:00
Denis Zharkov
c7634fb41a Create annotation arguments in ultra-light classes via PsiElementFactory 2018-12-18 09:32:27 +03:00
Denis Zharkov
d634db2d82 Restrict search scope for KtUltraLightParameter
^KT-28365 Fixed
2018-12-18 09:32:27 +03:00
Denis Zharkov
43482f60ae Fix throws-list for case of kotlin.Throwable in ultra-light classes 2018-12-18 09:32:27 +03:00
Denis Zharkov
b940b64d06 Do not generate no-arg constructor for sealed ultra-light class 2018-12-18 09:32:27 +03:00
Denis Zharkov
72e42ba2cb Support annotation based on descriptor in ultra-light classes
It helps to generate properly the annotations for delegates
Also note in test, that annotations in Base class have really weird
text of arguments and also don't have names
2018-12-18 09:32:27 +03:00
Denis Zharkov
20766dce65 Minor. Introduce typeMapper val into UltraLightSupport
To avoid multiple creation
2018-12-18 09:32:27 +03:00
Sergey Igushkin
34199c5d92 Fix Gradle 5.0 deprecation warnings:
* DefaultSourceDirectorySet constructor is deprecated -> objects()
* IvyRepository.layout('pattern') { } is deprecated -> patternLayout { }

Issue #KT-26808 Fixed

(cherry picked from commit 67e82a54e5)
2018-12-17 20:07:46 +03:00
Sergey Igushkin
816976035b Fix the localToProject attribute schema for Gradle 4.10.2+
In Gradle 4.10.2, a change was made in the attributes disambiguation
process: if some of the candidates have a single attribute value and
others don't have that attribute (i.e. have a null value), the
disambiguation rule for that attribute doesn't get called.
Effectively, null values are excluded from disambiguation, but still may
cause ambiguity (sic!)

See: https://github.com/gradle/gradle/issues/6747#issuecomment-445921139

This change affected our attribute `localToProject` that we use to
disambiguate the deprecated but still consumable configurations like
`compile`, `runtime`, `testCompile`, `testRuntime` from those
configurations which should have priority during project dependency
resolution: the `*Element` ones. Our scheme marked the former
configurations with the attribute and the latter were not marked, with
a disambiguation rule that preferred null values.

To fix this logic with Gradle 4.10.2, we instead mark both kinds of
configurations with the attribute, which now has a value 'public'
that is preferred by the rule over the other values. We also make sure
that the attribute doesn't leak into the published Gradle metadata, as
it is only needed for project-to-project dependencies resolution.

Issue #KT-28795 Fixed

(cherry picked from commit 557fb07f44)
2018-12-17 20:07:46 +03:00
Sergey Igushkin
8df408122f Workaround for ConcurrentModificationException in KotlinModelBuilder
In Gradle 5.0, iterating over the `.withType<...>()` result below
caused a ConcurrentModificationException. Workaround that by first
collecting the items into a list.

(cherry picked from commit 2349aaf488)
2018-12-17 20:07:45 +03:00
Sergey Igushkin
f349b92896 Fix some tests for Gradle 5.0 and update some dependency versions
* Introduce GradleVersionRequired.InRange and thus prevent older
tests (e.g. Android 2.3.0) from running with newer Gradle versions

* Add a task outputs pattern suitable for Gradle 5.0

* Run some of the Android tests with AGP 3.1.0 (and Gradle 4.4) instead
of 3.0.0 to ensure compatibility with Gradle 5.0

* Update test projects according to Gradle 5.0 dropped deprecated
features: classesDir, left-shift operator, default org.gradle.util.*
imports

* Fix a Gradle test after Gradle 5.0 changed `publishing` behavior to
run the closure eagerly rather than after evaluation

(cherry picked from commit d7522e2283)
2018-12-17 20:07:45 +03:00
Sergey Igushkin
f221a6794b Advance test Gradle version to 5.0
(cherry picked from commit 5f21ced26b)
2018-12-17 20:07:45 +03:00
Shagen Ogandzhanian
037b7a5f5e Introduce idl definition for SVGMaskElement 2018-12-17 16:25:15 +01:00
Alexey Tsvetkov
39af8f3994 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:42 +03:00
Alexey Tsvetkov
fd192f811e Add project property to disable AP discovery in compile classpath
AP discovery in compile classpath can be disabled in all subprojects
by adding "kapt.include.compile.classpath = false" to 'gradle.properties' file.

KT-24530

The setting can be overrided per project by using KAPT DSL
in a 'build.gradle' file:
```
kapt {
    includeCompileClasspath = false
}
```
2018-12-17 15:42:22 +03:00
Mikhael Bogdanov
d83e2afcdf Use last ASM version to read binaries
#KT-28798 Fixed

(cherry picked from commit 1a0c3dfaa6)
2018-12-17 12:20:23 +01:00
Yan Zhulanow
45e5013097 Fix a compilation error after rebase 2018-12-17 18:47:13 +09:00
Alexey Tsvetkov
24aa636283 Test that javac is loaded once when worker is reused 2018-12-16 04:29:38 +03:00
Ting-Yuan Huang
2884cfc9e4 Cache classloaders for tools.jar and kapt in Gradle workers
#KT-28852 fixed

The loaders and hence some classes were repeatedly loaded and
jit-compiled everytime when KaptExecution were dispatched. Those
classes, like JavaCompiler, can be very large and therefore created a
significant overhead. In some projects, the overhead accounted for more
than 40% of total CPU time of annotation processing.

This change tries to cache the classloaders so that they won't be
reloaded and re-jitted.
2018-12-16 04:29:34 +03:00
Alexey Tsvetkov
2cc7bab0ff Run in-process compiler in separate thread
The compiler uses thread local values,
so when the compiler runs Gradle's thread,
it leaks classes preventing
a compiler's classloader from being collected.

    #KT-28037 fixed
2018-12-16 03:32:42 +03:00
Alexey Tsvetkov
f3bef7e48b Minor: remove unused util 2018-12-16 03:32:39 +03:00
Alexey Tsvetkov
7717921574 Print stacktrace to Gradle logger instead of writing directly to stderr 2018-12-16 03:32:36 +03:00
Shagen Ogandzhanian
08180d95e9 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 16:22:39 +01:00
Denis Zharkov
318f8e2891 Transform KotlinClassFinder::findKotlinClass to extension 2018-12-14 11:51:24 +03:00
Denis Zharkov
724fa51fb4 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-14 11:51:24 +03:00
Denis Zharkov
68aa525877 Minor. Reformat BinaryJavaClass 2018-12-14 11:51:24 +03:00
Denis Zharkov
51c4a10276 Convert JavaClassFinder.java to kotlin 2018-12-14 11:51:24 +03:00
Denis Zharkov
75572882a3 Convert JavaClassFinder.java to kotlin: rename file 2018-12-14 11:51:24 +03:00
Denis Zharkov
b731b02eda Minor. Reformat LazyJavaPackageScope.kt 2018-12-14 11:51:24 +03:00
Shagen Ogandzhanian
f5d28808c8 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-13 21:46:59 +01:00
Shagen Ogandzhanian
5b206eeee6 Support float initializers in fun params generated from idl definitions 2018-12-13 21:46:40 +01:00
Shagen Ogandzhanian
f29926006b Add mininal test suite to idl2k, remove deprecated ANTLRFileStream 2018-12-13 21:42:42 +01:00
Alexey Tsvetkov
9dc11b2dd7 Make AbstractJvmAbiContentTest system independent 2018-12-13 21:23:20 +03:00
Alexey Tsvetkov
4422fd220a Register classpath as inputs of SmartJavaExec tasks 2018-12-13 21:23:17 +03:00
Ilya Chernikov
0731ad4bf0 [minor] get rid of obsolete "environment" wording 2018-12-13 18:04:43 +01:00
Ilya Chernikov
7dc3797e85 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:04:42 +01:00
Ilya Chernikov
4c81b4d4a7 Add generic interfaces to dependency resolvers 2018-12-13 18:04:42 +01:00
Ilya Chernikov
2c907e800a Add script config refinement before compilation into API 2018-12-13 18:04:41 +01:00
Ilya Chernikov
fe16ac8628 Add UrlScriptSource 2018-12-13 18:04:40 +01:00
Ilya Chernikov
a11dd0a7b5 [minor] copy utility fun to reduce dependencies 2018-12-13 18:04:39 +01:00
Ilya Chernikov
3bd19503b0 Fix vararg argument mapping for generic args convertor 2018-12-13 18:04:39 +01:00
Roman Artemev
c52204359b Update changelog 1.3.20 EAP1 2018-12-13 19:41:51 +03:00
Ivan Gavrilovic
51fc596aa9 Complete Java usage tracker if analysis extension finishes (KT-27487)
In cases when kapt compiler plugin runs in stubs generation mode,
Java usage tracker was not completed. This caused issues with
the incremental compilation if Java files changed.

E.g. if a constant defined in Java source file changed, stubs
would not be recompiled because the Java usage tracker would
not report changed type. This commit fixes that issue.
2018-12-13 17:13:41 +03:00
Alexander Udalov
0cfbd1a27f Fix isInitialized for companion lateinit properties
Instead of trying to access a missing field `Foo.foo`, call the
synthetic accessor `Foo.access$getFoo$cp` which, as per previous commit,
no longer contains the lateinit assertion

 #KT-21862 Fixed

(cherry picked from commit 8c74312cf6)
2018-12-13 14:13:02 +01:00
Alexander Udalov
5da0d8f060 Move lateinit assertion for companion property to companion object
Previously, for a property named `x` in the companion object of a class
named `Foo`, we generated:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x` and lateinit
  assertion
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`

Now, we generate:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x`
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`
  and lateinit assertion

The reason is that this way we can avoid generating another accessor and
reuse `Foo.access$getX$cp` in case `isInitialized` is called on a
lateinit property from companion.

For private properties, getX is not generated, but instead the assertion
is generated on each access to the field (which can be improved, see
KT-28331). The same happens for access to non-private properties from
inside the same context where they're declared.

 #KT-21862 In Progress

(cherry picked from commit 43413fcc44)
2018-12-13 14:13:00 +01:00
Alexander Udalov
d0969e77dd Minor, reformat & fix warnings in intermediateValueForProperty
(cherry picked from commit 8617365983)
2018-12-13 14:12:59 +01:00
Mikhail Glukhikh
b4101ef2ae Add "Ambiguous context due to scope receiver in suspend fun" inspection
#KT-28696 Fixed

(cherry picked from commit a15b47c93c)
2018-12-12 18:22:53 +03:00
Mikhail Glukhikh
edd4f283c6 Refactor "change type to mutable" in suspicious collection reassignment
Related to KT-20626

(cherry picked from commit 42fa6ce6f0)
2018-12-12 18:22:40 +03:00
Mikhail Glukhikh
7d07329292 Change description of boolean argument/augmented assignment inspections
(cherry picked from commit b17ee60c6f)
2018-12-12 18:22:26 +03:00
Mikhail Glukhikh
1eadec5432 Boolean literal arguments: check previous arg, fix all args in a row
(cherry picked from commit 13b09f532c)
2018-12-12 18:22:11 +03:00
Mikhail Glukhikh
0a33859eb2 Boolean literal arguments: do not highlight with single boolean argument
(cherry picked from commit 235b50d86e)
2018-12-12 18:21:59 +03:00
Mikhail Glukhikh
9a0f3f9e57 Boolean literal arguments: don't report on a call, just on an element
(cherry picked from commit d31e0b9632)
2018-12-12 18:21:44 +03:00
Toshiaki Kameyama
2a7bb8d13e Introduce "Boolean literal arguments" inspection #KT-2029 Fixed
(cherry picked from commit 0d7116aa5d)
2018-12-12 18:21:25 +03:00
Mikhail Glukhikh
fc9b41a05c Augmented list assignment inspection: add "replace with ordinary" fix
Relates to KT-20626

(cherry picked from commit aa9e48b9b6)
2018-12-12 18:21:11 +03:00
Mikhail Glukhikh
ac16907f1c Don't highlight "replace with +=" for read-only collections
Related to KT-20626

(cherry picked from commit ed8305995e)
2018-12-12 18:20:58 +03:00
Mikhail Glukhikh
c24bbff948 Add "Suspicious collection reassignment" inspection #KT-20626 Fixed
(cherry picked from commit c560aada3d)
2018-12-12 18:20:44 +03:00
Mikhail Glukhikh
410123d0f7 Introduce KtReferenceSearch to use LocalSearchScope, when possible
This fixes a set of problems in J2K tests in 183
#KT-28368 Fixed

(cherry picked from commit 3e936f64bf)
2018-12-12 18:20:28 +03:00
Leonid Startsev
04cb2265d8 Declare real external symbols for overriden by synthetic function
instead of unbound

Unbound symbols were throwing an exception on attempt to analyze them
in the other parts of compiler and are generally incorrect

(cherry picked from commit fdf4f02dde)
2018-12-12 17:31:54 +03:00
Yan Zhulanow
d5e1fc24e0 Evaluator: Render inline class values using its toString() implementation (KT-27414) 2018-12-12 21:42:21 +09:00
Yan Zhulanow
7725f0d1d7 Kapt: Switch to more appropriate way of converting URIs to Files 2018-12-12 21:42:20 +09:00
Yan Zhulanow
6e3494d83c Fix Android Lint tests (182 bunch only) 2018-12-12 21:42:19 +09:00
Yan Zhulanow
3cfee99ac6 Remove Lint tests for annotation argument API check.
Looks like newer Lint API checker ignores type usage in annotations, so these tests are no more needed.
2018-12-12 21:42:18 +09:00
Yan Zhulanow
68cd113d83 Fix testSimple() for "Remove Parcelable" action 2018-12-12 21:42:17 +09:00
Yan Zhulanow
8de34046a8 AllOpen: Update test data (enum constructors are now private) 2018-12-12 21:42:16 +09:00
Yan Zhulanow
a2be50a223 Update debugger test data, fix the current behavior 2018-12-12 21:42:15 +09:00
Yan Zhulanow
700a7c68eb Remove a magic constant from 'KotlinLambdaMethodFilter' 2018-12-12 21:42:14 +09:00
Yan Zhulanow
d7d066d081 Revert "Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282)"
This reverts commit 6c868701
2018-12-12 21:42:13 +09:00
Yan Zhulanow
a30b4af7a4 Uast: Update test data (enum constructors are now private) 2018-12-12 21:42:12 +09:00
Yan Zhulanow
55097c09a0 NoArg: Update test data (enum constructors are now private) 2018-12-12 21:42:11 +09:00
Yan Zhulanow
09c97d7a18 Kapt: Update test data (stub converter tests) 2018-12-12 21:42:10 +09:00
Yan Zhulanow
9ac928aa1b Add missing 'disallowRootAccess()' to debugger and stub tests 2018-12-12 21:42:09 +09:00
Yan Zhulanow
5322dbe3fe Fix backend tests after changing format of synthetic variables for inline functions 2018-12-12 21:42:09 +09:00
Yan Zhulanow
3927e7615a Fix quick evaluation for array expressions (KT-13268) 2018-12-12 21:42:08 +09:00
Yan Zhulanow
3a3bd4826f Fix breakpoints for the same inline function nested calls (KT-22366)
This commit changes the format of the synthetic local variables for inline functions.
2018-12-12 21:42:07 +09:00
Yan Zhulanow
148ac0471d Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282) 2018-12-12 21:42:06 +09:00
Yan Zhulanow
2eba1714bc Fix evaluation for captured inline classes (KT-28487) 2018-12-12 21:42:05 +09:00
Yan Zhulanow
758db84e53 Fix evaluation for static interface methods declared in Java (KT-23585) 2018-12-12 21:42:04 +09:00
Yan Zhulanow
75f8025d6a Fix source mapping for stepping into package facades from libraries (KT-28028) 2018-12-12 21:42:03 +09:00
Yan Zhulanow
e41d8ca122 Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:42:02 +09:00
Yan Zhulanow
d0b71643b7 Evaluate: Enable 'foo_field' convention only for Jvm/Common code 2018-12-12 21:42:01 +09:00
Yan Zhulanow
80d1c9a7de Refactoring: Replace 'ParametersDescriptor' with a simple 'List' 2018-12-12 21:42:00 +09:00
Yan Zhulanow
4b060b68fe Evaluate: Support synthetic 'field' variable evaluation (KT-28342) 2018-12-12 21:41:59 +09:00
Yan Zhulanow
2d10730233 Minor: Move changeSuperToMagicAccessor() function to its single use site, J2K it 2018-12-12 21:41:58 +09:00
Yan Zhulanow
53a2fb7302 Kapt: Preserve 'getJarPathForClass()' (used in kapt-cli) 2018-12-12 21:41:57 +09:00
Yan Zhulanow
09d0cba192 Evaluate: Use '<name>_field' syntax for field value evaluation (KT-14075) 2018-12-12 21:41:56 +09:00
Yan Zhulanow
a5b19826e7 Provide a default implementation for 'SyntheticScope' 2018-12-12 21:41:55 +09:00
Denis Zharkov
863be9369a Add diagnostic for calling ConcurrentHashMap::contains by convention
^KT-18053 Fixed
2018-12-12 15:38:42 +03:00
Mikhail Glukhikh
92e125413d Do not modify highlighting settings for non-Kotlin files #KT-28716 Fixed
(cherry picked from commit 3889bb05d6)
2018-12-12 14:24:07 +03:00
Alexey Tsvetkov
6aebc695ec Minor: replace UsefulTestCase with KtUsefulTestCase
For some reason assertSameLinesWithFile from UsefulTestCase
fails with exception on TeamCity, whereas the one KtUsefulTestCase
does not
2018-12-12 12:01:45 +03:00
Alexey Tsvetkov
1bb75ac2ec Exclude InsnList from proguard
It is used by jvm-abi-gen plugin
2018-12-12 12:01:43 +03:00
Roman
1e2115ba83 Merge pull request #2024 from JetBrains/rr/gradle/native-update-1.1.0-rc1-5227
Update Kotlin/Native: RC1 1.1.0.5227
2018-12-12 08:04:57 +03:00
Alexey Tsvetkov
34dd6062fd Exclude local variables and try catch blocks of non-inline functions from ABI 2018-12-11 22:51:51 +03:00
Alexey Tsvetkov
e7cea0239a Check descriptor visibility before excluding method from ABI class 2018-12-11 22:51:48 +03:00
Alexey Tsvetkov
962a52ef0d Minor: rename const according to style guide 2018-12-11 22:51:44 +03:00
Alexey Tsvetkov
6a50cd8a11 Attempt to fix ABI tests on TC
Locally they work fine
2018-12-11 22:51:40 +03:00
Alexey Tsvetkov
b96d77db63 Disable removing private/synthetic/local classes temporarily 2018-12-11 22:51:36 +03:00
Alexey Tsvetkov
fe9287a20e Report output classes 2018-12-11 22:51:33 +03:00
Alexey Tsvetkov
d30eb186fd Reuse BytecodeListingTextCollectingVisitor in tests 2018-12-11 22:51:29 +03:00
Alexey Tsvetkov
b8c0d0f589 Reuse TransformationMethodVisitor in ABI gen plugin 2018-12-11 22:51:25 +03:00
Alexey Tsvetkov
e6b1e1df3a Convert TransformationMethodVisitor: step 2 2018-12-11 22:51:22 +03:00
Alexey Tsvetkov
f7d4aae815 Convert TransformationMethodVisitor: step 1 2018-12-11 22:51:18 +03:00
Alexey Tsvetkov
da5bfd6bea Minor fixes after review 2018-12-11 22:51:12 +03:00
Alexey Tsvetkov
d0c59dc73f Exclude nested classes of private classes from ABI classes 2018-12-11 22:51:07 +03:00
Alexey Tsvetkov
79b9f2fdf2 Report locations of errors in ABI classes tests 2018-12-11 22:51:03 +03:00
Alexey Tsvetkov
1207568c60 Add tests for compilation against abi classes 2018-12-11 22:51:00 +03:00
Alexey Tsvetkov
0bcec43b9a Add tests for non-compatible ABI changes 2018-12-11 22:50:56 +03:00
Alexey Tsvetkov
0c5ccbe6eb Exclude clinit from ABI classes 2018-12-11 22:50:52 +03:00
Alexey Tsvetkov
d3d027bc2d Exclude synthetic classes from ABI classes 2018-12-11 22:50:48 +03:00
Alexey Tsvetkov
278afe0691 Minor: extract function 2018-12-11 22:50:44 +03:00
Alexey Tsvetkov
6854ed319b Delay I/O when transforming ABI classes 2018-12-11 22:50:41 +03:00
Alexey Tsvetkov
07d3842de8 Remove unused cosntant pool entries from ABI classes 2018-12-11 22:50:37 +03:00
Alexey Tsvetkov
c66ce278e2 Exclude private typealiases from ABI classes 2018-12-11 22:50:33 +03:00
Alexey Tsvetkov
9a76ea227d Exclude local and private classes from ABI classes 2018-12-11 22:50:29 +03:00
Alexey Tsvetkov
ecbe37085b Exclude non-inline method bodies from ABI classes 2018-12-11 22:50:25 +03:00
Alexey Tsvetkov
5dc88796d9 Exclude private members from ABI classes 2018-12-11 22:50:22 +03:00
Alexey Tsvetkov
bf3debdfb2 Add plugin for JVM ABI classes generation
#KT-25128 Fixed

ABI class generation is implemented as a compiler plugin.
Command-line usage:
1. Add a path to 'jvm-abi-gen.jar' to the plguin classpath argument
(`-Xplugin`). By default the jar is located at
'kotlinc/lib/jvm-abi-gen.jar' in the kotlinc distribution archive.
2. Specify an output directory for ABI classes via
`-Pplugin:org.jetbrains.kotlin.jvm.abi:outputDir=<DIR>`.
2018-12-11 22:50:18 +03:00
Toshiaki Kameyama
9bb9bdd0a5 Assign backing field: don't add empty line
#KT-28694 Fixed

(cherry picked from commit 07ffac72cf)
2018-12-11 22:20:58 +03:00
Mikhail Glukhikh
5bf88069db For each parameter not used: handle char sequences correctly
An enhancement for KT-27209

(cherry picked from commit b143a1c8f7)
2018-12-11 22:20:25 +03:00
Mikhail Glukhikh
f874b8aebd Disable extract actions on non-JVM classes #KT-28476 Fixed
(cherry picked from commit 833f564f0e)
2018-12-11 22:20:08 +03:00
Mikhail Glukhikh
2873aaf4e2 For each parameter not used: introduce "replace with repeat"
An enhancement for KT-27209

(cherry picked from commit 11909a86a8)
2018-12-11 22:19:52 +03:00
Mikhail Glukhikh
daab8d4e14 For each parameter not used: cleanup
(cherry picked from commit e06c995516)
2018-12-11 22:19:34 +03:00
Mikhail Glukhikh
df648dbb06 Redundant arrow: don't report on forEach call with underscore
#KT-27209 Fixed

(cherry picked from commit 9aa1d1495b)
2018-12-11 22:19:17 +03:00
Mikhail Glukhikh
c4d52e0a80 Redundant arrow: support removing of 'it ->' #KT-28631 Fixed
(cherry picked from commit c8c485d27e)
2018-12-11 22:18:31 +03:00
Ilya Chernikov
6988ab0a4f Fix locking in script definition provider
fixes possible parallel modifications on definitions loading, e.g.
as in https://github.com/shyiko/ktlint/issues/287
2018-12-11 15:24:22 +01:00
Denis Zharkov
630502e17d Unwrap InvocationTargetException in dependency injection
^KT-28348 Fixed
2018-12-11 16:14:17 +03:00
Denis Zharkov
0cc6ece8dc Optimize searching constructor delegation calls
^KT-28755 Fixed
2018-12-11 16:14:17 +03:00
Denis Zharkov
b6dcebb08e Minor. Reformat usagesSearch/utils.kt 2018-12-11 16:14:17 +03:00
Alexey Tsvetkov
196193c238 Deprecate AP discovery in compile configurations in Gradle
#KT-24368 Fixed
2018-12-11 16:10:54 +03:00
Alexey Tsvetkov
e04c080e89 Add option to disable AP discovery in compile classpath
#KT-24530 Fixed

To disable discovery and enable avoidance for kapt tasks,
use "kapt.includeCompileClasspath = false"
2018-12-11 16:10:51 +03:00
Vasily Levchenko
b8f92714ac Update Kotlin/Native: RC1 1.1.0.5227 2018-12-11 15:33:42 +03:00
Simon Ogorodnik
ac052ce52a Support overriding module/library/sdk for particular light PsiClass
To support light R classes
2018-12-11 15:01:54 +03:00
Denis Zharkov
83934bfd14 Temporary remove some tests after a fix for KT-24937
Otherwise, our project is failed to be indexed
2018-12-11 12:03:52 +03:00
Denis Zharkov
7214d36a49 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 12:03:44 +03:00
Yan Zhulanow
43eb3e4042 ServiceLoaderLite: Support paths with spaces (KT-28527) 2018-12-11 17:46:51 +09:00
Dmitry Petrov
6b6c3e7ff3 KT-28585 Fix boxing for values of captured vars of inline class type 2018-12-10 15:08:55 +03:00
Dmitry Petrov
3ab2da1226 KT-28405 Fix toString for inline classes with underlying arrays 2018-12-10 15:08:48 +03:00
Dmitry Savvinov
d51be4cd77 Fix missed returned expression if the last expression was condition jump
See ticket comments for the detailed description

^KT-28061 Fixed
2018-12-10 13:45:20 +03:00
Dmitry Savvinov
68889d839d Add test on in-place lambda with return + safecall
Currently, diagnostics behavior is undesired. The next commit fixes it

^KT-28061 In Progress
2018-12-10 13:45:15 +03:00
Mikhail Glukhikh
79537a5fdb Fix check in isSameRootType. May fix KT-28626. Related to KT-27718 2018-12-07 18:57:09 +03:00
victor.petukhov
6c4f255393 Actualize PSI spec tests after fix KT-27762 2018-12-07 18:35:43 +03:00
victor.petukhov
60def724be Fix invalid package pattern in spec tests parser 2018-12-07 18:35:43 +03:00
victor.petukhov
b9d1825765 Implement tests exceptions fixation mechanism 2018-12-07 18:35:43 +03:00
Nikolay Krasko
8da9bdf928 Relax package convention name inspection for Kotlin project 2018-12-07 18:32:10 +03:00
Nikolay Krasko
2373c9d838 Allow underscore in packages and forbid uppercase letters (KT-27900) 2018-12-07 18:32:09 +03:00
Nikolay Krasko
e0d3abc819 Do not indent and align initializer list in enums (KT-28070)
#KT-28070 Fixed
2018-12-07 18:32:07 +03:00
Nikolay Krasko
bbf05eaaba Fix test compilation because of using HierarchyViewTestFixture in <= 181 2018-12-07 18:24:41 +03:00
Shagen Ogandzhanian
1f0bca12e1 Leave undefined values for undefined params in idl-generated code unassigned
https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2535
2018-12-07 16:05:00 +01:00
Roman Artemev
1ad2434fa0 Add changelog for 1.3.11 2018-12-07 17:58:20 +03:00
Roman Artemev
4e05be9a96 Update tests 2018-12-07 17:58:20 +03:00
Roman Artemev
eff81525d3 Make IrField be IrDeclarationParent
* fix parent in TypeOperatorLowering
2018-12-07 17:58:20 +03:00
Roman Artemev
ce70e5850f [JS IR BE] New Inliner from native 2018-12-07 17:58:20 +03:00
Ilya Gorbunov
7b08f6f8f1 readLine: extend buffer to decode surrogate pairs from utf-8 correctly
CharBuffer had capacity to hold 2 chars, which was not enough to append
a surrogate pair when the buffer was not empty.

The buffer was extended and the decoding algorithm rewritten to deal with
a buffer of any length.

#KT-28572 Fixed
2018-12-07 17:42:09 +03:00
Nikita Katkov
297054037c Dispatchers IO is now considered non-blocking context
See BlockingMethodInNonBlockingContextInspection
2018-12-07 15:19:12 +03:00
Mikhail Glukhikh
3b33d3e58d MPP wizard: drop some target names to use defaults instead 2018-12-07 13:18:56 +03:00
Mikhail Glukhikh
8e81d9a44f Migrate mobile (shared) / native / shared library MPP wizards to new DSL
#KT-28458 Fixed
2018-12-07 12:48:31 +03:00
Mikhail Glukhikh
9a0facf56a Upgrade MPP wizard tests to use kotlin 1.3.20-dev with new MPP DSL 2018-12-07 12:46:14 +03:00
Dmitry Petrov
0561cb6c0d Fix KT-24804 PSI2IR Crashes on loop with two labels 2018-12-07 10:51:55 +03:00
Dmitry Petrov
6f97db81c8 Update testData after IR type rendering changes 2018-12-07 10:51:55 +03:00
Dmitry Petrov
f8582c1929 psi2ir: ersatz type approximation for intersection types
Emulate old JVM back-end behavior for intersection type mapping.

IrType renderer should render the IR type, not the original Kotlin type.
2018-12-07 10:51:55 +03:00
Natalia Selezneva
0e4908087c Fix NoReadAccessException running scratch file in Android Studio
KtScratchSourceFileProcessor accesses PsiElement.getText
2018-12-07 10:25:09 +03:00
Natalia Selezneva
62584f2483 Fix IndexNotReadyException during runnning scratch file in Android Studio 2018-12-07 10:25:06 +03:00
Natalia Selezneva
84aef9cf2d Minor: remove unnecessary parameter 2018-12-07 10:25:04 +03:00
Natalia Selezneva
b8007f1ee9 Scratch: filter out fake gradle modules from combobox
^KT-23523 Fixed
2018-12-07 10:25:01 +03:00
Natalia Selezneva
4a2e8849b9 Tests: allow file access to KotlinTestUtils.getHomeDirectory() in AbstractConfigureKotlinTest
This test configure kotlin standard library, so it should have access to .jar files from project dist directory
2018-12-07 10:22:59 +03:00
Andrey Uskov
abadfbb632 Fix dependencies after removal of build scripts bunches 2018-12-06 22:58:39 +03:00
Andrey Uskov
235b6ca6cd Fix stacktrace check for KT-27718. This work-around should be removed after fix of IDEA-203651
#KT-27718 Fixed
2018-12-06 20:23:05 +03:00
Vyacheslav Gerasimov
d84c5b1608 Switch to 183 platform 2018-12-06 20:16:58 +03:00
Toshiaki Kameyama
5aa0b7d2aa Extend Selection: whole literal with braces is selected after parameters (KT-13420)
#KT-13420 Fixed
2018-12-06 19:48:04 +03:00
Nikolay Krasko
05269cea2f Reformat in idea.editor package 2018-12-06 19:48:03 +03:00
Andrey Uskov
c85f56a0a8 Remove some bunches for build scripts. 2018-12-06 19:44:09 +03:00
Denis Zharkov
d8ebb70151 Advance enum entries in smart completion list
^KT-22579 Fixed
2018-12-06 17:38:31 +03:00
Denis Zharkov
d2d81d6ddc Minor. Reformat StaticMembers.kt 2018-12-06 17:38:31 +03:00
Ilmir Usmanov
1336e8f3e3 Take java 9 modules into account in coroutines debug metadata
reading
 #KT-28237
2018-12-06 16:59:15 +03:00
Ilmir Usmanov
bdd1eef39a Use class name instead internal name in coroutines debug metadata
I.e. instead of slashes use dots in fqnames.

 #KT-28237 Fixed
2018-12-06 16:59:12 +03:00
Ilmir Usmanov
5483ce0933 Do not map this when remapping parameters of static function inside
inline lambda.

 #KT-23543 Fixed
2018-12-06 15:46:22 +03:00
Mikhail Glukhikh
de33905c44 Fix formatting in "simplify call chain" #KT-28576 Fixed 2018-12-06 15:37:47 +03:00
Mikhail Glukhikh
a3909d8e47 Refactor code in "simplify call chain" (relates to KT-28576) 2018-12-06 15:37:47 +03:00
Dmitriy Dolovov
33d89005b7 K/N fix: Built-ins initialization refactoring
- Use language settings from IDELanguageSettingsProvider
- Don't use dependencies of root modules to looks up for K/N stdlib
2018-12-06 19:05:17 +07:00
Dmitriy Dolovov
0a55c586d2 K/N fix: Use BindingTrace that allows overwriting slices
Issue #KT-21791
2018-12-06 19:05:11 +07:00
Dmitriy Dolovov
d4df5e132e CLion: Hide JVM- and JS-specifics in Preferences
Issue #KT-28465:fixed
2018-12-06 19:03:43 +07:00
Andrey Uskov
273dbc823e Fix "Kotlin not configured" issue in common MPP tests.
#KT-27718 Fixed
2018-12-06 14:50:26 +03:00
Andrey Uskov
5a8621d7c7 Fix build of bunch 191 2018-12-06 14:50:05 +03:00
Mikhail Glukhikh
25f393d299 MPP JVM/JS wizard: add head & title to HTML #KT-27491 Fixed 2018-12-06 13:09:23 +03:00
Mikhail Glukhikh
6d72032b82 MPP JVM/JS wizard: upgrade Ktor to 1.0.1 (part of KT-27491) 2018-12-06 13:09:22 +03:00
Dmitriy Dolovov
782f221a9c CLion: New version 2018.3.1 (183.4588.63) 2018-12-06 16:44:50 +07:00
Roman Elizarov
75e2dfda19 Added COROUTINE_SUSPENDED docs
Fixes KT-28488
2018-12-06 11:00:32 +03:00
Natalia Selezneva
6291cfee49 Fix 'read action required' exception in scratch 2018-12-06 09:33:34 +03:00
Natalia Selezneva
9e2ff04e1b Fix build module in AndroidStudio for REPL and Scratch
^KT-23560 Fixed
2018-12-06 09:33:33 +03:00
Natalia Selezneva
ee5ede08c1 Tests: do not use hardcoded stdlib jar name 2018-12-06 09:33:32 +03:00
Natalia Selezneva
7b6508a8f9 Tests: refresh file system looking for recently copied file 2018-12-06 09:33:32 +03:00
Natalia Selezneva
6d41834282 Allow file access to KotlinTestUtils.getHomeDirectory() in IdeaModuleInfoTest 2018-12-06 09:33:31 +03:00
Natalia Selezneva
f3328b119c Fix missing changes in bunch files in ConfigureKotlinTest 2018-12-06 09:33:30 +03:00
Natalia Selezneva
d25c4a8d3e Rewrite ConfigureKotlinTest.testJsLibraryWrongKind
After the fix of KT-20511 we now detect library kind from it's jars, so even if LibraryKind is not set, it's effective kind is JSLibraryKind for this test
2018-12-06 09:33:30 +03:00
Natalia Selezneva
7d66e3f6f2 Fix AbstractExtractionTest for scripts
It fails with 'Descriptor wasn't found for declaration SCRIPT' because PsiElement was invalidated during test because of restaring highlighting in case of new script dependencies
2018-12-06 09:33:29 +03:00
Toshiaki Kameyama
9ee9965c7a Convrt anonymous function to lambda: fix incorrectly conversion
#KT-28618
2018-12-06 09:28:56 +03:00
Toshiaki Kameyama
f6323cdee4 Replace assert boolean with assert equality: add import statement
#KT-28540 Fixed
2018-12-06 09:27:35 +03:00
Dave Leeds
6ff3ae3447 KT-20357: Add samples for commonPrefixWith and commonSuffixWith 2018-12-05 19:21:57 +03:00
Ilya Chernikov
6e27bc0fb3 Fix scratch testdata after introducing result vals into repl 2018-12-05 16:02:31 +01:00
Ilya Chernikov
8e72495ded Add repl line result tests, refactor repl tests 2018-12-05 16:02:30 +01:00
vitaly.khudobakhshov
396ba6cdd5 Display function value properly 2018-12-05 16:02:29 +01:00
vitaly.khudobakhshov
c901d6cebc Implement support for "resX" result fields in REPL 2018-12-05 16:01:32 +01:00
Nikolay Krasko
79e577ae27 Remove unused deprecated configureAs methods 2018-12-05 17:46:31 +03:00
Nikolay Krasko
9cc88c13f5 Rewrite KotlinHierarchyViewTestBase with light fixture tests 2018-12-05 17:46:30 +03:00
Nikolay Krasko
5055308064 Rewrite AbstractNavigateToLibraryTest with light fixture tests 2018-12-05 17:46:28 +03:00
Nikolay Krasko
8a63a1655f Rewrite NavigateToStdlibSourceTest with project descriptors 2018-12-05 17:46:26 +03:00
Vyacheslav Gerasimov
96282b3c52 Update 183 platform to 183.4588.61 (2018.3.1) 2018-12-05 16:44:09 +03:00
Denis Zharkov
e88ed25f26 Support targeted annotations on property accesors in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
52d5143dd7 Support delegating to interfaces in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
dbf9ff29a9 Support data classes in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
8b65311769 Minor. Extract KtUltraLightMethodForSourceDeclaration 2018-12-05 16:34:44 +03:00
Denis Zharkov
b73760c3fc Get rid of redundant method KtUltraLightParameter::annotatedOrigin 2018-12-05 16:34:44 +03:00
Denis Zharkov
bbaa4c225d Introduce subclasses for KtUltraLightParameter
Mostly, it's needed for clarity and to simplify
what exactly `kotlinOrigin` means in each case:
- Note, that annotatedOrigin() is always kotlinOrigin
- We don't need to store another field for receiver
- Now, kotlinOrigin is consistent with KtLightParameter::kotlinOrigin
2018-12-05 16:34:44 +03:00
Denis Zharkov
ad2f02b12e Minor. Get rid of redundant is check and unused method
Now, nullability for ultra-light elements is processed via KtUltraLightNullabilityAnnotation
2018-12-05 16:34:44 +03:00
Denis Zharkov
28d3a62567 Separate nullability annotation processing for ultra-light classes
KtLightNullabilityAnnotation is specifically designed for old light classes
and includes a bunch of hacks that are applicable for them

So, we have to introduce own hack into it
(see org.jetbrains.kotlin.asJava.classes.KtUltraLightParameter#getTypeForNullability)
that is a bit of hard to support when extending hierarchy
2018-12-05 16:34:44 +03:00
Denis Zharkov
30c60c7b1f Do not render nullability in UltraLightChecker when it's irrelevant
It's necessary because after next changes,
they become different for ultra and old light classes.
The former (ultra) is more correct but it doesn't help when
we need to compare our implementation with reference
2018-12-05 16:34:44 +03:00
Denis Zharkov
d7d0407afb Fix parameters nullability for generated overloads in light classes
When making KtLightNullabilityAnnotation after test org.jetbrains.kotlin.idea.caches.resolve.IdeLightClassTestGenerated.NullabilityAnnotations#testJvmOverloads
started failing the wrong assumption was made that for
@JvmOverloads-generated overloads their last parameter is always nullable
(see removed isNullableInJvmOverloads function) and that lead to a bug,
namely KT-28556.

The actual problem of this test started failing was incorrect definition
of kotlinOrigin in KtLightParameter for case of JvmOverloads:
wrong KtParameter was being chosen before

This commit fixes the issue by propagating how actually generated
parameters in codegen relate to source KtParameters'

^KT-28556 Fixed
2018-12-05 16:34:44 +03:00
Denis Zharkov
ac19cc9376 Extract kotlinType property in KtUltraLightField
It's gonna be used in the later commits

Also simplify a bit related code in `_type` initializer:
it seems safe just to map `kotlinType` as is for all non-trivial cases,
also note that all of them are actually generated without generic signature
2018-12-05 16:34:44 +03:00
Denis Zharkov
efc39c6137 Minor. Reformat KtLightModifierList.kt and make function private 2018-12-05 16:34:44 +03:00
Vyacheslav Gerasimov
508fe28781 Build: Add NoDebugJavaExec to filter out debugger arguments added by Idea
Workaround for IDEA-200192:
IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
2018-12-05 16:23:25 +03:00
Leonid Startsev
f2e27da5bb Support @SerialInfo annotation for Native 2018-12-05 15:16:17 +03:00
Leonid Startsev
13af036024 Fix problem with encodeUnitElement : Unit instance is not needed in Native IR 2018-12-05 15:16:16 +03:00
Leonid Startsev
b775501042 Translate KClass references to built-in types in serialization plugin correctly.
Add overload with ClassDescriptor to `getPrimitiveClass` translation function and increase it visibility to public to be usable from plugin.
2018-12-05 15:16:15 +03:00
Leonid Startsev
5f2cea917f Remove redundant check for 'all parameters are properties' in a case of fully-customized serializer 2018-12-05 15:16:15 +03:00
Leonid Startsev
7e32e2e9b9 Increase priority of @ContextualSerialization annotation on types 2018-12-05 15:16:14 +03:00
Leonid Startsev
f13f54d5ad Fix "kotlin.UninitializedPropertyAccessException: lateinit property typeTranslator has not been initialized" in Native IR serialization plugin 2018-12-05 15:16:13 +03:00
Leonid Startsev
7c8b34fe1c Fix unresolved symbol to SerialDescriptor in KSerializer if it was
referenced from user custom serializer code (kotlinx.serialization/290)
2018-12-05 15:16:12 +03:00
Leonid Startsev
58c145210c Support for @UseSerializers annotation 2018-12-05 15:16:11 +03:00
Dmitry Savvinov
f174ee863d Don't run ExpectedActualDeclarationChecker on property accessors
One might think that it shouldn't be run because of 'if (declaration
!is KtNamedDeclaration) return' check in the 'check'-overload.

However, for default accessors we pass PSI for property, i.e.
KtProperty (see 'DeclarationCheckers.checkAccessors'), which
obviously passes this check

Note that we can't use `DescriptorToSourceUtils` here, because it's
returns `KtProperty` for default accessor too.

This commits adds specific check for that case, to avoid exception in
KT-28385. Ideal solution would be to either don't launch checkers on
such parameters, or explicitly declare semantic of the
'declaration'-parameter, e.g. to rename it to 'reportOn' (see KT-28403
for discussion)

^KT-28385 Fixed
2018-12-05 11:50:35 +03:00
Dmitry Savvinov
415fcf70e9 Add test on incomplete code in MPP
Currently, the behavior is undesired. See the next commit for the fix

^KT-28385 In Progress
2018-12-05 11:50:35 +03:00
Georgy Bronnikov
a35f368ce0 Switch off logging for failing IrBlackBox tests
Logging of tests that are expected to fail is controlled by
kotlin.suppress.expected.test.failures project property.
2018-12-05 01:48:43 +03:00
Shagen Ogandzhanian
b154d10cc5 Merge pull request #2013 from JetBrains/KT-16305-MUTATION_OBSERVER_INIT
Skip assignment for null-value ArrayLike object in idl-based generate…
2018-12-04 20:33:24 +01:00
Roman Artemev
30cc5f6d3c Support Ir Validation in phaser 2018-12-04 19:45:15 +03:00
Roman Artemev
de1cbc396e Implement JS IR Phaser 2018-12-04 19:45:15 +03:00
Roman Artemev
2d9d9484b3 Refactored Common & JVM IR Phaser 2018-12-04 19:45:15 +03:00
Cuihtlauac ALVARADO
094dc2ae45 Remove useless parameter
Private function convertToOverloadResults() has two call sites, both:

* inside member functions of the NewResolutionOldInference class
* passing NewResolutionOldInference.languageVersionSettings

Therefore, it is safe to remove this parameter from the signature of
convertToOverloadResults(). The occurence of languageVerstionSetting
in it's return statement will refer (implicitly) to the definition from
its class.
2018-12-04 19:07:27 +03:00
Cuihtlauac ALVARADO
ece745966b Remove CandidateWithBoundDispatchReceiverImpl
Interface CandidateWithBoundDispatchReceiver had a unique
implementation, which was private.

Turned interface CandidateWithBoundDispatchReceiver into a
class. Removed CandidateWithBoundDispatchReceiverImpl. Removed
string "Impl" suffix at constructor call sites.
2018-12-04 19:01:48 +03:00
Vyacheslav Gerasimov
2791a679aa Minor: add TaskAction & Option to Unused symbol inspection exclusions 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
17a60e3fd3 Build: use UtilityJavaExec task for compileJs and generateVisitors 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
da46164896 Build: use UtilityJavaExec task to serialize builtins 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
35c2de08b0 Build: Add UtilityJavaExec task needed to avoid JavaExec tasks
This task does the same as original JavaExec task
We avoid using JavaExec tasks due to IDEA-200192: IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution.
2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
99c149bb8b Build: Update url for android build tools 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
a112bebf78 Build: Configure cache-redirector in allprojects block 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
3ee8cae48d Build: Update cache redirector url list 2018-12-04 15:38:56 +03:00
Simon Ogorodnik
2556d64459 Provide findModuleDescriptor for ResolutionFacadeWithDebugInfo
Fixes Move refactoring tests
Broken after introduction of ResolutionFacadeWithDebugInfo
2018-12-04 15:13:40 +03:00
Shagen Ogandzhanian
8294309e5b Skip assignment for null-value ArrayLike object in idl-based generated code 2018-12-04 12:44:43 +01:00
Dmitry Zhuravlev
ab259c2d6f Consider Kobalt libraries as external for Kotlin 2018-12-04 13:51:23 +03:00
Toshiaki Kameyama
7bf51f1533 Expand selection for class members #KT-28289 Fixed 2018-12-04 11:17:27 +03:00
Ilya Gorbunov
736818dfa7 Use Before/AfterMethod from TestNG as kotlin.test.Before/AfterTest
According to their documentation they should be invoked before and after
each test method runs.

#KT-27629 Fixed
2018-12-03 21:46:26 +03:00
Ilya Gorbunov
48c80e247e Move kotlin.test common annotations tests
Place them in tests of kotlin-test-annotations-common, so that every
platform module that implements that common module (e.g. kotlin-test-junit,
kotlin-test-junit5, kotlin-test-testng) gets these tests run.

Improve test for BeforeTest/AfterTest annotations to check that they are
invoked before/after _each_ test method.

#KT-27629
2018-12-03 21:46:26 +03:00
Ilmir Usmanov
4a828f839f Support recursive local suspend functions
Previously they were trying to call constructor (incorrectly) for
recursive calls. This is redundant, since this.invoke creates one
automatically.

In addition, support callable references to recursive local suspend
functions.

 #KT-24780 Fixed
2018-12-03 18:49:23 +03:00
Svyatoslav Kuzmich
8359887696 [JS IR BE] Fix inline classes workarounds
- Remove uninitialized return type check
- Remove unbound classifier symbol check
2018-12-03 13:07:41 +03:00
Mikhail Glukhikh
7cbc8e8b76 Introduce "Redundant else in if" inspection #KT-19668 Fixed 2018-12-03 09:39:22 +03:00
Mikhail Glukhikh
ca87e53f04 Introduce DeferredIsResultInspection #KT-25620 Fixed 2018-12-01 11:07:02 +03:00
Georgy Bronnikov
f4aad70b36 Fix KotlinFrameworkSupportProviderTest 2018-11-30 18:00:27 +03:00
Corey
ae7cc8a133 Consider non-existent AttributeContainers empty
Given the prior faulty logic, no tree of `HierarchyAttributeContainer`s would ever report itself as empty (not even a 'tree' consisting of a single, attribute-less/empty HierarchyAttributeContainer), since every tree will have a root, which will lack a parent, and it considered the lack of existence of a parent to mean that that root container is not empty.
2018-11-30 16:21:33 +03:00
Sergey Igushkin
8cec50e6e2 Reorder MPP plugin logic to fix eager publishing configuration
In Gradle 5.0, the `publishing` extension is configured eagerly, so
we need to make sure everything we use in publishing setup is already
available at the point when it's triggered:

* the `metadata` target
* the source JARs

Issue #KT-28520 Fixed
2018-11-30 15:34:58 +03:00
Sergey Igushkin
0f670f806f Fix Android Extensions early dependency resolution
Make compiler plugin options evaluate lazily, with Lazy<String> and
FileCollection as replacements for the eagerly-evaluated data.

Adjust compiler plugin option usages so that their evaluation is not
triggered when not necessary.

Issue #KT-26065 Fixed
2018-11-30 15:34:21 +03:00
Alexey Tsvetkov
201c16ecb0 Reformat incremental-compilation-impl tests 2018-11-30 15:26:34 +03:00
Alexey Tsvetkov
db0d549f02 Minor: remove usage of Intellij hashmap 2018-11-30 15:26:34 +03:00
Mikhail Glukhikh
a7ad1113b2 Redundant async: do not suggest for calls with 'start'
The reason with 'withContext' does not have such parameter anymore
2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
3d15cbcced Redundant async inspection: run "optimize imports" after quick-fix 2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
fd3c6496fb Redundant async inspection: support case with explicit scope
#KT-28504 Fixed
2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
9f5255da02 SimplifyCallChainFix: take Conversion instead of raw text, polish a bit 2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
b6630699aa SimplifyCallChainFix: implement 'modifyArguments' as lambda 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
5947ca1142 Redundant async cleanup: use CAPS for constant names 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
e6a1b96c53 Redundant async inspection: support case with GlobalScope
Partial implementation of KT-28504
2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
138e36aa66 Simplify call chain fix: extract 'apply' 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
c4717d17d9 Redundant async: extract generateConversion, integrate arguments inside 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
d909162a89 Rename "Result is Result" inspection to "Direct use of result type" 2018-11-30 15:14:26 +03:00
Sergey Rostov
5237079c5d Move resources: fix copy-resources kotlin compiler maven plugins 2018-11-30 15:01:02 +03:00
Sergey Rostov
2fac72cd99 Move resources: remove build code that not required anymore 2018-11-30 15:01:02 +03:00
Sergey Rostov
d3dc1d8164 Move resources: update writePluginVersion 2018-11-30 15:01:02 +03:00
Sergey Rostov
487c57e2e0 Move resources, kotlin-reflect.jar: remove manually included META-INF/services/*
Now it already included. Manually including causes duplicated contents
in resulting files, for example:

1	   kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
2	   kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
3	   kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition
4	+  kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
5	+  kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
6	+  kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition

Removing this line fixes that.
2018-11-30 15:01:02 +03:00
Sergey Rostov
74f6c8ac5c Move resources: remove includes from src to resources, include resource folder in custom build scripts 2018-11-30 15:01:02 +03:00
Sergey Rostov
5623c74543 Move resources: fix pill 2018-11-30 15:01:02 +03:00
Sergey Rostov
df2e4524d7 Move resources from /src to separate /resources directory.
Previously this files was stored in /src directory and was included in
resources mainly by SourceSet.projectDefault from sourceSets.kt:

val processResources = tasks.getByName(processResourcesTaskName) as ProcessResources
processResources.from("resources") { include("**") }
processResources.from("src") { include("META-INF/**", "**/*.properties") }

Also there are some custom rules like this:

resources.srcDir("../idea-analysis/src").apply { include("**/*.properties") }
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }

All this rules are synthesized in script
https://github.com/snrostov/kotlin-migrate-resources/blob/master/src/main/kotlin/main.kt

This commit created using that script. See README.md for more details on
 script.
2018-11-30 15:01:01 +03:00
Ilya Matveev
093b9d174d Update Kotlin/Native: 1.0.3 2018-11-30 18:58:01 +07:00
Alexander Podkhalyuzin
c416b192ef Cleanup, all bunches are completely the same... 2018-11-30 14:30:43 +03:00
Denis Zharkov
2182be82e6 Fix message text for INCOMPATIBLE_ENUM_COMPARISON
^KT-28516 Fixed
2018-11-30 10:34:00 +03:00
Ilya Gorbunov
a534bfc32f Move index overflow tests to another test source set
To avoid reporting them as ignored and to make it more easy to run them
when needed.
2018-11-30 07:27:07 +03:00
Roman Artemev
c5922bf74b Refact stdlib generator, add support for different backends
[JS IR BE] Runtime fixes
 * Do not generate external declarations for IR BE
 * Move `arrayToString` helper function out of shared JS stdlib
 * Fix arrays type check for IR BE
2018-11-29 22:04:53 +03:00
Mikhail Glukhikh
05b1a99022 Fix "redundant async" for coroutines 1.*, forbid explicit scopes case
Related to KT-28504
#KT-28445 Fixed
2018-11-29 21:17:57 +03:00
Mikhail Glukhikh
93fff99d8d Extract stub library file from "Result is Result" inspection tests 2018-11-29 21:17:33 +03:00
Mikhail Glukhikh
6b60d49e09 Extract stub library file from "Redundant async" inspection tests 2018-11-29 21:17:16 +03:00
Mikhail Glukhikh
4e1d8fcfd0 Allow to convert nullable local / top to late-init since version 1.2
Enhancement for KT-12743
2018-11-29 19:58:11 +03:00
Toshiaki Kameyama
4cf266e99f Add intentions to convert nullable <--> lateinit var #KT-12743 Fixed 2018-11-29 19:45:10 +03:00
Mikhail Glukhikh
9049af3bdf Quick-fixes for SMARTCAST_IMPOSSIBLE: refactor
Enhancement for KT-27184
2018-11-29 19:26:58 +03:00
Toshiaki Kameyama
cf3215b96e Add quick fixes for SMARTCAST_IMPOSSIBLE in 'if' #KT-27184 Fixed 2018-11-29 19:26:58 +03:00
Toshiaki Kameyama
a0162adbf9 Nested lambda has shadowed implicit parameter: do not report when outer lambda 'it' is not used
#KT-26710 Fixed
2018-11-29 19:19:19 +03:00
Mikhael Bogdanov
7ee13ca353 Generalize parameter index calculation in ASM 7 support
Second part for d2a205c72d commit

 #KT-27774 Fixed
2018-11-29 16:45:50 +01:00
Alexander Podkhalyuzin
e044ec78a1 Do not duplicate build number of IDEA in code 2018-11-29 16:37:33 +03:00
Nikolay Krasko
e4da6c268a Generate new Gradle dependency directives when is version above 3.4 (KT-22571)
^KT-22571 Fixed
2018-11-29 16:23:24 +03:00
Juan Chen
7aa195b017 Use "implementation" in build scripts when configuring Kotlin (KT-22571)
Currently "compile" is used when adding kotlin dependencies to build
scripts, which is deprecated.
2018-11-29 16:23:23 +03:00
Nikolay Krasko
76a3c58aaf Better check when to apply old syntax for configuration (KT-28513, KT-22571)
^KT-28513 Fixed
2018-11-29 16:23:22 +03:00
Nikolay Krasko
93b7f05287 Add exceptions to VfsRootAccess in gradle tests 2018-11-29 16:23:21 +03:00
Svyatoslav Kuzmich
59032c384e [JS IR BE] Validate parents 2018-11-29 15:36:57 +03:00
Svyatoslav Kuzmich
39cdee8d6c [JS IR BE] Enable IrValidator 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
2172a12df4 [JS IR BE] Eliminate identical IrElements duplicates 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
ba0f652e02 [JS IR BE] Fix parameters parents 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
d5f8c63130 [IR] Add returnType to consturcotrs of IrFunctionBase 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
fe6b36391d [JS IR] JsIrBuilder - add returnType and parent to buildFunction 2018-11-29 15:36:56 +03:00
Ilmir Usmanov
0934db8fbd Do not transform state-machine when inlining
Sometimes, state-machine, generated in inline functions with
crossinline parameter, is transformed, since all usages should be
renamed.
However, this is wrong: in this case, we will have state-machine
inside state-machine.
This fix addresses the issue.

 #KT-25893 Fixed
2018-11-29 14:58:35 +03:00
Toshiaki Kameyama
d3908aeb2e Add "map.get() with not-null assertion operator" inspection #KT-25171 Fixed 2018-11-29 14:42:18 +03:00
Mikhail Glukhikh
c5c0cbccde Redundant companion reference: simplify name conflict checking code
Before this commit, function with same name but different signature
wasn't counted as name conflict, now it is - just because that exact
check in this place could be too complex and error-prone

Enhancement for KT-27539
2018-11-29 14:32:08 +03:00
Toshiaki Kameyama
1db7a0e0cc Redundant companion reference: don't report in case of name conflicts
#KT-27539 Fixed
2018-11-29 14:32:08 +03:00
Mikhail Zarechenskiy
6e27d7a2a5 [NI] Refactor common supertype calculator
Make filtration phases more explicit, get rid of `filterNot`
2018-11-29 14:08:04 +03:00
Mikhael Bogdanov
623f31a178 Remove redundant tests 2018-11-29 12:02:05 +01:00
Mikhael Bogdanov
aa12439e65 Add 'visitAnnotableParameterCount' to MethodBodyVisitor.kt 2018-11-29 12:02:04 +01:00
Mikhael Bogdanov
c6268d72c9 Separate RemapVisitor and MethodBodyVisitor 2018-11-29 12:02:03 +01:00
Nikolay Krasko
226ade615c Show build number in internal mode (KT-28254)
^KT-28254 Fixed
2018-11-29 13:31:09 +03:00
Nikolay Krasko
0aec18c440 Minor: explain in comment when light class can be null 2018-11-29 13:31:08 +03:00
Nikolay Krasko
05b2443988 Make assignment indent conforms with indent for expression bodies (KT-28484)
Do not make plain list of binary expression for assignment expressions.

 #KT-28484 Fixed
2018-11-29 13:31:07 +03:00
Nikolay Krasko
699e3397d9 Warn about bad options in usage parsers in tests 2018-11-29 13:31:04 +03:00
Mikhail Glukhikh
9b4bcabbd3 Fold initializer & if to elvis: add test, rename tests, simplify code
Enhancement for KT-27016
2018-11-29 13:20:54 +03:00
Toshiaki Kameyama
fd6f34f8ca "Replace 'if' with elvis operator": don't suggest on super type check
#KT-27016 Fixed
2018-11-29 13:20:54 +03:00
Georgy Bronnikov
ffa3d7c57a Update test data 2018-11-29 12:48:52 +03:00
Georgy Bronnikov
32640750ee Add CompilerPhase and corresponding compiler keys 2018-11-29 12:48:52 +03:00
Alexander Prendota
ecba313223 ReadMe: update Kotlin playground link 2018-11-29 12:16:57 +03:00
Ilya Chernikov
7719a5849f Refactor templates from dependencies loading:
move into background thread
avoid parallel execution
other refactorings

#KT-27669 fixed
2018-11-29 09:47:15 +01:00
Ilya Chernikov
e91fd63a15 Add config entry for main.kts to recognise it in all locations 2018-11-29 09:47:15 +01:00
Ilya Chernikov
c67df19281 Improve classpath calculation for locally-defined script templates
Since at least in gradle-imported projects, the template could be found
in several modules, some of them - incomplete (parent/buildscript module)
the previous logic of filtering for already processed templates and roots
is incorrect, and therefore removed.
Also fixes the exception in our project "cannot load script definition"
2018-11-29 09:47:15 +01:00
Natalia Selezneva
4b5ba83c77 Tests: synchronize script dependencies in the beginning of the test because it invalidates the tested psi file
Fix for StandaloneScriptRunConfigurationTest.testOnFileMoveWithNonDefaultWorkingDir
2018-11-28 16:04:50 +03:00
Natalia Selezneva
9f372c3c66 Update dependencies for AS34 (Canary 3.4.0.5) 2018-11-28 16:04:50 +03:00
Natalia Selezneva
25043a720c Tests: allow document modification during highlighting for scripts in LocalInspectionTest
Fix 'java.lang.AssertionError: PSI/document/model changes are not allowed during highlighting'
For script when there are some new dependencies we are restarting highlighting (see ScriptDependenciesCache)
2018-11-28 16:04:49 +03:00
Natalia Selezneva
902c4688a2 Tests: register jdk in project table to avoid leaking of VirtualPointer 2018-11-28 16:04:49 +03:00
Natalia Selezneva
1b0919a019 Fix navigation on stdlib in non-gradle projects (KT-28398)
In non-gradle project kotlin-stdlib-sources.jar contains sources for common and jvm part, so both (expect and actual) declarations are present in the same library sources scope.
We are moving expect declarations in the bottom of this list to avoid navigation on expect declaration when actual declaration is present in the same scope
^KT-28398 Fixed
2018-11-28 16:04:49 +03:00
Natalia Selezneva
8033ec469c Revert wrong testdata fix in NavigateToStdlibSourceTest 2018-11-28 16:04:49 +03:00
Simon Ogorodnik
29a1204b48 Fix test failures on CI due to ProGuard-ed Guava 2018-11-28 15:29:01 +03:00
Dmitriy Dolovov
42392fff23 Fix: Analysis in scratch ends with ISE
Issue #KT-28427:fixed
2018-11-28 18:58:57 +07:00
Toshiaki Kameyama
dc2a707444 Keyword completion: add 'class' after 'data' #KT-26632 Fixed 2018-11-28 14:47:37 +03:00
Dmitry Petrov
42e253b5ff KT-28456 generate index arguments per expression
In the desugaring for compound assignment to a collection element,
argument expression 'i' is mapped to value parameters 'iG' and 'iS' of
corresponding 'get' and 'set' operators.
In general, these value parameters can have different indices.

This requires extra machinery in argument generation - that is, to be
able to generate a particular expression argument using an arbitrary
callback. In the vast majority of the cases this callback will just use
the corresponding StatementGenerator to generate IR subtree for the
provided expression. In case of 'get' and 'set' operator calls for an
augmented assignment expression this will map corresponding argument
expressions to pregenerated temporary variables.

Thus, in the following context:
```
  class A

  operator fun A.get(vararg xs: Int) = 0
  operator fun A.set(i: Int, j: Int, v: Int) {}
```

statement `a[1, 2] += 3` will be desugared as (in a really pseudo
Kotlin):
```
  {
    val tmp_array = a
    val tmp_index0 = 1
    val tmp_index1 = 2
    tmp_array.set(
      i = tmp_index0,
      j = tmp_index1,
      v = tmp_array.get(xs = [tmp_index0, tmp_index1]).plus(3)
    )
  }
```
2018-11-28 14:36:44 +03:00
Toshiaki Kameyama
036b12f408 Extract interface: do not show private contstractor parameter on dialog
#KT-28408 Fixed
2018-11-28 13:46:57 +03:00
Mikhail Glukhikh
8fb213021c Create expect: remove false positive in inaccessible type detector 2018-11-28 12:36:29 +03:00
Mikhail Glukhikh
9ae7bc935d Create expect / actual refactoring: extract AbstractCreateDeclarationFix 2018-11-28 12:36:22 +03:00
Mikhail Glukhikh
222939efe7 Create expect / actual refactoring: extract common part to utilities 2018-11-28 12:00:55 +03:00
Mikhail Glukhikh
17e0e529e0 Create actual refactoring: get rid of actualNeeded 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
d54b5b68cc Create expect / actual refactoring: get element description at one place 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
933d10e75d Create expect / actual refactoring: remove all declarations at start 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
d3fada89b7 Generate enum entries in create actual / expected fixes as all other
This makes code a bit cleaner
2018-11-28 12:00:54 +03:00
Cuihtlauac ALVARADO
a9280cdbcd Add support for proxies to scripts
Update jcabi-aether dependency from 0.10.1 to 1.0-SNAPSHOT. In order to
do that, add https://oss.sonatype.org/content/repositories/snapshots to
the repositories in tools/kotlin-script-util/build.gradle.kts

Script dependencies are resolved using jcabi-aether. Unfortunately "stable"
release (0.10.1) does not support proxies. Therefore, script dependencies
are not pulled behind a proxy. Issue is fixed in SNAPSHOT release of
jcabi-aether.

FIXED: KT-22363
2018-11-28 09:30:05 +01:00
Natalia Selezneva
e3eda012c4 Tests: synchronize script dependencies in the beggining of the test because it invalidates the tested psi file 2018-11-28 11:16:26 +03:00
Natalia Selezneva
2d2a073c55 Tests: replace immediate run with TransactionGuard.submitTransaction to fix write in write-unsafe context in tests 2018-11-28 11:16:26 +03:00
Sergey Rostov
62b0b3e4e9 JPS: report about unsupported targets once
Report about unsupported targets once per target type, show presentable
chunks list and don't show more then 5 chunks.

Example: "Native is not yet supported in IDEA internal build system.
Please use Gradle to build a, b, c, d, e and 10 other  (enable 'Delegate
IDE build/run actions to Gradle' in Settings)."

#KT-26980 Fixed
#KT-28316 Fixed
2018-11-28 11:08:57 +03:00
Sergey Rostov
ab2b4311fd JPS: fix SimpleKotlinJpsBuildTest.testDaemon
Make it the same as testJpsDaemonIC
2018-11-28 10:46:57 +03:00
Sergey Rostov
0c39358b5f JPS: fix testJpsDaemonIC
1. Checking for COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was moved to COMPILE_DAEMON_DEFAULT_RUN_DIR_PATH.

Looks like COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was introduced incorrectly in 220fab0d3f.
Checking of this property was added in DaemonOptions.runFilesPathOrDefault, while DaemonOptions.runFilesPath was internally used in runFilesPathOrDefault and in many other places.
For example DaemonOptions.runFilesPath used to pass this option to daemon server.
So daemon was started with runFilesPath that ignores COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS.

2. JpsKotlinCompilerRunner._jpsCompileServiceSession was leaked between tests.

Fixed by extracting @TestOnly releaseCompileServiceSession() and calling it in tests tearDown()

3. The result of compileWithDaemon was ignored in compileWithDaemonOrFallback.

So, the fallback was never called, and the FAIL_ON_FALLBACK_PROPERTY was actually was never worked.
This was fixed. Also the message was improved to make it easier to find the original fail cause.
2018-11-28 10:46:57 +03:00
Sergey Rostov
c06b000e8d JPS: Test for "Cyclically dependent modules should have same compiler"
KT-27285
2018-11-28 10:46:57 +03:00
Sergey Rostov
3c8b15ca54 JPS: Report "Cyclically dependent modules should have same compiler" as build error rather than exception
#KT-27285 Fixed
2018-11-28 10:46:57 +03:00
Sergey Rostov
ce4422e2ef JPS, tests: Support multimodule mpp tests without steps 2018-11-28 10:46:58 +03:00
Ilya Gorbunov
beec6a7c4a Update line numbers after reformatting coroutines stdlib sources 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
d7ff6c48ea Leave only 1.3 JS IR runtime sources
Update exclusions after merging coroutines sources into stdlib.
2018-11-28 06:05:03 +03:00
Ilya Gorbunov
5c94ef229b Move release coroutines sources into the corresponding stdlib sourcesets 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
7d61a2de73 Reformat coroutine sources 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
ec3692026d Rename coroutines sourceset to coroutinesExperimental
Restore experimental coroutine tests as they were before e22ca022
and compile and run them twice:
 - first time with LV=1.2
 - second time with LV=1.3
2018-11-28 06:05:02 +03:00
Ilya Gorbunov
673844a059 Move coroutine tests to other stdlib-jvm tests 2018-11-28 06:05:02 +03:00
Georgy Bronnikov
1a529bd601 Revert "Switch off logging for failing IrBlackBox tests"
This reverts commit d23964034b.
2018-11-28 00:00:13 +03:00
Yan Zhulanow
6590497b8d Revert "Minor: Remove a deprecated method usage"
The method is still actual in IDEA 181 and Android Studio 3.1/3.2.
2018-11-28 02:25:34 +09:00
Yan Zhulanow
9bc02279c4 Kapt: Fix Maven build, add 'getJarPathForClass()' to the ProGuard configuration 2018-11-28 02:25:34 +09:00
Sergey Igushkin
a0399d0541 Add new-mpp-lib-with-tests Kotlin DSL build script and test 2018-11-27 19:47:49 +03:00
Sergey Igushkin
202c86aafe Add a function attributes { } to KotlinTarget and KotlinCompilation
Gradle has a function `attributes { ... }` for `Configuration`, so we
can introduce one, too, for uniformity of the DSLs. This will configure
the `val attributes: AttributeContainer` of the `KotlinTarget` and
`KotlinCompilation`.

Issue #KT-27682 Fixed
2018-11-27 19:47:48 +03:00
Sergey Igushkin
5c5c161d59 Enable resources processing for Kotlin/JS target in MPP
Issue #KT-28363 Fixed
2018-11-27 19:47:47 +03:00
Sergey Igushkin
4dd95e331f Add missing DSL features to the MPP dependencies DSL
* Add DSL for project(...) with path and configuration
* Add DSL for e.g. api(someDependency) { /* ... */ }
* Add DSL for e.g. api(kotlin("stdlib"))

Issue #KT-26663 Fixed
2018-11-27 19:47:45 +03:00
Sergey Igushkin
cee52c095f Add and generate Groovy-friendly DSL members
As Gradle Groovy DSL does out-of-the box not allow working with
SAM-receiving functions in the same way as those accepting a Closure,
and, moreover, does not work with Kotlin default parameters, we need
to provide Groovy-friendly DSL functions along with Kotlin DSL functions

This commit adds those additional members for all of the newly
introduced MPP DSL members.
2018-11-27 19:47:44 +03:00
Sergey Igushkin
88fa85fc1f Don't set the default Maven coordinates that are derived from project
In Gradle, a publication's Maven coordinates are by default derived from
the project. Setting them explicitly breaks the link, and the
coordinates are no more updated when the project's group and version
change.

Setting the coordinates in our code breaks with Gradle Kotlin DSL, where
the plugin is applied before the build script can even update the
project's group and version -- our code could set empty values, which
would update no more. Not setting them helps: the values are still
delegated to the project.
2018-11-27 19:47:43 +03:00
Sergey Igushkin
a3b50e33b8 Remove the out-projection from kotlinSourceSets in kotlin extension
Gradle versions older than 4.10 could not correctly provide access to
the source set via delegation (i.e. `getting`, `creating` etc.) because
of the out-projection.

Remove the out-projection and expose just
`DomainObjectContainer<KotlinSourceSet>`, as under the hood we can still
use the `DefaultKotlinSourceSet` type for the items.
2018-11-27 19:47:42 +03:00
Sergey Igushkin
207bf7cf4a Add test for multiplatform projects with Gradle Kotlin DSL
* Adjust some of the test tools to work with *.kts scripts
* Expose the tool for version substitution into plugins DSL and use it
* Transform the lib-and-app test case to Gradle Kotlin DSL
2018-11-27 19:47:41 +03:00
Sergey Igushkin
fe64d33ae4 Add defaultSourceSet to KotlinCompilation
Previously, the connection between a `KotlinCompilation` and its
default `KotlinSourceSet` (the one automatically created and added into
the compilation) was not expressed in the MPP model in any reasonable
way that can be used in the build scripts.

However, this connection seems to have settled in the build logic, and
it may be useful to be able to get the default source set from a
compilation, for example, to be able to configure dependencies across
several targets in a uniform way.

The metadata compilations don't have their dedicated source sets, but
we can think of commonMain as a default source set for the project's
metadata, is it is currently in fact only contains the declarations from
commonMain.

Issue #KT-27685 Fixed
2018-11-27 19:47:39 +03:00
Sergey Igushkin
581b161611 Expose statically-typed kotlinOptions and compileKotlinTask in DSL
To simplify configuring a `KotlinCompilation` with Gradle Kotlin DSL, it
is essential to expose statically-known types where possible.

This commit parametrizes `KotlinCompilation` with its Kotlin options
type (a subtype of `KotlinCommonOptions`) and adds `kotlinOptions` and
`compileKotlinTask` to `KotlinCompilation`.

(minor) Also reduce the visibility of `attachClassesDir` and
`setupPlugins` to internal, since this API is not for external use.
2018-11-27 19:47:38 +03:00
Sergey Igushkin
1e2436b1c1 Make KotlinNativeCompile implement the <...>.dsl.KotlinCompile interface
This is required for KotlinCompilation to be able to generically expose
the Kotlin compile tasls.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
ae5d59caf0 Add a new root of <...>.dsl.KotlinCompile hierarchy in API
This new interface uses a more general type for its kotlinOptions,
KotlinCommonToolOptions rather than KotlinCommonOptions. This is
needed for the Kotlin/Native task to implement a common interface
with the other Kotlin compilation tasks.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
ecd54d9b21 (minor) Move KotlinCommonToolOptions to kotlin-gradle-plugin-api
This change is needed to expose `kotlinOptions { ... }` in the
API interfaces.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
635d436f02 Provide preset-like factory functions for creating targets in new MPP
* Pull the `targets` and `presets` properties of the `kotlin` extension
  up to an interface in `kotlin-gradle-plugin-api`

* Generate the code: we need type-safe statically-typed functions for
  different target type, which seems to be only possible to achieve by
  providing a function per preset.

* Place these functions in the top-level `kotlin` Gradle extension,
  rather than extension functions for `kotlin.targets`:

  - `kotlin.jvm { ... }` will work, while `kotlin.targets.jvm { ... }`
    won't, the extension function needs to be somehow brought into scope

  - reducing the nesting level by one seems to be a good move here

Issue #KT-26389 Fixed
2018-11-27 19:37:49 +03:00
Georgy Bronnikov
d23964034b Switch off logging for failing IrBlackBox tests
Logging of tests that are expected to fail is controlled by
kotlin.suppress.expected.test.failures project property.
2018-11-27 16:53:34 +03:00
Yan Zhulanow
57d8e9457c Evaluate: Pass a constructor with loaded classes to 'runEval4J()'
So even if 'evaluateWithCompilation()' fails, 'runEval4J()' can use the additional classes.
2018-11-27 22:21:28 +09:00
Yan Zhulanow
1d1f3c3fd6 Minor: Remove a deprecated method usage 2018-11-27 22:21:27 +09:00
Yan Zhulanow
4cfd028768 Do not ignore an evaluation exception in StepOver command 2018-11-27 22:21:27 +09:00
Yan Zhulanow
03a6066ce0 Call 'StackFrameProxy::visibleVariables()' in a safe way (KT-27462) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
47657df8da Kapt: Convert valid references to qualified names (KT-26304) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
6a8a8b794d Kapt: Support correctErrorTypes in suspend functions (KT-27711) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
4c5e982f3e Kapt: Fix an ArrayIndexOutOfBoundsException for suspend functions with generated return types 2018-11-27 22:21:26 +09:00
Yan Zhulanow
69633e6686 Kapt: Fix stubs for delegated properties with anonymous types (KT-27910) 2018-11-27 22:21:26 +09:00
Yan Zhulanow
5fd070a9b9 Kapt: Add option for showing annotation processor timings (KT-28024) 2018-11-27 22:21:26 +09:00
Yan Zhulanow
9feb834d97 Kapt: Support paranoid mode in memory leak searcher 2018-11-27 22:21:26 +09:00
Yan Zhulanow
ecc44419b6 Kapt: Support KotlinOptions class in KaptWithoutKotlincTask 2018-11-27 22:21:25 +09:00
Yan Zhulanow
7e4069f114 Kapt, Refactoring: Introduce 'KaptOptions'
1. Use 'KaptOptions' for all kapt options, including paths and flags.
2. Use a single 'KAPT_OPTIONS' compiler configuration key for setting all options (using a mutable KaptOptions.Builder).
3. Pass 'KaptOptions' instead of separate flags.
4. Remove 'KaptPaths'.
5. Remove deprecated 'aptOnly' CLI option.
2018-11-27 22:21:25 +09:00
Toshiaki Kameyama
a621171d9b KT-24515 Intention to add an exception under the cursor to @Throws annotations 2018-11-27 22:21:25 +09:00
Yan Zhulanow
3918ec71be Kapt: Suppress warnings for deprecated kapt option usage 2018-11-27 22:21:25 +09:00
Yan Zhulanow
abd1646d42 Kapt: Detect memory leaks in annotation processors (KT-28025) 2018-11-27 22:21:24 +09:00
Yan Zhulanow
eb3511164f Fix DataBinding kapt integration test 2018-11-27 22:21:24 +09:00
Yan Zhulanow
911ad32580 Kapt: Check if the psiElement is bound to some Document instance before asking for its text range
textRange has an assertion that fails if the Document is not set.
2018-11-27 22:21:24 +09:00
Yan Zhulanow
cd968ba8fe Kapt: Clear Javac shared ZIP cache after annotation processing or stub generation (KT-25756) 2018-11-27 22:21:24 +09:00
Yan Zhulanow
0ffa901859 Switch plugin and annotation processor loading to the own implementation of ServiceLoader
'ServiceLoader' in JDK8 leaks file handles (https://bugs.openjdk.java.net/browse/JDK-8156014).
New implementation uses the ZipFile API, it also doesn't operate on the whole classpath which is not often needed.
2018-11-27 22:21:24 +09:00
Yan Zhulanow
11e23ecc70 Kapt: Fix 'apt+compile' mode, clear package caches directly 2018-11-27 22:21:23 +09:00
Yan Zhulanow
4e84a6b601 Kapt: Do partial analysis only for stub generation
Kapt has a 'compile' mode which repeats analysis after the annotation processing.
It should not run in the partial analysis mode.
2018-11-27 22:21:23 +09:00
Yan Zhulanow
69ec958aab Kapt: Add tests for the command-line 'kapt' tool 2018-11-27 22:21:23 +09:00
Yan Zhulanow
6e5eb0fdd4 Kapt: Implement 'kapt' command-line tool (KT-24998, KT-24997) 2018-11-27 22:21:23 +09:00
Yan Zhulanow
2e56feed73 Performance optimization: do not create a new list object on each new option 2018-11-27 22:21:23 +09:00
Yan Zhulanow
b6aecf3933 Remove hacky PluginURLClassLoader
It was once needed for the compiler plugins bundled straight into the compiler (read: kapt1). Since there are no bundled plugins anymore, the parent-last plugin classloader itself is not needed anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow
02340a4fe3 Removed obsolete 'BundledCompilerPlugins' class
It was used once in kapt1, but since it's gone, there is no need in this anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow
c5e241d5c6 Remove deprecated usages of CliOption in official compiler plugins 2018-11-27 22:21:22 +09:00
Yan Zhulanow
49941339a3 Introduce AbstractCliOption, rewrite all possible kapt options as enum values 2018-11-27 22:21:22 +09:00
Yan Zhulanow
546eff6e45 Kapt: Use light analysis by default 2018-11-27 22:21:21 +09:00
Yan Zhulanow
fa0f447a23 Minor: Refactor AptMode a bit 2018-11-27 22:21:21 +09:00
Yan Zhulanow
fe0f9005b0 Kapt: Allow to use class output directory as a generated class output 2018-11-27 22:21:21 +09:00
Yan Zhulanow
7893bb60a6 Kapt: Using 'kapt' configuration without the 'kotlin-kapt' plugin applied should throw an error (KT-26145) 2018-11-27 22:21:21 +09:00
victor.petukhov
f5d44003cd Add tests for type annotations with unresolved reference and invalid target (KT-28424, KT-28449) 2018-11-27 13:55:12 +03:00
Andrey Uskov
620969652a Fixed dependency resolution of root project
#KT-28389 Fixed
2018-11-27 13:46:56 +03:00
Toshiaki Kameyama
4abcd9a053 Make internal: don't suggest for @JvmField property inside companion object of interface #KT-27138 Fixed 2018-11-26 18:39:54 +03:00
Pavel Punegov
9cc93e9e55 Fix Contracts deserialization for native plugin 2018-11-26 18:19:03 +03:00
Pavel Punegov
fe0a2bc75e Provide SerializerExtension methods with child DescriptorSerializer instance
to make Native be able to serialize backing properties and inline bodies.
Change visibility for functions and properties of DescriptorSerializer.
2018-11-26 18:15:30 +03:00
Toshiaki Kameyama
726b9272f3 Move out of companion object: don't suggest for @JvmField property inside companion object of interface #KT-28443 Fixed 2018-11-26 18:01:43 +03:00
Nikolay Krasko
3ca934e5ea Update test data for gradle migration test 2018-11-26 17:23:00 +03:00
Nikolay Krasko
bc6f53d023 Auto-indent || and && operator typed on a new line (KT-28402)
#KT-28402 Fixed
2018-11-26 17:22:59 +03:00
Nikolay Krasko
9c41ec46ee Auto-indent elvis operator on new line (KT-28371)
#KT-28371 Fixed
2018-11-26 17:22:58 +03:00
Nikolay Krasko
8fad4db8ce Auto-popup lambda type parameter info (KT-28401)
#KT-28401 Fixed
2018-11-26 17:22:45 +03:00
Vyacheslav Gerasimov
d30b66467b 183: Update 183 Idea version to the release one 2018-11-26 17:00:38 +03:00
Simon Ogorodnik
fd1a6f3830 KT-20725: Fix storing NotProperty settings
#KT-20725 fixed
2018-11-26 16:38:23 +03:00
Mikhail Glukhikh
cb7f7b1de5 Report "use of non-const Kotlin property" also on some assignments
#KT-25536 Fixed
2018-11-26 15:54:20 +03:00
Mikhail Glukhikh
651faa4ab2 Report "use of non-const Kotlin property" also on Java case labels
#KT-25536 Fixed
2018-11-26 15:54:07 +03:00
Denis Zharkov
23c43cd124 Support retrieving class of enum entry in ultra-light classes 2018-11-26 11:36:43 +03:00
Denis Zharkov
5cf2d659dc Minor. Split ultraLightPsi.kt into three files
By one for PsiClass, PsiField and PsiMethod implementations
2018-11-26 11:36:31 +03:00
Denis Zharkov
5231da4320 Fix hasAlias check when resolving annotation in ultra-light classes
When trying to estimate if annotation entry might be resolved
to a specified fqName we should track the short name from entry itself
instead of the short name of desired annotation
2018-11-26 11:36:30 +03:00
Denis Zharkov
aa5a2a2643 Support @JvmField on primary ctr properties in ultra-light classes 2018-11-26 11:36:29 +03:00
Denis Zharkov
206466f6ce Support enums in ultra-light classes
There's no need to add "values"/"valueOf" methods for them
(see com.intellij.psi.impl.compiled.StubBuildingVisitor#visitMethod that ignores them too)

We already have tests that check enum entries/synthetic methods
are properly resolved in Java:
idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/*Enum*
2018-11-26 11:36:28 +03:00
Denis Zharkov
d5a640b82d Get rid of checks for ultra-light classes unsupported annotations
Seems like all of the Jvm* annotations related to classes are supported by now
2018-11-26 11:36:28 +03:00
Denis Zharkov
ca9f42f449 Support @JvmName in ultra-light classes 2018-11-26 11:36:27 +03:00
Denis Zharkov
17328a442a Support @JvmSynthetic in ultra-light classes 2018-11-26 11:36:26 +03:00
Denis Zharkov
91c86f7f56 Fix refactorings that remove parameter based on ultra-light classes
This commit fixes the exception attached to the bottom of the message
The problem is that when creating ChangeSignatureProcessor for old PsiMethod
that points to the parameter that is already removed from PSI, some pieces
of platform code run resolution on the light PSI that eventually checks
if the source element is valid.

For KtUltraLightParameter, it inherits "isValid" from LightElement and
the latter is defined as getNavigationElement().isValid(),
while here navigationElement points to already removed parameter,
and marked as invalid.

The simplest solution was to define KtUltraLightParameter::isValid
as it was before ultra-light classes, i.e. checking if parent is valid
(see KtLightElementBase::isValid)

com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl #JAVA  because: File language:Language: JAVA != Provider base language:Language: kotlin
invalidated at: no info
	at com.intellij.psi.util.PsiUtilCore.ensureValid(PsiUtilCore.java:482)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:190)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:138)
	at com.intellij.psi.util.PsiUtil.resolveClassInType(PsiUtil.java:445)
	at com.intellij.psi.util.PsiUtil.convertAnonymousToBaseType(PsiUtil.java:484)
	at com.intellij.psi.impl.light.LightTypeElement.<init>(LightTypeElement.java:33)
	at com.intellij.psi.impl.PsiElementFactoryImpl.createTypeElement(PsiElementFactoryImpl.java:142)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.fillOldParams(JavaChangeInfoImpl.java:218)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:127)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:86)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.generateChangeInfo(ChangeSignatureProcessor.java:121)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.<init>(ChangeSignatureProcessor.java:88)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$3.invoke(KotlinChangeInfo.kt:400)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$5.invoke(KotlinChangeInfo.kt:469)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo.getOrCreateJavaChangeInfos(KotlinChangeInfo.kt:498)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeSignatureUsageProcessor.processUsage(KotlinChangeSignatureUsageProcessor.kt:847)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessorBase.doChangeSignature(ChangeSignatureProcessorBase.java:218)
2018-11-26 11:36:25 +03:00
Denis Zharkov
7de8b4de4e Support declarations returning object literals in ultra-light classes 2018-11-26 11:36:25 +03:00
Denis Zharkov
28f20a97f8 Support @JvmOverloads annotation in ultra-light classes 2018-11-26 11:25:42 +03:00
Denis Zharkov
41997769e3 Support @JvmField annotation in light classes 2018-11-26 11:25:42 +03:00
Sergey Rostov
dcc47fd8ef JPS: support KotlinResourceSourceRootType
Implementation is similar to KotlinSourceRootProvider.
This workaround is required since ResourcesTarget.computeRootDescriptors
supports only JavaResourceRoots.

#KT-27622 Fixed
2018-11-26 09:29:49 +03:00
Sergey Rostov
1301333e37 JPS, tests, minor: rename test files in modules for better readability 2018-11-26 09:29:38 +03:00
Sergey Rostov
63c6e3e1b4 JPS, minor: formatting 2018-11-26 09:29:38 +03:00
Sergey Rostov
32bd4d5936 JPS, tests: update removeAndRestoreCompanion[WithImplicitUsages] test data
src/A.kt is affected by removed classes
2018-11-26 09:29:38 +03:00
Sergey Rostov
7cdd5257c8 JPS: clear target local cache version file when caches are not required anymore
Makes changeIncrementalOption/incrementalOff test green
2018-11-26 09:29:38 +03:00
Sergey Rostov
1f162cfacf JPS, tests, minor: reformat test data for changeIncrementalOption/incrementalOff 2018-11-26 09:29:38 +03:00
Sergey Rostov
4cd4e230bf JPS, tests: update test data for cacheVersionChanged/withError
In this test only lookups caches are invalidated and only in first step.
module4 shouldn't be rebuilt since is compiled in step 1 and it is independent of all dirty modules.

Previously this module was rebuilt because of #KT-27044 which is fixed
by 5232f08
2018-11-26 09:29:38 +03:00
Sergey Rostov
a508f53f9d JPS, tests, minor: reformat test data for cacheVersionChanged/withError 2018-11-26 09:29:38 +03:00
Sergey Rostov
06b908d48f JPS, tests: Add docs for incremental/cacheVersionChanged tests 2018-11-26 09:29:38 +03:00
Ilya Gorbunov
290efe3749 BFS improvement in Gradle importer
Avoid queuing duplicate dependencies and excessive `contains` checks
by tracking discovered modules instead of processed.

Use ArrayDeque instead of LinkedList
2018-11-24 16:20:29 +03:00
Toshiaki Kameyama
e409007749 Join Lines: join initializer + if null check to elvis (KT-22388)
#KT-22388 Fixed
2018-11-24 02:30:10 +03:00
Vyacheslav Gerasimov
0708872f62 Remove kotlin-ultimate from VcsDirectoryMappings 2018-11-23 22:29:08 +03:00
Alexander Udalov
a796f11934 Support calling methods annotated with PolymorphicSignature
#KT-14416 Fixed
 #KT-26165 Fixed
2018-11-23 18:41:33 +01:00
Alexander Udalov
b940418604 Compute default method signature lazily in CallableMethod
To prevent calling mapDefaultMethod for methods which are guaranteed
not to have default parameters (e.g. signature-polymorphic methods)
2018-11-23 18:41:32 +01:00
Alexander Udalov
0331f84ccd Make parameter descriptor in CallGenerator.genValueAndPut optional
The main implementation in DefaultCallGenerator did not use anything
from that parameter anyway in 99% cases, except the type, which is
passed separately now as JvmKotlinType. This will be useful to implement
call generation for functions which do not have descriptors for their
value parameters (such as signature-polymorphic)

 #KT-14416 In Progress
2018-11-23 18:41:32 +01:00
Alexander Udalov
7766f0a89d J2K CallBasedArgumentGenerator: convert and prettify 2018-11-23 18:41:32 +01:00
Alexander Udalov
b66755b2d6 J2K CallBasedArgumentGenerator: rename .java -> .kt 2018-11-23 18:41:32 +01:00
Dmitriy Dolovov
bdaf762d93 CLion/AppCode: Disable action items in IDE:
- Convert Java File to Kotlin File
- Decompile Kotlin To Java

Issue #KT-28345:fixed
2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
597d119ab7 CLion/AppCode: New plugin versioning schema
Use -PdeployVersion=<kotlin_version> to specify Kotlin version
Use -PcidrPluginVersion=<plugin_version> to specify CLion or AppCode plugin version (default is "beta-1")
2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
b39656a85a CLion/AppCode: Use LLDB bindings in Kotlin/Native debugger 2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
5dca9b3de5 CLion/AppCode: Re-enable specific EPs for Kotlin/Native
Issue #KT-26717
2018-11-23 22:27:23 +07:00
Simon Ogorodnik
8ed63d1c18 CLion: Patch some xml's of Java plugin to make it work more stable
To get rid of exceptions while startup and indexing
2018-11-23 22:27:23 +07:00
Simon Ogorodnik
2b3b5876aa CLion/AppCode: Use default platform for libraries, if no LibraryKind is specified
To avoid Unknown platform JVM
2018-11-23 22:27:23 +07:00
Vyacheslav Karpukhin
1b9b545643 CLion: limit plugin compatibility 2018-11-23 22:27:23 +07:00
Simon Ogorodnik
a8e5c01126 CLion/AppCode: Build artifacts via compilations, not via tasks 2018-11-23 22:27:23 +07:00
Simon Ogorodnik
7f0fcf7ef1 CLion/AppCode: Do not import sourceSets with unsupported platforms 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
4a99cb274b CLion/AppCode: Provide proper TargetPlatform & TargetPlatformVersion to FE 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
49de7becfd CLion/AppCode: Disable module type check for Kotlin Facet adding 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
64800266f5 CLion/AppCode: Provide proper default platform instead of JVM 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
39b151e37b CLion/AppCode: Fix facet configuring 2018-11-23 22:27:22 +07:00
Vyacheslav Karpukhin
6dccafb469 CLion/AppCode: Move KotlinMPPGradleProjectResolver declaration from gradle-java.xml to gradle.xml 2018-11-23 22:27:22 +07:00
Vyacheslav Karpukhin
632dcc31bd CLion/AppCode: Added kotlin-ultimate repository. 2018-11-23 22:27:21 +07:00
Mikhail Zarechenskiy
7b108541a9 [NI] Add test for obsolete issue
It was fixed after c6712ff861

 #KT-25182 Obsolete
2018-11-23 17:30:37 +03:00
Mikhail Zarechenskiy
30aee3bfb6 [NI] Update test data 2018-11-23 17:30:37 +03:00
victor.petukhov
68c1e70b74 Add real literals spec tests 2018-11-23 17:24:13 +03:00
victor.petukhov
73ecde6cc3 Add boolean literals diagnostic spec tests 2018-11-23 17:24:01 +03:00
victor.petukhov
1af1eed31c Add when expression PSI spec tests 2018-11-23 17:23:51 +03:00
victor.petukhov
64f531fc93 Reorganize spec tests infrastructure code
- Add the tests mute system for the diagnostic tests
- Move the code for the test info parsing to the separate package `parsers`
- Unification of the `linked` and `not linked` spec tests
- Package structure is refactored
- Change the multiline comment format with a test information
- Actualize `PrintSpecTestsStatistic`
- Other different code improvements
2018-11-23 17:23:41 +03:00
Mikhail Glukhikh
2af9efa4a0 Fix failing test (related to KT-28381, KT-28382 commits) 2018-11-23 15:43:39 +03:00
Mikhail Glukhikh
d59ea4c087 Move member to companion object: reformat 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
88cea0a88c Navigation to implementation: do not try to find expect enum inheritors
Before this commit, expect enum could find actual enum entries
as its implementation, now it cannot.
#KT-28206 Fixed
2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
5502d2de6a Fix KNPE in "Move member to companion" for expect class #KT-28383 Fixed 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
41b75346fe Forbid "introduce backing property" for expect classes #KT-28382 Fixed 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
10cc4959cc Forbid "move property to constructor" for expect classes #KT-28381 Fixed 2018-11-23 15:35:18 +03:00
Andrey Uskov
f960ed9a46 Fix gradle-api version in bunch 173 (KT-27337) 2018-11-23 13:43:52 +03:00
Andrey Uskov
8fc005d8fd Versions of components were moved from versions.gradle.kts to versions.properties in order to avoid unnecessary buildscript recompilation
#KT-27337 Fixed
2018-11-23 13:26:12 +03:00
Nikolay Krasko
d2b0ccd341 Restrict index search to declarations visible from Java
Fix KotlinStdLibInJavaCompletionTestGenerated.testList
Regression after KotlinShortNamesCache rewrite.
2018-11-23 01:59:15 +03:00
Nikolay Krasko
b79f8ff8fa Fix completion tests after "cast required" color change (KT-18089)
#KT-18089 Fixed
2018-11-23 01:59:14 +03:00
Toshiaki Kameyama
d06b04f025 Add intention to convert SAM lambda to anonymous object #KT-25718 Fixed 2018-11-23 01:05:42 +03:00
Andrey Uskov
eedb69b5e4 Improve diagnostics in GradleInspectionTest 2018-11-22 20:18:03 +03:00
Ilya Gorbunov
cff32e46bb Provide expect declarations for String.startsWith/endWith overloads
Mark the existing declarations as actual.
2018-11-22 19:17:24 +03:00
Mikhail Zarechenskiy
b48614df47 Add test for class literals on inline classes
#KT-28361 Obsolete
2018-11-22 18:10:41 +03:00
Mikhail Zarechenskiy
7a9fb3ca26 [NI] Fix coercion to Unit for explicitly specified type argument
#KT-25424 Fixed
2018-11-22 18:10:39 +03:00
Mikhail Zarechenskiy
c6712ff861 [NI] Correctly compute definitely not null type for intersection one
{ T : Any? & Foo & Bar? }!! -> { T!! & Foo & Bar }

 Also, fix bug with loosing non-representative number type.
 For example, for type { Byte & SomeType } we lost type `Byte` because
 `getDefaultPrimitiveNumberType` returns null for it

 Fixes #KT-28334 for NI
2018-11-22 18:10:37 +03:00
Mikhail Zarechenskiy
aa224558bd Convert and simplify IntersectionTypeConstructor 2018-11-22 18:10:35 +03:00
Mikhail Zarechenskiy
8340bff113 Rename .java to .kt for IntersectionTypeConstructor 2018-11-22 18:08:30 +03:00
Toshiaki Kameyama
f1a0cefde0 Convert concatenation to template: remove 'toString()' call #KT-6025 Fixed 2018-11-22 15:55:32 +03:00
Toshiaki Kameyama
825d1d8b35 Extract 'isToString()' function to Utils 2018-11-22 15:55:32 +03:00
Nikolay Krasko
a0c25c7a87 Revert running AS in internal mode
Patch isn't needed anymore, because it was resolved in Android Studio.

Reverts: 11bcd84f57
2018-11-22 13:07:58 +03:00
Nikolay Krasko
dfa0ca1192 Some better colours for unmatched elements (KT-18089)
Platform requires a single color for both selected/not-selected item and
so colour selection isn't easy (see https://youtrack.jetbrains.com/issue/IDEA-191959
for details)

 #IDEA-191959 Fixed
2018-11-22 13:07:57 +03:00
Mikhail Glukhikh
d50c4d7211 Fix failing IR tests because of CCE in WrappedValueParameterDescriptor
In previous commits, renderValueParameter began to calculate its
containing declaration. However, WrappedValueParameterDescriptor
assumes that parent of IrParameter is IrFunction, which is not true
for dispatch receiver parameters. The correct fix would be not to create
WrappedValueParameterDescriptor for dispatch receivers at all and use
WrappedReceiverParameterDescriptor instead. In this fix, I just moved
parameter' containing declaration calculation inside specific option
which is usually false, thus hiding the found problem.
2018-11-22 13:03:05 +03:00
Andrey Uskov
22830ebbf8 Disable irrelevant importing tests in AS 3.3 and 3.4 2018-11-22 12:52:04 +03:00
Andrey Uskov
ef6aae0f4a Migrate importing tests to new configuration management 2018-11-22 12:51:47 +03:00
Andrey Uskov
903a048fcd Enabled tests for gradle 4.9 2018-11-22 12:51:33 +03:00
Andrey Uskov
0fd9e06f8a Fix import tests after KT-27832 2018-11-22 12:51:20 +03:00
Nikolay Krasko
9a79f43a50 Restore support for 173 branch 2018-11-22 11:25:56 +03:00
Nikolay Krasko
3e11fc1824 Extract common pattern in KotlinShortNamesCache and more arrays reuse 2018-11-22 11:25:55 +03:00
Nikolay Krasko
175ed533ee Implement another method in KotlinShortNamesCache with processor 2018-11-22 11:25:53 +03:00
Nikolay Krasko
98c6b6837a Rewrite fetching methods in KotlinShortNamesCache with processor 2018-11-22 11:25:50 +03:00
Nikolay Krasko
25fff006ef Minor: rearrange and add regions in KotlinShortNamesCache 2018-11-22 11:25:48 +03:00
Nikolay Krasko
001d4875c8 Rewrite fetching fields in KotlinShortNamesCache with processor 2018-11-22 11:25:47 +03:00
Nikolay Krasko
21ea17b398 Rewrite processClassesWithName with processors 2018-11-22 11:25:45 +03:00
Nikolay Krasko
0ffec69d12 Use processors in KotlinShortNamesCache and remove deprecated methods 2018-11-22 11:07:05 +03:00
Dmitry Petrov
7dd906db44 KT-28324 More exact startOffset for function/constructor declarations
Function/constructor declaration start offset is the start offset of the
corresponding declaration token, if available.
2018-11-22 10:09:31 +03:00
Sergey Rostov
dfe662364d JPS, minor: remove unused parameter 2018-11-22 08:40:32 +03:00
Sergey Rostov
f70d01f657 Fix updating complementary files map in case of compilation errors
#KT-27868 Fixed

Previously given dirtyFiles was removed from complementaryFilesMap
exactly on call of clearComplementaryFilesMapping. This causes fail
of next build in case of compilation error of previous build on JPS
(since complementary files not known on second build). The right way
to do it is removing (replacing) them only after successful
build.

This was working on Gradle since Gradle rebuilds whole module (project)
in case of build error.
2018-11-22 08:40:32 +03:00
Sergey Rostov
cc9892a27d JPS: Add tests for mpp complementary files tracking after build error (KT-27868) 2018-11-22 08:40:32 +03:00
Sergey Rostov
84d6c1df5a Add assertion for overwriting common sources flag
Wrong flag state causes compilation errors for optional expectation
(this flag is used to pass -Xcommon-sources)
2018-11-22 08:40:32 +03:00
Sergey Rostov
5a25d3ef58 Workaround for KT-28099 Duplicated dependency to common module
Duplicated dependencies causes duplicated source roots which in turns
causes duplicated files dirty state tracking.
2018-11-22 08:40:31 +03:00
Nicolay Mitropolsky
daef6f09b9 183: IdeaKotlinUastResolveProviderService.kt.183 compilation fix 2018-11-21 18:55:07 +03:00
Nicolay Mitropolsky
ebefcd476f 183: CliKotlinUastResolveProviderService.kt.183 compilation fix 2018-11-21 18:12:44 +03:00
Mikhail Glukhikh
914620fd1f FIR: introduce status & status transformer (no override resolve)
So #KT-24021 Fixed
2018-11-21 18:04:15 +03:00
Mikhail Glukhikh
65d89a61bf FIR: constructor refactoring, now there are callable members 2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
a07b9a70f7 FIR builder: do not generate implicit types for getters 2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
dadc028884 FIR: support delegated types in secondary constructors
So #KT-24088 Fixed
2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
c06b0efdfa FIR: add implicit primary constructors, add delegated types to them
So #KT-24088 In Progress
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
1c6490a1be FIR: Fix resolution of type parameter in ext property receiver
Also cleanup FirTypeResolveTransformer
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
6bca2d1045 FIR: Get rid of delegation in resolved imports
This prevents strange visitors behaviour
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
e010a96055 FIR: Fix super-type nested qualifier resolution 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
06cb24db7c FIR builder: do various stub-based optimizations #KT-24090 Fixed 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
73235885e7 FIR: get rid of FirUnitType in default setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
c2686872ae FIR: use implicit Unit type in setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
bcb27f212c FIR: support resolve of implicit Unit types 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
65f1a6c041 FIR: introduce FictitiousFunctionSymbol making it not FIR-based 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
5cdf938902 FIR: temporary implementation of kotlin.FunctionX resolve 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
82ae3f8f10 FIR resolve: add nested companion scope #KT-24095 Fixed 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
98abe08056 Add Java symbol resolve in default star importing scope
Related to KT-24098
2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
5c572aa56e Add java.lang & kotlin.jvm to default star importing scope 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
b58e372db3 FIR: include properties from primary constructors in tree 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
e2cec9125d FIR: resolve annotations on value & type parameters 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
78d45f3f90 FIR: resolve constructor delegated calls (types are all error yet) 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
ea86c3d2b3 FIR: resolve bounds of function type arguments 2018-11-21 18:04:11 +03:00
Simon Ogorodnik
6c3fe5dc98 FIR: refactor cone types (arguments, projections) 2018-11-21 18:04:11 +03:00
Simon Ogorodnik
02bedeca05 FIR: introduce Java type resolve and JavaSymbolProvider #KT-24098 Fixed 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
5c53bdb142 FIR: support inline classes + render class attributes nicer 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
124c11df08 FIR: support lateinit properties 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
7279d696d2 FIR: support annotation resolve & rendering 2018-11-21 18:04:10 +03:00
Mikhail Glukhikh
c31513837b FIR: fix resolve of function type & its parameters in supertype position 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
6cfe935c2a FIR: Switch to | in fir resolved type renderer
Otherwise it clashed with qualified names
2018-11-21 18:04:10 +03:00
Simon Ogorodnik
4fb321fa00 FIR: Support function type resolve #KT-24092 Fixed 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
0ea1a5b30f FIR: Various random optimization 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
140120abc2 FIR: Optimize iteration 2018-11-21 18:04:10 +03:00
Mikhail Glukhikh
cce741eef8 FIR: partial function type resolve + some rendering fixes 2018-11-21 18:04:09 +03:00
Simon Ogorodnik
29ee4371d0 FIR: Optimize fqName creation in ImportResolveTransformer 2018-11-21 18:04:09 +03:00
Simon Ogorodnik
8a5a43d670 Add IDEA action to show raw FIR of currently opened file
This action works correctly with fir.enabled=true in Gradle properties
2018-11-21 18:04:09 +03:00
Toshiaki Kameyama
e5f0f2489f Introduce backing property: fix false positive for const property #KT-28341 Fixed 2018-11-21 17:51:34 +03:00
Andrey Uskov
7080559cb4 Remove empty build.gradle.kts.191 2018-11-21 17:37:16 +03:00
Nicolay Mitropolsky
0ee98a8d1d 183: Uast: multiresolve (KT-27244) 2018-11-21 17:24:14 +03:00
Leonid Startsev
2e83ec1551 Restrict auto-implementing serializers methods to certain type of classes 2018-11-21 16:00:04 +03:00
Leonid Startsev
1535426a11 Don't add GeneratedSerializer as a supertype for user-defined serializers 2018-11-21 16:00:03 +03:00
Leonid Startsev
a3e34af2f1 Increase priority of overridden serializer on type
Fixes Kotlin/kotlinx.serialization/252
2018-11-21 16:00:02 +03:00
Leonid Startsev
127ceaca34 Fix commented check when generating descriptor initializer:
It was needed before `save` because save references symbol of initializer,
yet we don't need to generate it if user provided its own getter
2018-11-21 16:00:01 +03:00
Leonid Startsev
b76116a077 Do not add any .childSerializers() stuff if user explicitly marked custom serializer as KSerializer
todo: better design for user-provided descriptors and and schema hierarchy
2018-11-21 16:00:00 +03:00
Leonid Startsev
80c262ec66 Fix instantiation of generic serializers on JS
(Kotlin/kotlinx.serialization/244, which was fixed already by lookuping descriptor, but still had a bug)
2018-11-21 15:59:59 +03:00
Leonid Startsev
a163e62f5f Rebased on master, adopt to new constant values from deserialized
annotations
Fix issue with generating redundant constructors for custom generic
seralizers
2018-11-21 15:59:58 +03:00
Leonid Startsev
2444a6680e .shouldEncodeElementDefault for JVM 2018-11-21 15:59:57 +03:00
Leonid Startsev
662e918a7b Support skipping values equals to defaults in output stream for JS and IR backends 2018-11-21 15:59:56 +03:00
Leonid Startsev
dba6396e95 Support enums according to new design 2018-11-21 15:59:55 +03:00
Leonid Startsev
f101e17dfa Support reference array and context serializers
Enum serializers are also instantiated, but won't work on native because of lack of KClass<E: Enum<E>>.enumValues()
2018-11-21 15:59:54 +03:00
Leonid Startsev
ef42201b05 Fix order of overriding @Serializable(with) on property: check override, than @ContextualSerialization.
This will apply Context serializer event if class annotated @Serializable
2018-11-21 15:59:53 +03:00
Leonid Startsev
abb8e5e914 Support @Transient properties initializers and init blocks in IR plugin 2018-11-21 15:59:52 +03:00
Leonid Startsev
104368de3b Better lookup for serializer() function in companion for generic classes because user can define a parameterless shorthand one
Fixes Kotlin/kotlinx.serialization/#228
2018-11-21 15:59:51 +03:00
Leonid Startsev
077f51e2f4 Generics serialization in IR 2018-11-21 15:59:50 +03:00
Leonid Startsev
a4a1df0a81 Add information about secondary constructors to synthetic classes.
Before this, descriptors for such constructors were created in-place where they needed by the codegens.
However, presence of symbol table in IR backend requires the single instance of constructor descriptor across all compilation to be able to reference it and create a symbol. This support of generics in kotlinx.serialization on Kotlin/Native.
2018-11-21 15:59:49 +03:00
Leonid Startsev
01d3c7bdc8 Descriptors for IR 2018-11-21 15:59:48 +03:00
Leonid Startsev
3010814327 .childSerializers for JS 2018-11-21 15:59:47 +03:00
Leonid Startsev
baf8cb6e9b Replace imported serialization-ide.jar with serialization-compiler.jar so JPS build also start working 2018-11-21 15:59:46 +03:00
Leonid Startsev
e40383b1ce Introduce GeneratedSerializer and childSerializers
Descriptors passing on JVM
2018-11-21 15:59:45 +03:00
Leonid Startsev
f0e81c6eb8 Respect @ContextualSerialization on file
Add common ancestor to all serializable generators
2018-11-21 15:59:44 +03:00
Leonid Startsev
82fa152514 Remove auto-applying ContextSerializer 2018-11-21 15:59:43 +03:00
Nicolay Mitropolsky
0cfce8bd99 Evaluating string constants in injections in String Interpolations (KT-25906) 2018-11-21 15:37:57 +03:00
Mikhail Glukhikh
0489efc0ae Get rid of !! in getDataFlowAwareTypes #KT-28200 Fixed 2018-11-21 15:13:35 +03:00
Mikhail Glukhikh
5385efd7d7 Do not start import fixes in write action because pop-up is possible
I was not able to reproduce the issue. However, according the rules
quick-fixes working with pop-ups should not start in write action
#KT-28196 Fixed
2018-11-21 15:13:22 +03:00
Mikhail Glukhikh
1585461a68 Fix create expected for classes with anonymous initializers 2018-11-21 15:13:02 +03:00
Mikhail Glukhikh
99388c304f Fix create expected for non-actual nested class case 2018-11-21 15:13:02 +03:00
Mikhail Glukhikh
a4214f13c8 Forbid create expected on class member when class has no expected itself
Related to KT-27075
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
8b7c7dbe25 Create expected quick-fix: check types accessibility before creation
Related to KT-27075
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
f31428257d Add a set of new tests for KT-27075 (create expected class) + some fixes 2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
4ab4358d22 OverrideMemberChooserObject cleanup: remove forceAbstract (function gen) 2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
2277dcc76f Introduce quick-fix "create expected class / function / property"
#KT-27075 Fixed
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
5c6f776c09 Add actual: handle already existing declarations more precisely
#KT-23693 Fixed
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
46a5d76254 Create actual: add delegation to secondary constructor, if needed
#KT-26518 Fixed
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
90a2f70fd1 Use OverrideMemberChooserObject to generate also primary constructors
Relates to KT-27093 and similar problems
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
cd041cca71 Use OverrideMemberChooserObject to generate also abstract actual decls
Relates to KT-27093 and similar problems
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
3612c2983e Use OverrideMemberChooserObject to generate actual decls in quick-fixes
This can fix a lot of issues related to inexact generation, in particular
#KT-27093 Fixed
2018-11-21 15:12:59 +03:00
Sergey Rostov
5645b6c1b7 Add upsource IDEA plugin shared configuration 2018-11-21 14:36:20 +03:00
Dmitry Petrov
b3ce2eea39 Add LanguageVersionSettings to KotlinTypeMapper
KotlinTypeMapper clients should use proper LanguageVersionSettings when
possible.
2018-11-21 12:01:41 +03:00
Yan Zhulanow
5636227857 Android Extensions: Use lazy package fragment descriptors only in IDE 2018-11-21 12:34:01 +09:00
Yan Zhulanow
4f3f813b32 Android Extensions: Make AndroidPackageFragmentProviderExtension lazy 2018-11-21 12:34:01 +09:00
Yan Zhulanow
6f8d44750a Android Extensions: analyze layout XMLs lazily 2018-11-21 12:34:01 +09:00
Yan Zhulanow
12a05e0006 Android Extensions: Use smart pointers in 'AndroidResource' 2018-11-21 12:34:01 +09:00
Ilya Gorbunov
3d2a3cddff Stop producing empty kotlin-stdlib-coroutines jar 2018-11-21 03:42:27 +03:00
Simon Ogorodnik
bc7ef66a28 Fix codeStyleSettings damaged test failure properly 2018-11-20 22:13:06 +03:00
Alexander Udalov
67bc8d62fc Do not store JVM reflection objects by soft reference
Otherwise they might be garbage-collected before being made accessible
with `isAccessible = true` and the reflective call.

Also, compute BoxUnboxData in InlineClassAwareCaller right away, to
prevent storing a hard reference on the descriptor (all descriptors and
related data are stored by soft references in kotlin-reflect).

 #KT-27585 Fixed
2018-11-20 17:54:01 +01:00
Mikhail Zarechenskiy
9d2524a790 Fix failing test because of lack of inference annotation
LINENUMBER was incremented because of added import
2018-11-20 19:36:50 +03:00
Mikhail Zarechenskiy
761cf0812b Minor: add test for obsolete issue
#KT-8050 Obsolete
2018-11-20 19:36:50 +03:00
Mikhail Zarechenskiy
7327928449 Refactoring: extract common code into the method 2018-11-20 19:36:50 +03:00
Ilmir Usmanov
fda0901b39 Remove usages of kotlin-stdlib-coroutines.jar in tests 2018-11-20 19:09:27 +03:00
Igor Chevdar
2f3ff60abc Fixed bug with fake overridden functions with defaults 2018-11-20 12:11:29 +03:00
Toshiaki Kameyama
c49770d9a7 Unused symbol: don't report for type parameter in open class #KT-23639 Fixed 2018-11-20 11:18:18 +03:00
Toshiaki Kameyama
bc4d353134 Unused symbol: fix message for interface #KT-28286 Fixed 2018-11-20 11:14:45 +03:00
Matthew Runo
56d354223e Updated suggested issues link to only query the KT project rather than all projects. 2018-11-20 10:52:14 +03:00
Matthew Runo
08d70cbfe8 Update to better describe first time import of project. Changed URL for up for grabs to filter to only show Open issues. 2018-11-20 10:52:14 +03:00
Dmitry Petrov
3efb07bf7b Return kotlin ctor mapped to a java ctor even if java ctor is synthetic
This allows working with constructors with inline class parameters using
Kotlin reflection, as described in
https://youtrack.jetbrains.com/issue/KT-27429#focus=streamItem-27-3161148-0-0

 #KT-27913
 #KT-27429
2018-11-20 09:53:18 +03:00
Dmitry Petrov
9082f19c00 KT-25907: Use proper loop parameter type in for-in-CharSequence 2018-11-20 09:52:09 +03:00
Natalia Selezneva
b8086d9093 Do not start multiple background threads loading dependencies for different scripts
^KT-27743 Fixed
2018-11-20 08:51:03 +03:00
Natalia Selezneva
8ce63f6567 Fix extension for ErrorGradleScriptDefinition 2018-11-20 08:48:58 +03:00
Nikolay Krasko
5ab812e29e Enlarge scope for auto-import and completion with extensions (KT-27944)
Android R classes provided with scope enlarger and they can be found
during resolve, but ignored during auto-import search.
2018-11-19 16:47:21 +03:00
Nikolay Krasko
be92c5e787 Return back to using Exec task instead of JavaExec for serializing builtins
Idea patches all JavaExec tasks and enables debugger for them. This
causes unexpected breakpoints stops during serialization (IDEA-200192).

An attempt with explicit removing added agentlib:jdwp= parameter breaks
Gradle up-to-date check for this task:

> Task ':core:builtins:serialize' is not up-to-date because:
>   Value of input property 'jvmArgs' has changed for task ':core:builtins:serialize'

Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-11-19 15:06:36 +03:00
Denis Zharkov
580d03be5f Support JvmWildcard/JvmSuppressWildcard in ultra-light classes
The idea is reusing logic from KotlinTypeMapper for that
2018-11-19 14:40:51 +03:00
Denis Zharkov
ce3b489fa9 Avoid using CheckSignatureAdapter in ultra-light classes 2018-11-19 14:40:51 +03:00
Denis Zharkov
037ad2923c Minor. Rename parameter in KtUltraLightClass::asJavaMethod 2018-11-19 14:40:51 +03:00
Denis Zharkov
e15e82e1a9 Refactor KotlinType::asPsiType for ultra-light classes
- Extract HOF that UltraLightSupport::mapType that allows to call
arbitrary functions of type mapper
- Use it for computing return type of functions
- "declaration: KtDeclaration" parameter became unused since it was only
used for return types
2018-11-19 14:40:51 +03:00
Egor Ushakov
06d91fd95f use CharSequence methods where available (KOTLIN-CR-2456) 2018-11-19 13:06:40 +03:00
Toshiaki Kameyama
35cc6ff495 Keyword completion: add 'val' after 'const' #KT-27916 Fixed 2018-11-19 11:51:45 +03:00
Natalia Selezneva
1b715ab253 "Add non-null asserted (!!) call": Fix for array access expression (KT-27071)
^KT-27071 Fixed
2018-11-19 11:09:32 +03:00
Dmitry Petrov
90da274eaa KT-28054: Treat inline class constructor accessors specially 2018-11-19 09:42:03 +03:00
Mikhail Zarechenskiy
3a93cab3b6 Mark JVM specific test with TARGET_BACKEND directive
This is needed to avoid test failing for Kotlin/Native
2018-11-17 22:55:18 +03:00
Ilya Chernikov
c05c46d50f Convert to release coroutines (kotlinx-coroutines.1.0.1) 2018-11-17 19:24:34 +01:00
Toshiaki Kameyama
89ba7a7ae8 Make abstract: do not suggest for inline classes #KT-28268 Fixed 2018-11-17 18:07:15 +03:00
Toshiaki Kameyama
e671318653 Formatting: add line break between '{' and enum entry (KT-28227)
#KT-28227 Fixed
2018-11-17 01:26:27 +03:00
Ilya Gorbunov
7d3de70754 Correct replacement for js Math.log
The correspondent kotlin.math function is ln(x)

#KT-28251 Fixed
2018-11-17 00:20:54 +03:00
Ilya Gorbunov
e81859b50d Document exceptions that can be thrown from MatchGroupCollection.get(name) 2018-11-16 20:29:38 +03:00
Ilya Gorbunov
8d0d6d1bf3 Do not mutate Matcher in MatchResult.next()
Instead of mutating the matcher create a new one when `next()` is called.
This allows getting named groups from that matcher later.

Add lookbehind in matchSequence test to ensure this change doesn't alter
the existing behavior.

Also fixes #KT-20865
2018-11-16 20:29:38 +03:00
Ilya Gorbunov
f76c0568ea Additionally run kotlin-stdlib-jdk8 tests on jdk9 and jdk10/11 if available 2018-11-16 19:46:38 +03:00
Ilya Gorbunov
c0a7c5cff4 Refactor: use ArrayDeque instead of Stack in FileTreeWalkIterator
Cleanup modifiers, replace if with when.

#KT-27251 Fixed
2018-11-16 19:40:40 +03:00
Toshiaki Kameyama
52ca1803d3 Call chain into sequence: use registerProblemWithoutOfflineInformation() #KT-28231 Fixed 2018-11-16 18:20:40 +03:00
Nikolay Krasko
6c3f01ce2c Refactoring: move channels titles and urls to single place 2018-11-16 17:45:04 +03:00
Nikolay Krasko
bc85b531ee Include jre -> jdk library replacement to cleanup 2018-11-16 17:45:02 +03:00
Nikolay Krasko
c568ea043f Reformat parameterInfo 2018-11-16 17:45:01 +03:00
Nikolay Krasko
b1cf98d82a Reformat completion.handlers 2018-11-16 17:45:00 +03:00
Toshiaki Kameyama
8b2fef3812 Remove explicit type specification: don't propose for ext function type
#KT-8875 Fixed
2018-11-16 16:35:04 +03:00
Dmitry Savvinov
c8cbe05722 [Minor] Add even more logging for EA-119635 2018-11-16 14:46:46 +03:00
Toshiaki Kameyama
8089d2e9e3 Replace deprecated symbol usage in whole project: enable on annotation declared without parentheses #KT-12479 Fixed 2018-11-16 13:07:36 +03:00
Toshiaki Kameyama
fa51354ef9 Reformat: DeprecatedSymbolUsageInWholeProjectFix 2018-11-16 13:07:36 +03:00
Toshiaki Kameyama
75755afc00 Remove redundant spread operator: don't remove inner argument spread operator #KT-27699 Fixed 2018-11-16 13:06:25 +03:00
Toshiaki Kameyama
52c499166e Reformat: RemoveRedundantSpreadOperatorInspection 2018-11-16 13:06:25 +03:00
Denis Zharkov
aa63ad4a45 Report a warning when comparing incompatible enums
I've put `isIncompatibleEnums` to TypeIntersector because I placed
all of its usages after all of the TypeIntersector::isIntersectionEmpty ones

^KT-28225 Fixed
2018-11-16 10:36:09 +03:00
Dmitry Petrov
a0d74be7cf KT-28235: Make sure array access produces unique elements
This requires generating calls on-demand in
LValueWithGetterAndSetterCalls.
2018-11-16 10:33:30 +03:00
Dmitry Petrov
080c177ed2 Minor: formatting 2018-11-16 10:33:30 +03:00
Mikhail Zarechenskiy
090d3327c0 Use wrapper class of an inline one as a result for javaClass
#KT-28185 Fixed
 #KT-28246 Open
2018-11-16 00:55:01 +03:00
Alexander Udalov
1a2579d8e8 Minor, add test for obsolete issue
#KT-21692 Obsolete
2018-11-15 20:29:34 +01:00
Igor Chevdar
2ff87ab1ce Fixed tests on IR copier 2018-11-15 19:13:06 +03:00
Igor Chevdar
728b7b130b Removed descriptors usage from IR copier 2018-11-15 19:13:06 +03:00
Nikolay Krasko
2d1c76344c Store presence of spread operator for value argument in stubs 2018-11-15 18:55:56 +03:00
Alexander Udalov
4c64db66dc Use File.toPath instead of Paths.get+File.toURI in moduleVisibilityUtils
#KT-27930 Fixed
2018-11-15 16:51:37 +01:00
Roman Artemev
d5acc8ff5b [JS BE] Set enclosing exception state in finally block
[Fix KT-28207]
2018-11-15 18:44:22 +03:00
Denis Zharkov
353b469f4a Update bootstrap to 1.3.20-dev-1708 2018-11-15 17:17:41 +03:00
Simon Ogorodnik
ad6ae3ba48 Fix failing test for AS33 2018-11-15 16:27:57 +03:00
Simon Ogorodnik
2d514d410f Update testData due to platform changes 2018-11-15 16:27:56 +03:00
Simon Ogorodnik
6b07cd1950 Update testData due to changes in stdlib
New function equals, and kotlin.js.JsName in common
2018-11-15 16:27:20 +03:00
Toshiaki Kameyama
2a03e1b3da Leaking this: fix for 'this' in enum class #KT-15835 Fixed 2018-11-15 15:16:48 +03:00
Xavi Arias Seguí
14311e77c2 Fix typo in Kotlin doc for contract method
Fix the typo in "Specifies the contact of a function."
2018-11-15 03:58:41 +03:00
Alexander Udalov
9b07bbdf56 Do not use backslash for escaping outside of string literals in argfiles
This fixes CLI tests testArgfileWithEscaping and
testApiVersionLessThanLanguageUsingArgfile on Windows

 #KT-28180 Fixed
2018-11-14 12:53:24 +01:00
Ilya Gorbunov
607b11e6b9 Replace kotlin-stdlib-jre8 dependency with -jdk8 in 'idea' module
No API is used from -jre8 artifact and -jdk8 is required in runtime for tests
2018-11-14 14:28:34 +03:00
Ilya Gorbunov
3e72c0bece Add stdlib-jdk7/8 to Kotlin IDEA plugin classpath
Motivation: standard library dynamically loads its JDK7/8 extensions by class name.
When these extensions are missing from the plugin classloader, they are loaded by
the parent classloader thus becoming assignment incompatible with the base class.

Fixes EA-120914
2018-11-14 14:28:33 +03:00
Mikhail Glukhikh
ad4ebcd953 Do not run MPP wizard tests for AS34 (fixes test suite warning) 2018-11-14 13:14:22 +03:00
Dmitry Petrov
08f23d981b Minor: generated tests 2018-11-14 13:01:00 +03:00
Alexey Tsvetkov
5fa627c501 Add flag to enable intra-project parallel tasks
To enable parallel tasks execution within a project,
add 'kotlin.parallel.tasks.in.project=true'
to gradle.properties or local.properties file .

    #KT-28155 fixed
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
4678a00324 Always clear local state directories for non-incremental build 2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
21289722b7 Move after-compilation cleanup actions to GradleKotlinCompilerWork
Otherwise cleanup actions would run in-parallel or before
compilation when Gradle Workers are used
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
ff81a46233 Pass arguments to GradleKotlinCompilerWork in GradleKotlinCompilerWorkArguments
It's less error prone to add/remove/reorder arguments this way,
because named arguments can be used and the compiler actually
checks that all arguments are passed to GradleKotlinCompilerWorkArguments's
constructor.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
349386960e Minor: remove unnecessary return 2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
4fc05f74c3 Wrap null values into serializable optional
Otherwise worker executor fails with NPE
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
a41c2d759a Avoid catching exceptions from workers in GradleKotlinCompilerRunner
Exceptions were catched in `KotlinCompilerRunner.runCompiler`.
When the method from superclass is not used in
`GradleKotlinCompilerRunner`, the superclass does not make much sense
anymore, so I turned it into util object.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
37dfe2b608 Use Workers API for NMPP tasks
This change enables parallel execution of compile tasks in NMPP projects
within a subproject.

    #KT-28155 In Progress
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
ba5795519b Minor: move compile iteration result to daemon common
The class is used on both server and client, but it was defined in
server module.
Gradle plugin worked, because all classes are present in kotlin compiler
embeddable, but the code was red in IDE (which is correct because
Gradle plugin does not depend on daemon server module).
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
80597b6206 Update dokka to 0.9.17 2018-11-14 11:40:13 +03:00
Mikhail Zarechenskiy
35fb3ba096 Fix CCE when unboxed inline class receiver is passed to inline function
Initial problem is started in `capturedBoundReferenceReceiver` method
 where we assume that bound receiver is captured for usual call.

 Note that if method is inline then we don't pass actual name reference
 receiver, but pass special CAPTURED_RECEIVER_FIELD, which is then
 is used to find special instructions during inline and fold several
 instructions in `foldFieldAccessChainIfNeeded`.

 As a result, we got unboxed reference receiver for inline call, which
 caused CCE and to fix it we should box receiver one more time during
 inline

 #KT-28188 Fixed
2018-11-14 11:21:04 +03:00
Dmitry Petrov
99d8f2eb0c Support 'call' for primary value of an inline class
Getter of a primary value of an inline class belongs to the box class.
Its arguments should not be unboxed when the method is called.
However, its result might require boxing if it's an inline class value.

When we have an internal primary value, there's no getter method.
In fact, we can use box/unbox methods for inline class directly
(don't forget to box the result, it may be an inline class type value).

 #KT-26748
2018-11-14 09:57:51 +03:00
Alexey Tsvetkov
78ee48e1cd Minor: add missing import 2018-11-13 22:11:18 +03:00
Alexey Tsvetkov
22192e7008 Stop using experimental coroutines in kotlin-scripting-jvm-host tests 2018-11-13 21:54:36 +03:00
Alexey Tsvetkov
f2ae857780 Include tests from kotlin-scripting-jvm-host in compiler tests
Previously these tests were not executed during CI test run
2018-11-13 21:54:36 +03:00
Alexander Udalov
3bfe138dbe Support KClassValue in JavaActualAnnotationArgumentExtractor
#KT-22704 Fixed
2018-11-13 19:05:14 +01:00
Alexander Udalov
49d6a7a7cb Refactor and improve code obtaining actual Java annotation parameter values
Extract Java-specific code into module 'frontend.java' and use already
existing JavaAnnotationArgument facilities to determine the default
parameter value in an actual Java annotation class.

Annotation arguments are not yet supported because to create an instance
of AnnotationValue, we need a descriptor, which is not available at this
point.

 #KT-22704 In Progress
 #KT-28077 Open
2018-11-13 19:05:14 +01:00
Ricardo Meneghin Filho
c08540175b Allow expect annotations with actual typealias to Java have default arguments 2018-11-13 19:05:14 +01:00
Andrey Uskov
53414aca87 Cache module dependencies on project import
#KT-27832 Fixed
2018-11-13 20:46:42 +03:00
Nikolay Krasko
daa54978d1 Do not fail in diagnostic code 2018-11-13 19:38:03 +03:00
Nikolay Krasko
eb45848beb Update to AS 3.3 16 2018-11-13 19:38:03 +03:00
Vyacheslav Gerasimov
dee2449ee1 Build: Fix idea sources import broken during upgrade to gradle 4.10
#KT-28030 Fixed
2018-11-13 18:36:05 +03:00
Vyacheslav Gerasimov
022691384a Build: Minor refactoring intellij-sdk build.gradle.kts 2018-11-13 18:36:02 +03:00
Mikhail Zarechenskiy
45541296ad Stop building separate jar with unsigned types
Now this is not needed as unsigned types were merged into stdlib
2018-11-13 15:47:06 +03:00
Fedor Korotkov
797784ff34 [idea-gradle] improved transitive resolution
Fixed BFS. We need to either mark dependency nodes as visited after adding them to the queue or double check if a node has been already processed.
2018-11-13 14:27:30 +03:00
Mikhail Zarechenskiy
d28488eaed Remove WITH_UNSIGNED directive from tests
#KT-25226 Fixed
2018-11-13 11:48:32 +03:00
Toshiaki Kameyama
cbaa8e5be2 Remove single lambda parameter declaration: fix false positive on property with implicit type #KT-23134 2018-11-13 10:42:16 +03:00
Aleksei Semin
793cac02e8 Add inspection and quick-fix to remove empty parentheses in annotation entries 2018-11-13 10:38:08 +03:00
Toshiaki Kameyama
e903b2f92a Unused symbol: don't report for finalize() method #KT-13311 Fixed 2018-11-13 10:26:06 +03:00
Mikhail Glukhikh
503f061c8c Forbid suggesting "iterate over" on expression with Nothing type
#KT-14555 Fixed
2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
1e0746ebcd Unused symbol: handle internal constructor used in Java #KT-27708 Fixed 2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
da39d45cb1 Add more "non properties" for atomic classes #KT-25953 Fixed 2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
92bbf885f7 "Generate member" actions: do not show any dialogs for expect class
Related to KT-27595
2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
b15b993b26 Reformat: "Generate member" actions 2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
cb28387da4 Fix KNPE in different "Generate members" for expect class
#KT-27595 Fixed
2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
38c3f13b12 Remove unnecessary main arguments from MPP wizard builders 2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
a04321478d Fix isEffectivelyActual to work with constructors correctly 2018-11-13 10:15:47 +03:00
Mikhail Glukhikh
589b377ef3 Minor: remove unused parameter in both buildNavigate to markers 2018-11-13 10:15:47 +03:00
Mikhail Glukhikh
d7d1b0420d Do not show non-actual members in actual gutter #KT-27951 Fixed 2018-11-13 10:15:47 +03:00
Nicolay Mitropolsky
4a64edd610 KotlinStringLiteralTextEscaper: provides offsets for already decoded (KT-27380) 2018-11-13 10:01:52 +03:00
Nicolay Mitropolsky
6342bc378e KotlinLanguageInjector: removing kotlin.annotation.injection.enabled key 2018-11-13 10:01:51 +03:00
Natalia Selezneva
a8b55740a1 Scratch: include all related module dependencies in ScriptModuleInfo
^KT-28094 Fixed
2018-11-13 08:47:19 +03:00
Natalia Selezneva
4661ab9961 Fix loading Kotlin Scripting options from kotlinScripting.xml
^KT-28046 Fixed
2018-11-13 08:47:19 +03:00
Natalia Selezneva
da71a35187 Update highlighting in UI thread 2018-11-13 08:47:19 +03:00
Natalia Selezneva
372daa0463 Do not attach script report if they didn't changed 2018-11-13 08:47:19 +03:00
Natalia Selezneva
ad43c2dc1c Simplify logic in ScriptDependenciesLoader 2018-11-13 08:47:18 +03:00
Natalia Selezneva
18c9d968f9 Pass ResolveResult to ScriptNotificationPanel 2018-11-13 08:47:18 +03:00
Mikhail Zarechenskiy
ed2b9172da Support unsigned integers in kotlinx-metadata-jvm
#KT-25371 Fixed
2018-11-13 01:29:39 +03:00
Andrey Uskov
dac4cb5d06 Fix source sets in all bunches except AS 33 in idea-android 2018-11-12 21:23:14 +03:00
Simon Ogorodnik
7f5f6ad76f Update QuickDoc testData due to platform changes 2018-11-12 20:56:26 +03:00
Alexander Udalov
a2612c1eae Fix generic signature for KSuspendFunction types in bytecode
#KT-27560 Fixed
2018-11-12 18:53:23 +01:00
Andrey Uskov
7b0c7ec400 Get rid of bunch 191 for build scripts (Continuation of "Replace bunch copies for some of build.gradle.kts files with a DSL") 2018-11-12 17:43:20 +03:00
Sergey Igushkin
308eafe0e1 (test data) Revert removal of coroutines opt-in from a test
This test checks the coroutines opt-in, so it should stay there.

Revert the change made in a64a76d5
2018-11-12 17:26:07 +03:00
Mikhail Zarechenskiy
79159947a5 Coerce last value of delegated expression for inline classes
Note that this commit doesn't fix case when some inline class over
 `Any` is returned from a lambda, it'll be fixed further as part of the
 #KT-27586

 #KT-27737 Fixed
2018-11-12 14:21:24 +03:00
Mikhail Zarechenskiy
a97867ccb8 Add test for obsolete issue
#KT-23531 Obsolete
2018-11-12 14:12:59 +03:00
Nikolay Krasko
9dab32f67d Re-implement getBodyBlockExpression() in stubbed elements
Avoid delegation to getBodyExpression() to monitor AST loading abuses.
2018-11-12 13:38:29 +03:00
Nikolay Krasko
2284028bbe Add bodyBlockExpression() helper function to KtDeclarationWithBody 2018-11-12 13:38:28 +03:00
Nikolay Krasko
2b8a81c5a8 Don't force getting body psi if null is predicted by stubs but allow it for resolve
We can't avoid loading AST in general, because there're no stubs for
expression bodies.
2018-11-12 13:38:27 +03:00
Nikolay Krasko
e2269e13af Move AstLoadingFilter to incompatible API and update usages 2018-11-12 13:38:26 +03:00
Nikolay Krasko
02d7e701d0 Allow getting initializer from psi during resolve as there're no stubs 2018-11-12 13:38:25 +03:00
Nikolay Krasko
d1e7229b7a Allow getting operation node in annotation qualified expressions for now 2018-11-12 13:38:24 +03:00
Nikolay Krasko
ff9477554f Do not check and load psi for modifier list with stub 2018-11-12 13:38:22 +03:00
Nikolay Krasko
04559800f1 Ignore reporting "literal prefixes and suffixes" for stubbed elements 2018-11-12 13:38:21 +03:00
Nikolay Krasko
710f3e8551 Make an excuse for contracts for loading psi for now 2018-11-12 13:38:20 +03:00
Nikolay Krasko
349f1e2e6a Update to AS 3.3 14 2018-11-12 13:38:19 +03:00
Nikolay Krasko
11bcd84f57 Disable internal mode in AS 3.3 and AS 3.4 to avoid using core class loader
Core class loader doesn't include Kotlin plugin dependencies and Kotlin
plugin becomes unusable (for example Gradle sync always fail).

https://issuetracker.google.com/issues/119250571
2018-11-12 13:38:18 +03:00
Nikolay Krasko
01bea14f09 Allow to fetch name for mock virtual machine to fix tests in 183 2018-11-12 13:38:17 +03:00
Mikhail Zarechenskiy
021732f74a [NI] Consider type non-nullable only if it has non-null supertype
Fixes #KT-12684 for NI
2018-11-12 12:42:03 +03:00
Mikhail Zarechenskiy
20ff74a726 Fix mapping for inline classes when JvmSuppressWildcards mode is using
#KT-28097 Fixed
2018-11-12 09:36:05 +03:00
Pavel V. Talanov
24f1db811a Fix running JUnit test method in abstract class
Previously led to running all methods in an inheritor class
Untested because behaviour is rare and we don't have test covering JUnit run configuration

 #KT-28080 Fixed
2018-11-09 15:51:36 +01:00
Pavel V. Talanov
aae023909d Minor: refactor KotlinJUnitRunConfigurationProducer
Clarify 'getTestMethod' and 'onFirstRun' functions
2018-11-09 15:51:35 +01:00
Pavel V. Talanov
47935c19e6 Show line markers for JUnit test methods in abstract class
#KT-27977 Fixed
2018-11-09 15:51:34 +01:00
Ilya Chernikov
9c51f521a9 Add embeddable version of the jvm scripting host
#KT-27382 fixed
2018-11-09 15:57:09 +03:00
Toshiaki Kameyama
d64ca8a8f9 Insert paird brackets: enable on before colon #KT-9840 Fixed 2018-11-09 15:15:59 +03:00
Ilya Gorbunov
5f4e8bf4fb Correct abstract mutable collections declarations in kotlin-stdlib-common
Add SinceKotlin(1.3) to the new and substantially changed common declarations

#KT-28091
2018-11-09 13:39:44 +03:00
Ilya Gorbunov
4f2ec3533a Remove inline modifier from expect functions without lambda or reified types
This gives more flexibility when providing actuals for them.
2018-11-09 13:39:07 +03:00
Mikhael Bogdanov
3e26f17e9d Update proguard config for AS 34 2018-11-09 10:30:00 +01:00
Denis Zharkov
fadd2c12c2 Update idea to 2018.2.6 RC (182.5107.16) 2018-11-09 11:59:25 +03:00
Toshiaki Kameyama
2683b25728 "Change type" quick fix: fix false negative in 'when' branch #KT-8820 Fixed 2018-11-09 11:09:02 +03:00
Dmitry Petrov
6d0a403ead KT-26765: Support 'call' for constructors with inline class parameters 2018-11-09 10:21:46 +03:00
Ilya Gorbunov
23ead5e430 Remove extensive testing of the discontinued jre7/8 artifacts 2018-11-09 04:00:26 +03:00
Ilya Gorbunov
b026b9eb22 Remove +ReleaseCoroutines explicit feature enabling
It's enabled by default in Kotlin 1.3
2018-11-09 04:00:26 +03:00
Ilya Gorbunov
a64a76d5fc Remove experimental coroutines opt-in from build scripts
It has no effect in Kotlin 1.3

Only enable coroutines if '-ReleaseCoroutines' is used
2018-11-09 04:00:26 +03:00
Ilya Gorbunov
ea0030f324 Actualize Deprecated annotation and DeprecationLevel enum docs
...to clear some confusion from KT-25643.
Describe level property usage scenario in detail.
2018-11-08 19:39:41 +03:00
Roman Artemev
8f2117685f [JS BE] Support contracts in JS Fix KT-27946 2018-11-08 17:35:06 +03:00
Roman Artemev
b010d9eef8 Add Contract tests for JS 2018-11-08 17:35:06 +03:00
Mikhail Glukhikh
caad0d5a74 ExposedVisibilityChecker refactoring: make trace BindingTrace 2018-11-08 17:16:06 +03:00
Mikhail Glukhikh
d464b441c8 ExposedVisibilityChecker refactoring: extract 'reportExposure' 2018-11-08 17:16:06 +03:00
Mikhail Glukhikh
b3857e85e0 Report exposed type for properties in class primary constructor
Before this commit, we compared property visibility with constructor
visibility only, which is incorrect. Now we compare property visibility
also with class visibility

#KT-19613 Fixed
2018-11-08 17:16:06 +03:00
Mikhael Bogdanov
f160eabaf6 Switch snapshot to exact IDEA 183 dependency 2018-11-08 13:47:17 +01:00
Mikhael Bogdanov
e8db36e2f1 Update dependencies for AS34 2018-11-08 13:47:16 +01:00
Simon Ogorodnik
cf9b2e6377 Fix potential CCE in LightCodeInsight tests in non-JVM 2018-11-08 15:31:30 +03:00
Simon Ogorodnik
f40cc2eb3f Fix CCE in JSBasicCompletionTest 2018-11-08 15:31:29 +03:00
Denis Zharkov
d74c12323f Fix ambiguity when KtUltraLightClass contains overrides
#KT-27987 Fixed
2018-11-08 15:25:41 +03:00
Denis Zharkov
234776820b Use KotlinLightReferenceListBuilder for type parameters bounds
It doesn't run resolve() on freshly added reference, thus the latter is
not failing in recursive case like T : Enum<T>
2018-11-08 15:25:41 +03:00
Denis Zharkov
a4cc67d0a0 Refine isInlineOnly check in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
34f9a1e70e Do not build no-arg constructor overload for inner KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
8999a21764 Refine visibility computation for lateinit's field in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
99afc40d93 Use ModuleDescriptor::stableName for mangling in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
6fc8c98aea Avoid calling PsiType::resolve while adding supertype references
Otherwise, e.g. in case of inner classes it may lead to
StackOverflowError:
- Someone tries to resolve supertypes
- We're starting building extends/implements lists
- Then calling resolve on the type references leads that some logic
in Java resolution again is trying to resolve supertype of the same
class (only in case of inner ones)

Probably, it could be fixed on the side of Java resolve
but at the same time it's clear that calling `resolve` while building
extends list it's really somewhat not very cool

The exception is following:
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:77)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:73)
	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.get_extendsList(KtLightClassForSourceDeclaration.kt)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.getExtendsList(KtLightClassForSourceDeclaration.kt:320)
	at com.intellij.psi.impl.PsiClassImplUtil.getExtendsListTypes(PsiClassImplUtil.java:1017)
	at com.intellij.psi.impl.light.AbstractLightClass.getExtendsListTypes(AbstractLightClass.java:137)
	at com.intellij.psi.impl.ScopedClassHierarchy.getSuperTypes(ScopedClassHierarchy.java:95)
	at com.intellij.psi.impl.ScopedClassHierarchy.visitType(ScopedClassHierarchy.java:80)
	at com.intellij.psi.impl.ScopedClassHierarchy.getSuperClassSubstitutor(ScopedClassHierarchy.java:115)
	at com.intellij.psi.impl.JavaClassSupersImpl.getSuperSubstitutorWithCaching(JavaClassSupersImpl.java:111)
	at com.intellij.psi.impl.JavaClassSupersImpl.getSuperClassSubstitutor(JavaClassSupersImpl.java:71)
	at com.intellij.psi.util.TypeConversionUtil.getMaybeSuperClassSubstitutor(TypeConversionUtil.java:1089)
	at com.intellij.psi.util.TypeConversionUtil.getClassSubstitutor(TypeConversionUtil.java:1055)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.advancedResolveImpl(ClsJavaCodeReferenceElementImpl.java:143)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.access$000(ClsJavaCodeReferenceElementImpl.java:43)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl$Resolver.resolve(ClsJavaCodeReferenceElementImpl.java:121)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl$Resolver.resolve(ClsJavaCodeReferenceElementImpl.java:115)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$1(ResolveCache.java:203)
	at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:99)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:202)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.multiResolve(ClsJavaCodeReferenceElementImpl.java:223)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.advancedResolve(ClsJavaCodeReferenceElementImpl.java:213)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:191)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:138)
	at org.jetbrains.kotlin.asJava.classes.LightReferenceListBuilder.addReference(LightReferenceListBuilder.java:53)
	at org.jetbrains.kotlin.asJava.classes.KtUltraLightClass.createExtendsList(ultraLightPsi.kt:91)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:77)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:73)
	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.get_extendsList(KtLightClassForSourceDeclaration.kt)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.getExtendsList(KtLightClassForSourceDeclaration.kt:320)
	at com.intellij.psi.impl.PsiClassImplUtil.getExtendsListTypes(PsiClassImplUtil.java:1017)
	at com.intellij.psi.impl.light.AbstractLightClass.getExtendsListTypes(AbstractLightClass.java:137)
	a
2018-11-08 15:25:41 +03:00
Denis Zharkov
34e8ce6a48 Fix data race in LightReferenceListBuilder
Effectively this is a cherry-pick of
7503200869
2018-11-08 15:25:41 +03:00
Denis Zharkov
94d9fd8b72 Add our own version of LightReferenceListBuilder
There are some issues with one from the platform that may be backported
at some moment, but now it's faster to have our own implementation
2018-11-08 15:25:41 +03:00
Denis Zharkov
875e9d2a36 Fix KtUltraLightMethod::getParameterList
There's already a correct override in KtLightMethodImpl
Otherwise the tests is failing because clsDelegate.parameterList
has a wrong parent
2018-11-08 15:25:41 +03:00
Denis Zharkov
3814c7687b Add JavaAgainstKotlinSourceCheckerWithUltraLightTestGenerated 2018-11-08 15:25:41 +03:00
Denis Zharkov
5f45ab1e2b Support forcing usage of ultra-light classes in tests 2018-11-08 15:25:41 +03:00
Denis Zharkov
03e937ddfa Minor. Reformat KtLightClassForSourceDeclaration.kt 2018-11-08 15:25:41 +03:00
Svyatoslav Kuzmich
0bf3199c19 Support nullable inline classes 2018-11-08 15:00:33 +03:00
Svyatoslav Kuzmich
5ea7673950 [JS IR BE] Mute inline class tests 2018-11-08 15:00:32 +03:00
Svyatoslav Kuzmich
43b4b6eaae Add more specific fail messages in inline class box tests 2018-11-08 15:00:31 +03:00
Svyatoslav Kuzmich
370b04df35 [JS IR BE] Inline classes lowering 2018-11-08 15:00:30 +03:00
Svyatoslav Kuzmich
4866c2b36a [IR] Move irCall from JS backend to common utils 2018-11-08 15:00:09 +03:00
Svyatoslav Kuzmich
81d61aefff [IR] Specify IrType in irTemporary 2018-11-08 15:00:09 +03:00
Svyatoslav Kuzmich
dd20775662 [IR] Move IrFunction.isStatic from JS to Common 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
4f6a18e29a [IR] Update parents when transforming declaration containers 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
38b31e8f7d [JS IR BE] Fix reusing expression instances 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
47b0f94903 [JS IR BE] Fix funny safe call 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
27ff4da94d [JS IR BE] Bugfix: set overriden symbols for generated bridges 2018-11-08 15:00:08 +03:00
Pavel V. Talanov
54dc1a779e Fix test: experimental API usage error reporting in js module
Make module a js module so that test passes
2018-11-08 11:22:46 +01:00
Toshiaki Kameyama
6971ca44e7 Generate equals and hashCode: enable for data classes #KT-17502 Fixed 2018-11-08 12:51:29 +03:00
Dmitry Petrov
b5664755c8 Minor: remove IGNORE_BACKEND for passing JS_IR tests 2018-11-08 12:29:15 +03:00
Dmitry Petrov
8262d4a4b9 psi2ir: Don't generate constructor bodies for 'external' classes
#KT-27934
2018-11-08 12:29:15 +03:00
Dmitry Petrov
51002ee620 psi2ir: Handle missing "then" branches as empty blocks
#KT-27933
2018-11-08 12:29:15 +03:00
Dmitry Petrov
bd1491ac8a psi2ir: Merge constant entries in string template expressions
This is required to handle UCNs properly, see KT-28006.

 #KT-28006
2018-11-08 12:29:15 +03:00
technoir
6bb5e028a5 Multiple templates with concatenation generator should add spaces after commas (KT-27954) 2018-11-08 11:21:11 +03:00
Ilya Matveev
798b4a8164 Update Kotlin/Native: 1.0.2 2018-11-08 11:06:49 +03:00
Mikhail Glukhikh
772ae60512 Extract inspection names from GradleInspectionTest into testData 2018-11-08 11:04:04 +03:00
Mikhail Glukhikh
52815f5eb5 Extract test files from GradleInspectionTest into testData 2018-11-08 11:04:04 +03:00
Denis Zharkov
eae7e43583 Avoid redundant String allocations in JvmDescriptorTypeWriter
In most cases, jvmCurrentTypeArrayLevel == 0 and we can just use `type`
The change was initially suggested by @gorrus
2018-11-08 10:44:13 +03:00
Toshiaki Kameyama
4ae837e669 Redundant lambda arrow: fix false positive in 'when/if' without block #KT-28047 Fixed 2018-11-08 10:40:02 +03:00
Toshiaki Kameyama
0bfcfb5716 ProtectedInFinalInspection: don't report for finalize() method #KT-13311 Fixed 2018-11-08 10:37:36 +03:00
Toshiaki Kameyama
b935f52a63 ProtectedInFinalInspection: reformat 2018-11-08 10:37:36 +03:00
Toshiaki Kameyama
9c18e24de5 Change to function invocation fix: use parentheses in string template
#KT-5071 Fixed
2018-11-08 10:33:50 +03:00
Timo Obereder
3c75d46328 Correctly handle end-of-line comment in "Add braces to if"
#KT-27408 Fixed
2018-11-08 10:33:15 +03:00
Alexander Udalov
61d3b6ee1f Restore heuristic to compute inner class names in ClassifierResolutionContext
This commit restores the heuristic removed in 9df02b2366, but only
enables it in case the class wasn't found with the name mapped initially
according to the InnerClasses attribute values. This helps to support
class files which do not have the InnerClasses attribute for all nested
referenced classes, such as those generated by Groovy.

Note that in theory it's still possible for this code to behave
incorrectly, for example a reference to a class `C` nested in a
_top-level_ class named `A$B` will not be loaded by this code correctly.
This is a lower-priority issue and it will need to be fixed later.

 #KT-27874 Fixed
2018-11-07 18:12:58 +01:00
Alexander Udalov
a3231e561c Remove unneeded name-handling code in ClassifierResolutionContext
The only place where a name with dots was passed to
ClassifierResolutionContext.mapInternalNameToClassId was in
BinaryClassSignatureParser.parseParameterizedClassRefSignature, where
for some reason names can be both of internal (`a/b$c`) and canonical
(`a/b.c`) form. Supporting both names in mapInternalNameToClassId was
confusing because JVM internal names cannot contain dots. Replace dots
with dollars in parseParameterizedClassRefSignature to get rid of the
dot-name handling in mapInternalNameToClassId and rely on the correct
(simplified) InnerClasses-based name resolution later instead.

Also inline mapDescToClassId to its only usage.
2018-11-07 18:12:58 +01:00
Georgy Bronnikov
c20f93ddbf Mute failing test 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
dbfbfa65a6 Remove IrClass.isFileClass as unneeded 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
a814e4a314 IR. Remove ClassLowerWithContext
The code is never used and shows some signs of bit rot.
2018-11-07 19:09:15 +03:00
Georgy Bronnikov
1aec16ca29 JVM_IR. Remove FileClassDescriptor, no longer used 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
0a43054a92 JVM_IR. Remove descriptors from FileClassLowering 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
95fbe29350 JVM_IR: remove descriptors from JvmCoercionToUnitPatcher 2018-11-07 19:09:15 +03:00
Toshiaki Kameyama
c9477d94ad Replace if with when: fix behavior on 'else if' #KT-4645 Fixed 2018-11-07 19:02:11 +03:00
Dmitry Petrov
1523185734 KT-27948: Use proper KotlinType when comparing with literal 0
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
e14f74bc18 KT-27948: Properly coerce values when generating areEqual call
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
ac7cc0c08e KT-27706: Dispatch receiver type for constructor accessor is Object 2018-11-07 18:17:29 +03:00
Dmitry Petrov
ea4afdaebe KT-27705: Use proper types for captured outer class instance
Call typeMapper only if we have an inline class.
2018-11-07 18:17:29 +03:00
Mikhael Bogdanov
60986293bf Minor. Use until in for iterator 2018-11-07 15:42:58 +01:00
Mikhael Bogdanov
d2a205c72d Update synthetic parameter processing logic according to ASM 7 changes
#KT-27774 Fixed
2018-11-07 15:42:57 +01:00
Toshiaki Kameyama
23b9889ebb Redundant companion reference: Fix false negative in enum entry #KT-27861 Fixed 2018-11-07 17:21:41 +03:00
Monchi
07ca958ff0 Add the quickfix to add property to supertype #KT-17004 Fixed 2018-11-07 17:00:26 +03:00
Simon Ogorodnik
aa8031691e Fix picocontainer version 2018-11-07 15:16:39 +03:00
Toshiaki Kameyama
0fcd1a2072 Introduce "Delegate to 'var' property" inspection #KT-26724 Fixed 2018-11-07 13:59:00 +03:00
Alexander Udalov
17d740a373 Do not try computing return type in OverloadChecker
Return type is not needed for checking overloads, but querying it may
involve resolving function bodies, which usually happens after overload
checking (see LazyTopDownAnalyzer.analyzeDeclarations) and at this point
can lead to incorrect BACKING_FIELD_REQUIRED value being computed for
some properties (see KT-27895)

 #KT-27895 Fixed
2018-11-07 11:00:15 +01:00
Anton Bannykh
829bdf6061 JS: fix noInline version of inline suspend fun (KT-27611 fixed) 2018-11-07 12:34:00 +03:00
Toshiaki Kameyama
455db32199 "Remove parameter" quick fix: remove also type constraint
#KT-26673 Fixed
2018-11-07 12:20:35 +03:00
Anton Bannykh
59009430e5 JS: report inline suspend functions to IC
* Also inline suspend lambda'a
* Also use correct JsName's in exported suspend inline fun's
* Also use less unused imports
2018-11-07 12:11:01 +03:00
Anton Bannykh
82268cd95d JS: fix concurrent access to NameSuggestion.cache 2018-11-07 12:07:58 +03:00
Anton Bannykh
5dae00182d JS: fix suspend lambda inlining
* Also avoid casts when setting inline metadata
2018-11-07 12:07:02 +03:00
Anton Bannykh
4c5201d30e JS: fix module parameter linking 2018-11-07 12:06:09 +03:00
Mikhail Glukhikh
da02acd6e9 Fix flaky "plugin & stdlib versions different" #KT-23744 Fixed
Before this commit, kotlin-stdlib-common or -jdk8 can be accidentally
detected as kotlin-stdlib with the following strange version resolve.
Now we check for dash after name, so it's not possible.
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
fcfeb33501 Don't suggest "Implement as constructor parameters" in actual class
This applies if expect class has primary constructor declared
#KT-27791 Fixed
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
63856cff1b Fix failing GradleImportingTestCase-based tests in 183 #KT-28026 Fixed
To fix this, we say explicitly not to use qualified module names option
during Gradle import

Related to IDEA-201249
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
e597dda526 AndroidViewConstructorFix: do not reformat while creating constructor
Before this commit, it was done by createDeclarationByPattern,
preventing later reformatting in addAnnotation

Related to KT-27945
2018-11-07 11:56:54 +03:00
Toshiaki Kameyama
d0d98dc283 Redundant companion reference: fix false positive for class with name Companion #KT-27861 Fixed 2018-11-07 11:53:22 +03:00
Bradley Smith
4b8f8604f2 Change kotlinSourceSets -> allKotlinSourceSets
This ensures that transitive SourceSets are also merged and included in
the model.
2018-11-06 20:19:02 +03:00
Bradley Smith
f426fda18b Remove unused inport 2018-11-06 20:19:02 +03:00
Bradley Smith
1e37785de1 Populate the SourceSets with more relevant information. 2018-11-06 20:19:02 +03:00
Bradley Smith
f3482d1251 Register KotlinModelBuilder for kotlin-android plugin 2018-11-06 20:19:02 +03:00
Dmitry Savvinov
939b58f8f4 Fix testdata to incorrect to keep local testruns green
This test was originally written with fix for KT-22379

Lately, fix was proven to be wrong and reverted (KT-27084), which made
this test fail.

Correct solution here would be to mute test with link to YT issue, but
unfortunately we don't have infrastructure to mute tests locally (yet),
which is a major issue because this tests is a part of very popular for
local smoke-testing test suite (DiagnosticTestsGenerated).
2018-11-06 19:29:28 +03:00
Leonid Startsev
facd2d7aec Call Gradle import handlers when importing Gradle modules from new mpp plugin
This enables serialization and other plugins in IDE with new mpp
2018-11-06 16:21:32 +03:00
Simon Ogorodnik
3590d534e5 KT-24788: Fix exceptions in offline inspections
When there is severe memory load SLRUCache inside getResolutionFacade
may cause double computation of ResolutionFacade, thus will cause
moduleDescriptor to be recreated, and it will be different from one
that is stored in declarationDescriptor
Newer resolutionFacade will actually not built for old moduleDescriptor
and will cause exception

 #KT-24788 fixed
2018-11-06 15:49:01 +03:00
Nikolay Krasko
6c67cb3d7f Prioritize failure in expect file over stub validation problem in tests 2018-11-06 13:43:24 +03:00
Nikolay Krasko
6dcc3374fe Get string entries from stubs (KT-23738) 2018-11-06 13:43:23 +03:00
Nikolay Krasko
359e16eb82 Get argument name from stubs if possible (KT-23738) 2018-11-06 13:43:22 +03:00
Nikolay Krasko
3f53f9d9fb Allow storing dot qualified expression in annotations arguments (KT-23738) 2018-11-06 13:43:21 +03:00
Nikolay Krasko
a794d26493 Get stubbed expressions in value arguments (KT-23738) 2018-11-06 13:43:20 +03:00
Nikolay Krasko
a9c3b27d3e Don't generate stub for value arguments list when no arguments present (KT-23738)
Need this to conform stubs list obtained by decompiler.
Also ignore green stub, because is might not contain actual psi node.
2018-11-06 13:43:19 +03:00
Nikolay Krasko
efa59bfc7e Make stubs for string entries (KT-23738) 2018-11-06 13:43:17 +03:00
Nikolay Krasko
37d7e618da Stub element for KtStringTemplateExpression (KT-23738) 2018-11-06 13:43:16 +03:00
Nikolay Krasko
11543ba897 Make possible store constant values in stubs (KT-23738) 2018-11-06 13:43:15 +03:00
Nikolay Krasko
d9bc512556 Put arguments name to stubs in annotations (KT-23738) 2018-11-06 13:43:14 +03:00
Nikolay Krasko
12f127d631 Add stub for annotations value arguments (KT-23738) 2018-11-06 13:43:13 +03:00
Nikolay Krasko
fbb0e7d927 Stubbed VALUE_ARGUMENT_LIST and store it for annotations (KT-23738) 2018-11-06 13:43:12 +03:00
Nikolay Krasko
0f0dfe725e Refactoring: move KtExpression.unpackFunctionLiteral to utils file 2018-11-06 13:43:10 +03:00
Nikolay Krasko
7c49eeded7 Make KtProperty.getInitializer() use stub check 2018-11-06 13:43:09 +03:00
Nikolay Krasko
4f52f62b44 Use stubs in KtProperty for getDelegate() and getDelegateExpression() 2018-11-06 13:43:08 +03:00
Nikolay Krasko
f892714bea Test for stubs in annotations (KT-23738) 2018-11-06 13:43:07 +03:00
victor.petukhov
9a61998fca Add lexer test runner and whitespace characters tests
Whitespace characters for the tests are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
2018-11-06 11:19:15 +03:00
victor.petukhov
fe072e3366 Fix the lack of the handling of whitespace characters in the KDoc lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:58 +03:00
victor.petukhov
9e6ac6cb2a Fix the lack of the handling of whitespace characters in the Kotlin lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:38 +03:00
Toshiaki Kameyama
4a82f50e79 Convert concatenation to template: omit braces when converting 'this' #KT-7555 Fixed 2018-11-06 11:03:08 +03:00
Toshiaki Kameyama
7a9effe30d Redundant companion reference: Fix false positive in enum entry #KT-27861 Fixed 2018-11-06 11:02:35 +03:00
Karen Schwane
d88fd8aa6f KT-20357 Add samples for maxBy and minBy 2018-11-04 22:34:16 +03:00
Alexey Tsvetkov
aae24c993d Revert usage of lazy task API
We want to be compatible with Gradle 4.0+
where the API is not available.
Use eager task creation API for now.
Lazy API support should be added later with
proper Gradle versions checks.
2018-11-03 00:59:27 +03:00
Ivan Gavrilovic
c42b3b8ff8 Do not resolve configuration for scripting Gradle plugin
Avoid resolving kotlinScriptDef configurations during
configuration phase. Also, make task creation lazy.

   #KT-27160 fixed
2018-11-03 00:59:27 +03:00
Mikhail Glukhikh
22fa9b6b92 AndroidViewConstructorFix: add white space after annotation explicitly
This fixes Android formatter-related issue
#KT-27945 Fixed
2018-11-02 19:51:44 +03:00
Mikhail Glukhikh
279203e2e1 FIR visitor generator: fix copyright generator to pass conformance test 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
631adde3f5 Regenerate FIR resolve tests 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
2bc063b230 FIR: implement default star importing scope 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
284b21b2a6 Get rid of descriptors, resolved classifiers, + some cleanup 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
8035be07e2 FIR: built-in resolve, preliminary version #KT-24091 Fixed 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
ce113fbe2e FIR: introduce class & type alias symbols 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
093a236e34 FIR resolve: support star imports, enum entries 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
929573e0d5 FIR type transformer: minor optimization: do not create empty scopes 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
dfa8c32c5d FIR: minor cone types refactoring 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
4d48c40832 FIR tree & builder: support expect / actual 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
d16303342e FIR: do not allow to resolve to type parameters in supertype position 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
e46074dee6 FIR: simplify type parameter scopes 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
9aaec1efda FIR: resolve function type parameters 2018-11-02 19:44:54 +03:00
Simon Ogorodnik
25ae12fe07 FIR: implement early type alias expansion 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
d15fb1963b FIR: introduce symbols + type parameter resolve #KT-24064 Fixed 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
3495f09ac4 Fix visiting of resolved FIR nodes 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
a99578c354 FIR: handle unresolved modality as questionable 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
737ec37486 FIR visibility rendering: unknown -> public with question 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
b83d921445 FIR: add type alias descriptors 2018-11-02 19:44:53 +03:00
Simon Ogorodnik
bc9175c4e8 FIR: Refactor nested scope, fix super-type resolving jump context
#KT-24017 Fixed
2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
f82ad6ac20 FIR: support type alias resolve 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
d5463193fd FIR: introduce classifier scopes #KT-24022 Fixed 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
1ba498b021 FIR: transform types inside functions & properties 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
be35b904f2 FIR: replace UnambiguousFqName with ClassId 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
6c8a326e15 FIR: split transformer into three (imports / types / descriptors) 2018-11-02 19:44:52 +03:00
Simon Ogorodnik
8933c9035b FIR: introduce FIR importing scopes #KT-24096 Fixed 2018-11-02 19:44:51 +03:00
Mikhail Glukhikh
e6cd07b46e FIR: support tailrec & external modifiers 2018-11-02 19:44:51 +03:00
Mikhail Glukhikh
fa80f40e74 FIR: no nullability in error type 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
3e7b9c4e27 FIR: introduce type resolvers #KT-24019 Fixed 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
aa20d88dff FIR: Create ad-hoc fir by name provider 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
9976eff03a FIR: Add components storage to FirSession 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
7e95eee9f1 FIR: Introduce new classifier descriptors aka 'cones' 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
ce7456c93d FIR: Introduce new kotlin types aka 'cones' #KT-24063 Fixed 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
12acbaaa21 FIR: Add module for new types aka 'cones' (of fir tree)
Start of KT-24063
2018-11-02 19:44:50 +03:00
Mikhail Glukhikh
9daa84c5a9 FIR: add resolve module 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
3e06f426d0 Raw FIR: support a bunch of new elements + some fixes
Support: calls, constructor calls, annotation calls, arguments
Support: enums, primary constructors, const modifier
Support: inner modifier, qualified types
Add: some base transformed types
Fix: acceptChildren etc.
Progress: #KT-24013
2018-11-02 19:44:49 +03:00
Simon Ogorodnik
2ddf52123a Create FIR transformer generator #KT-24062 Fixed 2018-11-02 19:44:49 +03:00
Simon Ogorodnik
fda49736ee Regenerate visitors 2018-11-02 19:44:49 +03:00
Simon Ogorodnik
f33c16a7db Fix various inconsistencies in visitor generator output 2018-11-02 19:44:49 +03:00
Mikhail Glukhikh
2c626d6c5d Implement raw FIR builder (initial version)
All necessary FIR tree implementations were created
FIR renderer & three first builder tests were added
#KT-24013 Fixed
2018-11-02 19:44:49 +03:00
Simon Ogorodnik
1a80477c1c Create visitor generator for FIR (KT-24062 in progress) 2018-11-02 19:44:47 +03:00
Mikhail Glukhikh
4755a494f1 Create basic version of FIR interfaces (mostly declarations)
#KT-24014 Fixed
2018-11-02 19:44:47 +03:00
Simon Ogorodnik
0f02622e32 Create modules for Frontend IR & its builder from PSI 2018-11-02 19:44:46 +03:00
Ilya Gorbunov
332b843301 kotlin-bom: Add distributionManagement and signing profile
Since kotlin-bom intentionally has no parent these settings have to be duplicated
same as in the root kotlin-project pom.

#KT-18398
2018-11-02 19:04:10 +03:00
Ilya Gorbunov
11519e40cc Add scripting dependencies to kotlin-bom
#KT-18398
2018-11-02 18:52:40 +03:00
Ilya Gorbunov
119385839a Provide bom (bill-of-materials) pom for kotlin libraries
#KT-18398 Fixed
2018-11-02 18:52:40 +03:00
Mikhail Glukhikh
329e4f6000 New MPP highlighting test: add test without errors (KT-27494) 2018-11-02 15:42:39 +03:00
Mikhail Glukhikh
62e9eae48d New MPP highlighting test: check also line markers (KT-27494)
We have to do complex operations with tags, because otherwise
tags in different files prevent correct analysis of the current one
2018-11-02 15:42:06 +03:00
Mikhail Glukhikh
9be23bb21c Add first test for new multiplatform highlighting #KT-27494 Fixed 2018-11-02 15:41:45 +03:00
Mikhail Glukhikh
948e4a48af Delete deprecated old MPP wizard 2018-11-02 15:41:29 +03:00
Andrey Uskov
b9753164c9 Fix dependency resolution on model post-processing
#KT-27265 Fixed
2018-11-02 13:12:37 +03:00
Andrey Uskov
080681ea2f Fix NPE in KotlinJavaMPPSourceSetDataService.postProcess 2018-11-02 13:09:48 +03:00
Vyacheslav Gerasimov
e9c0dea70e Register stream-debugger for AS 3.2, 3.3, 3.4 2018-11-01 20:07:11 +03:00
Alexey Tsvetkov
d68cac314a Do not fail builds during lint checks in Gradle tests
Tests fail with unrelevant checks like recommended
target SDK for play store
2018-11-01 19:35:20 +03:00
Ilya Gorbunov
cad8b81dcb Update selenium version to 2.53.1
This change is required to fix failing tests of browser-example and browser-example-with-library.
Tests began to fail recently because `htmlunit-driver` had a dependency on `selenium-support`
constrained to [2.53.0,4.0.0) range. Apparently the recently released 3.141.0 version of that artifact
became incompatible with the rest of selenium 2.52.

This fix advances the version of selenium to 2.53.1. This version has a dependency on
`selenium-support:2.53.1`. Since it goes earlier in dependency tree and satisfies the range constraint,
it is used for `htmlunit-driver` too.
2018-11-01 17:52:48 +03:00
Ilya Gorbunov
2b699f8f07 Add a test for CharSequence/String.regionMatches 2018-11-01 17:51:24 +03:00
Pavel V. Talanov
02f5891ee0 multiplatformUtil: Do not fail on non-physical classes from java
#KT-27907 Fixed
2018-11-01 15:48:43 +01:00
Nikolay Krasko
5b6437876f Refactoring: use isNamed utility function for value arguments 2018-11-01 17:12:46 +03:00
Nikolay Krasko
6fcb1716eb Do additional resolve for inline properties for backend (KT-27460)
There's an additional resolve for inline declarations to make backend
happy with the passed binding context object. Unlike functions,
properties were not processed.

 #KT-27460 Fixed
2018-11-01 17:12:45 +03:00
Nikolay Krasko
9978ba4aaa Validate new file or class name for empty parts (KT-27903)
#KT-27903 Fixed
2018-11-01 17:12:44 +03:00
Roman Artemev
0e7520fde3 [JS IR BE] Fix GetClass on primitive type 2018-11-01 16:51:44 +03:00
Roman Artemev
2d03f87ea5 [IR BE] Support lateinit locals and isInitialized property
* update tests
2018-11-01 16:51:43 +03:00
Roman Artemev
535eea7f48 [JS IR BE] fix enum initialization 2018-11-01 16:51:42 +03:00
Roman Artemev
b86e2e6dc0 [JS IR BE] Fix EnumClassLowering
* make it incremental
 * fix access to enum entry from different module
 * drop ExternalEnumLowering
2018-11-01 16:51:42 +03:00
Roman Artemev
7f215d3f52 Update tests 2018-11-01 16:51:38 +03:00
Roman Artemev
12848d4eff [JS IR BE] Support in callable references
* default params
 * vararg
Minor refactoring
2018-11-01 16:18:44 +03:00
Roman Artemev
fb709cae92 [JS IR BE] Fix private field names 2018-11-01 16:18:44 +03:00
Nicolay Mitropolsky
bf42bd1226 Uast: fixes and tests for descriptors leak (KT-27663) 2018-11-01 15:23:54 +03:00
Natalia Selezneva
e48fbe4aa3 Do not insert additional new lines in REPL 2018-11-01 15:00:41 +03:00
Natalia Selezneva
468404c6c3 Repl: refactoring, move common parts to utils 2018-11-01 15:00:41 +03:00
Natalia Selezneva
ce424d27e8 Scratch tests: compile java files to temp directory 2018-11-01 15:00:40 +03:00
Natalia Selezneva
2e3c645bf6 183: Implement new API from git plugin.
That allows hide checkbox for additional java to kotlin renames if there isn't any converted files

#KT-26073 Fixed
2018-11-01 15:00:39 +03:00
Natalia Selezneva
ccf49f9d1c Update notifications in script file when script reports are attached (KT-24705)
^KT-24705 Fixed
2018-11-01 15:00:02 +03:00
Natalia Selezneva
ec14fdd94f Do not attach script reports if 'reload dependencies' isn't pressed (KT-24706)
^KT-24706 Fixed
2018-11-01 14:58:52 +03:00
Nikolay Krasko
6198641cb7 Fix test after adding line with force ranking directive 2018-11-01 12:24:03 +03:00
Nikolay Krasko
6f719a9460 Use binary expression as parent for better spacing (KT-27717)
When BINARY_EXPRESSION is used as parent, spacing rules for it are applied.
There're no rules for OPERATION_REFERENCE on the other side.

 #KT-27717 Fixed
2018-11-01 12:24:02 +03:00
Nikolay Krasko
2684974a33 Single indent for multi-declarations for official codestyle (KT-27847)
#KT-27847 Fixed
2018-11-01 12:24:01 +03:00
Nikolay Krasko
a8fc9d6b6f Show lambda return hints only once in one-liner ifs (KT-27802)
#KT-27802 Fixed
2018-11-01 12:24:00 +03:00
Natalia Selezneva
6ae95b747d Fix KotlinScriptDefinitionProvider compilation for 181 branch
Use FileTypeRegistry.getFileTypeByFileName instead of isFileOfType
2018-11-01 12:09:27 +03:00
Toshiaki Kameyama
e8e51d1db4 Safe cast with return: fix false negative on lambda last statement #KT-27906 Fixed 2018-11-01 10:59:18 +03:00
Ilya Gorbunov
e49789f819 Build java9 modular artifacts under 'modular' classifier
Provide additional modular artifacts as a workaround for KT-21266

Update module-info declarations:
  - add new packages
  - add exports and opens for internal PlatformImplementations
  - remove exports of kotlin.coroutines.experimental.*

#KT-27919 Fixed
2018-11-01 02:27:49 +03:00
Alexey Tsvetkov
f139ec72cd Convert kotlin-gradle-plugin-integration-tests build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
45ac6ba251 Convert kotlin-gradle-plugin-integration-tests build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
bc65e6e66a Convert kotlin-gradle-plugin-model build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
9c7bd610c5 Convert kotlin-gradle-plugin-model build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
e0e3d90774 Convert kotlin-gradle-plugin-api build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
0ab326e4ba Convert kotlin-gradle-plugin-api build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
5a3a2df272 Convert kotlin-gradle-plugin build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
911f54ed0b Convert kotlin-gradle-plugin build script: step 1 2018-11-01 00:59:07 +03:00
Alexander Udalov
be66591a4f Minor, fix test data for PublishedApi on inline class constructor
PublishedApi is not available at runtime because it has BINARY
retention. Probably this test should check some other RUNTIME-retained
annotation
2018-10-31 17:25:12 +01:00
Alexander Udalov
911420d823 Minor, move InlineOnly-related utilities to frontend 2018-10-31 17:21:06 +01:00
Alexander Udalov
c5275f178a Do not use getMethod/getConstructor in reflection
Use only getDeclaredMethod/getDeclaredConstructor instead. The reason is
that getMethod/getConstructor only finds public-API (public or protected
on JVM) declarations, and to determine if a declaration is public-API in
the class file we used isPublicInBytecode, which was trying to load
annotations on the declaration to see if it was InlineOnly, and that
required lots of time-consuming actions and worsened the stack trace (as
can be seen e.g. in KT-27878). In fact, the implementation of
Class.getMethod is not supposed to do anything complicated except
loading annotations from each superclass and superinterface of the given
class. Doing it in our codebase simplifies implementation and probably
improves performance
2018-10-31 17:21:06 +01:00
Alexander Udalov
2f72f68e1a Fix loading class literal value void.class in reflection
#KT-27878 Fixed
2018-10-31 17:21:05 +01:00
Alexander Udalov
902d414d39 Fix loading of class literal constant values in reflection
This is an addition to c1ab08c8ce where KT-26582 was fixed. The test
testClassLiteralArguments in JvmRuntimeDescriptorLoaderTestGenerated
failed before this change but went unnoticed because it wasn't run on CI
(see the previous commit)
2018-10-31 17:21:05 +01:00
Alexander Udalov
7d0d2fcdb9 Add descriptors.runtime tests to compilerTest 2018-10-31 17:21:05 +01:00
Alexander Udalov
38aad20231 Update konan.proto to be consistent with kotlin-native repo
See https://github.com/JetBrains/kotlin-native/pull/2278
2018-10-31 17:20:13 +01:00
Mikhail Glukhikh
9bc1dbb5bc Fix testCleanup 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
318d6e7111 Introduce inspection for unused main parameter #KT-26999 Fixed 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
ad44118605 Delay UNUSED_PARAMETER on main parameter until 1.4 (part of KT-26999) 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
388aecb249 Extract new MPP tests from Gradle config tests, forbid them for 173
This removes four failing tests from 173 / AS31
2018-10-31 19:00:28 +03:00
Shagen Ogandzhanian
d78115757f Update antlr dependency from 4.5.3 to 4.7.1 switch to gradle in idl2k
This is a squashed and rebased commit of https://github.com/JetBrains/kotlin/pull/1945

- add idl2k to default gradle build lifecycle
- removemaven build completely
- invert maven's `idl2k.deploy.skip` to `idl2k.deply` in gradle
(false by default)
- antlr upgrade from 4.5.3 to 4.7.1 - I'd have to slightly modify WebIDL.g4 definition though -
and updated copyright accordingly - my updates were based on
https://raw.githubusercontent.com/antlr/grammars-v4/master/webidl/WebIDL.g4
- I've checked all generated output to make sure it is identical to
what we hade before dependency update.
- Package idl2k according to our souce code guidelines
2018-10-31 16:23:00 +01:00
Ilya Gorbunov
c3237f416f Minor: fix doc formatting that caused summary differ in JVM and Native 2018-10-31 17:16:50 +03:00
Ilya Gorbunov
18f9b9a022 Minor: fix sample references in MatchResult 2018-10-31 17:14:49 +03:00
Ilya Gorbunov
a341110304 Remove Build-Jdk manifest property
To get rid of an additional cause of potential artifact indeterminacy.

#KT-26102 Fixed
2018-10-31 16:41:31 +03:00
Natalia Selezneva
ffc7d302fb Check that file is valid during reading/writing file attribute 2018-10-31 16:13:42 +03:00
Natalia Selezneva
715a5699de Do not use stubs looking for script definition
Fix EA-128960
2018-10-31 16:13:42 +03:00
Natalia Selezneva
6af9929992 Do not try to find script definition for decompiled kotlin files 2018-10-31 16:13:41 +03:00
Dmitry Savvinov
f9f54e5a4b Minor: publish AbstractIrGeneratorTestCase.createExpectedFile 2018-10-31 14:52:04 +03:00
Dmitry Savvinov
00036ba498 [BE IR] Skip comments for determining startOffset of declaration 2018-10-31 14:52:03 +03:00
Dmitriy Dolovov
633f665b7f Add icon for Kotlin/Native
Issue #KT-27150 Fixed
2018-10-31 17:35:54 +07:00
Mikhael Bogdanov
2f2093add3 Temporary switch 183 branch to SNAPSHOT dependency, update asm version to 7.0 2018-10-31 11:15:50 +01:00
Natalia Selezneva
c6882c1ebd Fix testdata in j2k 2018-10-31 13:08:48 +03:00
Natalia Selezneva
2d628d84f6 Add missing import in bunch file 2018-10-31 13:08:48 +03:00
Mikhail Glukhikh
1936c14e84 Remove MPP wizard "Shared" from 181, together with relevant failed test 2018-10-31 11:57:22 +03:00
Toshiaki Kameyama
1df15612d6 Unnecessary parentheses in function call with lambda: fix false positive #KT-26669 Fixed 2018-10-31 11:45:48 +03:00
Natalia Selezneva
2d0ecf8f50 Update testdata: println is moved to ioH.kt 2018-10-31 11:02:14 +03:00
Natalia Selezneva
a79785727e Update testdata: coroutines are not experimental since 1.3.0 2018-10-31 11:01:14 +03:00
Natalia Selezneva
cc689af635 Set projectJdk in MultiFileTestCase, because many of configuration files contains inheritedJdk dependency
Fix MultiModuleRenameTest, MultiModuleSafeDeleteTest, MultiModuleChangeSignatureTest
2018-10-31 11:01:14 +03:00
Natalia Selezneva
0fa908a1b5 Configurator tests: update testdata
LATEST_STABLE version is used in language version settings if there is no facet configured
2018-10-31 11:01:13 +03:00
Natalia Selezneva
43fa2d59fc Configurator: repositories are inserted in one line 2018-10-31 11:01:13 +03:00
Natalia Selezneva
cbd54e7867 Fix configuration tests with latest runtime 2018-10-31 11:01:12 +03:00
Natalia Selezneva
f364717da2 J2K: convert annotations properly 2018-10-31 11:01:12 +03:00
Natalia Selezneva
ed1452c136 Fix j2k testdata for constructors 2018-10-31 11:01:11 +03:00
Alexander Udalov
5bc2178040 Report warning instead of error on incorrect -Xuse-experimental/-Xexperimental
#KT-27430 Fixed
 #KT-27709 Fixed
2018-10-30 19:58:03 +01:00
Mikhail Glukhikh
43895f43d4 Drop empty GradleMultiplatformWizardTest to avoid empty test suite 2018-10-30 20:23:27 +03:00
Mikhael Bogdanov
bedaa1a503 Use proper type constructor in IrIllegalArgumentException
'v.anew(Type.geType(...))' worked accidentally because
  1. By default, ASM 6 creates METHOD Type for 'Type.geType(...)' invocation
  2. It didn't fail because this type was used only in 'anew' invocation that
      calls 'internalName' only
  3. ASM 7 changes default behavior to throw Exception
2018-10-30 16:30:26 +01:00
Mikhael Bogdanov
98fa26c2d8 Use proper type constructor in eval4j
ASM 7 changes default behavior for 'getTypeInternal' (was 'getType') method.
 Now it's throwing exception instead of create 'METHOD' Type.
 Old behavior was equals to 'Type.getMethodType("<invalid>")'

 #KT-27833 Fixed
2018-10-30 16:30:03 +01:00
Sergey Igushkin
f995afd50d Fix runtime elements configuration resolved for compile classpath
The existing disambiguation rule for the Usage attribute lead to
runtime variants being resolved even for compile-scoped input
configurations, because Gradle runs disambiguation rules even if the
consumer value is present in the candidates list.

For example, an `app` project's `jvmCompileClasspath` configuration
would get its `project('lib')` dependency resolved to the
`jvmLibRuntimeElements` instead of `jvmLibApiElements`.

Fix this by:
1) running the part of the disambiguation rule only with Gradle 4.1+, so
  as to use the consumer value for proper disambiguation;
2) choosing the JAVA_API usage when the consumer is JAVA_API or
  KOTLIN_API, and choosing one of the JAVA_RUNTIME usages if the
  consumer is either KOTLIN_RUNTIME, one of the JAVA_RUNTIME usages, or
  does not specify its usage.

Issue #KT-27849 Fixed
2018-10-30 17:29:54 +03:00
Mikhael Bogdanov
43e79035e9 Revert "Fix backend for working with asm-7.0 beta (KT-27540, KT-27774)"
Original commit that cause this change was removed in asm 7.0 release
2018-10-30 11:00:23 +01:00
Dmitriy Dolovov
e5a3feada4 Disable ProjectRootModificationTrackerFixer in IDEA 183+
Issue #KT-27579 Fixed
2018-10-30 11:13:26 +07:00
Alexey Tsvetkov
49d5c8ae37 Run model tests with Gradle 4.0+ 2018-10-29 21:48:01 +03:00
Alexey Tsvetkov
00f60553dc Try 0 and 1 starting lines in Kapt location mapping tests 2018-10-29 21:48:01 +03:00
Alexey Tsvetkov
22064fd005 Choose Gradle version for Gradle model tests as for other tests 2018-10-29 21:48:01 +03:00
Denis Zharkov
f2a937ed97 Add changelog notes for 1.3 RCs and release 2018-10-29 19:12:38 +03:00
Vyacheslav Gerasimov
4eeb4a0ffd Build: Use cache-redirector for Android Studio 2018-10-29 18:53:19 +03:00
Alexey Tsvetkov
c4268a4238 Update Android Gradle plugin version in tests 2018-10-29 16:09:57 +03:00
Ilya Matveev
a03707cf87 Update Kotlin/Native: 1.0.1 2018-10-29 18:45:51 +07:00
Ilya Matveev
e0a83b6159 Use KOTLIN_API usage in cinterop dependencies.
Issue #KT-27803 fixed.
2018-10-29 18:45:51 +07:00
Alexander Udalov
d28c6559b8 Fix support of directories as sources in build files (-Xbuild-file)
#KT-27775 Fixed
2018-10-29 11:36:29 +01:00
Nikolay Krasko
0a2d1b409b Cleanup LookupCancelWatcher.kt 2018-10-27 18:57:21 +03:00
Nikolay Krasko
48c0fb2ba9 Remove deprecated AbstractProjectComponent 2018-10-27 18:57:20 +03:00
Sergey Rostov
cce125b982 JPS: Don't catch BuildDataCorruptedException as internal error.
BuildDataCorruptedException should be thrown up to `IncProjectBuilder`
to be handled by TeamCity.

#KT-27037 Fixed
2018-10-27 16:08:38 +03:00
Sergey Rostov
0b8d94a6b1 JPS: Fix initialization order for case when all kotlin rebuild.
#KT-27792 Fixed
2018-10-27 16:08:16 +03:00
Mikhail Glukhikh
700bcb5984 Unused symbol: fix false positives on inline class constructors
#KT-27434 Fixed
2018-10-27 12:13:52 +03:00
Mikhail Glukhikh
506f7aaa68 Replace toString with string template: fix grammar 2018-10-27 12:13:50 +03:00
Mikhail Glukhikh
6e10235208 Make "Add name(s) to call arguments" available for generic arguments
#KT-15550 Fixed
2018-10-27 12:13:42 +03:00
peter
e93a90bc09 fix some cases of "Cls delegate shouldn't be loaded for not too complex ultra-light classes" 2018-10-26 20:41:56 +02:00
Alexander Udalov
cfffd21fa9 Fix KtLightAnnotationsValues.kt for 173
See 17076cd05e
2018-10-26 20:17:52 +02:00
Mikhail Glukhikh
cb92009862 Fix maven build + ~50 compiler tests broken by UNUSED_PARAMETER in main 2018-10-26 19:51:20 +03:00
peter
c54eb7db97 Merge remote-tracking branch 'origin/master' 2018-10-26 18:44:12 +02:00
peter
cd1560e0b4 provide correct context for method return type
to fix generics in

class A<E> {
   fun foo(): E = null!!
}

public class B {
   public static void main(String[] args) {
       A<String> a = new A<>();
       a.foo().length(); // Unresolved length, because it thinks that `a.foo()` returns E
   }
}
2018-10-26 18:42:41 +02:00
Vyacheslav Gerasimov
87af14849d as34: Restore compatibility with 183 platform in AS 3.4 2018-10-26 18:25:22 +03:00
Vyacheslav Gerasimov
99924c3df5 as34: Update idea-version 2018-10-26 18:25:21 +03:00
Vyacheslav Gerasimov
c6ecc6c21c as34: Update versions.gradle.kts 2018-10-26 18:25:21 +03:00
Vyacheslav Gerasimov
4076923a26 as34: Apply changes from AS 3.3 2018-10-26 18:25:20 +03:00
Vyacheslav Gerasimov
25e6916469 Derive as34 bunch from 183 2018-10-26 18:24:33 +03:00
Nikolay Krasko
7009b261d6 Don't rank local classes (KT-27712)
Allow enable ranking even for single source file in tests

 #KT-27712
2018-10-26 18:02:36 +03:00
Nikolay Krasko
214785d9b7 Do not ruin breakpoints when there's failure in ranking (KT-27712) 2018-10-26 18:02:36 +03:00
Nikolay Krasko
8d7829be31 Allow to assert rank value in ranking test
Update test data for lambdas.kt because of same rank check bug fixed.
2018-10-26 18:02:36 +03:00
Nikolay Krasko
122fba20da Do not wait for not generated classes in LowLevelDebuggerTestBase 2018-10-26 18:02:35 +03:00
Nikolay Krasko
651d76f4ef Allow disable strict mode in ranking tests 2018-10-26 18:02:35 +03:00
Andrey Uskov
1c7cab61c9 Add platform AS34 2018-10-26 17:58:11 +03:00
Ilya Gorbunov
c833272392 stdlib-gen, minor: rename property 2018-10-26 16:27:43 +03:00
Ilya Gorbunov
138ab13364 Remove experimental coroutines usages from stdlib generator 2018-10-26 16:27:42 +03:00
Mikhail Glukhikh
e39953c4a0 Check also drop-box content in multi-module line marker tests
Related to KT-26957
2018-10-26 16:21:49 +03:00
Alexander Udalov
f4c77ec66f Minor, rework groovyTraitsWithFields integration test
Declaring Groovy and Kotlin classes in the same project is not necessary
for this test, split them to two projects instead to avoid the hack with
modifying task dependencies manually
2018-10-26 14:40:13 +02:00
Nicolay Mitropolsky
274fcd6237 183: PsiElementChecker: the 55-th method textRangeInParent was added in 183 2018-10-26 15:09:19 +03:00
Nicolay Mitropolsky
23d2269aac 183: Update IDEA version to 183.3975.18 2018-10-26 12:13:22 +03:00
Pavel Punegov
4d5b00d3e3 Ignore test in native: uses Array.fill 2018-10-26 11:33:14 +03:00
Mikhael Bogdanov
09d0d2c71c Keep android tests in libs/test folder
To avoid 'com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded
2018-10-26 09:51:14 +02:00
Alexander Udalov
9df02b2366 Support Groovy $Trait$FieldHelper classes in new class file reader
Preface: for Groovy traits with fields, the Groovy compiler generates
synthetic "$Trait$FieldHelper" classes which posed several problems to
our class file reader, caused by the fact that the contents of the
InnerClasses attribute broke some assumptions about how names on the JVM
are formed and used.

For a trait named `A`, the Groovy compiler will additionally generate a
synthetic class file `A$Trait$FieldHelper` with the following in the
InnerClasses attribute:

InnerClasses:
     public static #15= #2 of #14; //FieldHelper=class A$Trait$FieldHelper of class A

i.e. the simple name of the class is `FieldHelper`, the name of its
outer class is `A`, but the full internal name is `A$Trait$FieldHelper`,
which is surprising considering that the names are usually obtained by
separating the outer and inner names via the dollar sign.

Another detail is that in some usages of this synthetic class, the
InnerClasses attribute was missing at all. For example, if an empty
class `B` extends `A`, then there's no InnerClasses attribute in `B`'s
class file, which is surprising because we might decode the same name
differently depending on the class file we encounter it in.

In this change, we attempt to treat these synthetic classes as top-level
by refusing to read "invalid" InnerClasses attribute values (they are
not technically invalid because they still conform to JVMS), fixing the
problem of "unresolved supertypes" error which occurred when these
classes were used as supertypes in a class file in a dependency.

1) In ClassifierResolutionContext.mapInternalNameToClassId, do not use
   the ad-hoc logic (copy-pasted from intellij-core) to determine class
   id heuristically from the internal name. For $Trait$FieldHelper
   classes this logic attempted to replace all dollar signs with dots,
   which was semantically incorrect: dollars there were used as
   synthetic characters, not as a separator between outer and inner
   classes.
2) In isNotTopLevelClass (Other.kt), only consider "valid" InnerClasses
   attribute values, where the full name of the class is obtained by
   separating the outer name and the inner name with a dollar character.
   This way, we'll be able to treat class files with invalid attribute
   values as top-level and avoid breaking any other assumptions in the
   class file loader.
3) In BinaryJavaClass.visitInnerClass, record all valid InnerClasses
   attribute values present in the class file, not just those related to
   the class in question itself. This is needed now because previously,
   the removed heuristics (see p.1) transformed mentioned inner class
   names to class ids correctly >99% of the time. Now that the
   heuristics are gone, we'll use the information present in the class
   file to map names correctly and predictably. According to JVMS, this
   attribute should contain information about all inner classes
   mentioned in the class file, and this is true at least for class
   files produced by javac.

 #KT-18592 Fixed
2018-10-25 22:15:22 +02:00
Yan Zhulanow
cd88209cf4 Fix Android Extension imports resolution after project reopening (KT-27793) 2018-10-25 23:10:41 +03:00
peter
beba8f215e fix registry bean registration for ultra-light classes 2018-10-25 19:54:35 +02:00
Mikhael Bogdanov
0edd2d326b Add LocalVariablesSorter to MethodRemaper in RemappingClassBuilder to keep old behavior
#KT-27774 In Progress
2018-10-25 19:53:27 +02:00
Mikhael Bogdanov
0468a354e0 Get rid of deprecated asm remapping api
#KT-27774 In Progress
2018-10-25 19:53:20 +02:00
Toshiaki Kameyama
ad8c58d176 Lift return out refactoring: extract function for problem report 2018-10-25 19:51:36 +03:00
Toshiaki Kameyama
3e6007e3d3 Lift return out: report also on 'return' keywords #KT-27173 Fixed 2018-10-25 19:51:36 +03:00
Toshiaki Kameyama
f771ed5dd8 Reformat & cleanup: LiftReturnOrAssignmentInspection 2018-10-25 19:51:35 +03:00
peter
ebc998d710 add ultra-light classes/members that work without backend in simple cases 2018-10-25 18:22:33 +02:00
Mikhail Glukhikh
387efc3791 Highlight unused parameters in main function in 1.3 (KT-26999) 2018-10-25 19:11:45 +03:00
Mikhail Glukhikh
17da136420 KotlinPsiCheckerAndHighlightingUpdater: convert to Kotlin 2018-10-25 19:11:43 +03:00
Mikhail Glukhikh
b73bcbb06d KotlinPsiCheckerAndHighlightingUpdater: .java -> .kt 2018-10-25 19:11:42 +03:00
Mikhail Glukhikh
f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Mikhail Glukhikh
b9161c5293 Gradle configurator: handle kotlin options correctly with new-mpp plugin
#KT-27052 Fixed
2018-10-25 18:13:08 +03:00
Mikhail Glukhikh
d050629589 Show expect / actual for parameters & enum entries in drop-box
#KT-26957 Fixed
2018-10-25 18:11:47 +03:00
Mikhail Glukhikh
bb19d4c598 Do not create expect / actual markers for parameters & enum entries
Part of KT-26957
2018-10-25 18:11:45 +03:00
Alexander Udalov
17076cd05e Support class literal values in light annotations correctly
Map Kotlin built-in classes (e.g. Throwable) to corresponding Java
classes, do not map Unit to void, support arrays of primitives and
arrays of wrapper types
2018-10-25 16:27:23 +02:00
Alexander Udalov
266a8dae3f Fix KClassValue behavior for reified type parameter literals
#KT-27799 Open
2018-10-25 16:27:23 +02:00
Alexander Udalov
c1ab08c8ce Refactor KClassValue to store ClassLiteralValue internally
Only invariant array projections and non-null element types will be
supported soon (see KT-26568), so it makes no sense to store the
complete type in KClassValue. What we need is only the ClassId of the
class, and the number of times it's wrapped into kotlin/Array, which is
exactly what ClassLiteralValue represents.

This change helps in decoupling annotation values from
descriptors/types. The only constant value that depends on descriptors
is now AnnotationValue.

 #KT-26582 Fixed
2018-10-25 16:27:23 +02:00
Alexander Udalov
bad30a4b99 Add module to ExperimentalMarkerDeclarationAnnotationChecker
Will be used in a subsequent commit
2018-10-25 16:27:22 +02:00
Alexander Udalov
2ab33026fb Move ClassLiteralId to 'descriptors', rename to ClassLiteralValue 2018-10-25 16:27:22 +02:00
Alexander Udalov
19c79b906f Minor, add utility to get class name from StringTable via ClassId 2018-10-25 16:27:22 +02:00
Alexander Udalov
9183d7ca27 Add ModuleDescriptor to AnnotationCodegen 2018-10-25 16:27:22 +02:00
Roman Artemev
ffdfec4815 [JS IR BE] Minor refactoring 2018-10-25 15:49:33 +03:00
Roman Artemev
080e1ad5b5 [JS IR BE]
* Fix type parameters for callable references
 * Visit IrCallableReference tree as well
2018-10-25 15:49:22 +03:00
Roman Artemev
fb499def59 Update tests 2018-10-25 15:49:21 +03:00
Roman Artemev
04bf93c1bc [JS IR BE] Refact CallableReferenceLowering
* fix cross-module references
 * make it incremental
2018-10-25 15:49:20 +03:00
Roman Artemev
43d14ed954 [JS IR BE] Put closure function declaration in container (factory function) 2018-10-25 15:49:20 +03:00
Roman Artemev
9515de0b7e [JS IR BE] Fix name clash between top-level fields 2018-10-25 15:48:42 +03:00
Roman Artemev
91ea377622 [JS IR BE] Fix translation for float literals 2018-10-25 15:48:42 +03:00
Roman Artemev
59b1743c37 Add tests 2018-10-25 15:48:42 +03:00
Roman Artemev
7cb202934c Update tests 2018-10-25 15:48:42 +03:00
Roman Artemev
276000a974 [JS IR BE] Fix exceptions
* set message property in the correct way
 * set proper name for each Throwable successor
2018-10-25 15:48:42 +03:00
Roman Artemev
6a05b1eee5 [JS IR BE] Add noWhenBranchMatchedException
* refact exception helpers
2018-10-25 15:48:42 +03:00
Roman Artemev
3bea3eca2b [JS IR BE] Support external enum classes
* add lowering pass
 * fix EQEQ operator
2018-10-25 15:48:42 +03:00
romanart
eed22b0485 [JS IR BE] Add isTopLevel property to IrFunction 2018-10-25 15:48:42 +03:00
Roman Artemev
fced46ffaf [JS IR BE] Fix block decomposer 2018-10-25 15:48:42 +03:00
Mikhael Bogdanov
612ca87aa3 Support coroutines in Android box tests 2018-10-25 13:34:29 +02:00
Ilya Chernikov
ae0b2405bc Add ide script settings for sources and accepted location 2018-10-25 13:09:34 +02:00
Ilya Chernikov
492abd08bc Fix bridge resolver behaviour on static dependencies 2018-10-25 13:09:32 +02:00
Ilya Chernikov
0e66c64a17 Implement new minimal extension point for providing (new) script definitions to idea
#KT-27817 fixed
2018-10-25 13:09:01 +02:00
Mikhael Bogdanov
afc78be58e Explicitly specify test dist dependencies 2018-10-25 11:55:22 +02:00
Alexander Podkhalyuzin
812d3d9ce6 Fixed testdata to have the same package/file structure, otherwise it
will not work with Java 9.
2018-10-25 11:16:37 +03:00
Mikhael Bogdanov
35fc629305 Move custom JDK tests into separate module 2018-10-25 09:15:03 +02:00
Mikhael Bogdanov
2f2d056aff Add stdlib and reflect to Android test dependencies 2018-10-25 09:15:02 +02:00
Mikhael Bogdanov
1b2145af22 Fix test data 2018-10-25 09:12:26 +02:00
Mikhael Bogdanov
e5ef5d096e Fix test data 2018-10-25 09:10:40 +02:00
Yan Zhulanow
7626cf6611 Minor: Update test data for kapt stub converter 2018-10-24 23:44:31 +03:00
Yan Zhulanow
ae66482715 Add missing versions.platform for the new bunches 2018-10-24 23:38:35 +03:00
Yan Zhulanow
9dd6efeb46 Fix sporadic false-positive "Receiver parameter is never used" for local functions (KT-26481) 2018-10-24 20:12:42 +03:00
Yan Zhulanow
f19c0c3fb9 Minor: Fix inspection warnings in 'kotlin-annotation-processing' 2018-10-24 20:12:41 +03:00
Yan Zhulanow
17c02a77c7 Minor: Fix inspection warnings in 'kotlin-annotation-processing-base' 2018-10-24 20:12:40 +03:00
Yan Zhulanow
2cb2141e07 Kapt: Do not treat initially empty configurations specially (KT-27404) 2018-10-24 20:12:39 +03:00
Yan Zhulanow
6e6a036f98 Kapt: Improve check for the current JDK version (KT-27188) 2018-10-24 20:12:38 +03:00
Yan Zhulanow
1f6dbc74da Kapt: Restore constant identifiers for field annotations (KT-27334)
The old behavior broke after the refactoring of annotations with use-site targets.
2018-10-24 20:12:37 +03:00
Yan Zhulanow
0ae5d1c08f Kapt: Log annotation processor initialization time 2018-10-24 20:12:36 +03:00
Yan Zhulanow
6d017f07ad Kapt: Support androidx.annotation.RecentlyNullable annotations (KT-26725) 2018-10-24 20:12:35 +03:00
Yan Zhulanow
ac1dd59472 Kapt: Fix anonymous type transformer, do not use ClassDescriptor.defaultType as a replacement (KT-27119) 2018-10-24 20:12:34 +03:00
Yan Zhulanow
39863edd0e Kapt: Use correct type mapping mode while mapping super types (KT-27126) 2018-10-24 20:12:32 +03:00
Yan Zhulanow
f6bf35c1f5 Kapt: Fix error type correction for super class constructor calls 2018-10-24 20:12:31 +03:00
Yan Zhulanow
ba53ba37b0 Replace bunch copies for some of build.gradle.kts files with a DSL 2018-10-24 20:12:30 +03:00
Yan Zhulanow
81cfc3e39f Kapt: Support symlinked Java source files (KT-26817) 2018-10-24 20:12:29 +03:00
Yan Zhulanow
65a1dd9350 Minor: Add a package to JavaKaptContextTest, make it a TestCase 2018-10-24 20:12:28 +03:00
Yan Zhulanow
f36447aab8 Remove usage of deprecated ConcurrentWeakFactoryMap in debugger (KT-25667) 2018-10-24 20:12:27 +03:00
Yan Zhulanow
e3f6d183fa Check for dumb mode before evaluation (KT-24959) 2018-10-24 20:12:26 +03:00
Yan Zhulanow
b8c756a4e8 Debugger: Remove false-positive assertion (KT-24343) 2018-10-24 20:12:25 +03:00
Yan Zhulanow
713dc589e0 Debugger: Allow to evaluate private properties from companion objects (KT-26795) 2018-10-24 20:12:24 +03:00
Yan Zhulanow
fee0cfcecb Debugger: Add a stepping test for inline classes (KT-26798) 2018-10-24 20:12:23 +03:00
Alexander Udalov
1ee1d15b91 Support annotations on property accessors in JS/common metadata
#KT-14529 Fixed
2018-10-24 18:17:12 +02:00
Alexander Udalov
d1e1e274d9 Render property accessor annotations in .txt test data
If property accessor rendering is disabled in a test, render annotations
on accessors as use-site-targeted, as was done with
`@setparam:`-annotations. Otherwise they were lost
2018-10-24 18:17:12 +02:00
Mikhael Bogdanov
e326b8755f Fix method inlining problems in 191 branch related to asm upgrade to 7.0
'visitAnnotableParameterCount' is propagating copying node state to
    destination one that corrupts its state
2018-10-24 17:07:10 +02:00
Alexey Tsvetkov
bf39e1d146 Make google maven repo take precedence over jcenter in Gradle tests
'com.android.tools.build:aapt2-proto:0.3.1' stopped resolving from jcenter
2018-10-24 15:54:04 +03:00
Alexander Udalov
9394caf9cf Use access to backing field on overridden property with private setter
#KT-27772 Fixed
2018-10-24 12:53:50 +02:00
Nikolay Krasko
8e1bff0e37 Additional diagnostic for internal state during jvm codegen 2018-10-24 13:04:49 +03:00
Nikolay Krasko
5fdb0df3fa Fix backend for working with asm-7.0 beta (KT-27540, KT-27774)
Reset labels infos before moving instructions, otherwise list of
instructions is corrupted.

For more information:

https://gitlab.ow2.org/asm/asm/issues/317858
dc8acb4845 (5e3df072b61d74b2fd71d97a1d99188ccc46c1da_235_233)

 #KT-27540 Fixed
2018-10-24 13:04:48 +03:00
Nikolay Krasko
3b5dfba73a 191: Add com.intellij.util.ui.UIUtilities to proguard exception 2018-10-24 13:04:45 +03:00
Nikolay Krasko
77be4a9e85 Remove warnings in createByPattern.kt 2018-10-24 13:04:43 +03:00
Andrey Uskov
4024d0c484 Make JDK 9 mandatory back
#KT-26413 Fixed
2018-10-24 12:31:13 +03:00
Dmitry Savvinov
339c55505a Refactor logic of reporting errors in contracts
Rename 'doCheckContract' into 'parseContractAndReportErrors',
emphasizing that it works with definitely call to 'contract' from
stdlib.
In particular, it means that it should either return non-null
value or report some errors.

Note that this commit doesn't change behavior of this code (modulo cases
when something in 'parseContract' throws exception), but just refactors
the code to be more clear and easy to reason about.
2018-10-24 12:03:04 +03:00
Dmitry Savvinov
3dd4e9f04f Minor: use try-finally for setting LazyContractProvider
It conveys meaning of the code more celearly (because that's what we
want to do here: set LazyContractProvider no matter how code finished),
and also defends from several corner-cases (like, make sure that we
properly set LazyContractProvider even if doCheckContract has throw an
exception)
2018-10-24 12:03:04 +03:00
Mikhail Zarechenskiy
bae3ff5211 Don't try parsing contract-like function not from kotlin package
Returning `null` from `doCheckContract` functions means that we
have failed to parse contract function and should report an error, but
if the called function isn't true contract, we shouldn't evaluate that code
at all.

 #KT-27758 Fixed
2018-10-24 12:03:04 +03:00
Mikhael Bogdanov
d82ca9ccd0 Rearrange repositories in android build script 2018-10-24 09:45:39 +02:00
Ilya Gorbunov
c8caed5b6f Duplicate MutableList.add docs in AbstractMutableList.add
Because the documentation inheritance doesn't work as desired here.
2018-10-23 22:21:25 +03:00
Ilya Gorbunov
efa7bf0c37 Unify kotlin.test docs 2018-10-23 22:21:25 +03:00
Piotr Krzeminski
3c46bb9d03 kotlin-test: Add documentation for value returned by assertFailsWith
A follow-up after https://youtrack.jetbrains.com/issue/KT-27418

Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-10-23 22:21:25 +03:00
Mikhail Levchenko
16918fa25e Remove confusing samples from SequenceBuilder docs
Problem:
SequenceBuilder is experimental and deprecated in 1.3 in favor of
SequenceScope. Usage of experimental package is discouraged in 1.3.
The documentation for SequenceBuilder refers to SequnceScope sample code,
which might be confusing.

Solution:
Remove samples for SequenceBuilder completely to discourage its usage,
but provide a note about it having deprecated in favor of SequenceScope.
Provide links to modern version of outdated SequenceBuilder.
2018-10-23 22:21:25 +03:00
Andrey Uskov
af5281e7c7 Fixed import in IDEA if required environment variables are not set.
#KT-26413 Fixed
2018-10-23 20:52:15 +03:00
Mikhael Bogdanov
d77175b7e4 Minor. Reformat 2018-10-23 16:27:53 +02:00
Mikhael Bogdanov
0288a1bd2d Restructure android test module, update dependencies 2018-10-23 16:27:52 +02:00
Mikhael Bogdanov
78fe9d8eee Move 'compileKotlinAgainstKotlin' java 8 tests to common 2018-10-23 16:27:51 +02:00
Mikhael Bogdanov
c6b4bae81f Move 'bytecodeText' java 8 tests to common 2018-10-23 16:27:50 +02:00
Mikhael Bogdanov
4284c19a16 Move 'writeFlags' java 8 tests to common 2018-10-23 16:27:50 +02:00
Yan Zhulanow
37c38b6e43 Add missing bunch for testResourceBundle (fixes flaky debugger tests)
See also e1f746f23c.
2018-10-23 17:12:12 +03:00
Sergey Igushkin
5ee6a6037d (minor) Move the unused source sets check to the taskGraph.whenReady
This is a workaround for Android compilations being configured in
an afterEvaluate callback.

Issue #KT-26963 Fixed
2018-10-23 16:15:05 +03:00
Denis Zharkov
834de23f39 Do not set version to buildNumber
They might be different in case of releases:
1.3.0 != 1.3.0-release-N
2018-10-23 15:39:01 +03:00
Denis Zharkov
cbbc0eae8c Use https when publishing to sonatype
Otherwise, NoHttpResponseException may happen sporadically
2018-10-23 15:39:01 +03:00
Ilya Matveev
ca152fed12 Update Kotlin/Native: 1.0.0 2018-10-23 18:30:50 +07:00
Mikhail Glukhikh
7a589d69da Fix 183 build 2018-10-23 14:16:19 +03:00
Alexander Podkhalyuzin
16d3bf7716 Fixed KotlinConfidenceTests 2018-10-23 13:57:42 +03:00
Nikita Katkov
d66619b1c2 BlockingMethodInNonBlockingContextInspection: resolve mode switched to partial & coroutine "released" status check 2018-10-23 13:18:32 +03:00
Toshiaki Kameyama
90529dfda4 "Remove redundant receiver" quick fix: Remove unused type parameter #KT-23512 2018-10-23 13:02:44 +03:00
Toshiaki Kameyama
0cd25353bc Lift assignment: do not report in cases where argument are of different types #KT-21520 Fixed 2018-10-23 12:48:03 +03:00
Mikhail Glukhikh
fcc6395b14 SetterBackingFieldAssignment: minor refactoring 2018-10-23 12:35:35 +03:00
Toshiaki Kameyama
29cc727c5a Add inspection for suspicious 'var' property #KT-23691 Fixed 2018-10-23 12:31:42 +03:00
Toshiaki Kameyama
3ede93df11 Introduce inspection: "Setter backing field should be assigned"
#KT-20273 Fixed
2018-10-23 11:22:40 +03:00
Mikhail Glukhikh
784d9f14f6 Rollback language / API version at the end of IDE tests
This should fix some flaky tests
2018-10-23 10:57:09 +03:00
Nikolay Krasko
0eb5934e09 Update channels list in update Kotlin dropdown (KT-25429)
#KT-25429 Fixed
2018-10-23 01:23:21 +03:00
Yan Zhulanow
5d2a3c097c Minor: Update kapt test (nullability annotation is gone in Enum constructors) 2018-10-22 23:06:05 +03:00
Alexey Sedunov
af5d4b3156 MPP: Fix adjustment of transitive project dependencies
#KT-27632 Fixed
2018-10-22 19:18:35 +03:00
Alexey Sedunov
fd4c07f0e6 MPP: Populate BuildScriptClasspathData if it's absent
This happens when Java support is not available in the IDE
(e.g. in CLion)
2018-10-22 19:18:34 +03:00
Alexey Sedunov
839d936918 MPP: Implement directory selection UI supporting non-JVM roots
#KT-27291 Fixed
 #KT-26696 Fixed
2018-10-22 19:18:32 +03:00
Alexey Sedunov
aa4e87fc4b Refactor: Introduce MoveSource class 2018-10-22 19:18:31 +03:00
Mikhael Bogdanov
2131a314b0 Add file content to parsing errors 2018-10-22 16:32:57 +02:00
Mikhael Bogdanov
9c3b367b93 Skip JVM_TARGET and SKIP_JDK6 tests on android 2018-10-22 16:32:56 +02:00
Mikhael Bogdanov
ce1d6e7217 Fix test in JDK independent way 2018-10-22 16:32:56 +02:00
Mikhael Bogdanov
a4206a543a Skip test on JDK 6 2018-10-22 16:32:55 +02:00
Mikhael Bogdanov
db25343f90 Run tests on different JDKs via different suites and custom test runner 2018-10-22 16:32:54 +02:00
Mikhael Bogdanov
55880ef013 Fix delegateFilter reinitialization
Otherwise IDEA marks all test as skipped
2018-10-22 16:32:54 +02:00
Mikhael Bogdanov
5b8acd69e3 Mute JVM IR tests 2018-10-22 16:32:53 +02:00
Mikhael Bogdanov
edc648813d Regenerate box tests 2018-10-22 16:32:52 +02:00
Mikhael Bogdanov
ac8e1a0124 Move JVM8 box test to common 2018-10-22 16:32:52 +02:00
Mikhael Bogdanov
b61608aba7 Add TARGET_BACKEND for JVM 8 tests 2018-10-22 16:32:51 +02:00
Mikhael Bogdanov
6ec7b8e0d3 Fix test server and proxy 2018-10-22 16:32:50 +02:00
Vyacheslav Gerasimov
38902149d2 Add bunch set for AS 3.4 2018-10-22 17:21:22 +03:00
Ilya Gorbunov
4a10d954fc Unify and improve Regex docs 2018-10-22 17:14:46 +03:00
Ilya Gorbunov
709a28060f Unify coroutine intrinsic docs 2018-10-22 17:14:46 +03:00
Ilya Gorbunov
63c5e18149 capitalize/decapitalize docs in stdlib/js 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
a1c0c679ee Common String.toNumber: clarify thrown exception types 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
1ed136a621 kotlin.system docs improvements
- Rewrite exitProcess docs in a more common way
- Add [block] parameter reference
2018-10-22 17:14:45 +03:00
Ilya Gorbunov
3aff7112e0 Minor: code formatting in Unit docs 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
ac5eeb885f Unify AbstractMutableMap JS docs 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
7fc6f06b70 Correct parameter reference in copyInto docs 2018-10-22 17:14:44 +03:00
Ilya Gorbunov
ebe9d59df7 Unify print/println/readLine docs 2018-10-22 17:14:44 +03:00
Ilya Gorbunov
406bd7c980 Minor: split math sources into regions 2018-10-22 17:14:44 +03:00
Alexander Podkhalyuzin
5c0d516044 Refactored plugin.xml
#KT-27698 Fixed
2018-10-22 16:26:08 +03:00
Ilya Chernikov
dd28d55c7d Implement proper JDK home passing logic for scripts, deprecating old one
KT-27497 fixed, as well as failing tests on TC
2018-10-22 09:48:49 +02:00
Ilya Matveev
9ccaef2f6b Specify K/N default libs directory more precisely (#1934) 2018-10-21 10:50:46 +07:00
Anton Bannykh
b83df18e22 [JS IR BE] make default argument lowering support per-file mode 2018-10-19 23:49:18 +03:00
Roman Artemev
4c30888d89 Fix test data 2018-10-19 19:38:00 +03:00
Nikolay Krasko
2c98153c6c Use withIgnoredConflicts to fix compilation in 191 2018-10-19 19:16:25 +03:00
Nikolay Krasko
e3d7edb6ce Not null name in RunProfile since 191 2018-10-19 19:16:24 +03:00
Nikolay Krasko
31b4db7f67 191: PersistentStateComponent and other declarations were moved to platform-api 2018-10-19 19:16:22 +03:00
Nikolay Krasko
17421ed14d 191: asm-all has 7.0-beta version in Intellij 191
Pass project to fetch extra parameters for asm-all work
2018-10-19 19:16:21 +03:00
Nikolay Krasko
e86b1f2761 Workaround for generalized configuration classes in 191 2018-10-19 19:16:19 +03:00
Nikolay Krasko
8d48f9d719 Make parameters in KotlinDefaultTemplatePropertiesProvider not-null
Otherwise there's an error in 191
2018-10-19 19:16:18 +03:00
Nikolay Krasko
b79762ec63 Fallback for nullable name in PsiClass 2018-10-19 19:16:17 +03:00
Nikolay Krasko
06478f5147 Unify usages of JavaRunConfigurationExtensionManager.getInstance() for 191 2018-10-19 19:16:15 +03:00
Nikolay Krasko
210b5a8ca2 element utility is removed in 191, use Element constructor instead 2018-10-19 19:16:14 +03:00
Nikolay Krasko
9299ea8f5d Introduce 191 bunch 2018-10-19 19:16:12 +03:00
Nikolay Krasko
d381b4d3eb J2K: rewrite JetRunConfiguration 2018-10-19 19:16:11 +03:00
Nikolay Krasko
6d71d024e2 J2K: Rename JetRunConfiguration 2018-10-19 19:16:10 +03:00
Mikhail Glukhikh
a5e508a083 Unused symbol: handle functions with inline class parameters correctly
#KT-27357 Fixed
2018-10-19 19:07:59 +03:00
Mikhail Glukhikh
0678a56ca4 Add workaround for tests to avoid problems with UnusedSymbolInspection
#KT-27664 Fixed

In particular, this should solve
"Could not initialized UnusedSymbolInspection" and
"Modifications during highlighting are not allowed"
2018-10-19 18:19:21 +03:00
Natalia Selezneva
9653fe2fcf Do not threat sources from buildSrc folder as library sources
#KT-27674 Fixed
2018-10-19 16:36:58 +03:00
Natalia Selezneva
6decd06b1b Provide dependency on buildSrc module for .gradle.kts files
#KT-23603 Fixed
#KT-14862 Fixed
#KT-24623 Fixed
#KT-25354 Fixed
2018-10-19 16:36:57 +03:00
Sergey Igushkin
285620cb28 (minor) Add missing mavenLocal() repo to a Gradle IT project 2018-10-19 16:23:01 +03:00
Roman Artemev
1338d6d66f Update tests 2018-10-19 14:07:20 +03:00
Roman Artemev
41ccea6807 [JS IR BE] Fix name clashes between static and top-level functions 2018-10-19 14:07:20 +03:00
Roman Artemev
c496d8ed50 Fix Char.toLowerCase/Char.toUpperCase extensions 2018-10-19 14:03:06 +03:00
romanart
0260dc813f Update tests 2018-10-19 14:03:06 +03:00
Roman Artemev
79f7cb11f0 [JS IR BE] Fix invoke on dynamic types 2018-10-19 14:03:06 +03:00
Toshiaki Kameyama
ecba862dc9 Expand selection for labeled return #KT-26987 Fixed 2018-10-19 12:24:47 +03:00
Roman Elizarov
790c5632ea Broken doc link to suspendCoroutineOrReturn fixed 2018-10-19 09:58:40 +03:00
Sergey Igushkin
bccca5cfa8 (minor) Fix testResolveMppLibDependencyToMetadata after stdlib was added 2018-10-18 20:10:13 +03:00
Sergey Igushkin
91b435b4bc Check the MPP model for unused Kotlin source sets, warn when found
Issue #KT-26963 Fixed
2018-10-18 20:10:13 +03:00
romanart
44d9ff6c71 Update tests 2018-10-18 19:00:43 +03:00
romanart
df5872281b [JS IR BE] Support instance check for Nothing type 2018-10-18 19:00:43 +03:00
Ilya Gorbunov
c72cf02e6c Add more missing SinceKotlin("1.3") annotations 2018-10-18 16:16:34 +03:00
Pavel Punegov
0bdbcbc662 Ignore the test that uses JVM functions and String constructor 2018-10-18 16:08:38 +03:00
Lukas Welte
70d0c1a0ae Mark Result, its extensions and runCatching as available since 1.3 2018-10-18 16:05:33 +03:00
Matthew Runo
374eec04d4 KT-27445: Add QuickFix for DEPRECATED_JAVA_ANNOTATION compiler warning 2018-10-18 15:56:15 +03:00
Mikhail Glukhikh
570c770d58 MPP web wizard: integrate Ktor inside #KT-27491 Fixed 2018-10-18 15:16:46 +03:00
Mikhail Glukhikh
c770a80ab9 MPP wizard tests: run Native tests using correct task name 2018-10-18 15:16:46 +03:00
Anton Bannykh
3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Anton Bannykh
e9c932260c [JS IR BE] minor refactoring 2018-10-18 14:25:48 +03:00
Anton Bannykh
29ff4d6677 [JS IR BE]: Disable incremental compilation tests until IC is supported 2018-10-18 14:24:05 +03:00
Anton Bannykh
995ac7aac2 [JS IR BE]: make deleteProperty non-inline due to new inliner limitations 2018-10-18 14:24:05 +03:00
Dmitry Savvinov
e2bf43c54f Minor: update testdata in ClsStubBuilder test on contracts 2018-10-18 13:15:05 +03:00
Alexander Udalov
5fb1bbe3f3 Add bytecode listing test on private default setter
Also fix test data of the kotlinp test and remove the newly added test
case in the obsolete PropertyGenTest

 #KT-20344 Fixed
2018-10-18 12:13:22 +02:00
Fabian Mastenbroek
05f6ed40f1 Don't generate setters for trivial private property setters
This change will prevent the compiler for generating Java bytecode for
private property setters that are trivial.

Since Kotlin uses direct field access for private properties, it will result
in the private setter never been used and since it cannot be accessed by any
other class without reflection, the setter cannot be covered by code
coverage tools.

See https://youtrack.jetbrains.com/issue/KT-20344 for the related YouTrack
issue.
2018-10-18 12:05:46 +02:00
Alexander Udalov
b1e82c78da Minor, remove obsolete KtMockFileTypeManager.java.183
This is a continuation of 4f0c31ef
2018-10-18 11:58:30 +02:00
Dmitry Savvinov
7887bafc5b Minor: update testdata in completion test on contracts 2018-10-18 12:09:10 +03:00
Dmitry Petrov
763e72603a Mark implicit 'invoke' calls with origin INVOKE 2018-10-18 10:59:24 +03:00
Dmitry Petrov
ad9953724f Basic infrastructure for psi2ir tests with JS front-end 2018-10-18 10:59:24 +03:00
Mikhail Glukhikh
01091ba1aa Refactor getKotlinTypeWithPossibleSmartCastToFP and related parts 2018-10-18 10:27:19 +03:00
Georgy Bronnikov
bbac1d802f JVM_IR. Support annotation classes with JvmField fields 2018-10-17 21:15:28 +03:00
Georgy Bronnikov
605afbae90 Move fields and init blocks of companions to their owners 2018-10-17 21:15:28 +03:00
Georgy Bronnikov
827494abbe JVM_IR. Mostly remove descriptors from ConstAndJvmFieldPropertiesLowering 2018-10-17 21:15:28 +03:00
Alexander Udalov
6e2e6794aa Remove unnecessary copy of ReflectionTypes
ReflectionTypes was copied from org.jetbrains.kotlin.builtins to
kotlin-native in
https://github.com/JetBrains/kotlin-native/commit/776f4c4b7, and then
was incorrectly copied back in 27365dc4be. This class is in fact only
needed in kotlin-native, where it was moved and simplified in
https://github.com/JetBrains/kotlin-native/commit/c3e921d53
2018-10-17 18:39:50 +02:00
Alexander Udalov
e3a332c393 Configure Java module path when compiler is invoked in -Xbuild-file mode
#KT-27626 Fixed
2018-10-17 18:39:50 +02:00
Alexander Udalov
1a1b7938fb Fix deprecated API usage in RemappingClassBuilder
#KT-25058 Fixed
2018-10-17 18:39:50 +02:00
Alexander Udalov
f868964e25 Fix most unchecked/deprecation javac warnings in compiler modules 2018-10-17 18:39:49 +02:00
Alexander Udalov
4f0c31eff3 Remove unneeded copied mock test framework classes
These classes were copied when tests-common were compiled with JDK 6, to
prevent dependencies on classes compiled with JDK 8
2018-10-17 18:39:49 +02:00
Alexander Udalov
23c210e9f2 Use JvmWildcard on return type of getContributedVariables/getContributedFunctions 2018-10-17 18:39:49 +02:00
Alexander Udalov
9dc53c38f3 Remove deprecated CompilerJarLocator 2018-10-17 18:39:49 +02:00
Alexey Tsvetkov
a44d70e79d Reformat kotlin-gradle-plugin according to code style 2018-10-17 19:31:30 +03:00
romanart
47b8e54f84 Update test data 2018-10-17 18:33:52 +03:00
romanart
d75434ac71 [JS IR BE] Support tailreq in JS 2018-10-17 18:33:52 +03:00
Zalim Bashorov
8ac2582e24 Forward gradle properties with prefix "fd." to test runner as system property("-D") w/o this prefix 2018-10-17 18:29:41 +03:00
Zalim Bashorov
99a131d0ab KJS test infrastructure: cache reference to global object and it's original state instead of evaluate them for each run 2018-10-17 18:29:41 +03:00
Zalim Bashorov
180215f3f8 Don't unmute passed tests by default 2018-10-17 18:29:40 +03:00
Zalim Bashorov
1ef3906481 Minor: reformat and cleanup NashornJsTestChecker.kt 2018-10-17 18:29:40 +03:00
Ingo Kegel
d853fcb642 Do not configure module SDK after the Gradle import if it was set explicitly with the Gradle Idea plugin (fixes KT-27530)
If `kotlinOptions.jdkHome` is set, this will still override the setting from the Gradle Idea plugin.
2018-10-17 17:48:27 +03:00
Alexey Sedunov
06e0fde74f Inspections: Report "unresolved property" only if reference is soft
#KT-27619 Fixed
2018-10-17 17:43:00 +03:00
Alexey Sedunov
0bf9a795aa Minor: Drop "(experimental)" from coroutines label
#KT-25681 Fixed
2018-10-17 17:43:00 +03:00
Dmitry Petrov
b13d270d77 Test: reference to constructor with inline class parameters 2018-10-17 16:38:22 +03:00
Dmitry Petrov
0af2a0dc19 Tests: references to private/internal primary val of inline class 2018-10-17 16:38:22 +03:00
Dmitry Petrov
5032c106af Support 'call' for references to inline class constructors
#KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
94e1701089 Support 'call' for references to inline class members
This includes overriding and non-overriding functions and properties.

 #KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
5003388d38 Unbox bound receiver if inline class type expected 2018-10-17 16:38:22 +03:00
Dmitry Petrov
9c7c0c8952 Propagate KotlinType to callable reference receivers 2018-10-17 16:38:22 +03:00
Dmitry Petrov
3dc4d01adc Tests for callable references and inline classes 2018-10-17 16:38:22 +03:00
Dmitry Petrov
8fc6b91f66 Minor: reformat 2018-10-17 16:38:22 +03:00
Dmitry Petrov
9a31e04062 Minor: reformat 2018-10-17 16:38:22 +03:00
Mikhail Glukhikh
0fc2a07ee4 Fix typo in import 2018-10-17 16:36:50 +03:00
Mikhail Glukhikh
94d87bfb67 MPP wizard tests: enable Groovy extension, don't wait for daemon death 2018-10-17 16:33:49 +03:00
Mikhail Glukhikh
02e6fb348d MPP wizard tests: check no empty files are generated 2018-10-17 16:33:47 +03:00
Mikhail Glukhikh
853d90d906 MPP wizard tests: extract test functions into separate class 2018-10-17 16:33:21 +03:00
Mikhail Glukhikh
35d4b7dfd9 MPP wizard tests: temporary fix for "failed to delete" problem 2018-10-17 16:33:19 +03:00
Mikhail Glukhikh
63146b98bb MPP wizard tests: add tests run #KT-27492 Fixed 2018-10-17 16:33:18 +03:00
Mikhail Glukhikh
855e2707e3 MPP wizard test: add project import (KT-27492) 2018-10-17 16:33:17 +03:00
Mikhail Glukhikh
43c8c44441 Add MPP wizard general test (KT-27492) 2018-10-17 16:33:15 +03:00
Mikhail Glukhikh
8281416dfa Introduce explicit plugin versions for MPP builder testing 2018-10-17 16:33:09 +03:00
Mikhail Glukhikh
a16318624b MPP wizards: remove unused module parameter from createProjectSkeleton 2018-10-17 16:33:06 +03:00
Sergey Igushkin
a88bfb726d Fix uninitialized lateinit compilerPluginOptionsTask in non-MPP
When a non-MPP is imported into the IDE, the importer anyway tries to
build the MPP source sets model, so it tries to access the
`compilerPluginArguments` and `compilerPluginClasspath`, resulting in
an import error.

Issue #KT-27646 Fixed
2018-10-17 16:19:16 +03:00
Alexander Udalov
5d040c459b Regenerate tests 2018-10-17 14:05:31 +02:00
romanart
71f109387a Update tests 2018-10-17 14:10:37 +03:00
romanart
6a66663739 Update IR Runtime 2018-10-17 14:10:37 +03:00
romanart
eb2a33ebee [JS IR BE] Implement lowering to connect kotlin Throwable with JS Error 2018-10-17 14:10:37 +03:00
Roman Elizarov
1a86411139 Removed todo from Continuation.context
The design decision was the we would not provide its default impl
2018-10-17 11:59:26 +03:00
Mikhail Zarechenskiy
fe233de825 Report error for Result as an extension receiver with safe call
#KT-27620 Fixed
2018-10-16 19:03:05 +03:00
Dmitriy Dolovov
249bdb969c Fix: K/N interop libs are not read by IDEA in certain cases
Issue #KT-27579 Fixed
2018-10-16 21:32:08 +07:00
Mikhail Glukhikh
2dd8b526fb Live templates test: fix typo & cleanup 2018-10-16 17:17:22 +03:00
Mikhail Glukhikh
0f94c0901f Introduce live templates for main without arguments #KT-27461 Fixed 2018-10-16 17:17:21 +03:00
Pavel V. Talanov
1c761c7864 KotlinJUnitRunConfigurationProducer: do not manually override sdk
Should be correct if the module is correct
Manually setting sdk led to problem in case of android SDK
2018-10-16 15:27:59 +02:00
Pavel V. Talanov
3c3e7b617b KotlinMultiplatformRunLocationsProvider: fix tests in android modules
Android modules are considered to be 'production' but can contain tests
    and test roots

 #KT-27371 In progress
2018-10-16 15:27:58 +02:00
victor.petukhov
a2b7912db9 Add expect and actual modifiers to the grammar (KT-25477) 2018-10-16 16:18:32 +03:00
victor.petukhov
205bd3f829 Replace the invalid rule name element to expression in the collectionLiteral grammar rule 2018-10-16 16:16:18 +03:00
Sergey Igushkin
c25cdb4264 Fix resourcesDir that cannot be imported due to not being a File 2018-10-16 14:30:25 +03:00
Sergey Igushkin
e103bea211 Import compiler plugin options from new MPP into IDE
Issue #KT-27499 Fixed
2018-10-16 14:30:25 +03:00
Sergey Igushkin
7075509b1e Import experimental annotations from new MPP into IDE
Issue #KT-26840 Fixed
2018-10-16 14:30:25 +03:00
Sergey Igushkin
9f2e5cdc4d Propagate the subplugin options from the tasks to the source sets
If a source set is used in only one compilation, take the options from
its compile task.

If a source set is used by multiple compilations of a single target,
either choose the 'main' compilation or choose any (this will happen
for Android, and it looks OK for the first time). If there are multiple
compilations of different targets, use the metadata compilation.

Issue #KT-27499 In Progress
2018-10-16 14:30:24 +03:00
Sergey Igushkin
e573911e16 Fix the format used by Kotlin/Native tasks for compiler plugin args
The correct format is "-P arg1", not "-Parg1".
2018-10-16 14:30:24 +03:00
Sergey Igushkin
ee63a6b3af Don't apply the Android Extensions subplugin to non-Android JVM tasks
In a multiplatform project with both Android and non-Android JVM targets
the subplugin should only affect the tasks of the Android target
2018-10-16 14:30:24 +03:00
Sergey Igushkin
5db23f1a81 Support -Xuse-experimental in the new MPP languageSettings { ... } DSL
Add the corresponding Gradle plugin DSL, consistency checks, and logic
for propagating these settings to the compiler during build.

Issue #KT-26840 In Progress
2018-10-16 14:30:24 +03:00
Sergey Rostov
bde6d841c1 IC: move CacheVersionManager from build_common to jps plugin, tests 2018-10-16 13:33:24 +03:00
Sergey Rostov
0d1f7965d4 JPS, CacheAttributesManager: remove unused methods 2018-10-16 12:29:58 +03:00
Sergey Rostov
d91f6f8c43 IC: move CacheVersionManager from build_common to jps plugin 2018-10-16 12:29:58 +03:00
Sergey Rostov
940861c245 IC: remove CacheVersionManager usages from build_common.
They are kept up to date but was never used.
2018-10-16 12:29:58 +03:00
Sergey Rostov
5232f080d6 JPS: Fix updating cache format version for rebuilt targets by removing i/o optimization
Problem: previously, format-version.txt file was deleted while cleaning
target output on rebuild. Since directory was deleted, cache
attributesDiff stored in memory was not updated. This causes that on
saveExpectedStateIfNeeded does nothing.

The right way to fix it is move cache version format diff into
AbstractIncrementalCache, and override `clean()` method. But this is
hard to do for lookup storage, since used compilers set (jvm/js) will
known only after context init. This can be done by moving `expected`
attributes out of manager, but this is huge change for small benefit.

So, the optimal way for now is to write version for each build, even if
it is not changed.

#KT-27044 Fixed
2018-10-16 12:29:58 +03:00
Alexey Sedunov
cf31e4d58c MPP: Recover content root import accidentally removed earlier 2018-10-16 12:05:19 +03:00
Alexey Sedunov
fea397a2ad MPP: Support MPP-dependent Java modules in Android projects
#KT-27265 Fixed
2018-10-16 12:05:19 +03:00
Alexey Sedunov
dcdd42ba00 MPP: Add Android tests for new MPP 2018-10-16 12:05:19 +03:00
Alexey Sedunov
da06e49b19 MPP: Merge module dependencies if one of them has COMPILE scope 2018-10-16 12:05:18 +03:00
Alexey Sedunov
d36ee02499 Gradle: Retrieve AndroidModuleModel using IdeModifiableModelsProvider
Otherwise it may be null if module is just created by the import
2018-10-16 12:05:18 +03:00
Alexey Sedunov
3a0e539eee MPP: Add MPP source roots to dependent non-MPP module
#KT-27365 Fixed
2018-10-16 12:05:18 +03:00
Alexey Sedunov
558345b057 MPP: Assign TEST scope to dependencies of test source sets
#KT-26868 Fixed
2018-10-16 12:05:17 +03:00
Alexey Sedunov
523b662680 MPP: Update Kotlin version in tests to 1.3-RC3 2018-10-16 12:05:17 +03:00
Alexey Sedunov
abec171685 Native: Register '.klib' extension through FileTypeFactory 2018-10-16 12:05:17 +03:00
Alexey Sedunov
ca2367f2b5 MPP: Rewrite ImportedModule name instead of wrapping it
Otherwise this instance is not deserialized properly
breaking import on opening project in AS

 #KT-27485 Fixed
 #KT-27473 Fixed
2018-10-16 12:05:17 +03:00
Denis Zharkov
bda1ef8d57 Do not run bytecode optimization passes for in bodyless modes
FunctionsFromAnyGeneratorImpl has been changed because previously
it didn't satisfy annotation visitor contract but it wasn't important
for MethodNode
2018-10-16 11:16:53 +03:00
Denis Zharkov
26da0b9e7e Do not call default constructor of SourceInterpreter in subclasses
It became illegal since asm-6.x

See c72a86bd5f/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java (L56)

 #KT-27572 Fixed
2018-10-16 11:16:53 +03:00
Valentin Kipyatkov
c63eb18b3c Fixed nested class in companion object case 2018-10-16 08:41:43 +03:00
Valentin Kipyatkov
28e2683146 One more test 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov
69f74b2a51 Fixed ShortenReferences for extension on companion object 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov
d4e0f53583 Fixed ShortenReferences for the case of extension for object 2018-10-16 08:41:42 +03:00
Dmitriy Dolovov
840ee66fd0 MPP Wizards: Clearer notation in generated build.gradle files
- Follow the same style as used in public documentation: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html
- Use standard methods to get link task name, don't evaluate it manually
2018-10-16 10:20:06 +07:00
Georgy Bronnikov
4942ed5e7a Clean up backend.common.ir.IrUtils.kt 2018-10-15 21:52:50 +03:00
Georgy Bronnikov
376eef05f5 JVM_IR. Accessor lowering 2018-10-15 21:52:50 +03:00
Georgy Bronnikov
a23aae590e JVM_IR. Avoid unbound symbols and declarations without parent 2018-10-15 21:52:50 +03:00
Toshiaki Kameyama
9b49c23668 Move lambda out: don't report in delegation #KT-27584 Fixed 2018-10-15 19:52:10 +03:00
Pavel Punegov
8ea8acc7f7 Set target backend to JVM for tests that have @JvmStatic annotations 2018-10-15 19:25:03 +03:00
Pavel Punegov
ed64d42d45 Regenerate JS tests 2018-10-15 19:25:02 +03:00
Pavel Punegov
eb6580acdd Return native ignore back.
K/N doesn't initialize companion objects if no methods were called from them
2018-10-15 19:25:02 +03:00
Pavel Punegov
d9a8a00069 Make tests that use jvm-annotations be targeted to jvm backend 2018-10-15 19:25:02 +03:00
Pavel V. Talanov
8be3e902a8 ResolutionFacadeWithDebugInfo: do not wrap index not ready exception
Fixes problems where `catch (IndexNotReadyException)` blocks
    in IDEA code would not work
2018-10-15 15:10:50 +02:00
Pavel Punegov
aab28e6cc7 Revert "Make coroutines test JVM-only"
This reverts commit 17b7bbce
2018-10-15 13:52:16 +03:00
Natalia Selezneva
648e8acbde Update testdata after the fix of KT-27095
(replace http with https configuring gradle project)
2018-10-15 12:28:43 +03:00
Dmitry Petrov
b6be72bb11 Add more tests for inline classes
#KT-27416
 #KT-27513
2018-10-15 12:21:14 +03:00
Dmitry Petrov
0fd68d29f4 Support @JvmStatic in inline class companion object
#KT-27107
2018-10-15 12:21:14 +03:00
Dmitry Petrov
5304754e88 Generate specialized 'toString' for inline classes when possible
#KT-25613
2018-10-15 12:21:14 +03:00
Dmitry Petrov
f68ce4b35b Support default parameter values for inline class constructors and funs
#KT-26908
 #KT-26554

Move default parameter value tests to separate directory
2018-10-15 12:21:14 +03:00
Dmitry Petrov
8ce1d09f8a Fix inline class coercion in default parameter values
#KT-27358
2018-10-15 12:21:14 +03:00
Natalia Selezneva
c2315f065a Add test for script definitions settings 2018-10-15 11:32:49 +03:00
Natalia Selezneva
71e72ec6c2 Add button to open script settings from Multiple script definition notification 2018-10-15 11:32:49 +03:00
Natalia Selezneva
6596a6ba75 Allow to switch off script definitions
^KT-24465 Fixed
2018-10-15 11:32:48 +03:00
Natalia Selezneva
7826f44180 Save ScriptDefinitions order into kotlinScripting.xml
^KT-24465 In Progress
2018-10-15 11:32:48 +03:00
Natalia Selezneva
77e687df92 Change base class for ErrorGradleScriptDefinition (migrate to new API) 2018-10-15 11:32:48 +03:00
Natalia Selezneva
3f20453ccf Do not create multiple ErrorGradleScriptDefinitions 2018-10-15 11:32:48 +03:00
Natalia Selezneva
9ab4d727e9 Provide UI for changing the order of script definitions applicability
^KT-24465 In Progress
2018-10-15 11:32:47 +03:00
Natalia Selezneva
2df8adc50b Move option for auto-reloading script dependencies to 'Kotlin Scripting' page 2018-10-15 11:32:47 +03:00
Natalia Selezneva
54f3982709 Add 'Kotlin Scripting' configuration tab
^KT-24465 In Progress
2018-10-15 11:32:47 +03:00
Natalia Selezneva
02c1ae62c3 Show notification if there are more than one script definition applicable for one script file (KT-24466)
^KT-24466 Fixed
2018-10-15 11:32:47 +03:00
Dmitry Savvinov
99e1d4ab45 Check for the presence of dispatch receiver too in isEqualsDescriptor()
Otherwise, top-level function with the name 'equals' and suitable
signature will be (erroneously) treated as true 'equals' invocation,
leading to further exception (see EA-126602)
2018-10-15 10:54:39 +03:00
Natalia Selezneva
28e43b0487 Indexes should be updated if there are new dependencies for script file
KT-26271 Fixed
2018-10-15 09:43:49 +03:00
Natalia Selezneva
c4aab8340b Do not store script definition in psiFile
This may cause problems when definitions are reordered or switched off
KT-27375 Fixed
2018-10-15 09:43:49 +03:00
Svyatoslav Kuzmich
02277d0293 [JS IR BE] ExpectDeclarationsRemoving lowering
* Copy lowering from konan to common
* Keep actual default parameters when both actual and expect default parameters are present
* Run lowering before inline in JS IR BE to fix
  box/multiplatform/defaultArguments/inlineFunctionWithDefaultLambda.kt
2018-10-15 00:03:46 +03:00
Svyatoslav Kuzmich
4c38d55f21 [JS IR BE] Unmute tests 2018-10-15 00:03:45 +03:00
Svyatoslav Kuzmich
5a057f8ca6 [JS IR BE] Support 'is Number' and 'is Comparable<>' 2018-10-14 23:53:03 +03:00
Svyatoslav Kuzmich
783f27c554 [JS IR BE] Support Number.to(Byte|Short|Int|Float|Double|Long) 2018-10-14 23:53:03 +03:00
Svyatoslav Kuzmich
bad9534abd [JS IR BE] Support integer operation overflow 2018-10-14 23:53:02 +03:00
Zalim Bashorov
8013a56286 [JS IR BE] process empty loops correctly in BlockDecomposerLowering 2018-10-13 01:51:59 +03:00
Zalim Bashorov
6d592ae66b Unmute tests 2018-10-13 01:51:59 +03:00
Zalim Bashorov
dfc3bda3b4 Minor: remove forgotten "TODO" 2018-10-13 01:51:58 +03:00
Nikolay Krasko
ea9d4037e6 Minor: cleanup KotlinLightCodeInsightFixtureTestCase.kt 2018-10-12 18:50:06 +03:00
Nikolay Krasko
d8fda8b153 Tests for navigation to stdlib multiplatform sources (KT-26004)
#KT-26004 Fixed
2018-10-12 18:50:05 +03:00
Nikolay Krasko
e3d930a6a1 Build maven-like stdlib sources artifacts during dist
This is needed to emulate gradle and maven like projects in plugin tests.
2018-10-12 18:50:04 +03:00
Nikolay Krasko
ac2bc22f54 Use information from stub for contracts presence 2018-10-12 18:21:39 +03:00
Nikolay Krasko
d3ec145f13 Fixes for ReplaceArraysCopyOfWithCopyOfInspection
- Reduce applicability range
- Don't fix reporting level, otherwise it won't be possible to change
  it in settings
- Using isCalling utility
2018-10-12 18:21:38 +03:00
kenji tomita
e6de8e9cd3 Inspection to convert Arrays.copyOf(a, size) to a.copyOf(size) 2018-10-12 18:21:36 +03:00
Nikolay Krasko
fc4f7303d3 Disable highlighting for decompiled Kotlin files (KT-27284)
#KT-27284 Fixed
2018-10-12 18:21:35 +03:00
victor.petukhov
b86211b434 Add spec tests for integer literals 2018-10-12 17:31:24 +03:00
Natalia Selezneva
4f04d4503a Highlight files in diff view (KT-17892)
KT-17892 Fixed
2018-10-12 15:27:46 +03:00
Natalia Selezneva
db0021718f Set since-build for Idea 182 and AS 3.3 to 182.4323.46 2018-10-12 15:27:46 +03:00
Natalia Selezneva
605396f9e2 Update idea to 2018.2.3 (182.4323.46) 2018-10-12 15:27:46 +03:00
Natalia Selezneva
6bddf36725 Update as33 branch to AS3.3 canary 12 2018-10-12 15:27:46 +03:00
Natalia Selezneva
3744a00f77 Run Kotlin Scratch in the background cancelable task (KT-25032)
KT-25032 Fixed
2018-10-12 15:27:46 +03:00
Natalia Selezneva
00e0f430ac Add shortcut and menu item for Run Scratch Action (KT-24180)
KT-24180 Fixed
2018-10-12 15:27:45 +03:00
Natalia Selezneva
af2235fd1d Fix compatibility with anko plugin 2018-10-12 15:27:45 +03:00
Natalia Selezneva
c73885142a Do not access stubs in dumb mode finding script definition 2018-10-12 15:27:45 +03:00
Natalia Selezneva
daa6e9b562 Minor: reformat and rearrange code 2018-10-12 15:27:45 +03:00
Ilmir Usmanov
a5bcd3495e Simplify tail-call optimisation check
Check, that all suspension points are immediately followed by ARETURN
and do not check that all these ARETURNs are immediately preceded by
suspension points.
 #KT-27190 Fixed
2018-10-12 15:10:12 +03:00
Vyacheslav Gerasimov
d11fbac511 Build: Use cache-redirector.jetbrains.com to prevent connection timeouts 2018-10-12 14:57:37 +03:00
Yan Zhulanow
a8aab3fbe5 as33: Remove declaration of the KotlinAndroidGradleOrderEnumerationHandler extension from as33 (KT-26975)
'idea-android' module is not put into the plugin made for Android Studio 3.3 as it has its own copy of 'idea-android'.
2018-10-12 14:50:53 +03:00
Ilmir Usmanov
e21159c28f Report suspension point in monitor error on crossinline lambdas
#KT-27258: Fixed
2018-10-12 14:21:42 +03:00
Zalim Bashorov
3f0bd20235 Add an ability to run/debug ir tests inside node.js (even from IDEA) 2018-10-12 13:57:03 +03:00
Mikhail Zarechenskiy
b7d7d1eb01 Fix inline class type coercion in == with generic call
#KT-27393 Fixed
2018-10-12 12:50:49 +03:00
Mikhail Zarechenskiy
0201694f84 Propagate KotlinType into create method for coroutines
#KT-27526 Fixed
2018-10-12 12:50:47 +03:00
Mikhail Zarechenskiy
a8abd8cceb Fix boxing/unboxing for generic functions on index expressions
Unsubstituted type should be used for coercion to box value of
 inline class type if it's needed. For the substituted value it's not
 known if it was a generic parameter or not.

 #KT-27502 Fixed
2018-10-12 11:58:56 +03:00
Nikolay Krasko
882a12d916 Exit if it's impossible to create file during copy/past (KT-26210)
#KT-26210 Fixed
2018-10-12 11:48:49 +03:00
Toshiaki Kameyama
749fd5dd80 "Convert property to function" intention: don't suggest if property has @JvmField annotation #KT-27157 Fixed 2018-10-11 21:01:27 +03:00
Toshiaki Kameyama
487b1e96be "Introduce backing property" intention: don't suggest if property has @JvmField annotation #KT-27156 Fixed 2018-10-11 21:00:44 +03:00
Toshiaki Kameyama
ca335880eb "Convert property initializer to getter" intention: don't suggest if property has @JvmField annotation #KT-27139 Fixed 2018-10-11 20:59:33 +03:00
Toshiaki Kameyama
3866c85a34 Add accessor intention: don't suggest if property has @JvmField annotation #KT-27139 Fixed 2018-10-11 20:59:33 +03:00
Ilya Gorbunov
27dc160aef Rename Random companion object to Default
#KT-27508
2018-10-11 19:06:12 +03:00
Sergey Igushkin
81b4031a35 Remove internal Gradle API usage for stale output cleanup
BuildOutputCleanupRegistry tracks the all of the outputs that belong to
the Gradle build, so when Gradle runs in an unknown state (e.g. without
any history), it can detect stale outputs in the output directories and
delete them.

Since this is an internal API, its usage is removed. Instead, another
way to tell Gradle that a set of directories belongs to the build is to
add them to the `delete` task targets.
2018-10-11 19:01:53 +03:00
Sergey Igushkin
a0f4d5a637 Get rid of FileCollectionInternal usage that breaks with Gradle 5.0+
Remove the implementation of the `FileCollectionInternal` interface in
`KotlinCompilationOutput`. This interface may change unexpectedly (and
does between Gradle 4.10 and 5.0) so we need to get rid of its
implementation.

On the other hand, we can't just implement `FileCollection` instead
because Gradle internally assumes that all `FileCollection` instances
are also `FileCollectionInternal`. So the way to fix this is to remove
`SourceSetOutput` from superinterfaces of `KotlinCompilationOutput`
altogether.

Instead, to work with `SourceSetOutput` and `KotlinCompilationOutput`
in a uniform way, provide a wrapper for `SourceSetOutput`:
`KotlinWithJavaCompilationOutput` that is basically a proxy
class.
2018-10-11 19:01:52 +03:00
Alexey Sedunov
174fd41564 Rename: Restore project scope (fixing failing tests)
It fixes search of usages for some cases where element's useScope()
is not enough (like parameter references in named arguments)
2018-10-11 17:56:27 +03:00
Alexey Sedunov
84d9f8250c Configuration: Ensure facet UI is initialized in apply() call
#KT-27187 Fixed
2018-10-11 17:56:27 +03:00
Alexey Sedunov
3fcf6e7719 Change Signature: Clear callback after the call
Retaining the callback leads to the leak of obsolete resolve data
2018-10-11 17:56:27 +03:00
Alexey Sedunov
c3af3cc482 Configuration: Do not use read action during conpiler settings loading
It may lead to deadlock (see KT-27298)

 #KT-27298 Fixed
2018-10-11 17:56:27 +03:00
Alexey Sedunov
26d77183df Misc: Update repository URLs in importer test data 2018-10-11 17:56:27 +03:00
Alexey Sedunov
7553fd2766 Misc: Disable some tests for recent Gradle versions
Old-style MPP doesn't work there due to ExternalProject not being built
2018-10-11 17:56:26 +03:00
Toshiaki Kameyama
061aa63a73 "Make private" intention: fix some false positive cases 2018-10-11 17:20:46 +03:00
Mikhail Glukhikh
7488056249 Use 'canBeInternal' in ChangeVisibilityFix (related to KT-27138) 2018-10-11 17:20:30 +03:00
Toshiaki Kameyama
c65e246e02 Make private: don't suggest if property has @JvmField annotation
#KT-27138 Fixed
2018-10-11 17:20:13 +03:00
Mikhail Glukhikh
248e09ff2c Refactoring: ConstantConditionIfInspection
Transform collectFixesAndRegisterProblem to just collectFixes
2018-10-11 17:19:55 +03:00
Toshiaki Kameyama
5c83c247d7 "Simplify comparison": remove if when possible after applying quickfix
#KT-25995 Fixed
2018-10-11 17:19:10 +03:00
Mikhail Glukhikh
688fc386b6 Refactoring: introduce resolve to property descriptor 2018-10-11 17:14:17 +03:00
Mikhail Glukhikh
b08f966428 Use kotlin-stdlib instead of kotlin-stdlib-jdk8 in MPP mobile wizard
#KT-27356 Fixed
2018-10-11 17:12:31 +03:00
Mikhail Glukhikh
42888572cb MPP wizards: generate different file names to avoid KT-21186
#KT-27456 Fixed
2018-10-11 17:11:44 +03:00
Anton Bannykh
8852ef9e75 [JS IR BE] fix multimodule 2018-10-11 16:02:21 +03:00
Zalim Bashorov
9041d717a2 [JS IR BE] add IrType.asString that return stable string representation to use it for stringified signatures
`IrType.render` was used before, but it's written for debugging purpose and generates unstable string representation.
2018-10-11 14:54:55 +03:00
Ilmir Usmanov
c4d0b5493a Fix NPE in suspension point in monitor call checker
#KT-27484 Fixed
2018-10-11 14:38:34 +03:00
Denis Zharkov
36c73eedbf Minor. Move DslMarkerOnFunctionTypeReceiver entry closer to 1.4 features 2018-10-11 10:23:02 +03:00
Denis Zharkov
75dc8ce1c3 Fix exception in light classes when type alias in MultifileClass
#KT-27355 Fixed
2018-10-11 10:22:09 +03:00
Toshiaki Kameyama
dc750cdbb3 Call chain into sequence: add 'unzip' to conversion targets #KT-27486 Fixed 2018-10-11 09:18:30 +03:00
Toshiaki Kameyama
3f252b15e1 Call chain into sequence: add 'flatten' to conversion targets #KT-26969 Fixed 2018-10-11 09:17:23 +03:00
Nikolay Krasko
bd27460694 Prevent IDEA attach debugger to serialize task
Workaround for IDEA-200192

IDEA patches JavaExec tasks and adds
agentlib:jdwp= jvm parameter when running under debug.

Replace parameters after IDEA has finished patching parameters.
2018-10-10 20:58:00 +03:00
Svyatoslav Kuzmich
7074909230 [JS IR BE] Support enumValues<T>() and enumValueOf<T>(name) 2018-10-10 19:35:17 +03:00
Svyatoslav Kuzmich
bdc3daf972 [JS IR BE] Support Enum::values 2018-10-10 19:35:17 +03:00
Svyatoslav Kuzmich
0210ec3114 [JS BE] Fix KT-26787: handle JsSwitch in LabeledBlockToDoWhileTransformation 2018-10-10 19:35:16 +03:00
Pavel Punegov
f543170998 Increase tolerance for Float asin test 2018-10-10 19:05:44 +03:00
Sergey Bogolepov
2f1f32bbf4 Replace random val in companion object with top level val 2018-10-10 19:04:55 +03:00
Pavel Punegov
17b7bbce8c Make coroutines test JVM-only 2018-10-10 19:04:31 +03:00
Pavel Punegov
3dd16da315 Fix vararg test for native that assigns named argument.
Ignore test that uses nested class in enum in native
2018-10-10 19:03:56 +03:00
Pavel Punegov
dd1c9fa9f0 Native: Ignore tests that use reflection not implemented in native 2018-10-10 19:01:35 +03:00
Pavel Punegov
82b59c5044 Native: Ignore tests that use jvm or full reflect 2018-10-10 19:00:50 +03:00
Svyatoslav Kuzmich
89f7ced0d4 [JS IR BE] Unmute tests 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
e73ff16b35 [JS IR BE] Refactor: split IntrinsicifyCallsLowering into multiple classes 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
749556f565 [JS IR BE] Support Long coercion 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
c7bde6a5e6 [JS IR BE] Fix runtime compareTo(Number, Long) 2018-10-10 17:27:36 +03:00
Anton Bannykh
44d56cb278 JS: fix val with backing field initialization in secondary constructors
This change reverts the AssignmentTranslator logic to a previous state
of "if we assign to a val, tranlate to backing field". Previously a
check whether or not we are inside of a constructor was added. The
check didn't detect secondary constructors, hence initializing of
val's with backing field started to work incorrectly.

The check itself was added in an attempt to prevent augmented assignment
operators to reference the backing field. The check seems to have been
wrong, because an augmented assignment could happen inside a construcotr.
A more correct fix was added later. It seems that it is safe now to
revert the logic back and rely on the frontend to only allow assignment
to a val property during initilization.
2018-10-10 17:25:55 +03:00
Mikhail Glukhikh
6be65e7d1a Replace equals with == involving FP types: handle possible smart casts
This fixes two relevant tests with smart casts
#KT-25933 Fixed
2018-10-10 15:02:47 +03:00
Mikhail Glukhikh
04cadf3f58 Reformat ReplaceCallWithBinaryOperator 2018-10-10 15:02:45 +03:00
kenji tomita
1aa9d5673b Do not highlight replacement of equals involving floating-point types
Two tests with smart casts do not work yet
Part of KT-25933
2018-10-10 15:02:43 +03:00
Anton Bannykh
8c6337f3f6 [JS IR BE]: support dynamic_var["foo"] = "bar"
Used EQ origin to detect. Added a test to check dynamic_var = "bar" case
is not affected
2018-10-10 13:43:22 +03:00
Anton Bannykh
7afb81a7df JVM_IR: fix ranges' test generator 2018-10-10 13:13:36 +03:00
Ilya Chernikov
7fbfad814e Fix default host configuration property - make it not shared:
Shared instance is incorrect here and causes clashes when many
definitions are loaded in the same process.
Also make the diagnostics in case of clashes more verbose.
2018-10-10 10:53:57 +02:00
John Eismeier
ac69fa14d5 Is the Interface with out the f a type? 2018-10-10 09:44:10 +03:00
Ilmir Usmanov
9af7316845 Add call checker to report error more granulary if possible
This, however, works only for calls of 'synchronized' only. Thus, it
does not support inline functions of any kind.
2018-10-09 22:55:51 +03:00
Ilmir Usmanov
281f09f077 Rework check of suspension point inside critical section
There is a trade-off between robustness of check and accuracy of the
diagnostic: the previous version, which works on generation, was too
fragile and lead to false-positives. Now we check on state machine
generation. However, since we do not have PSI for call, we can only
report diagnostic on whole suspend function or suspend lambda.
Additionally, the state machine is generated on crossinline suspend
lambdas regeneration and thus we do not have the PSI for the lambda as
well!

 #KT-27130 Fixed
 #KT-27258 Open
2018-10-09 22:55:48 +03:00
Ilmir Usmanov
1b04945625 Revert: Forbid suspension points in critical sections 2018-10-09 22:55:43 +03:00
Vyacheslav Gerasimov
37a88fda78 Build: Remove shadow jar task from custom-deps/intellij-sdk project 2018-10-09 20:48:27 +03:00
Vyacheslav Gerasimov
78d4abf954 Build: set version for build-scan plugin to 1.15 since 1.16 fails with NPE 2018-10-09 20:27:15 +03:00
Sergey Igushkin
294bd8c7fa Fix resolution of Java Usage artifacts for configurations with no usage
When Gradle resolves a dependency on a publication with no metadata
(or with metadata disabled), it represents it as two variants, one with
Usage `java-api`, the other with `java-runtime`. It turns out that the
`java-api` one does not contain transitive dependencies with Maven scope
`runtime`.

This commit makes the Kotlin Gradle plugin disambiguation rules behave
the same way as those defined in the JavaBasePlugin: when no Usage is
requested, prefer the runtime usages as they are more complete.
2018-10-09 19:17:36 +03:00
Sergey Igushkin
748dc203e5 Fix unresolved library with 'java-api' and 'java-runtime' usages 2018-10-09 19:17:36 +03:00
romanart
d77a0f109b Update tests 2018-10-09 15:33:04 +03:00
romanart
5af114da07 Add unit into compilation 2018-10-09 15:33:03 +03:00
romanart
9b40981368 [JS IR BE] Unit Materialization lowering
Fix unit-related things across backend
2018-10-09 15:32:52 +03:00
Toshiaki Kameyama
57ae60e9dc "Add else branch" on when quickfix: don't add braces #KT-5088 Fixed 2018-10-09 12:28:08 +03:00
Toshiaki Kameyama
f22133be7e Call chain into sequence refactoring: introduce & use isIterable
Related to KT-26650
2018-10-09 12:22:19 +03:00
Toshiaki Kameyama
416d33fc92 Refactoring: extract KtCallExpression.isCall(FqName) function 2018-10-09 12:22:18 +03:00
Toshiaki Kameyama
9a725b99b2 Call chain into sequence: fix false negative on Iterable
#KT-26650 Fixed
2018-10-09 12:22:17 +03:00
Mikhail Glukhikh
2e5ee242c7 Minor refactoring: implicitVisibility 2018-10-09 11:50:21 +03:00
Toshiaki Kameyama
3be5f2b843 "Redundant visibility": Fix false positive for overridden setter
#KT-26051 Fixed
2018-10-09 11:48:00 +03:00
Toshiaki Kameyama
1c8e75eb34 if then to elvis: propose transformation to 'let' #KT-26653 Fixed 2018-10-09 11:41:06 +03:00
Toshiaki Kameyama
539c55c5b2 Call chain into sequence: fix false negative on implicit receiver
Part of KT-26650
2018-10-09 11:33:55 +03:00
Mikhail Glukhikh
0285cae2fd Minor: introduce 'lazyTerminations' in Call chain --> Sequence
Related to KT-27104
2018-10-09 11:32:25 +03:00
Toshiaki Kameyama
8fc5fefc7f Call chain --> Sequence: don't report if first call is 'groupingBy'
#KT-27104 Fixed
2018-10-09 11:26:50 +03:00
Mikhail Glukhikh
b500239bd1 Call chain -> sequence: minor style fix 2018-10-09 11:09:58 +03:00
Toshiaki Kameyama
3c75dd7b5a Fix inspection message 2018-10-09 11:09:43 +03:00
Toshiaki Kameyama
920c200693 Call chain --> Sequence: introduce "call chain length" parameter
#KT-26571 Fixed
2018-10-09 11:09:28 +03:00
Mikhail Glukhikh
a43be4cbe8 Fix testNotPossible (no more conversion to secondary constructor) 2018-10-09 11:08:37 +03:00
victor.petukhov
c01362a943 Fix path separators for Windows in spec test validator 2018-10-09 10:00:07 +03:00
victor.petukhov
4ee0a666cb Temporary mute test with FrontEndException (KT-26386) 2018-10-09 09:59:56 +03:00
victor.petukhov
f61980732b Mute tests with unexpected behaviour 2018-10-09 09:59:46 +03:00
victor.petukhov
e90cf4b955 Actualize test with return expression in contract description (implies) 2018-10-09 09:59:35 +03:00
victor.petukhov
4a372458d6 Include part of the spec tests to the compiler dist tests 2018-10-09 09:59:20 +03:00
Ilya Matveev
85ba5f11d6 Add configuration methods for kotlinOptions in K/N tasks
Issue #KT-26758 fixed.
2018-10-08 17:44:32 +03:00
Ilya Matveev
ee5bc95da5 Fix up-to-date checks for framework compilation 2018-10-08 17:44:32 +03:00
Ilya Matveev
73138073f1 Take K/N version into account in UP-TO-DATE checks for cinterop tasks 2018-10-08 17:44:32 +03:00
Alex Saveau
524ae9df7d Fix bugs causing early task evaluation (#1812)
* Fix bugs causing early task evaluation

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix another call forcing tasks evaluation  Add a test for lazy tasks
2018-10-08 14:07:22 +03:00
James Wald
b7d0d20739 Fix typo in expression precedence table 2018-10-08 14:00:51 +03:00
Nikolay Krasko
1aab3c890c Minor: fix typo 2018-10-08 13:40:29 +03:00
Alexey Belkov
f3bb952148 Remove useless code to determine default visibility 2018-10-08 13:40:28 +03:00
Nikolay Krasko
daf6036bc0 Update Android Studio 3.3 dependency to 3.3.0.10 2018-10-08 13:40:27 +03:00
Nikolay Krasko
76a3f23df0 Test for stubs of extension/non-extension properties with same name (KT-27274)
An issue was probably fixed in 98232265d7

 #KT-27274 Fixed
2018-10-08 13:40:25 +03:00
Toshiaki Kameyama
b0c3461eab Add quickfix for ASSIGN_OPERATOR_AMBIGUITY on mutable collection '+=', '-='
KT-26236 Fixed
2018-10-05 15:58:39 +03:00
Toshiaki Kameyama
725cb88f41 Add quick-fix to "Unlabeled return inside lambda" inspection #KT-27007 Fixed 2018-10-05 10:01:31 +02:00
Vyacheslav Gerasimov
d7b885159e Revert Workaround IndexOuOfBoundsException on configuration with gradle 4.7 2018-10-04 18:28:16 +03:00
Toshiaki Kameyama
f4a637a72e "Convert object literal to lambda" inspection: report at INFORMATION level if object literal has 'return' #KT-27116 Fixed 2018-10-04 13:13:52 +02:00
Toshiaki Kameyama
23734bae3e Add quickfix for DECLARATION_CANT_BE_INLINED #KT-9983 Fixed 2018-10-04 13:11:36 +02:00
Toshiaki Kameyama
c44d3a8d68 Show lambda parameter info #KT-13118 Fixed 2018-10-03 19:08:56 +03:00
victor.petukhov
30fc76a602 Remove redundant directives to contracts use 2018-10-03 13:49:32 +03:00
victor.petukhov
4819223b74 Add generated codegen box tests for Boolean literals as identifiers 2018-10-03 13:49:31 +03:00
victor.petukhov
1bc0c4092c Add codegen box test templates for identifiers 2018-10-03 13:49:30 +03:00
victor.petukhov
dd91727a78 Add generated PSI tests for Boolean literals as identifiers 2018-10-03 13:49:22 +03:00
victor.petukhov
ed73513d48 Add PSI test templates for identifiers 2018-10-03 13:49:20 +03:00
victor.petukhov
4bfa90dc25 Refactor files in the 'spec' package 2018-10-03 13:49:11 +03:00
victor.petukhov
45c5a168a3 Implement feature interaction tests generator based on templates 2018-10-03 13:48:22 +03:00
victor.petukhov
6f95e4ae3b Add codegen box spec tests support 2018-10-03 13:29:25 +03:00
victor.petukhov
8538866778 Add few tests for contracts
- Contracts in getter/setter (unexpected behaviour)
- Check smartcasts when non-null assertion for a contract function is used
- Check work of contracts when type parameter of the callsInPlace is specify explicitly
- Check smartcasts working if type checking for contract function is used
2018-10-03 13:29:13 +03:00
victor.petukhov
ecb3f10e47 Add 'mute' concept: move tests with unexpected behaviour to the corresponding folder 2018-10-03 13:26:37 +03:00
victor.petukhov
84dc28374c Add multilevel sections support and corresponding renaming 2018-10-03 13:26:29 +03:00
Ilya Gorbunov
2c313e12e5 Rewrite builtin serialization task as JavaExec
Add standard clean, assemble, build tasks by applying base plugin.
Clean outputs in dist/builtins on clean.
2018-10-03 11:51:30 +03:00
Dmitry Petrov
b55b0c1ff1 Support local property delegation to inline class values
Also, add extra test on property delegation.
2018-10-03 11:09:48 +03:00
Dmitry Petrov
6fa436911a Support interface delegation to inline class values (KT-27318) 2018-10-03 11:09:47 +03:00
Dmitry Petrov
5480bf69e8 Support property delegation to inline class values (KT-27070) 2018-10-03 11:09:46 +03:00
Dmitry Petrov
70e60ea9bc Fix inline class coercion in string template with StringBuilder.append
Inline class values with array as a carrier type were not boxed.

 #KT-27113
2018-10-03 11:09:41 +03:00
kenji tomita
6532916dd2 Change necessary labels in "Call on collection type may be reduced"
#KT-24492 Fixed
2018-10-03 08:00:40 +02:00
Toshiaki Kameyama
5e7d974767 "Make open": Fix false positive for data class inheritance #KT-27354 Fixed 2018-10-03 08:53:03 +03:00
Yan Zhulanow
6d73aa29e0 Pill: Understand dependencies with the 'apiElements' configuration name as module dependencies 2018-10-02 20:03:01 +03:00
Dmitry Petrov
813e4c966a Update testData for constant initializers in IR 2018-10-02 17:08:55 +03:00
Dmitry Petrov
189b05f8a4 Update testData for public API: companion field visibility in 1.3 2018-10-02 16:20:09 +03:00
Nikolay Krasko
02fbb03d6a Show migration when changes are in kts files or inside buildSrc dir (KT-27329)
#KT-27329 Fixed
2018-10-02 16:05:18 +03:00
Nikolay Krasko
d756d93af1 Better coroutines versions update (KT-27351)
- It was decided to update coroutines to 1.0.0 not to 0.30.0 for 1.3
- Always update to 0.27.0-eap13 coroutines for versions before 0.27.0

 #KT-27351 Fixed
2018-10-02 15:54:10 +03:00
Dmitry Petrov
8891733074 Generate const val initializers as IrConst expressions 2018-10-02 13:46:37 +03:00
Mikhail Glukhikh
75b27f890a Fix tests in mobile shared library wizard #KT-27335 Fixed 2018-10-02 13:08:45 +03:00
Mikhael Bogdanov
4fb434c0de Move out jvm-specific part from ir-common
#KT-27005 Fixed
2018-10-02 11:12:21 +02:00
victor.petukhov
023e4e3a0e Actualize tests after KT-27260 fix 2018-10-02 11:49:10 +03:00
Alexey Sedunov
b5d3520db9 MPP: Add MPP sources roots to dependent Android module
#KT-27331 Fixed
2018-10-02 11:18:09 +03:00
Dmitry Savvinov
62edf29cbf Use DataFlowValue instead of Descriptor for equality of ESDataFlowValue
Equality of those values is crucial for intersecting data-flow info
coming from expressions like: 'this.x != null || other.x != null'.

Using 'ValueDescriptor' for equality is obviously wrong, because then 'this.x'
and 'other.x' will be treated as equal, leading to unsound smartcasts.

This commit adds proper overload of 'equals' to 'ESDataFlowValue' that
will compare them based on underlying 'DataFlowValue' (which already
distinguish those values)

^KT-27260 Fixed
2018-10-02 11:05:06 +03:00
Dmitry Savvinov
dd682bd37d Add test on data-flow
Idea is to intersect similar smartcasts on similar properties coming
from *different* instances (something like
'this.x == null && other.x == null' ).

It checks that we distinguish subjects of such smartcasts properly.

Currently behavior is undesired, see KT-27260
2018-10-02 11:05:06 +03:00
Mikhail Zarechenskiy
e74469fdfc Use mutable lists before deserialization of project structure
The problem is that we perform xml deserialization using intellij
 mechanism which tries to clear target object if it isn't unmodifiable
 (see CollectionBinding.isMutableCollection). This check fails for
 kotlin.EmptyList (emptyList()) which then cause exception

 #KT-27321 Fixed
2018-10-01 19:43:03 +03:00
Ilya Chernikov
da9c486a70 Fix gradle support for non-kts scripts for inter-project dependencies 2018-10-01 18:34:15 +02:00
Ilya Chernikov
c50e880173 Implement more precise diagnostic when a standard script template is missing
adapt quickfix accordingly
#KT-26505 fixed
2018-10-01 18:34:15 +02:00
Ilya Gorbunov
b1c4590537 Override docs of MutableList.add/addAll methods
#KT-25632
2018-10-01 18:09:09 +03:00
Ilya Gorbunov
d6beddaac5 Document the requirement for 'minus(elements)' to have stable hashCode
#KT-24536
2018-10-01 18:09:09 +03:00
Ilya Gorbunov
27beadad18 Summary for new packages: kotlin.coroutines, kotlin.contracts, kotlin.random 2018-10-01 18:03:28 +03:00
Ilya Gorbunov
08822ff14b Document that lines and lineSequence do not preserve line separators 2018-10-01 18:03:23 +03:00
Ilya Gorbunov
21b71f3bb1 Clarify the purpose of the message parameter of assertFailsWith
#KT-22869 Fixed
2018-10-01 18:03:23 +03:00
Ilya Gorbunov
9f9033870c Add a note about non-atomic behavior of MutableMap.getOrPut
#KT-13821
2018-10-01 18:03:23 +03:00
Ilya Gorbunov
bb9e9ac1ee Seeded random docs: add a note about repeatability not being preserved
We're not ready to give a guarantee that the seeded generator
implementation will never change in future versions.
2018-10-01 18:03:23 +03:00
Ilmir Usmanov
896913907b Update bootstap 2018-10-01 17:30:06 +03:00
Alexander Udalov
712c9cbfe6 Minor, mute legacyModOperator.kt for JVM_IR 2018-10-01 16:17:14 +02:00
Alexander Udalov
04ba1cff05 Minor, unmute bothInExpectAndActual.kt for JS_IR 2018-10-01 16:17:14 +02:00
Alexander Udalov
6a6a28f8cd Fix ComponentContainerTest 2018-10-01 16:17:14 +02:00
Vyacheslav Gerasimov
f871e9dc79 Update gradle version to 4.10.2 2018-10-01 16:38:58 +03:00
Vyacheslav Gerasimov
f9cefdaa44 Add to kotlin-plugin.jar js.translator module referenced by serialization 2018-10-01 16:27:23 +03:00
Vyacheslav Gerasimov
28c84d0e00 183: Make 183 plugin compatible with upcoming Idea 191 2018-10-01 15:35:50 +03:00
Mikhail Glukhikh
6dbb51d7a7 MPP wizards: remove AS bunches (anyway they aren't accessible for AS) 2018-10-01 15:07:44 +03:00
Alexey Sedunov
a24e58f5a0 Configuration: Update repository URLs to use HTTPS instead of HTTP
#KT-27095 Fixed
2018-10-01 14:46:52 +03:00
Alexey Sedunov
03b289b899 Configuration: Do not save default values of sourceMapEmbedSources 2018-10-01 14:46:52 +03:00
Alexey Sedunov
0765cb9c62 Minor: Fix model access 2018-10-01 14:46:52 +03:00
Alexander Udalov
55c8b35eee Remove unneeded default imports in stdlib and tests 2018-10-01 13:39:02 +02:00
Mikhail Glukhikh
199ae3bac8 Forbid all MPP wizards in IDEA 173, but leave them in AS 3.1
Related to KT-27267
2018-10-01 14:36:52 +03:00
Mikhail Glukhikh
4c85616ee3 Forbid all MPP native-related wizards in IDEA 181, but leave in AS 3.2
Related to KT-27267
2018-10-01 14:36:51 +03:00
Alexander Udalov
009f18f1f4 Split AnalysisFlag values to AnalysisFlags and JvmAnalysisFlags
Declare AnalysisFlags in module 'frontend', and JvmAnalysisFlags in
module 'frontend.java', to avoid leaking Java-related logic to common
compiler code
2018-10-01 13:31:00 +02:00
Alexey Sedunov
c59779f5b9 MPP: Retain KotlinSourceSetInfo for Android in data nodes
User data is not serialized which leads to broken import on reopening

 #KT-27213 Fixed
2018-10-01 13:55:35 +03:00
Alexey Sedunov
c183c5b36a MPP: Add dependencies for all source sets for a given Android variant 2018-10-01 13:55:31 +03:00
Alexey Sedunov
63500216f0 MPP: Fix recognition of test source sets in Android projects
#KT-27212 Fixed
2018-10-01 13:55:26 +03:00
Alexey Sedunov
5b8208c751 MPP: Fix import failure in the case unresolved dependency is found
Instead report unresolved dependencies in Gradle build results

 #KT-27029 Fixed
2018-10-01 13:55:22 +03:00
Alexey Sedunov
99f63f2ebd Configuration: Use model provider to access facets
Otherwise newly created Android project may get invalid SDK
until the reimport is performed

 #KT-27193 Fixed
2018-10-01 13:55:16 +03:00
Mikhail Glukhikh
eb528c3d65 MPP mobile wizard: generate also Xcode (r) project for iOS
#KT-27178 Fixed
2018-10-01 13:46:37 +03:00
Dmitriy Dolovov
21952960f6 [K/N] Allow common source sets in projects created with wizard
Issue #KT-27232 Fixed
2018-10-01 16:36:32 +07:00
Georgy Bronnikov
ade640eadb JVM_IR. Support compile time constants 2018-10-01 12:25:55 +03:00
Denis Zharkov
623c6803d6 Fix regression on smart casts in when on a sealed class
See the comment in PatternMatchingTypingVisitor

 #KT-27221 Fixed
2018-10-01 09:59:28 +03:00
Dmitry Petrov
729da29e49 Update command-line options help for '-Xnormalize-constructor-calls'
Default value depends on language version.
2018-10-01 09:42:13 +03:00
Ilya Matveev
d2740db88f Update Kotlin/Native: 0.9.3 2018-09-30 11:27:13 +03:00
Ilya Matveev
7a5c05b72d Filter java.endorsed.dirs property in K/N runner 2018-09-30 11:27:13 +03:00
Nikolay Krasko
b09ec3cbb3 Shortcut quick fix for migrating all coroutines in the project (KT-27164)
#KT-27164 Fixed
2018-09-29 16:27:45 +03:00
Nikolay Krasko
282407c4a7 Minor: register problems through holder function 2018-09-29 16:27:43 +03:00
Nikolay Krasko
0efb4cc5f6 Refactoring: extract fun in ObsoleteExperimentalCoroutinesInspection.kt 2018-09-29 16:27:42 +03:00
Sergey Igushkin
58a8411575 Fix KNPE due to publications processing order in Gradle 4.7
A KNPE happened because Gradle 4.7 (but not 4.8+) requested a
publication's dependencies before all other publications were created.

Issue #KT-27231 Fixed
2018-09-28 21:57:09 +03:00
Svyatoslav Kuzmich
334c776b92 [JS IR BE] Fix @DoNotIntrinsify processing. Reuse it for compareTo 2018-09-28 20:27:01 +03:00
Ilya Gorbunov
12a31637d1 Improve groupingBy samples 2018-09-28 19:59:30 +03:00
Ilya Gorbunov
3a40e3f041 Move groupingByEachCount together with the new Grouping samples 2018-09-28 19:51:07 +03:00
Itsuki Aoyagi
039d41679e Add samples for groupingBy operations 2018-09-28 19:51:07 +03:00
Toshiaki Kameyama
d89947bd5a "Convert put to assignment": don't report on 'super' #KT-27146 Fixed 2018-09-28 19:43:05 +03:00
Leonid Startsev
b611facd71 Check if serialization plugin presents in the facet compiler classpath before applying extensions logic
#KT-27166 Fixed
2018-09-28 18:31:03 +03:00
Alexander Udalov
088cd4b5e3 Stop parsing argument in argfile when quote ends
There are two visible effects of this change:
1) If an empty argument is passed in quotes, it will be parsed as an
   empty string and handled by the compiler, which will report an error
   later. The specific error is not very important because it's an edge
   case anyway; at the moment, "source file or directory not found:" is
   reported which is no better than the "invalid flag:" error reported
   by javac in the similar case
2) It's no longer possible to split an argument into several parts and
   quote them separately, such as:

       "-langu"ag"e-"ver'sio'n 1.2

   No test added for this change in behavior since it's an even edgier
   case. Note that javac also prohibits this.

 #KT-27226 Fixed
2018-09-28 16:02:40 +02:00
Alexander Udalov
16dd6ebe61 Handle whitespaces in argfiles correctly
#KT-27218 Fixed
2018-09-28 16:02:40 +02:00
Mikhail Glukhikh
ab05f17d1d Fix ifThenToSafeAccess inspection test 2018-09-28 15:11:40 +03:00
Pavel Punegov
fedb9ad035 Merge branch 'ignore-defaultArgs-mpp' 2018-09-28 14:27:12 +03:00
Pavel Punegov
7c2c4e68ce Ignore 2 tests in Native: default arguments got from expect declarations there 2018-09-28 14:22:27 +03:00
Ilya Matveev
5140e674b4 Use compileClasspath configuration for native standard libraries 2018-09-28 14:15:11 +03:00
Ilya Matveev
5c4adc1100 Don't add dependency on a klib task for binary tasks 2018-09-28 14:15:11 +03:00
Dmitry Petrov
7b7cf39388 Fix inline classes coercion in 'if' expression
#KT-27132
2018-09-28 10:46:42 +03:00
Dmitry Petrov
ab90b2b901 Fix nullability propagation in inline class type mapping
#KT-27096

See https://jetbrains.slack.com/archives/C06E082M6/p1537949572000100
2018-09-28 10:46:42 +03:00
Dmitry Petrov
0b23ddb947 Add test for KT-27140 2018-09-28 10:46:42 +03:00
Nikolay Krasko
1901331ee5 Remove NotificationAction.createSimple to fix compilation in 173 2018-09-28 10:37:43 +03:00
Ilmir Usmanov
e7bed58ebe Fix bootstrap 2018-09-27 21:59:38 +03:00
Ilmir Usmanov
6e0391f9ec Use release coroutines in script-runtime 2018-09-27 21:59:35 +03:00
Dmitry Petrov
0191e3d1cf Migrate to release coroutines 2018-09-27 21:59:31 +03:00
Yan Zhulanow
bbc73ec0e5 MPP: Fix JPS tests
Move back the application check as only the class presence check is not sufficient.
2018-09-27 21:31:30 +03:00
Mikhail Glukhikh
ca4547c40a Add Maven Publish to MPP library wizards (in progress) #KT-27201 Fixed 2018-09-27 20:16:05 +03:00
Mikhail Glukhikh
e7100838d0 Introduce MPP wizard for mobile (Android / iOS) libraries
#KT-27200 Fixed
2018-09-27 19:43:04 +03:00
Nikolay Krasko
41bd29c3e9 Replace migration dialog with sticky popup (KT-27163)
#KT-27163 Fixed
2018-09-27 18:48:54 +03:00
Pavel V. Talanov
ce9028e367 Prefer data from facet settings when computing module js output root
#KT-26872 Fixed
2018-09-27 17:21:09 +02:00
Sergey Igushkin
2441df820b Support Kotlin/JS DCE in new MPP
Issue #KT-27196 Fixed
2018-09-27 17:54:38 +03:00
Ilya Chernikov
499146db0e Fix pill problem with main-kts-test, reenabling pill for main-kts modules 2018-09-27 16:27:55 +02:00
Ilya Chernikov
0303fc036c Fix gradle support for non-kts scripts when daemon is used 2018-09-27 16:27:17 +02:00
Dmitriy Dolovov
bfa6d57e34 [K/N] Improvements in new application wizard in IDEA
Issue #KT-27210 Fixed
2018-09-27 18:37:46 +07:00
Ilya Chernikov
7b7f87a3b7 Move ivy resolver to the main-kts to avoid classloading issues...
e.g. when main-kts is loaded in IDEA
#KT-26828 fixed
2018-09-27 12:56:19 +02:00
Dmitry Savvinov
6065095e24 Fix too aggressive data-flow clearing of loop-assigned vars
This is effectively a revert of
447c127036, which was an (incorrect) fix
for KT-22379.

The bug was that we've cleared data-flow info for assigned variables
*after* knowledge that loop condition if 'false' was applied (we can
claim that if loop has no jump-outs). Therefore, we broke smartcasts in
the innocent code like that:

  var x: Int? = null
  while (x == null) {
      x = readPotentiallyNullableInt()
  }
  // x should be non-null here

Commit reverts that "fix" for 1.3.0 and postpones deprecation until 1.4

KT-22379 Open
KT-27084 Fixed
2018-09-27 12:09:22 +03:00
Dmitry Savvinov
99454aa78d Add test on smartcast from while-assigned var
Currently behavior is undesired, it will be fixed in the next commit
(see KT-27084)
2018-09-27 12:09:21 +03:00
Nikolay Krasko
056c61090d Ignore non-kotlin modules during building migration information (KT-27100)
Otherwise maximum settings might be always obtained from project compiler
settings and thus stay unchanged during migration process.

 #KT-27100 Fixed
2018-09-27 11:59:49 +03:00
Pavel V. Talanov
2d52865415 Default to plain 'Run' icon when calculating icons for common code
#KT-26942 Fixed
2018-09-27 10:51:43 +02:00
Alexey Sedunov
8d3e997a82 Configuration: Do not configure SDK for Android modules
This is already done by the Android plugin itself

 #KT-27193 Fixed
2018-09-27 10:46:44 +02:00
Alexander Udalov
9f6575c57f Add file name to exception on invalid module-info.class in dependencies
This will help users in working around KT-23025
2018-09-27 10:16:15 +02:00
Dmitry Petrov
7624dbbb20 Fix subject variable handling in specialized enum codegen
#KT-27161
2018-09-27 10:48:35 +03:00
Mikhail Glukhikh
258999fa9e Always use Gradle wrapper 4.7 in MPP projects #KT-27177 Fixed 2018-09-27 10:45:00 +03:00
Dmitry Petrov
0dd04c3424 Postpone companion object field visibility
Have to reconsider this issue because of interface companion objects.
2018-09-27 10:35:23 +03:00
Dmitry Petrov
792ff3c39e Generate private interface companion object as package-private synthetic 2018-09-27 10:35:23 +03:00
Dmitry Petrov
7949ac1080 Use common instance receiver generation logic for 'this' expression
Otherwise it would skip private companion object accessor generation.
2018-09-27 10:35:23 +03:00
Denis Zharkov
c4337f753e Restore binary compatibility for IDE plugins
Caused by 341f7c348a
2018-09-27 10:16:20 +03:00
Ilya Gorbunov
0c81e30d46 Make a more correct implementation of unsigned arrays copyInto
Return the destination array instead of the destination storage array
wrapped in a new unsigned array. The difference should be
indistinguishable, however in JS, where inline classes are not inlined yet,
it had resulted in an extra wrapper.
2018-09-26 22:57:14 +03:00
ymnder
1a20b1f357 Add sample for 'repeat' function
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 22:39:56 +03:00
shiraji
0c97d99d77 KT-20357 Add sample code for Regex.find
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 22:24:53 +03:00
takattata
f06ea6fddd KT-20357 Add sample code for Char extensions 2018-09-26 21:58:50 +03:00
Takayuki Matsubara
d26c0f777b KT-20357 Add samples for Map.containsValue
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 21:03:57 +03:00
Keita Watanabe
12ec4fdce0 KT-20357 Add sample for mutableSet function 2018-09-26 20:44:40 +03:00
Ilya Gorbunov
df6ccbca49 KT-20357 Add samples for elementAtOrElse
Move samples to Elements nested class.
2018-09-26 20:44:40 +03:00
Takayuki Matsubara
7d5efe7f51 KT-20357 Add samples for elementAtOrNull 2018-09-26 20:44:40 +03:00
Takayuki Matsubara
ad9b700ec4 KT-20357 Add samples for elementAt 2018-09-26 20:44:40 +03:00
Leonid Startsev
40b3514a47 Include serialization config in IDE for IDEA 183, AS 3.2 and 3.3 2018-09-26 19:47:07 +03:00
Alexander Udalov
5713298108 Fix FQ name usage of experimental marker in UseExperimental
#KT-26366 Fixed
2018-09-26 18:36:01 +02:00
Vyacheslav Gerasimov
cb398ea6b1 Fix compilation of kotlin-gradle-plugin broken after migration to gradle 4.10 2018-09-26 18:56:35 +03:00
Ilya Gorbunov
7b66a4d295 Remove links to contract samples as these samples are not supported by Dokka 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
b2b23ac282 Improve contract API documentation 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
f2a51f96a5 Improve documentation of experimental annotations 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
04f1f6086b Fix doc build script after removing taks distJar from stdlib project 2018-09-26 18:15:52 +03:00
Mikhael Bogdanov
29568d2f48 Add test configuration for JDK_11 2018-09-26 17:05:55 +02:00
Mikhail Zarechenskiy
d0ed76ebc8 183: Fix exception about unmapped lambda argument from IDE inspection
Intention: obtain lambda argument for some parent call,
 then get that call (for the lambda argument) and map
 the argument to the parameter.

 Before the fix, we were getting call for inner element,
 not for the lambda argument and as a result, there were exceptions.

 #KT-26873 Fixed
2018-09-26 18:03:34 +03:00
Alexey Sedunov
c1b3e72ae8 Gradle: Inherit project SDK when no explicit one is specified
#KT-27145 Fixed
2018-09-26 16:59:46 +03:00
Vyacheslav Gerasimov
60758b86ee as33: Delete unnecessary bunch for itellij-sdk build.gradle.kts 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
666b660f79 Restore noDefaultJar() in kotlin-compiler project 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
1f0e9f24c5 Fix noDefaultJar helper for gradle 4.10
artifacts don't implement ArchivePublishArtifact in gradle 4.10
2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
1109b795da Build: upgrade gradle to 4.10 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
8338a0dd85 Build: upgrade gradle to 4.9 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
10810aa90f Build: upgrade gradle to 4.8, fix ivy artifacts publication
Fix kotlin gradle plugin compilation against gradle 4.8 api
Internal ivy artifacts api has been changed, there is no longer DefaultIvyArtifact
2018-09-26 16:19:09 +03:00
Sergey Igushkin
44f87e4951 Revert "(minor) Transform KotlinPlatformType attribute to String, rename entries"
This reverts commit 3f24f8bd
2018-09-26 15:58:14 +03:00
Sergey Igushkin
8d054ba346 Revert "Build source sets hierarchy in Android projects"
This reverts commit 269410d7

The change causes errors in AS 3.2 import.
2018-09-26 15:58:14 +03:00
Ilya Matveev
3f452b2af2 Fix native test working directory 2018-09-26 15:49:47 +03:00
Ilya Matveev
6741a550d9 Add implementation dependencies into publication for native 2018-09-26 15:49:47 +03:00
Ilya Matveev
ac24bb0433 Update Kotlin/Native: 0.9.2 2018-09-26 15:49:47 +03:00
Ilya Matveev
da1fcb008b Fix -Xcommon-sources in native args 2018-09-26 15:49:47 +03:00
Mikhail Glukhikh
a97f2bb992 Introduce MPP wizard for mobile (Android / iOS) applications
This mobile wizard already contains skeleton
Finally #KT-25952 Fixed
Also #KT-26786 Fixed
2018-09-26 15:41:24 +03:00
Pavel V. Talanov
a258908fbb Create ModuleInfos for newmpp modules with missing roots accurately
#KT-27010 Fixed
 #KT-27133 Fixed
2018-09-26 13:46:45 +02:00
Pavel V. Talanov
cc1be5f559 Introduce SourceType and use KotlinFacetSettings.isTestModule
Refactor dealing with production/test roots
Remove ad-hoc code in KotlinMultiplatformRunLocationsProvider
2018-09-26 13:46:45 +02:00
Nikolay Krasko
1be491504a Fix formatting for when with subjects (KT-27027)
#KT-27027 Fixed
2018-09-26 13:35:36 +03:00
Nikolay Krasko
0833f23d02 Make ReplaceWith work for objects (KT-16211, KT-14929)
#KT-16211 Fixed
2018-09-26 13:35:35 +03:00
Nikolay Krasko
18c181641f Return updated element after reference shortening
Fresh new expression obtained after qualified expression binding is
invalidated after shortening.
2018-09-26 13:35:34 +03:00
Sergey Igushkin
c4283de9cb Mark deprecated Gradle configurations with the Kotlin platform attribute
The traditional Gradle/Java model assumes several configurations, which
are now deprecated, which are both `canBeConsumed = true` and
`canBeResolved = true`.

* compile, testCompile, etc.
* runtime, testRuntime, etc.
* default

These configurations need to somehow resolve correctly to an appropriate
platform-specific artifact when they contain an MPP library or project
dependency.

However, simply marking them with the Kotlin platform type attribute
would put these configurations under considerations during Gradle
variant aware depdendency resolution of project dependencies, which
in order would lead to ambiguity (e.g. `compile` vs `runtime` vs
`testCompile` vs ... vs `apiElements`).

To deprioritize these configurations during dependency resolution, we
mark them with a special attribute with a unique value in each project.
Given that the values are different in different projects, Gradle will
not choose a configuration marked by this attribute.

But we still need 'project(path: '...', configuration: '...')`
dependencies to work, and so, instead of rejecting those different
values of the attribute, we say that all values are compatible, but
when an ambiguity arises, choose the configurations not marked by this
attribute, so effectively eliminating them from resolution.

Issue #KT-27111 Fixed
2018-09-26 13:02:32 +03:00
Sergey Igushkin
3f24f8bd8d (minor) Transform KotlinPlatformType attribute to String, rename entries
* To avoid unexpected effects from the Gradle instantiation mechanisms
  for attribute values, use a safer String attribute type for the
  KotlinPlatformType attribute

* Rename its entries to keep enum entries naming consistent
2018-09-26 13:02:32 +03:00
Sergey Igushkin
65e3559c09 Fix resources processing configuration
* Add resources processing to the K/N compilations

* Use a proper resources output path (composed from target + compilation
  rather than just compilation name)

* Fix incorrect reassignment of the resources directory
2018-09-26 13:02:32 +03:00
Sergey Igushkin
fef61eca51 Add tests for variant-aware dependency resolution between projects 2018-09-26 13:02:32 +03:00
Sergey Igushkin
81ae54c05b Show warnings for disabled targets on current host
Issue #KT-26647 Fixed
2018-09-26 13:02:32 +03:00
Sergey Igushkin
4f650bb056 Add an experimental feature warnings on MPP usage & metadata publishing
Issue #KT-25200 Fixed
2018-09-26 13:02:31 +03:00
Sergey Igushkin
54988932a3 Ensure that kapt configurations are not exposed for consumption 2018-09-26 13:02:31 +03:00
Sergey Igushkin
7c05f77cb7 Add tools for testing dependencies resolution by resolving all configs 2018-09-26 13:02:31 +03:00
Sergey Igushkin
c3dd24e9b2 Rewrite project dependencies when publishing a multimodule MPP
When a new MPP is published without Gradle metadata, the project
dependencies should be replaced with specific module dependencies,
e.g. `sample-lib` with `sample-lib-jvm`, because a consumer won't be
able to resolve `sample-lib` in a variant-aware way.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
05301e37d8 Fallback for publishing with no Gradle metadata
The following parts of the publications are affected:

* root publication
  * with Gradle metadata, it is published and references the
    other publications using the `available-at` mechanism
  * without metadata opt-in, it is not published

* Kotlin metadata variant
  * with Gradle metadata, it is added as an additional variant to the
    platform-specific publications to allow the IDE to discover it
  * without metadata opt-in, it is added as a dependency to the platform-
    specific modules (like in old MPP)
2018-09-26 13:02:31 +03:00
Sergey Igushkin
b388f7fde0 Introduce Kotlin variants with metadata variant and metadata dependency
These two will be needed when we publish a platform-specific part of a
MPP library in order to help the consumers of that single module
(rather than the whole MPP library) find the Kotlin metadata.

`KotlinVariantWithMetadataVariant` will be used for publishing with
Gradle metadata enabled, `KotlinVariantWithMetadataDependency` for
publishing without Gradle metadata, instead adding the Kotlin metadata
as a dependency, just like we did in old MPP.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
1abcfc76df Add Kotlin-specific Usage attribute values
When a non-Kotlin (JVM) project resolves an MPP library dependency,
it expects only one variant per Java Usage value ('java-api',
'java-runtime-jars'). If there's more than one, it will report
ambiguity and fail.

So we need to avoid creating non-JVM variants with Java Usage values
to ensure that non-Kotlin consumers can resolve the dependencies on
an MPP library with a single JVM target (if there's more than one
JVM target, there will still be ambiguity, but that's quite what one
would expect and what can be solved with custom attributes).

Instead, we define two Kotlin-specific Usage values, 'kotlin-api' and
'kotlin-runtime', so that:

* input configurations with these Usage values can consume plain Java
  artifacts, for compatibility with plain old Kotlin modules

* if a consumer does not request a Kotlin usage and receives the two,
  let it use the runtime one as it is more complete

We then use the two Usage values on those Kotlin input and output
configurations which are not JVM-related, and leave the Java Usages
for the JVM targets.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
76b51b1058 Allow the common platform type consumers to consume platform artifacts
When a Kotlin metadata input configuration tries to resolve a module
with no Kotlin metadata (such as: plain old Maven module, a non-MPP
Kotlin project with a single platform), it should be able to resolve
successfully.

Given that the input metadata configurations extend from source set
dependencies configurations, where platform-specific dependencies may
occur, allowing the metadata configuration to resolve such dependencies
into platform artifacts seems to achieve successful dependency
resolution.

Issue #KT-26834 Fixed
2018-09-26 13:02:31 +03:00
Sergey Igushkin
269410d7aa Build source sets hierarchy in Android projects
Instead of simply adding all Kotlin source sets participating in an
Android compilation, as was appropriate until we introduced the
dependsOn relation, we should now build a proper source sets hierarchy.
2018-09-26 13:02:30 +03:00
Ilya Chernikov
43a4b84b44 Make script resolving annotations repeatable, fix multiple repos usage
Also avoid "unknown resolver central" errors on ivy resolving
#KT-27050 fixed
2018-09-26 11:49:45 +02:00
Mikhail Zarechenskiy
0d103e7f0c Allow using extensions with trivial-constraints in builder-inference
#KT-27079 Fixed
2018-09-26 11:52:23 +03:00
Mikhail Zarechenskiy
0da1b9b80f Revert "Migration change: temporarily specify type explicitly"
This reverts commit bc6e091004.

 This commit was needed to avoid bootstraping, now we can revert it
2018-09-26 11:51:57 +03:00
Mikhail Zarechenskiy
7c1d374ed5 Fix diagnostic tests about coroutine-inference 2018-09-26 11:51:55 +03:00
Alexander Podkhalyuzin
3142627269 Removed extra spaces in new MPP project template
#KT-26952  Fixed
2018-09-26 10:21:10 +03:00
Toshiaki Kameyama
c1013cc198 "Convert to secondary constructor": Fix false positive with delegation #KT-27061 Fixed 2018-09-26 09:31:12 +03:00
Yuki Miida
af1fc5b668 Add sample for orEmpty method 2018-09-26 05:54:40 +03:00
Mikhail Glukhikh
64b23812c0 Move CliArgumentStringBuilder: cli -> idea-jvm 2018-09-25 19:14:12 +03:00
Mikhail Glukhikh
1f4d91da1c Has actual marker: distinguish Android and JVM modules #KT-25055 Fixed 2018-09-25 19:11:30 +03:00
Dmitry Petrov
fd57a43665 Update testData for ClassFileToSourceStubConverterTestGenerated 2018-09-25 17:25:02 +03:00
Simon Ogorodnik
189fe95d8a Fix type-aliases by expansion search loop
Compare type-aliases by it's fqNames instead of identity, as
multiple runs of resolveToDescriptorIfAny produces different descriptors
for one declaration
2018-09-25 16:40:03 +03:00
Nikolay Krasko
1ff12d00e4 Allow return value hint for lambda expressions (KT-26689)
#KT-26689 Fixed
2018-09-25 15:52:22 +03:00
Nikolay Krasko
07e305e5f4 Update dictionary: +infos, -kompiler 2018-09-25 15:52:21 +03:00
Nikolay Krasko
80c3e59dd5 Minor: cleanup testUtils.kt 2018-09-25 15:52:19 +03:00
Nikolay Krasko
e1f746f23c Resolve "key is not found in bundle" exception from tests in AS
Android Studio idea.jar is taken from clion projects and has
IdeSpecificFeatures.xml and ProductivityFeaturesRegistry.xml files that
mention function that have to be found in ProductivityFeaturesRegistry.

Unfortunately, correspondent CLion bundle is not registered in tests, and
this causes a lot of tests fail.
2018-09-25 15:52:18 +03:00
Ilya Chernikov
127451e1d9 Add kotlin-main-kts.jar to the dist 2018-09-25 14:13:28 +02:00
Alexey Sedunov
22c77ffbb2 MPP: Do not populate content roots in the absence of ExternalProject
#KT-26900 Fixed
2018-09-25 15:05:46 +03:00
Alexey Sedunov
4f01a438c4 MPP: Add all android-targeted compilation source roots to the module 2018-09-25 15:05:43 +03:00
Alexey Sedunov
3a973973ce MPP: Create android source roots automatically when requested
#KT-26764 Fixed
2018-09-25 14:54:27 +03:00
Alexey Sedunov
391e4c2ad1 Configuration: Fix JVM target detection in the absence of Kotlin facet
#KT-27021 Fixed
2018-09-25 14:54:26 +03:00
Alexey Sedunov
bd3adbd457 MPP: Reset JDK for JVM modules
#KT-26937 Fixed
2018-09-25 14:54:26 +03:00
Alexey Sedunov
6d4f927f7e Configuraion: Defer initialization of facets UI
#KT-25410 Fixed
2018-09-25 14:54:25 +03:00
Dmitriy Dolovov
5e33860652 [K/N] Stand-alone Native Application wizard in IDEA
Issue #KT-27076 Fixed
2018-09-25 17:24:59 +07:00
Dmitriy Dolovov
8e455f5a14 Merge pull request #1893 from JetBrains/rr/ddol/KT-27072
[K/N] Friendly displaying of Kotlin/Native default libraries in IDEA
2018-09-25 16:03:28 +07:00
Toshiaki Kameyama
7d89205618 Add "Remove inline modifier" quick fix for NOTHING_TO_INLINE #KT-5187 Fixed 2018-09-25 11:48:20 +03:00
Toshiaki Kameyama
65f23f3c4e Fix false positive in class literal #KT-16338 Fixed 2018-09-25 11:27:27 +03:00
Toshiaki Kameyama
6cd13341ee Add inspection for unlabeled return inside lambda #KT-26511 Fixed 2018-09-25 11:24:56 +03:00
Dmitry Petrov
ba32ed7404 Test: @JvmField in inline class companion 2018-09-25 11:15:29 +03:00
Dmitry Petrov
bffe9e45e8 Add accessor tests: inline class <-> companion
KT-26858 was fixed somewhere in the middle.

 #KT26858
2018-09-25 11:15:29 +03:00
Dmitry Petrov
850d72f13f Fix accessor generation for inline class members
TODO 'generateMethodCallTo' is a bloody mess that deserves rewriting.
2018-09-25 11:15:29 +03:00
Dmitry Petrov
edc8cf3ed0 Use proper type for context 'this'
Bug in 'generateThisOrOuterFromContext', it worked while instance of a
class was always an object.

 #KT-27078
2018-09-25 11:15:29 +03:00
Dmitry Petrov
c1bb3479df More tests on casts on receiver of inline class type 2018-09-25 11:15:29 +03:00
Dmitry Petrov
88cc900dc7 Add test for private inline class method call from inline lambda 2018-09-25 11:15:29 +03:00
Dmitry Petrov
2e6d53a43f Fix extension receiver coercion for inline classes
#KT-27031
2018-09-25 11:15:29 +03:00
Dmitry Petrov
20d7210239 Fix outer class mapping for closures in inline class
#KT-27030
 #KT-27033
2018-09-25 11:15:29 +03:00
Dmitry Petrov
26602c8443 Minor: move tests 2018-09-25 11:15:29 +03:00
Dmitry Petrov
f9a419f940 Fix companion method access from inline class
#KT-27025
2018-09-25 11:15:29 +03:00
Dmitry Petrov
1869ed09bc Fix companion field access from inline class
#KT-26858
2018-09-25 11:15:29 +03:00
Toshiaki Kameyama
3e4d8eba76 Add braces: Remove new line between '}' and 'else' #KT-26839 Fixed 2018-09-25 11:08:49 +03:00
Alexey Tsvetkov
de261df6f5 Use separate configuration for resolving native compiler plugin artifacts
Kotlin/JVM and Kotlin/JS use shaded compiler, but
Kotlin/Native uses non-shaded one.
Serialization plugin was configured to use either shaded or non-shaded
plugin version, because we used one configuration for resolving
compiler plugins.
This change introduces 'kotlinNativeCompilerPluginClasspath' configuration
for resolving Kotlin/Native compiler plugins.
2018-09-25 11:08:39 +03:00
Toshiaki Kameyama
affa881421 "Redundant SAM constructor": Fix highlighting range #KT-27034 Fixed 2018-09-25 11:06:45 +03:00
Dmitriy Dolovov
405bd91597 [K/N] User friendly displaying of Kotlin/Native default libraries in IDEA
Issue #KT-27072 Fixed
2018-09-25 11:50:39 +07:00
Georgy Bronnikov
487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00
Georgy Bronnikov
055215c54f JVM_IR. Support compile time constants 2018-09-25 01:38:51 +03:00
Pavel V. Talanov
985934a40a Prefer kotlin JUnit config to any pattern based config
Specifically that means that Kotlin JUnit configurations will be created
    for JUnit classes and methods instead of AS pattern configurations
2018-09-24 18:29:04 +02:00
Pavel V. Talanov
71d640f3f8 Improve kotlin jvm run config producers for 181 and as32 branches
Drop KotlinJUnitRunConfigurationProducer, KotlinRunConfigurationProducer
    bunch files
Extract differences in behaviour to 'jvmMppUtils.kt'
Improve 'isConfigurationFromContext' checks for 181 and as32
    (this prevents duplicate configurations being created)
KotlinRunConfigurationProducer chooses corresponding jvm module
    for common code

 #KT-26886 Fixed
2018-09-24 18:08:06 +02:00
Pavel V. Talanov
f34f306d90 IdeaModuleInfos: consider newMpp modules to always have relevant roots
Make sure implementing(ed)Descriptors always return a relevant module
    regardless of whether the module has physical directories configured
2018-09-24 18:08:06 +02:00
Vyacheslav Gerasimov
7eb8123d26 Add changelog for 1.2.71 2018-09-24 18:37:39 +03:00
Nikolay Krasko
dda1673096 Don't choose navigation target only by index (KT-26004)
There might be situation when platform code has a declaration with
another signature and the same fqname, but navigating to common
declaration is expected.

 #KT-26004 Fixed
2018-09-24 18:26:34 +03:00
Svyatoslav Kuzmich
b79dcbe8e6 [JS IR BE] Refactor equals and compareTo lowering 2018-09-24 18:21:57 +03:00
Yan Zhulanow
005955326f Pill: Exclude kotlin-main-kts module from JPS 2018-09-24 17:54:24 +03:00
Yan Zhulanow
ff0b051a64 MPP: Rewrite work-around for JPS in a more safe way 2018-09-24 17:54:24 +03:00
Yan Zhulanow
bc27cabb1a Call 'GradleProjectImportHandler's in MPP Gradle importer (KT-27006) 2018-09-24 17:54:23 +03:00
Nikolay Krasko
bbd15db308 Remove old buildIterator import (KT-26679) 2018-09-24 15:57:06 +03:00
Mikhail Zarechenskiy
6a860dd042 Fix blackbox codegen tests that use coroutine inference
Note that previously we implicitly ignored JS_IR backend when directive
 COMMON_COROUTINES_TEST was enabled, see kotlin/generators/util/coroutines.kt#L57
2018-09-24 12:10:56 +03:00
Ilya Gorbunov
974837654e Remove workaround for complex default value in Array.copyInto
#KT-22818
2018-09-22 18:24:00 +03:00
Ilya Gorbunov
a5f1ed9a5d Advance bootstrap to 1.3.20-dev-384 2018-09-22 18:23:52 +03:00
Alexey Tsvetkov
cd2ff41ef5 Validate Gradle task properties on test run
By default `validateTaskProperties` is added only to `check` task's
dependencies, so doesn't run on our CI.
We can run `check` instead of `test` on CI, but since developers are
not used to it, I believe it's better to make `test` tasks depend on
`validateTaskProperties`
2018-09-22 00:10:45 +03:00
Natalia Selezneva
a078526c4d Scratch tests: check that highlighting is enabled for scratch 2018-09-21 22:58:14 +03:00
Natalia Selezneva
8f8c431524 Fix Optimize import for scripts not under source roots
KT-17231 Fixed
KT-21981 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva
eb597fbf22 Fix unused import inspection for scripts not under source roots (including build.gradle.kts and scratches)
KT-20040 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva
43027d0581 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:14 +03:00
Natalia Selezneva
074aa47dc0 Use ProjectRootUtil.isInContent instead of checking script expected location manually 2018-09-21 22:58:14 +03:00
Natalia Selezneva
d3ee14c5d2 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:06 +03:00
Ivan Gavrilovic
2d425d4e0a Fix null checks in the flow 2018-09-21 20:23:44 +03:00
Ivan Gavrilovic
bb53a1c3d2 Use new API from AGP to get JavaCompile task
New API for getting the JavaCompile task has been
added to AGP, and the old one is deprecated. It is
now returning TaskProvider<JavaCompile>, which allows
API users to avoid configuring tasks unnecessarily.

This commit does not change anything functionally, it
is only to avoid the warning message, as reporter in
https://issuetracker.google.com/116198439.
2018-09-21 20:23:44 +03:00
Ilya Gorbunov
358e64fdb0 Remove dead code for builtins uninvalidation in tests 2018-09-21 18:35:02 +03:00
Ilya Gorbunov
4423ef9087 Minor: remove unused template for Map.random() 2018-09-21 18:28:44 +03:00
Anton Bannykh
8e347f9f39 [JS IR BE] lateinit support
* Functions with IrExpressionBody are lowered to IrBlockBody
* Implemented throwUninitializedPropertyAccessException function
2018-09-21 18:20:11 +03:00
Anton Bannykh
beaf6df8c5 [JS IR BE] support CharSequence and String methods 2018-09-21 18:16:03 +03:00
Alexander Udalov
3e90d367f2 Do not report experimental usage errors in import statements
#KT-25545 Fixed
2018-09-21 17:35:50 +03:00
Alexander Udalov
9d27771f86 Fix instance parameter type of inherited declaration in reflection
Both for callables obtained via reflection API (KClass.members etc) and
for callables obtained via ::-references, the instance parameter is now
the class which was used to construct the type at the left-hand side of
the reference, NOT the class where the callable is originally declared
as is known at compile-time. The reason is to reduce the difference in
behavior of KCallable.call vs FunctionN.invoke: the latter always
required the subclass instance for a fake override, and it's reasonable
that the former would require it as well.

Note that in Java reflection, behavior could differ in a similar case.
For a simple fake override, Class.getMethod would return the method
declared in the base class and that method will accept instances of the
base class in invoke. However, it's difficult to rely on this behavior
because if there's a bridge for a fake override in the derived class
(e.g. when overridden members have different signatures), the returned
Method object is accepting the derived class as the receiver. This just
confirms the fact that Java reflection operates on a different level of
abstraction, namely JVM methods in .class files, which is not applicable
to our use cases directly. Another reason not to replicate Java
reflection's behavior is the uncertainty as to which member is returned
in case there are several in the hierarchy for a given fake override:
see the "otherwise one of the methods is chosen arbitrarily" note in
javadoc on Class.getMethod.

 #KT-24170 Fixed
2018-09-21 17:32:43 +03:00
Alexander Udalov
3ca81b95c2 Use non-allowed actual defaults in backends to workaround compiler exception
It's difficult to fix KT-22818 until the IR comes along, so we're
providing a workaround where one can disable the
ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS error and provide default values
in the actual function, to avoid exception from the backend.

 #KT-22818
2018-09-21 17:30:05 +03:00
Ilya Chernikov
18b53f331a Fix proguarding of the main-kts 2018-09-21 15:12:53 +02:00
Simon Ogorodnik
68dfe9bf14 Fix missing NativeLibraryType
#KT-27009 fixed
2018-09-21 15:32:56 +03:00
Simon Ogorodnik
3aee3dfdd9 Remove JPS KotlinNativeConfigurator 2018-09-21 15:32:55 +03:00
Simon Ogorodnik
9a79254f7e Make possible to have no libraryDescription for 'Configure Kotlin' 2018-09-21 15:32:54 +03:00
Simon Ogorodnik
faf09a2aac Add KotlinNativeGradleConfigurator to avoid 'Configure Kotlin' for K/N 2018-09-21 15:32:53 +03:00
Simon Ogorodnik
cff648a505 Don't show 'Configure Kotlin' panel when module already configured 2018-09-21 15:32:53 +03:00
Roman Artemev
a807397f65 [JS_IR] Add inlineBox tests 2018-09-21 14:02:53 +03:00
Alexander Podkhalyuzin
aa56c50218 Fixed update copyright action with no package and imports
#KT-23864 Fixed
2018-09-21 12:56:11 +03:00
Dmitry Petrov
d03237bebc Generate backing fields and initializers for external constants 2018-09-21 09:50:21 +03:00
Dmitry Petrov
ec8bdff5c7 Working infrastructure for external dependencies testing
(not really, but at least something)
2018-09-21 09:50:21 +03:00
Dmitry Petrov
6022fb4ec3 Fix default impl for suspend fun
We have an extra parameter in the mapped signature, and don't care about
Kotlin types there (so far). Might be a better idea to obtain the actual
descriptor for a suspend function (with extra parameter), and pass
arguments accordingly.
2018-09-21 09:48:11 +03:00
Dmitry Petrov
0f898dc6dc Fix default interface generic extension fun call with inline class type
When we've determined that we are going to invoke an erased inline class
method ('static foo-impl(this, ...)' in inline class), keep track of it
so that the remaining type mapping logic proceeds correctly.

 #KT-26998 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov
95010de32e Minor: renaming 2018-09-21 09:48:11 +03:00
Dmitry Petrov
8d2b1950e6 Fix Kotlin default interface methods calls for inline classes
When mapping callable method signature for erased inline class methods,
use original function descriptor instead of super declaration
(otherwise it would map to a default interface method with mismatching
signature).

When generating delegates to Kotlin default interface methods, keep
track of the original Kotlin types for delegating method arguments and
interface method arguments.

'original' for value parameters of fake overrides points to the
overridden function value parameters instead of the value parameter of
the unsubstituted function. This causes inconsistent type mapping for
inline classes implementing generic interfaces with default methods.

 #KT-25295 Fixed Target versions 1.3.20
 #KT-26931 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov
8536ef5b43 Minor: reformat 2018-09-21 09:48:11 +03:00
Dmitry Petrov
947ea88d5e Refactor: pull up and extract method 2018-09-21 09:48:11 +03:00
Dmitry Petrov
d9593c7a34 Add tests for inline class variables captured in closure 2018-09-21 09:48:11 +03:00
aleksZubakov
7e49005bab Add LazyTopDownAnalyzer in LazyResolve container 2018-09-20 22:24:07 +03:00
Ilya Gorbunov
0ca59b3a40 Use modern API of Kotlin 1.3 in JS canvas examples 2018-09-20 22:08:56 +03:00
Roman Artemev
24e7bafa7d Port test from K/N 2018-09-20 19:59:12 +03:00
Ilya Matveev
a6f2af03e7 Pass absolute library paths to native compiler 2018-09-20 19:10:27 +03:00
Mikhail Zarechenskiy
09cd038e4b Fix test about version requirement
We began to write version requirement on declarations with `Result` and
 now (after bootstrap) we are getting error in this test because of that
 version requirement.

 see 908be10bf4
2018-09-20 17:58:56 +03:00
Mikhail Zarechenskiy
a4f5cced47 Support coroutine inference under version <= 1.2
Follow-up #KT-26958
2018-09-20 17:42:24 +03:00
Mikhail Glukhikh
de36d919aa Fix testJvmStaticUsagesRuntime from PSI checker, messages updated to 1.3 2018-09-20 17:28:07 +03:00
Mikhail Glukhikh
83faba6424 MPP wizard: add skeleton for shared JVM/JS/iOS project
Part of KT-26786
2018-09-20 16:21:43 +03:00
Mikhail Glukhikh
47baaf10c6 MPP wizard: add skeleton for JVM/JS project
Part of KT-26786
2018-09-20 16:21:26 +03:00
Mikhail Glukhikh
625ff00f62 Fix testEnableCoroutinesFacet from update configuration group 2018-09-20 16:19:10 +03:00
Mikhail Glukhikh
6850d7be0c Enable feature: add test for JPS case 2018-09-20 16:19:03 +03:00
Mikhail Glukhikh
c5a81c4e8b Extract shouldConfigureInProject to AbstractChangeFeatureSupportLevelFix 2018-09-20 16:18:06 +03:00
Mikhail Glukhikh
7030a485be Enable / disable feature: update Gradle build script bunch for 173 2018-09-20 16:18:05 +03:00
Mikhail Glukhikh
f6b805a973 Add enable / disable feature in JPS
#KT-26775 Fixed
#KT-26774 Fixed
2018-09-20 15:56:37 +03:00
Mikhail Glukhikh
8a7ff4cd24 Add enable / disable feature in Maven project
Part of KT-26775
2018-09-20 15:56:32 +03:00
Mikhail Glukhikh
106db57975 Add enable / disable feature in Gradle (Kotlin DSL) project
Part of KT-26775
2018-09-20 15:56:31 +03:00
Mikhail Glukhikh
43e4616fdf Add enable / disable feature in Gradle (Groovy) project, forTests option
Part of KT-26775
2018-09-20 15:56:29 +03:00
Mikhail Glukhikh
b194be7665 Introduce skeleton for ChangeGeneralLanguageFeatureSupportFix
Part of KT-26775 and KT-26774
2018-09-20 15:56:27 +03:00
Mikhail Glukhikh
fd3dfe0710 Extract AbstractChangeFeature...Fix from ChangeCoroutineSupportFix
Part of KT-26775 implementation
2018-09-20 15:56:26 +03:00
Mikhail Glukhikh
125a136663 Delete unnecessary bunches for KotlinMavenConfigurator
One private fun (instead of public) is the only difference here
2018-09-20 15:56:25 +03:00
Mikhail Glukhikh
a0ae4dd387 Fix Maven enable coroutines test (language version) 2018-09-20 15:56:23 +03:00
Ilya Chernikov
a6c7f4294c Annotate DiscoverScriptExtensionsTask properly
KT-26978 fixed
2018-09-20 09:44:58 +02:00
Yan Zhulanow
1008adaf02 Do not discover script extensions for Kapt stub generation tasks (KT-26974) 2018-09-19 22:50:31 +03:00
Ilmir Usmanov
7b1c564b87 Replace ALOAD 0 with fake continuation if suspension point is default
method

 #KT-25922 Fixed
 #KT-26608 Fixed
 #KT-26658 Fixed
2018-09-19 22:14:29 +03:00
Pavel V. Talanov
85bdb8b787 Do not show run gutters for native
#KT-26851 Fixed
2018-09-19 19:25:24 +02:00
Anton Bannykh
06ecca4144 [JS IR BE] unsigned literal support 2018-09-19 17:45:07 +03:00
Nikolay Krasko
9f16e4f709 Report jre deprecated warning when version is set implicitly (KT-26933)
#KT-26933 Fixed
2018-09-19 17:31:10 +03:00
Toshiaki Kameyama
3f2c73b4a9 if-then to safe access: fix for qualified 'this' condition #KT-26662 Fixed 2018-09-19 16:16:15 +03:00
Toshiaki Kameyama
b5f73ebd0f if-then to safe access: report even if condition in parentheses #KT-26662 Fixed 2018-09-19 16:16:15 +03:00
kenji tomita
6d9fb4f382 Fix #KT-26902 Bad quickfix name for "Call on non-null type may be reduced" 2018-09-19 15:56:26 +03:00
Stanislav Erokhin
4ca0c60066 Temporary specify type explicitly for sequence method in debugger tests. 2018-09-19 15:46:24 +03:00
Stanislav Erokhin
95633b6027 Advance bootstrap to 1.3.20-dev-258 2018-09-19 15:46:22 +03:00
Anton Bannykh
6736987239 JS: fix unsigned literal inlining 2018-09-19 15:04:36 +03:00
Dmitry Petrov
7ff72e9d90 Fix inline class recursion through type parameters
Note that inline class such as
  inline class Id<T>(val x: T)
is prohibited in 1.3.0.
2018-09-19 14:51:50 +03:00
Anton Bannykh
66b5dd92d9 JS: fix line number data 2018-09-19 13:57:43 +03:00
Mikhael Bogdanov
1face1c334 Don't generate annotations on synthetic accessor parameters 2018-09-19 12:14:09 +02:00
Mikhael Bogdanov
38652372ce Generate private constructors for Enums
#KT-2680 Fixed
  #KT-16867 Fixed
2018-09-19 12:14:08 +02:00
Mikhael Bogdanov
c753a98d02 Use section constants to generate smap data 2018-09-19 12:14:07 +02:00
Mikhael Bogdanov
a789fd92fe Properly parse smap information
#KT-23369 Fixed
2018-09-19 12:14:07 +02:00
Ilya Gorbunov
86ba5ebf29 Mix kotlin-annotations-jvm with kotlin-reflect into proguard
So it can strip these annotations from the resulting jar.

#KT-26929 Fixed
2018-09-19 12:40:47 +03:00
Nikolay Krasko
64d2cdf0c2 Migrate for moved and renamed buildSequence/buildIterator (KT-26679)
#KT-26679 Fixed
2018-09-19 12:38:35 +03:00
Nikolay Krasko
082801efb4 Refactoring: move each problem to a separate class 2018-09-19 12:38:33 +03:00
Mikhail Zarechenskiy
86141be61f Add inference annotations to the dumped declarations 2018-09-18 23:28:54 +03:00
Alexander Udalov
8c01cd48a5 Report warning instead of error on usages of Experimental/UseExperimental
#KT-26936 Fixed
2018-09-18 22:50:26 +03:00
Ilya Gorbunov
1d7ee22bdc Simplify comparisons for small unsigned types that can fit in Int
UByte and UShort can be extended to Int exactly and then compared as ints
2018-09-18 22:25:36 +03:00
Ilya Gorbunov
af29dced98 Make overridden compareTo in unsigned types inline only 2018-09-18 22:25:36 +03:00
Ilya Gorbunov
9e0708e85a Make most of unsigned operations inline only 2018-09-18 22:25:36 +03:00
Ilya Gorbunov
d793221a7b Extract unsigned type related extensions to separate classes
- Rename class with unsigned number to string conversions to UStringsKt
- Extract Random unsigned extensions to URandomKt
2018-09-18 22:25:36 +03:00
Ilya Matveev
b469afdfcb Use argument file to run Kotlin/Native compiler 2018-09-18 21:39:44 +03:00
Ilya Matveev
7d6adbd088 Serialize native compiler args 2018-09-18 21:39:44 +03:00
Ilmir Usmanov
5dea245a37 Fix linenumbers written to debug metadata
#KT-26848 Fixed
2018-09-18 20:06:25 +03:00
Ilya Chernikov
c0f4933356 Make ivy resolver quiet 2018-09-18 18:39:30 +02:00
Mikhail Zarechenskiy
d7f2eeb6e8 Add BuildInference annotation onto stdlib coroutine builders 2018-09-18 18:55:26 +03:00
Mikhail Zarechenskiy
bc6e091004 Migration change: temporarily specify type explicitly
Because of introduction of `BuilderInference` annotation.
 Change it back after bootstrap
2018-09-18 18:55:26 +03:00
Mikhail Zarechenskiy
a293aded5d Introduce builder-like inference with an explicit opt-in for it
- Add marker for the experimental type inference features
 - Add annotation that will control builder-like inference
 - Require that annotation on corresponding parameters and extensions
 - Allow to use builder inference without suspendability

 Changes in tests and refactorings (rename mainly) are going to be
 introduced in further commits
2018-09-18 18:55:25 +03:00
Mikhail Zarechenskiy
5e9b31ca2c Minor: invert logic of function 2018-09-18 18:55:25 +03:00
Vyacheslav Gerasimov
5229ed0217 Add compatibility artifact with Mutable and ReadOnly annotations into dist
#KT-26916 Fixed
2018-09-18 18:52:32 +03:00
Denis Zharkov
ed7dd6fccb Minor. Move serialization annotation fq-names to IDE light-classes
They are a kind of a hack applied in light-classes and it'd be nice
to prevent them being used in irrelevant contexts

kotlin-serialization-compiler module should not depend on idea,
thus we can't use annotations directly there.

So, we copy-paste them and add a test on names consistency
2018-09-18 18:37:11 +03:00
Nikolay Krasko
b31de355db Fix compilation error in MavenMigrateTest.kt 2018-09-18 18:12:58 +03:00
Simon Ogorodnik
818171108e [K/N] Hack to enable exporting interop libraries 2018-09-18 17:54:57 +03:00
Dmitriy Dolovov
ab07377200 [K/N] Fix: Obsolete text stubs after updating K/N library
Issue #KT-26736 Fixed
2018-09-18 17:43:20 +03:00
Dmitriy Dolovov
db418123d4 [K/N] Proper invalidation of metadata cache in IDEA by VFS events 2018-09-18 17:43:19 +03:00
Simon Ogorodnik
35a0b42796 Support forward declarations for Native via hack-ing into built-ins 2018-09-18 17:43:15 +03:00
Simon Ogorodnik
69f5cf7095 Create Native specific LibraryInfo
This LibraryInfo contains KonanLibrary and provides correct
capabilities to ModuleDescriptor
2018-09-18 17:41:39 +03:00
Simon Ogorodnik
a2cdb14610 Add function to get typed capability from ModuleInfo 2018-09-18 17:33:10 +03:00
Simon Ogorodnik
d90cda65a1 Add factory function to create platform specific LibraryInfo's 2018-09-18 17:33:09 +03:00
Simon Ogorodnik
0cc3625dc1 Do not throw exception on not-found serialized class from knm 2018-09-18 17:33:08 +03:00
Simon Ogorodnik
ca742b1552 Support free-form .knm package part names 2018-09-18 17:33:07 +03:00
Simon Ogorodnik
7166c011bf Support for split-packages in Kotlin Native
See JetBrains/kotlin-native#2034
2018-09-18 17:33:06 +03:00
Ilya Matveev
a2c5c515de Support OptionalExpectation in native 2018-09-18 15:55:49 +03:00
Anton Bannykh
7d5a304cf6 [JS IR BE] support Char.rangeTo() 2018-09-18 15:43:55 +03:00
Roman Artemev
89bec8ec59 Update tests 2018-09-18 15:30:17 +03:00
Roman Artemev
084071e2e5 [JS IR BE] Fix callable reference lowering
* more precisely handle implicit receiver arguments
2018-09-18 14:59:21 +03:00
Ilmir Usmanov
14818a4fc1 Minor. Remove tests with suspend delegates 2018-09-18 14:56:11 +03:00
Ilmir Usmanov
c4038729ea Minor. Split tests with buildSequence into LV 1.2 and LV 1.3 versions 2018-09-18 14:56:08 +03:00
Nikolay Krasko
50deac7a26 Update test data in migration tests 2018-09-18 14:38:26 +03:00
Nikolay Krasko
6ef6fe4a47 Don't show migration dialog if no actual migrations are available (KT-26889)
#KT-26889 Fixed
2018-09-18 14:38:26 +03:00
Nikolay Krasko
11b948f004 Postpone migration till indexes are ready (KT-26428)
#KT-26428 Fixed
2018-09-18 14:38:26 +03:00
Anton Bannykh
0660e4d616 [JS IR BE] support multimodule tests 2018-09-18 14:36:20 +03:00
Anton Bannykh
2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Mikhail Glukhikh
e24f68c357 Remove erroneous suspend delegate tests (not supported in 1.3) 2018-09-18 12:00:12 +03:00
Mikhail Glukhikh
65ee837bfe Fix testAddArrayOfTypeForJavaAnnotation (named arguments in 1.3) 2018-09-18 11:50:48 +03:00
Mikhail Glukhikh
140c5d7689 Fix AddAnnotationTarget.testWithJava from multi-file quick fix 2018-09-18 11:50:47 +03:00
Mikhail Glukhikh
b7da2ad675 RedundantSamConstructor: remove reformatting in inspection visitor
This fixes testNestedInterface
2018-09-18 11:50:45 +03:00
Mikhail Glukhikh
6cb1ba9d41 Switch off ResultIsResultInspection as no more necessary for 1.3 2018-09-18 11:50:44 +03:00
Mikhail Glukhikh
94789c50b9 Do not suggest adding 'name =' before single vararg argument
This fixes two named argument intention tests
2018-09-18 11:50:43 +03:00
Mikhail Glukhikh
9694882db6 Fix testEnumClass (implementAsConstructorParameter) 2018-09-18 11:50:42 +03:00
Mikhail Glukhikh
b6c4bd270c Switch testCoroutineContext to release coroutines thus fixing it 2018-09-18 11:50:41 +03:00
Mikhail Glukhikh
2e2b15853e Suppress RESULT_CLASS_IN_RETURN_TYPE in ResultIsResultInspection tests
This fixes four relevant inspection tests
2018-09-18 11:50:40 +03:00
Mikhail Glukhikh
54e7fe6c52 Add language version 1.2 to mod-related inspection test thus fixing it
This does not work in 1.3 because mod is no more supported
2018-09-18 11:50:39 +03:00
Mikhail Glukhikh
2473362373 ArrayInDataClass test: replace Arrays functions with Kotlin ones
This fixes relevant inspection test
2018-09-18 11:50:38 +03:00
Mikhail Glukhikh
4a3af36909 Remove SHOULD_FAIL_WITH from testQuotesName thus fixing it 2018-09-18 11:50:37 +03:00
Mikhail Glukhikh
3014c3b33b Add new error from 1.3 into testIncorrectArgs thus fixing it 2018-09-18 11:50:36 +03:00
Mikhail Glukhikh
362ee126d1 Add language version 1.2 to quick-fix tests for companion in interface
In 1.3, companion members in interface can be annotated with JvmField,
so fix replacing JvmField with const is no more actual.
This fixes testCompanionInInterface.
2018-09-18 11:50:35 +03:00
Mikhail Glukhikh
81406a2bac Change .hashCode() to .bar() for some nullability fixes tests
Hash code can be no more used because in 1.3 we have nullable extension.
This fixes two wrap with safe let call tests and
one surround with null check test.
2018-09-18 11:50:34 +03:00
Mikhail Glukhikh
0f8b46b7d7 Add language version 1.2 to quick-fix tests for add explicit import
This fixes tests for KT-21515
2018-09-18 11:50:33 +03:00
Mikhail Glukhikh
39d28f1c92 AddAnnotationTargetTest: replace retention annotation if needed
This fixes testExpression3 from this test group
2018-09-18 11:50:32 +03:00
Mikhail Glukhikh
2bba4f5aa8 Fix two obsoleteCoroutines tests 2018-09-18 11:50:30 +03:00
Ilya Chernikov
7dd168d4ef [minor] remove dumping of the proguard config to the wrong file 2018-09-18 08:36:47 +02:00
Ilmir Usmanov
3bb405bee4 Minor. Move SUSPENSION_POINT_INSIDE_MONITOR to ErrorsJvm 2018-09-17 20:22:49 +03:00
Yan Zhulanow
139c582ce2 Minor: Fix missing 'ifEmpty()' 2018-09-17 20:08:28 +03:00
Yan Zhulanow
8db5fd4b9b Add missing empty bunches for AS 3.3 2018-09-17 20:08:27 +03:00
Yan Zhulanow
373ddcf55d Fix compatibility with JPS-standalone (KT-26777) 2018-09-17 20:08:27 +03:00
Yan Zhulanow
d5f203a978 Add a missing write action to KotlinNativeApplicationComponent 2018-09-17 20:08:27 +03:00
Yan Zhulanow
b38e9b6b05 Make all intellij-core dependencies non-transitive 2018-09-17 20:08:27 +03:00
Yan Zhulanow
39f5418c01 Update Android Studio 3.2 version 2018-09-17 20:08:27 +03:00
Ilmir Usmanov
35056543a2 Fix LVT entries of 'this' and parameters in coroutine code
#KT-24510 Fixed
2018-09-17 20:03:51 +03:00
Ilmir Usmanov
2dd5b8fa70 Forbid suspension points in critical sections
#KT-26480: Fixed
2018-09-17 19:29:51 +03:00
Denis Zharkov
a4b2e5964a Do not build dummy light classes for serialization-related classes
Otherwise, whether LazyLightClassMemberMatchingError happens
or other type of errors because serialization plugin expects
full resolution in the correct module

Currently, only @Serializable annotation leads to exceptions,
but just in case we consider both of them as potentially problematic

 #KT-26895 Fixed
2018-09-17 19:09:40 +03:00
Leonid Startsev
fe9ce45e1d Add initialization of constantValueGenerator for correct work
Exception was thrown from serialization plugin after compiler
refactoring
2018-09-17 19:07:10 +03:00
Ilya Gorbunov
cb47b0cde1 Fix sourcemap of stdlib/js to include new source sets 2018-09-17 17:58:28 +03:00
Ilya Gorbunov
f4af656e20 Remove entire stdlib opt-in for unsigned types to control precisely where they are exposed 2018-09-17 17:58:27 +03:00
Dmitry Petrov
97999a6415 Update testData for public API tests
Internal constructors for UIntProgression and ULongProgression are now
correctly detected as non-public API (because of proper metadata).
2018-09-17 17:28:52 +03:00
Mikhail Zarechenskiy
ea69d26bac Don't throw exception on error types in light classes mode
#KT-26829 Fixed
 #KT-26827 Fixed
2018-09-17 16:21:07 +03:00
Mikhail Zarechenskiy
fa9a3868b7 Make generation of assertions for platform types aware of kotlin types
#KT-26859 Fixed
2018-09-17 16:21:06 +03:00
Mikhail Zarechenskiy
03ea8603ce Do not try building light classes for inline classes in dumb mode
Generation of inline classes is quite complicated: we mangle methods,
 add stubs and synthesized methods. So, for simplicity, to avoid
 logic duplication in dummy resolve and in the backend, currently we
 will use only the latter for light classes generation

 #KT-26843 Fixed
2018-09-17 16:21:04 +03:00
Mikhail Zarechenskiy
7d2bc5c0f6 Properly load top-level constant initializers from multifile classes
Before Kotlin 1.3-M2 we didn't write `has_field` flag for constants
 inside multifile classes. Now we write and rely on this when
 trying to load constant initializers, which is totally fine for
 binaries that were compiled with the 1.3-M2 or newer version.
 Unfortunately, constant initializers will not be loaded for old binaries.

 One way is to avoid relying on this flag, but then we'll get other
 problems (e.g. 3345dc81fd).

 Therefore, for binaries that were compiled with at least 1.3-M2 version,
 we'll rely on the flag, otherwise, we won't.
2018-09-17 16:21:02 +03:00
Mikhail Zarechenskiy
8e66dadb47 Add regression test for KT-26806
#KT-26806
2018-09-17 16:21:01 +03:00
Roman Artemev
e242a8b08b Unmute tests 2018-09-17 15:29:19 +03:00
Roman Artemev
affc827998 [JS IR BE] Support 1.3 coroutines in backend 2018-09-17 15:29:18 +03:00
Roman Artemev
c0ef1311ba [JS IR BE] Fix runtime for Release coroutines 2018-09-17 15:29:16 +03:00
Roman Artemev
c4ddf2e9ae Enable release coroutine tests in JS IR 2018-09-17 14:52:44 +03:00
Roman Artemev
323602eb5f Skip expect declaration 2018-09-17 14:52:44 +03:00
Roman Artemev
a8b44c9e18 [JS IR BE] Fix Ir Copier
* use symbol table to allocate classifier for IrType
2018-09-17 14:52:44 +03:00
Roman Artemev
6bb77ba51d [JS IR BE] Get rid of parameters in doResume method. Make its signature similar for both 1.2 and 1.3 coroutines 2018-09-17 14:52:44 +03:00
Pavel V. Talanov
e66f3fa59e Remove as33 bunches specific to mpp run configs
It is now compatible with 182 branch
2018-09-17 13:51:17 +02:00
Pavel V. Talanov
20b86d85c3 as33 branch 'since-build' is 182.4129.33 2018-09-17 13:51:15 +02:00
Pavel V. Talanov
9cbc87ce57 Update as33 branch to AS3.3 canary 10 release 2018-09-17 13:51:14 +02:00
Ilya Matveev
e1e02b072b Use Kotlin/Native 0.9.1 (#1872) 2018-09-17 14:30:14 +03:00
Ilya Matveev
82baf6cbb1 Don't add cinterop libraries in compilation output (#1871) 2018-09-17 14:29:10 +03:00
Denis Zharkov
956f8ad5e9 Support deserialized contracts in common code
#KT-26687 Fixed
2018-09-17 12:48:42 +03:00
Alexander Podkhalyuzin
ed8aad6149 Override completion right after override modifier
#KT-25312 Fixed
2018-09-17 12:23:59 +03:00
Nikolay Krasko
073f4f51fd Clean accidentally committed temporary code 2018-09-17 11:28:22 +03:00
Ilya Matveev
ea1abb0680 Provide a DSL for publication settings (#1869)
* Provide a DSL for publication settings
* Rename DSL method publication -> mavenPublication
* Fix gradle task input/output validation

 #KT-26771 fixed.
2018-09-17 11:04:55 +03:00
Ilya Gorbunov
1b889c976a Use new sequence builders in tests
Coroutine tests will fail when LV=1.2 because there're no such builders
in kotlin.coroutines.experimental.

#KT-26678
2018-09-16 23:30:36 +03:00
Ilya Gorbunov
7a7fa56d74 [JS IR BE] New sequence builder mocks for building stdlib
#KT-26678
2018-09-16 23:30:36 +03:00
Ilya Gorbunov
aac96c476a Rename sequence and iterator builder functions and their scope class
This introduces new functions instead of the existing sequence builders:
- `sequence` instead of `buildSequence`
- `iterator` instead of `buildIterator`
- `SequenceScope` instead of `SequenceBuilder`

The old functions were deprecated with error and made inline-only, and `SequenceBuilder` has been
made a deprecated typealias to `SequenceScope`.

Move sequence builders to `SequencesKt` facade class.

Replace sequence builder usages in stdlib and samples.

#KT-26678
2018-09-16 23:30:35 +03:00
Ilya Gorbunov
9c812c6e2b Use new coroutines in samples 2018-09-16 23:30:32 +03:00
Roman Elizarov
4d3d376db8 InlineOnly Result.getOrNull method 2018-09-16 23:27:46 +03:00
Roman Elizarov
feb7239189 Removed SuccessOrFailure.
Left deprecated/error typealias to Result for 1.3-Mx users.
2018-09-16 23:27:45 +03:00
Roman Elizarov
1f675c8a74 Fixed unused exceptionOrNull result in map/mapCatching
(replaced with isSuccess check)
2018-09-16 23:27:45 +03:00
Ilya Chernikov
73907106e9 Fix script util tests after moving context utils to scripting-jvm 2018-09-16 22:24:59 +02:00
Nikolay Krasko
94e6f986e7 Mover to AS 3.2 RC 3 2018-09-16 15:52:35 +03:00
Nikolay Krasko
782aa94513 Bad indentation after annotation in incomplete declaration (KT-22322)
Same behavior is for any modifier in incomplete declaration.

 #KT-22322 Fixed
2018-09-16 15:52:34 +03:00
Nikolay Krasko
94531f992d Do not show incompatible error for *-rc13 coroutines (KT-26810)
#KT-26810 Fixed
2018-09-16 15:52:32 +03:00
Ilya Chernikov
d760299dc1 Implement context classpath extraction using particular class,...
Use it in the main-kts.
Also improve diagnoistics related to the definition loading.

#KT-26828 fixed (after this commit - finally, see also another related commit)
2018-09-15 15:44:53 +02:00
Ilya Chernikov
d9760f00f6 Move context classpath utils from script-util to scripting-jvm
since it is the right place to have it in the new structure.
Solves the problem that script-util classes not found then script
definition with context classpath is loaded by the scripting compiler
plugin, since script-util is not packed into embeddable plugin.
The old context utils are deprecated and in fact wrap the new utils.
#KT-26828 fixed (in fact - partially, see another related commit)
2018-09-15 15:43:53 +02:00
Alexey Sedunov
7b3973db52 MPP: Enable Android-specific content root logic for Android Studio
#KT-26813 Fixed
2018-09-14 21:27:10 +03:00
Anton Bannykh
082c44cb5c JS: add a flag for more convenient investigation of failing IR tests 2018-09-14 20:34:34 +03:00
Mikhail Glukhikh
382379d785 MPP wizard: remove kotlin-stdlib-native & kotlin-test-native deps
Related to KT-25952
2018-09-14 18:58:50 +03:00
Pavel V. Talanov
d3540a01a7 Jest/Mocha run config producers: fix searching for test runner package
#KT-26793 Fixed
2018-09-14 17:36:29 +02:00
Pavel V. Talanov
cbe3c69457 Gradle method/class configurations: support only jvm modules
Fixes a problem where invalid run configuration could be created
    for common module when 'Gradle Test Runner' option is selected
2018-09-14 17:36:29 +02:00
Alexey Sedunov
619e2bc0db MPP: Allow 'implements' relation only within the same Gradle project
Also allow COMMON modules on the "implementer" side
2018-09-14 17:33:59 +03:00
Mikhael Bogdanov
9e6637dced Don't generate additional annotations on synthetic accessors 2018-09-14 16:23:57 +02:00
Mikhael Bogdanov
b7afb4a58e Generate enum entries classes with package private visibility
#KT-6574 Fixed
2018-09-14 16:23:57 +02:00
Raluca Sauciuc
de989c4050 Expand the fix from commit 6c274cecff to cover AndroidX
Android Studio users who migrated to AndroidX are running into the
databinding deadlock again: https://issuetracker.google.com/111788726
2018-09-14 17:09:16 +03:00
Dmitriy Dolovov
0059fcceb9 [K/N] Safe determining Kotlin/Native meta version 2018-09-14 17:08:08 +03:00
Dmitry Petrov
88fb76bffc Fix annotations loading for inline class constructors 2018-09-14 16:09:41 +03:00
Alexey Sedunov
d5b3dc8a2a MPP: Exclude non-COMMON modules from 'implemented' list 2018-09-14 15:56:04 +03:00
Ilya Gorbunov
6bfb5c59a3 Make ResultTest common
Use custom exception type to avoid platform differences in toString implementation.
2018-09-14 15:32:25 +03:00
Ilya Gorbunov
b1c2daf1fe Stdlib: fix name shadowing and names of overridden method parameters 2018-09-14 15:32:25 +03:00
Ilya Gorbunov
bf4be12239 Stdlib: review and suppress warnings 2018-09-14 15:32:25 +03:00
Ilya Gorbunov
6786b9ece2 Stdlib tests: cleanup warnings 2018-09-14 15:32:08 +03:00
Ilya Gorbunov
7e0a658de7 Change nextInt/Long with range parameters from members to extensions
We'd like to fix the implementation of these methods, so we could intrinsify them later
or perform other optimizations that are not possible when these methods are open.
2018-09-14 15:15:52 +03:00
Ilya Gorbunov
928fe19801 Rename Random.next* parameters: remaining renames
- Correct docs after parameter renaming
- Rename parameters in Random inheritors
- Rename local variables

#KT-26596
2018-09-14 15:15:52 +03:00
kenji tomita
ffb83bbdf0 Rename Random.next* parameters from "origin, bound" to "from, until"
Rename Random test methods

#KT-26596
2018-09-14 15:15:52 +03:00
Ilya Matveev
ccd4bc1bff Add a project property for Kotlin/Native version overriding 2018-09-14 14:58:03 +03:00
Ilya Matveev
80bec0898f Download native compiler in configuration stage 2018-09-14 14:58:03 +03:00
Alexey Sedunov
5a64067601 MPP: Update gradle plugin version in new MPP tests 2018-09-14 14:51:02 +03:00
Alexey Sedunov
14d8425e27 MPP: Fix import of dependencies on Android modules 2018-09-14 14:51:01 +03:00
Alexey Sedunov
1de0dbd67d MPP: Configure Kotlin facets for Android modules
#KT-26770 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
9253f88220 MPP: Exclude COMMON modules from implementation list 2018-09-14 14:51:01 +03:00
Alexey Sedunov
4970e90412 MPP: Add commonMain as a part of inter-project dependency
#KT-26383 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
469b11e0aa MPP: Drop duplicating library produced by file collection dependency
#KT-26675 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
5ac64bcc1d MPP: Match project dependencies by target elements task 2018-09-14 14:51:00 +03:00
Alexey Sedunov
a417630c24 MPP: Force COMMON platform for commonMain/commonTest source sets
Follow-up for 172/AS3.1 bunches
2018-09-14 14:51:00 +03:00
Alexander Udalov
863c0051ce Do not report deprecation on readBytes with API version < 1.3
#KT-26667 Fixed
2018-09-14 14:43:24 +03:00
Alexander Udalov
044419eda5 Minor, refactor DeprecationResolver.getOwnDeprecations
Make local function a member, inline another utility function
2018-09-14 14:43:23 +03:00
Alexander Udalov
5dc563a9af Split deprecationUtil.kt to several files, move to subpackage
Also move interface Deprecation to subpackage "deprecation"
2018-09-14 14:43:23 +03:00
Nikolay Krasko
c268dcecd2 Better parsing for external library name (KT-26794)
- Migration notification fixed
- Make fix for replacing old coroutines libraries applicable

 #KT-26794
2018-09-14 10:52:57 +03:00
Sergey Rostov
5fc2267665 JPS, Tests: Encapsulate libraries root paths used in JPS tests 2018-09-14 10:34:30 +03:00
Sergey Rostov
f1b97bb9be JPS: code cleanup 2018-09-14 10:34:30 +03:00
Sergey Rostov
39c76c7b11 JPS: fix daemon RPC serialization
#KT-26809 Fixed
2018-09-14 10:34:30 +03:00
Georgy Bronnikov
e712007904 Restore a test 2018-09-14 09:41:39 +03:00
Georgy Bronnikov
433afcd669 JVM_IR. Mute failing tests 2018-09-14 03:12:23 +03:00
Ilya Chernikov
a03bfb3561 Implement support for non-kts scripts in gradle
#KT-26784 fixed
2018-09-13 20:47:21 +02:00
Sergey Rostov
9ae478e4fc JPS, Tests: migrate to master 2018-09-13 20:40:21 +03:00
Sergey Rostov
81cf3fbc28 JPS, minor: rename KotlinModuleBuildTarget.updateSourcesList to computeSourcesList 2018-09-13 20:30:35 +03:00
Sergey Rostov
9e6d6ad9da JPS, native: skip and report native modules as not supported
#KT-26648 Fixed
2018-09-13 20:30:35 +03:00
Dmitriy Dolovov
0c94aefb87 Move NativeIdePlatformKind to idea-jps-common
Issue #KT-26714 Fixed
2018-09-13 20:30:34 +03:00
Sergey Rostov
c8351c3da0 JPS, -Xcommon-sources: write tests 2018-09-13 20:30:34 +03:00
Sergey Rostov
313c27859a JPS tests: support _dependencies.txt and _steps.txt for better files sorting 2018-09-13 20:30:34 +03:00
Sergey Rostov
1b93f07a76 JPS tests: support custom mpp multi module tests, rearrange test data files for more consistency, configure js modules with facet (not with stdlib dependency which should be deprecated), temporary mute some complex mpp tests 2018-09-13 20:30:33 +03:00
Sergey Rostov
8cd3b46f05 JPS, -Xcommon-sources: don't iterate on all sources, use root info from DirtySourceFilesHolder. Cleanup code.
Also:
- Pass `-Xcommon-sources` argument to JS compiler.
- Calculate all sources list only when needed (after change it is not required to calculate common-sources)
- Remove `chunk: ModuleChunk` parameter from some `KotlinModuleBuildTarget` functions.
2018-09-13 20:30:33 +03:00
Sergey Rostov
359909dcff JPS MPP tests: Don't do anything for common modules, enable js ic, fix test data 2018-09-13 20:30:33 +03:00
Sergey Rostov
4975ef7db5 JPS tests: restore MPP tests runner, support new MPP model 2018-09-13 20:30:32 +03:00
Sergey Rostov
808e83a01e JPS tests: switch to new dependencies.txt parser
Order of modules changed because new parser preserve order, while previously modules are accidentally sorted by hashCode().
2018-09-13 20:30:32 +03:00
Sergey Rostov
0b5a6f61bb JPS tests: move MockJavaConstantSearch to separate file to got rid of AbstractIncrementalJpsTest.kt.173 bunch file 2018-09-13 20:30:32 +03:00
Sergey Rostov
b8c982bb72 JPS: support -Xcommon-sources for multiplatform projects
#KT-26489 Fixed
2018-09-13 20:30:31 +03:00
Vyacheslav Gerasimov
9e701f96de Add changelog for 1.2.70 2018-09-13 20:18:09 +03:00
NikitaKatkov
d2536f207c 183: CoroutineNonBlockingContextChecker for warning on blocking calls in coroutines (KT-15525) 2018-09-13 19:36:51 +03:00
Denis Zharkov
341f7c348a Fix memory leak in KotlinBuiltins related to unsigned types
Having a map from ModuleDescriptor leads to modules leakage
Especially, it's critical for DefaultBuiltins which is used in JS

ModuleDescriptor's instances were leaked there forever until the daemon dies
(up to 350M while compiling Kotlin project itself)
2018-09-13 18:49:42 +03:00
Georgy Bronnikov
f04733ef33 JVM_IR. support big arity 2018-09-13 18:44:47 +03:00
Mikhael Bogdanov
03f092fd39 Revert "Generate private constructors for Enums" cause of bootstrap problem
This reverts commit 81435c9
2018-09-13 17:07:56 +02:00
Mikhail Glukhikh
76d1d6ff12 Allow to move suspend lambda out of parentheses
#KT-26674 Fixed
#KT-26676 Fixed
2018-09-13 16:38:29 +03:00
Alexander Udalov
3a5de13dd4 Support inline classes in function signatures in call/callBy
#KT-25664 Fixed
 #KT-26748 Open
 #KT-26765 Open
2018-09-13 16:04:20 +03:00
Alexander Udalov
3e79bd2b0e Make CallerImpl with subclasses a sealed hierarchy 2018-09-13 15:54:20 +03:00
Alexander Udalov
8c8f0639f8 Remove unneeded CallerImpl implementations
Also fix a bug where nullability of the assigned value was not checked
in ClassCompanionFieldSetter because it wasn't a subclass of FieldSetter
where this check occurred
2018-09-13 15:54:20 +03:00
Alexander Udalov
356b02cb91 Extract Caller interface out of FunctionCaller, move to subpackage
Also rename FunctionCaller to CallerImpl and extract irrelevant
declarations out of it
2018-09-13 15:40:38 +03:00
Alexander Udalov
43dcbbcce1 Minor, use arrayOf to simplify code in FunctionCaller 2018-09-13 15:40:38 +03:00
Natalia Selezneva
4b138ae2b8 Do not use async script dependencies resolver in tests 2018-09-13 14:50:22 +03:00
Nikolay Krasko
8be1929634 Title and description unification for coroutines migration inspection (KT-26472) 2018-09-13 11:26:59 +03:00
Nikolay Krasko
9bfbe8a90a Enable Maven fix for coroutines in migration (KT-26472)
#KT-26472 Fixed
2018-09-13 11:26:57 +03:00
Nikolay Krasko
504c9c02d7 Remove detection of new projects from the list of modules 2018-09-13 11:26:55 +03:00
Nikolay Krasko
a58f7b5599 Remove unneeded bunch file 2018-09-13 11:26:53 +03:00
Mikhael Bogdanov
81435c98fa Generate private constructors for Enums
#KT-2680 Fixed
  #KT-16867 Fixed
2018-09-13 10:09:58 +02:00
Mikhail Glukhikh
941e5ae1b2 Introduce MPP wizard for shared (JVM / JS / iOS) libraries
This implements second part of KT-25952
2018-09-13 10:52:46 +03:00
Mikhail Glukhikh
84587eb0f9 Kotlin JVM/JS multiplatform builder: change description 2018-09-13 10:52:23 +03:00
Mikhail Glukhikh
03820245eb Change KonanPlatform platform name: Konan -> Native #KT-26691 Fixed 2018-09-13 09:09:47 +03:00
Mikhail Glukhikh
6c49c1eabd NativeIdePlatformKind: remove redundant 2018-09-13 09:09:46 +03:00
Mikhail Glukhikh
e7a6ce3626 NativeIdePlatformKind: remove unused 2018-09-13 09:09:44 +03:00
Mikhail Glukhikh
df0d91ef9e Style fix: KotlinNativeModuleConfigurator 2018-09-13 09:09:43 +03:00
Ilya Gorbunov
9353cfb526 contentDeepToString: use list instead of set for infinite recursion tracking
#KT-26388
2018-09-13 06:10:10 +03:00
Ilya Gorbunov
2d356b89b5 Specialize contentDeepEquals/HashCode/ToString for arrays of unsigned types
#KT-26388
2018-09-13 06:10:10 +03:00
Ilya Gorbunov
3cc606577c Add annotations-13.0 in classpath of those tests where the annotations from stdlib were used 2018-09-13 02:41:19 +03:00
Ilya Gorbunov
f340bc9f91 Do not use deprecated org.junit.Test in gradle js integration tests 2018-09-12 21:42:48 +03:00
Denis Zharkov
e213dc261e Fix bunch files for test RunConfigurationTest 2018-09-12 19:48:03 +03:00
Alexander Podkhalyuzin
85ba637796 Light classes should reuse language versions settings during generation
#KT-26732 Fixed
2018-09-12 16:02:07 +03:00
Vyacheslav Gerasimov
c768130f89 Remove gradle/ext-releases-local repo, native platform is now available on jcenter 2018-09-12 15:52:15 +03:00
Ilmir Usmanov
e9fc65c7ae Use our own primitive boxing methods in coroutines codegen
#KT-26490 Fixed
2018-09-12 15:36:17 +03:00
Ilmir Usmanov
273889d1a9 Add our own primitive boxing methods to stdlib
These methods are very thin wrappers around primitive wrapper classes
constructors.
They are used by coroutines code which returns primitives and this way
HotSpot is able to throw the allocations away completely.
 #KT-26591 Fixed
2018-09-12 15:36:11 +03:00
Dmitry Petrov
792c5f8b3f Generate metadata and annotations for hidden constructor
Reflection expects to see a callable method for a hidden constructor,
thus, it should be a synthetic accessor.
JVM method signature in metadata should point to the synthetic accessor.
Annotations for hidden constructor should be written on the synthetic
accessor.
2018-09-12 15:33:11 +03:00
Ilmir Usmanov
3e3ffd14a9 Exclude kotlin.coroutines.intrinsics and kotlin.coroutines.jvm.internal
from default imports.
2018-09-12 15:22:51 +03:00
Alexander Udalov
f63cf9d506 Use JvmName on kotlin.Metadata parameters to improve public API
#KT-26359 Fixed
2018-09-12 14:37:11 +03:00
Denis Zharkov
8365836753 Fix as33-bunch for KotlinRunConfigurationProducer.kt after 38be1f6947 2018-09-12 14:03:07 +03:00
Alexander Udalov
6b2a1497e2 Advance bootstrap to 1.3.0-dev-496 2018-09-12 13:34:23 +03:00
victor.petukhov
50d9dbbfc1 Fix inheritance in stdlib contracts code (KT-26409) 2018-09-12 12:34:15 +03:00
victor.petukhov
cba99a1e67 Move test to negatives after fix KT-26382 2018-09-12 12:32:57 +03:00
Denis Zharkov
9bc5b753aa Fix 181-bunch for KotlinRunConfigurationProducer.kt after 38be1f6947 2018-09-12 11:47:33 +03:00
Anton Bannykh
b389e29db5 JS: update DCE testdata 2018-09-12 09:49:25 +03:00
Anton Bannykh
ead9b31e03 JS: support [suspend] fun main([args: Array<String>]) (KT-26628, KT-26572 fixed) 2018-09-12 09:49:25 +03:00
Denis Zharkov
7e9704e50d Prohibit inheritance of Java members containing FunctionN types
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
24a905293f Load Java declarations which reference FunctionN as Deprecated.Error
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
bcf1b9c804 Minor. Reformat SignatureEnhancement 2018-09-12 09:49:25 +03:00
Denis Zharkov
7f4f07659c Minor. Move Deprecation and DeprecationLevel interfaces to core 2018-09-12 09:49:25 +03:00
Denis Zharkov
9cb8a35275 Minor. Pull user-data related things to CallableDescriptor
Currently, we assume user data for all non-FunctionDescriptor
declarations is empty
2018-09-12 09:49:25 +03:00
Denis Zharkov
c1cc722ac4 Turn off incorrect switch-optimization for when by enums
#KT-24708 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
fc3c4ad883 Support parameterless and suspend main functions in multifile classes
#KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
b53194ef1a Minor. Drop unused method in FunctionCodegen 2018-09-12 09:49:25 +03:00
Denis Zharkov
aa74511378 Fix UnusedSymbolInspection for parameterless and suspend main functions
#KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
1cc0c12f87 Add language feature for extended main convention
- suspend
- parameterless

 #KT-17679 Fixed
 #KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
f79fbe778f Minor. Extract KtElement::isMainFunction in the IDE context 2018-09-12 09:49:25 +03:00
Denis Zharkov
38be1f6947 Minor. Parametrize MainFunctionDetector with LanguageVersionSettings 2018-09-12 09:49:25 +03:00
Denis Zharkov
bc722f9c5f Support main entry-point without arguments in JVM
#KT-26574 In Progress
2018-09-12 09:48:13 +03:00
Denis Zharkov
2c920b732c Support main entry-point without arguments in frontend
#KT-26574 In Progress
2018-09-12 09:48:13 +03:00
Denis Zharkov
3cf1c56794 Minor. Get rid of static public parts in MainFunctionDetector
In further commits, MainFunctionDetector::isMain will use
getFunctionDescriptor property
2018-09-12 09:48:13 +03:00
Denis Zharkov
c3f6ba3302 Support suspend fun main in JVM
#KT-17679 Fixed
2018-09-12 09:48:13 +03:00
Denis Zharkov
272ee252d8 Report warning on "suspend {}"-like calls based on variable
#KT-22892 Fixed
2018-09-12 09:48:13 +03:00
Denis Zharkov
b9f141d4aa Forbid suspend functions annotated with @kotlin.test.Test
#KT-26200 Fixed
2018-09-12 09:48:13 +03:00
Ilya Gorbunov
a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Ilya Gorbunov
03340d770b Replace remaining distJar dependencies with default configuration dependencies 2018-09-12 06:05:05 +03:00
Pavel V. Talanov
ef915096a5 Common tests are discoverable via platform modules test classpath
Introduce KotlinGradleOrderEnumerationHandler
    and patch KotlinAndroidGradleOrderEnumerationHandler:
    - If 'Android Support' plugin is off KAndroidGradleOEH will not be available and KGOEH will be used
    - Make KAndroidGOEH implement a different EP so it replaces KGOEH when it is available
2018-09-12 04:13:32 +02:00
Pavel V. Talanov
4b0bc4a438 Try to distinguish between test/production compilations 2018-09-12 04:13:32 +02:00
Pavel V. Talanov
ee1ec22e4c Implement MultipleRunLocationsProvider EP
Provide run locations corresponding to platform modules when invoked from common code
2018-09-12 04:13:32 +02:00
Pavel V. Talanov
3da9d79fc2 KtFile.getClasses() returns empty array for non-jvm files 2018-09-12 04:13:32 +02:00
Pavel V. Talanov
3a2d25a422 Js run configuration producers: get module from ConfigurationContext
Delegate mpp concerns to MultipleRunLocationsProvider EP
Restore old behaviour via bunch files
2018-09-12 04:13:31 +02:00
Pavel V. Talanov
456bf9808d Configuration providers don't create configurations for common code
Remove special code that creates configurations
    and patches them for common modules
This should be done via MultipleRunLocationsProvider EP
2018-09-12 04:13:31 +02:00
Pavel V. Talanov
25882c5b46 Minor: add is(New)MPPModule utils 2018-09-12 04:13:31 +02:00
Pavel V. Talanov
472be61356 182 branch since-build is 182.4129.33
To allow use of the latest API
2018-09-12 04:13:31 +02:00
Ilya Gorbunov
c4e794b21f Add nullability annotations jar to debugger test application compile classpath 2018-09-12 00:58:55 +03:00
Ilya Gorbunov
41a8678b95 Remove mutability and nullability annotations from stdlib in kotlinc/lib
#KT-21784
2018-09-12 00:58:55 +03:00
Ilya Gorbunov
584410b14b Advance bootstrap to 1.3.0-dev-485 2018-09-12 00:55:14 +03:00
Alexander Udalov
e7807cc168 Skip prerelease check when building kotlin-stdlib-js-merger 2018-09-11 21:10:04 +03:00
Ilya Gorbunov
c1829782b7 Turn off compiler prerelease flag #KT-26643 2018-09-11 21:10:04 +03:00
Yan Zhulanow
59241a9c1f Minor: Remove unneeded import 2018-09-11 21:07:27 +03:00
Ilya Gorbunov
000e7493a1 Introduce common KCallable and K(Mutable)Property(ø,0,1,2) interfaces
#KT-25935
2018-09-11 19:21:15 +03:00
Ilya Gorbunov
7b46d22877 Introduce common KClass interface #KT-25935 2018-09-11 18:45:55 +03:00
Ilya Gorbunov
62ffacab09 Raise deprecation level for jsClass functions
Suppress error in tests

#KT-21703
2018-09-11 18:15:04 +03:00
Ilya Gorbunov
35f42c7d35 Raise deprecation level for kotlin.Synchronized and Volatile, remove replacements
They are js-only but not supposed to be used in Kotlin/JS code, so their
usages should be just removed.

#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
010b36be1f Raise deprecation level for kotlin.js.Math functions
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
fbd2322ffa Add replacement information for deprecated JQuery members
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
c3f654a71c Stdlib/JS: drop deprecated CharSequence.size
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
f1c3d8b860 Raise deprecation level for kotlin.test collection assertions
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
ad76edd7b7 Raise deprecation level for org.junit.Test in stdlib for common and JS
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
1a8b258d86 Raise deprecation level for map delegation accessor according to #KT-18789
#KT-21703
2018-09-11 18:15:03 +03:00
victor.petukhov
8f209fa667 Add documentation to contracts stdlib code 2018-09-11 18:03:38 +03:00
victor.petukhov
63698380e1 Add contract samples for stdlib 2018-09-11 18:03:09 +03:00
Ilmir Usmanov
8ec49adcf0 Minor. Ignore test 2018-09-11 17:50:46 +03:00
Leonid Startsev
fa990174ef Rename kotlinx-serialization => kotlin-serialization
Discussed with @elizarov and @ilya-g
2018-09-11 17:31:38 +03:00
Sergey Igushkin
099ad8de1e Don't set Kotlin platform attribute for the default configuration
Also, fix empty configurations created for targets that have no runtime
outputs (metadata ones, especially), which could get chosen by Gradle
during dependency variant-aware resolution of a `project(...)`
dependency.

See also: d13ca38

With the attribute set, an input configuration that does not require the
Gradle's USAGE attribute but requires Kotlin platform metadata, will
fail to resolve because the attributes set on the consumable
output configurations are not subsets of each other, as follows:

> Cannot choose between the following variants of project :lib:
  - metadataApiElements
  - metadataDefault
  - metadataRuntimeElements
  All of them match the consumer attributes:
    - Variant 'metadataApiElements':
      - Found org.gradle.usage 'java-api' but wasn't required.
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.
    - Variant 'metadataDefault':
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.
    - Variant 'metadataRuntimeElements':
      - Found org.gradle.usage 'java-runtime-jars' but wasn't required.
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.

Issue #KT-26383 Fixed
2018-09-11 17:22:36 +03:00
Mikhail Zarechenskiy
908be10bf4 Write version requirement on inline classes and relevant declarations
#KT-26720 Fixed
2018-09-11 17:13:44 +03:00
Ilya Gorbunov
1eda3805ec Introduce overloads to check for T? element contained in iterable range in a constant time
#KT-18483
2018-09-11 17:06:42 +03:00
Yan Zhulanow
64e85e8a0c Support new $this_<label> field naming convention in debugger 2018-09-11 16:41:21 +03:00
Yan Zhulanow
50858b6fa3 Kapt, minor: Add a test for inline classes (KT-25800) 2018-09-11 16:41:21 +03:00
Yan Zhulanow
2219f0956e Minor: Change the output for KT-19628 tests to the temporary directory path 2018-09-11 16:41:20 +03:00
Yan Zhulanow
d16b55033e Introduce new naming convention for captured receiver backing fields
'receiver$0' -> '$this_<label>'
2018-09-11 16:41:20 +03:00
Yan Zhulanow
11d4a6bf5c Refactoring: Rename closure methods in CalculatedClosure, add a method for getting receiver labels 2018-09-11 16:40:44 +03:00
Yan Zhulanow
6f7741b6bb Minor: Move AbstractParcelBytecodeListingTest to compiler tests, change its format a bit 2018-09-11 16:40:43 +03:00
Yan Zhulanow
c6b5e8c40f Minor: Extract code for checking Dalvik identifiers to frontend 2018-09-11 16:40:43 +03:00
Yan Zhulanow
5fed77d87a MPP: Add missing platform kind extensions to AS 3.3 bunch file 2018-09-11 16:40:43 +03:00
Yan Zhulanow
72637268c6 Minor, tests: Move EXPECTED_ERROR directives to the file end (to preserve stable line numbers) 2018-09-11 16:40:42 +03:00
Yan Zhulanow
c517b85de1 Kapt: Support also erroneous super interface names 2018-09-11 16:40:42 +03:00
Martin Petrov
dfff00d55f KT-26540: Support generated superclasses in KAPT
https://youtrack.jetbrains.net/issue/KT-26540

Included an integration test that relies on a generated superclass.
2018-09-11 16:40:42 +03:00
Sergey Igushkin
f147b8d2b2 Change classes task naming and create additional task for IDE runner
Issue #KT-26641 Fixed
2018-09-11 16:24:59 +03:00
Ilya Matveev
29048ce5ae Add generated interop libraries in compile dependency configuration (#1864) 2018-09-11 16:07:33 +03:00
Ilya Chernikov
712e23f8b0 Document scripting common API, drop unused bits 2018-09-11 14:56:53 +02:00
Ilya Chernikov
a02d5b4b21 Rename script annotation params according to configuration keys...
rename evaluation params consistently too
2018-09-11 14:56:51 +02:00
Mikhail Glukhikh
136428c7b4 If-then to safe access/elvis: fix mistake in shouldBeTransformed
This should fix two inspection tests (implicit receiver case)
Before this commit, check of 'this' on null was accidentally
not highlighted by if-then to safe access or elvis. Now it is.
2018-09-11 15:34:58 +03:00
Anton Bannykh
65f98a285a JS: fix test by using release coroutines 2018-09-11 15:29:48 +03:00
Alexey Sedunov
6b3184e634 MPP: Fix test data after disabling import of 'metadata' compilations 2018-09-11 15:01:23 +03:00
Leonid Startsev
585d584857 Minor: get rid of some compiler warnings in kotlin-serialization-compiler-plugin 2018-09-11 14:36:10 +03:00
Roman Artemev
d0ce5d5a4d Fix test data 2018-09-11 14:29:47 +03:00
Roman Artemev
cc995bf1d5 Remove workaround for COROUTINE_SUSPENDED property 2018-09-11 14:29:47 +03:00
Roman Artemev
3dbc5ddb05 [KT-25003] Fix accessing property COROUTINE_SUSPENDED from stdlib coroutine 2018-09-11 14:29:47 +03:00
shiraji
fd3fe52eb4 Fix the problem with code completion of type extension method
KT-23834 Fixed
2018-09-11 14:24:45 +03:00
Svyatoslav Kuzmich
9ff8c93529 [JS BE] Fix KT-26706: incorrect Long value in string templates 2018-09-11 14:13:00 +03:00
Leonid Startsev
7011e9422d Rename kotlinx-gradle-serialization-plugin => kotlinx-serialization 2018-09-11 13:22:17 +03:00
Leonid Startsev
23fd0a6ec9 Split IDE part from kotlinx-serialization-compiler-plugin 2018-09-11 13:22:16 +03:00
Dmitriy Dolovov
9ca0643b1a K/N: Added comments regarding synthetic forward declarations module 2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
fbd220fc05 K/N: Actualize KonanBuiltIns 2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
324ec7aff8 Detect K/N library kind if library is a ZIP file (native-specific part)
Issue #KT-26730 Fixed
2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
0d0929922a Detect K/N library kind if library is a ZIP file (common part)
Issue #KT-26730
2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
8a79255176 K/N: Drop unused class 2018-09-11 12:48:31 +03:00
Mikhail Zarechenskiy
66a00f442c Add tests for obsolete issues
#KT-12008 Obsolete
 #KT-11881 Obsolete
 #KT-10822 Obsolete
2018-09-11 12:34:09 +03:00
Dmitry Petrov
58442899b8 Postpone NoConstantValueAttributeForNonConstVals till 1.4
Requires special inspection for migrating Java code.
2018-09-11 11:27:33 +03:00
Mikhail Zarechenskiy
106ecadd62 Allow using kotlin.Result as a return type in stdlib 2018-09-11 10:39:27 +03:00
Mikhail Zarechenskiy
7b70c1a2d9 Allow kotlin.Result only for declarations that are effectively fields 2018-09-11 10:39:25 +03:00
Mikhail Zarechenskiy
e6f936e689 Update test data about mod from builtIns
After 7595cb23ab
2018-09-11 10:39:24 +03:00
Mikhail Zarechenskiy
ccfcea85ec Minor: get MAX_VALUE directly from unsigned types 2018-09-11 10:39:22 +03:00
Mikhail Zarechenskiy
2a04df531a Fix exception: don't try to map value of error type
#EA-127029 Fixed
2018-09-11 10:39:20 +03:00
Mikhail Zarechenskiy
862aa8d1aa Fix exception: don't try to get value of error constant
#EA-126623 Fixed
2018-09-11 10:39:19 +03:00
Mikhail Zarechenskiy
e5ee142208 Prohibit @JvmField on properties of inline class types
#KT-26454 Fixed
2018-09-11 10:39:17 +03:00
Mikhail Zarechenskiy
55ef96e5c9 Prohibit @JvmName on functions that are assumed to be mangled
#KT-26454 In Progress
2018-09-11 10:39:16 +03:00
Mikhail Zarechenskiy
5f50977974 Refactoring: extract mangling utils that related to resolve out 2018-09-11 10:39:14 +03:00
Mikhail Zarechenskiy
26ca411423 Minor: use common constant for kotlin.Result 2018-09-11 10:39:13 +03:00
Mikhail Zarechenskiy
169599abcc Add flag to allow using kotlin.Result as a return type
#KT-26659 Fixed
2018-09-11 10:39:11 +03:00
Mikhail Zarechenskiy
864e21dd1b Prohibit expressions of Result type as left operands of ?./!!/?:
#KT-26659 In Progress
2018-09-11 10:24:50 +03:00
Mikhail Zarechenskiy
b1cd49dd7b Prohibit using kotlin.Result as a return type in most cases
#KT-26659 In Progress
2018-09-11 10:24:48 +03:00
Ilya Gorbunov
48add96e79 Deprecate mixed Int/FP contains operator for ranges
#KT-22423
2018-09-11 05:40:15 +03:00
Ilya Gorbunov
68c5c0f639 Introduce ConcurrentModificationException typealias in stdlib/jvm
This is required to provide the corresponding expect exception in stdlib/common.
Raise deprecation level for constructors declared in common but unsupported in JVM.

#KT-26598
2018-09-11 04:59:56 +03:00
Ilya Gorbunov
afb62ffc0c Update testData for incremental compilation tests
- enumMemberChanged, flagsAndMemberInSameClassChanged: added top level function results in a file class being generated
- companionObjectNameChanged: one more file is marked as dirty after the changes in build 1.2.70-dev-1439
2018-09-11 04:19:49 +03:00
Ilya Matveev
3269c0e51b Support cinterop in the native part of kotlin-multiplatform 2018-09-10 20:43:00 +03:00
Ilya Matveev
f7949a2131 Use 'teamcity.version' property to detect CI in K/N tests 2018-09-10 20:40:59 +03:00
Ilya Matveev
0ac701d8bf Provide getters for names of native link tasks 2018-09-10 20:40:59 +03:00
Ilya Matveev
f1de88ebbc Use teamcity test logger if the project has a corresponding property 2018-09-10 20:40:59 +03:00
Ilya Matveev
cbb1b9fae5 Provide a basic DSL for liking task accessing 2018-09-10 20:40:59 +03:00
Ilya Matveev
f5eecdd547 Support custom entry points for native binaries 2018-09-10 20:40:59 +03:00
Ilya Matveev
76074f9543 Support language settings from source sets for native 2018-09-10 20:40:59 +03:00
Ilya Matveev
14e4f219da Support compiler plugins in native part of the mpp plugin 2018-09-10 20:40:59 +03:00
Ilya Matveev
41367b0285 Create test tasks for all native hosts + tests
#KT-26547 fixed
2018-09-10 20:40:59 +03:00
Ilya Matveev
03e1e8d19d Support friend modules in native mpp 2018-09-10 20:40:59 +03:00
Ilya Matveev
595a7700df Use FQ names for Kotlin/Native project properties 2018-09-10 20:40:59 +03:00
Nikolay Krasko
462000ae19 Fix code style applier (KT-23400)
- Stop removing defined schemes and clone settings before modification
- Clone code styles before modification
- Don't bother users that already have needed code style with settings change
2018-09-10 19:07:36 +03:00
Dmitriy Dolovov
194d94071a K/N: Create target-neutral K/N libraries 2018-09-10 17:54:08 +03:00
Dmitriy Dolovov
314173af60 Disable specific EPs for K/N plugin for CLion/AppCode #KT-26717 2018-09-10 17:54:07 +03:00
Dmitriy Dolovov
71be94b3e4 K/N: Cache library metadata in IDEA plugin 2018-09-10 17:54:06 +03:00
Simon Ogorodnik
1df91ff7ec Refactor NativeAnalyzerFacade to reuse existing library dependency model
Fix memory blowing up in quadratic native stdlib dependencies
Reuse ModuleInfo & LibraryInfo for Native properly
2018-09-10 17:54:06 +03:00
Nikolay Krasko
69aa6d399e Forgotten utility for getting Kotlin code style defaults 2018-09-10 17:49:39 +03:00
Dmitry Petrov
e3fa785678 Minor: drop irrelevant test case
Hiding constructors with inline class type parameters
is tested by bytecodeListing tests
2018-09-10 17:45:05 +03:00
Dmitry Petrov
eb940ec58d Fix inline class tests
Use original descriptor when determining if a synthetic accessor should
be used for a possibly hidden ("mangled") constructor call.
2018-09-10 17:33:34 +03:00
Alexey Sedunov
6206f1e419 MPP: Implement isTestModule flag (as required by JPS) 2018-09-10 17:27:41 +03:00
Alexey Sedunov
befb6d19d1 MPP: Use all transitively reachable modules as compilation source sets
#KT-26254 Fixed
2018-09-10 17:27:41 +03:00
Alexey Sedunov
ff105cb059 MPP: Force COMMON platform for commonMain/commonTest source sets
Also set isTestModule flag for them according to source set name alone

 #KT-26356 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
ad4a3c0b7c MPP: Do not import compilations with 'metadata' target
#KT-26634 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
358b7ca1d1 MPP: Import library dependencies of transitive dependee source sets
#KT-26369 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
dbd18ca27b MPP: Do not show -Xmultiplatform flag in facet settings
#KT-26484 Fixed
2018-09-10 17:27:40 +03:00
Svyatoslav Scherbina
5c6193ddf3 Use proper origin for fake override fields in IR 2018-09-10 17:00:58 +03:00
Svyatoslav Scherbina
dc71e5b934 Prevent external IR field stub from being bound twice 2018-09-10 17:00:57 +03:00
Denis Zharkov
3d72831966 Mark idea-native module as 'jps-compatible' 2018-09-10 16:59:29 +03:00
Alexander Podkhalyuzin
0a5e782901 Removed @author tag 2018-09-10 14:51:01 +03:00
Mikhail Glukhikh
0169719a87 Add native dependencies to uast-kotlin module tests 2018-09-10 14:33:36 +03:00
Alexander Podkhalyuzin
baa0f2dc1b Override completion in expect class should behave differently
Caret placement is at the end of new fun/property

#KT-25313 Fixed
2018-09-10 14:23:48 +03:00
Anton Bannykh
d571d0ad51 JS: prohibit using experimental coroutines from 1.3 2018-09-10 14:18:44 +03:00
Alexander Udalov
c4be039cd1 Support argfiles in CLI with "@argfile"
#KT-24613 Fixed
2018-09-10 14:12:32 +03:00
Alexander Udalov
e996513044 Support single quotation marks in argfiles
#KT-26122 Fixed
2018-09-10 14:12:31 +03:00
Alexander Udalov
9311ea5d25 Support progressive mode via "-progressive"
#KT-25862 Fixed
2018-09-10 14:12:31 +03:00
Alexander Udalov
7474f1dc56 Minor, refactor KotlinMetadataVersionIndexBase.createBinaryVersion
Make it a protected method instead of a property passed in the
constructor
2018-09-10 14:12:18 +03:00
Alexander Udalov
1d5d6b5b72 Support strict metadata version semantics
Preface: Kotlin 1.3 will be able to read metadata of .class files
produced by Kotlin 1.4 (see KT-25972). Also, to simplify implementation
and to improve diagnostic messages, we're going to advance JVM metadata
version to 1.4.0 in Kotlin 1.4, and would like to keep it in sync with
the compiler version thereafter. This presents a problem: in an unlikely
event that before releasing 1.4, we find out that the metadata-reading
implementation in 1.3 was incorrect, we'd like to be able to fix the bug
in that implementation and _forbid_ 1.3 from reading metadata of 1.4.
But prior to this commit the only way to do this was to advance the
metadata version, in this case to 1.5, and that breaks the
metadata/compiler version equivalence we'd like to keep.

The solution is to add another boolean flag to the class file, called
"strict metadata version semantics", which signifies that if this class
file has metadata version 1.X, then it can only be read by the compilers
of versions 1.X and greater. This flag effectively disables the smooth
migration scenario proposed in KT-25972 (as does increasing metadata
version by 2), and will be used only in hopeless situations as in the
case described above.
2018-09-10 14:12:18 +03:00
Alexander Udalov
8c942752e8 Write flags to .kotlin_module files since metadata version 1.4
This value will be used for flags like pre-release (KT-21256) and other
similar info
2018-09-10 14:12:17 +03:00
Dmitry Petrov
b8eb804774 KT-26531 is fixed in NewInference mode 2018-09-10 14:10:05 +03:00
Alexander Podkhalyuzin
8e9945bc9e Fixed deprecated IDEA API
#KT-24907 Fixed
2018-09-10 13:28:11 +03:00
Alexander Podkhalyuzin
720587abf3 Added DynamicallyLoaded annotation to AndroidDexWrapper
#KT-25449 Fixed
2018-09-10 13:26:12 +03:00
Nikolay Krasko
f679b3f6dd Import Kotlin code style from Maven properties (KT-23400) 2018-09-10 13:03:41 +03:00
Nikolay Krasko
1820028086 Refactoring: extract method for applying codestyle from string (KT-23400) 2018-09-10 13:03:41 +03:00
Nikolay Krasko
a5e8508e5a Write official code style to maven archetypes (KT-23400) 2018-09-10 13:03:41 +03:00
Ilya Chernikov
ba702a7eec [minor] remove redundant null check 2018-09-10 11:21:29 +02:00
Ilya Chernikov
01dd665441 Simple test for non-kts script compilation 2018-09-10 11:21:27 +02:00
Ilya Chernikov
3f2552af60 Export filename extension from KotlinScriptDefinition, register...
extensions after loading definitions
2018-09-10 11:21:26 +02:00
Dmitriy Dolovov
5183eba70b Fix K/N module compilation in MPP project imported from Gradle #KT-26688 2018-09-10 11:17:42 +03:00
Dmitry Petrov
4c7972a9e8 Fix KT-25853 IDEA hangs when Kotlin bytecode tool window open...
KotlinTypeMapper.findFirstDelegatingSuperCall can loop forever if the
code is invalid. Bail out.
2018-09-10 10:58:33 +03:00
Dmitry Petrov
bbbca9fbbf Minor: mute inline classes tests in JVM_IR 2018-09-10 10:42:18 +03:00
Ilya Gorbunov
903976d9af Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039
2018-09-10 06:41:49 +03:00
Ilya Gorbunov
48fd8a63ee Introduce Any?.hashCode() extension #KT-25039 2018-09-10 06:41:49 +03:00
Mikhail Zarechenskiy
3431123cab Fixes for tests about mod
#KT-25217
2018-09-10 06:31:55 +03:00
Mikhail Zarechenskiy
dee3617dd8 Refine deprecation diagnostics for mod depending on api version
#KT-25217 Fixed
 #KT-26654 Open
2018-09-09 23:55:38 +03:00
Mikhail Zarechenskiy
7595cb23ab Raise deprecation level for mod operators to ERROR in stdlib
#KT-25217 In Progress
2018-09-09 23:55:36 +03:00
Roman Elizarov
b12e0aab2f Remove contract from Result.xxxCatching functions
Fixes KT-26523
2018-09-09 11:36:47 +03:00
Roman Elizarov
2406bf0536 Restore SuccessOrFailure.kt to bootstrap (to be removed later) 2018-09-09 11:34:49 +03:00
Roman Elizarov
e2713501ce Rename SuccessOrFailure to Result and hide Failure from ABI
* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
2018-09-09 11:34:31 +03:00
Zalim Bashorov
69ee88871f Don't print stack trace for ignored tests by default 2018-09-08 13:37:30 +03:00
Zalim Bashorov
bd6f3fd9b2 Minor: remove the no longer used variable in BasicIrBoxTest.kt 2018-09-08 13:37:30 +03:00
Zalim Bashorov
ae801c4b45 [JS IR BE] (quick fix) define coroutine related *H.kt files earlier to fix overriding actual implementations by empty expected versions 2018-09-08 13:37:30 +03:00
Mikhail Glukhikh
78131d2e65 Add native dependencies to idea-gradle module tests 2018-09-08 12:16:27 +03:00
Mikhail Glukhikh
bf23dac7ff Add native dependencies to idea-maven module tests 2018-09-08 12:16:27 +03:00
Mikhail Glukhikh
9887db1f9b Add native dependencies to ultimate module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
1fd4be580a Add native dependencies to idea-android module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
f909761974 Add native dependencies to android-extensions-idea module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
c2da0bf797 Add native dependencies to J2K module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
f514424324 Revert non-convention KotlinNativeCompile task in import 173 / AS31
'Property' is not supported for these IDEA / AS versions
2018-09-08 12:16:25 +03:00
Simon Ogorodnik
6e93bccad4 Fix test dependencies of idea module after introducing native 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
22e6948d7d K/N: add fake compiler arguments (only to be used in IDEA plugin) 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
f663c0ea87 Rename "Konan" -> "KotlinNative" in class and function names (part 3) 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
cb7009ace8 K/N: Rename "kotlin-native-serializer" to "kotlin-native-library-reader" 2018-09-08 12:16:24 +03:00
Dmitriy Dolovov
6701dbb220 K/N: Clean-up unused K/N stuff 2018-09-08 12:16:24 +03:00
Dmitriy Dolovov
88638ef655 K/N: Clean-up logic for import of K/N projects from Gradle 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
dd203830a8 K/N: Refactor KotlinNativePluginSearchPathResolver
Get rid of dependency on KonanPaths project component
2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
b157e9d5a1 Rename "Konan" -> "KotlinNative" in class and function names (part 2) 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
07a1d683ed MPP: Better detection of KLIB library kind 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
9b92d38917 K/N: Move classes and functions we don't want to expose
These classes we don't want to expose to Gradle DSL users
from "kotlin-native-utils" to "kotlin-native-serializer" module.
Reason: "kotlin-gradle-plugin-api" depends on "kotlin-native-utils",
while "kotlin-native-serializer" is used only inside of IDEA plugin.
2018-09-08 12:16:22 +03:00
Mikhail Glukhikh
a4daf9f1ff More precise libraryMap in createResolvedModuleDescriptors 2018-09-08 12:16:22 +03:00
Dmitriy Dolovov
2ff538fc87 K/N: Correct creation of module descriptors for K/N module 2018-09-08 12:16:22 +03:00
Dmitriy Dolovov
fbeff9245e More correct detection of Kotlin/Native stdlib by open IDEA projects 2018-09-08 12:16:21 +03:00
Alexander Gorshenev
e8f238d53c Make sure zip filesystems are closed on exit 2018-09-08 12:16:21 +03:00
Dmitriy Dolovov
46a697db82 Rename "Konan" -> "KotlinNative" in class and function names 2018-09-08 12:16:21 +03:00
Dmitriy Dolovov
337100edc3 Rename "konan" modules to "kotlin-native" modules 2018-09-08 12:16:20 +03:00
Dmitriy Dolovov
4cedbe5f39 Disable mandatory adding of KLIBs into the root IDEA module 2018-09-08 12:16:20 +03:00
Ilya Matveev
299e508204 Add libraries provided by the K/N compiler in dependencies 2018-09-08 12:16:20 +03:00
Simon Ogorodnik
c4a33e0a2f [CHECKME] Support non-convention KotlinNativeCompile task in IDEA import 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
04fca2ac0d [IDEA plugin for K/N] Source code reorganization
Move Gradle part of plugin from 'idea-gradle/native' to
'idea-gradle-native' module
2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
f6c61fbe30 Remove useless TODOs 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
beb12b693f MPP: Keep original capabilities in descriptors created for all KLIBs 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
7623169130 MPP: implement IdePlatformKind, its resolution and tooling for K/N 2018-09-08 12:16:18 +03:00
Svyatoslav Scherbina
b86afb0bab Enable implicit integer coercion for Kotlin/Native interop libraries 2018-09-08 12:16:18 +03:00
Dmitriy Dolovov
2161451482 [K/N lib] Implement multiple fixes:
- source code simplifications
- more correct work with paths
- builtIns module requires dependency on itself
2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
3c5c21256f [K/N lib] fix in POM dependencies for konan-serializer module 2018-09-08 12:16:17 +03:00
Ilya Matveev
d49ff1aa2c [K/N lib] Add timeout for native dependency extraction 2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
db29d12c60 [K/N lib] merge metadata & serializer, publish the result to Maven 2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
eda29a48a4 [K/N lib] IDEA plugin for K/N + missed items in konan-serializer module 2018-09-08 12:16:16 +03:00
Dmitriy Dolovov
51bb408c56 [K/N lib] add Kotlin/Native deserializer and library reader 2018-09-08 12:16:16 +03:00
Dmitriy Dolovov
fade311b92 [K/N lib] add Kotlin/Native metadata 2018-09-08 12:16:15 +03:00
Vyacheslav Gerasimov
114b5288b0 Set until-build for Idea 182 plugin to 182.* 2018-09-08 12:06:30 +03:00
Ilya Gorbunov
53334664c7 Advance bootstrap to 1.3.0-dev-322 2018-09-07 21:28:12 +03:00
Leonid Startsev
9aba3b6c72 Add forgotten kotlinx-maven-serialization 2018-09-07 21:17:08 +03:00
Leonid Startsev
dea69e4469 Integrate serialization plugin into big Kotlin plugin
Split import handlers into multiple files
Add empty Maven handler for Android Studio

Add testRuntime dependency on kx-serialization-plugin for all modules which require compiler
plugins in test classpath
2018-09-07 21:17:07 +03:00
Leonid Startsev
087f60389a Migrating to 1.3 preview API 2018-09-07 21:17:06 +03:00
Leonid Startsev
359a37c9c3 Fix after rebase 2018-09-07 21:17:05 +03:00
Leonid Startsev
090f7e67eb Separate module for unshaded version 2018-09-07 21:17:04 +03:00
Leonid Startsev
6770cccd61 [IR-plugin] New symbol tables 2018-09-07 21:17:04 +03:00
Leonid Startsev
566e5ce603 Updates for new API 2018-09-07 21:17:03 +03:00
Leonid Startsev
2e50e4e816 Extract naming conventions 2018-09-07 21:17:02 +03:00
Leonid Startsev
8cd5966c4a IR-plugin
[IR-plugin] Synthetic property declaration in $serializer

[IR-plugin] Saving most of simple cases

[IP-plugin] Some refactoring and start of work on load func

[IP-plugin] Loading simple case without validation

[IP-plugin] Rebase to IR types and Native-enabled

[IP-plugin] Generating .serializer() accessor in companion

[IP-plugin] Basic synthetic deserializing constructor, fixed some todos

[IR-plugin] Remove reference to SerialDescriptor.init() since K/N now has freeze-aware lazy
2018-09-07 21:17:01 +03:00
Leonid Startsev
edcac21723 Names from new runtime 2018-09-07 21:17:00 +03:00
Leonid Startsev
223733558c Use new approach to resolve compiler plugin classpaths in gradle 2018-09-07 21:16:59 +03:00
Leonid Startsev
9ad3922c7d Fix 1.2.50 compatibility
Updated version to 0.5.1

Fix resolving serializers for classes from other modules
(Kotlin/kotlinx.serialization/153)

Respect @SerialName on classes

Add support for @SerialInfo on class-level
2018-09-07 21:16:58 +03:00
Leonid Startsev
26ac6bd887 While creating descriptors, add type arguments not from serializable class definition
but from actual KSerializer implementation.
This provides better support for user-defined or external generic serializers

Fix order of resolving serializers: user-overriden should go before polymorphic and default

Don't generate additional constructor if @SerialInfo has no properties

Workaround for recursive resolve
on @Serializable(with) and @Serializer(for) pair annotations

Don't trigger the whole resolve if we need just to check that there is
an argument on the annotation; check PSI instead.

Also, return back check on serializable annotation constructor arguments
2018-09-07 21:16:57 +03:00
Leonid Startsev
572e8873ca Respect @Serializable(with) on properties on JS too.
Don't generate constructor for passing generic serializers if user already defined proper one.
2018-09-07 21:16:56 +03:00
Paul de Vrieze
365a183d01 Fix for Kotlin/kotlinx.serialization/136
Create a version that actually passes a type parameter in write$Self.
This version should take the correct type parameters from the class
rather than adding a function type parameter shared with all
serializers.
2018-09-07 21:16:56 +03:00
Leonid Startsev
114fb5790a Fix for Kotlin/kotlinx.serialization/118
Fix for Kotlin/kotlinx.serialization/123: resolve annotation parameters in-place
Fix for Kotlin/kotlinx.serialization/125
Now polymorphic serializer required by all modalities expect final
2018-09-07 21:16:55 +03:00
Leonid Startsev
97694e65aa Update version to 0.4
Optimize references in generated code. Also fixes Kotlin/kotlinx.serialization/issues/65

Fix (again) broken char boxing

Rebased on 1.2.40 and fixed broken compatibility

Fix https://github.com/Kotlin/kotlinx.serialization/issues/107 and code reformatting

(cherry picked from commit d4c307d)

Add correct type parameter information to synthetic declarations

Needed by kapt due to https://github.com/Kotlin/kotlinx.serialization/issues/76

Make correct call to sealed class constructor

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/112

Bump version

1.2.50-eap-1 compatible
2018-09-07 21:16:54 +03:00
Leonid Startsev
5e19e89dda Enhanced support for custom serializers definition
kotlin.Triple serializer

Resolving serializers for mutable collection interfaces on JS

Remove idea-related source files form maven compilation

Serialization url in plugin.xml

Removed note about JPS incompatibility

Don't use serial names in produced JS code (https://github.com/Kotlin/kotlinx.serialization/issues/43)

Generator for calling `update` functions

Fix synthetic serialinfo implementations for 2-slots vars (double and long) (https://github.com/Kotlin/kotlinx.serialization/issues/60)

Prohibit usage of nullable serializers for non-null fields (https://github.com/Kotlin/kotlinx.serialization/issues/59)

Fix incorrect `this` referencing after update to 1.2.20 compiler
2018-09-07 21:16:53 +03:00
Leonid Startsev
8c4daef969 Maven and Gradle project import handlers 2018-09-07 21:16:52 +03:00
Leonid Startsev
0f7a356af8 Extension points for synthetic function contributions
Pass real type arguments serializers to runtime lib
2018-09-07 21:16:51 +03:00
Leonid Startsev
703d715334 JPS plugin
Breaking changes in compiler plugin:

* Remove java.Serializable supertype
* Move serializer impl from companion to special inner class
* Add generic serializer fields in $serializer and serializer getter
in companion

kotlin.Pair serializer

Generating getter also for non-generic serializers

Generic serializers in JS
2018-09-07 21:16:51 +03:00
Leonid Startsev
f42767fcc2 Serialization plugin GSK build
Fixed issue when serialDesc property getter was generated, but backing field not.

Respect @Serializable(with=...) on property

Calling 3-arg readElementValue for support of custom contexts

Ability to nest context-based serializer

Migration to 1.2-Beta2

Use polymorphicSerializer prior to default

Don't use polymorphic serializers for all java classes

Docs and maven project update

Remove plugin runtime dependency on stdlib
2018-09-07 21:16:50 +03:00
Leonid Startsev
8a250b07df Default case in "load" switch-case throws exception instead of silent read ending.
Improved error descriptions, fixed issue with transient properties
without backing field (Kotlin/kotlinx.serialization#2)

Don't add serialClassDesc property if user already defined one
(Kotlin/kotlinx.serialization#10)

Bump version to 0.1.1

Fix issue with mixing serial name with real property name (Kotlin/kotlinx.serialization#13)
2018-09-07 21:16:49 +03:00
Leonid Startsev
02d0322029 Plugins renaming: kotlinx-<buildSystem>-serialization-plugin 2018-09-07 21:16:48 +03:00
Leonid Startsev
3eb10823d4 Maven serialization plugin 2018-09-07 21:16:47 +03:00
Leonid Startsev
8cacaecf90 Changed serialization gradle plugin build to gradle
Env variable for idea SDK on TeamCity
Fix kotlin_root dir relative path

Updated broken API after rebase to 1.1.50

Bintray upload setup
2018-09-07 21:16:46 +03:00
Leonid Startsev
ef11fb5857 Js synthetic generation plugin.
Fix for JS frontend resolving

Generating serialClassDesc property and save method (w/o virtual calls).

JS Serialization: Load function and synthetic constructor

User-defined serial annotations support

Reference array serialization in JS

Reference array serializer now requires KClass instance as first constructor argument

Finding enum serializer in common module for support in JS
2018-09-07 21:16:46 +03:00
Leonid Startsev
841693643a KotlinX serialization plugin applied onto latest master
IntelliJ project, ant task and maven goal for serialization plugin
Serialization IDEA plugin
2018-09-07 21:16:45 +03:00
Simon Ogorodnik
6b5dcf6ae7 Add extension point to recognize library kind 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
08a66b61c2 Create built-ins via ProjectContext instead of GlobalContext 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
d8937936a9 MPP: recognize source sets from Gradle project model (refactoring) 2018-09-07 20:55:30 +03:00
Mikhail Glukhikh
5e3fd189a4 MPP: make platformByCompilerArguments a bit safer 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
5633d86cb2 MPP: extend IdePlatformKind EP & determine it by CommonCompilerArguments 2018-09-07 20:55:29 +03:00
Mikhail Glukhikh
2e29a581f2 KotlinFacetEditorGeneralTab refactor: use chosenPlatform when possible 2018-09-07 20:55:29 +03:00
Dmitriy Dolovov
622c9bedad MPP: fix bug with displaying empty Kotlin targets in facet settings 2018-09-07 20:55:29 +03:00
Nikolay Krasko
b4163f953f Add gradle.properties file with new codestyle for new Gradle projects (KT-23400) 2018-09-07 20:15:05 +03:00
Nikolay Krasko
3831ff1d05 Apply Kotlin official code style for projects created from wizards (KT-23400)
- Kotlin templates
- New Java projects with Kotlin support
- Gradle projects with Kotlin support
- Gradle projects with Kotlin DSL
2018-09-07 20:15:05 +03:00
Nikolay Krasko
921af44cb9 Import code style if gradle.properties has kotlin.code.style option (KT-23400) 2018-09-07 20:15:04 +03:00
Nikolay Krasko
f94ff3dc26 Implement transition project code style to predefined code style (KT-23400) 2018-09-07 20:15:04 +03:00
Ilya Chernikov
fa98b0afac Implement main-kts project and test 2018-09-07 18:47:18 +02:00
Ilya Chernikov
79bad24941 Simple ivy resolver with test 2018-09-07 18:47:18 +02:00
Ilya Chernikov
d7f45253d5 Improve noDefaultJar behaviour:
- drop appropriate artifact from all configurations
- clean actions - in addition to task disabling
2018-09-07 18:47:18 +02:00
Zalim Bashorov
24dc8b33cd [JS IR BE] fix compilation of stdlib by IR BE after move coroutine related sources in stdlib 2018-09-07 19:22:35 +03:00
Mikhail Glukhikh
99a2add0e8 SimplifyCallChainFix: build new argument list more accurately
Related to KT-23691
2018-09-07 17:26:23 +03:00
Toshiaki Kameyama
1d2e18e263 SimplifyCallChainFix: Keep comments in place #KT-22552 Fixed 2018-09-07 17:26:15 +03:00
Mikhail Glukhikh
9bc874f647 replacedBaseClauseWithLet: rename & convert parameter to receiver 2018-09-07 17:24:47 +03:00
Mikhail Glukhikh
9ab8f3d7b5 Refactor clauseReplaceableBySafeCall (if-then to safe access) 2018-09-07 17:24:25 +03:00
Mikhail Glukhikh
485e098ced Handle implicit receivers more accurately in if-then to safe access
#KT-26599 Fixed
2018-09-07 17:24:19 +03:00
Mikhail Glukhikh
ccb17caf7b Code cleanup: x as? Type ?: return -> if (x !is Type) return 2018-09-07 16:32:19 +03:00
Mikhail Glukhikh
ad4da3d761 Code cleanup: convert flatMap { it } into flatten() 2018-09-07 16:32:18 +03:00
Mikhail Glukhikh
dead2516c2 Redundant override inspection: don't report for ambiguous derivation
#KT-24405 Fixed
#KT-25883 Fixed
2018-09-07 16:32:11 +03:00
Mikhail Glukhikh
607392a2ab Cleanup code: KotlinRedundantOverrideInspection 2018-09-07 16:32:08 +03:00
Alexander Podkhalyuzin
6cee310c54 Fixed 181 branch 2018-09-07 16:08:51 +03:00
Dmitry Petrov
006c0aa740 Hide constructors accepting inline class parameters 2018-09-07 15:57:59 +03:00
Mikhail Glukhikh
8a5dbe1c6b Move property to constructor: minor refactoring
Related to KT-26015
2018-09-07 14:56:19 +03:00
Toshiaki Kameyama
de6fdc5733 Move to constructor: choose property use-site target more precisely
#KT-26015 Fixed
2018-09-07 14:56:17 +03:00
Mikhail Glukhikh
29390dab42 Create actual: use analyzeWithContent to resolve annotations correctly
So #KT-26626 Fixed
2018-09-07 14:56:16 +03:00
Mikhail Glukhikh
26469b3365 Get rid of IndexNotReadyException in CreateActualFix
Related to KT-19586
2018-09-07 14:56:14 +03:00
Mikhail Glukhikh
74c5d8ed09 Create actual: do not generate default parameter values in constructor
So #KT-26517 Fixed
2018-09-07 14:56:13 +03:00
Mikhail Glukhikh
ef4053d5c3 Invalidate module source roots in create actual to fix exceptions
Related to KT-19586
2018-09-07 14:56:12 +03:00
Mikhail Glukhikh
fe9f655c26 Configure module source roots in create actual fix, if it's necessary
#KT-19586 Fixed
2018-09-07 14:56:11 +03:00
Alexander Podkhalyuzin
873463d24b Fixed deprecated IDEA API
#KT-24931 Fixed
2018-09-07 14:33:22 +03:00
Nikolay Krasko
1f1953cc38 Minor: use common trimIndent() in type hints tests 2018-09-07 12:29:06 +03:00
Nikolay Krasko
307586e435 Don't show types for enum entries with enum name is present in initializer (KT-26057)
#KT-26057 Fixed
2018-09-07 12:29:06 +03:00
Alexander Udalov
ab3f8db743 Consider property accessor non-default if it has annotations
Otherwise we're not trying to load annotations on the parameter of the
property setter in MemberDeserializer.loadProperty.

Note that after this commit, we could now also assume that if
getter/setter is default, it has no annotations, and thus use
Annotations.EMPTY for default getter/setter in loadProperty. However,
this would cause reflection to work incorrectly on classes compiled by
an older Kotlin compiler, so we'll still try to load annotations on
default accessors for an indefinite time.

 #KT-25499 Fixed
2018-09-07 11:49:42 +03:00
Alexander Udalov
06ce0cb0f0 Fix deserialization of default property accessor flags
In MemberDeserializer.loadProperty, we incorrectly passed 0 to
getAnnotations when loading annotations on property accessors in case
the protobuf field getter_flags/setter_flags was not present. The
correct behavior, as described in metadata.proto, was to pass a special
"default accessor flags" value, constructed from the main property
flags. Otherwise in case there were annotations both on the property and
on the accessor (as in PropertyAndAccessor.kt) and the accessor was
otherwise default, we would assume that it had no annotations and would
not load them in compiler and reflection

 #KT-25499 In Progress
2018-09-07 11:49:41 +03:00
Alexander Udalov
a432704c4f Fix typo in MemberDeserializer.loadProperty when loading inline setters
This could lead to inline setters of properties which have default
getters not being inlined
2018-09-07 11:29:16 +03:00
Dmitry Petrov
65ad93ebe4 Don't generate getter for private or internal inline class primary vals 2018-09-07 10:27:31 +03:00
Dmitry Petrov
8158dd0c83 Update testData for writeSignature tests 2018-09-07 10:25:59 +03:00
Dmitry Petrov
cafaa3e13c Mangle inline class members
<IMPL_SUFFIX> for method is a method signature hash,
if method value parameter types contain inline class types,
otherwise 'impl'.

Constructor methods are named as 'constructor-<IMPL_SUFFIX>'.

Synthesized 'box' and 'unbox' methods are named as
'<METHOD_NAME>-<IMPL_SUFFIX>'.

Erased implementations of overriding and non-overriding methods
are named as '<METHOD_NAME>-<IMPL_SUFFIX>'.

Fully specialized implementation of 'equals' will have a special suffix.
2018-09-07 10:25:53 +03:00
Dmitry Petrov
aec173ac5c Minor: fix tests after rebase 2018-09-07 09:32:11 +03:00
Dmitry Petrov
427295525a Minor: mute test in JVM_IR 2018-09-07 09:31:33 +03:00
Dmitry Petrov
caa49f85ad Minor: drop ERASED_INLINE_CLASS_SUFFIX 2018-09-07 09:31:33 +03:00
Dmitry Petrov
43b4190f7c Test: visibility of inline class members
Also merge in testInlineClassWrapperPrimaryConstructorIsSynthetic
and testInlineClassConstructors.
2018-09-07 09:31:33 +03:00
Dmitry Petrov
d8a6db8774 Mark synthesized box/unbox methods in inline classes as ACC_SYNTHETIC 2018-09-07 09:31:26 +03:00
Dmitry Petrov
c86ee90bec Minor: move "is box/unbox method" to InlineClassDescriptorResolver 2018-09-07 09:31:26 +03:00
Dmitry Petrov
d24b0fd3b2 Test: 'constructor' methods visibility 2018-09-07 09:31:26 +03:00
Dmitry Petrov
0bd1c4d1b7 Make inline class wrapper constructor private 2018-09-07 09:31:26 +03:00
Dmitry Petrov
c094b3a5a2 Drop erased class for inline class 2018-09-07 09:31:26 +03:00
Dmitry Petrov
4c7430e990 Test: inline class in binary dependencies 2018-09-07 09:29:55 +03:00
Dmitry Petrov
ae0d980b54 Minor: mute some inline classes tests in JS_IR 2018-09-07 09:29:55 +03:00
Ilya Gorbunov
d0923e7a32 Update EXPECTED_REACHABLE_NODES in JS tests 2018-09-07 01:28:38 +03:00
Ilya Gorbunov
700e6fc5e3 Extract carrier value from continuation result
Otherwise incorrect type gets into continuation: SuccessOrFailure<T> instead of T.
2018-09-07 01:28:32 +03:00
Ilmir Usmanov
94096bba26 Ignore version requirements of kotlin.suspend completely 2018-09-07 01:03:53 +03:00
Ilya Gorbunov
2821c357a1 Switch coroutine tests to release coroutines 2018-09-07 01:03:53 +03:00
Ilya Gorbunov
df9f77909b Make experimental COROUTINE_SUSPENDED refer to corresponding release one
Partially reverts commit 20c7a97.
Apply workaround for KT-25003 once again for the new COROUTINE_SUSPENDED
2018-09-07 01:03:53 +03:00
Ilya Gorbunov
e22ca022d4 Switch sourcesets of experimental and release coroutines
- Move experimental coroutines out of the main source root.
- Include experimental coroutines into the coroutines source set.
- Include release coroutines into the main source set.
2018-09-07 01:03:53 +03:00
Alexander Udalov
0fa2d29779 Fix test data in annotationsOnUseSiteTargets.kt
After the initial commit fc87043cb3 has been authored, master has
advanced to 1.3 where this diagnostic had slightly changed
2018-09-07 00:14:33 +03:00
Ilya Gorbunov
82d35cfa26 Change signed to unsigned widening conversions to sign-extending
e.g. `Byte.toUInt()` now returns `UInt.MAX_VALUE` for Byte value of -1 instead of 0xFFu.

#KT-26594 Fixed
2018-09-06 21:25:42 +03:00
Ilya Gorbunov
4344005fb5 Deprecate synchronized function in common stdlib #KT-26595 2018-09-06 21:15:31 +03:00
Ilmir Usmanov
cb57444e14 Forbid numbered KSuspendFunction interfaces usage as supertypes
#KT-24853 Fixed
2018-09-06 20:26:16 +03:00
Ilmir Usmanov
6f591369d8 Forbid provideDelegate, setValue and getValue suspend operators
#KT-24866 Fixed
2018-09-06 20:25:17 +03:00
Ilya Chernikov
34569071b3 [minor] rename function 2018-09-06 19:17:45 +02:00
Ilya Chernikov
ba2e08c014 Make property collection serializable (with runtime check) 2018-09-06 19:17:45 +02:00
Ilya Chernikov
ae107339fd Implement compiled script caching with tests 2018-09-06 19:17:45 +02:00
Ilya Chernikov
836ea28fe7 Renaming remaining former "environment"-related identifiers 2018-09-06 19:17:44 +02:00
Ilya Chernikov
7860220e76 Add simple jvm scripting host test 2018-09-06 19:17:44 +02:00
Ilya Chernikov
6c60e38260 Add compatibility with templates from script-runtime...
and add script-runtime to the compilation classpath by default
2018-09-06 19:17:44 +02:00
Ilya Chernikov
6716c512d3 [minor] Rename too long named functions 2018-09-06 19:17:43 +02:00
Ilya Chernikov
a52b57eecf Drop currently unused REPL part of the API 2018-09-06 19:17:43 +02:00
Ilya Chernikov
67ba8b5361 Rename ScriptSource to SourceCode, extract location to another i-face...
other related refactorings. The goal - make interface terminologically
more suitable for usage in REPL.
2018-09-06 19:17:43 +02:00
Ilya Chernikov
1e85a26b62 Fix evaluation part of the scripting API - mostly renaming 2018-09-06 19:17:43 +02:00
Ilya Chernikov
539e0f4961 [minor] switch to project dependencies in scripting projects 2018-09-06 19:17:43 +02:00
Ilya Chernikov
8674cd7a6b Fix scripting tests 2018-09-06 19:17:43 +02:00
Ilya Chernikov
d6590d4fa3 Scripting examples refactoring 2018-09-06 19:17:43 +02:00
Ilya Chernikov
f159a686df Fix compiled script caching interface 2018-09-06 19:17:42 +02:00
Ilya Gorbunov
0eb5bf21e9 Fix maven plugin smoke test
- Do not use default encoding to avoid warnings in logs
- Update 'Downloading'/'Downloaded' filters to new maven version
2018-09-06 20:07:54 +03:00
Alexander Udalov
41f8819158 Deprecate Annotations.getUseSiteTargetedAnnotations 2018-09-06 19:13:17 +03:00
Alexander Udalov
7658ddafd8 Make AnnotationsImpl internal, introduce Annotations.create 2018-09-06 19:13:17 +03:00
Alexander Udalov
eef11c669a Extract TargetedAnnotations out of AnnotationsImpl
Minimize AnnotationsImpl to leave it usable in simple scenarios where
there's no use-site targeted annotations, and use TargetedAnnotations in
the only place in the frontend (AnnotationResolverImpl) where use-sites
were needed.

Also, delete kdoc on Annotations.isEmpty to prevent readers from putting
too much thought into how it works. With the exception of a few places
in the frontend where use-site targeted annotations are still accessed
via the Annotations object, it's now an implementation detail and users
(such as backends, IDE) should not care about them at all, and instead
should just deal with the correct element when processing annotations
2018-09-06 19:13:16 +03:00
Alexander Udalov
c0b025b23d Provide default implementation for Annotations.getUseSiteTargetedAnnotations
After this commit, it's overridden only in AnnotationsImpl and
CompositeAnnotations.

Note that although FilteredAnnotations did have a non-trivial
implementation, that class was only used in circumstances where
annotations with use-site targets could not be of any use, so it's safe
to return empty list there now. One could argue that the new semantics
makes more sense: filter "standard" annotations, but don't touch those
with use-site targets because they are not applied to this element
directly, thus should likely not be affected by the filtering
2018-09-06 19:13:16 +03:00
Alexander Udalov
f9b9b6908a Remove use-site targeted annotations from LazyAnnotations
LazyAnnotations are only used for classes and files, and in the latter
case it will now contain file annotations as normal annotations, without
the target "file:"
2018-09-06 19:13:15 +03:00
Alexander Udalov
98232265d7 Simplify deserialization of annotations on backing/delegate fields
Instead of returning the list of targeted annotations in
loadCallableAnnotations, add two separate methods to load annotations on
the backing field and on the delegate field of the property
2018-09-06 19:13:15 +03:00
Alexander Udalov
ca3cff9a93 Do not write hasAnnotations flag for properties with source-only annotations
This does not break or fix any behavior except the fact that
deserialization will now not try loading annotations on a property which
had no binary- or runtime-retained annotations in the sources
2018-09-06 19:13:14 +03:00
Alexander Udalov
87c0d56618 Drop Annotations.getAllAnnotations 2018-09-06 19:13:14 +03:00
Alexander Udalov
83fbabd628 Drop Annotations.Companion.find/getUseSiteTargetedAnnotation(s) 2018-09-06 19:13:13 +03:00
Alexander Udalov
7271995ff0 Drop Annotations.findAnyAnnotation, DescriptorUtils.getAnnotationByFqName 2018-09-06 19:13:13 +03:00
Alexander Udalov
9d1baaeb56 Simplify backing field generation logic in PropertyCodegen
Inline several methods, remove extra parameters, fix warnings
2018-09-06 19:13:12 +03:00
Alexander Udalov
753191e668 Simplify codegen of annotations, get rid of use-site targets 2018-09-06 19:13:12 +03:00
Alexander Udalov
fc87043cb3 Merge use-site targeted annotations into corresponding Annotations
Add PropertyDescriptor.backingField/delegateField to store annotations
on the field directly in an otherwise almost empty descriptor instance,
instead of storing them with use-sites in the corresponding property
descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor
instances in AnnotationSplitter. Change DescriptorRenderer to render
annotations on "related" declarations when needed, with the explicit
use-site target if applicable.

Most changes in diagnostic test data are related to the fact that
annotations which are known to have an incompatible use-site to the
declaration they're applied at (such as `@param:`-annotation on a
function), are now not loaded at all. It's fine because the code is
erroneous, so it doesn't really matter how do we load annotations with
invalid targets (some of this logic is also changed freely in subsequent
commits). Some changes are also explained by the fact that for example
an annotation on the property which is only applicable to FIELD is now
rendered with an explicit use-site target `@field:`, regardless of
whether it did have that use-site target syntactically or not.

Basically, after this change there's no point in calling
Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore
because it's easier and more intuitive to just use Annotations of the
corresponding descriptor -- the backing / delegate field (introduced in
this commit) or the extension receiver / setter parameter (related
behavior was fixed in previous commits). Usages of
use-site-target-related methods will be refactored out in subsequent
commits
2018-09-06 19:13:11 +03:00
Alexander Udalov
8c21e86ded Don't add unapplicable targeted annotations to the container
For example, previously on an (incorrect) code like

    @setparam:Ann
    val x = 42

We added Ann to x's annotations. Not doing this seems more correct and
simplifies implementation a bit.

Test data is NOT changed in this commit because effective changes
somewhat depend on the changes in the subsequent commits. Affected tests
are at compiler/testData/diagnostics/tests/annotations/withUseSiteTarget
2018-09-06 19:13:10 +03:00
Alexander Udalov
0e5544a491 Use AnnotationSplitter for annotations on extension receiver
Instead of using `@receiver:`-targeted annotations on the receiver type,
use normal annotations of the ReceiverParameterDescriptor instance
everywhere
2018-09-06 19:13:10 +03:00
Alexander Udalov
823a24e0a3 Use AnnotationSplitter for annotations on setter parameter
Make it possible to specify annotations of the setter parameter when
constructing the default setter via DescriptorFactory; pass the split
annotations in DescriptorResolver.resolvePropertySetterDescriptor

 #KT-25500 Fixed
2018-09-06 19:13:09 +03:00
Anton Bannykh
779d9aafe7 JS: fix module aliasing for inline imports (KT-26466 fixed)
Consider an import from an inline function invocation. If it is
being called from another inline function, it should be defined
in a special way (e.g. `$$importsForInline$$.foo`) so that
the compiler knows where to load transitive dependencies from.
What's more, the declaration itself should be inside the inline
function wrapper.

Otherwise it should be defined in a regular way (e.g.
`$module$bar.foo` among other top-level imports).

By default the imports are loaded in the first form, and
transformed into the second one when needed. To check
whether this transformation the following predicate is
used: `inlineFunctionDepth == 0`.

At the moment the mentioned variable is increased upon
visiting an inline function declaration (`defineInlineFunction`),
and upon visiting an unknown (not visited before) inline function invocation.

It seems that instead the variable should be increased when processing
an existing inline function wrapper. At that point a new place to
put import definitions (`statementContextForInline`) is set.

Due to way JS code is generated (lambda's come before their call sites)
this issue seems to have been masked. Primary class constructors are a special
case - they come before any other declaration within. Hence a lambda
invocation inside a constructor leads to incorrect import definition.
2018-09-06 19:08:45 +03:00
Mikhael Bogdanov
da93ff1a30 Properly cast right-hand side value for inline property setter
#KT-22649 Fixed
2018-09-06 18:04:45 +02:00
Ilya Matveev
5cb8108eec Add builtBy for Kotlin/Native platform libs dependency 2018-09-06 22:59:27 +07:00
Sergey Igushkin
699cff27a7 If a target has no main compilation, don't create a sources JAR
Currently, Android libraries are not published as a part of an MPP
library, and building no sources JAR for them is OK.

Issue #KT-26390
2018-09-06 22:59:27 +07:00
Ilya Matveev
779030da1b Don't use Kotlin/Native home path in up-to-date checks 2018-09-06 22:59:27 +07:00
Ilya Matveev
7b51cfa804 Workaround duplicated libraries for native in IDE 2018-09-06 22:59:27 +07:00
Ilya Matveev
48d8f5eb39 Add libraries provided by the K/N compiler in dependencies 2018-09-06 22:59:27 +07:00
Ilya Matveev
e433778268 Switch to Kotlin/Native 0.9 2018-09-06 22:59:27 +07:00
Sergey Igushkin
7ff53deea5 Generate and publish *-sources.jar for each target 2018-09-06 22:59:27 +07:00
Sergey Igushkin
36a81acb5d Fixes for new MPP publishing
* Generate the JARs with the same names as they are published.
  Put the target name in the JAR name's appendix instead of classifier.

* Configure Maven publications eagerly to allow their editing by user.

* Take KotlinVariant's coordinates from the MavenPublication.
  If the user changes Maven coordinates of the publication, this ensures
  the parent component to have the updated information.
2018-09-06 22:59:27 +07:00
Ilya Matveev
440f6996d2 Fix wasm binary output paths 2018-09-06 22:59:27 +07:00
Ilya Matveev
36e8f84797 Add test for static/shared library building 2018-09-06 22:59:27 +07:00
Ilya Matveev
bef898509d Allow using strings to set native output kinds 2018-09-06 22:59:27 +07:00
Ilya Matveev
cfe7858229 Support static and shared libraries for native in kotlin-mpp 2018-09-06 22:59:27 +07:00
Ilya Matveev
0a685d57c2 Add macos in targets for new MPP integration tests 2018-09-06 22:59:27 +07:00
Sergey Igushkin
577bae763c Add tests for Kotlin/Native in new MPP
* Add K/N variants to the general MPP tests
* Also check the separated publishing
2018-09-06 22:59:27 +07:00
Sergey Igushkin
67bd659390 Fallback to publishing with coordinates inferred from publication
In Gradle < 4.7, there's no `ComponentWithCoordinates` interface, and we
need to make sure that none of our classes implementing this interface
are loaded with older Gradle versions.

Instead of that interface, we can rely on Gradle's metadata generation
heuristic that takes Maven coordinates for the variants from the
corresponding publications.
2018-09-06 22:59:27 +07:00
Ilya Matveev
091e680196 Fix validation warning for Kotlin/Native compilation task 2018-09-06 22:59:27 +07:00
Ilya Matveev
ed7da870cf Rename test tasks for native targets 2018-09-06 22:59:27 +07:00
Ilya Matveev
c23296a0d8 Publish different targets as different software components 2018-09-06 22:59:27 +07:00
Nikolay Krasko
91308508bd Inject with suffix and prefix arguments in annotations (KT-26584)
#KT-26584 Fixed
2018-09-06 17:39:54 +03:00
Mikhail Zarechenskiy
690762d46c Inline classes ABI: rename equals--impl to equals-impl0 2018-09-06 17:01:01 +03:00
Yan Zhulanow
280a3e3d26 Android Extensions: Support platform modules (KT-26169) 2018-09-06 14:42:23 +03:00
Yan Zhulanow
ca4b99b1a0 Maven: Do not consider 'kapt' and 'test-kapt' executions as non-JVM (KT-26211) 2018-09-06 14:42:22 +03:00
Yan Zhulanow
2ec1a89fa1 Use IdePlatform instead of IdePlatformKind in 'Kotlin Facet' project structure tab 2018-09-06 14:42:21 +03:00
Yan Zhulanow
a434cb00c6 Do not retain proxy-based components for compiler plugin settings in project model (again) (KT-24444)
The previous approach didn't work because Gradle wraps the copy() result, and the leakage didn't go away.
2018-09-06 14:42:20 +03:00
Yan Zhulanow
f55a52b86e MPP: Fix compatibility issue with Android Studio 3.3 Canary 7
'TargetPlatformKind' is still used in AS 3.3 so we can't remove it entirely yet.
2018-09-06 14:42:19 +03:00
Alexander Udalov
f90303315d Support array class literals in annotation serializer/deserializer
Note that this change brings an incompatibility: `Array<Foo>::class`
will be seen as `Foo::class` by the old deserializer. We consider this
OK because the compiler never had any logic that relied on reading class
literal arguments correctly (otherwise it wouldn't have worked because
it could only see `Array<*>::class` before this commit), and the support
of annotations on types in JVM reflection is only available in the
upcoming 1.3 release (KT-16795)

 #KT-22069 Fixed
2018-09-06 14:40:06 +03:00
Mikhael Bogdanov
f3f93ed6cc Get rid of 'BRIDGE' flag on $default functions
#KT-24415 Fixed
2018-09-06 13:34:00 +02:00
Alexey Sedunov
b441c76313 Generate equals/hashCode(): Support content equality from stdlib
#KT-22361 Fixed
2018-09-06 14:28:53 +03:00
Alexey Sedunov
5fcc6cfa0b Change Signature: Retain necessary backquotes in the dialog
#KT-17124 Fixed
2018-09-06 14:28:52 +03:00
Alexey Sedunov
26c02cd8bb Move Left/Right: Support type constraints
#KT-26525 Fixed
2018-09-06 14:28:52 +03:00
Alexey Sedunov
a20857beb9 Misc: Do not look for *_main/*_test modules in import test (AS3.2) 2018-09-06 14:28:52 +03:00
Mikhail Zarechenskiy
3dd5a267b8 Refine scope of signed to unsigned conversions
Depend on a module of function declaration, not function call
2018-09-06 14:06:03 +03:00
Nicolay Mitropolsky
e80a01a3fd 183: IDEA 183 version set to 183.2153.8 2018-09-06 12:49:00 +03:00
Sergey Igushkin
0ee19cf28f Support -Xcommon-sources in new MPP
In new MPP, add source sets taking part in more than one compilation to
the tasks' `commonSourceSet` in order to pass them as -Xcommon-sources

Issue #KT-26515 Fixed
2018-09-06 12:41:02 +03:00
Sergey Igushkin
5e6148c970 Refactor & fix: add allKotlinSourceSets and use it where appropriate
* Some of the usages of `kotlinSourceSets` should instead get all the
  source set from the source set hierarchies, i.e. including the ones
  transitively-participating in the compilation
2018-09-06 12:40:32 +03:00
Sergey Igushkin
96901c5487 Move KotlinSourceSet back to org.jetbrains.kotlin.gradle.plugin.*
After all MPP related changes, the `KotlinSourceSet` interface turns out
compatible with the old `KotlinSourceSet`, and, since there are external
usages of `KotlinSourceSet`, it is reasonable to expose the new
interface under the old FQ-name to fix those external usages.

Issue #KT-26498 Fixed
2018-09-06 12:35:59 +03:00
Sergey Igushkin
57c4886bd4 Don't create source sets and test compilation for the metadata target
Issue #KT-26253 In progress
2018-09-06 12:35:58 +03:00
Mikhail Zarechenskiy
5173a84dc7 Enable signed to unsigned coercion for modules with special capability
Mainly this is needed for Kotlin/Native part
2018-09-06 12:29:30 +03:00
Mikhail Glukhikh
55ff519aa8 Fix KtModifierListOwner.addAnnotation (case without modifier list)
Now add annotation to primary constructor should work correctly,
and may be some other related cases too.

Related to KT-25548
2018-09-06 11:10:05 +03:00
Mikhail Glukhikh
5f2c7d3c84 Do not report OPTIONAL_DECLARATION_USAGE_... in IDE for platform modules
#KT-26585 Fixed
Also fixes MultiPlatformHighlightingTestGenerated.testMultifileFacade
2018-09-06 11:07:21 +03:00
Nikolay Krasko
ca1e0a4b88 Do not fetch Kotlin stubs for versioned files from multi-release jars (KT-26439)
An incomplete list of inner class files might be stored in versioned
directory and that ruins Kotlin stub building.

Another reason for excluding such files, that they are duplicated
in different declarations lists such as `Navigate -> Class...` action.

 #KT-26439 Fixed
2018-09-06 10:48:18 +03:00
Mikhail Zarechenskiy
bc7f13b838 Temporarily allow equals & hashCode for SoF to compile bootstrap
equals & hashCode should be removed completely soon anyway
2018-09-06 10:39:34 +03:00
Mikhail Zarechenskiy
83975bd6ac Generate stub for specialized equals inside inline class 2018-09-06 10:39:33 +03:00
Mikhail Zarechenskiy
b4674a172e Reserve secondary constructors with bodies inside inline classes
#KT-26575 Fixed
2018-09-06 10:22:01 +03:00
Mikhail Zarechenskiy
002a66fec1 Reserve box/unbox/equals/hashCode methods inside inline classes
#KT-26573 Fixed
2018-09-06 10:20:03 +03:00
Ilya Gorbunov
7f8863bfd0 Update public API after inline class generation schema was changed 2018-09-06 03:56:01 +03:00
Ilya Gorbunov
43eeccbcb8 Advance bootstrap to 1.3.0-dev-169 2018-09-06 03:55:02 +03:00
Vyacheslav Gerasimov
e29151a1f0 Apply java plugin to kotlin-compiler project to fool idea import
java plugin makes idea import dependencies on this project as source (with empty sources however), this prevents reindexing of kotlin-compiler.jar after build on every change in compiler modules
2018-09-05 22:58:31 +03:00
Vyacheslav Gerasimov
b868450e9a Make dependencies on :kotlin-compiler project testRuntimeOnly everywhere 2018-09-05 22:58:31 +03:00
Ilmir Usmanov
53a1526412 Add version to DebugMetadata
#KT-26580 Fixed
2018-09-05 22:51:55 +03:00
victor.petukhov
e082fe19ea Actualize contracts diagnostic spec tests after 051ad0f79e 2018-09-05 18:04:58 +03:00
Mikhail Glukhikh
ad27d9aae7 Package utils: implement getNonGeneratedKotlinSourceRoots
This is needed to prevent creation of actual elements
in generated sources. Checked manually.

#KT-24129 Fixed
2018-09-05 17:21:23 +03:00
Mikhail Glukhikh
caee77cdae Kotlinize findOrCreateDirectoryForPackage in create actual fix
Before this commit, without existing directory
we tried to create it only inside Java source roots,
which is incorrect for JS and other non-JVM modules.
Source roots themselves still aren't created if they don't exist.

This fixes KT-19586 partially
2018-09-05 17:21:10 +03:00
Yan Zhulanow
3276e348cc Fix kapt tests (Kotlin version updated to 1.3) 2018-09-05 17:15:04 +03:00
Yan Zhulanow
17849473d6 Fix bunch compilation for AS 3.1/3.2 2018-09-05 17:15:04 +03:00
Dmitry Savvinov
051ad0f79e Fix unsound smartcast due to returns(null) in safecall
^KT-26382 Fixed
2018-09-05 16:27:48 +03:00
Dmitry Savvinov
18338f4ea3 Add test on safecall of function with returns(null) contract
Currently with non-desired testdata, fix incoming in the next commit.
2018-09-05 16:27:47 +03:00
Mikhail Glukhikh
1530a8bf53 Downgrade "Call chain -> sequence" to information level
Made to hide problem KT-26571
2018-09-05 14:55:23 +03:00
Roman Elizarov
eac1f5f8c8 Bootstrap change to rename SuccessOrFailure to Result 2018-09-05 14:29:36 +03:00
victor.petukhov
af732d16d6 Actualize contracts diagnostic spec tests 2018-09-05 14:08:50 +03:00
Mikhail Glukhikh
bae92f3a33 Sealed class: handle the case with actual type alias #KT-26141 Fixed
Before this commit, class super-type could be sealed only in the case
it's the class we are inside or in the same file with.
However, it's quite possible for the expect sealed class
to be implemented by typealias.
So in this commit we allow class super-type to be sealed
if it's typealias expansion we are inside.
2018-09-05 13:25:49 +03:00
Mikhail Glukhikh
56d89266d4 Add tests for KT-26141 (yet without changes) 2018-09-05 13:10:03 +03:00
Mikhail Glukhikh
68e3821ae2 Code cleanup: packageUtils.kt 2018-09-05 13:05:08 +03:00
Mikhail Glukhikh
53e7778078 Add modifiers on the same line even after annotation #KT-26492 Fixed 2018-09-05 13:05:08 +03:00
Mikhail Glukhikh
4dd95e5640 Introduce OptionalExpectationInspection
It works at INFORMATION level only and is intended to form quick-fixes
to add relevant actual declarations.

#KT-25533 Fixed
2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
ba84c6adf3 Request focus while navigating to expected declaration #KT-18490 Fixed 2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
df125702c1 Test for KT-25040 (just to stabilize behaviour) 2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
69def648c9 Remove deprecated MP extensions from Gradle menu #KT-22491 Fixed
Related to KT-26414
2018-09-05 13:05:06 +03:00
Mikhail Glukhikh
62e1121e7f Remove deprecated MP project builder from Gradle menu #KT-26414 Fixed 2018-09-05 13:05:06 +03:00
Dmitry Petrov
db13ab59a6 Test: SuccessOrFailure calls don't generate erased class references 2018-09-05 12:20:57 +03:00
Dmitry Petrov
203fd6a5d6 Make inline class wrapper constructor synthetic 2018-09-05 12:20:57 +03:00
Dmitry Petrov
85826d304e Don't generate secondary constructors for inline class wrapper 2018-09-05 12:20:57 +03:00
Dmitry Petrov
65881dda97 Fix tests after rebase 2018-09-05 12:20:57 +03:00
Dmitry Petrov
1bf8cfca8b Test: property accessors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
a2900282fd Call factory method for primary constructors of inner classes
We might want to add 'init' blocks later, so now, for the sake of
binary compatibility with 1.3-RC binaries, we have to generate these
'constructor' calls.

Note that in some tests inline class boxing is no longer redundant,
because resulting value is passed to 'constructor' as an argument.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
b1016936b2 'box'/'unbox' methods are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
580b782585 Simplify code, make $Erased class package private 2018-09-05 12:20:57 +03:00
Dmitry Petrov
687b492bf9 Test: inline class secondary constructors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
05daa21657 Fix inline class secondary constructor call generation
Don't generate NEW+DUP for inline class constructor calls.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
80a67477db Generate method calls for inline classes through IC, not IC$Erased
IC extends IC$Erased, so it should be fine.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
3080b65f7d Inline (wrapper) class IC extends erased inline class IC$Erased 2018-09-05 12:20:57 +03:00
Sergey Bogolepov
a46b28718e Add allScopes property to IrElementVisitorVoidWithContext 2018-09-05 09:56:48 +03:00
Svyatoslav Scherbina
66b259350a Support implicit integer coercion enabling for the entire module 2018-09-05 09:56:47 +03:00
Nicolay Mitropolsky
d0575127be fix for StoredExceptionsThrowToggleAction nullability changed in 183 2018-09-05 09:42:59 +03:00
Roman Elizarov
0401b4e0bb Coroutine context shall perform structural equality comparison on keys
Fixes KT-26398
2018-09-05 01:29:19 +03:00
Ilmir Usmanov
cfc10ec061 Simplify debug metadata: instead of array of same values, store single element
This change is valid, since we want StackTraceElement to be as close
as possible to StackTraceElement of non-coroutine code.
Particularly, if the line is inside inlined function, its className,
functionName and sourceFile are inline site's ones, but lineNumber
is large, which is the way of representing inline function's line
numbers. The rest is handled by the plugin, which allows the user to choose
between inline function body and inline site.
2018-09-04 22:20:08 +03:00
Svyatoslav Kuzmich
ad58fdd158 [JS IR BE] Unmute tests after adding stdlib 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
197a5969e2 [JS IR BE] Fix stdlib files list for 1.3 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
c3b9a5108e [JS IR BE] Add more stdlib files to runtime
Keep old sources list for coroutine tests
2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
97717afec4 [JS IR BE] Choose actual declaration of COROUTINE_SUSPEND_NAME 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
5192783669 [JS IR BE] Workaround empty blocks in state machine builder 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
e0237a4480 [JS IR BE] Check for unbound symbols in type operator lowering 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
437a68daca [JS IR BE] Check number of value arguments in toString 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
a3afd101fa [JS IR BE] Delete expected enum classes 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
dde1e9335e [JS IR BE] Don't copy type parameters in secondary ctor lowering 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
a01b6de2d8 [JS IR BE] Add missing exceptions 2018-09-04 20:19:03 +03:00
Alexey Sedunov
9d5bd29e8b Misc: Render MemberInfo as 'abstract' only if it's present in source
#KT-26533 Fixed
2018-09-04 19:49:14 +03:00
Toshiaki Kameyama
be30761ec4 "Convert to 'also'" intention: Fix for call expression has this receiver #KT-26009 Fixed 2018-09-04 19:29:44 +03:00
Toshiaki Kameyama
e1dd85429f Extract function: make default visibility private #KT-25454 Fixed 2018-09-04 19:28:25 +03:00
Toshiaki Kameyama
dc57887a4d Create function quick fix: fix visibility from inline method #KT-25228 Fixed 2018-09-04 19:01:22 +03:00
Toshiaki Kameyama
e2945b1d12 Add quickfix for "Interface doesn't have constructors" #KT-17687 Fixed 2018-09-04 18:58:56 +03:00
Toshiaki Kameyama
b5ba475696 "Redundant lambda arrow" inspection: Also report arrow with single underscore parameter #KT-24728 Fixed 2018-09-04 18:29:46 +03:00
Toshiaki Kameyama
20535feb31 "Remove parameter" quick fix: Remove unused type parameter used as type projection #KT-23511 2018-09-04 18:29:13 +03:00
Ilya Gorbunov
3e38bbcb07 Update generator template to match manually edited _URanges.kt file 2018-09-04 17:39:51 +03:00
Ilya Gorbunov
64996618b3 Suppress signed literals used as unsigned values in stdlib tests 2018-09-04 17:39:51 +03:00
Alexander Podkhalyuzin
c36d0e5db5 Changed action group text
#KT-26501 Fixed
2018-09-04 16:47:54 +03:00
victor.petukhov
921fc263e1 Remove PSI spec tests generation 2018-09-04 15:54:04 +03:00
Yan Zhulanow
7398a8149d Do not use ApplicationExtensionDescriptor in JPS (KT-26542)
The 'ExtensionPointName' class that ApplicationExtensionDescriptor uses is missing in the JPS classpath.
Now we don't use it unless the IDEA Application is properly initialized.
2018-09-04 14:54:45 +03:00
Roman Artemev
0eba87b571 [JS IR BE] Mute temporary broken tests 2018-09-04 12:43:39 +03:00
Roman Artemev
6387cc45aa Update testIr.html 2018-09-04 12:43:39 +03:00
Roman Artemev
a46b1cf126 [JS IR BE] Remove workaround to run coroutine tests 2018-09-04 12:43:39 +03:00
Roman Artemev
54e98fc014 [JS IR BE] Make coroutine compile separately from stdlib
* use accessors instead of direct field access
2018-09-04 12:43:39 +03:00
Alexander Udalov
4f803d03cf Minor, fix test data 2018-08-31 19:54:08 +02:00
Mikhail Zarechenskiy
9a978d2c8f Fix test data after daadba0927 2018-08-31 18:17:34 +03:00
Mikhail Zarechenskiy
6c747dcdb2 Don't use constant conversion from signed to unsigned in stdlib
After daadba0927
2018-08-31 18:17:09 +03:00
victor.petukhov
110bc7412d Fix name of 'controlflow' folder with contract tests 2018-08-31 17:27:51 +03:00
Nicolay Mitropolsky
7068992937 183: gson for 183 updated to 2.8.5 2018-08-31 17:20:54 +03:00
Nicolay Mitropolsky
c13eac7507 183: AbstractHierarchyTest.doHierarchyTest signature update 2018-08-31 17:20:54 +03:00
Nicolay Mitropolsky
d415ca9cf6 fixed nullability for various listeners update in 183 2018-08-31 17:20:54 +03:00
victor.petukhov
d9473c0b6e Add parsing spec tests support 2018-08-31 17:16:19 +03:00
victor.petukhov
f322aba768 Add gradle task to generate json tests map 2018-08-31 17:16:10 +03:00
victor.petukhov
88d8bb84ac Add not linked spec tests support in printSpecTestStatistic gradle task 2018-08-31 17:16:00 +03:00
victor.petukhov
8d91e5998d Add spec tests for contracts 2018-08-31 17:15:51 +03:00
victor.petukhov
ecf8b88c4c Add 'not linked' kind of spec tests 2018-08-31 17:15:40 +03:00
Yan Zhulanow
841bb4f253 Minor: Update DataFlowValueRenderingTestGenerated 2018-08-31 18:56:57 +05:00
Natalia Selezneva
3979ad7a1d Use correct classpath for Ide Scripting Console files during highlighting
KT-25606
2018-08-31 15:55:59 +03:00
Georgy Bronnikov
2fccf6875f Mute tests involving Char.{MIN,MAX}_VALUE, analogously to other primitive types 2018-08-31 15:44:05 +03:00
Roman Artemev
8a871b3f0c Update tests 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
e6b8ade096 JVM_IR. Reference fields 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
92ce50b22c JVM_IR. Cache defaultImpls function declarations 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
5c0cdac69f JVM_IR. Support generic constructors after "Roll back constructor type parameters" 2018-08-31 15:34:18 +03:00
Roman Artemev
0b926af203 Add KotlinType in WrappedClassDescriptor & WrappedTypeParameterDescriptor 2018-08-31 15:34:18 +03:00
Roman Artemev
fec8065fd0 Fix code review
Minor fixes
Fix JVM IR BE
Fix NATIVE
2018-08-31 15:34:18 +03:00
romanart
afcdcf8217 Partially reimplement KotlinType based util using IrType 2018-08-31 15:34:18 +03:00
Roman Artemev
d1621b80cc Fake wrapped descriptors first working draft
get rid of descriptors in Bridge and Enum lowerings
Replace property accessors function type with IrSimpleFunction because they couldn't be constructors
get rid of descriptors in Callable reference lowering
refactored descriptor factory and inner class lowering
Add isReified property to IrTypeParameter declaration
keep getting rid of descriptors
Get rid of descriptors in Shared Variable Manager
LocalDeclarationLowering also uses no descriptors
Fix psi2ir
Fix nested classes names
Fix outer reference in inner classes
Fix name generator
get rid of descriptors in coroutines - something is working
Fix name generator
Fix unbound symbols in JVM BE
Rename DeclarationFactory members
2018-08-31 15:34:18 +03:00
Mikhail Zarechenskiy
daadba0927 Postpone conversions from signed constants to unsigned ones
#KT-26071 Fixed
2018-08-31 15:22:43 +03:00
Ilya Chernikov
d785b7e4c5 Extract urls from any classloader that has getUrls(): List<URL> method
via reflection, e.g. IDEA platform UrlClassloader. This fix allow
kotlin JSR223 host for IDEA to extract classpath from the environment
properly (with appropriate fix on IDEA side as well).
2018-08-31 15:18:56 +03:00
Ilya Chernikov
fd0eb6ee34 Implement support for class literals as annotation arguments...
on deserialization and reflection
2018-08-31 15:17:51 +03:00
Mikhail Glukhikh
68da28edb9 Fix some tests bound to changed annotation formatting 2018-08-31 15:03:25 +03:00
Toshiaki Kameyama
53c10238d6 Introduce inspection for safe cast + return #KT-26230 Fixed 2018-08-31 15:03:25 +03:00
Toshiaki Kameyama
2c71b3873e Introduce "flatMap { it } -> flatten" inspection #KT-25969 Fixed 2018-08-31 15:03:24 +03:00
Sergey Rostov
cdcc588a55 IC: Fix CacheVersionsManager IC flag set.
Previously flag was set before the IncrementalCompilation.isEnabledForJvm() system property was set.
This cases that the cache versions was not saved.
2018-08-31 14:55:35 +03:00
Alexander Udalov
5f18439442 Use correct module name when calling internal members from other module
This is needed to avoid using the same module name for test root as for
the main source root in the Gradle plugin, which is needed to fix
KT-18955
2018-08-31 13:42:57 +02:00
Nicolay Mitropolsky
d1667483a5 ModuleRootListener.rootsChanged parameter made non-null in 183 2018-08-31 13:20:00 +03:00
Sergey Rostov
437fc9d749 JPS: Refactor cache compatibility checking and build targets loading/dependency analysis.
CacheVersion class refactoring:

Responsibilities of class CacheVersion are splitted into:
	- interface CacheAttributesManager<Attrs>, that should:
	    - load actual cache attribute values from FS
	    - provide expected attribute values (that is required for current build)
	    - checks when the existed cache (with actual attributes) values is suitable for current build (expected atribute values)
	    - write new values to FS for next build
	- CacheAttributesDiff is created by calling CacheAttributesManager.loadDiff extension method. This is just pair of actual and expected cache attributes values, with reference to manager. Result of loadDiff can be saved.

CacheAttributesDiff are designed to be used as facade of attributes operations: CacheAttributesDiff.status are calculated based on actual and expected attribute values. Based on that status system may perform required actions (i.e. rebuild something, clearing caches, etc...).

Methods of CacheAttributesManager other then loadDiff should be used only through CacheAttributesDiff.
Build system should work in this order:
    - get implementation of CacheAttributesManager for particular compiler and cache
    - call loadDiff __once__ and save it result
    - perform actions based on `diff.status`
    - save new cache attribute values by calling `diff.saveExpectedIfNeeded()`

There are 2 implementation of CacheAttributesManager:
    - CacheVersionManager that simple checks cache version number.
    - CompositeLookupsCacheAttributesManager - manager for global lookups cache that may contain lookups for several compilers (jvm, js).

Gradle:

Usages of CacheVersion in gradle are kept as is. For compatibility this methods are added: CacheAttributesManager.saveIfNeeded, CacheAttributesManager.clean. This methods should not be used in new code.

JPS:

All JPS logic that was responsible for cache version checking completely rewritten.

To write proper implementation for version checking, this things also changed:
	- KotlinCompileContext introduced. This context lives between first calling build of kotlin target until build finish. As of now all kotlin targets are loaded on KotlinCompileContext initialization. This is required to collect kotlin target types used in this build (jvm/js). Also all build-wide logic are moved from KotlinBuilder to KotlinCompileContext. Chunk dependency calculation also moved to build start which improves performance for big projects #KT-26113
	- Kotlin bindings to JPS build targets also stored in KotlinCompileContext, and binding is fixed. Previously it is stored in local Context and reacreated for each chunk, now they stored in KotlinCompileContext which is binded by GlobalContextKey with this exception: source roots are calculated for each round, since temporary source roots with groovy stubs are created at build time and visible only in local compile context.
	- KotlinChunk introduced. All chunk-wide logic are moved from KotlinModuleBuildTarget (i.e compiler, language, cache version checking and dependent cache loading)
	- Fix legacy MPP common dependent modules

Cache version checking logic now works as following:
- At first chunk building all targets are loaded and used platforms are collected. Lookups cache manger is created based on this set. Actual cache attributes are loaded from FS. Based on CacheAttributesDiff.status this actions are performed: if cache is invalid all kotlin will be rebuilt. If cache is not required anymore it will be cleaned.
- Before build of each chunk local chunk cache attributes will be checked. If cache is invalid, chunk will be rebuilt. If cache is not required anymore it will be cleaned.

#KT-26113 Fixed
#KT-26072 Fixed
2018-08-31 11:13:18 +03:00
Denis Zharkov
3bdfd811e8 Add some new String methods in JDK 11 to built-ins mapping blacklist
These three methods are conflicting with existing extensions,
thus the behavior might be changed when switching to JDK 11

Probably, it's worth revisiting our strategy here,
e.g. by blacklisting all new methods in

 #KT-24974 Fixed
2018-08-31 10:33:09 +03:00
Dmitry Petrov
00aa6158c8 Fix IR tests for 1.3 2018-08-31 09:19:13 +03:00
Dmitry Petrov
4cf98fd3ce Fix IR generation for '!is' pattern 2018-08-31 09:12:44 +03:00
Ilya Gorbunov
623adbfe4a Do not use JVM-specific annotations in pure-JS generated sources 2018-08-31 04:17:42 +03:00
Ilya Gorbunov
056db883c3 Fix JS IR runtime compilation for tests after applying OptionalExpectation
Jvm-specific actuals were removed from stdlib/js runtime.
Recreate them in irRuntime so they can be resolved when compiling runtime for IR tests.
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
36f154882c Provide JvmSynthetic annotation in stdlib-common as optional
#KT-24478
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
0c89996e34 Introduce platform specific annotations as optional in common stdlib
#KT-24478
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
ce7a863843 Move OptionalExpectation and related annotations to another source root 2018-08-31 04:17:42 +03:00
Ilya Gorbunov
2091601fe8 Advance bootstrap to 1.3.0-dev-25
Update public API of specialized unsigned iterators.
2018-08-31 04:17:42 +03:00
Yan Zhulanow
d00f5b335a MPP: Refactoring, extract IDE platform kinds, allow to add custom platforms 2018-08-31 05:14:15 +05:00
Ilya Gorbunov
cf1b2bedf4 Support bootstrapping from TeamCity releases builds
that have build.number different from the version of artifacts.
2018-08-31 00:42:40 +03:00
Ilya Gorbunov
29ce1297da Prepend changelog of 1.3-M1 and 1.3-M2 2018-08-30 23:11:15 +03:00
Anton Bannykh
e7f9727783 JS: fix tests related to 1.3 migration 2018-08-30 22:27:24 +03:00
Pavel V. Talanov
3a8499b10e Fix a bug where kotlin common classes were seen as missing dependencies
When kotlin referred to them through java signatures
Java resolver ignores expect classes

 #KT-24185 Fixed
2018-08-30 19:37:02 +02:00
Pavel V. Talanov
7087a1b3f5 MPP: test different jvm implementations for single common module
Add test infrastructure to support same platform implementations
2018-08-30 19:37:02 +02:00
Alexander Udalov
cb8951eeef Do not write pre-release binaries for stable LV
This is another cherry-pick of the commit 475a80b641 which was
accidentally reverted by 927706883e during the rebase on master
2018-08-30 17:57:07 +02:00
Alexander Udalov
47bde73ed5 Minor, fix testdata to use release coroutines 2018-08-30 17:34:32 +02:00
Mikhail Glukhikh
2849919094 Fix starImport quick-fix test 2018-08-30 18:30:50 +03:00
Mikhail Glukhikh
ea74b37b5b Insert new line between annotation and type alias or sec. constructor
#KT-26377 Fixed
2018-08-30 18:30:47 +03:00
Toshiaki Kameyama
bae754a266 Foldable if-then: do not highlight for is checks #KT-24978 Fixed 2018-08-30 18:30:45 +03:00
Alexander Udalov
ac14c5e74f Fix KType.javaType for suspend function return type
#KT-26293 Fixed
2018-08-30 16:47:48 +02:00
Toshiaki Kameyama
fba539debf "Nested lambda has shadowed implicit parameter": minor improvements 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
b7c4248524 "Nested lambda has shadowed implicit parameter": add quickfix to rename shadowing 'it' 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
97150cb0e2 "Nested lambda has shadowed implicit parameter": show warning on the shadowing 'it' reference 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
7fdbcda91d "Nested lambda has shadowed implicit parameter": downgraded to WEAK WARNING level 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
7800f42840 "Nested lambda has shadowed implicit parameter": Do not report if 'it' paramerter is not used #KT-26268 Fixed 2018-08-30 17:37:36 +03:00
Ilmir Usmanov
f3879af9f6 Implement suspend lambdas of big arity
Suspend functions and callable references to suspend lambdas are already
supported.
Support callSuspendBy of suspend function of big arity.
 #KT-24854: Fixed
2018-08-30 17:29:09 +03:00
Georgy Bronnikov
769344569d Mute tests that are new to 1.3-M2 2018-08-30 16:24:48 +03:00
Anton Bannykh
9af8fad43f JS: more coroutines 1.3 API related fixes 2018-08-30 16:24:45 +03:00
Anton Bannykh
8975a6e17e JS: adapt to 1.3 coroutines API
Also update a line number test
2018-08-30 16:24:43 +03:00
Ilmir Usmanov
2d04acba42 Update test data of compiler tests, except IR tests 2018-08-30 16:24:41 +03:00
Dmitry Savvinov
23c945b002 Remove specific language version in testMetadataField
- Why we bother? Because this test tries to read @Metadata via
reflection, and in 1.3 @Metadata has @Since("1.3") annotation. Thus,
with version fixed to 1.2, this test fails with UNRESOLVED_REFERENCE

- Why it is correct? Because initially this directive was used to enable
'LanguageFeature.JvmPackageName' (we didn't have infrastructure for
enabling particulare feature at that moment). So, now we could change it
to the '!LANGUAGE:+JvmPackageName', but it is actually redundant,
because master is already >= 1.2
2018-08-30 16:24:34 +03:00
Dmitry Savvinov
b064c48f83 Fix testdata after advancing LATEST_STABLE to 1.3
This commit contains minor changes in testdata, where test and behavior
change are not related
2018-08-30 16:24:31 +03:00
Dmitry Savvinov
4dfb99596b Fix testdata after introduction of inline-classes mangling 2018-08-30 16:24:29 +03:00
Dmitry Savvinov
f23528770b Extract usages of legacy 'mod' in a separate test 2018-08-30 16:24:27 +03:00
Alexander Udalov
053b54d216 Report error on .class files produced by Kotlin 1.3-M1
Advance incremental cache version to force rebuild after switching from
1.3-M1 to 1.3-M2

(cherry picked from commit ba111d58ae)
2018-08-30 16:23:33 +03:00
Dmitry Savvinov
2ecea06d3e Do not coerce inferred language levels when importing from facet
Rationaly is that facet importer knows better about which language
versions should be used, so we shouldn't interfere.

Otherwise, Gradle or Maven projects which have upgraded corresponding
plugin to 1.3 will be imported with 1.2 levels, which is undesirable
2018-08-30 16:23:30 +03:00
Sergey Igushkin
90ec151258 Bring back two methods used by old MPP K/N plugin
* First, it overrides `addCommonSourceSetToPlatformSourceSet` with an
  old signature that was drop during migration to 'KotlinSourceSet's

* Second, it uses an extension SourceSet.kotlin that got dropped during
  the aforementioned migration

Now, for the old MPP K/N plugin, `addCommonSourceSetToPlatformSourceSet`
is called twice, one time with the new signature and another with the
old one, which it overrides.
2018-08-30 16:22:00 +03:00
Mikhail Glukhikh
1e2334a911 Kotlin migration: fix data context calculation for 173 / AS31
Version for IDEA 182 does not work properly here (returns null),
so we have to use `DataManager.getDataContext(focusedComponent)` directly

#KT-26399 Fixed
2018-08-30 16:21:56 +03:00
Mikhail Glukhikh
2e4f46045e Kotlin migration: extract data context into a function, check it on null
The extraction itself is needed due to different behaviour of related
IDEA functions in different platforms.
Check on null is needed because `createFromAnAction` last argument
cannot be null, otherwise we will get an exception.

Partial fix of KT-26399
2018-08-30 16:21:53 +03:00
Roman Elizarov
319c16c885 CoroutineStackFrame: public API dump updated 2018-08-30 16:21:49 +03:00
Roman Elizarov
a9eb94d822 Introduce CoroutineStackFrame interface for coroutine stack reconstruction in debugger
Fixes KT-26339
2018-08-30 16:21:46 +03:00
Dmitry Savvinov
b23bf371cf Always pass languageVersion explicitly to JPS compiler
When 'languageVersion' isn't passed explicitly, compiler will choose
'LATEST_STABLE'.

This may lead to spurious migration of a project to the next major
version after plugin update (e.g. when user had project of major
version X and then installed plugin of version X+1 -- in such case,
meaning of "no language version" suddenly changes).

So, we set it to RELEASED_VERSION, which is exactly the version
that is safe to use as the fallback.
2018-08-30 16:21:43 +03:00
Alexander Podkhalyuzin
69a0fedd9f When version is not defined we need to fallback to released
There are few more such places. Better fix would be to avoid
situation, when we need to fallback. So in every project these
settings are defined. It means "Latest stable" setting is not good.

#KT-26364 Fixed
2018-08-30 16:21:40 +03:00
Ilya Gorbunov
009980944b Refine the exception type of EmptyRange.random()
Make it the same type as in case of an empty collection, so that
`emptyRange.random()` throws the same exception as `emptyRange.toList().random()`.

#KT-15539
2018-08-30 16:21:36 +03:00
Ilya Gorbunov
9c412ba436 Fix incorrect range transform in nextUInt/nextULong with range parameter
#KT-25570
2018-08-30 16:21:33 +03:00
Dmitry Petrov
583c66a2a7 Don't mangle synthesized 'box' function for inline classes 2018-08-30 16:21:30 +03:00
Ilya Gorbunov
ea2c33a532 Extension random() to select random element from a collection
Fixes #KT-15539
2018-08-30 16:21:27 +03:00
Ilya Gorbunov
b0bcd78e38 Optimize copying for typed arrays in JS 2018-08-30 16:21:24 +03:00
Ilya Gorbunov
ea37a65178 copyInto: copying elements between two arrays
#KT-25874 Fixed
2018-08-30 16:21:20 +03:00
Ilya Gorbunov
58e6f910bc Update public API after stopping SuccessOrFailure mangling in signatures 2018-08-30 16:21:17 +03:00
Stanislav Erokhin
31f9184874 Update bootstrap 2018-08-30 16:21:14 +03:00
Yan Zhulanow
5d936a4c7c Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.

(cherry picked from commit d08a32c7cb)
2018-08-30 16:21:11 +03:00
Stanislav Erokhin
bcf2b39df2 Update bootstrap
Here we use build from custom branch intentionally and soon
we should bootstrap again.
2018-08-30 16:21:08 +03:00
Ilya Gorbunov
9c4a74ce5b Improve stability of nextBoolean test
Increase number of tosses (according to the Law of Large Numbers).
2018-08-30 16:21:05 +03:00
Ilya Gorbunov
d035c2690a Random extensions for unsigned: fixes after review
#KT-25570
2018-08-30 16:21:01 +03:00
Kerooker
f9dec5e794 Implement extension functions for Random: nextUInt, nextULong and nextUBytes
Given there's a Random API in the stdlib, that generates all random primitives, this commit adds the possibility to generate random unsigned integers.
It uses the same implementation from Random.nextInt, nextLong and nextBytes, but uses the appropriate conversions from a signed type to an unsigned type.

The use of the same API guarantees that the distribution is uniform, but this commit adds some unit test to enforce that necessity.

Fixes #KT-25570
2018-08-30 16:20:58 +03:00
Dmitry Petrov
db131df751 Don't mangle function names with 'kotlin.SuccessOrFailure' 2018-08-30 16:20:55 +03:00
Ilmir Usmanov
e8597d706d Implement debug-friendly Continuation.toString()
#KT-18986 Fixed
2018-08-30 16:20:52 +03:00
Dmitry Savvinov
4929f457ed Turn off BooleanElvisBoundSmartCasts in 1.3
See KT-26357
2018-08-30 16:20:49 +03:00
Ilya Gorbunov
3607ed85ab Update public API dump with mangled signatures 2018-08-30 16:20:45 +03:00
Ilya Gorbunov
e670318cf0 ifEmpty and isBlank extensions
- Introduce ifEmpty extension for Collections, Maps, Arrays, Sequences
- Introduce ifEmpty and isBlank for CharSequences

#KT-15695 Fixed
2018-08-30 16:20:42 +03:00
Alexey Tsvetkov
4f6d9e7b86 Update bootstrap 2018-08-30 16:20:39 +03:00
Dmitry Savvinov
2179ae496e Fix testdata after improvements in contract parsing diagnostics 2018-08-30 16:20:36 +03:00
Dmitry Savvinov
a6bb7d1e89 Support identity equals in contracts 2018-08-30 16:20:32 +03:00
Dmitry Savvinov
cf033fa78a Minor: extract common equals processing in a separate method 2018-08-30 16:20:29 +03:00
Dmitry Savvinov
70dc6ef0f7 Minor: detect 'returns()' more accurately
Before, we've assumed that if call has no expression arguments, then
it's a 'returns()' call.

Now we check that we've resolved to overload of 'returns' from
ContractsDsl with zero parameters.
2018-08-30 16:20:26 +03:00
Dmitry Savvinov
1300a475db Improve diagnostics for illegal constructions in contract-block
Like 'if', 'when', etc: they can have type of 'Effect', so we would try
to parse them and then fail silently.
2018-08-30 16:20:23 +03:00
Dmitry Savvinov
ca20c0b0bd Improve diagnostics for unrecognized InvocationKind in contracts 2018-08-30 16:20:19 +03:00
Dmitry Savvinov
e40f11ec52 Improve diagnostics for contract-calls when not lambda-literal passed 2018-08-30 16:20:16 +03:00
Dmitry Savvinov
90e37c6599 Improve diagnostics for illegal contract targets 2018-08-30 16:20:13 +03:00
Dmitry Savvinov
a9c388ecc7 Forbid referencing captured types and generics in contracts 2018-08-30 16:20:10 +03:00
Dmitry Savvinov
749fa049ca Refactor diagnostic reporting of effects parsing
- Introduce ContractParsingDiagnosticsCollector
It allows us to make sure that we return 'null'-contract iff there's
some error. Note that it differs from previous behavior in two major
points:
a) if contract was unparsed, but no error were reported for
some reason, then generic error will be reported (previously we were
swallowing incorrect contract silently)
b) if there were some errors during parsing, return only 'null'
(previously, we could return some contract. It was unusable due to
errors in code, but we want to be extra-safe here)

- Introduce ContractCallContext to not pass a bunch of random arguments
around

- Make message of Error.CONTRACT_NOT_ALLOWED more flexible
2018-08-30 16:20:07 +03:00
Dmitry Savvinov
a6783176ea Add tests on illegal usages of Contracts DSL
(currently with undesired behavior, it will be fixed in the next
commits)
2018-08-30 16:20:04 +03:00
Dmitry Savvinov
79476839c4 Minor: remove unneeded check from contract parsing
'parseContract' is called only from
'ContractParsingServices.checkContractAndRecordIfPresent', and here we
already have checked that this call is indeed a contract call.
2018-08-30 16:20:01 +03:00
Dmitry Savvinov
e29de37ac4 Fix JS IR BlackBox tests after contracts publishing
- Add necessary files to compilation
- Opt-in for experimentality

See changes at e2606b72bdbec2fea567d4127197707869eb801e
2018-08-30 16:19:58 +03:00
Dmitry Savvinov
ee8702d21e Load of testdata change due to contracts publishing
See changes in e2606b72bdbec2fea567d4127197707869eb801e
2018-08-30 16:19:55 +03:00
Dmitry Savvinov
accbd07b2e Publish ContractsDsl
- Mark @ContractsDsl as @Experimental
- Move Contracts DSL out from 'internal' package
- Change visibility of ContractsDsl from 'internal' to 'public'

^KT-25274 Fixed
^KT-25495 Fixed
2018-08-30 16:19:51 +03:00
Ilmir Usmanov
208c3a51ab Use short jvm names for the annotation parameters 2018-08-30 16:19:44 +03:00
Ilmir Usmanov
22f9a6ce08 Add coroutines debug metadata: compiler
#KT-25557 Fixed
 #KT-25559 Fixed
2018-08-30 16:19:41 +03:00
Ilmir Usmanov
c4287118d8 Add coroutines debug metadata: stdlib 2018-08-30 16:19:38 +03:00
Ilmir Usmanov
fe451dce31 Implement correct is check for SuspendFunction
Add test for suspend functions with language version 1.2.
Minor edit in SuspendFunction docs.
2018-08-30 16:17:46 +03:00
Dmitry Petrov
a205019156 Additional tests and fixes for function name mangling 2018-08-30 14:58:54 +03:00
Dmitry Petrov
99498eb7b8 Use 'name-hash' mangling scheme
'-' is allowed as a name character both in JVM and in Dalvik, but can't
be a part of a Java identifier.
2018-08-30 14:58:52 +03:00
Dmitry Petrov
a56d1d3ce8 Mangle function names with inline class parameters
Avoid name clashes in cases such as

  inline class Login(val login: String)
  inline class Password(val password: String)

  fun validate(login: Login) { ... }
  fun validate(password: Password) { ... }
2018-08-30 14:58:50 +03:00
Dmitry Petrov
ff9ba97d66 Minor: fix warnings and reformat 2018-08-30 14:58:47 +03:00
Alexey Sedunov
c7a5a7ebd5 Gradle: Use common language/api version (if any) of all modules for project
#KT-26290 Fixed
2018-08-30 14:58:45 +03:00
Denis Zharkov
c6eaaac877 Adjust coroutines test data to changing the default LV to 1.3 2018-08-30 14:58:43 +03:00
Denis Zharkov
f594cb22e8 Add "LANGUAGE_VERSION: 1.2" directive where it's necessary 2018-08-30 14:58:41 +03:00
Ilya Gorbunov
f5df53b7a7 Detect UInt/ULong parsing overflow after digit addition instead of before
#KT-26161
2018-08-30 14:58:39 +03:00
Ilya Gorbunov
d99f97ad96 Support '+' in front of parsed unsigned string values
#KT-26161
2018-08-30 14:58:37 +03:00
Ilya Gorbunov
2530a8e98c Provide unsigned string to number conversion in arbitrary base
#KT-26161
2018-08-30 14:58:35 +03:00
Ilya Gorbunov
c1d1a7108f Provide unsigned number to string conversion in arbitrary base
#KT-26161
2018-08-30 14:58:33 +03:00
Ilya Gorbunov
47162590eb Add a credit for Guava implementation of unsigned division and remainder 2018-08-30 14:58:30 +03:00
Ilya Gorbunov
abdd971d92 More contentHashCode tests for arrays 2018-08-30 14:58:28 +03:00
Ilya Gorbunov
4df665bc78 Generate extensions for unsigned arrays and provide tests for them
- contentEquals, contentToString, contentHashCode
- as[Signed]Array, as[Unsigned]Array
- to[Signed]Array, to[Unsigned]Array
- toTypedArray
- copyOf(), copyOf(newSize), copyOfRange(...)
2018-08-30 14:58:26 +03:00
Ilya Gorbunov
6360cc3cb5 Unsigned arrays: expose storage field as internal PublishedApi
To be able to write basic extensions that access storage array.
2018-08-30 14:58:24 +03:00
Ilya Gorbunov
6d33313d2e Regenerate range iteration tests 2018-08-30 14:58:22 +03:00
Ilya Gorbunov
3d2eb36486 Generate until, downTo, step, reversed functions for unsigned ranges/progressions 2018-08-30 14:58:20 +03:00
Ilya Gorbunov
add0894f54 Support unsigned types and array specializations in stdlib generator 2018-08-30 14:58:18 +03:00
Ilya Gorbunov
76ff4c9b2f Remove custom hashCode and equals from unsigned types
The generated ones are ok now (on JVM)
2018-08-30 14:58:16 +03:00
Ilya Gorbunov
f367322084 Introduce associateWith and associateWithTo functions
#KT-13814
2018-08-30 14:58:14 +03:00
Ilya Gorbunov
751e844258 Support having primary type parameter other than T in generated code
With some limitations: the primary parameter cannot have constraints for now.
2018-08-30 14:58:11 +03:00
Roman Elizarov
929064dfa7 Adjust SequenceBuilder to the new coroutines API
* Continuation.resumeWith(SuccessOrFailure)
* createCoroutineUnintercepted

(cherry picked from commit 8bbd78c)
2018-08-30 14:58:09 +03:00
Ilya Gorbunov
6400687f2a Restore experimental SequenceBuilder 2018-08-30 14:58:07 +03:00
Ilya Gorbunov
0ceceaaa6a Restore history of SequenceBuilder from experimental coroutines 2018-08-30 14:58:05 +03:00
Ilya Gorbunov
47996dbf47 Temporary remove SequenceBuilder 2018-08-30 14:58:03 +03:00
Ilya Gorbunov
38d8451d1c Remove unused and unnecessary classpath entries in compiler tests
Also remove obsolete additional path arguments for runIde task.
2018-08-30 14:58:01 +03:00
Ilya Gorbunov
237d870618 Change kotlin-runtime dependency to kotlin-stdlib in Kotlin runner and ant task 2018-08-30 14:57:59 +03:00
Ilya Gorbunov
e59141e32c Replace kotlin-stdlib-jreN usages in tests and samples 2018-08-30 14:57:56 +03:00
Ilya Gorbunov
16148a30c1 Remove or replace deprecated kotlin-runtime artifact usages 2018-08-30 14:57:54 +03:00
Ilya Gorbunov
c8becbd335 Stop distributing and publishing obsolete artifacts
Keep stdlib-jreN dist for tests only.

#KT-23799
2018-08-30 14:57:52 +03:00
Ilmir Usmanov
b7b5fd75b8 Minor. Fix tests 2018-08-30 14:57:50 +03:00
Ilmir Usmanov
e93683621a Implement callSuspend and callSuspendBy functions as KCallable's
extension methods.
Also make isSuspend a member of KCallable.
 #KT-21972: Fixed
2018-08-30 14:57:48 +03:00
Denis Zharkov
66315cee45 Fix coroutine-related test data 2018-08-30 14:57:46 +03:00
Denis Zharkov
c12bfe312a Make experimental/release COROUTINE_SUSPENDED reference the same instance
It's necessary when mixing experimental/release coroutines together

 #KT-25683 In Progress
2018-08-30 14:57:44 +03:00
Denis Zharkov
3a7f8dcf3a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-30 14:57:41 +03:00
Alexey Sedunov
5ac5a8d723 Configuration: Do not auto-advance "Latest Stable" to pre-release version
#KT-25611 Fixed
2018-08-30 14:57:39 +03:00
Alexey Sedunov
a490781213 Configuration: Drop coroutines for language >= 1.3
#KT-25681 Fixed
2018-08-30 14:57:37 +03:00
Alexander Udalov
9f4c8d5b81 Minor, fix test data
Language version 1.3 is no longer experimental
2018-08-30 14:57:35 +03:00
Alexander Udalov
927706883e Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-30 14:57:33 +03:00
Alexander Udalov
02a9b03007 Report a warning or error if an old language version or API version is used
#KT-25823 Fixed
2018-08-30 14:57:31 +03:00
Anton Bannykh
db29eadba5 Advance bootstrap to 1.3-M2-eap-82 2018-08-30 14:57:29 +03:00
Anton Bannykh
a83baee67b review fixes + DCE data update + test (un)muting 2018-08-30 14:57:27 +03:00
Anton Bannykh
2663d9751a JS: support unsigned constants inside string templates 2018-08-30 14:57:24 +03:00
Anton Bannykh
6103df0b31 JS: support signed constant expressions as unsigned primitive arguments 2018-08-30 14:57:22 +03:00
Anton Bannykh
934e11aa60 JS: support unsigned primitive vararg's 2018-08-30 14:57:20 +03:00
Anton Bannykh
944c5b6044 JS: modify a test to work around Kotlin/JS Double.toString problems 2018-08-30 14:57:18 +03:00
Anton Bannykh
a11c4871ea JS: equals, hashCode, toString support in inline classes 2018-08-30 14:57:16 +03:00
Ilya Gorbunov
a8596a9cd6 Rename experimental coroutines expect sources
In order not to clash in sources jar with expect sources of release coroutines
2018-08-30 14:57:14 +03:00
Alexey Tsvetkov
49bddcd220 Use release coroutines in evaluate tests 2018-08-30 14:57:12 +03:00
Dmitry Savvinov
756e5ece84 Revert "Disable contracts in 1.3-M1"
This reverts commit e866a3bd0d.
2018-08-30 14:57:10 +03:00
Alexander Udalov
254d943e07 Fix some tests in compileKotlinAgainstCustomBinaries 2018-08-30 14:57:07 +03:00
Ilya Gorbunov
357c5be4fb Make sure index and count do not overflow for long sequences
Throw an exception immediately before an overflow becomes observable.
Place check to prevent negative index from indexOf, indexOfFirst.
Do not insert overflow checks for arrays, lists, maps and char sequences.

#KT-16097
2018-08-30 14:57:05 +03:00
Ilya Gorbunov
c44f62a3d4 Allow dropping and taking a lot of elements in very long sequences
For example allow dropping and taking Int.MAX_VALUE elements from
a sequence that is a result of another Int.MAX_VALUE dropping.
2018-08-30 14:57:03 +03:00
Ilya Gorbunov
eaa0902ea5 Add a class for long-running sequence/iterable tests
These tests will not run neither locally nor on CI unless the explicit
"kotlin.stdlib.test.long.sequences" parameter is specified.
2018-08-30 14:57:01 +03:00
Ilya Gorbunov
2df78fc81a Introduce common ArithmeticException
Make divisionByZero test still fail in JS after introducing ArithmeticException
2018-08-30 14:56:59 +03:00
Alexander Udalov
ceb909d261 Inherit KType from KAnnotatedElement, implement KType.annotations
#KT-16795 Fixed
2018-08-30 14:56:57 +03:00
Alexey Tsvetkov
e4bbe2d5e2 Fix coroutines default value checks in KotlinProjectIT 2018-08-30 14:56:55 +03:00
Ilya Gorbunov
a0b0994651 Make unsigned array constructor-like functions inline-only 2018-08-30 14:56:53 +03:00
Ilya Gorbunov
f9479d12f9 Add missing unsigned array constructors (from size)
#KT-25961 Fixed
2018-08-30 14:56:51 +03:00
Ilya Gorbunov
282cf73aff Update public API: inline classes codegen changes 2018-08-30 14:56:48 +03:00
Ilya Gorbunov
99de68507d Workaround for new MPP dependency configuration limitations 2018-08-30 14:56:46 +03:00
Ilya Gorbunov
6174ae7af6 Advance bootstrap to 1.3-M2-eap-35 2018-08-30 14:56:44 +03:00
Alexander Udalov
b55fc818d1 Support JvmName on annotation constructor parameters
#KT-25372 Fixed
2018-08-30 14:56:42 +03:00
Alexander Udalov
dc1f4c7d5b Generate get-targeted annotations on annotation constructor parameters
This change would also make NotNull annotations to be generated on
non-primitive annotation methods, but we skip this deliberately because
annotation methods never return null on JVM anyway

 #KT-25287 Fixed
2018-08-30 14:56:40 +03:00
Alexey Tsvetkov
9df949c039 Remove non default coroutines options from Gradle tests
They don't have any effect anyway
2018-08-30 14:56:38 +03:00
Alexey Tsvetkov
a3d78f769b Add Coroutines.DEFAULT to Gradle plugin
See CommonCompilerArguments changes
2018-08-30 14:56:36 +03:00
Ilya Gorbunov
c26b202907 Make StringBuilder.clear extension inline in JS
#KT-18910
2018-08-30 14:56:34 +03:00
Ilya Gorbunov
5412227380 Unify Regex.split behavior in JVM, JS regarding empty match delimiters
Rewrite split implementation for JVM

#KT-21049
2018-08-30 14:56:31 +03:00
Ilya Gorbunov
85af1f5d38 Improve argument validation in copyOfRange
Make copyOfRange implementation non-inline in order not to expose
copyOfRangeToIndexCheck implementation detail.

It will be possible to make the function non-inline itself later without
that JvmName trick, when apiVersion 1.2 support is discontinued.

#KT-19489
2018-08-30 14:56:29 +03:00
Ilya Gorbunov
58a3b64baf Add argument validation in copyOf(newSize) in JS
#KT-19489
2018-08-30 14:56:27 +03:00
Ilya Gorbunov
93540e476e stdlib-gen: tweak to build with 1.3 compiler, turn off ReleaseCoroutines 2018-08-30 14:56:25 +03:00
Ilya Gorbunov
17e04b2665 Deprecate readBytes with estimatedSize parameter, add overload without parameters
Add a test for readBytes.

#KT-19305 Fixed
2018-08-30 14:56:23 +03:00
Alexander Udalov
cbc92bc9a1 Add KClass.sealedSubclasses to get direct subclasses of sealed class
#KT-14657 Fixed
2018-08-30 14:56:21 +03:00
Ilya Gorbunov
1b1713a849 Simplify long constants in range iteration tests 2018-08-30 14:56:19 +03:00
Ilya Gorbunov
bb1ce52267 Add support for generating unsigned progression iteration codegen tests 2018-08-30 14:56:17 +03:00
Ilya Gorbunov
1dbaaf7f8a Begin test coverage for unsigned ranges and progressions 2018-08-30 14:56:15 +03:00
Ilya Gorbunov
f010231ff7 Change range iteration tests so they are runnable on all platforms
Remove JS and Native backend exclusions
2018-08-30 14:56:13 +03:00
Ilya Gorbunov
e18bebf12a Fix plain wrong unsigned rem implementation 2018-08-30 14:56:10 +03:00
Ilya Gorbunov
b412143fce Aggregate coroutines tests under 'check' task instead of 'test'
Otherwise --tests "pattern" gradle option has problem as it's applied
to both 'test' and `coroutinesTest` tasks and fails to match tests in one of them
2018-08-30 14:56:08 +03:00
Ilya Gorbunov
b68c27178d Do not use MIN_VALUE step in tests
#KT-17176
2018-08-30 14:56:06 +03:00
Ilya Gorbunov
7dc6c3d7ce Prohibit MIN_VALUE step for unsigned progressions 2018-08-30 14:56:04 +03:00
Ilya Gorbunov
4e574cb017 Improve exception message for invalid steps and document step requirements
#KT-17176
2018-08-30 14:56:02 +03:00
Pap Lőrinc
bdf623f711 Prohibit step size of min value, as it doesn't have a negated counterpart
#KT-17176
2018-08-30 14:56:00 +03:00
Vyacheslav Gerasimov
c6c3b05d02 as32: Update build range for AS 3.2 plugin to match RC1 and further releases 2018-08-30 14:55:58 +03:00
Alexander Udalov
877dfd8ff4 Fix generic signature of FunctionN type visible from Java 2018-08-30 14:55:56 +03:00
Vyacheslav Gerasimov
348ce6733d Update build range for AS 3.2 plugin to match next AS 3.2 releases 2018-08-30 14:55:54 +03:00
Vyacheslav Gerasimov
d5009e4fb4 as33c4: Remove registration of AndroidGradleOrderEnumerationHandler from gradle-java.xml 2018-08-30 14:55:52 +03:00
Ilmir Usmanov
cf1f194f8b Add warning on -Xcoroutines flag use
The only case when warning is not reported is -Xcoroutines=default.
But this is OK until the flag is removed completely.
2018-08-30 14:55:50 +03:00
Ilya Gorbunov
8f6d2b70a9 Add stdlib test for Boolean companion 2018-08-30 14:55:48 +03:00
Ilya Gorbunov
5f3a7f0147 Use Char.MIN_VALUE and MAX_VALUE in tests 2018-08-30 14:55:45 +03:00
Ilya Gorbunov
92e149fa40 Add tests for SIZE_BYTES and SIZE_BITS constants
#KT-8247 Fixed
2018-08-30 14:55:43 +03:00
Ilya Gorbunov
fa2f1311d7 Add tests for UInt, ULong
Opt-in to use unsigned types in tests
2018-08-30 14:55:41 +03:00
Ilya Gorbunov
fb62507e51 Switch bootstrap to 1.3 branch, build 1.3-M1-eap-77 2018-08-30 14:55:39 +03:00
Ilya Gorbunov
26b258af6a Unignore passing tests with unsigned literals in JS 2018-08-30 14:55:37 +03:00
Mikhail Zarechenskiy
d94b47bcd3 Support other kinds of translation for unsigned literals 2018-08-30 14:55:34 +03:00
Roman Artemev
d1df5f5783 Fix unsigned constants translation (Int to UInt) 2018-08-30 14:54:30 +03:00
Mikhail Zarechenskiy
61efbea9a8 Initial support of unsigned literals translation in JS 2018-08-30 14:54:27 +03:00
Ilya Gorbunov
1792a77a47 Generate hashCode and equals for unsigned types 2018-08-30 14:52:51 +03:00
Ilya Gorbunov
e2310343d4 Opt-in to use unsigned types in various internal utils 2018-08-30 14:52:49 +03:00
Ilya Gorbunov
db7f4bb402 Deprecate js Math.random and provide replacement with Random.nextDouble
#KT-23564 Fixed
2018-08-30 14:52:47 +03:00
Dmitry Savvinov
402f8880a9 Disable contracts in 1.3-M1
^KT-25538 Fixed
2018-08-30 14:52:45 +03:00
Ilya Gorbunov
e4d7efcf06 Update expected reachable node count in JS tests
Caused by new coroutine API an its js support
2018-08-30 14:52:43 +03:00
Ilya Gorbunov
516ea04d18 Update expected reachable node count in JS tests
Caused by introduction of new random API
2018-08-30 14:52:40 +03:00
Alexander Udalov
c369e67e9f Revert "Ignore tests on big function types until master is 1.3"
This reverts commit f03dc62173.
2018-08-30 14:52:38 +03:00
Alexander Udalov
082da82f3e Introduce kotlin.jvm.functions.FunctionN
#KT-13764
2018-08-30 14:52:36 +03:00
Alexander Udalov
51979b9ffa Convert FunctionBase to Kotlin, add type parameter to Lambda
This will make it possible to avoid raw types when inheriting from both
FunctionBase and Function<R>. This change adds a generic type parameter
to FunctionBase and Lambda which is not source-breaking under our policy
because both FunctionBase and Lambda are internal classes (located in
package kotlin.jvm.internal)
2018-08-30 14:52:33 +03:00
Alexander Udalov
e35ebff4e1 Move superinterface to the only subclass of FunctionBase 2018-08-30 14:51:17 +03:00
Ilya Gorbunov
07a0cb91d4 Introduce Char.MIN_VALUE and MAX_VALUE constants (KT-21763)
Add Char.MIN_VALUE and Char.MAX_VALUE implementations in primitive companion objects.
Update builtins test data and public API.

Co-authored-by: Oskar Drozda <themppsplx@gmail.com>
2018-08-30 14:51:14 +03:00
Ilya Gorbunov
5ee3cc59b3 Split summary from description in Char docs 2018-08-30 14:51:12 +03:00
Ilya Gorbunov
0c50014e7a Introduce SIZE_BYTES and SIZE_BITS constants for all integral types
#KT-8247 Fixed
2018-08-30 14:51:10 +03:00
Ilya Gorbunov
31d7aae98d Annotate companion object declaration with SinceKotlin
Move it to the end of the class declaration.
Update builtins testdata
2018-08-30 14:51:08 +03:00
Kerooker
be2ba61f13 Removed Boolean from ClassMapperLite to avoid compiler confusion 2018-08-30 14:51:06 +03:00
Kerooker
af5f78076c KT-7922 Added Boolean Companion Object 2018-08-30 14:51:04 +03:00
Ilya Gorbunov
cd0906a357 Improve isNullOrEmpty() extensions
- Annotate with SinceKotlin("1.3") and InlineOnly
- Add contract linking the receiver and the returned value
- Unify wording in docs
- Add sample for Map.isNullOrEmpty

#KT-23279
2018-08-30 14:51:02 +03:00
Mon_chi
d0788148e2 Add isNullOrEmpty() to Array, Collection, and Map. Fixes KT-23279 2018-08-30 14:51:00 +03:00
Jeff Wright
292f69936b Add Collections.isNullOrEmpty #KT-23279 2018-08-30 14:50:58 +03:00
Toshiaki Kameyama
6a140fb9ed "Useless call on collection type" inspection: Apply to 'kotlin.sequences.orEmpty' 2018-08-30 14:50:56 +03:00
Toshiaki Kameyama
c4b785de36 Add Sequence.orEmpty #KT-16552 Fixed 2018-08-30 14:50:54 +03:00
Ilya Gorbunov
2ce0bca34e Make bound check helpers top-level so they are compiled as static on JVM
Improve empty range exception text in nextInt/nextLong(range)
2018-08-30 14:50:52 +03:00
Ilya Gorbunov
35c927214d More efficient double generation in JS 2018-08-30 14:50:50 +03:00
Ilya Gorbunov
b96803248f Write random contract tests and fix implementations to pass them 2018-08-30 14:50:48 +03:00
Ilya Gorbunov
ed1f869354 Add xorwow random implementation test and fix implementation 2018-08-30 14:50:46 +03:00
Ilya Gorbunov
042a8ff6a2 Provide ThreadLocalRandom wrapper only on JDK8 as it is buggy in JDK7 2018-08-30 14:50:44 +03:00
Ilya Gorbunov
870f5e3448 Remove lazy initialization of default platform random 2018-08-30 14:50:42 +03:00
Ilya Gorbunov
fa33b1b5a9 Random docs and API refinement
KT-17261
2018-08-30 14:50:40 +03:00
Ilya Gorbunov
7e4528e217 Common shuffle/shuffled with the specified random source
KT-17261, KT-9010
2018-08-30 14:50:38 +03:00
Ilya Gorbunov
cc031e3a40 Provide common Random API
#KT-17261
2018-08-30 14:50:36 +03:00
Ilmir Usmanov
9df411481c Do not coerce function literals to suspend.
The design is to use `suspend fun` instead of coercion, just as suspend
lambdas.
However, this syntax is not supported in the parser. But this is not a
problem, since the coercion lead to internal compiler error.
As a workaround everybody uses suspend lambdas.
 #KT-24860: Fixed
2018-08-30 14:50:33 +03:00
Ilya Gorbunov
d57e1bb68b Migrate stepping and evaluation tests to the new coroutine API 2018-08-30 14:50:31 +03:00
Ilya Gorbunov
bbee18b84d Introduce StringBuilder.clear() extension
#KT-18910 Fixed
2018-08-30 14:50:29 +03:00
Ilya Gorbunov
c667340261 Allow pre-release compiler reading pre-release binaries in tests
Pre-release compiler should be able to read pre-release binaries in tests
even if a stable language version is used, otherwise no stdlib API can be read.
2018-08-30 14:50:27 +03:00
Alexander Udalov
f423403167 Make kotlin.Metadata public
Prohibit explicit usage of `@Metadata` to prevent possible
AnnotationFormatError at runtime

 #KT-23602 Fixed
2018-08-30 14:50:25 +03:00
Ilya Gorbunov
8102e512d3 For bootstrapping on 1.3-M1: compile parts that can be used in .gradle.kts scripts with 1.2 language version 2018-08-30 14:50:23 +03:00
Ilya Gorbunov
b160561795 Include new coroutines and unsigned classes into stdlib
Fix clashing module name in common coroutines sourceset
2018-08-30 14:50:21 +03:00
Ilya Gorbunov
4c6c0aa279 Update public API test due to ProperVisibilityForCompanionObjectInstanceField 2018-08-30 14:50:19 +03:00
Ilya Gorbunov
76e581fe4f Temporarily turn off ReleaseCoroutines feature 2018-08-30 14:50:16 +03:00
Ilya Gorbunov
d4a195c757 Advance maven project versions to 1.3-SNAPSHOT 2018-08-30 14:49:30 +03:00
Ilya Gorbunov
0f5f90cf52 Advance project version to 1.3-SNAPSHOT
Set LATEST_STABLE language version and current version of stdlib to 1.3, set IS_PRE_RELEASE
Remove "EXPERIMENTAL" from 1.3 version description in tests and gradle options
2018-08-30 14:49:27 +03:00
Natalia Selezneva
5b29528386 Scripting Console files shouldn't have scratch panel
KT-25818 Fixed
2018-08-30 12:35:54 +03:00
Natalia Selezneva
472e3a7178 Simpify message in commit dialog for java to kt renames
^KT-26073
2018-08-30 12:35:54 +03:00
Natalia Selezneva
2fe4f95d33 Gradle project configurator: fix inserting of non-kotlin library version in gradle.kts files 2018-08-30 12:35:53 +03:00
Natalia Selezneva
4671fa0136 Mute some multiplatform test for Gradle 4.9 2018-08-30 12:35:52 +03:00
Natalia Selezneva
81f4bd3846 Add tests for configuring kotlin with gradle 4.9 2018-08-30 12:35:52 +03:00
Sergey Rostov
81b519286f ScriptDependenciesLoader: Fix freeze on notifyRootsChanged
In 4f3f4dd, launch(EDT(project)) was replaced with TransactionGuard.submitTransaction to fix write in write-unsafe context.
Unfortunately submitTransaction will call action immediately if we are already on EDT. This causes IDE freeze.
By replacing submitTransaction with submitTransactionLater we are postponing work to the end of events queue (as it was before 4f3f4dd).
Also in isUnitTestMode we need to call action immediately as it was before 4f3f4dd.

#KT-25958 Fixed
2018-08-30 10:59:32 +03:00
Yan Zhulanow
ddb034715d Gradle importer: Join compiler plugin options as before the new MPP refactoring (KT-26424)
Android Studio has at least two kinds of importers: a generic one (that is run when the "Refresh Gradle model" tool button is pressed) and a fast one (is run on the build variant switch). Fast importer doesn't invoke our import handlers (AndroidExtensionsGradleImportHandler) that modify the compiler options stored in Kotlin facet in some way.

Until the recent MPP importer refactoring both old and new options were saved in the Kotlin facet; now only the new options persist. This is certainly better, though it breaks the existing behavior (as the options added by import handlers become lost).

The alternative approach is to re-design import handlers in a way they won't require the whole module/source set node (so we can invoke them every time), though it requires a way more changes.
2018-08-29 19:16:16 +05:00
kenji tomita
e5841441c9 Fix #KT-26353 'Make variable immutable' is a bad name for a quickfix that changes 'var' to 'val' 2018-08-29 16:27:46 +03:00
Alexander Udalov
e85dcfc3e3 Fix compatibility with Android plugin broken in 896cf61 2018-08-29 15:24:58 +02:00
Toshiaki Kameyama
3ea0222d43 "Add annotation target" quickfix: add SOURCE retention when target is EXPRESSION #KT-26306 Fixed 2018-08-29 16:18:04 +03:00
Denis Vnukov
ddf92ef187 Creating IrLineNumberTestGenerated, adding line numbers for few common expressions
This PR enables LineNumberTestGenerated test on IR backend. The testing of
hardcoded sequence of line numbers is replaced with mere checks for set-like
checks for expected line numbers.
2018-08-29 12:52:20 +02:00
Ilya Gorbunov
36936d252c Support multiple expectedBy dependencies when building -Xcommon-sources list
`addCommonSourceSetToPlatformSourceSet` may be called multiple times during
a platform project configuration.
2018-08-28 19:13:36 +03:00
Zalim Bashorov
b2d9254bfd Fix testdata 2018-08-28 16:30:15 +03:00
Vyacheslav Gerasimov
bf4ded3991 Add org.jetbrains.markdown to test runtime of idea project 2018-08-28 15:20:03 +03:00
Pavel Punegov
1ea9c2d4ba Replace min with coerceAtMost in test 2018-08-28 13:48:44 +03:00
Pavel Punegov
1c5ebacf0f Disable 1.3 version coroutines in Native and incorrect genericProperty test 2018-08-28 13:48:44 +03:00
Pavel Punegov
9eb78fc490 Disable tests that fail in NATIVE 2018-08-28 13:48:44 +03:00
Pavel Punegov
39a65a099a Disable IEEE754 tests with improper comparisons behaviour in Native 2018-08-28 13:48:44 +03:00
Pavel Punegov
1a7d366733 Disable JVM tests in native 2018-08-28 13:48:44 +03:00
Pavel Punegov
0c8f34a934 Disable JVM assertions in native 2018-08-28 13:48:44 +03:00
Pavel Punegov
e2efeb70f7 Zip stdlib tests 2018-08-28 13:48:43 +03:00
Pavel Punegov
2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Alexander Udalov
4219aff548 Refactor DescriptorRenderer's renderAccessors option
In some tests with txt (probably all except loadJava), property
accessors are not rendered at all, so a third option value (NONE) will
be useful to determine whether we need to render annotations on property
accessors as get/set/sparam-targeted annotations on the property
2018-08-27 23:37:06 +02:00
Alexander Udalov
896cf61443 Move JVM-specific annotation FQ names and utils to frontend.java 2018-08-27 23:37:06 +02:00
Alexander Udalov
ab441dcd96 Drop PropertyDescriptorImpl.setType that takes KotlinType
Only use the other setType that takes an instance of
ReceiverParameterDescriptor. This will make sure that call sites can
use correct receiver annotations
2018-08-27 23:37:05 +02:00
Alexander Udalov
34c033bcaf Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize
Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
2018-08-27 23:37:04 +02:00
Alexander Udalov
6fb39785ff Postpone force resolve of annotations on properties
Otherwise (after subsequent commits) we may end up calling
BindingContext.HAS_BACKING_FIELD too early and getting incorrect value,
which will influence which annotations the property and the field will
have, and since they're cached as soon as they're computed, they will
remain incorrect until the end of the program. Now we're calling force
resolve after bodies of property accessors are resolved, which is the
point where the backing field presence has been already determined for
certain.

This all still looks very fragile because we might try to get property's
annotations anywhere else before the accessors' bodies are analyzed, but
I have no idea at the moment how to improve this without refactoring the
whole subsystem
2018-08-27 23:36:25 +02:00
Alexander Udalov
8d44824875 Minor, use Annotations.EMPTY instead of empty AnnotationsImpl 2018-08-27 23:36:24 +02:00
Alexander Udalov
872f6e2cea Minor, make AnnotatedImpl not abstract 2018-08-27 23:36:24 +02:00
Alexander Udalov
50270293e3 Minor, improve assertion message in test 2018-08-27 23:36:24 +02:00
Vyacheslav Gerasimov
bc544d764a Refactor build repositories to reduce number of unnecessary request
Setup for all projects only local, jcenter and bootstrap repositories
2018-08-27 18:09:26 +03:00
Mikhael Bogdanov
ca5b19d0c6 Merge Java 8 write signature tests in common ones 2018-08-27 15:55:03 +02:00
Mikhael Bogdanov
7e7b556018 Minor. Reformat 2018-08-27 15:17:26 +02:00
Mikhael Bogdanov
7843d4e0d4 Minor. Code clean 2018-08-27 15:17:26 +02:00
Mikhael Bogdanov
efd93670f8 Migrate AbstractWriteSignatureTest.kt to CodegenTestCase stuff 2018-08-27 15:17:25 +02:00
Mikhail Zarechenskiy
3f79a752a5 Check for accessibility of unsigned types when using unsigned literals 2018-08-27 15:16:14 +03:00
Alexander Udalov
afd53c9870 Revert metadata version reading advancement for JS/Common
This commit reverts 59e2101a25 partially,
leaving only the implementation of KT-25972 for JVM. The reason is that
we can't fully commit to stabilizing JS (and .kotlin_metadata) binary
metadata formats so much as to postpone any changes done to it for a
whole release year time. It's likely that we will need to update JS
metadata format incompatibly pretty soon, and with the scheme where we
can read the "current + 1" version, it'd require advancing the metadata
version by 2, which would break the nice property that the metadata
version (since Kotlin 1.4) is equal to the version of the compiler that
produced it.

See KT-25972
2018-08-27 13:14:09 +02:00
Mikhail Zarechenskiy
4067d6b196 [NI] Fix overload resolution ambiguity for incorrect provideDelegate
#KT-25810
2018-08-27 13:49:19 +03:00
Toshiaki Kameyama
ae4ff45750 "Remove redundant let" inspection: do not report for long call chains #KT-26289 Fixed 2018-08-27 13:42:25 +03:00
Toshiaki Kameyama
c6db26ba91 "Replace 'if' with elvis operator": Don't suggest on nullable type check #KT-25886 Fixed 2018-08-27 13:33:46 +03:00
Toshiaki Kameyama
1a31ce769c Fix false negative in not reduceable binary expression #KT-26179 Fixed 2018-08-27 13:32:49 +03:00
Toshiaki Kameyama
8f80851b9a if then to elvis: support calling extension function in class #KT-26343 Fixed 2018-08-27 13:31:04 +03:00
Toshiaki Kameyama
b34f32d4f3 "Remove redundant backticks": Fix false positive for yield #KT-25968 Fixed 2018-08-27 13:10:57 +03:00
Toshiaki Kameyama
362e6863ac "Replace if with when": Do not remove block braces if block has single lambda expression #KT-26187 Fixed 2018-08-27 12:54:45 +03:00
kenji tomita
e59427edab Fix false positive for if-else 2018-08-27 12:53:35 +03:00
Toshiaki Kameyama
0099b7b3b1 "Remove explicit type specification" intention: Add type argument to initializer if need #KT-13343 Fixed 2018-08-27 12:35:32 +03:00
Alexander Podkhalyuzin
54922362e3 Added Kotlin svg icon to the distribution
#KT-26393 Fixed
2018-08-25 17:21:50 +03:00
Alexander Podkhalyuzin
c0e92ba350 Added resolve scope enlarger to module infos in Kotlin
From now it's possible to enlarge resolve scope for analysis in IDE,
the only difference is that it's based on module file.

#KT-26313 Fixed
2018-08-25 11:22:50 +03:00
Alexander Udalov
a9a8925409 Revert "Report error on .class files produced by Kotlin 1.3-M1"
This reverts commit ba111d58ae.

The reverted commit only makes sense after a bootstrap step after
advancing the metadata version, which has not yet happened in master,
but did happen in 1.3-M2, where this commit was supposed to end up
2018-08-24 22:38:59 +02:00
Vyacheslav Gerasimov
0dd410a5bb Make CommandAdapter.beforeCommandFinished override compatible with 183 platform 2018-08-24 22:19:28 +03:00
Juan Chen
1a562d477a Add sync after Kotlin configured in Android Studio projects. 2018-08-24 22:07:36 +03:00
Mikhael Bogdanov
f21dd9f801 Minor. Review fixes 2018-08-24 20:22:33 +02:00
Mikhael Bogdanov
367ab5470c Minor. Code clean 2018-08-24 20:22:32 +02:00
Mikhael Bogdanov
4687381179 Convert AbstractLineNumberTest.java to Kotlin 2018-08-24 20:17:25 +02:00
Mikhael Bogdanov
c28b9f75e3 Rename .java to .kt 2018-08-24 20:17:24 +02:00
Mikhael Bogdanov
de02e97f39 Print generated bytecode on AbstractCheckLocalVariablesTableTest fail 2018-08-24 20:17:23 +02:00
Mikhael Bogdanov
9a1b2daa12 Minor. Code clean 2018-08-24 20:17:21 +02:00
Mikhael Bogdanov
f06b6ed47e Convert AbstractCheckLocalVariablesTableTest.java to Kotlin 2018-08-24 20:17:20 +02:00
Mikhael Bogdanov
614fad016f Rename .java to .kt 2018-08-24 20:17:19 +02:00
Mikhael Bogdanov
232170b72a Migrate AbstractIrCheckLocalVariablesTableTest to CodegenTestCase stuff 2018-08-24 20:17:18 +02:00
Alexander Udalov
ba111d58ae Report error on .class files produced by Kotlin 1.3-M1
Advance incremental cache version to force rebuild after switching from
1.3-M1 to 1.3-M2
2018-08-24 18:49:55 +02:00
Cuihtlauac ALVARADO
813d7ff84a Remove useless parameter
It seems a candidate is added either when requiresExtensionReceiver is true and
receiver is not null or when requiresExtensionReceiver is false and receiver is null.
Consequently, f appears useless.
2018-08-24 18:48:03 +03:00
Cuihtlauac ALVARADO
eb7d77ebd9 Accept renaming and formating requests
* Rename "resolve" into "resolveCandidates"
* Use multi-line formatting for formal parameters
* Move ")" down one line at call sites
2018-08-24 18:48:03 +03:00
Cuihtlauac ALVARADO
bf08755969 Factor duplicated code.
Move SimpleScopeTowerProcessor from TowerResolver into ScopeTowerProcessors.

Lift code duplicated in functions:

  * ExplicitReceiverScopeTowerProcessor.simpleProcess()
  * QualifierScopeTowerProcessor.simpleProcess()
  * NoExplicitReceiverScopeTowerProcessor.simpleProcess()

into AbstractSimpleScopeTowerProcessor. Turn it into a function and call it
in the various context. Incidentally, now useless functions resolveAsMember()
and resolveAsExtension() are  removed.
2018-08-24 18:48:03 +03:00
Alexey Sedunov
7ae740dd91 MPP: Add tests for new MPP model import 2018-08-24 18:00:57 +03:00
Mikhail Glukhikh
ded652382b "Deferred result not used": report all Deferred results by default
#KT-26181 Fixed
2018-08-24 18:00:56 +03:00
Mikhail Glukhikh
564ea629d1 Add annotations to primary constructor together with 'constructor'
This fixes incorrect behaviour if primary constructor has no explicit
'constructor' keywork
#KT-25548 Fixed
2018-08-24 18:00:54 +03:00
Mikhail Glukhikh
c12f29ae30 Enhance inspection about SuccessOrFailure (related to KT-25621)
Increase performance by searching first SuccessOrFailure/runCatching/etc
in text of functions without return type.
Remove stdlib false positives, like success() & failure().
For catching extension, check also non-catching members.
Add "rename to *Catching" fix.
2018-08-24 18:00:46 +03:00
Mikhail Glukhikh
7a2d0a3bb2 Add inspection "Redundant runCatching {}" (related to KT-25621) 2018-08-24 18:00:44 +03:00
Mikhail Glukhikh
2084e94099 Add quick-fix "add .getOrThrow()" for SuccessOrFailure inspection
#KT-25621 Fixed
2018-08-24 18:00:42 +03:00
Mikhail Glukhikh
87d750aa1c Add inspection to detect functions with SuccessOrFailure return type
Partial implementation of KT-25621 (no quick-fixes yet)
2018-08-24 18:00:41 +03:00
Ivan Gavrilovic
48784fd95e Use new API for getting the raw Android resources
A new method has been added in the Android Gradle
plugin 3.3.0. This commit switches from ussing the
MergeResources task, and uses getAllRawAndroidResources
API instead.

Test: manually verified
2018-08-24 17:28:40 +03:00
Roman Artemev
5dcb02466a Update test data 2018-08-24 15:49:13 +03:00
Roman Artemev
2e5940e46d [JS IR BE] Fix object instance reference
* set it in primary constructor prior to constructor body
2018-08-24 15:49:13 +03:00
Roman Artemev
85a8af13cf [JS IR BE] Fix constructor parent 2018-08-24 15:49:13 +03:00
Georgy Bronnikov
30a2058f74 Fix JVM_IR backend crashes when compiling for Android
^KT-23963 Fixed
^KT-23968 FIxed
^KT-23972 Fixed
2018-08-24 15:46:44 +03:00
Roman Artemev
cc14442be1 Add tests for primitive companion object
Update test data
2018-08-24 14:58:42 +03:00
Roman Artemev
450ed63690 [JS IR BE] Implement primitive companion object 2018-08-24 14:58:42 +03:00
Dmitry Petrov
2a524920a5 Don't remap inline function args requiring inline class boxing/unboxing
Same as for primitives: inline lambda expects to see a boxed value,
so, even if an argument is a local variable, it can't be remapped,
because it contains unboxed representation.
2018-08-24 14:52:29 +03:00
Dmitry Petrov
6e2d05cd94 Fix argument original type order in InlineCodegen
Arguments are put on stack in the direct order, and then stored into
local variables for inlining in the reversed order:

    <arg0>
    <arg1>
    <arg2>
    store <param2>
    store <param1>
    store <param0>

Original value parameter types were taken in direct order, though.
2018-08-24 14:52:29 +03:00
Mikhael Bogdanov
25b32b8e1d Migrate AbstractLineNumberTest to CodegenTestCase stuff 2018-08-24 13:39:22 +02:00
Alexander Udalov
9c68f2be36 Advance metadata versions and JVM bytecode version
JVM versions are increased in order to differentiate pre-1.3-M2 .class
files where signatures mentioning inline classes were not mangled. Other
versions are increased in case something similar will need to be
detected
2018-08-24 13:01:53 +02:00
Georgy Bronnikov
50e8f7efc7 Track fake overrides for IrField 2018-08-24 13:41:52 +03:00
Yan Zhulanow
01d5e227f0 Pill: Fix resource roots importing 2018-08-24 15:29:55 +05:00
Yan Zhulanow
b7873edf30 Pill: Fix issue with clashing sdk-common.jar and sdk-common-26.1.2.jar
Move sdk-common.jar to the end of the classpath
2018-08-24 15:29:55 +05:00
Yan Zhulanow
267e239e52 Pill: Refactoring, introduce a generic predicate in DependencyMapper 2018-08-24 15:29:55 +05:00
Denis Zharkov
83a431fca3 Introduce redundant enum CoroutineSingletons in experimental.intrinsics 2018-08-24 10:55:12 +03:00
Yan Zhulanow
bda14fcbb2 Unresolved reference not reported on data class constructor @get annotation (KT-19628) 2018-08-24 04:28:16 +05:00
Yan Zhulanow
463f8dae6a Pill: Add '-ea' option to the default JUnit configuration if missing 2018-08-24 04:28:15 +05:00
Yan Zhulanow
b145c97b37 Kapt: Restore line mappings correctly for nested classes and its members 2018-08-24 04:28:13 +05:00
Yan Zhulanow
2328cecffe Minor: Add kotlinx-metadata and kotlinx-metadata-jvm to Pill 2018-08-24 04:28:12 +05:00
Yan Zhulanow
c83581e6b8 Kapt: Strict mode. Issue an error if the converter fails to process a class (#KT-25518, #KT-24272) 2018-08-24 04:28:11 +05:00
Yan Zhulanow
ef210d7122 Kapt: Do not write references to anonymous classes to stubs & metadata (#KT-25374) 2018-08-24 04:28:09 +05:00
Yan Zhulanow
43f5971863 Remove unneeded 'idea-full' dependency from compiler plugin test runtime classpath 2018-08-24 04:28:08 +05:00
Yan Zhulanow
834ece7d63 Debugger: Remove type checking in file ranking calculator
Type checking makes checking slower and less stable.
2018-08-24 04:28:07 +05:00
Yan Zhulanow
d0fd74982d Parcelize, Minor: Fix tests (writeToParcel/describeContents are not final anymore) 2018-08-24 04:28:06 +05:00
Yan Zhulanow
d08a32c7cb Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.
2018-08-24 04:28:05 +05:00
Yan Zhulanow
8c05769745 Parcelize: Fix infinite recursive loop for zero-parameter Parcelable classes (KT-25839) 2018-08-24 04:26:36 +05:00
Alexander Udalov
475a80b641 Do not write pre-release binaries for stable LV
This commit reverts f6571effcc and
reimplements the desired logic in another way.

In particular, we'd like these two conditions to hold:
1) only the release compiler with stable language settings (meaning,
   language version is a released version of Kotlin and no experimental
   features are enabled) should report errors when _reading_ pre-release
   binaries.
2) the compiler should _write_ pre-release binaries only if language
   settings are not stable, independent of whether the compiler itself
   is release or not.

From these conditions it follows that we must use different logic to
determine how to behave when reading/writing pre-release binaries.
Namely, reading (in CompilerDeserializationConfiguration) now checks if
both the compiler is release and the language settings are stable, and
writing (in LanguageVersionSettings.isPreRelease) checks only that the
language settings are stable
2018-08-23 23:11:30 +02:00
Vyacheslav Gerasimov
053a4b714c Refactor :kotlin-compiler project to allow project(":kotlin-compiler") dependencies 2018-08-23 21:55:26 +03:00
Mikhail Glukhikh
023b1b1880 Shorten quick-fix text of "Redundant async" #KT-25712 Fixed 2018-08-23 18:35:01 +03:00
Mikhail Glukhikh
3dc2c07b23 Simplify description of "Deferred result not used" #KT-25711 Fixed 2018-08-23 18:35:00 +03:00
Mikhail Glukhikh
b41ef6a807 Do not report "unused symbol" on experimental annotations
#KT-25609 Fixed
2018-08-23 18:34:59 +03:00
Mikhail Glukhikh
4113a6fd6a Extend fixes of experimental errors to property & type alias
#KT-25525 Fixed
#KT-25526 Fixed
2018-08-23 18:34:57 +03:00
Alexander Udalov
f6571effcc Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-23 16:50:48 +02:00
Anton Bannykh
4e496cf2b2 JS: don't throw AssertionError from RedundantCallElimination
Also mark JS `call` function to avoid removing a custom `call`
2018-08-23 14:44:40 +03:00
Roman Artemev
0895f72570 Fix testdata 2018-08-23 14:10:11 +03:00
Dmitry Petrov
34548a0667 Fix primitive override with inline class in Kotlin-Java inheritance 2018-08-23 13:07:07 +03:00
Ilya Chernikov
01eca8bac8 Clean up properties collection 2018-08-23 09:51:53 +03:00
Ilya Chernikov
c2e6c0ed49 Rename ScriptingEnvironment to ScriptingHostConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
2fe5f78921 Rename ScriptEvaluationEnvironment into ScriptEvaluationConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bb22dadc1e Rearrange compilation related API 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bd8f2a81e9 Rename ScriptDefinition to ScriptCompileConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
98c0a3bdaa Optimize script base class loading 2018-08-23 09:51:53 +03:00
Ilya Chernikov
d2195fc080 Fix default script definition 2018-08-23 09:51:53 +03:00
Ilya Chernikov
02431e4562 Fix build with proguard by removing unneeded library dep 2018-08-23 09:51:53 +03:00
Ilya Chernikov
da2b60ffa6 Fix discovery tests after refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
acb0f6c6a9 Remove ScriptCompileConfiguration as separate entity, refactor pieces accordingly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bda8089004 Fix asm annotations loading after annotations refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
2bf458d970 Drop unused files from removed project 2018-08-23 09:51:53 +03:00
Ilya Chernikov
ab63d59a56 Refactor definition keys 2018-08-23 09:51:53 +03:00
Ilya Chernikov
dbee426647 [minor] use java reflection in some places instead of kotlin one 2018-08-23 09:51:53 +03:00
Ilya Chernikov
1ea66e56c2 Fix annotations calculation in the bridge resolver 2018-08-23 09:51:53 +03:00
Ilya Chernikov
04ffe7754e Refactoring properties collection after review 2018-08-23 09:51:53 +03:00
Ilya Chernikov
74f8a541c0 Grand refactoring of the scripting DSL + many minor usability refactorings around it 2018-08-23 09:51:53 +03:00
Ilya Chernikov
45eaca1290 Add diagnostics chaining 2018-08-23 09:51:53 +03:00
Ilya Chernikov
3fb3aa5ad1 Setup props once, fix initialization problem 2018-08-23 09:51:53 +03:00
Ilya Chernikov
c41717d03b Make definition a part of the basic hosts, simplify usages 2018-08-23 09:51:53 +03:00
Ilya Chernikov
70ec004aaa Sorting default jvm props and basic implementations 2018-08-23 09:51:53 +03:00
Ilya Chernikov
fe2a11142e Renaming, commenting sample 2018-08-23 09:51:53 +03:00
Ilya Chernikov
3629583942 Add overridable method "setup" for defining properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
1de37ca765 Make KotlinScript annotation accepting all params needed to define a script 2018-08-23 09:51:53 +03:00
Ilya Chernikov
dafbd59707 Add shorter aliases for properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
df870b47b8 Add helpers for jvm dependencies from context 2018-08-23 09:51:53 +03:00
Ilya Chernikov
100b908a94 Add properties builders to the dsl, implement a builder for refineConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
e5e1b8d100 Improve generic DSL 2018-08-23 09:51:53 +03:00
Ilya Chernikov
7a621405ae Add generic properties builder dsl, convert maven example to it 2018-08-23 09:51:53 +03:00
Ilya Chernikov
d0ed86c11c Add REPL interfaces to scripting API 2018-08-23 09:51:53 +03:00
Ilya Chernikov
5ca4a21edf Convert evaluator interface to function 2018-08-23 09:51:53 +03:00
Ilya Chernikov
9b7eeebaaa Convert compiler interface to function 2018-08-23 09:51:53 +03:00
Ilya Chernikov
cf2162c445 Refactor properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
904917c194 Make script definition a property bag directly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
8953bba47c Pass scripting (host) environment independently from properties/configuration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
91e6c0b77c Remove evaluator from script definition, simplify interface 2018-08-23 09:51:53 +03:00
Ilya Chernikov
e61ba1fd70 Replace dedicated configurator with definition properties + refine fun 2018-08-23 09:51:53 +03:00
Ilya Chernikov
a54675abe7 Clean and fix new scripting API 2018-08-23 09:51:53 +03:00
Vyacheslav Gerasimov
f2a8e5c248 Log name of the class caused LinkageError in SyntheticResolveExtension
#EA-120641: Now it is unclear which extension caused AbstractMethodError
2018-08-22 18:10:50 +03:00
Ilmir Usmanov
483094cac8 Minor. Streamline SuspendFunction{N} interfaces creation 2018-08-22 16:21:33 +03:00
Ilmir Usmanov
0559cfb724 Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
2018-08-22 16:21:30 +03:00
Ilmir Usmanov
4a7703ed66 Implement correct is check for SuspendFunction
Let callable references implement SuspendFunction
Do not generate CHECKCAST SuspendFunction when LV is 1.2

 #KT-25825: Fixed
2018-08-22 16:21:27 +03:00
Nicolay Mitropolsky
9eb612a605 CreateCallableFromUsageFix always calls openInEditor to force proper editor and focus 2018-08-22 15:03:01 +03:00
Nicolay Mitropolsky
18db40474a KotlinElementActionsFactory uses createAddMethodActions to create properties 2018-08-22 15:03:01 +03:00
Dmitry Petrov
533f87ac33 Use proper KotlinType for prefix increment/decrement
Otherwise inline class values (such as UByte) are boxed incorrectly,
see KT-26219.
2018-08-22 12:24:50 +03:00
Toshiaki Kameyama
f1dc09f839 Add postfix template for the spread operator #KT-26249 Fixed 2018-08-22 10:56:39 +03:00
Alexey Tsvetkov
32d910320f Annotate KotlinNativeCompile#outputFile 2018-08-21 23:49:42 +03:00
Sergey Igushkin
ef85fe7ab2 Always apply the java-base plugin from the new MPP plugin
This fixes misconfigured test tasks and the `Usage` attribute
compatibility rule missing that is added by `java-base`.

Issue #KT-26301 Fixed
2018-08-21 22:54:50 +03:00
Sergey Igushkin
2040cdde4b Add missing Gradle task input path sensitivity
Fix after the commit 0f003802f
2018-08-21 22:54:49 +03:00
Anton Bannykh
04b04f919d JS: fix complex nested cross-module inlining (KT-26117 fixed) 2018-08-21 20:42:02 +03:00
Denis Zharkov
16a27d593c Optimize memory-footprint for RemoteLookupTrackerClient
Observations:
- In case of !requiresPosition we don't need to track position
- Also, in the latter case we don't need scopeKind (implicit contract)
- There were a lot of LookupInfo instances having two references
(fileName/scopeFqName) pointing to the same strings.
Looks like in common case (reasonable amount of files/fqnames) it's more
sensible to group lookups in the two-level-tree (implemented with nested maps)

It's expected to decrease memory consumption up to 15M in case of compiling
`idea` module in Kotlin project
2018-08-21 18:18:43 +03:00
Alexander Udalov
e41e28271b Use kotlinx-metadata-jvm of version 0.0.4 in kotlin-reflect build script
To prevent various problems with non-shaded artifact (shading was added
in 0.0.3)
2018-08-21 17:12:02 +02:00
Alexander Udalov
59e2101a25 Support reading binary metadata of the next major release
Already existing tests testRequireKotlinInNestedClassesAgainst14{,Js}
now check that there's no error when loading a module/class with
metadata version 1.4.0

 #KT-25972 Fixed
2018-08-21 17:12:02 +02:00
Alexander Udalov
852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Alexander Udalov
4f11812668 Report error instead of throwing exception in JvmPackagePartProvider 2018-08-21 17:12:02 +02:00
Sergey Igushkin
a71c66a82f Fix the SourceSet.projectDefault() extension adding sources to resources
The `include` calls were effectively made on the `resources`
`SourceDirectorySet`, which meant including '**' from 'src' as well.

Since the 'SourceDirectorySet' API is quite limited and does not support
specifying includes/excludes separately, configure the
`ProcessResources` task instead.
2018-08-21 18:05:52 +03:00
Sergey Igushkin
674e464230 Fix Kotlin source directories not added into the Java source set srcDirs
Before the new MPP, Kotlin source directories were added to the Java
source set's `allJava` and `allSource` by all of the Kotlin plugins,
including common and JS ones. As it turned out, this was required by the
IntelliJ Gradle import.

* Make all `KotlinSourceSetProcessor`s (not just JVM) check whether a
  compilation has a Java source set and add the Kotlin source
  directories to `allSource` and `allJava`

* Also disable the unclear resource `exclude` for the Java source set
  that filters Kotlin source directories out of the resources

Issue #KT-26020 Fixed
Issue #KT-26267 Fixed
2018-08-21 18:05:52 +03:00
Vyacheslav Gerasimov
f4eee4c2e4 as33: Restore gradle-java.xml 2018-08-21 17:38:58 +03:00
Zalim Bashorov
503fcd5cd3 [JS FE] Minor: cleanup JsExternalChecker.kt 2018-08-21 17:09:34 +03:00
Zalim Bashorov
589085369e [JS FE] Unify how the compiler checks parameters and return types for external declarations 2018-08-21 17:09:33 +03:00
Zalim Bashorov
9d0b880f67 [JS FE] Prohibit inline classes as parameter type and return type of external declarations
#KT-26171 Fixed
2018-08-21 17:09:33 +03:00
Zalim Bashorov
839bce5236 [JS FE] Prohibit external inline classes
#KT-26138 Fixed
2018-08-21 17:09:33 +03:00
Roman Elizarov
4fe2730f4a SuccessOrFailure.getOrDefault 2018-08-21 17:07:20 +03:00
Alexander Udalov
b6bf1604ea Regenerate tests 2018-08-21 15:54:04 +02:00
Vyacheslav Gerasimov
4bfa2a3957 as33: Add missing GooglePluginUpdateVerifier 2018-08-21 16:36:22 +03:00
Vitaliy Bibaev
4830c9a13d Fix broken tests compilation for AS and IDEA 173 after Sequence Debugger merging (#1820)
* Add dependency on stream debugger for tests in IDEA 173

* Fix compilation error for tests with IDEA 173

* Fix compilation issues with Android studio and sequence debugger tests
2018-08-21 16:23:45 +03:00
Alexey Sedunov
788606445e MPP: Support configurations with metadata 2018-08-21 15:35:43 +03:00
Alexey Sedunov
acbe299126 MPP: Support language settings in new model import 2018-08-21 15:35:42 +03:00
Alexey Sedunov
c45608a46e MPP: Restore non-Android content roots dropped by AS3.1 2018-08-21 15:35:42 +03:00
Alexey Sedunov
a5de065d7c MPP: Support Android platform in new model import 2018-08-21 15:35:42 +03:00
Alexey Sedunov
b983c93930 MPP: Add ImportedModule for non-Android source set modules
The goal is to work around model disposal service
which discards module data without ImportedModule instance
2018-08-21 15:35:42 +03:00
Alexey Sedunov
80102fc2bc Test Support: Check availability of test plugins in Gradle run configs
#KT-26228 Fixed
2018-08-21 15:35:42 +03:00
Alexander Udalov
3442c7385f Fix compilation in KotlinTestUtils for IDEA 173 2018-08-21 14:05:07 +02:00
Alexander Udalov
97c0f1712a Fix compilation in KotlinTestUtils for AS 3.1 & 3.2 2018-08-21 14:03:28 +02:00
Ilmir Usmanov
932b76a3f3 Minor. Unmute test 2018-08-21 14:13:19 +03:00
Alexander Udalov
f069686a14 Minor, use resolveSibling in getAbsolutePaths 2018-08-21 12:49:11 +02:00
Alexander Udalov
e56374908e Disallow using optional annotations outside common module sources
#KT-25196 Fixed
2018-08-21 12:49:10 +02:00
Alexander Udalov
0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Denis Zharkov
d35e73d29b Get rid of COROUTINE_SUSPENDED replacement in SuspendFunction wrappers 2018-08-21 13:46:01 +03:00
Denis Zharkov
ca39cc47c9 Support calling experimental coroutines API in JVM
The support is very limited, though

 #KT-25683 Fixed
2018-08-21 13:46:01 +03:00
Denis Zharkov
20c7a97bcd Make experimental/release COROUTINE_SUSPENDED reference the same instance
It's necessary when mixing experimental/release coroutines together

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Denis Zharkov
db34555800 Use package property COROUTINE_SUSPENDED instead of enum entry
For sake of encapsulation: actual property content might be
different from the entry
2018-08-21 13:44:02 +03:00
Denis Zharkov
944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Denis Zharkov
c94b72680a Minor. Extract InstructionAdapter::emitInlineMarker 2018-08-21 13:44:02 +03:00
Alexander Udalov
1c2a9e4b21 Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-08-21 12:38:05 +02:00
Alexander Udalov
b7808ba24d Pass JvmTarget to KotlinTypeMapper
Also use KotlinTypeMapper.RELEASE_COROUTINES_DEFAULT instead of false in
FileRankingCalculator
2018-08-21 12:23:07 +02:00
Stanislav Erokhin
f3e0470dcd Allow generic type parameter to have mixed constraints for @InlineOnly functions
#KT-19323 Fixed
2018-08-21 12:17:25 +03:00
Dmitry Petrov
7d4dfc87b1 Use proper KotlinType in get/set methods for property reference 2018-08-21 08:43:12 +03:00
Dmitry Petrov
6cd91e43bb Minor: reformat 2018-08-21 08:43:12 +03:00
Alexey Tsvetkov
272f9b8a10 Recompile all subclasses of changed classes
Previously inter-project IC recompiled only direct subclasses
of changed classes

    #KT-25455 fixed
2018-08-21 04:32:32 +03:00
Alexey Tsvetkov
73f7c2ef3c Use file trees in InspectClassesForMultiModuleIC
#KT-26208
2018-08-21 04:32:32 +03:00
Alexey Tsvetkov
41a47ea50f Minor: remove redundant default argument 'weakTesting = false' 2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
c9a62e078a Minor: remove GradleICReporter 2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
30f3622b27 Implement inter-project JS IC with Gradle
#KT-25025 fixed
2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
02af631e14 Minor: move tests for incremental compilation of Kotlin when Java changes 2018-08-21 03:53:57 +03:00
Alexey Tsvetkov
7ff7c71b96 Refactoring: extract function for getting classpath changes 2018-08-21 03:53:56 +03:00
Alexey Tsvetkov
aeaf1d6633 Refactoring: introduce DirtyFilesContainer for better code reuse in IC 2018-08-21 03:53:56 +03:00
Alexey Tsvetkov
638c1eadff Avoid rebuild when '--verbose' is used in Gradle
#KT-23472 fixed
2018-08-20 23:41:11 +03:00
Alexey Tsvetkov
d09629972a Use same system property to avoid deleting module file in JPS and Gradle 2018-08-20 23:41:11 +03:00
Ilmir Usmanov
d3dbcae7a4 Get rid of typed create and invoke wherever possible
in coroutine lambdas.
 #KT-26243 Fixed
2018-08-20 21:33:24 +03:00
Mikhail Glukhikh
3bdf38e6b2 Refactoring: HasExpectedMarker (use not-null declarations) 2018-08-20 18:42:31 +03:00
Mikhail Glukhikh
8ef2c479e4 Refactoring: HasActualMarker (use not-null declarations) 2018-08-20 18:42:17 +03:00
Mikhail Glukhikh
9b29651371 Has actual (new MPP): handle possible actual in "common" module
Before this commit, we assumed all actual declarations are
in platform modules, and each platform has no more than one actual.
In new MPP, actual declarations can be also in common code,
and each platform as well as common code can include
more than one actual declarations for given expected.

#KT-26217 Fixed
2018-08-20 18:41:32 +03:00
Mikhail Glukhikh
18d43a2fce MPP wizard [web]: do not add Java to JVM module by default
This removes controversial behaviour during Gradle import,
now strange 'main' / 'test' source sets aren't added
2018-08-20 18:41:29 +03:00
Mikhail Glukhikh
41507a4deb MPP wizard [web]: add kotlin-test as dependency to all source sets
#KT-26239 Fixed
2018-08-20 18:41:28 +03:00
Dmitry Petrov
b5f37d18b2 Fix inlining of functions with matching JVM signatures in same package
When two functions with matching JVM signatures in the same package
were inlined sequentially, inliner could take a wrong method body from
the cache due to MethodId clash. This manifested with inline classes,
but also was possible with some legal Kotlin overloads with matching
erasure.

Use internal name of the corresponding implementation owner class
instead of FQN of the containing declaration. Such MethodIds can't match
accidentally, because corresponding JVM method signatures would clash.
2018-08-20 14:12:34 +03:00
Mikhail Glukhikh
f9bba3ca86 Reformat & cleanup: kotlinSpacingRules 2018-08-20 13:21:28 +03:00
Mikhail Glukhikh
4fd8d3b480 Add formatting rule "new line between { and when entry" 2018-08-20 13:21:22 +03:00
Mikhail Glukhikh
ef094e78e3 Add when branches (minor): 'with import' -> 'with * import'
Change name of quick-fix to more descriptive one
2018-08-20 13:21:18 +03:00
Mikhail Glukhikh
b031e34f8d Add when branches: include auto-import
Before this commit, enum / sealed class to add was not imported so
user had to import them himself. Now everything is auto-imported.
Separate "add with import" is kept but * import is now in mind there.
#KT-22330 Fixed
#KT-22354 Fixed
EA-108090 Fixed
2018-08-20 13:21:17 +03:00
Mikhail Glukhikh
f3972bfdfe Ignore potential KNPE in "import all members" (see KT-22354) 2018-08-20 13:21:15 +03:00
Svyatoslav Kuzmich
7578dbf8f2 [JS BE] KT-22053 Fix constructor delegation of immediate subtype of Error 2018-08-20 12:08:30 +03:00
Dmitry Petrov
5045fa446a Prohibit recursive inline classes 2018-08-20 10:08:10 +03:00
Vitaliy.Bibaev
4f722dd32d Use heuristics for termination calls for java/streamex as well 2018-08-20 05:18:04 +03:00
Vitaliy.Bibaev
1f9004e1ae Minor: rename 'receiver' -> 'receiverValue' 2018-08-20 05:18:04 +03:00
Vitaliy.Bibaev
e1acd2e2c5 Use heuristics with call name to avoid redundant types resolve 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
9b24600b0f Minor: rename KotlinTypes -> KotlinSequenceTypes 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
0ba506c1ec Use partial resolve 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
3bc7944e0c Remove commented code 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
320cb18746 Remove dependency on stream-debugger plugin from 'idea' project 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
5779eacb23 Use KotlinBuiltIns.FQ_NAMES for type names 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
e158c9191c Mention sequence debugger for 181 and 183 IDEA 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
db5e6e1ddc Minor: remove redundant field 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
57ac7e0fb9 Remove @author JavaDoc from all my files 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
55055ce3aa Remove redundant LibraryUtil.kt 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
c1ebc2788d Minor fixes after inspecting code-style 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
2d22267cf1 Apply project code style settings to sequence debugger code 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
245a358ea8 Remove unused code 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
1986309a07 Set up KotlinPsiChainBuilderTestCase for current environment 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
c2c09e2ac3 Remove stream ex test to avoid undesirable dependency on streamex lib 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
4eb06fb11c Use qualified names of test classes 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
490f7bc3d7 Do not generate test cases for ignored tests 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
568a664491 Move test classes into 'streams' package in the tiny app 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
1a78058cf4 Remove unused OutputChecker 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
6db36e7c62 Remove unused code 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
d4795c0e5d Add generated tests for collections/java streams 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
cf2c2ed802 Move sequence test data into 'debugger/tinyApp/src/streams/sequence' 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
db6894f145 Add abstract test cases for collection\java streams tests 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
75e5cfca82 Do not use deprecated API 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
c4a1e32f3d Add 'stream-debugger' plugin as a test dependency 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
44b736e846 Generate tests be test data for sequence traces 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
c0c344210a Enable back dsl test 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
895e78d180 Move test data to tinyApp directory 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
ac4c42cc4b Add extensions to support sequences debugging 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
aa34d84487 Move files to the correct packages 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
f90b33424a Add java stream debugger as a dependency 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
0fab9e5fa7 Move sequence debugger tests to idea/tests/debugger/sequence directory 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
6dda5b0397 Move sequence debugger src to a debugger/sequence directory 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
fbc2a5d9a7 EA-114349 Fix bug when trace collecting for large int values throws NPE 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
7cd1baff9d Fix bug when chain is not detected if method expression is used 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
da731b9bae Do not set redundant space in string representation of lambdas 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
89abcb82e4 Support distinctBy intermediate call 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
0cc5e924a7 Fix bug then Map.contains is not an expression 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bfced7dd1e Support filterIsInstance with generic parameter 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
e9d8398573 Minor: update test data 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
914a631322 Add tests & test data for all terminal operations 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bf82cd9b40 Fix test dsl/mapComputeIfAbsent 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bde34b45e7 Add 'asSequence' operation support 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
64dec10bd5 Avoid redundant allocation on each collection chain transformation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
ac19f30ed3 Disable distinctBy operation support (will be fixed in the platform) 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
8f807f441b Add two more tests for windowed operation support 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
449fa8f3ec Support 'windowed' intermediate call 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
cc549d3ae5 Support chunked operation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
85d83309ae Support mapNotNull intermediate operation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
eaee6697f2 Make zipWithNext work & add test 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
d8bc73367f Add tests for misc operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
53209eaeec Add tests for appending values to sequence operation 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
d30a3b2495 Add tests for distinct operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
113bb9ca46 Use computeIsAbsent instead of getOrPut in generated expression 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
fd17d9959a Add tests for sorting operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
3114691a02 Remove redundant copyright header in test data 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
42aba80eb7 Add tests for flat-mapping operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
a4e72067a9 Add tests outputs for mapping operation tests 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
da5cbeb92b Drop mapNotNull operation support 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
b31db50ba1 Add tests for mapping operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
5383ec50d2 Add tests on filtering operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
22c455a01e Add base test case for the sequence execution tests 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
a1525ca022 Add support for some intermediate operations if possible 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
c1cf159beb Minor: fix Sequence package name 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
9d69b701c1 Add tests for type inference for items in the chain 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
b7e99a75ad Use index by array name instead of elements name in KotlinTypes 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
43614a1dfe Fix bug when generics are erased in trace expression 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
5f9481b273 Implement SequenceTypeExtractor 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
6b83e2f49f Move utility methods for primitive types into KotlinTypes 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
b9ae33b068 Simplify CallTypeExtractor implementations 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
f98d50265b Implement SequenceCallChecker 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
98d698290e Move a workaround for collections into CollectionChainTransformer 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
50d30f3d8b Use TerminatedChainBuilder for both java stream & sequences 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
416b15e42b Minor: move KotlinJavaStreamChainBuilder to the 'impl' package 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
7f57730c45 Move classes into packages java/sequence/collections where needed 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
7d903b43a1 Add library support extension for kotlin sequence support 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
c69e0c0d01 Update test data 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
8a026fd9cd Ignore kotlin collections execution tests 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
6cc797ad31 Update copyright header for new files 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
6433592618 Minor: move file CallUtils.kt to the upper level 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
14ef19418b Add tests on different types of chain source 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
0d2c5c4d65 Minor: add todo 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
7c417a59dc Fix bug when onEach extension call is not found for arrays 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
aa7f1073e6 Add tests outputs for collection execution tests 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
e3d651ec09 Add tests for filter operation 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
adb36d53fe Fix bug when chain result type inferred incorrectly 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
c5ede40262 Recognize CharSequence and Arrays as iterable too 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
338e06ff21 Minor: fix bug in tests/test data 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
91348e3b2a Fix typo in test data 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
ddda26c3da Implement chain type extractor for kotlin collection chains 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
3b6b6d5770 Fix typos in tests 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
cd17f59e21 Implement elements type extractor for java streams 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
5a02f37d1f Fix bug when string representation of flexible kt type was wrong 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
8900411fb1 Add util function to extract type name without generic parameters 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
b817fd111e Extract KotlinType -> String function to utils 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
4969de404e Add additional classes and interfaces to infer types of chain items 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
d14cc77003 Add tests for types in chains of collection transformation calls 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
25024ff9a0 Add all primitive types to KotlinTypes.kt 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
6b6ccc45f0 Add tests on types of items in java chain operations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
16768bd9e3 Add and use NULLABLE_ANY type into KotlinTypes.kt 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
0d7e9d698e Minor: fix formatting in KotlinTypes.kt 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
502cb1e456 Add test cases to check types of chain operations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
e61fbb16c5 Resolve types of arguments 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
86ec8eab6e Support filter and filterNotOperations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
6be340f079 Use getValue method to receive value by key in map variable 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
872cb225f0 Specify all types as nullable (temporary solution) 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
be69362f7d Minor: refactoring 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
4517d3a3d0 Support primitive boolean arrays 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
3acb4285ea Minor: add missed paren 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
523bdb0d54 Reserve unique time for mapped value in filter handler 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
a88719ff08 Minor: rename BothSemanticCallWrapper -> BothSemanticHandlerWrapper 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
246f79ab86 Implement handler for filter call for kotlin collections 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
3b14ed9ae8 Refactoring: updated methods signatures 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
8d9e348424 Implement proxy classes for collection handlers 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
8fc64490ca Add abstractions to implement handlers for kotlin collections 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
cd4577ea78 Add stubs for filter operations 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
385a82567f Minor: fix formatting issues 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
12fe36b77f Add ability to specify a custom way to create peek call 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
5ab76d1eed Add tests for chain building for kotlin collections 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
dd05a9b11b Add kotlin stdlib to psi tests 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
5502d62471 Minor: rename LibraryManager -> LibraryUtil 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
e15f3624cf Implement chain builder for kotlin collections 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
ad1a91a6c8 Add extension for kotlin collections support 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
871dc4253f Minor: fix code style in NegativeJavaStreamTest and group tests 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
67d7f77f66 Minor: add checks in tests that no built chains 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
70f4933d5b Add tests to check that chain is not build in some hard cases 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
6ce6301613 Fix bug when chain was not found from nested lambda or anonymous 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
bb90c5ad08 Add tests for java stream chain building 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
ac956a46df Fix minor chain building bug in kotlin 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
4573069a8d Add setUp & tearDown for kotlin tests 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
055b0eed97 Fix wrong testdata 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
bc7d30bd99 Fix bug when stream chain lose terminator call arguments 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
4cb8cc3653 Fix bug when chain in the upper level is not found 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
56a783b858 Fix bug when chain detection did not work 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
295d340d7c Add standard stream chain builder tests 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
b916fc6ca2 Add simplest execution tests for support of kotlin collection 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
4552504315 Minor: rename base trace evaluation test case 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
07cc21200a Do not add a blank line after copyright header 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
9bc08da6c6 Update copyright headers in test sources 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
a630390781 Update copyright header in source code files 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
25b174b8f7 Minor: optimize imports 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
2aef583aa7 Add support for tests with debugger 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
b916f9e8e6 Support psi tests for streamex library 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
8d9b021ef2 Support psi tests for standard stream api 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
310bcc48a5 Add psi tests with the simplest test data 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
5fe0f167ca Simplify checks that stream chain exists 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
6d395dffbb Move stream call checks into separate class 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
64f399235e Add tests for kotlin language support in the expressions dsl 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
8185354116 Add streamex support 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
3a2370a2d6 Minor: add a forgotten file 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
ea3206bba4 Minor: fix compatible issue 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev
2c57853dbe Add an extension point to support standard library in kotlin 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev
957f9a7e14 Add source files 2018-08-20 05:17:42 +03:00
Nikolay Krasko
8f566132e4 Workaround for IndexNotReadyException from icon provider (EA-118965)
Provider is DumbAware and isn't expected to access indexes.
2018-08-19 17:44:42 +03:00
ilmat192
2251440f04 Basic native support in kotlin-multiplatform (#1811)
* Add dependency on KN shared in gradle-plugin

* Basic support for Kotlin/Native:
     * Target presets
     * Compilation into a klib
     * Compilation into native binraies: framework and executable
     * Basic dependencies between projects
     * No jars in native publications
     * Replace '-' with '_' in framework names
    * Escape quotes in native command lines on Windows
* Move targets from Kotlin/Native repo
* Download KN compiler using Gradle's mechanisms
* Support source set dependencies in native
2018-08-19 20:45:31 +07:00
Zalim Bashorov
8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Zalim Bashorov
c61d99fcff [JS IR BE] don't initialize instance storage for singletons explicitly, use default value (undefined) instead
It allows accessing to a singleton independent to the state of its storage.
2018-08-17 21:43:33 +03:00
Zalim Bashorov
0f6a77e700 [JS IR BE] take into account receiver's type when generate name for callables (including properties)
Also, add special markers for receiver type and generic types to avoid accidental clashes.
2018-08-17 20:31:06 +03:00
Mikhail Glukhikh
b9d6580b44 Introduce MPP wizard for web (JVM / JS) applications
This implements first part of KT-25952
2018-08-17 18:16:34 +03:00
Mikhail Glukhikh
b10554a8a0 Make old MPP wizard deprecated 2018-08-17 18:16:11 +03:00
Mikhail Glukhikh
57153cc2fc Make code in IntroduceIndexMatcher safer
EA-101119 Fixed
2018-08-17 18:16:10 +03:00
Mikhail Glukhikh
d67dea4619 Reformat & cleanup: CreateCallableFromCallActionFactory 2018-08-17 18:16:08 +03:00
Mikhail Glukhikh
9a9e703e80 Do not suggest "create abstract property" inside annotation 2018-08-17 18:16:07 +03:00
Mikhail Glukhikh
04675b4446 Do not suggest "create local variable" inside primary constructor
#KT-26158 Fixed
EA-99300 Fixed
2018-08-17 18:15:47 +03:00
Mikhail Glukhikh
34be9ccbbe Reformat: CreateLocalVariableActionFactory 2018-08-17 18:15:44 +03:00
Sergey Igushkin
b125f1e23e Revert "Fix source set resources filtering broken by refactoring"
This reverts commit 6af6834
2018-08-17 17:54:43 +03:00
Alexander Udalov
92e7fe347a Minor, provide more info when deserializing bad constant value 2018-08-17 16:31:54 +02:00
Ilmir Usmanov
2ecea55cb1 Ignore coroutines and assertion tests in android tests generator
for now.
2018-08-17 16:17:19 +03:00
Ilmir Usmanov
dcfdc781db Minor. Unmute test in JS BE 2018-08-17 16:14:28 +03:00
Anton Bannykh
8e5b2fe657 JS: create appropriate nameBinding's upon inlining
Otherwise JsName's don't get linked properly upon deserialization.
As a result a function/constructor doesn't get renamed at
call site during the name conflict resolution phase.
2018-08-17 15:27:00 +03:00
Alexey Tsvetkov
3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Sergey Igushkin
1a3dd67176 Enable metadata publishing for new MPP and consumption from source sets
* Add configurations for consuming source sets metadata (extending the
  source set's dependency configurations). These configurations will be
  used by the IDE to pick up the dependencies metadata.

* Remove the universal preset from the default presets, create a
  metadata target by default for compiling and publishing the metadata
  of `commonMain` (in the future, we will publish and consume the
  metadata of the other source sets as well).

* Make the classpath configurations of common modules consume the
  metadata and thus ensure compatibility of 1.2.x MPP with the new MPP
  model.
2018-08-17 15:12:44 +03:00
Vyacheslav Gerasimov
add323a486 as33: Remove incorrect gradle.xml.as33 2018-08-17 14:39:03 +03:00
Ilya Chernikov
2a4cef3ac2 Avoid "Failed to initialize native filesystem for Windows" warning from the platform on script compilation 2018-08-17 09:49:46 +02:00
Jonathan Lermitage
66bb744e3c Update Maven central repository url to latest version 2018-08-17 09:46:07 +02:00
Sergey Igushkin
6af6834966 (minor) Fix source set resources filtering broken by refactoring
Before the last change in this logic, the resources filtering used
the original Kotlin source directories, not those with Java filtered
out.

Make sure that the Java source directories that are added to the Kotlin
source set are excluded from the resources, and all the related
configuration works lazily, i.e. supports source sets modification
after configuration took place.
2018-08-17 03:22:30 +03:00
Sergey Igushkin
d1a5794d36 (minor) Move source set configuration creation
It was placed in the new MPP plugin and was therefore not used for
the 'KotlinSourceSet's with the old plugin. Move this logic to the
KotlinSourceSetFactory so that it is applied to all source sets
2018-08-17 03:18:32 +03:00
Pavel V. Talanov
42f39a3ea4 Use older utility to fix compilation for as31 and 173 branches 2018-08-16 16:33:49 +02:00
Ilya Chernikov
ac65aebb19 Direct mapping of script implicit receivers and env vars to parameters 2018-08-16 15:13:00 +02:00
Ilya Chernikov
e1ee31b4ce Use linked hashmap in properties dsl - preserving order 2018-08-16 15:13:00 +02:00
Alexander Udalov
ddb398645b Reformat modules 'metadata' and 'metadata.jvm', fix some inspections 2018-08-16 15:08:18 +02:00
Alexander Udalov
3345dc81fd Do not return field signature if there's none in the metadata
Otherwise this code behaves incorrectly on getter-only properties: it
returns a meaningless field signature whereas the property has no field.
It's hard to come up with an example of when this could matter in
compiler code, but it's very noticeable in kotlinx-metadata-jvm

 #KT-26188 Fixed
2018-08-16 15:05:19 +02:00
Alexander Udalov
3f32e1cce9 Do not serialize empty property signature to JVM metadata
This should have no effect on the correct code currently because all
properties have at least a getter, but may help in debugging problems
with serialized metadata for properties
2018-08-16 14:11:09 +02:00
Alexander Udalov
bba25042b6 Fix generation of metadata for const val field in multi-file class
Metadata for declarations in multi-file classes is always written to the
corresponding parts, but fields for public const vals are generated into
the facade class.

Before this change, we ran generateBackingField only to generate the
const val field in the facade (because isBackingFieldOwner is true only
for the facade). Besides generating the actual field,
generateBackingField also stores the mapping to the FIELD_FOR_PROPERTY
slice, which is used later in the serializer to serialize the correct
JVM signature of the field to the metadata. However, the mapping was
stored to the incorrect binding map! Namely, the map from the same
ClassBuilder that is used to generate the class, and that is the facade
class builder. But the metadata needs to be generated to the part class,
not the facade.

Surprisingly, there is a test at
reflection/multifileClasses/javaFieldForVarAndConstVal.kt that checks
that kotlin-reflect is able to load the field signature of a const val
in a multi-file class, which is the main use case of this information,
and it passed before this change. The reason the test passed is that
KPropertyImpl.javaField uses JvmProtoBufUtil.getJvmFieldSignature which
mistakenly treats the absence of the field signature in the proto as the
hint that it may be computed naively (just the property's name + naively
mapped type), whereas in fact the field signature was missing
completely. (The fact that absence of a message may mean two things is
certainly a shortcoming of the metadata format and should be revisited
in the future.) This never led to any problem in the real world because
it's easy to prove that the field signature of a const val can always be
computed naively.

After this change, we now run generateBackingField twice: for the
facade's class builder, and for the part's class builder. The actual
field is only generated in the former case. But the mapping computed in
the latter case is used correctly in JvmSerializerExtension to store the
field signature to metadata. Also refactor
generateSyntheticMethodIfNeeded in the similar way, to reduce the number
of `if`s.
2018-08-16 14:11:09 +02:00
Alexander Udalov
b9594988ea Do not read property getter/setter signature if it's empty
This has no effect on the correct code currently, but will help in
debugging when changing the serialized metadata for properties.

For example, if after some change an empty propertySignature extension
is written for Property (it's possible for PropertyDescriptor without
getter or setter and without backing field), we now won't try to read a
missing getter message when loading annotations on property getter. In
protobuf, reading a missing message will result not in an exception, but
in a "default" message being returned, which makes no sense in our case
because it would simply be read as a getter signature with both "name"
and "desc" equal to 0 (i.e. the first entry in the string table)
2018-08-16 14:11:09 +02:00
Dmitry Petrov
b6e3218ca2 Use mapping mode for inline class underlying type without wrapping 2018-08-16 15:03:50 +03:00
Dmitry Petrov
06ef8824b6 Minor: reformat 2018-08-16 15:03:50 +03:00
Pavel V. Talanov
5ad8405893 Tweak test data so MultiFileHighlighting does not fail
Actually this test has to be reviewed
Current failures are caused by change in platform API
2018-08-16 14:03:01 +02:00
Pavel V. Talanov
8e470c7c4c Fix test data
Order of members returned by platform changed
Fix test files so test result would not depends on this order
2018-08-16 14:03:01 +02:00
Pavel V. Talanov
b59f134f78 Fix completing members for receivers shadowed by DslMarker
#KT-20396 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov
0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov
51681d57c8 Minor: toString() for CompoundWeight to improve test results readability 2018-08-16 13:59:38 +02:00
Pavel V. Talanov
b51c021f56 Dsl completion: assign high priority for dsl elements that are members 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
af2a6a5096 Support dsl highlighting for object references 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
f80b85c282 Minor, refactor TypeKindHighlightingVisitor 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
3d91d4b865 Minor: expand dsl highlighting test cases to cover member functions 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
e9a9f2a1aa Dsl highlighting: support highlighting properties
Fix properties not being highlighted
Fix test infrastructure to verify actual output of highlighting visitors
2018-08-16 13:59:37 +02:00
Pavel V. Talanov
c250f7fca4 Add debug information on any of ResolutionFacade API failures 2018-08-16 13:56:28 +02:00
Sergey Rostov
f09364e654 Kotlin facet UI, JS: Hide "Enable incremental compilation (experimental)".
This option is project-wide only, so it should be visible only in project settings.
#KT-26095 Fixed.
2018-08-16 10:51:36 +03:00
Ilya Gorbunov
ebc64da52a Update EXPECTED_REACHABLE_NODES after introducing top-level comparator
#KT-18067
2018-08-15 21:28:57 +03:00
Ilya Gorbunov
ed53983e1e Add support for CASE_INSENSITIVE_ORDER in JS and common
#KT-18067
2018-08-15 21:28:54 +03:00
Ilya Gorbunov
6866f5d19a Move test and cover more cases of string comparison
#KT-18067
2018-08-15 21:28:50 +03:00
Ilya Gorbunov
27dde5f730 String.compareTo: SinceKotlin in JS and common, restore default parameter value in JVM
Default parameter is required to generate docs with Dokka for now.

#KT-18067
2018-08-15 21:28:47 +03:00
Toshiaki Kameyama
f05a19aafb JS stdlib: implement String.compareTo with ignoreCase
#KT-18067 Fixed
2018-08-15 21:28:44 +03:00
Alexey Sedunov
d194893012 MPP: Add production module dependencies to the test one (new MPP import)
#KT-25985 In Progress
2018-08-15 18:21:53 +03:00
Alexey Sedunov
443f8b6f02 Minor: Fix test data 2018-08-15 18:21:53 +03:00
Svyatoslav Kuzmich
f5a80a30f7 Mute and unmute tests 2018-08-15 18:20:07 +03:00
Sergey Igushkin
d13ca38296 Relax some restrictions on Gradle dependency configurations in new MPP
* Set canBeConsumed = false only on those configurations that have this
  flag according to the Gradle Java plugins. This saves us from breaking
  existing build scripts but introduces ambiguity between consumable
  configurations (e.g. between `apiElements`, `compile`, `runtime`). See
  the solution in the next point.

* Don't set the Kotlin platform attribute on configurations that are
  not meant for consuming in other projects or resolving directly. This
  change hides these configurations from Gradle's variant aware
  dependency resolution and therefore prevents ambiguity

(cherry-picked from 81f2c48f)
2018-08-15 17:48:44 +03:00
Georgy Bronnikov
00da193167 Introduce IrDeclarationWithVisibility 2018-08-15 16:56:16 +03:00
Dmitry Petrov
8e95ecb821 Use underlying type when computing type mapping mode for inline classes 2018-08-15 15:37:46 +03:00
Dmitry Petrov
948e72f653 Inline classes can only implement interfaces 2018-08-15 15:32:50 +03:00
Ilmir Usmanov
1c098bf5cf Minor. Fix test 2018-08-15 14:23:33 +03:00
Ilmir Usmanov
b4189d9e85 Minor. Use more granular assertion levels in assertion tests 2018-08-15 14:23:30 +03:00
Mikhael Bogdanov
1a1bb53381 Update IR text test
Additional implicit coercions to unit was added
2018-08-15 14:18:15 +03:00
Ilmir Usmanov
300876348a Fix line numbers generation for coerced primitives
in coroutines
 #KT-25076: Fixed
2018-08-15 13:47:45 +03:00
Ilmir Usmanov
a470fd21ca Eliminate only first {ASTORE, ALOAD} in locals elimination
of ALOAD.
 #KT-25912: Fixed.
2018-08-15 13:45:24 +03:00
Svyatoslav Kuzmich
ff70b837ee [JS IR BE] Support local delegated properties 2018-08-15 13:35:14 +03:00
Svyatoslav Kuzmich
392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Mikhail Glukhikh
1471fe08d7 Minor rename in if-then utils 2018-08-15 12:36:01 +03:00
Mikhail Glukhikh
5b77def0e0 "if-then to safe access": treat transformation to 'let' as intention
Related to KT-7675
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
f5cfec4a91 "if-then to safe access" inspection: support call expression -> let
#KT-7675 Fixed
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
2dcbf6aa34 Introduce "Redundant return label" inspection #KT-25270 Fixed 2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
b91f30ab15 Suspicious callable reference: no quick fix with invalid reference type
#KT-23467 Fixed
2018-08-15 12:36:00 +03:00
Leonid Startsev
0ac969a617 Attempt to make loading of compiler plugins from kotlin-platform-native Gradle plugin
Moved SubpluginEnviroment to separate file and made public some methods
KotlinNativeCompile task now extends AbstractCompile so it could be passed to SubpluginEnviroment.loadSubplugins
KotlinNativeBasePlugin now declares kotlinCompilerPluginClasspath configuration
2018-08-15 12:19:04 +03:00
Mikhael Bogdanov
494828f4cf Unmute jvm ir-tests 2018-08-15 10:26:28 +03:00
Mikhael Bogdanov
6d915bd68c Use original descriptors on implicit coercion to unit generation 2018-08-15 10:26:03 +03:00
victor.petukhov
e01e832acd Add gradle task to print spec tests statistic by spec sections 2018-08-14 17:34:38 +03:00
victor.petukhov
93874de89b Add 'specTest' gradle task to run spec tests 2018-08-14 17:34:27 +03:00
victor.petukhov
bed4c5f2f0 Add diagnostic spec tests for 'When expression' section 2018-08-14 17:34:15 +03:00
victor.petukhov
90f22d47b6 Fix incorrect severity for some diagnostics of DebugInfoDiagnosticFactory 2018-08-14 17:34:04 +03:00
victor.petukhov
0a58898817 Add diagnostic spec tests generator and validator, helper functions and classes 2018-08-14 17:33:54 +03:00
victor.petukhov
e989cf2bf4 Add tests-spec module with basic gradle configuration 2018-08-14 17:33:41 +03:00
Alexey Tsvetkov
b6575b0c57 Do not turn off IC in gradle.properties
It is turned off for teamcity in build.gradle.kts
2018-08-14 16:30:23 +03:00
Toshiaki Kameyama
08cfe1acfd "Convert lambda to reference": fix false positive for vararg function
#KT-16422 Fixed
2018-08-14 15:48:37 +03:00
Toshiaki Kameyama
28aa0763a9 "Convert to run / with": don't suggest on java static method call
#KT-25739 Fixed
2018-08-14 15:40:46 +03:00
Toshiaki Kameyama
0a5aa2b60c "Convert lambda to reference": fix case with extension 'this'
#KT-21999 Fixed
2018-08-14 15:39:26 +03:00
Toshiaki Kameyama
2bf3b435f2 Redundant semicolon: fix false positive between modifier and declaration
#KT-25579 Fixed
2018-08-14 15:32:26 +03:00
Toshiaki Kameyama
1898df3fb7 Introduce "Convert property getter to initializer" intention
#KT-13854 Fixed
2018-08-14 15:32:20 +03:00
Toshiaki Kameyama
6fbf6b0a93 "Let type implement interface": don't suggest same type #KT-25928 Fixed 2018-08-14 15:32:17 +03:00
Toshiaki Kameyama
2d2f1125a9 "Remove redundant let": fix destructuring declaration false positive
#KT-26042 Fixed
2018-08-14 15:32:10 +03:00
Toshiaki Kameyama
7e8521d9dc Remove redundant let in "Safe access to if-then" #KT-13515 Fixed 2018-08-14 14:11:15 +03:00
kenji tomita
443b1834bc Add "Replace assertBoolean() with assertEquals() inspection"
#KT-23445 Fixed
2018-08-14 14:11:14 +03:00
Nicolay Mitropolsky
e92d3998de KotlinLanguageInjectionSupport: remove calling replaceInjectionsWithUndo on removing of in-place injection 2018-08-14 13:10:38 +03:00
Nicolay Mitropolsky
cd047b9605 Uast: KotlinUAnnotation.uastAnchor uses nameReferenceElement as javaPsi
because `nameReferenceElement` is not-null in LightAnnotations, but `referenceNameElement` violates `javaPsi` contract
2018-08-14 13:08:38 +03:00
Vyacheslav Gerasimov
9a441b9c8d Make DocumentAdapter.documentChanged overrides compatible with 183 platform 2018-08-14 12:48:26 +03:00
Denis Zharkov
9f3a902ff3 Take into account refined applicability of dsl-marker in IDE
After the previous change, when being applied to a function type
with receiver it's assumed to work just as it's applied to receiver type

Thus, it's necessary to fix relevant IDE features relied on DSL markers

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Denis Zharkov
117abb04aa Fix applicability of dsl-marker on function type
When marker is applied to function type it should work
like it's applied to receiver type

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Denis Zharkov
99fe6de52a Avoid storing ContractProviderKey in user data of every function
Whenever the key is absent it means that for some reason
contract can't be defined there.

But we still want to check them properly, thus checkContractAndRecordIfPresent
should work even if contract is inapplicable here
(no ContractProviderKey in owner's user data)
2018-08-14 15:58:18 +07:00
Georgy Bronnikov
1f7776981d Introduce correspondingProperty to IrField 2018-08-14 10:36:56 +03:00
Dmitry Petrov
ebf8ec455d Box/unbox nullable inline class values with null check
When we have a nullable inline class value with non-null underlying
type, corresponding value in unboxed representation is nullable. E.g.:

  inline class Str(val value: String)

  fun test(s: Str?) = listOf(s)

Here 'test(s: Str?)' accepts nullable 'java.lang.String' as a parameter.

When boxing/unboxing nullable values of such inline classes, take care
of nulls.

 #KT-26052 Fixed Target versions 1.3-M2
2018-08-14 10:22:07 +03:00
Dmitry Petrov
56ad091534 Generate synthetic inline class methods in psi2ir 2018-08-14 10:00:21 +03:00
Dmitry Petrov
de11d9164d Add IrClass.irInline 2018-08-14 10:00:21 +03:00
Nicolay Mitropolsky
9db2b6ffba KtLightPsiJavaCodeReferenceElement reference getting made lazy (KT-26036, EA-125884)
Collecting references from contributors could be expensive and even recursive (EA-125884)
2018-08-13 19:26:07 +03:00
Nicolay Mitropolsky
2ba2d360c2 KtLightPsiJavaCodeReferenceElement delegate made nullable (KT-26036, EA-124029) 2018-08-13 19:26:06 +03:00
Mikhail Glukhikh
84c035c763 For each parameter not used: use same context scope everywhere 2018-08-13 19:03:38 +03:00
Mikhail Glukhikh
bc102bf0c6 MPP new model: temporarily solution for commonTest type identification
Now if source set is not included into any compilation target,
then it is counted as test source set iff "Test" is in name
So #KT-26076 Fixed
2018-08-13 19:03:36 +03:00
Mikhail Glukhikh
a7b51070a7 MPP: find modules for expect / actual: filter non-new MPP modules 2018-08-13 19:03:35 +03:00
Alexey Sedunov
36da80bdf5 MPP: Use only explicitly specified source set dependencies
#KT-25985 Fixed
2018-08-13 19:03:06 +03:00
Alexey Sedunov
543934762e MPP: Implement transitive import of dependencies between source sets 2018-08-13 19:03:05 +03:00
Alexey Sedunov
49b5695664 MPP: Use new MPP model to find modules for 'expect'/'actual'
#KT-25955 Fixed
2018-08-13 19:03:03 +03:00
Mikhail Glukhikh
88ac04001d For each parameter unused: minor optimization / simplification
Related to KT-22068
2018-08-13 19:03:02 +03:00
Mikhail Glukhikh
911f16845e For each parameter unused: add quick-fix "introduce anonymous parameter"
Related to KT-22068
2018-08-13 19:03:01 +03:00
Mikhail Glukhikh
af17a4e961 For each parameter unused: do not report with explicit parameter
In this case we are duplicating compiler warning.
Related to KT-22068
2018-08-13 19:03:00 +03:00
Mikhail Glukhikh
6048647812 For each parameter unused: support correctly it() case
Related to KT-22068
2018-08-13 19:02:58 +03:00
Mikhail Glukhikh
0757533558 "ForEach parameter unused": minor simplification
Related to KT-22068
2018-08-13 19:02:57 +03:00
Dennis Cornwell
f3b0378918 "ForEach parameter unused": don't report destructured parameters
Related to KT-22068
2018-08-13 19:02:56 +03:00
Mikhail Glukhikh
c0c00c8c4e Downgrade "forEach parameter unused" to WEAK WARNING
Related to KT-22068
2018-08-13 19:02:55 +03:00
Dennis Cornwell
e81eee4cc1 Introduce inspection for determining if a forEach parameter is unused
#KT-22068 Fixed
2018-08-13 19:02:53 +03:00
Mikhail Glukhikh
c3b2d1829f Apply "call chain -> sequence" to idea module 2018-08-13 19:02:51 +03:00
Nicolay Mitropolsky
7f49b78e5f 183: MavenImportingTestCase: no more runs for Maven2
because IDEA gets rid of maven2-tests
2018-08-13 16:24:08 +03:00
Alexey Tsvetkov
696b05eb6e Turn off JS IC for Kotlin build
See KT-26064
2018-08-13 16:17:22 +03:00
Mikhael Bogdanov
ff3278828e Minor. Code clean 2018-08-13 15:10:21 +03:00
Mikhael Bogdanov
cb31962b38 Generate old style lambda classes in jvm ir backend 2018-08-13 15:10:20 +03:00
Mikhael Bogdanov
08038d6de9 Convert object literals to classes inside JvmBackendContext 2018-08-13 15:10:18 +03:00
Vyacheslav Gerasimov
2e624f771b 183: Fix MavenImportingTestCase (MavenServerManager.setUseMaven2 signature has changed) 2018-08-13 13:42:29 +03:00
Vyacheslav Gerasimov
d8d0e117cd as33: Set intellijEnforceCommunitySdk in gradle.properties 2018-08-13 12:54:16 +03:00
Vyacheslav Gerasimov
53af68983f as33: Delete AbstractJavaToKotlinConverterForWebDemoTest.kt.as33 2018-08-13 12:52:53 +03:00
Alexander Udalov
ac0f5548aa Only check language version in MemberDeserializer.loadAsSuspend
This is still not 100% foolproof because one may place such a
requirement manually on a suspend function (with `@RequireKotlin`, for
example), which will trick the compiler into thinking that this is a new
suspend function, even if it was compiled with old coroutines. But it's
still better than only checking the version number
2018-08-13 11:02:36 +02:00
Alexander Udalov
c011bf61fe Support multiple version requirements on single element 2018-08-13 11:02:35 +02:00
Dmitry Petrov
b7df36643b Implement additional declaration checks for inline classes
- Implementation by delegation is prohibited
- Delegated properties are prohibited
2018-08-13 08:49:09 +03:00
Dmitry Petrov
0af33462ef Fix code generation for Array<C> element access where C is inline class 2018-08-13 08:49:04 +03:00
Denis Zharkov
8063db5f80 Fix RemoteException that happens in JPS with compiler daemon
Recently, the container for "lookups" has changed to THashSet
And it lead to exception:
java.io.InvalidClassException: gnu.trove.THashSet;
local class incompatible: stream classdesc
serialVersionUID = -8659895033752433145,
local class serialVersionUID = -1699000958968314003

The reasons for different versions of THashSet are unknown
(though likely related to a slightly different classpathes),
but the fix is rather straight-forward

 #KT-26011 Fixed
2018-08-13 10:15:09 +07:00
Vyacheslav Gerasimov
0d2b888bdd Make KotlinFormattingSettingsStatusAction compatible with 183 platform 2018-08-12 13:15:12 +03:00
Sergey Igushkin
456edf3bbd Fix NPE due to classpath delegate change 2018-08-11 23:16:04 +03:00
Sergey Igushkin
5815d6a70c Implement language settings API for Kotlin source sets 2018-08-11 23:16:03 +03:00
Sergey Igushkin
2c04e2b95c Fix: create a compilation's default source set for Android as well 2018-08-11 23:16:03 +03:00
Anton Bannykh
a2f44c3caf JS: Recreate Nashorn script engine occasionally
Otherwise execution slows down significantly.
2018-08-10 22:15:37 +03:00
Vyacheslav Gerasimov
90e0ab022a as33: Set correct intellij-core version for AS 3.3 2018-08-10 20:02:21 +03:00
Alexander Udalov
f663b8f554 Fix kotlin-maven-plugin compilation 2018-08-10 18:34:40 +02:00
Alexander Udalov
76214930da Update generic signatures in codegen test data
The implementation of toString for generic types in Java reflection has
been changed in 8u162 (https://bugs.openjdk.java.net/browse/JDK-8054213)
2018-08-10 18:20:05 +02:00
Nikolay Krasko
9071b5cfa8 Enable reformat for the whole file for the reformat inspection 2018-08-10 18:45:32 +03:00
Nikolay Krasko
563b2f13a3 Better notification logic and explicit code style apply (KT-23400) 2018-08-10 18:45:30 +03:00
Nikolay Krasko
2924bd80d9 Minor: move methods 2018-08-10 18:45:29 +03:00
Nikolay Krasko
5aacd181fa Restore old code style settings action (KT-23400)
Can't use `KotlinCodeStyleSettings` instead `KtCodeStyleSettings`,
because current `KotlinCodeStyleSettings` class is already used in third
party plugin.
2018-08-10 18:45:28 +03:00
Nikolay Krasko
6920e3bd08 Prototype version for code style notifications (KT-23400)
Show information about code style update, when it is actually updated.
2018-08-10 18:45:27 +03:00
Nikolay Krasko
d16b6f9874 Internal action for showing Kotlin code style status (KT-23400)
Need this to monitor different IDE actions results. Commit can be
dropped after transition to new code style settings is finished.
2018-08-10 18:45:26 +03:00
Nikolay Krasko
a1759fe2ab Load kotlin formatter settings with obsolete defaults for restore (KT-23400) 2018-08-10 18:45:24 +03:00
Nikolay Krasko
a22f4232c0 Add information about obsolete code style usage (KT-23400) 2018-08-10 18:45:23 +03:00
Nikolay Krasko
17b88a28a0 Utility for detection if new code style is set by default (KT-23400)
Need this because some code should work differently before and after
applying new Kotlin code style defaults.
2018-08-10 18:45:22 +03:00
Pavel V. Talanov
01f1917d2a Run/test line markers: aggregate results across implementing modules 2018-08-10 17:00:03 +02:00
Mikhail Zarechenskiy
0fff8ebf71 Fix SOE after enabling SAM conversions 2018-08-10 17:24:19 +03:00
Mikhail Zarechenskiy
b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Nicolay Mitropolsky
31a5746724 183: implementation of JvmElementActionsFactory.createChangeParametersActions 2018-08-10 15:29:44 +03:00
Nicolay Mitropolsky
45b74e9fdb MockUpdateParameterInfoContext BUNCH comments added 2018-08-10 15:29:44 +03:00
Natalia Selezneva
97f1fc1f54 Rewrite MultiplatformProjectImportingTest to use testData directory 2018-08-10 15:26:12 +03:00
Natalia Selezneva
d20b58ce61 Rewrite GradleConfiguratorTest to use testData directory 2018-08-10 15:26:11 +03:00
Natalia Selezneva
f395f163f8 GradleImportingTestCase: add infrastructure to use files from testData folder 2018-08-10 15:26:10 +03:00
Natalia Selezneva
c17d7e63c8 Convert GradleImportingTestCase to Kotlin 2018-08-10 15:26:09 +03:00
Natalia Selezneva
cf56915f03 Rename .java to .kt 2018-08-10 15:26:09 +03:00
Natalia Selezneva
f104bdfe03 Do not log full file text when code fragment was created with error context of PsiFile 2018-08-10 15:26:08 +03:00
Natalia Selezneva
b7bdb43219 Fix leaked thread for AbstractScriptConfigurationTest 2018-08-10 15:26:07 +03:00
Denis Zharkov
b38a9ee386 Fix test data for postfix templates test
In this tests there are two variants:
- One extracts the lambda
- And another extracts the whole call

For some reason, the order of completion variants has been changed in 182
2018-08-10 18:40:44 +07:00
Dmitry Savvinov
20262b8700 Relax assertion in PsiContractPraserDispatcher.parseContract
See EA-124365 - KNPE: PsiContractParserDispatcher.parseContract

Reason of this is unknown, issue KT-26034 will be investigated
later.
2018-08-10 13:27:32 +03:00
Dmitry Savvinov
57bafcf9e9 Do not lose information about contracts if call uses default value
It is safe to treat DefaultValueArgument as UNKNOWN_COMPUTATION, because
default arguments can't break smartcasts.

Possibly, they can add new ones, but it can be supported later.

^KT-25278 Fixed
2018-08-10 13:19:32 +03:00
Nicolay Mitropolsky
cf62acc6d6 MockUpdateParameterInfoContext compilation fix for 183 2018-08-10 13:15:37 +03:00
Alexander Udalov
587ce56ad6 Use safer way of filtering out files from other modules
Comparing files by paths is too error-prone and it created a problem
here, where paths of File instances on Windows use "\" as a separator,
whereas VirtualFile paths always use "/", resulting in empty source
lists being compiled. This issue was introduced in 1582354077. Instead,
get the instance of the VirtualFile by path, and use its identity for
comparison
2018-08-10 11:33:52 +02:00
Sergey Rostov
59c41e111d K2JSCompilerArguments: sourceMapEmbedSources should be null by default.
When sourceMapEmbedSources are not null and source maps is disabled warning is reported, since it has effect only when source maps are enabled. Also this fixes some JPS JS with warnings count assertions.
2018-08-10 12:23:40 +03:00
Denis Zharkov
3e3841d17e Minor. Rename DelegatingDataFlowInfo -> DataFlowInfoImpl 2018-08-10 15:40:50 +07:00
Denis Zharkov
0eba48ae46 Adjust KotlinExpressionTypeProvider to new DataFlowInfo contracts
Now, trivial info is not being perstisted in the maps of DataFlowInfo

At the same time, we don't record trivial DataFlowInfo instances in binding context:
org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt#recordDataFlowInfo
Namely, it happens in case when expression is a callee expression of
"variable as function" calls (see
org.jetbrains.kotlin.idea.codeInsight.ExpressionTypeTestGenerated#testKt11601)

At the same time, there's a hack in `org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt#getType`
that helps to obtain type itself for these callees from the resolved calls.

So, it will work anyway if we use `noTypeInfo` here, that is kind of
correct since there's no non-trivial info anyway
2018-08-10 15:40:50 +07:00
Denis Zharkov
375f3c0769 Fix type-intersection-related test data
The order of types enumeration has been changed recently:
previously it was collected at first from a child and then from
its parent, but now it's being collected in order of appearance
2018-08-10 15:40:50 +07:00
Denis Zharkov
d024d2e64c Adjust PreliminaryLoopVisitor to new contracts of DataFlowInfo
Previously, there was a contract that if it contains some
non-trivial type info it also has it in `completeNullabilityInfo`.

But after two previous changes it became false
2018-08-10 15:40:50 +07:00
Denis Zharkov
666ca77666 Fix incorrect optimization in ExpressionTypingServices
Previously, it's been working because was almost always
a different instance.

After, the latter change with avoidance of storing trivial
info there, newDataFlowInfo may accidentally become empty
as context.dataFlowInfo.
But we, obviously, should compare it with newContext.dataFlowInfo instead
2018-08-10 15:40:50 +07:00
Denis Zharkov
9297babc20 Avoid putting trivial information into DelegatingDataFlowInfo map 2018-08-10 15:40:50 +07:00
Denis Zharkov
d20e5ce673 Cache hashCode for DataFlowValue in another field
It's necessary because DataFlowValue instances are commonly
used as keys in maps

 #KT-24657 Fixed
2018-08-10 15:40:50 +07:00
Denis Zharkov
e5507108ed Get rid of affectReceiver parameter in DelegatingDataFlow::putNullabilityAndTypeInfo
The only non-default argument was inside "assign" method
And it can be replaced with simple map instantiation
2018-08-10 15:40:50 +07:00
Denis Zharkov
851d760ac1 Minor. Extract common parts from DelegatingDataFlow::equate/disequate 2018-08-10 15:40:50 +07:00
Denis Zharkov
bf1f94c185 Rewrite DelegatingDataFlowInfo using immutable collections from javaslang
It may be useful because data-flow info is mostly the same for
neighbouring expressions and changes between them should be minor.

Thus, it should help to avoid making copies of huge maps and reusing
them instead
2018-08-10 15:40:50 +07:00
Denis Zharkov
f61686fcbf Minor. Convert loop to 'mapTo' call 2018-08-10 15:40:50 +07:00
Denis Zharkov
5bfa409da6 Get rid of DelegatingDataFlowInfo::parent property
It's been used to bring immutability to DelegatingDataFlowInfo
But in case of statements sequence like:
x = 1
...
x = 1

it would lead to huge DelegatingDataFlowInfo where each of
getCollectedNullability call works for O(n) where n is amount
of assignments

The solution is to get rid of reference to parent and to update
relevant maps properly

In next commits immutable maps will be used instead of making copies each
time
2018-08-10 15:40:50 +07:00
Dmitry Petrov
4f6aa50417 Fix == for inline classes with boxes
TODO generalize code generating object vs primitive equality

 #KT-25914 Fixed
 #KT-25981 Fixed
 #KT-25983 Fixed
2018-08-10 10:34:57 +03:00
Alexander Udalov
cd12772bc5 Remove unneeded bunch files related to PsiJavaModule
PSI for modules and related classes are already available in AS3.1
2018-08-10 00:10:37 +02:00
Roman Artemev
6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00
Dmitry Savvinov
447c127036 Fix unsound smartcast from loop condition on assigned vars
^KT-22379 Fixed
2018-08-09 19:56:23 +03:00
Mikhael Bogdanov
a7d706f693 Unmute jvm ir-tests 2018-08-09 16:30:32 +03:00
Mikhael Bogdanov
3c5a146c1f Support captured parameters in callable references 2018-08-09 16:30:28 +03:00
Zalim Bashorov
3c765e3625 [JS BE] Support val in when subject
#KT-25014 Fixed
2018-08-09 16:22:25 +03:00
Zalim Bashorov
289ff845c4 Minor: remove extra slash from a testdata file 2018-08-09 16:22:25 +03:00
Leonid Startsev
c9cb5a975c Support for multiple origins in irEquals builder
to preserve correct origin when it's called from irNotEquals
2018-08-09 16:16:10 +03:00
Leonid Startsev
28319a76df Access to ir and external symbol table 2018-08-09 16:16:10 +03:00
Leonid Startsev
87da6e2226 Add ir generation plugins to JS and JVM BE 2018-08-09 16:16:10 +03:00
Leonid Startsev
5d669ff671 Additional helpers in IR builders 2018-08-09 16:16:10 +03:00
Leonid Startsev
ba9b7547b0 Generate IR for synthetic nested classes directly in class generator 2018-08-09 16:16:09 +03:00
Leonid Startsev
c3f66cda65 Lowering extension point 2018-08-09 16:16:09 +03:00
Denis Vnukov
65c79ecfe9 Primitive support for LocalVariables for function parameters 2018-08-09 16:13:21 +03:00
Denis Vnukov
1a56af9bb0 Adding missing SourceFile attribute to classes generated with IR 2018-08-09 16:13:17 +03:00
Simon Ogorodnik
fca82c8e28 Cleanup dependencies of module :compiler:backend, :plugins:import-dumper 2018-08-09 16:04:31 +03:00
Toshiaki Kameyama
f2fec6b078 Fix messages #KT-25177 2018-08-09 15:24:20 +03:00
Toshiaki Kameyama
605736b6ba Introduce "redundant asDynamic" inspection #KT-25177 Fixed 2018-08-09 15:24:20 +03:00
Anton Bannykh
2c4e21ca36 JS box tests via Mocha: respect the ignoreTestFailures flag 2018-08-09 15:00:54 +03:00
Mikhael Bogdanov
bbc5fa4705 Perform InnerClassLowerings after CallableReferenceLowering 2018-08-09 14:22:51 +03:00
Mikhael Bogdanov
357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov
6b5b9fbde4 Temporary use special container mapping logic for IR backend 2018-08-09 14:22:47 +03:00
Mikhael Bogdanov
813e1ffa39 Initial support of function callable references 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov
06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov
da34299064 Temporary set public constructor visibility for lowered local declarations
Allow to support callable reference in next commits
2018-08-09 14:22:45 +03:00
Alexey Sedunov
fdc15b053d Minor: Remove unnecessary checks in new test 2018-08-09 13:36:57 +03:00
Mikhail Glukhikh
87d81a75f3 Fix secondary constructor deletion in "sealed class -> object" 2018-08-09 13:33:03 +03:00
Mikhail Glukhikh
0fb8dd2f75 Handle constructor usage for actual class as usage of expect class
#KT-25498 Fixed
2018-08-09 13:00:47 +03:00
Mikhail Glukhikh
f4d048334f Fix test for "Remove abstract function body"
Formatting rules (probably) was slightly changed in 182 branch,
so I have to introduce bunch file for 181/173/AS here
2018-08-09 13:00:34 +03:00
Mikhail Glukhikh
87b5fca094 Fix test for "Suppress unused if annotated"
Quick-fix test was changed in 182 branch,
so I have to introduce bunch files for 181/173/AS here
2018-08-09 13:00:00 +03:00
Mikhail Glukhikh
db787c78d6 Implement members: don't add 'actual' modifier for fake overrides
#KT-25044 Fixed
2018-08-09 12:59:58 +03:00
Mikhail Glukhikh
ed5791ed9e Introduce "remove actual" fix for ACTUAL_WITHOUT_EXPECT
Related to KT-25044
2018-08-09 12:59:57 +03:00
Mikhail Glukhikh
a91442cd3b Enable "add () fix" for expect base class without constructors
Related to KT-24597
2018-08-09 12:59:55 +03:00
Mikhail Glukhikh
79abf90916 Introduce "add default constructor for expect class" fix
Related to KT-24597
2018-08-09 12:59:54 +03:00
Nikolay Krasko
3dd99ce4cb Register gradle extension to run GradleWrongPluginVersion inspection
Gradle plugin isn't fully registered in tests in 182.
2018-08-09 12:25:50 +03:00
Nikolay Krasko
71bdda0980 Do not use Kotlin in Java files in find usages tests 2018-08-09 12:25:50 +03:00
Nikolay Krasko
fce21d1082 Make GradleClassFinder optional in tests for known class finder
Since 182 Gradle plugin is not fully loaded in tests and GradleClassFinder
is absent in the list.
2018-08-09 12:25:50 +03:00
Alexey Sedunov
465e11c473 Minor: Add missing import for 173 bunch 2018-08-09 12:08:40 +03:00
Alexey Sedunov
1b15ce3ddc Move: Fix top-level declaration detection for scripts
#KT-25858 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
1797a50fc9 Move: Fix "whole file" mode detection for scripts
#KT-25857 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
40a5bf0355 Gradle: Support Gradle test runner for TestNG tests
#KT-22732 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
73bdbbc697 Configuration: Do not show -Xfriend-paths in additional arguments
#KT-25945 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
cd61633b5d Configuration: Support external storage for imported facets
#KT-25913 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
abbac067b8 Configuration: Collapse empty nullable strings to null 2018-08-09 10:06:30 +03:00
Alexey Sedunov
db556d6551 Configuration: Clean library version before adding it as dependency
#KT-25633 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
a8f8ecc012 Configuration: Invalidate caches when changing compiler options
#KT-25515 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
a54f410a15 Configuration: Use specific language/API version only for new projects
#KT-25640 Fixed
2018-08-09 10:06:30 +03:00
Mikhail Zarechenskiy
70aa16f71a Fix hashCode & equals for IntegerValueTypeConstant 2018-08-09 09:49:21 +03:00
Mikhail Zarechenskiy
1a511166cc Discriminate unsigned types in overload resolution
#KT-24717 Fixed
 Relates to #KT-25996 and #KT-25997
2018-08-09 09:49:17 +03:00
Mikhail Zarechenskiy
be38263fc7 Introduce conversions from signed pure constants to unsigned ones
#KT-24717 In Progress
 #KT-25996 Open
 #KT-25997 Open
2018-08-09 09:47:48 +03:00
Ilya Gorbunov
7c996dc218 Improve padStart/padEnd samples 2018-08-09 04:38:22 +03:00
Gen
a90b72ffd8 KT-20357 Add samples for padStart() and padEnd() 2018-08-09 04:38:22 +03:00
Roman Artemev
36a99da820 Break/finally chain in suspend function test fix & workaround 2018-08-08 19:11:17 +03:00
Roman Artemev
efec82c0eb Update test data
* add new tests for coroutines
 * add copy of some tests without dependency on stdlib
2018-08-08 18:33:41 +03:00
Roman Artemev
c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Vyacheslav Gerasimov
37fadb8ee5 as33: Remove incorrect gradle.xml.as33 2018-08-08 16:26:15 +03:00
Mikhail Zarechenskiy
d3280252f9 Prohibit inline data classes
`CONFLICTING_JVM_DECLARATIONS` diagnostics are reported because we're
 trying to generate functions from `Any` once for inline class and
 once for data class

 #KT-25760 Fixed
2018-08-08 15:47:26 +03:00
Mikhail Zarechenskiy
fa2d159e3f Refactoring: move JVM related diagnostic to ErrorsJvm 2018-08-08 15:47:26 +03:00
Mikhail Zarechenskiy
34cd0e9f6c Do not report warning about useless annotations for JvmStatic properties
#KT-25745 Fixed
2018-08-08 15:47:25 +03:00
Mikhail Zarechenskiy
d9e0af4483 Improve message for warning about useless annotations
#KT-25746 Fixed
2018-08-08 15:47:25 +03:00
Alexey Sedunov
1f59ff1bd4 Minor: Fix test data 2018-08-08 15:32:00 +03:00
Alexey Sedunov
c234b40670 Misc: Update AS3.3 version to 182.4928781 2018-08-08 14:26:30 +03:00
Nicolay Mitropolsky
fcc49f55e3 JavaFrameworkType.findExtension nullability fix 2018-08-08 13:50:54 +03:00
Alexander Udalov
5dadddaecd Fix version-specific bunch files for KotlinTestUtils
After 5da8ce844a
2018-08-08 12:11:58 +02:00
Dmitry Savvinov
a8e1a6a2a1 Add contract for 'synchronized'
^KT-25962 Fixed
2018-08-08 12:53:09 +03:00
Dmitry Savvinov
a81fc9e9bc Add contract to checkNotNull overload without message
^KT-25303 Fixed
2018-08-08 12:50:38 +03:00
Dmitry Savvinov
952f67dafc Fix bogus smartcast on enum entry members
Previously, enum entries were treated by the data-flow subsystem similar
to other class/singletons. As a consequence, calls like
'Enum.ENTRY.property' had IdentifierInfo of 'property'.

However, specially for enum entries, descriptor of 'property' is one and
the same for all entries. It means that from the data-flow point of
view, 'Enum.ONE.property' and 'Enum.TWO.property' are *one and the same
data-flow values*.

It could obviously lead to some bogus smartcasts, so this commit
introduces separate IdentifierInfo.EnumEntry and uses it to build proper
qualified values.

^KT-20772 Fixed
2018-08-08 12:48:56 +03:00
Nicolay Mitropolsky
ce6543b1cb 183: IdeaExtensionPoints.IDEA_COMPATIBLE_BUILD_NUMBER = "183.1" 2018-08-08 12:29:36 +03:00
Dmitry Savvinov
9472ded936 Minor: fix .txt dump
Was missed in commits a71f09022c
and bd9254597d
2018-08-08 12:12:15 +03:00
Dmitry Savvinov
2b8ca60c05 Add SKIP_JAVAC in tests where behaviour has diverged with IDEA resolve
See a71f09022c
2018-08-08 12:12:15 +03:00
Denis Zharkov
e3bdde45de Intern canonical classes and parameters names in BinaryClassSignatureParser
Otherwise, a lot of duplicated strings are generated
2018-08-08 15:17:25 +07:00
Denis Zharkov
782f221ab5 Optimize memory-footprint for ClassifierResolutionContext
Use immutable maps for inner classes/type parameters
in nested contexts instead of making copies for each of them
2018-08-08 15:17:25 +07:00
Denis Zharkov
71a9ba4790 Minor. Move helpers for javaslang to a separate package 2018-08-08 15:17:25 +07:00
Denis Zharkov
3a8335d47f Optimize memory footprint for SlicedMapImpl in case it's empty
It might be useful in case of many delegating traces that
remain effectively empty themselves (up to 7M of empty maps in case of compilation of 'idea' module)
2018-08-08 15:17:25 +07:00
Denis Zharkov
8050869e45 Use THashSet for sets that are assumed to be big
Otherwise, a lot of memory is wasted on nodes instances

(cherry picked from commit 4922f87)
2018-08-08 15:17:25 +07:00
Denis Zharkov
2fd9b3ee35 Do not initialize SimpleFunctionDescriptorImpl::userDataMap if it's empty 2018-08-08 15:17:25 +07:00
Mikhail Glukhikh
e6850bf007 Add "Call chain -> sequence" to 183 plugin 2018-08-08 11:02:58 +03:00
Mikhail Glukhikh
c7e46d4998 Downgrade "Call chain -> sequence" to INFO level 2018-08-08 11:02:56 +03:00
Toshiaki Kameyama
b638e91c2b Call chain --> Sequence: minor improvements
Related to KT-15476
2018-08-08 11:02:55 +03:00
Toshiaki Kameyama
7e28cb1fe3 Call chain --> Sequence: take termination into account
Related to KT-15476
2018-08-08 11:02:47 +03:00
Toshiaki Kameyama
108dea5b46 Introduce "Call chain on collection should be converted into 'Sequence'"
So #KT-15476 Fixed
2018-08-08 10:29:10 +03:00
takasy
76a98c8e67 KT-20357 Add sample code for Pair/Triple.toList 2018-08-07 21:27:16 +03:00
Ilya Gorbunov
f41b410e1d Do not use projectTest helper to setup kotlinx-metadata-jvm
It sets up test instrumenter which cannot be used when running
these tests under JDK6.

Do not setup working dir, as there tests do not depend on it.
2018-08-07 21:27:16 +03:00
Alexey Sedunov
632dd05116 Misc: Fix compilation after rebase 2018-08-07 18:35:08 +03:00
Alexander Udalov
b67d236857 Fix bunch files for KotlinToJVMBytecodeCompiler
After 1582354077
2018-08-07 16:13:16 +02:00
Sergey Rostov
839a6b5e60 JPS: Support new MPP model. 2018-08-07 15:59:43 +03:00
Alexey Sedunov
ecf607d4fa Gradle: Implement new MPP model import 2018-08-07 15:59:41 +03:00
Sergey Igushkin
caec846330 Improve Android libraries support: allow project dependency on a lib
* Add a platform type androidJvm that is one-way compatible (can
  consume but cannot be consumed) with jvm, register the matching
  strategy

* Write our attributes to Android's output configurations (this uses
  a naming convention that Android inherits from Java, but there's no
  public API at the moment for that)
2018-08-07 15:55:46 +03:00
Sergey Igushkin
3f60798848 Fix the use case of an old-style project depending on an MPP lib
* Setup the attributes for the resolvable and output configurations
2018-08-07 15:55:46 +03:00
Sergey Igushkin
3ff61f59a7 Implement dependsOn relation for Kotlin source sets
* Setup configurations' extendsFrom and inherit sources of source sets.
  This make it unnecessary to restore transitive dependencies of a
  source set at its use sites, since their sources and dependencies are
  already included.

* Use dependsOn during default configuration instead of compilation.source()
2018-08-07 15:55:45 +03:00
Sergey Igushkin
93943a565c Refactor Kotlin tasks provider & fix friend task matching with new MPP
* Parameterize with the target name and use it in the task names
* Get rid of separate task providers for common and js, use the default
  with an appropriate target name
2018-08-07 15:55:45 +03:00
Sergey Igushkin
d4f44e63cd Create runtime software component usage only for runnables;
Also make Kotlin2JsCompilation a compilation to runnable files
2018-08-07 15:55:45 +03:00
Sergey Igushkin
209d0cf6a1 Add a few integration tests for the new MPP plugin 2018-08-07 15:55:45 +03:00
Sergey Igushkin
1e95e4d427 Allow resolution for compileOnly and compileClasspath configurations
This is required by the old IDE importer, which needs to resolve these configurations, and there seems to be no easy way to prevent that.
2018-08-07 15:55:44 +03:00
Sergey Igushkin
19fd706d98 Fixes for Android single-target projects
1. Kapt resolves runtime classpath during configuration, and because of
that we are unable to setup configurations that already took part in
dependency resolution. To fix that, run Kapt configuration as a separate
step out of the main loop over the variants

2. Old Android projects (< 3.0.0) don't have `api` and `implementation`
configurations. To stay compatible with those, ignore these
configurations being absent during configurations hierarchy setup.
2018-08-07 15:55:44 +03:00
Sergey Igushkin
7b6764c9ae Add test tasks to targets configured with KotlinTargetConfigurator 2018-08-07 15:55:44 +03:00
Sergey Igushkin
cb99f43033 Implement new MPP plugin 2018-08-07 15:55:44 +03:00
Sergey Igushkin
dc7d488deb Update existing plugin implementations to use KotlinCompilation
Add default implementations for KotlinTarget and KotlinCompilation
(some of them are used in code added by further commits).

Refactor AbstractKotlinPlugin so that parts of its logic can be easily
applied outside the plugin (needed for MPP plugin later).

The single platform Kotlin plugins having Kotlin compiled along with
Java will now create a KotlinCompilation and a KotlinSourceSet per Java
source set or per Android variant.
The build configuration logic will use KotlinCompilation
objects rather than Java or Android plugin entities.

Subplugins API and implementations are updated to use KotlinCompilation.
2018-08-07 15:55:44 +03:00
Sergey Igushkin
25eb93b136 (partial) Replace the KotlinSourceSet implementation and its factory
(Note: this commit leaves the repository in a non-compilable state as it
leaves some of the old API usages unchanged; they are replaced with new
implementations in further commits where more appropriate)

The new implementation covers the wider interface, and the factory
should now be used not on its own but in a named domain object container
(the API for creating a source set is now provided through the
source sets container rather than the factory, so that source sets are
also properly registered).
2018-08-07 15:55:43 +03:00
Sergey Igushkin
3828c26fa9 Introduce new API
These interfaces are needed for both new MPP design and getting rid of
the Java plugin source sets in favor of Kotlin source sets
2018-08-07 15:55:43 +03:00
Svyatoslav Kuzmich
a1c10956cb [JS IR BE] Support super calls for methods of Any 2018-08-07 14:41:50 +03:00
Svyatoslav Kuzmich
439350d41a [JS IR BE] Cast types in bridges 2018-08-07 14:41:50 +03:00
Alexander Udalov
97faff246d Compile kotlinx-metadata-jvm with JVM target 1.6 instead of 1.8
#KT-25920 Fixed
2018-08-07 13:38:47 +02:00
Alexander Udalov
1582354077 Refactor CompileEnvironmentUtil.getKtFiles, move to KotlinCoreEnvironment
Do not call this method the second time in KotlinToJVMBytecodeCompiler
where all KtFile instances are already created; just get only those
files that are in the needed module, which can be determined solely by
the file path.

Also "kotlinize" getKtFiles and rename to createKtFiles
2018-08-07 13:38:30 +02:00
Alexander Udalov
fe829add44 Minor, use TEMP_DIR/TESTDATA_DIR in CLI tests on xml build files
Otherwise the "outputDir" in these tests was treated as relative to the
project root, and starting from 63b4302cea, running these tests resulted
in the "whatever" directory being created in the project root
2018-08-07 13:38:30 +02:00
Alexander Udalov
19feacb96b Minor, expand TESTDATA_DIR with absolute path in CLI tests
To be able to use it correctly inside an xml build file where, if the
path is not absolute, it's treated as relative to the build file path
(which is TMP_DIR in several tests of the subsequent commit)
2018-08-07 13:38:30 +02:00
Alexander Udalov
f9ed8e7aaf Minor, make org.jetbrains.kotlin.fileClasses.LOG private
To prevent it from being suggested in auto-import
2018-08-07 13:38:30 +02:00
Alexander Udalov
5da8ce844a Minor, move ContentRoot and KotlinSourceRoot to module 'cli'
Also move CONTENT_ROOTS from JVMConfigurationKeys to
CLIConfigurationKeys since it's used on all platforms, not just JVM
2018-08-07 13:38:30 +02:00
Alexander Udalov
14b8f4b52b Minor, change package of outputUtils.kt 2018-08-07 13:38:30 +02:00
Alexander Udalov
2d875a9cb4 Reformat module 'cli', fix warnings/inspections 2018-08-07 13:38:29 +02:00
Nikolay Krasko
21a7561271 Fix small gap for install message 2018-08-07 14:08:09 +03:00
Nikolay Krasko
cb925375ed Not enough padding/white space for current version in update form (KT-25562)
#KT-25562 Fixed
2018-08-07 14:07:03 +03:00
Mikhael Bogdanov
5169cfba8f Use lazy symbol table in symbols 2018-08-07 12:42:05 +03:00
Nikolay Krasko
8e7d114850 Merge pull request #1795 from belovrv/patch-2
Delete the SlackIn badge
2018-08-07 12:28:00 +03:00
Nicolay Mitropolsky
bbf2af1004 IdeaExtensionPoints.IDEA_COMPATIBLE_BUILD_NUMBER = "182.3040"
Otherwise Kotlin plugin is not loaded in some tests (`org.jetbrains.uast.test.kotlin.KotlinDetachedUastTest` for instance)
2018-08-07 12:26:30 +03:00
belovrv
c17a9e10b5 Delete the SlackIn bage 2018-08-07 12:21:56 +03:00
Mikhail Zarechenskiy
1497c19dc9 Do not generate useless methods inside wrapper for inline class
Fix for test data (inlineFunctionInsideInlineClassesBox.kt) is needed
 to avoid check about "no inline functions".

 This check has two steps: first, names of inline functions from
 the metadata are loaded, then these names are checked that they are
 presented for physical methods in the classfile.

 Because now there are no physical methods in the classfile, we can't pass
 the second check, therefore this fix is needed.

 #KT-24872 Fixed
2018-08-07 12:15:46 +03:00
Yan Zhulanow
fcbcabd3a2 Pill: Generate iml files more consistently with IDEA 2018-08-07 11:55:24 +03:00
Yan Zhulanow
014b812a31 Pill: Remove -SNAPSHOT suffixes for artifact JAR file names 2018-08-07 11:55:24 +03:00
Yan Zhulanow
42d00c144b Pill: Fix compilation, forcibly move the annotations-13 dependency to the end of classpath 2018-08-07 11:55:24 +03:00
Yan Zhulanow
769a0d7701 Pill: Add extra stdlib jars as dist libraries 2018-08-07 11:55:23 +03:00
Yan Zhulanow
54470fe2b7 Pill: Remove source dependencies to 'tests-common'
'tests-common' module does only have a test source set so the dependency is redundant.
2018-08-07 11:55:23 +03:00
Mikhail Glukhikh
09766ae2ae Reformat: AddNameToArgumentFix 2018-08-07 11:30:31 +03:00
Mikhail Glukhikh
06d339639f Fix "Add name to argument" (disable reformatting in quick-fix text)
Four relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Mikhail Glukhikh
28484f31e7 Fix "Remove @ from annotation argument" (make consistent PSI)
Three relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Dmitry Savvinov
9ad2edbe85 Bump stubs versions after 5ab79a111d 2018-08-07 10:22:46 +03:00
Dmitry Savvinov
bd9254597d Fix testdata after switching idea version to 182
The source of testdata change is following commit from the
intellij-community repo:

d2bfe3d14bfa48af585f1faddc9a0c37dc05e724

It changes how Java-resolution resolves constructors:
- before, *any* PsiMethod without type reference was treated as
constructor
- now, PsiMethod without type reference is treated as constructor
only if their *names also match*

In particular, in this test, 'void () {}', surprisingly, doesn't have a
type reference ('void' is parsed as PsiErrorElement:Identifier
expected), its name is '<unnamed>', and its visibility is
'package-private' (!)

Therefore, previously we thought that 'Nameless' has package-private
constructor and were reporting INVISIBLE_MEMBER.
Now we don't see any constructor so we add default constructor, which has
public-visibility -> error is gone.

Note that this change affects behavior only when "red" code is already
present in the project (for "green" code, assumption "method without type
reference is a constructor" is indeed correct).
2018-08-07 10:18:25 +03:00
Dmitry Savvinov
a71f09022c Fix testdata after switching idea version to 182
The source of changes is commit the following commit in
intelllij-community repo:

b2b723fa449b16bb1da8102a5efdc219977fefe0 speedup java class resolve a bit

Eseentially, it makes Java resolve (which Kotlin reuses) accept first
matching candidate from explicit named import, instead of continuing
search.

Hence, behavior in cases where several conflicting imports are present,
has changed: before, reference to such names were unresolved, now it's
candidate from first import (see also test UsageMixed.java in the
intellij-community repo).

Therefore, previously we saw such types as undeclared and reported
MISSING_DEPENDENCY_CLASS on them (assuming they are not present in
classpath); now we see such types as properly resolved, so error is
gone.

Because behavior has changed only in case there already was "red" code,
it is not a BC and we can just accept changes.
2018-08-07 10:18:25 +03:00
Alexey Sedunov
ed5709afdb Misc: Fix compatibility issues with AS3.3C4 2018-08-06 21:39:17 +03:00
Vyacheslav Gerasimov
8231f5b259 Make handleElementRename overrides compatible with 183 platform 2018-08-06 20:24:46 +03:00
Mikhail Glukhikh
d7317c58e9 Move "Add test library to classpath" to irrelevant action list
This prevents inconsistencies like "Add JUnit 5.0" / "Add JUnit 5.2"
Should fix one relevant test
2018-08-06 19:04:12 +03:00
Mikhail Glukhikh
21be8d118d Fix "ReplaceInfixOrOperatorCallFix" (make consistent PSI)
One relevant quick-fix test should be fixed after it
2018-08-06 19:04:11 +03:00
Mikhail Glukhikh
247bb912ba Fix refactoring test (bunch file -> original file) 2018-08-06 19:04:09 +03:00
Mikhail Glukhikh
e15fc7da15 Fix two inspection tests (bunch file -> original file) 2018-08-06 19:04:07 +03:00
Mikhail Glukhikh
90245659ff Fix testOptionalParameterAndLambdaComplex (related to KT-24694) 2018-08-06 19:04:05 +03:00
Mikhail Glukhikh
07ff2bff33 Reformat & cleanup: psiModificationUtils, especially PsiElement.replaced 2018-08-06 19:04:04 +03:00
Mikhail Glukhikh
1d2438e04e Report SUPERTYPE_NOT_INITIALIZED even if no constructors in superclass
Before this commit, expect super-class without constructors did not
provoke SUPERTYPE_NOT_INITIALIZED. However, it should, but only
if sub-type is normal class (not an expect one).

So #KT-24597 Fixed
2018-08-06 19:02:24 +03:00
Vyacheslav Gerasimov
6db2037440 Make JavaToKotlinAction.convertFiles compatible with AS 3.3 2018-08-06 18:39:00 +03:00
Mikhail Zarechenskiy
1972387022 Fix test data after 6d4d244c28 2018-08-06 17:45:24 +03:00
Mikhail Zarechenskiy
659289b41a Report diagnostics about experimentality on unsigned literals
#KT-25580 Fixed
2018-08-06 17:45:22 +03:00
Mikhail Zarechenskiy
55e7def3c1 Fix coercion for stack value property in case of inline classes
#KT-25771 Fixed
2018-08-06 17:45:20 +03:00
Bloder
f89803fe8f Create samples for String.toLowerCase/toUpperCase
* Create toLowerCase method sample
* Create toUpperCase method sample
* Create toUpperCase sample reference in StringsJVM
* Create sample ref and doc of js impl toUpperCase
* Create sample ref and docs of js toLowerCase
* Add sample ref in toLowerCase expect fun
* Add sample ref in toUpperCase expect fun
2018-08-06 15:34:57 +03:00
Vyacheslav Gerasimov
e41f468bd8 Update compiler.pro for 183 platform 2018-08-06 15:08:03 +03:00
Vyacheslav Gerasimov
f712759a3e Make isReferenceTo parameter NotNull, annotated in 183 platform 2018-08-06 15:08:03 +03:00
Ilya Chernikov
a3d719785c Drop exception/stacktrace from logging warning if a script template is not found in the classpath
reducing clutter in logs and console
#KT-24754 fixed
2018-08-06 13:58:49 +02:00
Alexander Udalov
6f9441d3f4 Do not output empty non-root packages in tests with txt
Mostly to avoid listing every internal package in
kotlin-stdlib/kotlin-reflect, as in
acd5b62148/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.txt (L144)
2018-08-06 13:43:32 +02:00
Alexander Udalov
ccb6410823 Rework and move the pull request checklist to a new section in ReadMe
Otherwise this text appears in numerous pull requests and contributors
do not understand what to do with it
2018-08-06 13:41:49 +02:00
Alexander Udalov
4c7bdf5437 Minor, fix typos in ReadMe 2018-08-06 13:41:49 +02:00
Mikhael Bogdanov
ddf6bdffcf Move jvm ir tests to jvm ones 2018-08-06 13:57:43 +03:00
Natalia Selezneva
0e8b93bf35 Use IDELanguageSettingsProvider getting languageVersionSettings and targetPlatform during analysis 2018-08-06 10:41:42 +02:00
Ilya Chernikov
f2395bac2f Use script compiler options to calculate target platform in IDE
#KT-25822 fixed
2018-08-06 10:41:41 +02:00
Vyacheslav Gerasimov
0cf6b26494 as32: Set since-build to 181.5281 (AS 3.2 Beta 5) 2018-08-06 11:15:50 +03:00
Mikhail Zarechenskiy
2ee483f92b Do not generate bodies for functions from Any for light classes
#KT-25894 Fixed
2018-08-06 10:57:53 +03:00
Mikhail Zarechenskiy
ddf6c37e0e Prohibit inline classes with special underlying types
#KT-25328 Fixed
 #KT-23819 Fixed
2018-08-06 10:56:05 +03:00
Mikhail Zarechenskiy
6d4d244c28 Generate function from Any for inline classes same as for data classes
#KT-24873 Fixed
 #KT-25293 Fixed
 #KT-25299 Fixed
2018-08-06 10:56:01 +03:00
Mikhail Zarechenskiy
043ce1cb27 Support secondary constructors for inline classes
#KT-25614 Fixed
 #KT-25246 Fixed

 KT-25599 Will be fixed after recompilation of unsigned classes
2018-08-06 10:55:57 +03:00
Mikhail Zarechenskiy
064eb24d51 Refactoring: extract methods about constructor codegen out
#KT-25614 In Progress
2018-08-06 10:22:21 +03:00
Mikhail Zarechenskiy
e28c2ed549 Refactoring: extract codegen methods about functions from Any out 2018-08-06 10:22:17 +03:00
Mikhail Zarechenskiy
c253b39acf Refactoring: extract generator for functions from Any 2018-08-06 10:19:46 +03:00
Mikhail Zarechenskiy
6244846107 Add functions from Any to the member scopes of inline classes 2018-08-06 10:19:43 +03:00
Mikhail Zarechenskiy
fdf538007c Refactoring: extract logic about methods from Any for scopes out 2018-08-06 10:19:39 +03:00
Andrey Breslav
6e3497771d Some notes on contributing language features
This is to provide some guidance for PRs like: https://github.com/JetBrains/kotlin/pull/1769
2018-08-06 06:32:40 +03:00
Vyacheslav Gerasimov
e4bf20a267 183: Set since-build to 183.1 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
ebb90f8260 183: Build against 183-SNAPSHOT 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
4996d81ea1 Add 183 rule to .bunch 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
5666e1ea93 Update versions.gradle.kts for 183 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
c7a00971fe Fix source compatibility with 183 platform 2018-08-03 21:29:18 +03:00
Vyacheslav Gerasimov
57963d2e03 Remove asm-shaded sources downloading code since it is not published anymore 2018-08-03 21:29:18 +03:00
Nikolay Krasko
5ba877c144 Add empty test data files to make new test framework in 182 happy 2018-08-03 21:06:05 +03:00
Alexander Udalov
fe2251bfca Run classifier usage checkers on function types 2018-08-03 18:03:52 +02:00
Nikolay Krasko
759ffafb0a Render flexible types with enhancement as enhanced in IDE (KT-25622)
Main targets for the fix is completion, parameters info, inlay hints and
override/implement.

Other IDE functions might be affected.

 #KT-24911 Fixed
 #KT-25616 Fixed
 #KT-25622 Fixed
2018-08-03 16:00:09 +03:00
Nikolay Krasko
653d1d00de Option for rendering types with enhancement 2018-08-03 16:00:07 +03:00
Nikolay Krasko
ceeeffd814 Extend list of annotations ignored in parameter info (KT-24911, KT-25622)
#KT-24911 Fixed
2018-08-03 16:00:04 +03:00
Nikolay Krasko
10b2229a27 Skip main file while configuring extra files in parameter info test 2018-08-03 16:00:03 +03:00
Nikolay Krasko
ce9e7261a7 Allow kotlin extra files in parameter info tests 2018-08-03 16:00:02 +03:00
Natalia Selezneva
6672fd7bbf Fix tests for highlighting in scripts with custom script definition 2018-08-03 15:25:35 +03:00
Natalia Selezneva
41dc059da9 Register custom file extension for scripts loaded from script template 2018-08-03 15:25:35 +03:00
Natalia Selezneva
be2d4964fd Fix testData, add script-runtime 2018-08-03 15:25:35 +03:00
Natalia Selezneva
f71269009a Refactoring: use KtScript.scriptDefinition instead of KotlinScriptDefinitionProvider.findScriptDefinition if possible 2018-08-03 15:25:35 +03:00
Natalia Selezneva
736361e345 Provide a default scriptDefinition for script 2018-08-03 15:25:35 +03:00
Natalia Selezneva
c802428326 Do not check script definitions in parser 2018-08-03 15:25:35 +03:00
Alexey Sedunov
3ce4a14583 Misc: Workaround for failing tests due to unknown ".gradle" extension 2018-08-03 14:48:56 +03:00
Toshiaki Kameyama
1ac6f18a47 "Convert put to assignment": Fix false positive inside elvis expression
So #KT-22072 Fixed
2018-08-03 13:21:50 +03:00
Toshiaki Kameyama
1b1e503716 Add quick-fix for default parameter value removal #KT-25146 Fixed 2018-08-03 13:17:49 +03:00
Toshiaki Kameyama
a059d50c8f "Call chain may be simplified": fix false positive on Java Map
So #KT-25089 Fixed
2018-08-03 13:15:53 +03:00
Ilya Gorbunov
c9a784ebb0 Deprecate projectDist and make it a temporary alias for default configuration 2018-08-03 09:37:38 +03:00
Ilya Gorbunov
2a598e0ac4 Replace ReadOnly/Mutable usages in the compiler
Replace ones from org.jetbrains.kotlin package with new annotations from kotlin.annotations.jvm.
No need to copy them to compile kotlin-reflect anymore.
Then simplify reflect project more: no sources — no need to pack its direct output.
2018-08-03 09:37:38 +03:00
Dmitry Petrov
1bfb75a51b Generate intrinsic-based numeric comparison only for FP types 2018-08-03 09:34:59 +03:00
Vyacheslav Gerasimov
cce9505e31 Fix AbstractSpringClassAnnotatorTest compilation 2018-08-02 23:15:29 +03:00
Vyacheslav Gerasimov
5c177a86fe Use snapshot repository if platform version ends with SNAPSHOT 2018-08-02 23:15:28 +03:00
Simon Ogorodnik
07cc3bd63a KT-25733: Fix regression after optimization
#KT-25733 fixed
2018-08-02 22:41:48 +03:00
Nikolay Krasko
be3f0628ef Fix file structure tests in 182 2018-08-02 21:30:05 +03:00
Vyacheslav Gerasimov
8ccfdc70ac as33: Add private bintray repo to build against custom AS 3.3 build 2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov
8fc0c1d7b0 as33: Add AS 3.3 bunchset built with AS 3.3 C4 2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov
94bbb3831a Add as33 rule to .bunch file 2018-08-02 20:53:17 +03:00
Alexander Udalov
0355746304 Implement OpenAddressLinearProbingHashTable.entries for debug when needed
Otherwise it's very difficult to view the contents of BindingContext in
debugger views
2018-08-02 18:36:22 +02:00
Vyacheslav Gerasimov
53b1a8bd37 Remove hacks introduced for 172 platform compatibility 2018-08-02 19:32:18 +03:00
Vyacheslav Gerasimov
a2bf417d75 Remove 172 bunchset 2018-08-02 19:32:18 +03:00
Ilmir Usmanov
0c867b4804 Disable callable references to suspend functions in 1.2
#KT-25604: Fixed
2018-08-02 18:55:49 +03:00
Vyacheslav Gerasimov
ec276a07cb Add keep rule to compiler.pro for org.jdom.output.XMLOutputter
Without this class PluginManagerCore.loadDescriptorFromJar fails
2018-08-02 18:17:08 +03:00
Vyacheslav Gerasimov
0103c0d2fd Switch to 182 platform 2018-08-02 18:17:06 +03:00
Mikhael Bogdanov
a8b9393e79 Fix test data 2018-08-02 15:51:16 +02:00
Svyatoslav Scherbina
e923c65704 backend.common: improve support for unsigned types 2018-08-02 16:29:39 +03:00
Svyatoslav Scherbina
1aac1c2d69 Prepare default arguments IR lowering for inline classes support
Allow `nullConst` to be customized by backend
2018-08-02 16:29:38 +03:00
Natalia Selezneva
d57099088e Fix unusedReceiverParameter test 2018-08-02 15:12:56 +03:00
Nikolay Krasko
79ad0ea2ef Test for Gradle and Maven migration (KT-23401) 2018-08-02 14:44:42 +03:00
Nikolay Krasko
7aadf95f66 Don't show migration dialog if there're no project files changed (KT-23401) 2018-08-02 14:44:41 +03:00
Nikolay Krasko
f0794dbc0a Ability to disable migration detection (KT-23401)
-- to disable
2018-08-02 14:44:40 +03:00
Nikolay Krasko
bffbcc595c Add inspections to migration (KT-23401) 2018-08-02 14:44:40 +03:00
Nikolay Krasko
30ec73f322 Add migration action and marker fix interface (KT-23401) 2018-08-02 14:44:40 +03:00
Nikolay Krasko
feb456b0e1 Migration dialog (KT-23401) 2018-08-02 14:44:39 +03:00
Nikolay Krasko
4574fd94c6 Monitor maven projects synchronization (KT-23401)
-- Maven migrator
2018-08-02 14:44:39 +03:00
Nikolay Krasko
b4c88651f6 Migration detector for external systems (KT-23401) 2018-08-02 14:44:39 +03:00
Nikolay Krasko
02796783d3 Minor: update maven external system id 2018-08-02 14:44:39 +03:00
Nikolay Krasko
f9845bab54 Workaround for the case when some classes are unloaded during ranking (KT-25774)
It's important that ranking preserve order of files found
in findFilesByNameInPackage()

It's only a workaround because it's expected for debugger to have
classes unloaded and some valid variants might get bad rank and
rejected because of that.

 #KT-25774 Fixed
2018-08-02 14:38:28 +03:00
Nikolay Krasko
da6bcc9d46 Do not check locations inside synthetic and bridge methods
No valid psi declarations can be found for such locations leading to
negative rank.
2018-08-02 14:38:27 +03:00
Nikolay Krasko
c2dc66fe1b Minor: reformat DebuggerUtils.kt 2018-08-02 14:38:26 +03:00
Nikolay Krasko
449069b1b7 Attach preceding line comments to property accessors (KT-25417)
#KT-25417 Fixed
2018-08-02 14:38:25 +03:00
Mikhael Bogdanov
e3462a2999 Remove IrOnlyBoxCodegenTestGenerated test 2018-08-02 13:19:28 +02:00
Mikhael Bogdanov
6c41f078a6 Mute jvm ir box tests 2018-08-02 13:19:28 +02:00
Mikhael Bogdanov
34a12cb87c Mute 'boxAgainstJava' tests 2018-08-02 13:19:27 +02:00
Mikhael Bogdanov
7a98f5c5f7 Add 'boxAgainstJava' tests to ir test suite 2018-08-02 13:19:26 +02:00
Mikhael Bogdanov
261a00eec7 Remove IrCompileKotlinAgainstInlineKotlinTestGenerated tests 2018-08-02 13:19:26 +02:00
Mikhael Bogdanov
6c65507f29 Mute inline tests 2018-08-02 13:19:25 +02:00
Mikhael Bogdanov
9ccb25789b Unmute jvm-ir inline tests 2018-08-02 13:19:24 +02:00
Svyatoslav Kuzmich
826c524a9b [JS IE BE] Lower string equality method/operators 2018-08-02 13:42:50 +03:00
Alexander Udalov
aa1321287c Add ChangeLog for 1.2.60 2018-08-02 12:14:58 +02:00
Mikhael Bogdanov
0ddbe12e62 Use common assertion in ir-tests and proper arithmetic flag 2018-08-02 10:38:06 +02:00
Mikhael Bogdanov
cb53e86183 Move ir box test under "box/ir" 2018-08-02 09:52:48 +02:00
Natalia Selezneva
24579c27a2 Extract common part in inspections that checks usage of descriptor in some call 2018-08-02 09:23:27 +03:00
Toshiaki Kameyama
4c34ced1fa Introduct "Redundant 'with' call" inspection #KT-6633 Fixed 2018-08-02 09:23:27 +03:00
Artem Zinnatullin
58becffb1f Add documentation for @JvmSynthetic 2018-08-02 08:53:47 +03:00
Sergey Rostov
4f3f4dd025 ScriptDependenciesLoader: Fix calling notifyRootsChanged in write-unsafe context (EA-123239) 2018-08-02 08:38:17 +03:00
Alexander Udalov
0c8b231fde Add tests on coercion to Unit for callable references
#KT-11723
2018-08-01 16:26:07 +02:00
Alexander Udalov
9babd90999 Support default arguments and varargs for callable references
#KT-8834
 #KT-19869
 #KT-25514
2018-08-01 16:26:06 +02:00
Ilya Chernikov
f71909ee73 Fix classpath calculation for scripts, e.g. in JSR-223 setting
#KT-25814 fixed
2018-08-01 13:09:05 +02:00
Nikolay Krasko
a406f1b361 Revert registering ClsCustomNavigationPolicy EP in 182 (KT-24891)
Registration can't be removed because there's still a usage in ClsFileImpl:

Caused by: java.lang.IllegalArgumentException: Missing extension point: com.intellij.psi.clsCustomNavigationPolicy in area null
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:335)
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:26)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:104)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:93)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getNavigationElement(ClsFileImpl.java:312)
2018-08-01 14:02:59 +03:00
Mikhael Bogdanov
2b3162732b Fix lazy parent calculation for property accessor 2018-08-01 12:29:31 +02:00
Mikhael Bogdanov
bf60835975 Delete unused properties 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov
b27177b7ee Get rid of 'referenceAllTypeExternalClassifiers' 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov
b22352a60d Get rid of 'externalPackageFragments' and 'dependencyModules' in IrModuleFragment 2018-08-01 12:29:29 +02:00
Mikhael Bogdanov
0df6fddd0a Extract utils from ReferenceSymbolTable 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov
8a0c585c09 Move lazy var to separate file 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov
bee0803ac9 Generate ExternalPackageFragment lazily 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov
1bf3f4bda7 Extract ReferenceSymbolTable, support lazy type parameters 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov
6623799671 Clean 2018-08-01 12:29:26 +02:00
Mikhael Bogdanov
952bc6da63 Set parent for non-lazy declarations 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov
c19d45a2fc Initial lazy ir implementation 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov
2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Mikhael Bogdanov
74aa8f054e Fix type parameters count in synthetic accessor lowering 2018-08-01 12:27:08 +02:00
Dmitry Petrov
60d93aee87 Drop IrProperty.typeParameters 2018-08-01 12:06:41 +03:00
Roman Artemev
c9b7db646c Temporary mute test with issue between coroutines and crossinline 2018-08-01 10:56:08 +03:00
Roman Artemev
dac1fac957 Unmute working test 2018-08-01 10:55:21 +03:00
Vyacheslav Gerasimov
2ec7c4fd0d Update platform versions for 181, 182, as32, as33 plugins 2018-07-31 19:27:23 +03:00
Pavel V. Talanov
e1a27929ac Do not throw on using kotlin resolve via light classes in dumb mode
Fix an exception when kotlin resolve was invoked when searching
    for tests while indexing (probably many other cases)
Does not actually fix the behaviour, the test will not be found
    resulting in undesired behaviour
Full-blown infrastructure for resolving Kotlin in dumb mode is needed
    to fix the behaviour

 #KT-24979 Fixed
2018-07-31 14:47:21 +02:00
Dmitry Petrov
ea710ce607 IrField.isStatic: Update testData for new test 2018-07-31 14:04:04 +03:00
Dmitry Petrov
6dfcf15a39 IR: IrField.isStatic 2018-07-31 13:39:54 +03:00
Zalim Bashorov
8d97512179 [JS IR BE] Improve diagnostics in tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov
2fb286e39c [JS IR BE] Update tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov
0da14e4189 [JS IR BE] Support calls, property accesses and most of operators on expressions with dynamic type 2018-07-31 11:28:38 +03:00
Zalim Bashorov
4a7ecaa908 [JS IR BE] Add basic support for external declarations 2018-07-31 11:28:38 +03:00
Zalim Bashorov
3c0d0d2ab4 [JS IR BE] Move external declarations to a separate IrPackageFragment to not generate code for them 2018-07-31 11:28:38 +03:00
Zalim Bashorov
c66bb8c57d [JS IR BE] Remove no longer needed descriptor based utils 2018-07-31 11:28:38 +03:00
Zalim Bashorov
990ad8719d [JS IR BE] Run each lowering on all files instead of running all lowering on each file 2018-07-31 11:28:38 +03:00
Lucas Smaira
49292cd26c Move model interfaces code from Java to Kotlin 2018-07-30 19:08:04 +03:00
Lucas Smaira
52990c9eb1 Set JAVA and ANDROID_HOME when fetching Gradle models
In BaseGradleIT
2018-07-30 19:08:04 +03:00
Lucas Smaira
8cb03fcdec Fix model tests in Windows
By comparing files instead of paths, avoiding problems with separator
'/' or '\'.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5e515590cb Restrict methos in Tasks.kt to internal 2018-07-30 19:08:04 +03:00
Lucas Smaira
3588547d8c Remove *ImplTest for Kotlin Gradle Models
Equality should already be guaranteed by Kotlin data classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira
3c88f761a6 Introduce tooling model for Android extensions plugin
Introduce Gradle models for plugins 'kotlin-android-extensions'.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5a423e8dcd Introduce tooling model for annotation based projects
Introduce Gradle models for plugins 'kotlin-allopen', 'kotlin-noarg' and
'kotlin-sam-with-receiver'. Corresponding model builders are registered
in each one of those plugin main classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5671dbb929 Introduce tooling model for Kapt gradle projects
A Kapt model for Gradle projects including 'kotlin-kapt'plugin is
introduced. Its model builder KaptModelBuilder produces an
implementation of these models and can be queried through the Gradle
Tooling API when needed. Model builder is registered in
Kapt3GradleSubplugin.
2018-07-30 19:08:04 +03:00
Lucas Smaira
9def6f020f Introduce tooling model for Kotlin gradle projects
A KotlinProject model for Gradle projects including Kotlin (JVM, JS or
common) plugins is introduced. Its model builder KotlinModelBuilder
produces an implementation of these models and can be queried through
the Gradle Tooling API when needed. Model builder is registered in the
corresponding Kotlin Gradle plugins.

Model definition should be published as a separate artifact in public
repositories so it can be consumed when needed.
2018-07-30 19:08:04 +03:00
Ilmir Usmanov
4b03db771a Minor. Fix test. 2018-07-30 18:59:44 +03:00
Mikhail Zarechenskiy
acd5b62148 Introduce limited constant conversions for Kotlin/Native
#KT-25320 Fixed
2018-07-29 04:32:32 +03:00
Alexander Udalov
1a51132884 Add CLI tests on internal from other module (JVM, JS, common) 2018-07-27 18:51:42 +02:00
Alexander Udalov
4bd66d5aa8 Add compiler argument -Xfriend-paths for kotlinc-jvm
#KT-21910 Fixed
2018-07-27 18:51:42 +02:00
Dmitry Savvinov
8edbb10420 Fix typo introduced in f90b29c2e3 2018-07-27 18:55:52 +03:00
Dmitry Savvinov
f90b29c2e3 Support contracts in PartialBodyResolveFilter
Previously, PartialBodyResolveFilter didn't know about contracts and was
filtering out calls of such functions, leading to unstable completion in
cases like that:

fun test(x: Any?) {
    require(x is String)
    x.<caret>
}

However, PartialBodyResolveFilter works by pure PSI, while to determine
if function has a contract we have to resolve it.

To solve it, we do something very similar to what has been done with
Nothin-returning functions: introduce
KotlinProbablyContractedFunctionShortNameIndex, which collects all
function which *may* have a contract during indexing.

^KT-25275 Fixed
2018-07-27 16:59:24 +03:00
Dmitry Savvinov
5ab79a111d Introduce 'mayHaveContract'-flag in stubs
This is needed for further commit, which supports contracts-based
smartcasts in partial body resolve mode.

NB: Stubs can be built from 3 sources:
- source code (contract presence can be checked by PSI)
- binary data (contract presence can be checked by Kotlin Metadata)
- decompiled sources

The last case is a bit of a headache, because usually bodies are omitted
in decompiled sources. To workaround it, we have to inject stubbed
contract-call in the body.
2018-07-27 16:59:24 +03:00
Dmitry Savvinov
24245c2245 Support compiler test directives in PartialBodyResolve tests 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
ca64346b55 Add compiler test directives to the list of valid directives 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
2a57807c85 Minor: reformat and clean-up KotlinFixtureCompletionBaseTestCase 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
099fc0ad51 Push compiler options from test directives into project-wide settings
This may be useful if we want to configure how we read binaries
2018-07-27 16:59:23 +03:00
Dmitry Savvinov
724b7bf363 Minor: rename and refactor contract-related PSI checks in ktPsiUtil 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
b943140f3a Move purely PSI checks of contract presence to ktPsiUtil.kt 2018-07-27 16:59:23 +03:00
Alexey Sedunov
5275e19c76 Move: Do not consider type alias -> expect class change as a conflict
Given they have the same fqname

 #KT-23594 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
1c30a12d95 Move: Account for implemented modules in internal access check
#KT-23590 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
0406d61622 Rename: Update filenames within expect/actual set (when necessary)
#KT-23772 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
d586a84f31 Configuration: Include test roots of dependent modules to the module scope
#KT-23914 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
04500914f3 Misc: Update Kotlin Gradle script icons for IDEA 182
#KT-25356 Fixed
2018-07-27 16:08:12 +03:00
Dmitry Petrov
893e19e9f8 StrictJavaNullabilityAssertions is enabled since 1.3
https://youtrack.jetbrains.com/issue/KT-20830#focus=streamItem-27-2670071-0-0
2018-07-27 09:52:29 +03:00
Dmitry Petrov
566b5856ec Constructor call normalization mode depends on language version 2018-07-27 09:52:29 +03:00
Roman Artemev
14b1f0ef6a Fix issue #KT-24475
* count coroutine metadata references during RemoveUnusedImport pass in JsInliner
* add cases to test usage of stdlib symbols in inlined functions
2018-07-26 19:23:06 +03:00
Anton Bannykh
75c7045ea7 JS: fix bug in resolveTemporaryNames.kt 2018-07-26 18:23:20 +03:00
Alexander Udalov
3323fd5a11 Check "kotlin" package usage when compiling common code
#KT-25369 Fixed
2018-07-26 17:10:33 +02:00
Mikhail Glukhikh
ddd3a0a46e Implement liftToExpected correctly for primary constructor properties
Before this commit, we always tried to find expect property in this case.
However, there is at least one case when we should find parameter of
expect primary constructor instead (safe delete).
So #KT-25321 Fixed
2018-07-26 18:01:42 +03:00
Mikhail Glukhikh
437b6f2c2d Keep Expected functions state while searching for a regular function
So #KT-25492 Fixed
2018-07-26 18:01:34 +03:00
Mikhail Glukhikh
14d6560e67 Add modality/visibility/inline to all expect/actual declarations in QF
So #KT-25539 Fixed
2018-07-26 18:01:01 +03:00
Mikhail Glukhikh
54b63ea43a Reformat: AddModifierFix 2018-07-26 18:00:58 +03:00
Mikhail Glukhikh
48017a81ee Move isEquivalentTo() from KtClass to KtClassOrObject
This makes objects and companions with the same qualified name
compatible from find usages point of view
So #KT-25326 Fixed
So #KT-25438 Fixed
2018-07-26 18:00:26 +03:00
Mikhail Glukhikh
a7d189cd1c Branch 173: delete unnecessary duplicate of KtClassOrObject 2018-07-26 18:00:22 +03:00
Mikhail Glukhikh
46cc773953 Test refactoring: header/impl -> expect/actual in safe delete tests 2018-07-26 18:00:21 +03:00
Mikhail Glukhikh
26b57c6250 MPP navigation / search: handle expect objects correctly #KT-25317 Fixed 2018-07-26 18:00:18 +03:00
Ilmir Usmanov
82f64b9b14 Generate LVT entry for continuation
#KT-25688: Fixed
2018-07-26 16:12:54 +03:00
Roman Artemev
dec307799a Fix infinite loop in suspend function in case of return from finally [#KT-21961]
* add test
2018-07-25 23:04:57 +03:00
Ilya Gorbunov
a81c06049a Fix creatures web-demo example
Rewrite val reassignment in getter with lazy property
2018-07-25 20:25:36 +03:00
Ilya Gorbunov
293e5794f0 Allow to skip JS IR tests with gradle property kotlin.compiler.js.ir.tests.skip 2018-07-25 20:25:15 +03:00
Nikolay Krasko
c210d3d10a Minor: remove duplicated copyright comment 2018-07-25 19:52:26 +03:00
Nikolay Krasko
4ff6f23d18 Refactoring: move getResolvedVersionByModuleData utility function 2018-07-25 19:52:26 +03:00
Nikolay Krasko
2d1fc4b798 Fix incompatibility because of KotlinGradleModelFacade change (KT-25713)
AndroidGradleModelFacade was moved to android plugin in AS 3.3, so
now changes in KotlinGradleModelFacade should be binary compatible.

Current fix rewrite KotlinGradleModelFacade to Java because of default
methods.

Also current implementation abuses the fact that AndroidGradleModelFacade
don't use groupId parameter for getting library versions.

 #KT-25713 Fixed
2018-07-25 19:52:25 +03:00
Nikolay Krasko
fb6bb0c8b7 Need to check compatibility when checking plugin from custom repository (KT-25714)
There's no no range check is done on the server side for custom urls not
from IntelliJ plugins repository.

 #KT-25714 Fixed
2018-07-25 19:52:25 +03:00
Toshiaki Kameyama
4d1b8405cb "Suspicious ==/===": do not report when comparison with null is included
So #KT-24001 Fixed
2018-07-25 16:15:59 +03:00
Toshiaki Kameyama
d15e43f38a Reformat SuspiciousEqualsCombination 2018-07-25 16:15:20 +03:00
Ilmir Usmanov
dc3b230b55 Do not generate continuation's setLabel and getLabel methods in 1.3
Also, do not call them.
 #KT-25521: Fixed
2018-07-25 15:35:18 +03:00
Ilmir Usmanov
a10bd9f5a3 Refactoring. Move transformRuntimeFunctionTypeToSuspendFunction to TypeDeserializer 2018-07-25 15:35:13 +03:00
Ilmir Usmanov
533dd44668 Refactoring. Make DeserializedMemberDescriptor somewhat immutable 2018-07-25 15:35:09 +03:00
Natalia Selezneva
0750de73e1 Distinguish exceptions about unknown module info 2018-07-25 15:30:49 +03:00
Zalim Bashorov
9b1915799c [psi2ir] Skip synthetic descriptors created for calls on something with dynamic type when collecting unbound symbols
#KT-23382 Fixed
2018-07-25 14:51:08 +03:00
Zalim Bashorov
a6cd552a71 [JS IR BE] Implement Long.rangeTo and unmute tests 2018-07-25 14:51:08 +03:00
Sergey Rostov
adcabd2a5a Kotlin Scripting IDE performance: cache file attributes in memory.
This saves ~2 secs on file highlighting pass.
2018-07-25 14:42:35 +03:00
Roman Artemev
eb420a1e0f Fix [#KT-23921]
* make name collector in inliner process handle JsCatch
 * visit JsParameter during live analyser in coroutine transformer
2018-07-25 14:22:11 +03:00
Alexander Udalov
31c968123c Regenerate tests 2018-07-25 11:30:57 +02:00
Toshiaki Kameyama
9e83506c02 Introduce intention: trimMargin <--> trimIndent #KT-25056 Fixed 2018-07-25 12:30:00 +03:00
Dmitry Petrov
df6d4f358a KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break',
'continue', or 'return' expressions.
2018-07-25 12:08:20 +03:00
Dmitry Petrov
6fb913a463 KT-22274 report error/warning on incorrect return target label 2018-07-25 12:08:20 +03:00
Roman Artemev
5241b37ad9 Fix fallthrough in suspendable switch [#KT-22694, #KT-23687]
* do not explicitly put break for each case
* add test for related cases
2018-07-24 20:19:35 +03:00
Roman Artemev
0c6256d003 Fix initialization order
* put inheritance code in the beginning
 * put top-level initializer after any declaration
2018-07-24 20:16:39 +03:00
Mikhail Zarechenskiy
cff066f702 Use consistent descriptors as keys
This commit fixes exception during IR generation with enabled new inferece,
 but the problem also can affect old inference.

 We were using originalTypeArguments (`resolvedCall.typeArguments`)
 that uses type parameters from *candidate* descriptor and were trying
 to get value by key from `resolvedCall.resultingDescriptor.original`,
 assuming that resolvedCall.resultingDescriptor.original equals to
 resolvedCall.candidateDescriptor, which can be wrong
2018-07-24 20:14:19 +03:00
Mikhail Zarechenskiy
f9b19c6286 [NI] Approximate types during type translation for IR 2018-07-24 20:14:17 +03:00
Mikhail Zarechenskiy
dddaa74dac Propagate language version settings into IR type translator 2018-07-24 20:06:35 +03:00
Nikolay Krasko
165218890f Fix max value components for KotlinVersion 2018-07-24 19:13:54 +03:00
Nikolay Krasko
fb2a42126d Minor: fix typo in suppression property name 2018-07-24 17:09:15 +03:00
Nikolay Krasko
1418d1f9e5 Refactoring: abandon custom MajorVersion class, use KotlinVersion 2018-07-24 17:09:15 +03:00
Nikolay Krasko
7b6df0a7cc Don't delete unresolved imports in cleanup inspection (KT-25678)
It looks like they were deleted because of the bug in search for deprecated
imports search.

 #KT-25678 Fixed
2018-07-24 17:09:14 +03:00
Alexander Udalov
20ddbc9698 Do not generate generic signature for SAM wrapper methods
#KT-23870 Fixed
2018-07-24 13:35:47 +02:00
Denis Zharkov
ac6874c221 Hide deprecated overload LanguageSettingsProvider::getLanguageVersionSettings
It's necessary only for binary compatibility
After recompilation it's expected to be resolved to an overload
with default parameter
2018-07-24 14:09:54 +03:00
Dmitry Petrov
9dc2ad664d Fix ConstantValue-related testData for lightClasses tests
TODO support custom language version settings for lightClasses tests
2018-07-24 10:52:16 +03:00
Dmitry Petrov
8f103dd8e5 Fix ConstantValue-related testData for loadJava tests 2018-07-24 10:52:16 +03:00
Mikhail Glukhikh
cc1d9e88d5 1.3 migration: make inspections working for non-experimental coroutines 2018-07-24 10:24:18 +03:00
Alexey Tsvetkov
76b9b579bc Minor: fix 172 patchset 2018-07-23 23:10:14 +03:00
Ilmir Usmanov
fa9653c3d2 Deserialize experimental coroutines as suspend functions/types
but deprecate them for now.
Promote stub version.
 #KT-25623: Fixed
2018-07-23 21:52:17 +03:00
Toshiaki Kameyama
88a5eb24d5 "Convert lambda to reference": fix case with companion object
So #KT-24385 Fixed
2018-07-23 18:21:38 +03:00
Toshiaki Kameyama
0ae2054af4 "Replace if with when": do not add empty else block #KT-18681 Fixed 2018-07-23 18:21:37 +03:00
Toshiaki Kameyama
3e207fd6b2 Move lambda out: don't apply to multiple/default functional parameters
So #KT-24694 Fixed
2018-07-23 18:21:37 +03:00
Toshiaki Kameyama
a9c91099a4 Correct "Redundant override" inspection message #KT-25608 Fixed 2018-07-23 18:21:37 +03:00
Anton Bannykh
0f087e354e JS IR: sort input files to make compilation stable 2018-07-23 18:20:05 +03:00
Dmitry Petrov
65fe1101fd Object references in object field initializers are 'GET_VAR this@Object' 2018-07-23 18:16:32 +03:00
Simon Ogorodnik
c3d20ae138 Fix quick-doc tests generation 2018-07-23 16:18:07 +03:00
Dmitry Petrov
d61a3c158e Fix ProjectImpl leak in PatternMatchingTypingVisitor 2018-07-23 16:05:47 +03:00
Alexey Tsvetkov
ff35d509e6 Add test for KT-25540 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
11977cc1c1 Add multi-module JS IC tests with JPS 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
3227300f18 Minor: rename setIsEnabled->setIsEnabledForJvm 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
8f002fdb43 JS IC: track lookups from libraries
Otherwise we don't track lookups from other modules

    #KT-25540 fixed
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
c8c0c773fb Report info message when JS IC is enabled in JPS 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
eef40a5940 Add setting to enable JS IC for JPS
#KT-25565 fixed
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
0b18380770 Use separate system properties to control IC for JVM and JS
Also this commit effectively disables JS IC by default

     #KT-25563 fixed
2018-07-23 15:43:16 +03:00
Svyatoslav Kuzmich
625983b28a [JS IR BE] Enum class lowering 2018-07-23 15:08:18 +03:00
Nikolay Krasko
668708170f Add intention for replacing experimental coroutines usages to cleanup (KT-25251)
#KT-25251 In Progress
2018-07-23 13:43:35 +03:00
Denis Zharkov
56a87ec98e Restore method broken in f72aa78eec
Otherwise plugin compatibility tests are failing
2018-07-23 10:36:31 +03:00
Denis Zharkov
01503a84d9 Partially revert 79e776e9d7 2018-07-23 10:36:31 +03:00
Yan Zhulanow
7803294546 PrePush hook (temporary): Do nothing on a download failure 2018-07-20 22:17:45 +03:00
Nikolay Krasko
8fc377b3b3 Do not spam for same compiler version during the session (KT-25546)
Otherwise it might be too distracting when auto-import feature is enabled.
2018-07-20 19:15:20 +03:00
Nikolay Krasko
94e5f25569 Guarantee max compiler version will be shown in popup (KT-25546) 2018-07-20 19:15:20 +03:00
Nikolay Krasko
4be5c395aa Show popup about too old bundled compiler in Gradle and Maven (KT-25546) 2018-07-20 19:15:19 +03:00
Nikolay Krasko
d27002827e Refactoring: move ModuleSourceRootMap.kt from idea-jvm to idea module 2018-07-20 19:15:19 +03:00
Nikolay Krasko
99e0b998cf Minor: show class of the problem file in error 2018-07-20 19:15:19 +03:00
Simon Ogorodnik
b58e35a3e5 173: Revert changes for IDEA < 181 2018-07-20 18:41:24 +03:00
Simon Ogorodnik
c2e27a3c46 KT-22815: Rename parameter to match semantics 2018-07-20 18:41:21 +03:00
Simon Ogorodnik
ad6eac6ec6 KT-22815: Cleanup findKDoc logic 2018-07-20 18:41:18 +03:00
Simon Ogorodnik
1bd02472a2 KT-22815: Fix documentation for primary constructor params/props 2018-07-20 18:41:14 +03:00
Simon Ogorodnik
c608395c7c KT-22815: Update testData 2018-07-20 18:41:11 +03:00
Simon Ogorodnik
9ec0ce6ec8 KT-22815: Show documentation for function value/type params 2018-07-20 18:41:08 +03:00
Simon Ogorodnik
e4d76382b8 KT-22815: Update testData for quick documentation 2018-07-20 18:41:04 +03:00
Simon Ogorodnik
0b9d4a93dd KT-22815: Use 'Params' instead of 'Parameters' to save h-space 2018-07-20 18:41:01 +03:00
Simon Ogorodnik
6e95ae7393 KT-22815: Put colon after section names 2018-07-20 18:40:56 +03:00
Simon Ogorodnik
b237298c20 KT-22815: Position deprecated section between definition and description 2018-07-20 18:40:49 +03:00
Simon Ogorodnik
1918836340 KT-22815: Use gray color for filename 2018-07-20 18:40:38 +03:00
Simon Ogorodnik
84b299d7dc KT-22815: Use bold for root identifier, and not for keywords 2018-07-20 18:40:30 +03:00
Simon Ogorodnik
33a6721270 KT-22815: Update quick-doc testData 2018-07-20 18:40:21 +03:00
Simon Ogorodnik
48d0493edb Fix enum special function quick navigation behaviour 2018-07-20 18:40:15 +03:00
Simon Ogorodnik
9a34e91dec KT-22815: Render annotations on separate lines 2018-07-20 18:40:10 +03:00
Simon Ogorodnik
831e7fdc06 KT-22815: Render definition file for top-level declarations
Do not show defined in for local declarations
2018-07-20 18:40:05 +03:00
Simon Ogorodnik
6255743148 KT-22815: Cleanup quick doc rendering 2018-07-20 18:40:00 +03:00
Simon Ogorodnik
1d0fc0e736 Copy template engine from ktor 2018-07-20 18:39:57 +03:00
Simon Ogorodnik
9283089397 Reformat 2018-07-20 18:39:54 +03:00
Simon Ogorodnik
bfa5afa564 KT-22815: Cut Java signatures off properly 2018-07-20 18:39:52 +03:00
Simon Ogorodnik
263ed47aac KT-22815: Render sections properly 2018-07-20 18:39:48 +03:00
Simon Ogorodnik
39e72f4041 Reformat 2018-07-20 18:39:45 +03:00
Simon Ogorodnik
99f0a0368a KT-22815: Wrap parameters and try new DocumentationMarkup 2018-07-20 18:39:42 +03:00
Dmitry Petrov
86e863951e Compare FP numbers properly when determining if field initializer needed 2018-07-20 17:53:25 +03:00
Roman Elizarov
819ffe7117 Remove suspending function migration adapters for 1.3-M1 2018-07-20 16:57:42 +03:00
Dmitry Petrov
ae0704af9c Generate singleton references as GET_OBJECT in nested classes 2018-07-20 16:46:18 +03:00
Dmitry Petrov
779cae7db5 Adjust receivers for possibly synthetic properties access
Synthetic property accessors are treated as extension functions on Java
classes by the front-end. However, underlying Java accessor methods are
proper members.
2018-07-20 16:46:18 +03:00
Denis Zharkov
73acc86785 Store computed library kind for jar in a file attribute
It should help to avoid visiting children of each jar in java projects
LibraryEffectiveKindProviderImpl has it's own in-memory cache
but it doesn't help when project is reopened

 #KT-25129 Fixed
 #KT-25034 Fixed
2018-07-20 15:35:58 +03:00
Alexander Udalov
ad326f7875 Fix assert on parameter type length for functions with big arity
In case of a bridge for a vararg invoke with big arity, the bridge only
has one parameter (array of parameters), and the delegate method has at
least 23 parameters. This assert was added in 77959247d2 and it didn't
cause any tests in master to fail because tests on functions with big
arity are disabled there
2018-07-20 14:01:09 +02:00
Dmitry Savvinov
6dacd1011f Do not report warning if -XXLanguage turns on bugfix
KT-25554 Fixed
2018-07-20 14:24:42 +03:00
Alexander Udalov
e42017a468 Fix ISE in ReflectJavaMember.getValueParameters on Java 6
The exception was incorrectly introduced in 0f0602230a. We should not
fail when `names` is null, only when there's no element at the
corresponding index. On Java 6, `names` is always null. On Java 8,
`names` is never null (it's an empty list if the class was compiled
without "-parameters")
2018-07-20 13:11:11 +02:00
Mikhail Zarechenskiy
f8d19718c8 Fix exception on trying to evaluate red code with inline classes
#KT-25600 Fixed
2018-07-20 13:58:35 +03:00
Mikhail Zarechenskiy
17243c08c1 Forbid lateinit variables of inline class types
Proper support of lateinit inline class values will be added later,
 see #KT-23814

 #KT-25603 Fixed
2018-07-20 13:58:33 +03:00
Mikhail Zarechenskiy
045058c29a Support inline class values inside string templates through boxing
#KT-25626 Fixed
 #KT-25613 Open
2018-07-20 13:58:31 +03:00
Mikhail Zarechenskiy
9aa4247065 Do not box primitives in a single-entry string template expression 2018-07-20 13:46:11 +03:00
Mikhail Zarechenskiy
045e3f53b0 Propagate KotlinType into codegen methods where it's possible 2018-07-20 13:46:09 +03:00
Mikhail Zarechenskiy
ec9d8e580e Leave boxing for compareTo/areEqual methods for inline classes
Inline classes can override methods and thus introduce side effects
2018-07-20 11:51:34 +03:00
Denis Zharkov
4e7718bfff Minor. Extract many properties to ImportResolutionComponents 2018-07-20 11:27:08 +03:00
Denis Zharkov
0b2fde3886 State on types level that forcing imports works only for non-default 2018-07-20 11:27:08 +03:00
Denis Zharkov
79e776e9d7 Drop KtImportsFactory as it became unused after previous commit 2018-07-20 11:27:08 +03:00
Denis Zharkov
ec23695f77 Avoid creating fake PSI for default imports
#KT-13860 Fixed
2018-07-20 11:27:08 +03:00
Dmitry Petrov
acf0bb349c Update testData for restricted expression annotations retention 2018-07-20 10:39:51 +03:00
Dmitry Petrov
92a8448042 DiagnosticsTestWithJsStdLib should use proper language version settings 2018-07-20 10:39:51 +03:00
Yan Zhulanow
63d37ec93b as33: Remove AndroidGradleOrderEnumerationHandler (should be moved to the Android plugin) 2018-07-19 19:09:40 +03:00
Yan Zhulanow
314cc5c2f5 Add support for Android Studio 3.3 Canary 1 2018-07-19 19:09:40 +03:00
Yan Zhulanow
315de660ca Minor: Make plugin.xml and build files more consistent with the main bunch 2018-07-19 19:09:40 +03:00
Yan Zhulanow
88422fb7ce Make source set empty for Android modules of deleting the resulting JAR files in 'ideaPlugin' task 2018-07-19 19:09:40 +03:00
Raluca Sauciuc
0e8a04c4ba as33: Android dependency reversal
(cherry picked from commit be781f4f462f74ca0efcc91b5c07a5b3756ba5b2)
2018-07-19 19:09:39 +03:00
Georgy Bronnikov
db19a6e150 Make @JvmOverloads work with JVM_IR 2018-07-19 18:36:37 +03:00
Yan Zhulanow
1eb69a6960 Kapt: Do not add JDK jars if the 'no-jdk' option is set (KT-25258) 2018-07-19 17:31:25 +03:00
Nikolay Krasko
bdbe6d617c Remove setting kotlin internal mode in pill configurations 2018-07-19 16:37:28 +03:00
Denis Zharkov
f72aa78eec Fix libraries analysis for case of isReleaseCoroutines feature enabled
#KT-25466 In Progress
2018-07-19 16:19:04 +03:00
Nikolay Krasko
f1463b4a2e Add version replace fix for kotlinx coroutines in Maven (KT-25251) 2018-07-19 16:09:57 +03:00
Nikolay Krasko
481c428881 Add version replace fix for kotlinx coroutines in Gradle (KT-25251)
#KT-25251 In Progress
2018-07-19 16:09:57 +03:00
Nikolay Krasko
86a33defd8 Refactoring: introduce parameter for getResolvedKotlinStdlibVersionByModuleData 2018-07-19 16:09:56 +03:00
Nikolay Krasko
7358cc5bd6 Fix QuickFix-es with the same family name should be the same class instances (KT-25251)
#KT-25251 In Progress
2018-07-19 16:09:56 +03:00
Nikolay Krasko
adfa469b21 Maven inspection for incompatible coroutines libraries (KT-25251)
#KT-25251 In Progress
2018-07-19 16:09:56 +03:00
Nikolay Krasko
3bb9288e86 Refactoring: remove ProgressManager.progressIndicator usages 2018-07-19 16:09:55 +03:00
Alexey Sedunov
652d074bca Misc: Change display name of Kotlin/Protractor run configuration type
#KT-25595 Fixed
2018-07-19 15:20:51 +03:00
Ilmir Usmanov
0ed5ec868c Generate probeCoroutineSuspended call in suspendCoroutineUninterceptedOrReturn
#KT-25508: Fixed
2018-07-19 14:24:09 +03:00
Dmitry Savvinov
76c651421b Deprecate visibility of static members inherited from Java
Now they are not visible by short name through companion objects, just
like classifiers in KT-21515

^KT-25333 In progress
2018-07-19 13:32:38 +03:00
Dmitry Savvinov
63202fe560 Minor: spelling fixes in javadocs 2018-07-19 13:32:37 +03:00
Dmitry Petrov
99a71b9ecc Desugar synthetic Java properties in psi2ir 2018-07-19 12:34:45 +03:00
Dmitry Petrov
44962b00b2 Introduce SyntheticPropertyDescriptor interface 2018-07-19 12:34:45 +03:00
Dmitry Petrov
4061a36506 Minor: reformat 2018-07-19 12:34:45 +03:00
Dmitry Petrov
76bfb94538 Add tests for Java synthetic properties in external dependencies 2018-07-19 12:34:45 +03:00
Mikhael Bogdanov
56c535d505 Fix test data 2018-07-19 10:52:13 +02:00
Roman Elizarov
f5193802fc Uncommented coroutines tests that were failing due to inline class bugs 2018-07-19 10:32:55 +03:00
Yan Zhulanow
094cb6be1d Pill: Add an order entry for module's sources 2018-07-18 22:05:36 +03:00
Yan Zhulanow
2049d00ca8 Pill: Fix packages to find tests in for default test run configurations 2018-07-18 22:05:36 +03:00
Yan Zhulanow
e243dd18c1 Pill: Add "-Duse.pill=true" parameter to the default test configurations
This switches 'JUnit3RunnerWithInners' to the JPS mode.
2018-07-18 22:05:36 +03:00
Yan Zhulanow
af2f5549c5 Debugger: Do not report division by zero also for rem 2018-07-18 22:05:36 +03:00
Alexander Udalov
1464a4ac58 Load Java parameter names correctly in BinaryJavaMethod
PSI-based implementation (accessible via
`-Xuse-old-class-files-reading`) loads parameter names from the
"MethodParameters" attribute if it's present, so our own implementation
should as well.

This metadata doesn't seem supported in the java.lang.model.element API
though, so SymbolBasedValueParameter (which is used in `-Xuse-javac`)
will continue to have incorrect behavior for now

 #KT-25193 Fixed
2018-07-18 18:15:09 +02:00
Alexander Udalov
0f0602230a Fix parameter names of Java inner classes in reflection
#KT-25541 Fixed
2018-07-18 18:15:09 +02:00
Alexander Udalov
873e1b01d6 Merge and improve tests on Java parameter metadata in reflection 2018-07-18 18:15:08 +02:00
Alexander Udalov
5fbe35d1c8 Add tests on RequireKotlin on nested classes with metadata version 1.4 2018-07-18 17:59:37 +02:00
Alexander Udalov
ea3c5c0107 Use -Xmetadata-version in tests instead of custom preprocessing
Test data for the wrongMetadataVersion test has changed because now not
only the .class files have the "future" version, but also the
.kotlin_module file, which prevents the current compiler from being able
to read what parts does a package in the library consist of. This is
related to the TODO in ModuleMapping.kt:89
2018-07-18 17:59:37 +02:00
Alexander Udalov
871b896a21 Add internal compiler argument to change metadata version
Will be used in tests to check how we behave on binaries produced by a
"future" compiler
2018-07-18 17:59:37 +02:00
Alexander Udalov
cfc0f5e453 Support correct way of writing/loading version requirement table
Tests are added in subsequent commits.

KT-25120 Fixed
2018-07-18 17:59:37 +02:00
Alexander Udalov
4122021090 Add BinaryVersion to DeserializationContext
This will be useful to implement version-dependent deserialization,
which is needed for gradual fixes of issues in metadata

 #KT-25120 In Progress
2018-07-18 17:58:46 +02:00
Alexander Udalov
1e9694f1db Fix version requirement serialization for nested classes
Use the version requierement table of the outer DescriptorSerializer
instance when serializing metadata for a class. Pass parent serializer
to DescriptorSerializer.create to make sure the correct table is used.
Serialize nested classes before the outer class in JS and common code,
to make sure requirements are not lost. Also, split
VersionRequirementTest to JVM and JS

 #KT-25120 In Progress
2018-07-18 17:58:46 +02:00
Ilya Chernikov
a61de052c7 Do not throw on incompatible cli scripting plugin
More reliably fixes #KT-24946, #KT-24438 and alike
2018-07-18 15:15:41 +02:00
Roman Artemev
e4b314c26c Fix inlining of invoke operator [#KT-25474]
* add test
2018-07-18 16:12:41 +03:00
Dmitry Petrov
a457a9f870 Update testData for IDEA tests for annotations with target EXPRESSION 2018-07-18 15:56:11 +03:00
Svyatoslav Kuzmich
b23dabb8b7 Revert EXPECTED_REACHABLE_NODES for failed tests 2018-07-18 15:31:29 +03:00
Dmitry Petrov
82f22f92ca Don't generate ConstantValue for non-const vals in Kotlin 1.3+ 2018-07-18 15:02:54 +03:00
Georgy Bronnikov
7640b7f63a Stylistic changes suggested in review for @JvmStatic 2018-07-18 14:29:03 +03:00
Alexander Udalov
1e675bdc01 Simplify implementation of JvmField property in interface companion
Move parts of the logic to the only places where they're needed:
checking for public/final/val is only needed in
JvmFieldApplicabilityChecker, checking the proto flag is only needed in
reflection, checking the JvmField annotation presence is only needed in
backend
2018-07-18 13:24:45 +02:00
Alexander Udalov
79c2aa4acf Minor, move tests on JvmField into subdirectory 2018-07-18 13:24:45 +02:00
Alexander Udalov
715abda908 Add JvmFlags, use flags field instead of is_moved_from_interface_companion
To be able to add more property-related flags into the same int field
later
2018-07-18 13:24:44 +02:00
Dmitry Petrov
5767f84c0e Restrict retention for annotations with target EXPRESSION
#KT-13762 Fixed
2018-07-18 14:21:03 +03:00
Ilya Chernikov
70eaa0ec75 Cleanup annotations in script-util:
remove unused targets and runtime retention
2018-07-18 13:11:32 +02:00
Roman Elizarov
20c255948a Coroutines migration adapters 2018-07-18 12:29:17 +03:00
Dmitry Petrov
ebe3fca45c Enable ProperIeee754Comparisons in "progressive mode"
See https://youtrack.jetbrains.com/issue/KT-22723#focus=streamItem-27-2917037-0-0
2018-07-18 12:10:10 +03:00
Denis Zharkov
cc2280b95b Fix test data after 89d99e3989 2018-07-18 11:14:46 +03:00
Mikhail Zarechenskiy
48606ad983 Advance bootstrap to 1.2.70-dev-491 2018-07-18 11:05:09 +03:00
Mikhael Bogdanov
bca6b98ea8 Fix test data 2018-07-18 08:41:48 +02:00
Mikhail Zarechenskiy
bb575866cb Pass actual invoke parameters for inline functions with inline classes
#KT-25511 Fixed
2018-07-17 23:39:38 +03:00
Mikhail Zarechenskiy
77959247d2 Fix bridge generation for inline classes over Any type 2018-07-17 23:39:34 +03:00
Ilmir Usmanov
4811757d8d Disable intercepted instrinsic in 1.3
Fix compiler bootstrapping.
2018-07-17 22:25:43 +03:00
Nicolay Mitropolsky
a616f6cca9 Uast: implicit receiver for local function calls (KT-25524) 2018-07-17 21:41:03 +03:00
Nicolay Mitropolsky
5212728a82 Uast: implicit receiver for function variables calls (KT-25524) 2018-07-17 21:41:03 +03:00
Alexander Udalov
53a57e8e1b Reformat module 'deserialization', fix warnings/inspections 2018-07-17 20:26:31 +02:00
Alexander Udalov
ae6627fe94 Simplify code in JS serialization related to module descriptors
Do not use `JsModuleDescriptor<...>` where only its `data` is needed
2018-07-17 20:26:31 +02:00
Alexander Udalov
77405b2cca Reformat module 'js.serializer' 2018-07-17 20:26:31 +02:00
Yan Zhulanow
37411c823d Android Extensions: Check the backing 'virtualFile' validity before calling 'findFile()' (EA-124028) 2018-07-17 20:54:30 +03:00
Yan Zhulanow
a4b3653e1c Debugger: Navigate to the right file in MPP projects (#KT-25152, #KT-25147) 2018-07-17 20:54:29 +03:00
Yan Zhulanow
02ee3aef3f Kapt: Fix "Unknown option: infoAsWarnings" (#KT-25396) 2018-07-17 20:54:28 +03:00
Svyatoslav Kuzmich
1abb4f42ac [JS IR BE] Add ranges to runtime, rangeTo for primitive numbers 2018-07-17 20:18:29 +03:00
Pavel V. Talanov
4c38899a2a Improve error message on failing to get javaResolutionFacade 2018-07-17 17:37:22 +02:00
Pavel V. Talanov
770c280ba5 Light classes: handle broken context in case of supertype delegation
This lead to an exception being thrown frequently
Proper fix would be to prevent binding context from being corrupted
Known cases are hard to debug/reproduce

 #EA-101081 Fixed
2018-07-17 17:37:20 +02:00
Ilmir Usmanov
991b4251f3 Remove redundant RequireKotlin annotations from coroutines' stdlib. 2018-07-17 17:31:03 +03:00
Ilmir Usmanov
38c4006d9e Update bootstrap compiler. 2018-07-17 17:30:58 +03:00
Dmitry Savvinov
db1fc7f358 Use 'stableName' instead of 'name' in tests on module name 2018-07-17 17:14:22 +03:00
Mikhael Bogdanov
52b261e19e Fix test data 2018-07-17 13:30:43 +02:00
Alexander Udalov
bca3e1b95b Restore getDefaultImports for compatibility with an external plugin
(see ce34deb9af)
2018-07-17 12:48:43 +02:00
Roman Elizarov
2236049341 Wrapper for suspend fun main and @Test suspend fun testXXX functions. 2018-07-17 12:15:02 +03:00
Roman Elizarov
d33d21907d SuccessOrFailure test on JVM added 2018-07-17 12:15:01 +03:00
Roman Elizarov
0b59061bfe Coroutines debug probes 2018-07-17 12:15:01 +03:00
Roman Elizarov
78192ea712 Fixed createCoroutineFromSuspendFunction
Passes an object that extends BaseContinuationImpl to the
suspend function invocation, so that it can use .intercepted on it.
This requires implementation to track its state via label variable.
2018-07-17 12:14:59 +03:00
Roman Elizarov
d3982472a4 Explanatory comment to createCoroutineFromSuspendFunction 2018-07-17 11:28:48 +03:00
Roman Elizarov
96b5bb1b31 Fixed JVM Serialization problems:
* EmptyCoroutineContext readResolve fixed
* CombinedContext.writeReplace serializes all context elements
2018-07-17 11:28:38 +03:00
Roman Elizarov
e0f6165f10 Updated SuccessOrFailure:
* Parameter names for lambda
* getOrElse takes exception parameters
* fold added
* Improved docs
2018-07-17 11:26:49 +03:00
Nikolay Krasko
2a6dfba8bc Check kotlinx.coroutines libraries used with Kotlin 1.3 in Gradle (KT-25251)
#KT-25251 In Progress
2018-07-17 02:46:34 +03:00
Nikolay Krasko
f9de91016a Inspection for experimental coroutines imports migration (KT-25251)
#KT-25251 In Progress
2018-07-17 02:22:14 +03:00
Nikolay Krasko
5b34498162 Do not report code style warnings on overridden declarations (KT-25416)
#KT-25416 Fixed
2018-07-17 02:22:14 +03:00
Mikhail Zarechenskiy
b6db8971e4 Warn about annotations that targets non-existing accessors
#KT-15453 In Progress
2018-07-17 00:22:53 +03:00
Dmitry Savvinov
70144f8003 Make warning about usage of -XX-flags less scary 2018-07-16 18:49:21 +03:00
Dmitry Savvinov
9634734abf Minor: fix kdoc of LanguageFeature.Kind 2018-07-16 18:49:20 +03:00
Pavel V. Talanov
48a38f1820 Do not try inexact resolve on scripts
Script light psi depends on script definition
    which is costly to compute correctly

 #KT-25395 Fixed
2018-07-16 16:25:18 +02:00
Mikhael Bogdanov
5b8df2f6f2 Use proto flag to determine companion field moved to interface 2018-07-16 16:13:18 +02:00
Mikhael Bogdanov
e00b7a993f Write version requirements for @JvmField in interface companion 2018-07-16 16:13:18 +02:00
Mikhael Bogdanov
b412c90cef Move version requirements serialization for @JvmDefault to JvmSerializerExtension 2018-07-16 16:13:17 +02:00
Mikhael Bogdanov
0ca3afbb34 Code clean after converion 2018-07-16 16:13:17 +02:00
Mikhael Bogdanov
8633e8b329 Convert JvmSerializerExtension to Kotlin 2018-07-16 16:13:16 +02:00
Mikhael Bogdanov
ac7f33a9b5 Rename JvmSerializerExtension.java to JvmSerializerExtension.kt 2018-07-16 16:13:16 +02:00
Mikhael Bogdanov
1d283d243e Support @JvmField on interface properties
#KT-15807 Fixed
2018-07-16 16:13:15 +02:00
Mikhael Bogdanov
719c1882e0 Add new flag to proto for field moved out from interface companion 2018-07-16 16:13:14 +02:00
Mikhael Bogdanov
f3b419377b Minor. Reformat 2018-07-16 16:13:14 +02:00
Alexey Sedunov
65e763d562 Misc: Fix flaky test failing due to unstable ordering of libraries 2018-07-16 16:12:23 +03:00
Ilmir Usmanov
8fa3584c5c Minor. Fix test 2018-07-16 15:09:23 +03:00
Ilmir Usmanov
bc4a7aec76 Remove suspendCoroutineOrReturn intrinsic from compiler
#KT-21240: Fixed

Also, change logic of intrinsics check.

 #KT-23438: Fixed
2018-07-16 15:09:18 +03:00
Alexander Udalov
f766b2c473 Improve "optimize imports" behavior on default imports
Optimize imports to classes when there's an import of a type alias to
that class with the same name. This results in "java.lang.*" imports
being optimized in favor of the corresponding type aliases in "kotlin.*"
which are imported by default
2018-07-16 13:45:11 +02:00
Alexander Udalov
ce34deb9af Delete DefaultImportProvider, refactor TargetPlatform.defaultImports 2018-07-16 13:45:11 +02:00
Alexander Udalov
1f0fb4823f Simplify DefaultImportProvider, introduce "low priority imports"
Previously, packages `java.lang` and `kotlin.jvm` were imported on JVM
by default on the same rights, causing problems when the same classifier
existed both in `java.lang` and `kotlin.jvm`. Since the only known case
of such conflict were type aliases to JVM classes, the corresponding
classes (expansions of those type aliases) were manually excluded from
default imports. This made the code in DefaultImportProvider complicated
and resulted in multiple problems, regarding both correctness and
performance (see 82364ad3e5, a9f2f5c7d0, dd3dbda719).

This change adds a new concept, a "low priority import", and treats
`java.lang` as such. Since these imports are now separated from the rest
of default imports in LazyImportScope via secondaryClassImportResolver,
conflicts between classifiers are handled naturally: the one from
`kotlin.jvm` always wins (unless the one from `java.lang` is imported
explicitly, of course). This approach is simpler, safer and does not
require any memory to cache anything.

Skip ResolveToJava.kt test for javac-based resolve; it now fails because
of a weird issue which I didn't have time to investigate (this is OK
because it's a corner case of an experimental functionality)
2018-07-16 13:45:11 +02:00
Mikhail Zarechenskiy
857cc0f728 Make tests about mod and varargs valid for 1.3 version 2018-07-16 14:01:59 +03:00
Alexander Udalov
f03dc62173 Ignore tests on big function types until master is 1.3 2018-07-16 11:11:35 +02:00
Alexander Udalov
dcbb8045bd Disallow function types with big arity on JVM if LV < 1.3 or API < 1.3
The implementation is a bit obscure because this worked on JS since
Kotlin 1.0 and we should not break that; however, on JVM, a diagnostic
will be reported with old language/API version

 #KT-25241 Fixed
2018-07-16 10:41:27 +02:00
Alexander Udalov
56f509ba09 Support function types with >= 23 parameters
See https://github.com/Kotlin/KEEP/issues/107

 #KT-13764 Fixed
2018-07-16 10:41:27 +02:00
Max Medvedev
5c8afea68e Completion fallback to DescriptorToSourceUtilsIde.getAnyDeclaration
That's in case if DescriptorToSourceUtils.getSourceFromDescriptor fails

#KT-22373 Fixed
2018-07-14 15:17:03 +03:00
Zalim Bashorov
74df1208ae Make "localClassCaptureExtensionReceiver" test more robust and mute it for JS IR BE 2018-07-13 23:42:41 +03:00
Zalim Bashorov
3f0b31dc23 Speed up JS IR BE tests compiling the common parts (runtime + test common utils) once (on demand) and sharing the result between tests
It's a temporary hack until we implement IR based library format.
It relies on the fact that currently, IR BE generates stable (enough) names.​
2018-07-13 23:42:41 +03:00
Zalim Bashorov
34758110ee JS IR test runner: collect all .kt files from the "irRuntime" dir automatically instead of declaring each one in the list 2018-07-13 23:42:40 +03:00
Nikolay Krasko
dfcc41ebb0 Fix source position NPE (EA-118863) 2018-07-13 20:00:05 +03:00
Nikolay Krasko
f1c87376b9 Another NPE in PlainTextPasteImportResolver.kt (EA-91517) 2018-07-13 20:00:05 +03:00
Nikolay Krasko
5e35fd1758 Check created javaFileFacadeFqName short name (EA-122324) 2018-07-13 20:00:05 +03:00
Nikolay Krasko
819f6c036b Add '//' char to identifier validity check 2018-07-13 20:00:05 +03:00
Nikolay Krasko
ee5d357336 Guard PatternConfigurationProducer usages with JUnit presence check (EA-122472) 2018-07-13 20:00:04 +03:00
Nikolay Krasko
752cdedfe2 Stop reporting "using default platform" messages to log (KT-15300)
#KT-15300 Fixed
2018-07-13 20:00:04 +03:00
Alexander Udalov
dec003af71 Minor, improve wording in exception message 2018-07-13 18:45:44 +02:00
Alexander Udalov
66b383349f Fix regression in reflection on looking up equals/hashCode/toString in interface
Caused by 4266e50be8 and 8ccbbf71ec. Previously it worked because we
used hardcoded signatures of equals/hashCode/toString and always looked
them up in java.lang.Object

 #KT-25404 Fixed
2018-07-13 18:45:44 +02:00
Alexander Udalov
1f4dfbf5f3 Fix compilation of Java 9 sources for kotlin-reflect-api
Do not pass the jars for modules such as descriptors, descriptors.jvm,
etc to `--module-path` because javac assumes that these are separate
modules (even though they're listed later as parts of this module in
`--patch-module), and prohibits to have split packages and foreign
service implementations among them
2018-07-13 18:45:09 +02:00
Alexander Udalov
0d03d5abf6 Regenerate tests 2018-07-13 18:40:31 +02:00
Denis Zharkov
89d99e3989 Refine diagnostics for nullability migration warnings
#KT-24911 Fixed
2018-07-13 17:51:21 +03:00
Georgy Bronnikov
f85030b1e6 Remove a file added by mistake 2018-07-13 16:16:39 +03:00
Mikhail Zarechenskiy
820d168607 First, check for inline class type before boxing
The problem was that if `type` is of primitive type, but `KotlinType` is
 actually an inline class type, then anyway we boxed this type as primitive
2018-07-13 15:48:21 +03:00
Nicolay Mitropolsky
3c71761cf3 lightAnnotations: check element validity before resolving call 2018-07-13 15:46:44 +03:00
Nicolay Mitropolsky
cedc6821c3 lightAnnotations: proper parents for KtLightAnnotationsValues 2018-07-13 15:45:30 +03:00
Georgy Bronnikov
8478c73434 Make @JvmStatic work on JVM_IR 2018-07-13 13:43:02 +03:00
Toshiaki Kameyama
2547612d54 Implement Smart Enter handler for value argument list (KT-18807)
#KT-18807 Fixed
2018-07-13 13:04:19 +03:00
Natalia Selezneva
25cc85241f 172: Fix absent method in 172 branch 2018-07-13 12:02:08 +03:00
Natalia Selezneva
68ffcdc653 182: Fix imports in 182 branch 2018-07-13 11:33:10 +03:00
Natalia Selezneva
6835e5dd6f Wraps syncPublisher() call in KotlinCompilerSettings in a dispose check
Fix ConfigureKotlinTest
2018-07-13 09:50:42 +03:00
Mikhail Zarechenskiy
ef2095e4d3 Mute tests about unsigned types for JS backend 2018-07-13 00:27:12 +03:00
Yan Zhulanow
a464cc7f28 Minor: Do not report stack traces about PCE to the debug log 2018-07-12 20:36:42 +03:00
Yan Zhulanow
2070d40963 Minor: Move safeSourceName to utils, make it a function 2018-07-12 20:36:41 +03:00
Yan Zhulanow
423bd573a3 Kapt: Do not add imports for overloaded callables (#KT-25071) 2018-07-12 20:36:41 +03:00
Yan Zhulanow
00edc007f8 Minor: Fix the "Could not find installation home path" terminal warning 2018-07-12 20:36:41 +03:00
Yan Zhulanow
f6afab1226 Minor: Remove an obsolete warning in Android subplugin 2018-07-12 20:36:41 +03:00
Yan Zhulanow
22cfde3d43 Debugger: Check if the class instance is not yet collected before usage (EA-118758) 2018-07-12 20:36:41 +03:00
Yan Zhulanow
a2fdf7d47d Evaluator: Support when expressions (EA-119639) 2018-07-12 20:36:41 +03:00
Yan Zhulanow
c749a222eb Debugger: Add a missing read action (EA-119592) 2018-07-12 20:36:41 +03:00
Yan Zhulanow
2203615085 Check if the stackFrame we use is valid (EA-120312)
Unfortunately, the 'isValid' is a private field in StackFrameImpl so we have to catch an exception with an empty catch block.
2018-07-12 20:36:41 +03:00
Yan Zhulanow
cf3550b139 Add a number of runReadAction() in debugger (EA-120985) 2018-07-12 20:36:40 +03:00
Yan Zhulanow
115356b990 Eval4J: Do not report certain kinds of exceptions to EA 2018-07-12 20:36:40 +03:00
Yan Zhulanow
d8bab58b2c Minor: Fix exception message 2018-07-12 20:36:40 +03:00
Yan Zhulanow
d6db9e8f6f Evaluator: Do not report division by zero (EA-122365) 2018-07-12 20:36:40 +03:00
Yan Zhulanow
f16da8c566 Debugger: Add a missing read action (EA-123238) 2018-07-12 20:36:40 +03:00
Yan Zhulanow
6392adcfc9 Kapt: Ensure we collect .java files from the unique directories (#KT-24963) 2018-07-12 20:36:40 +03:00
Yan Zhulanow
20299f6224 Pill: Allow '18x-SNAPSHOT' versions 2018-07-12 20:36:40 +03:00
Yan Zhulanow
778df36dfa Debugger: Exclude inline callable usages inside itself (EA-117459) 2018-07-12 20:36:39 +03:00
Yan Zhulanow
6e3c2e8015 Revert "Android Extensions: Allow to access library project resources in Gradle setup (#KT-22430)"
This reverts commit a70707b
2018-07-12 20:36:39 +03:00
Raluca Sauciuc
e0137ed1d5 Android Extensions: make synthetic import resolution more resilient
In commit ec0abb0 (Fix EA-79206: Process only valid layout.xml...) we
started to drop layouts with invalid PsiFiles during resolution of
(synthetic) package fragments.

In Android Studio we run into invalid files quite often, and it seems
to be caused by a race with some invokeLater'ed code from android-ndk;
this has the side effect of now showing all the corresponding symbols
as unresolved, and the imports themselves are suggested for removal.

As a temporary fix I propose we try again to get a valid PsiFile.

Bug: https://issuetracker.google.com/78547457
(cherry picked from commit 3e8789225bd653caaedeca7f761a6442d48214b0)
2018-07-12 20:36:39 +03:00
Raluca Sauciuc
e7c1f578d1 Recognize Instant Apps plugin
Tested with sample project and Studio 3.2 Canary 18:
https://github.com/googlesamples/android-instant-apps/tree/master/hello-kotlin

(cherry picked from commit 528d66d5840cc8f584270c516e85da1a632df8b8)
2018-07-12 20:36:39 +03:00
Yan Zhulanow
392460e426 Kapt: Allow to disable info->warning mapping in logger (#KT-24985) 2018-07-12 20:36:39 +03:00
Yan Zhulanow
8b3aa3dc7f as32: Kapt: 'kapt.kotlin.generated' is not marked as source root in Android Studio (#KT-24449) 2018-07-12 20:36:39 +03:00
Yan Zhulanow
b2938ceacf Remove Gradle(Java) Kotlin configurator in Android modules (#KT-17946) 2018-07-12 20:36:39 +03:00
Yan Zhulanow
06af2a88f0 Uast: Move all IDE-related code to uast-idea, get rid of the 'idea' dependency
Uast is used in the CLI version of Android Lint so 'uast-kotlin' should run correctly even without IDE.
2018-07-12 20:36:39 +03:00
Yan Zhulanow
8d9c53da92 Kapt: Allow to disable warning for 'annotationProcessor' dependencies (#KT-24883) 2018-07-12 20:36:38 +03:00
Yan Zhulanow
57133af5f9 Pill: Support Android Studio bunches in "IDEA" run configuration 2018-07-12 20:36:38 +03:00
Yan Zhulanow
e958a9771f Extract refactoring: Make an extracted function 'inline' if any of its type parameters are reified (#KT-23983) 2018-07-12 20:36:38 +03:00
Yan Zhulanow
90bffbf4c8 Minor: Fix test data for Parcelize annotation checker 2018-07-12 20:36:38 +03:00
Yan Zhulanow
88c9d7e383 Parcelize: Recognize '@IgnoredOnParcel' with @get: use-site annotation target 2018-07-12 20:36:38 +03:00
Yan Zhulanow
26ca7a140d Parcelize: Generate non-final 'writeToParcel()' and 'describeContents()' (#KT-24720) 2018-07-12 20:36:38 +03:00
Yan Zhulanow
adf3057fea Parcelize: Fix Parcelize box tests 2018-07-12 20:36:38 +03:00
Yan Zhulanow
3c1c776cdb Parcelize: Check @IgnoredOnParcel annotation usage (#KT-24459) 2018-07-12 20:36:38 +03:00
Yan Zhulanow
ee37bcf14b Parcelize: Serialize primitive arrays correctly when the custom parceler is provided.
This fixes failing 'customSerializerBoxing' test.
2018-07-12 20:36:37 +03:00
Yan Zhulanow
defe97e4ef Parcelize: Always map primitive array element types as boxed types for Array<T> (#KT-23808) 2018-07-12 20:36:37 +03:00
Yan Zhulanow
d5f0495031 Parcelize: Support objects and enums (#KT-22576) 2018-07-12 20:36:37 +03:00
Mikhail Zarechenskiy
4e3674b330 Fix for-in iterator over list of boxed inline class values
#KT-25325 Fixed
2018-07-12 18:53:30 +03:00
Mikhail Zarechenskiy
0308e10c11 Fix for-in iterator over array of boxed inline class values
#KT-25324 Fixed
2018-07-12 18:53:24 +03:00
Mikhail Zarechenskiy
584c888e5b Fix exception from UAST: don't use constant of error type
#EA-121947 Fixed
2018-07-12 16:12:49 +03:00
Ilya Gorbunov
ed7f7ba737 Assigning single value to varargs is prohibited, use arrayOf 2018-07-12 14:33:15 +03:00
Anton Bannykh
d042038045 JS IR: mute tests with language version 1.0
Long.rem declaration doesn't compile
2018-07-12 14:18:34 +03:00
Anton Bannykh
6a9b8d27e6 JS: update DCE test data 2018-07-12 14:18:34 +03:00
Anton Bannykh
cf9ad635e1 JS: add more tests 2018-07-12 14:18:34 +03:00
Anton Bannykh
0579b52d6b JS: enabled codegen box tests for release coroutines 2018-07-12 14:18:34 +03:00
Anton Bannykh
99ac43eb84 JS: implement release coroutines in stdlib 2018-07-12 14:18:34 +03:00
Anton Bannykh
2604da6f0e Advance bootstrap to 1.2.70-dev-258 2018-07-12 14:18:34 +03:00
Nikolay Krasko
5bfb35c8aa Revert "Add knowledge about eap-1.3 channel to plugin (KT-25414)"
It's decided to migrate to scheme with two predefined channels:
`eap` and `eap-next`.

This reverts commit 4f1f1e6
2018-07-12 13:32:19 +03:00
Sergey Rostov
c8d85150de ReplOutputHandler: log xml parsing exception cause (EA-103447) 2018-07-12 10:26:37 +03:00
Natalia Selezneva
79a80ce8de Use new syntax for '.gradle.kts' files in AddKotlinLibQuickFix
^KT-25403 Fixed
2018-07-12 10:03:40 +03:00
Natalia Selezneva
e395a32734 Add quickfix to adding kotlin-script-runtime.jar to classpath
^KT-25402 Fixed
2018-07-12 10:03:35 +03:00
Simon Ogorodnik
75fa02646b EA-109046: Add diagnostic to catch NPE 2018-07-11 20:50:02 +03:00
Nikolay Krasko
4f1f1e66eb Add knowledge about eap-1.3 channel to plugin (KT-25414)
#KT-25414 Fixed
2018-07-11 17:25:30 +03:00
Natalia Selezneva
d241c092e2 Fix deadlock in ScriptTemplatesFromCompilerSettingsProvider
^KT-25373 Fixed
2018-07-11 16:23:58 +03:00
Svyatoslav Kuzmich
7bf2cd8054 [JS IR BE] Fix lost toLong conversions during merge 2018-07-11 16:16:50 +03:00
Mikhael Bogdanov
9cf9cb3ecd Fix KotlinType building by IrType: don't miss type parameters of outer for inner class
#KT-25405 Fixed
2018-07-11 15:12:43 +02:00
Anton Bannykh
9c6452778f JS IR: unmute tests 2018-07-11 15:25:41 +03:00
Anton Bannykh
ac1a97ad83 JS IR: unmute tests 2018-07-11 14:49:36 +03:00
Anton Bannykh
9e9b27fe79 JS IR: bug fixes 2018-07-11 14:49:36 +03:00
Anton Bannykh
9233e6c176 JS IR: char (always boxed for now) 2018-07-11 14:49:36 +03:00
Nikolay Krasko
d709b03160 Load/Save for old Intellij formatting settings (KT-22252)
#KT-22252 In Progress
2018-07-11 14:25:24 +03:00
Nikolay Krasko
6a4d2c1fdb Predefined obsolete code style (KT-22252)
#KT-22252 In Progress
2018-07-11 14:25:24 +03:00
Nikolay Krasko
b51880332e Migration inspection for fromClosedRange() call (KT-17176)
#KT-17176 Open
2018-07-11 14:25:24 +03:00
Ilmir Usmanov
6ba2baa9da Deserialize constructors and properties with version requirement 1.3
if they have suspend function type in their descriptors.
Also, review fixes.

 #KT-25256: Fixed
2018-07-11 14:20:46 +03:00
Ilmir Usmanov
c460593b7d Forbid coroutines in language version is 1.3 and api version is less 2018-07-11 14:20:45 +03:00
Ilmir Usmanov
03c50ea139 Add test for calling release coroutine from experimental one 2018-07-11 14:20:44 +03:00
Ilmir Usmanov
cbb81a343c Minor. Move experimental warning disabling to appropriate places. 2018-07-11 14:20:44 +03:00
Ilmir Usmanov
524cc3ffe4 Forbid old coroutineContext deserialization. Fix suspend function deserialization 2018-07-11 14:20:43 +03:00
Ilmir Usmanov
d13e2ef32e Add tests 2018-07-11 14:20:42 +03:00
Ilmir Usmanov
dbc3ddc578 Support loading function types 2018-07-11 14:20:41 +03:00
Ilmir Usmanov
5b7e099842 Read old suspend functions in 1.3 2018-07-11 14:20:41 +03:00
Mikhail Zarechenskiy
6b73e528ce Ignore test for JS IR because of TODO() function 2018-07-11 11:41:24 +03:00
Nicolay Mitropolsky
be611cd154 LightAnnotations don't try to get kotlinOrigin if not building from sources 2018-07-11 09:37:28 +03:00
Nicolay Mitropolsky
eaa58c3ec2 KtLightParameter should have a KtLightModifierList anyway
otherwise we wouldn't get proper annotations for `equals` in data-classes
2018-07-11 09:37:28 +03:00
Alexander Udalov
628833af65 Generate nullability annotations as non-runtime-retained
org.jetbrains.annotations.NotNull/Nullable have retention CLASS,
therefore they should appear in RuntimeInvisibleAnnotations

 #KT-22201 Fixed
2018-07-11 09:37:28 +03:00
Jake Wharton
2e4f3ced9b Add nullability annotations to data class equals and toString.
KT-22201
2018-07-11 09:37:28 +03:00
Mikhail Zarechenskiy
8d24ca65a3 Propagate KotlinType into when expression codegen
This commit removes unneeded boxing when result expression of `when` is
 value of inline class type
2018-07-10 23:10:57 +03:00
Zalim Bashorov
35b2b762cd Pill: fix name of ignored kotlin-scripting compiler plugin 2018-07-10 21:53:59 +03:00
Nikolay Krasko
a58acdd537 Fix suspend inlay tests after adding yield() from stdlib to ignore 2018-07-10 19:24:23 +03:00
Nikolay Krasko
cd8d6439aa Minor: add PsiTreeUtilKt#parentOfType to incompatible API 2018-07-10 19:24:22 +03:00
Ilya Gorbunov
5e5b9e5912 Fix incorrect parameter order in TestNG asserter
#KT-25351 Fixed
2018-07-10 19:12:21 +03:00
Mikhail Zarechenskiy
2be08f4d60 [NI] Fix exception, recorded type for function statement can be null
See `checkStatementType`, we return `null` to reduce count of errors.

 Also, note that named function which is used as last statement in lambda
 doesn't coerce to Unit, this is a separate bug and will be addressed later,
 see #KT-25383

 #EA-121026 Fixed
2018-07-10 17:41:17 +03:00
Mikhael Bogdanov
eb745133c9 Switch @JvmStatic diagnostic test to LanguageFeature usage 2018-07-10 16:04:30 +02:00
Alexander Udalov
e937fe8258 Move PackagePartProvider to module descriptors.jvm 2018-07-10 15:16:49 +02:00
Alexander Udalov
2cb4b7c6d4 Extract MetadataPartProvider out of PackagePartProvider 2018-07-10 15:16:49 +02:00
Alexander Udalov
e25bc2865f Remove PackagePartProvider from ResolverForProjectImpl
To be able to move it to JVM-specific modules, and to provide a
replacement for common module analysis
2018-07-10 15:16:49 +02:00
Mikhail Zarechenskiy
33bd1b23a2 Don't assign single elements to varargs as it's deprecated
See #KT-20171
2018-07-10 14:25:45 +03:00
Svyatoslav Kuzmich
77ad97a39e [JS IR BE] Bridges construction 2018-07-10 14:11:09 +03:00
Svyatoslav Kuzmich
a2f89cc711 [JS IR BE] Eqeq operator lowering. IntrinsicifyCallsLowering.kt refactoring 2018-07-10 14:11:08 +03:00
Anton Bannykh
d412b6f4d0 JS IR: tell CodeConformanceTest that longjs.kt does contain third-party copyright 2018-07-10 13:34:19 +03:00
Anton Bannykh
07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Anton Bannykh
65846d783d JS IR: Long 2018-07-10 13:34:19 +03:00
Anton Bannykh
4872c97929 JS: enable release coroutines 2018-07-10 13:11:39 +03:00
Nicolay Mitropolsky
f77e023210 fix ResolveElementCacheTest.kt compilation for 172 2018-07-10 12:11:59 +03:00
Georgy Bronnikov
8ce658ab54 Introduce -Xuse-ir flag for cli compiler 2018-07-10 10:05:06 +02:00
Nicolay Mitropolsky
be8740e0ee 172: KotlinUastApiTest.kt compilation fix 2018-07-10 10:28:30 +03:00
Ilya Chernikov
903e613bdd Fix script templates tests after updating definitions selection logic 2018-07-10 08:43:52 +02:00
Natalia Selezneva
5741f81f25 Fix AbstractScriptConfigurationTest
Add dependency on script runtime for module.
Provide default test script template thought template-classpath.
2018-07-10 08:43:52 +02:00
Natalia Selezneva
790188120a Add LightProjectDescriptor with script-runtime dependency. Use it in PsiChecker tests. 2018-07-10 08:43:52 +02:00
Natalia Selezneva
3b8bf3e74e Fix testdata fo IdeaModuleInfoTest: for script in module IdeaModuleInfo is created instead of ScriptModuleInfo.ForFile 2018-07-10 08:43:52 +02:00
Ilya Chernikov
b979f3dc52 Fix testdata 2018-07-10 08:43:52 +02:00
Ilya Chernikov
b83948f241 Drop support of KOTLIN_HOME environment variable in the command-line compiler
it is proved to be fragile and seems unnecessary at the moment
2018-07-10 08:43:52 +02:00
Ilya Chernikov
9549736d35 Fixes after review 2018-07-10 08:43:52 +02:00
Ilya Chernikov
5d597eb382 Fix configurations chaining in the script compiler 2018-07-10 08:43:52 +02:00
Ilya Chernikov
92d4d986c8 Take path to scripting plugin libs only from compiler jar path...
ignoring all "kotlin home" settings, since we need to load a compatible
plugin. Fixes #KT-24946
2018-07-10 08:43:51 +02:00
Ilya Chernikov
ec58929e39 Allow multiple same jsr305 options in the command-line
do not report duplicate jsr305 entries if options are the same
2018-07-10 08:43:51 +02:00
Ilya Chernikov
563e4c9e57 Add kts to supported file extensions to the DirtySourceFilesHolder as well
allows jps to compile scripts along with sources,
finally fixes #KT-22611
2018-07-10 08:43:51 +02:00
Ilya Chernikov
f39c6f3b7a Drop half-backed support of "dynamic" annotations on scripts...
leaving it in the history so it could be restored and finished, if needed
2018-07-10 08:43:51 +02:00
Ilya Chernikov
dee141b26b Add script constructor annotations inheritance 2018-07-10 08:43:51 +02:00
Ilya Chernikov
0f46f62232 Add script class annotations generation from the base class 2018-07-10 08:43:51 +02:00
Ilya Chernikov
edf13c022e Refactor script definitions loading and discovery:
Improve logic, code reuse and readability
Add support for more corner cases
Improve reporting
Add definitions loading test
2018-07-10 08:43:51 +02:00
Ilya Chernikov
fbbfe600ec Fix list of script definitions recognized by the asm-based loading:
fix of the previous fix to #KT-24926
2018-07-10 08:43:50 +02:00
Ilya Chernikov
199c3bce40 Fix explicit custom scripting definitions choice logic:
add standard script def after custom defs are processed
2018-07-10 08:43:50 +02:00
Ilya Chernikov
e17c36cf12 Improve automatic scripting plugin picking logic 2018-07-10 08:43:50 +02:00
Ilya Chernikov
4812fcf1ad Fix script definition discovery logic:
for cases when directory-based dependencies are passed and directories
with resources are different from directories with classes
Significant refactoring to make code prettier
2018-07-10 08:43:50 +02:00
Ilya Chernikov
56e9bfcd62 Fix default configuration refinement in scripts 2018-07-10 08:43:50 +02:00
Ilya Chernikov
befa94689a Return script instance from the evaluation in the basic jvm evaluator 2018-07-10 08:43:50 +02:00
Pavel Talanov
2ecddc996a Implement support for static resolving to scripts in source roots in IDEA 2018-07-10 08:43:50 +02:00
Ilya Chernikov
9453834fb1 Create proper constructor in script descriptor
allows to resolve calls to scripts in compiler (but not in the IDE yet)
Some refactorings on the way
2018-07-10 08:43:50 +02:00
Ilya Gorbunov
b7d3382f13 Report more diagnostics when JDK8PlatformImplementations can't be cast to base type
#EA-120914 - CCE: PlatformImplementationsKt.<clinit>
2018-07-09 22:13:57 +03:00
Ilya Gorbunov
35beb9698e Fix overflow in empty progressions' last element
#KT-24204 Fixed
2018-07-09 22:13:51 +03:00
Ilya Gorbunov
be8cb94105 Add failing tests for overflow in empty progressions KT-24204 2018-07-09 22:08:01 +03:00
Mikhail Zarechenskiy
14b8ff7d71 Load unsigned constants from class file with the use of expected type 2018-07-09 20:19:26 +03:00
Mikhail Zarechenskiy
9b6e8fa5d1 Do not recreate compile time initializer to avoid type info loosing
When we resolve arguments of annotation, expected type of parameters can
 be unknown. Therefore, if we'll try to load constants without expected type,
 info about unsigndness will be lost. For primitives it worked because we
 can differ type by its value
2018-07-09 20:19:25 +03:00
Mikhail Zarechenskiy
0c6757a8b0 Write is_unsigned flag into metadata for an annotation arguments
Instead of adding new kind of types, we'll use flag to disambiguate
 usual types from unsigned ones, this approach has two advantages:
 - less changes in the metadata format
 - it allows naturally extend format for unsigned arrays,
  which will be supported later

 #KT-25310 Fixed
 #KT-25273 Fixed
2018-07-09 20:06:05 +03:00
Mikhail Zarechenskiy
8c075bc622 Add ability to use unsigned types in LoadJava tests
This is a temporary solution, which will be completely removed in 1.3, see KT-25226
2018-07-09 20:05:38 +03:00
Nicolay Mitropolsky
dd0e3cd135 Uast: ULambdaExpression returns proper functionalInterfaceType for SamAdapterExtensionFunctionDescriptor (KT-25297) 2018-07-09 19:41:07 +03:00
Nicolay Mitropolsky
2c7687195c Uast: properly handling explicit SAM (KT-25297) 2018-07-09 19:41:07 +03:00
Nicolay Mitropolsky
38e2d474b7 Uast: create KotlinULambdaExpression for in-place lambdas (KT-25297)
and provide appropriate functionalInterface
2018-07-09 19:41:07 +03:00
Dmitry Savvinov
668bd209f2 Use -Xallow-kotlin-package while compiling common sources
K2MetadataCompiler doesn't perform explicit check of compilation of
'kotlin' package, thus stdlib build wasn't passing '-Xallow-kotlin-package'.

However, we have special hack for compiling stdlib with contracts: if
'-Xallow-kotlin-package' is passed, then allow compiling contracts for
custom functions. We have to do it this way, because we don't want
stdlib artifacts to be marked with pre-release flag, even though
contracts for custom functions are not enabled yet
(see eae9923dbe).

Therefore, it's crucial to pass -Xallow-kotlin-package properly for that
side-effect.
2018-07-09 18:57:58 +03:00
Dmitry Savvinov
2783e9939b Fix internal-visibility mangling in IDE
Collect module name properly from facets settings, using CLI arguments
which define module name ('-module-name' on JVM and Common,
'-output-file' on JS).

^KT-23668 Fixed
2018-07-09 18:50:50 +03:00
Dmitry Savvinov
04f12846f1 Minor: reformat ModuleDescriptorImpl.kt 2018-07-09 18:50:35 +03:00
Nikolay Krasko
b709012dea Minor: "Recheck now" -> "Check again" 2018-07-09 18:07:25 +03:00
Nikolay Krasko
aa21e9c3bc Show current Kotlin installed version in update form (KT-25255)
#KT-25255 Fixed
2018-07-09 18:07:25 +03:00
Nikolay Krasko
90f1829fb8 Minor: find tested element with <caret> in ResolveElementCacheTest.kt 2018-07-09 18:07:24 +03:00
Mikhael Bogdanov
66e68fbb53 Generate sam wrappers in inlined lambda in same way as in inline function
#KT-24825 Fixed
2018-07-09 15:52:54 +02:00
Alexey Tsvetkov
93e183c2e4 Test for KT-25051 2018-07-09 15:50:06 +03:00
Alexey Tsvetkov
f735586819 Remove redundant test
`testMultiModuleICNonAndroidModuleIsChanged` already tested
android and non-android change
2018-07-09 15:50:05 +03:00
Alexey Tsvetkov
5760b8cf8b Register kotlin_module as output of all files
Previously kotlin_module was registered as output
only for files containing top-level declarations
2018-07-09 15:48:11 +03:00
Alexey Tsvetkov
63b4302cea Always generate kotlin_module
#KT-25133 fixed
    #KT-25051 fixed
2018-07-09 15:48:11 +03:00
Denis Zharkov
4bf51af2fa Fix reference-public-api
It's necessary because of the changes in 3497880f203449121ea8035c49b792cc4dc53bd6
2018-07-09 15:27:19 +03:00
Denis Zharkov
0b3048f60a Replace trivial usages of suspendCoroutineOrReturn in tests
This is necessary since suspendCoroutineOrReturn gets removed in 1.3
2018-07-09 15:27:19 +03:00
Denis Zharkov
a23ce42c80 Replace a couple of usages of suspendCoroutineOrReturn in tests 2018-07-09 15:27:19 +03:00
Denis Zharkov
e753e0978f Fix dispatchResume.kt tests after suspendCoroutineOrReturn removal
To leave them COMMON_COROUTINES_TEST use suspendCoroutine instead
But, since it requires for continuation to be called externally
the tests are rewritten
2018-07-09 15:27:19 +03:00
Denis Zharkov
8c65e55c02 Fix some of the bytecodeText tests
The changes are necessary because of release coroutines support:
- Get rid of suspendCoroutineOrReturn calls. It's anyway irrelevant
to what is being tested here

- In varValueConflictsWithTable.kt, variables slots have been shifted
because the variable for continuation's exception was removed

- In varValueConflictsWithTableSameSort.kt, a variable has been introduced
to preserve the same slot numbers for old variables.
Otherwise, they become shifted and to the second slot,
and there are a lot of irrelevant "ALOAD 2" instructions

This change is another example of why bytecode text tests are evil
2018-07-09 15:27:19 +03:00
Denis Zharkov
820506d9c6 Fix tests after new Continuation API support
#KT-24863 Fixed
2018-07-09 15:27:19 +03:00
Denis Zharkov
170086250b Support new Continuation API in JVM BE
#KT-24863 Fixed
2018-07-09 15:27:19 +03:00
Denis Zharkov
aee0afbff1 Support CoroutineUtil.kt helpers within AbstractCompileKotlinAgainstKotlinTest 2018-07-09 15:27:19 +03:00
Denis Zharkov
f23a0c8fea Add ContinuationAdapter to coroutine tests helpers
It allows having the same Continuation implementations for different
API versions
2018-07-09 15:27:19 +03:00
Denis Zharkov
f01e690f49 Minor. Use coroutine test helpers for inline/diagnostics tests
It should help with decreasing test data copy-pasting when
testing against release / pre-release coroutines
2018-07-09 15:27:19 +03:00
Denis Zharkov
2c195555ad Minor. Reformat CoroutineCodegen.kt 2018-07-09 15:27:19 +03:00
Denis Zharkov
1ced127660 Minor. Move helpers for coroutines tests to kt-file 2018-07-09 15:27:19 +03:00
Roman Elizarov
3aa76c58fc Updated SuccessOrFailure class corresponding to KEEP-127 and docs. 2018-07-09 15:27:19 +03:00
Roman Elizarov
33f4a3fcbf Extracted BaseContinuationImpl 2018-07-09 15:27:19 +03:00
Roman Elizarov
38c17249b9 releaseInterceptedContinuation clarified and ref check in impl fixed 2018-07-09 15:27:19 +03:00
Roman Elizarov
d33409ff8a Fixed boxing of SuccessOrFailure inside SafeContinuation impl 2018-07-09 15:27:19 +03:00
Roman Elizarov
0370fac0b6 Further design improvements for coroutines 1.3 APIs
* Documentation improvements and clarification
* Dropped legacy intrinsic functions
* Remove context parameter default from Continuation builder function
2018-07-09 15:27:19 +03:00
Roman Elizarov
719d45510a Continuation builder function 2018-07-09 15:27:19 +03:00
Roman Elizarov
0b17c619bc Fixed ContinuationImpl.intercepted 2018-07-09 15:27:19 +03:00
Roman Elizarov
7513557315 Unroll recursion in resumeWith
Fixes KT-18987
2018-07-09 15:27:19 +03:00
Roman Elizarov
af9743709c Implement COROUTINE_SUSPENDED as a property with getter 2018-07-09 15:27:19 +03:00
Roman Elizarov
aaabfa6382 Missing SinceKotlin declarations added for resume extensions 2018-07-09 15:27:19 +03:00
Roman Elizarov
b06d626b21 releaseInterceptedContinuation and few other minor fixes 2018-07-09 15:27:19 +03:00
Roman Elizarov
8e2fae3322 More work on draft coroutines 1.3 ABI & API:
* SuspendFunction[01] interfaces removed, moved to RestrictedContinuationImpl
* validateContext introduced to check restricted coroutines
* Distinguish SuspendLambda as being lambda/coroutine and provide a separate
  toString implementation (draft) in its coroutine incarnation.
2018-07-09 15:27:19 +03:00
Roman Elizarov
29dcc4f18c Better support for mixed-version libs (override old method, too) 2018-07-09 15:27:19 +03:00
Roman Elizarov
8bbd78ca9a Draft Kotlin Coroutines 1.3 ABI & API:
* SuccessOrFailure inline class is introduced
* Continuation.resumeWith(SuccessOrFailure)
* createCoroutineUnintercepted
* [Restricted]ContinuationImpl as named suspending function base
* [Restricted]SuspendLambda as suspending lambda base
* SuspendFunction[01] interfaces for efficient createCoroutine
* Serializable coroutine classes
2018-07-09 15:27:19 +03:00
Alexander Podkhalyuzin
fb5e11dfc6 simple public interface is Java, not Kotlin
#KT-22823 Fixed
2018-07-09 15:23:52 +03:00
Alexander Podkhalyuzin
04fd4ef9de Do not stop recursive visitor with return
#KT-23627 Fixed
2018-07-09 15:19:38 +03:00
Simon Ogorodnik
2d4cbc712d KT-25012: Use index to check is java file selected instead of traversing file tree
Add initial estimation via fileType index

 #KT-25012 fixed
2018-07-09 14:37:11 +03:00
Alexander Podkhalyuzin
a92ce467a7 Fixed patchset branches 2018-07-06 18:31:21 +03:00
Alexander Podkhalyuzin
571fda0f45 Fixed deprecation of ConcurrentFactoryMap()
#KT-24892 Fixed
2018-07-06 17:20:46 +03:00
Mikhail Zarechenskiy
6dc36055b8 Make diagnostic about redundant spread in @Foo(s = *[A]) more clear 2018-07-06 15:54:23 +03:00
Mikhail Zarechenskiy
513b27f65f Make tests about varargs compatible with 1.2 and 1.3 versions 2018-07-06 15:23:33 +03:00
Mikhail Zarechenskiy
c032a02373 Prohibit assigning single elements into varargs in named form
#KT-20588 Fixed
 #KT-20589 Fixed
2018-07-06 15:23:31 +03:00
Alexander Udalov
959c2f4843 Get rid of split packages in descriptors, descriptors.jvm, deserialization
Also move some other files to related packages and reformat moved files
2018-07-06 14:08:35 +02:00
Natalia Selezneva
4b1ce15619 Run script dependencies update on editor focus change
^KT-24588 Fixed
2018-07-06 11:58:35 +03:00
Sergey Rostov
7408504356 Fix StringIndexOutOfBoundsException in KotlinConsoleFilterProvider.kt (EA-118757) 2018-07-06 11:35:26 +03:00
Denis Zharkov
0d00eb7de3 Add postfix template for listOf/setOf/etc
#KT-25239 Fixed
2018-07-06 10:06:56 +03:00
Denis Zharkov
4ab97e8454 Minor. Reformat org.jetbrains.kotlin.idea.codeInsight.postfix 2018-07-06 10:06:56 +03:00
Denis Zharkov
6f4aa2296d Implement quickfix wrapping elements in collection literal calls
#KT-25238 Fixed
2018-07-06 10:06:56 +03:00
Nikolay Krasko
189260c013 Remove old code style settings files 2018-07-05 16:15:37 +03:00
Nikolay Krasko
36933a52ec Remove code style settings irrelevant for Kotlin project 2018-07-05 16:15:36 +03:00
Ilmir Usmanov
bc8295b137 Minor: regenerate tests 2018-07-05 15:09:13 +03:00
Ilmir Usmanov
4ec82cad90 Minor: add test to call callable references from Java 2018-07-05 15:09:06 +03:00
Ilmir Usmanov
4e8cc53962 Minor: pass suspend flag to lambda's copy 2018-07-05 15:09:00 +03:00
Ilmir Usmanov
28ad498956 Use AnonymousFunctionDescriptor for suspend callable references
Also use it for local suspend functions, which allows us to remove hack
with dropSuspend.

Regenerate tests.
2018-07-05 15:08:49 +03:00
Ilmir Usmanov
eea95441c5 Add diagnostics tests. Forbid callable reference to coroutineContext
#KT-16908: Fixed
2018-07-05 15:08:42 +03:00
Ilmir Usmanov
f94b579d19 Implement callable references to suspend functions
In FE they have type KSuspendFunctionN
In BE they are treated like normal callable references with additional
parameter in invoke function.
2018-07-05 15:08:34 +03:00
Mikhail Zarechenskiy
5869274ff1 Disable errors in mod/rem tests that depend on language feature
Otherwise these tests will fail with LV=1.3
2018-07-05 12:59:43 +03:00
Mikhail Zarechenskiy
2939d9c8c6 Use correct lhs KotlinType & AsmType for is check generation
There were two problems:
  - For asm type `OBJECT_TYPE` was used, which can be wrong in case of
  inline classes, because it can be an underlying value of some inline class
  - For KotlinType, type from rhs was used
2018-07-05 12:55:43 +03:00
Mikhail Zarechenskiy
4f490ac264 Fix generation of checkcast instructions for inline classes
Normalize LHS and RHS types to use only boxed ones and then let bytecode
 optmizer reduce redundant boxing
2018-07-05 12:55:39 +03:00
Dmitry Savvinov
8eb7eab535 Make tests on -XXLanguage more tolerant to 1.2 -> 1.3 transition 2018-07-05 10:42:50 +03:00
Dmitry Savvinov
5cb949ad7f Fix language features in tests for gradual migration to 1.3 (part 2)
In 1.3, due to changes in language, testdata for some tests can be
different from 1.2

We want to simlultaneously test both versions, so instead of fixing
language version in such tests, we split them into two: one with fixed
1.2, another with fixed 1.3
2018-07-05 10:42:49 +03:00
Dmitry Savvinov
6d733ff7b9 Disable ContracsDSL in 1.3 2018-07-05 10:42:38 +03:00
Dmitry Savvinov
984ef9c3b1 Parse testing directives in AbstractLoadJavaTest 2018-07-05 10:41:41 +03:00
Ilya Gorbunov
1266ba682c Opt-in to use experimental unsigned types in tests
The opt-in is required to avoid side diagnostics about the experimentality.
2018-07-04 19:13:30 +03:00
Ilya Gorbunov
b5fabf3f72 Make unsigned types experimental (with warning if not opted-in) 2018-07-04 19:12:11 +03:00
Nikolay Krasko
71292bd681 Disable formatting inspection for unmodified files 2018-07-04 17:31:14 +03:00
Nikolay Krasko
370608d12f Ignore more methods from stdlib in argument name hints (KT-18350)
#KT-18350 Fixed
2018-07-04 17:31:13 +03:00
Nikolay Krasko
dcc6579dcb Modification trackers increment highlighting test 2018-07-04 17:31:10 +03:00
Vyacheslav Gerasimov
1cb97259aa Add :compiler:ir.backend.common to kotlin-plugin fat jar
#KT-25225 Fixed
2018-07-04 17:17:39 +03:00
Alexey Sedunov
2efd467c42 JS: Fix detection of run configuration with preconfigured Mocha
#KT-25253 Fixed
2018-07-04 16:40:01 +03:00
Mikhael Bogdanov
be40127ab3 Mute coroutines ir-tests in jvm 2018-07-04 15:33:41 +02:00
Nicolay Mitropolsky
5d9807ac36 Uast: converting Unit to void on type mapping (KT-25249) 2018-07-04 16:16:22 +03:00
Alexey Tsvetkov
39fc7cffe1 Temporarily ignore Kapt3WorkersAndroid32IT 2018-07-04 15:15:57 +03:00
Alexey Tsvetkov
bab8c97c09 Allow overriding default Gradle version per test class 2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
05fa8b7451 Add SDK jars to compile classpath for Kapt Workers task 2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
bfc608de29 Close kapt context 2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
3b18debee3 Test kapt with workers 2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
efeea9d7d4 Update android tools versions in Gradle plugin tests 2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
357518be0d Remove projectDir input from KaptWithoutKotlincTask
It is redundant since the task would be restarted when project dir changes,
because paths of sources would also change
2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
9b97108db4 Fix getting plugin version for kotlinKaptWorkerDependencies configuration
Previously the configuration would not work for non-android projects,
because it looked only at KotlinAndroidPluginWrapper for plugin version
2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
43b7ffd823 Create kotlinKaptWorkerDependencies only once
#KT-25124 fixed
2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
5bf5632886 Do not load annotation processors when generating stubs
#KT-25131 fixed
2018-07-04 14:55:42 +03:00
Alexey Tsvetkov
f438b7501c Fix compilation of plugin projects in JPS
#KT-25218 fixed
2018-07-04 14:54:07 +03:00
Alexander Udalov
285912f556 Minor, add helper StackValue.constant(int) 2018-07-04 13:39:32 +02:00
Denis Zharkov
22a9cecfe0 Optimize KotlinPropertyAccessorsReferenceSearcher for case of no kt-files
Property names by accessors can be computed without resolving
java descriptors

 #KT-11477 Fixed
 #KT-16890 Fixed
2018-07-04 14:03:28 +03:00
Denis Zharkov
2d50ad82a5 Optimize SyntheticJavaPropertyDescriptor.Companion::findByGetterOrSetter
Do not force getContributedDescriptors call when we need to request
at most three names
2018-07-04 14:03:28 +03:00
Denis Zharkov
5e6a3673c8 Reformat SyntheticJavaPropertiesScope.kt 2018-07-04 14:03:28 +03:00
Alexey Sedunov
fc93f00c7b Misc: Make LibraryEffectiveKindProvider cache an instance property 2018-07-04 13:34:20 +03:00
Ilya Chernikov
db73ed1d0c Add 1.2.51 issues to changelog 2018-07-04 11:42:47 +02:00
Alexey Sedunov
5f69eebe66 Misc: Fix SOE due to wrong overloaded method call
#KT-25247 Fixed
2018-07-03 22:09:55 +03:00
Alexander Udalov
50904d4216 Add JvmFunctionExtensionVisitor.visitEnd
#KT-25223 Fixed
2018-07-03 19:15:34 +02:00
Ilya Gorbunov
cbc3480d9e Split common builtin companion tests from JVM-only tests
Remove duplicated tests from NumbersJVMTest.
2018-07-03 19:58:53 +03:00
Svyatoslav Kuzmich
83f8cfaa66 [JS IR BE] hashCode, toString, number conversion support 2018-07-03 19:51:58 +03:00
Svyatoslav Kuzmich
a7a695f203 KJS: Add JsLoop AST interface and corresponding visitors 2018-07-03 19:51:58 +03:00
Roman Artemev
d130ba6f44 [JS IR BE] Update test data 2018-07-03 19:14:00 +03:00
Roman Artemev
47d088d4c5 [JS IR BE] Reimplement block decomposer lowering 2018-07-03 19:13:53 +03:00
Mikhail Zarechenskiy
e2c287c77e Fix language feature for mod/rem tests for migration to 1.3 version
After 2e88f5c47d
2018-07-03 16:10:37 +03:00
Alexander Podkhalyuzin
7ee055fccc Merge pull request #1745 from JetBrains/rr/suppressor
Introduce KotlinInspectionSuppressor
2018-07-03 14:37:39 +03:00
Svyatoslav Scherbina
226f16b44e ir.tree: fix .originalKotlinType for transformed IR types 2018-07-03 09:55:12 +03:00
Ilya Gorbunov
4fd6dcd063 Turn progressive mode on with the gradle parameter test.progressive.mode 2018-07-03 05:10:24 +03:00
Ilya Gorbunov
3c86e40bcb Fix WITH_UNSIGNED directive in noBoxingOperationsOnNonTrivialSpread 2018-07-03 03:52:18 +03:00
Ilya Gorbunov
16fb5f6901 Set language and api versions automatically for unsigned types box tests
Remove InlineClasses feature directive from tests
2018-07-03 03:52:18 +03:00
Ilya Gorbunov
181a8d7d6a Extract default language version settings for diagnostics tests
And override it in unsigned types diagnostics tests.
Remove InlineClasses feature directive from tests, because it's already
enabled in that language version.
2018-07-03 03:52:18 +03:00
Ilya Gorbunov
3349976279 Make MIN_VALUE and MAX_VALUE of unsigned types actual constants 2018-07-03 03:52:18 +03:00
Ilya Gorbunov
7a208c3e01 Simplify unsigned array constructor functions 2018-07-03 03:52:18 +03:00
Ilya Gorbunov
615f57f2fc Compile unsigned types sourceset with 1.3 and annotate them with SinceKotlin("1.3") 2018-07-03 03:52:18 +03:00
Ilya Gorbunov
a72ad8b267 Advance bootstrap to 1.2.70-dev-23 2018-07-03 03:52:18 +03:00
Alexey Tsvetkov
1dea01a479 Build: remove testRuntime dependency on ":kotlin-compiler:dist" 2018-07-02 22:36:35 +03:00
Alexey Sedunov
03ed4e39e3 Search Everywhere: Recover original behavior for non-functions
#KT-25189 Fixed
2018-07-02 20:18:21 +03:00
Alexander Udalov
e4af8dc7d8 Improve reflection error message when function/property is not found 2018-07-02 18:49:09 +02:00
Alexander Udalov
4f2fdd1c01 Load all resources in RuntimePackagePartProvider; optimize code
The issue was reproducible when the same package is present in different
modules with the same -module-name (which is a popular case of src/test
roots in simple IDEA projects). The problem was in the fact that several
resource files containing package name mapping with the same name were
present in the classpath, but RuntimePackagePartProvider only considered
the first one. The fix is to use getResources instead of
getResourceAsStream and handle each returned resource.

Also, optimize internal representation to store the mapping in the form
which is the most convenient for findPackageParts, which should be
faster than registerModule because in theory, it's called more often.

 #KT-21973 Fixed
 #KT-24651
2018-07-02 18:49:09 +02:00
Alexander Udalov
8ccbbf71ec Remove obsolete BuiltInFunction and mapIntrinsicFunctionSignature
This is now fully covered by the JVM signature mapping, introduced in
the previous commit. The change in KDeclarationContainerImpl.methodOwner
is needed because primitive classes have no methods on JVM; and when
we're looking for "Int.equals", we'll now look it up in the Class object
for java.lang.Integer, not for the primitive int.
2018-07-02 18:49:08 +02:00
Alexander Udalov
4266e50be8 Use manual type mapping in reflection for members from built-ins
There are cases when members deserialized from JVM classes have no JVM
signature in the proto. For example, if a member is inherited from a
built-in class (such as Map.getOrDefault in some Map implementations),
or if a member is synthesized in the compiler front-end and back-end
separately (such as enum values/valueOf). In these cases, we'll use the
naive type mapping to try to recover the signature.

 #KT-16616 Fixed
 #KT-17542 Fixed
2018-07-02 18:49:08 +02:00
Alexander Udalov
a7c80f2df1 Reformat module reflection.jvm, fix inspections/warnings 2018-07-02 18:49:08 +02:00
Alexander Udalov
25ee67a644 Catch SecurityException when reading system property in BitEncoding
This does not fix KT-15167 though because the exception from KT-20575 is
thrown shortly afterwards

 #KT-15167
2018-07-02 18:49:08 +02:00
Alexander Udalov
42de05f3fa Improve diagnostic for missing BuiltInsLoader implementation
Also initialize it lazily to avoid wrapping the exception into
ExceptionInInitializerError

 #KT-20575
2018-07-02 18:49:08 +02:00
Alexander Udalov
50c515deca Do not serialize constructors for anonymous objects
The only client of this data is reflection, and since anonymous objects
do not have constructors in the source code, they shouldn't in
reflection as well

 #KT-20442 Fixed
2018-07-02 18:49:08 +02:00
Alexander Udalov
17fc41e0f9 Do not create primary constructor for enum entry synthetic class
The change in DescriptorSerializer is needed so that serialized protos
of enum entry classes which are resolved in sources
(LazyClassDescriptor) and are deserialized from binaries
(EnumEntrySyntheticClassDescriptor) are the same. There are tests on
incremental compilation in JS that check that the serialized proto is
exactly the same after rebuild and after an incremental build.

 #KT-22048 Fixed
2018-07-02 18:49:08 +02:00
Alexey Sedunov
b52b07ec79 Test Support: KT-22306
Do not show run markers in JS modules when no relevant run configurations are available

 #KT-22306 Fixed
2018-07-02 19:15:52 +03:00
Alexey Sedunov
3e91346240 Rename: Fix processing of references to synthetic Java properties
Fixes for non-master-bunch plugin.xml
2018-07-02 19:15:51 +03:00
Alexey Sedunov
22d74276a0 Misc: Configure stdlib in failing tests 2018-07-02 19:08:10 +03:00
Alexey Sedunov
65dad5eb74 Misc: Fix test assertion 2018-07-02 19:08:10 +03:00
Mikhail Zarechenskiy
59567c8012 Improve exception message to detect actual problem
This relates to EA-120082, EA-119637
2018-07-02 16:12:39 +03:00
Mikhail Zarechenskiy
2e88f5c47d Prohibit operator mod as declaration and calls that resolved via it
#KT-24197 Fixed
2018-07-02 16:12:36 +03:00
Roman Artemev
c887b88ed9 Fix coroutine test generator 2018-07-02 15:35:02 +03:00
Nikolay Krasko
f1a44ed1a4 Allow to disable bad format inspection for unchanged files (KT-25199)
#KT-25199 Fixed
2018-07-02 15:06:47 +03:00
Nikolay Krasko
30a2969887 Move KotlinCleanupInspection to Migration group 2018-07-02 15:06:47 +03:00
Denis Zharkov
3b968351bb Load Java overrides of Kotlin suspend functions as suspend, too
There's still some blind spots:
- Covariant overrides in Java (KT-25036)
- Current implementation assumes that when language version is 1.3 every suspend function
reference only release-coroutines-package Continuation
(we need to check if it's a correct statement)

 #KT-24848 Fixed
 #KT-25036 Open
2018-07-02 14:14:59 +03:00
Denis Zharkov
0fc9bb3f4a Minor. Reformat LazyJavaClassMemberScope.kt 2018-07-02 14:14:59 +03:00
Mikhail Zarechenskiy
de60c9b635 Fix language features in tests for gradual migration to 1.3 version 2018-07-02 12:13:11 +03:00
Vyacheslav Gerasimov
931ebb4c3c as32: Limit until-build to prevent installation on AS 3.3 2018-07-01 00:09:21 +03:00
Alexey Tsvetkov
ece991639e Do not compile jps tests for android studio
I accidentally enabled compilation in one of my previous commits
2018-06-29 20:16:53 +03:00
Ilya Gorbunov
bed26dc700 Fix local delegated property smartcast usage 2018-06-29 20:11:03 +03:00
Nicolay Mitropolsky
80f022c3d5 182: IDEA sdk set to 182.3458.5 2018-06-29 16:42:44 +03:00
Dmitry Petrov
bbcb12ea4b samAdapter test doesn't actually need FULL_JDK 2018-06-29 14:27:57 +03:00
Dmitry Petrov
92430fc63a Update testData for JS_IR tests 2018-06-29 14:23:09 +03:00
Dmitry Petrov
38e9c86443 Update testData for irCfg and sourceRanges tests 2018-06-29 14:01:54 +03:00
Mikhail Glukhikh
537655a4c2 KotlinInspectionSuppressor: introduce more precise quick-fix names
Related to KT-11154, KT-25169
2018-06-29 11:58:28 +03:00
Mikhail Glukhikh
a51bda64dc Add a pair of tests for KT-11154 2018-06-29 11:44:48 +03:00
Dmitry Petrov
f0050930b5 Add ":compiler:ir.backend.common" to compilerModules 2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
da0a966d65 Initialize return type and use unit type in IrDelegationConstructorCall
(cherry picked from commit faac924)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
7bd5031eaf Fix array check
(cherry picked from commit e662f82)
2018-06-29 11:24:46 +03:00
Dmitry Petrov
b1d0a5e807 Fix delegated function body generation 2018-06-29 11:24:46 +03:00
Dmitry Petrov
71c5bf0b97 Fix annotation copying for IrValueParameters 2018-06-29 11:24:46 +03:00
Dmitry Petrov
799fcc2606 Fix IrType rendering, update testData 2018-06-29 11:24:46 +03:00
Dmitry Petrov
7fd3fac122 Minor: fix after rebase 2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
2a721ea0f6 Fix EnumClassLowering
(cherry picked from commit 1aa7e1a)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
95d72d0a32 Fix unbound symbol problem
Make property initialization non-lazy to bind owner by general mechanism

(cherry picked from commit eec6c18)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
ba9f12b617 Use original descriptor for property stub generation
(cherry picked from commit 1a9f242)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
068859eece Minor: use right type for null literal
(cherry picked from commit 88c824b)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
56bf1f895c Mute failed test for JS IR BE
(cherry picked from commit 6d379a6)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
15f33dd94a Unmute some tests for JS IR BE
(cherry picked from commit 04a9622)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
bf2aa5263e JS IR BE: migrate to IR types
(cherry picked from commit 064f47b)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
952163b2fb IR: define references to Throwable, KCallable and KProperty classes inside IrBuiltIns
(cherry picked from commit f92bda0)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
92407c509f IR BE common: add KotlinType based utils
(cherry picked from commit d8be3a6)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
686a3d631c IR BE common: provide type arguments count explicitly for ir calls to reduce dependency on descriptors
(cherry picked from commit af76ae2)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
f002e6030a IR BE common: use another ctor of IrGetValueImpl in LocalDeclarationsLowering
(cherry picked from commit 7e34d6e)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
d5906dd584 IR BE common: fix InnerClassesLowering
(cherry picked from commit 4239a5f)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
072804af52 ir.tree: uncomment and fix IrFunction.createParameterDeclarations
(cherry picked from commit af8b4be)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
6bc86bd42f IR: add ClassifierDescriptor.toIrType and KotlinType.toIrType
(cherry picked from commit 3e09659)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
fa51b962b8 IR: return original KotlinType from IrTupe.toKotlinType() when it possible instead of creating new one
(cherry picked from commit e3b921a)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
1c2ac364c7 IR: add more predicates on IrType
(cherry picked from commit 5cf136c)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
17454d3f9c ir.tree: fix return type of IrMemberAccessExpression.getTypeArgumentOrDefault
(cherry picked from commit 9e7661f)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
576dfda3a8 IrTypes: fix translating for Dynamic type
(cherry picked from commit bd04b46)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
ecb5d29130 Add additional IrFunction constructor with custom visibility and modality
(cherry picked from commit 0664d77)
2018-06-29 11:24:46 +03:00
Mikhael Bogdanov
3063de82aa Fix JVM BE IR part
(cherry picked from commit 5e55040)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
1d67cd3b97 IR: add ir.backend.common to jvm backend dependencies
(cherry picked from commit 0776e3d)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
9bcc3cae79 IR Tree: add overloads for irCall and IrGetValueImpl
(cherry picked from commit 1420fc5)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
80b6d84c72 Add dependency: backend.js -> ir.backend.common
(cherry picked from commit a8b02f8)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
7e9cf64754 KJS: don't use onlyIf from ir/backend.common
(cherry picked from commit 34574a9)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
49f2598907 IrTypes: fix ir2cfg
(cherry picked from commit cf162c7)
2018-06-29 11:24:46 +03:00
Zalim Bashorov
ea7b344b80 Use IrType in IrSuspensionPointImpl and IrSuspendableExpressionImpl
(cherry picked from commit 06e1728)
2018-06-29 11:24:46 +03:00
Dmitry Petrov
d5286874bd Fix circular dependency: TypeTranslator <-> ConstantValueGenerator
TODO proper DI?
2018-06-29 11:24:46 +03:00
Dmitry Petrov
ede3a34baa Temporary fix for IR2CFG: use originalKotlinType 2018-06-29 11:24:46 +03:00
Dmitry Petrov
15eafc1513 IrTypes: IrSuspensionPoint, IrSuspendableExpression update 2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
b11abeed6a IrTypes: migrate some code from backend.common
(cherry picked from commit 3788130)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
f1bdb48a76 IrTypes: comment backend.common code to be migrated by someone else
(cherry picked from commit 0491fc4)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
25d0c57194 backend.common: remove obsolete lowerings
(cherry picked from commit 5d6b9c7)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
17312a305b psi2ir: fix type for IrGetField(delegate) when generating delegation
(cherry picked from commit 7601cc2)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
56fdf2c735 psi2ir: fix null support in 'promoteToPrimitiveNumericType'
(cherry picked from commit 9b2a637)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
0b4d9513eb psi2ir: fix generating fake override for property with type parameters
(cherry picked from commit 2051177)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
be413e4fab psi2ir: don't generate accessor type parameter supertypes twice
(cherry picked from commit 22e6d5f)
2018-06-29 11:24:46 +03:00
Dmitry Petrov
a9d0e6d3da IrTypes: generateAnnotationConstructorCall -> ConstantValueGenerator 2018-06-29 11:24:46 +03:00
Dmitry Petrov
3a11767fae IrTypes: use proper scope for type parameters in stub generation 2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
f837537cb6 IrTypes: fix multiple issues in psi2ir 2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina
35cf7c4db3 Expose transformAnnotations from DeepCopyIrTree 2018-06-29 11:24:46 +03:00
Dmitry Petrov
d1b6e8901a Minor: IrTypes: fix after rebase 2018-06-29 11:24:46 +03:00
Dmitry Petrov
2d9ae6e93e IrTypes: approximate only non-denotable Kotlin types 2018-06-29 11:24:46 +03:00
Dmitry Petrov
93f4a4da10 IrTypes: star projections
Initial implementation, mostly to avoid infinite recursion in cases such
as 'Enum<*>'.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
5b3947da11 IrTypes: Fix type arguments mapping for properties 2018-06-29 11:24:46 +03:00
Dmitry Petrov
7497372f65 IrTypes: IrProperty has no type of its own
Within the current scheme, type parameters for IrProperty become type
parameters for getter and setter (and, since only extension properties
can have type parameters, backing field's type can't depend on type
parameters; see also KT-24643). Either properties themselves can have
type parameters of their own (for the sake of representing the property
type), or properties don't have types and don't have type parameters.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
ad65fa8c45 IrTypes: IrTypeParameter.superTypes can depend on type parameters
IrTypeParameter.superTypes can depend on type parameters and thus should
be initialized with type parameters in scope.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
eb6f652763 IrTypes: IrClass.superTypes can depend on type parameters
IrClass.superTypes can depend on type parameters of a class and thus
should be initialized after type parameters are in put in scope.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
8ae17ecbcb IrTypes: IrFunction.returnType can depend on type parameters
Function return type can depend on function type parameters and should
be initialized with type parameters in scope.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
847223683e Minor: IrTypes: fix after rebase 2018-06-29 11:24:46 +03:00
Dmitry Petrov
0ffef64428 IrTypes: IrClass.superTypes, IrTypeParameter.superTypes 2018-06-29 11:24:46 +03:00
Dmitry Petrov
353076f596 compiler/ir/backend.common is NOT a part of compiler/backend-common 2018-06-29 11:24:46 +03:00
Dmitry Petrov
25a66916a6 IrTypes: minor: pass generator context where required 2018-06-29 11:24:46 +03:00
Dmitry Petrov
6649ef2740 IrTypes required to declare symbol 2018-06-29 11:24:46 +03:00
Dmitry Petrov
609a6ca9bb IrTypes: dummy implementation of IrType.render 2018-06-29 11:24:46 +03:00
Dmitry Petrov
4eb2fc66d0 IrTypes: deep copy with symbols
Preliminary implementation of type remapper (does nothing).
2018-06-29 11:24:46 +03:00
Dmitry Petrov
062c4bf41d IrTypes: make old DeepCopy compile
Lots of TODOs, should figure out proper type mapping strategy
(or simply drop this frankenstein code, finally).
2018-06-29 11:24:46 +03:00
Dmitry Petrov
62a42130c8 Add dependency: ir.tree -> intellij
AnnotationGenerator looks into PsiElement
2018-06-29 11:24:46 +03:00
Dmitry Petrov
c22f6dee4a IrTypes: update minor utilities 2018-06-29 11:24:46 +03:00
Dmitry Petrov
e8fe788df6 IrTypes: Implicit casts, take 1
Keep KotlinType along with IrTypes created by psi2ir.
2018-06-29 11:24:46 +03:00
Dmitry Petrov
54e9a2bb7b IrTypes in psi2ir: generators (seem to be) complete 2018-06-29 11:24:46 +03:00
Dmitry Petrov
5f4f6ef863 IrTypes in psi2ir (work in progress) 2018-06-29 11:24:46 +03:00
Dmitry Petrov
0774ca415c Rebase + reformat 2018-06-29 11:24:46 +03:00
Dmitry Petrov
0f718ec2d8 IrTypes: Fix up some back-end code 2018-06-29 11:24:46 +03:00
Dmitry Petrov
326e4a160f IrTypes in psi2ir (work in progress) 2018-06-29 11:24:46 +03:00
Dmitry Petrov
0e34ee5270 IrTypes: basic built-in types 2018-06-29 11:24:46 +03:00
Dmitry Petrov
c97697d7a9 psi2ir: translate types in StatementGenerator
TODO: DI
2018-06-29 11:24:46 +03:00
Dmitry Petrov
372f280578 DeclarationStubGenerator uses IrTypes 2018-06-29 11:24:46 +03:00
Dmitry Petrov
1353cf879c IR: Drop obsolete builders (should be rewritten) 2018-06-29 11:24:46 +03:00
Dmitry Petrov
f66f3c1fed psi2ir: cleanup TypeTranslator 2018-06-29 11:24:46 +03:00
Dmitry Petrov
4bd2504367 IR declarations: KotlinType -> IrType 2018-06-29 11:24:46 +03:00
Dmitry Petrov
4992ca9179 IR expressions: KotlinType -> IrType 2018-06-29 11:24:46 +03:00
Dmitry Petrov
c28877d23c psi2ir: approximate types in TypeTranslator 2018-06-29 11:24:46 +03:00
Dmitry Petrov
1be28d6032 IrType -> IrDynamicType, IrErrorType, IrSimpleType 2018-06-29 11:24:46 +03:00
Mikhail Glukhikh
fdc0335b4a Add actual: handle (incorrect) case with expect function with body
So #KT-23326 Fixed
2018-06-29 10:54:37 +03:00
Mikhail Glukhikh
0fb183e302 Add actual: handle parameters with val/var as compatible with property
So #KT-23762 Fixed
2018-06-29 10:54:36 +03:00
Mikhail Glukhikh
dd0b267531 Add actual: handle primary & secondary constructors as compatible
So #KT-23686 Fixed
2018-06-29 10:54:35 +03:00
Mikhail Glukhikh
082c3e6767 Reformat: AddActualFix 2018-06-29 10:54:33 +03:00
Mikhail Glukhikh
16c6d63b10 Create actual: do not generate default parameter values
So #KT-23105 Fixed
2018-06-29 10:54:32 +03:00
Mikhail Glukhikh
b13e4535f5 Safe delete: add dialog asking about expect / actual declarations
Related to KT-15666
2018-06-29 10:54:30 +03:00
Mikhail Glukhikh
aac71bf904 Safe delete: when invoking on actual, delete expect & actual neighbors
So #KT-15666 Fixed
2018-06-29 10:54:24 +03:00
Mikhail Glukhikh
50e70e4638 Safe delete: when invoking on expect, delete also relevant actual
Partial fix of KT-15666
2018-06-29 10:53:43 +03:00
Mikhail Glukhikh
465d5c077e Safe delete: search for actual declarations more accurately 2018-06-29 10:53:42 +03:00
Mikhail Glukhikh
5bdaef4983 Cleanup: KotlinSafeDeleteProcessor 2018-06-29 10:53:42 +03:00
Mikhail Glukhikh
c4bba135bf Introduce KotlinInspectionSuppressor
So #KT-25169 Fixed
So #KT-11154 Fixed
2018-06-29 10:43:02 +03:00
Alexey Tsvetkov
8848d7a043 Remove groovy plugin from kotlin-gradle-plugin build script 2018-06-28 22:03:11 +03:00
Alexey Tsvetkov
22c1907167 Track project version in ":kotlin-gradle-plugin:processResources"
Before the change consecutive incremental builds with different project versions
produced kotlin-gradle-plugin with the same project.version in project.properties file
2018-06-28 22:03:11 +03:00
Alexey Tsvetkov
3a7c674957 Fix test dependencies in jps-plugin
Otherwise tests fail on clean checkout
2018-06-28 22:03:10 +03:00
Alexey Sedunov
a63aa5b7ca Misc: Restore utility functions misplaced in a previous commit 2018-06-28 20:39:16 +03:00
Alexey Sedunov
76ac65f723 Configuration: Use soft references to keep library kind cache
#KT-24943 Fixed
2018-06-28 18:22:28 +03:00
Alexey Sedunov
60583e557f PSI: Do not delete package directive for file in default package
#KT-24968 Fixed
2018-06-28 18:22:28 +03:00
Alexey Sedunov
e2a632e326 Misc: Add "refactoring exit" message
This allows executing mandatory code at the end of particular refactoring.
Also this fixes memory leak due to listener not being disposed

 #KT-17235 Fixed
2018-06-28 18:22:28 +03:00
Alexey Sedunov
ba2f28720f Introduce Parameter: Fix exceptions caused by write actions in dialogs
#KT-24992 Fixed
2018-06-28 18:22:27 +03:00
Alexey Sedunov
ed597e2da5 Extract Function: Make compliant with PublicApiImplicitTypeInspection 2018-06-28 18:22:27 +03:00
Alexey Sedunov
633c67ebf0 Misc: Use KtToken to represent visibility in ExtractableCodeDescriptor 2018-06-28 18:22:27 +03:00
Mikhael Bogdanov
b1693acfcd Unmute smap test in ir 2018-06-28 17:12:09 +02:00
Alexey Sedunov
83745010ba Search Everywhere: Update renderer to reflect changes in IDEA
#KT-24812 Fixed
2018-06-28 17:52:05 +03:00
Alexey Sedunov
31d248c42d Search Everywhere: Use Kotlin renderer for Kotlin elements only 2018-06-28 17:52:05 +03:00
Alexey Sedunov
bede2e1c16 Extract Interface: Fix type import when converting parameter to property
#KT-18736 Fixed
2018-06-28 17:52:05 +03:00
Alexey Sedunov
9b7450cfdb Extract Superclass: Report private members used in abstracted members
#KT-16284 Fixed
2018-06-28 17:52:04 +03:00
Alexey Sedunov
bd88e02172 Extract Superclass: Fix visibility lifting when moving to interface
#KT-16281 Fixed
2018-06-28 17:52:04 +03:00
Alexey Sedunov
b0e0460ee6 Extract Superclass: Allow extraction to existing file
#KT-15351 Fixed
2018-06-28 17:52:04 +03:00
Alexey Sedunov
5ef54a2f03 Extract Superclass: Run refactoring inside of transaction
#KT-18555 Fixed
2018-06-28 17:52:03 +03:00
Nikolay Krasko
87f4d0c5a4 Move "Copy Current File As Diagnostic Test" action to internal (KT-25164)
#KT-25164 Fixed
2018-06-28 16:02:14 +03:00
Nikolay Krasko
c68284030d Check files is valid before searching for children (EA-113417) 2018-06-28 16:02:14 +03:00
Alexander Udalov
8c8d0eefbb Relocate package org.jetbrains.kotlin in kotlinx-metadata-jvm
To prevent clashes in scenarios where it's used together with the Kotlin
compiler (e.g. in annotation processing)

 #KT-24945 Fixed
2018-06-28 14:39:53 +02:00
Mikhail Zarechenskiy
173bcd90df Simplify lexer rule for typed integers 2018-06-28 13:32:10 +03:00
Mikhael Bogdanov
e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Mikhael Bogdanov
a10c06eb4d Regenerate ir tests with JVM_IR target 2018-06-28 12:26:41 +02:00
Mikhail Zarechenskiy
dc7678a700 Use smartcast info that related to call in change signature quick fix
There is an inconsistency on how we record smartcasts in old and new
 inference, but we definitely should use all possible information about
 smartcasts in quick-fixes

 #KT-25144 Fixed
2018-06-28 13:14:18 +03:00
Nicolay Mitropolsky
698096f13e Uast: fix for creating an UClass for invalid object-literals (EA-122644, KT-20056) 2018-06-28 10:29:47 +03:00
Alexey Tsvetkov
25e6b76238 Build: disable jar compression for local builds
This speeds ups jar creation twice, which is significant for local
incremental builds when jar creation can dominate compilation time.

Changes in stripMetadata are required because putting entry from not-stripped
jar caused failures when compression was disabled (because size and crc
are actually changed during metadata removal; don't know why it works
with compression).
2018-06-27 23:56:26 +03:00
Alexey Tsvetkov
3dc38fe2f8 Build: enable Java incremental compilation for local builds 2018-06-27 23:56:26 +03:00
Alexey Tsvetkov
c73657b38d Build: disable incremental compilation for non-TC build
This should bring small performance improvements for CI builds
(since they are not incremental anyway).
2018-06-27 23:56:26 +03:00
Nico Mandery
5c16633175 fix typos in documentation of JsQualifier annotation (#1733) 2018-06-27 19:34:27 +03:00
Lucas Smaira
5820656aae Find Kotlin class with alternative resolve enabled
Kotlin run configurations are failing non-deterministically in Android
Studio due to not finding the class while in dumb mode (while AS invokes
Gradle build or in indexing after that).

Fix that by finding class in KotlinRunConfiguration with alternative
resolve enabled.
2018-06-27 16:38:44 +03:00
Vyacheslav Gerasimov
abd3ac4e96 UAST: Reformat KotlinUObjectLiteralExpression.kt 2018-06-27 16:04:41 +03:00
Vyacheslav Gerasimov
a829251690 UAST: Fix possible TypeCastException when creating KotlinUNamedExpression 2018-06-27 16:04:40 +03:00
Vyacheslav Gerasimov
23ee463053 Check if module disposed when getting modules with kotlin files 2018-06-27 16:04:40 +03:00
Vyacheslav Gerasimov
16b4d25c1d Reformat ConfigureKotlinInProjectUtils 2018-06-27 16:04:40 +03:00
Vyacheslav Gerasimov
62c0d37d45 UAST: Do not log PCE in DeclarationDescriptor.toSource 2018-06-27 16:03:16 +03:00
Nikolay Krasko
8ea19eda73 as32: Minor: use full sentences for reasons 2018-06-27 15:11:08 +03:00
Nikolay Krasko
17d4961760 as32: Use full sentences for reasons 2018-06-27 15:11:08 +03:00
Nikolay Krasko
099f3f3ddf Move isEap and isDev utility functions to idea module 2018-06-27 15:11:08 +03:00
Nikolay Krasko
54bb09a5fb Make disabled verification visible in UI 2018-06-27 15:11:07 +03:00
Alexander Udalov
0c45f20515 Minor, fix several CLI argument descriptions 2018-06-27 13:25:30 +02:00
Mikhail Zarechenskiy
a765ee41d7 Introduce uL/UL suffix to represent numbers of unsigned long type
#KT-24663 Fixed
2018-06-27 14:21:12 +03:00
Mikhail Zarechenskiy
7c44992016 Allow any case for u suffix
#KT-24663 In Progress
2018-06-27 14:21:07 +03:00
Alexander Udalov
984e37c7f1 Prohibit explicit usage of kotlin.Metadata as annotation 2018-06-27 12:37:18 +02:00
Alexander Udalov
8d124eb77f Minor, use array literal syntax in kotlin.Metadata 2018-06-27 12:20:03 +02:00
Dmitry Petrov
46a3f7420c When in debugger context, access private companion object directly 2018-06-26 16:46:55 +03:00
Nicolay Mitropolsky
bef3d4ace2 Uast: proper identifiers for KotlinUBinaryExpression (KT-25092) 2018-06-26 16:39:47 +03:00
Mikhail Glukhikh
eb92b7ed7f Unused symbol: don't suggest actual declaration used in another platform
Related to KT-17512
Related to KT-15666
2018-06-26 15:36:10 +03:00
Mikhail Glukhikh
30327aa9cc Do not mark kotlin.test.Test annotated declarations as unused
So #KT-20523 Fixed
2018-06-26 15:36:09 +03:00
Mikhail Glukhikh
7e0e7dc983 Unused symbol: remove forced "used" from actual declarations
Now we really check whether actual declaration has usages
(in expect or actual code) or not
Related to KT-17512
Related to KT-15666
2018-06-26 15:36:07 +03:00
Mikhail Glukhikh
e885e54233 Implement search from expect element in KotlinReferenceSearcher
So mostly #KT-17512 Fixed
2018-06-26 15:36:06 +03:00
Mikhail Glukhikh
97d158d833 Find property usages dialog: rename all check-boxes as in other dialogs 2018-06-26 15:36:05 +03:00
Mikhail Glukhikh
abbfea357a Add find usages option: search expected 2018-06-26 15:36:04 +03:00
Mikhail Glukhikh
69e420991a KotlinFindMemberUsagesHandler: get rid of deprecation 2018-06-26 15:36:03 +03:00
Mikhail Glukhikh
0a36edcf20 Cleanup: KotlinReferenceSearcher 2018-06-26 15:36:01 +03:00
Mikhail Glukhikh
ea7db42af6 Cleanup: findUsagesOptions 2018-06-26 15:36:00 +03:00
Mikhail Glukhikh
a46e4f3142 Cleanup: KotlinFindMemberUsagesHandler 2018-06-26 15:35:59 +03:00
Mikhail Glukhikh
cc2869988f Test for KT-17512 (yet with incorrect results) 2018-06-26 15:35:58 +03:00
Mikhail Zarechenskiy
600d135786 Fix internal compiler error on importing invisible fake reference
Note that this is not relevant for LOCAL/INHERITED visibilities:
  - for LOCAL visibility it's impossible to have a qualifier
  - INHERITED is an intermediate visibility, we enhance it later
    (see resolveUnknownVisibilityForMember)

 #KT-20356 Fixed
2018-06-26 14:18:21 +03:00
Nikolay Krasko
84b26fc61d Show kotlin internal information only in internal builds 2018-06-26 11:35:22 +03:00
Nikolay Krasko
5df0879538 Fix NPE in replaceImports() (EA-109700) 2018-06-26 11:35:21 +03:00
Alexander Udalov
1951d38f40 Retain optional expected annotations when compiling platform code
After this change, optional expected annotations will be compiled to
physical class files on JVM, and stored to metadata on other platforms,
to allow their usages from dependent platform modules. For example:

    @OptionalExpectation
    expect annotation class A

When compiling this code on JVM, A.class will be produced as if the
class A did neither have the 'expect' modifier, nor had it been
annotated with OptionalExpectation. Note that if there's no actual
annotation class for A, then usages (which can only be usages as
annotation entries) are simply skipped.

Class A will be public from Kotlin's point of view (since it should
be possible to use it in Kotlin sources), but _package-private_ in Java
to disallow its usages outside of the declaring module.

 #KT-18882 Fixed
 #KT-24617 Fixed
2018-06-26 10:23:55 +02:00
Alexander Udalov
4e217b180a Pass BindingContext to CodegenUtil.getActualDeclarations
Will be used in a subsequent commit. Also rename getActualDeclarations
-> getDeclarationsToGenerate
2018-06-26 10:23:55 +02:00
Mikhail Zarechenskiy
ba6da7c40a Support varargs of inline class types with non-trivial spread
#KT-24880 In Progress
2018-06-25 17:15:50 +03:00
Mikhail Zarechenskiy
333411c57d Associate vararg of unsigned types with corresponding arrays
This is a first step, full support will be added later

 #KT-24880 In Progress
2018-06-25 17:15:47 +03:00
Mikhail Zarechenskiy
3e45a1529c Allow to declare vararg parameters of unsigned types
varargs inside annotations will be supported later when
 constant evaluation of more complex expressions of unsigned types
 will be ready

 #KT-24880 In Progress
2018-06-25 17:15:44 +03:00
Mikhail Zarechenskiy
3f462659d2 Determine underlying property of inline class by its name
Previous way to distinguish "primary constructor properties" from other
 properties wasn't correct for deserialized properties, because currently
 we don't have special information about this in metadata
2018-06-25 17:11:59 +03:00
Sergey Igushkin
dbd72ae53b Fix Android ap option providers as Kapt task nested inputs
1) Exclude the providers arguments from the kapt inputs, as the values
may contain absolute paths, may be output properties etc. The providers
should correctly annotate their inputs.

2) Fix the options passed to kapt as 'value=option' (leading to all the
options collapse into one with the null key), use 'key=option' instead
to make Kapt pass them as '-Aoption'.

Issue #KT-23866 Fixed
Issue #KT-25027 Fixed
2018-06-25 15:03:52 +03:00
Mikhail Glukhikh
a3be68de82 Useless call: move class up from companion to remove 1.3 deprecation 2018-06-25 12:07:45 +03:00
Ilya Chernikov
7bff5e3ce7 Add missing tests dependencies on the renewed kotlin-scripting-idea plugin 2018-06-25 08:06:20 +02:00
Ilya Chernikov
1fbece9e7d Clean scripting plugin options and classpath on importing from gradle
should prevent problems that may appear if JPS will try to load
gradle scripting subplugin

(cherrypicked with update from 1.2.50)
2018-06-25 08:06:20 +02:00
Alexander Udalov
0dc12fc560 Update bootstrap to 1.2.60-dev-980 2018-06-24 18:14:37 +02:00
Ilya Gorbunov
39cad033a3 Cleanup: remove deprecated configuration property
Currently it's useless because we don't override compilerJarFile anymore.
2018-06-24 17:27:57 +03:00
xiexed
414fabb2c6 KtStringTemplateExpressionManipulator: properly works with interpolations (KT-24958) 2018-06-22 21:54:28 +03:00
Vyacheslav Gerasimov
01db78d776 Build: Introduce Project extension properties for source sets 2018-06-22 21:42:30 +03:00
Vyacheslav Gerasimov
42dc6a277f Build: Remove build.gradle.kts.182 for root project 2018-06-22 21:42:29 +03:00
Vyacheslav Gerasimov
07b0eeccc4 Build: Reduce differences in versions scripts 2018-06-22 21:42:13 +03:00
Vyacheslav Gerasimov
5ec535b680 Build: Rename File helper for creating file from pathes list to fileFrom 2018-06-22 21:42:12 +03:00
Vyacheslav Gerasimov
37ed8e2617 Build: Reformat CommonUtil.kt 2018-06-22 21:42:12 +03:00
Vyacheslav Gerasimov
4e3e4b2cd0 Build: Exclude android-lint.jar from CIDR plugin 2018-06-22 21:41:25 +03:00
Vyacheslav Gerasimov
e724cfa60f Revert "Build: Copy uast to idea plugin as separate artifacts"
This reverts commit e6f6451
2018-06-22 21:41:25 +03:00
Leonid Startsev
bef97d85af Respect version string in SubpluginArtifact to load compiler plugins
with versions different from compiler one
2018-06-22 21:13:34 +03:00
Nikolay Krasko
be5527b108 Merge pull request #1088 from lucamtudor/lucamtudor-patch-readme
Updates ReadMe.md to name the Sublime Text Package
2018-06-22 21:10:55 +03:00
Nicolay Mitropolsky
01e9dd5085 don't use project scope to resolve java.lang.String (#KT-25024) 2018-06-22 20:28:55 +03:00
Nikolay Krasko
cdfb813f2e Use single settings for Kotlin code style 2018-06-22 19:19:14 +03:00
Nikolay Krasko
8e31113a4f Ident elvis with normal ident in Kotlin code style (KT-25008)
#KT-25008 Fixed
2018-06-22 19:19:13 +03:00
Nikolay Krasko
341e7746a2 Minor: deprecated canBeOverriden -> canBeOverridden 2018-06-22 19:19:13 +03:00
Nikolay Krasko
6d29e44d1a Remove deprecated DirectClassInheritorsSearch.search call (KT-24933)
#KT-24933 Fixed
2018-06-22 19:19:13 +03:00
Nikolay Krasko
1973860e70 Indent content of when (KT-14066)
#KT-14066 Fixed
2018-06-22 19:19:12 +03:00
Nikolay Krasko
dc8a3ab534 Fix leak in debugger (KT-24903)
#KT-24903 Fixed
2018-06-22 19:19:12 +03:00
Nikolay Krasko
64f14ad89b Reformat: debugger.stepping 2018-06-22 19:19:12 +03:00
Alexey Tsvetkov
89f0b11765 Avoid exception when inspectClassesForKotlinIC produces empty file
Empty file should not happen, but we should process it correctly anyway.
2018-06-22 19:15:45 +03:00
Alexey Tsvetkov
2065f8e6fe Fix inter-project IC for android->non-android dependency
#KT-24832 fixed
2018-06-22 19:15:45 +03:00
Alexey Tsvetkov
9071a70a44 Avoid iterating jar inputs in inspectClassesForKotlinIC task
Jar's inputs can contain zipTrees in case of fat jars,
which can cause slow build
(Gradle unpacks them into temporary dir; that can be slow)

    #KT-24956 fixed
2018-06-22 19:15:45 +03:00
Alexey Tsvetkov
e38cafb1a2 Don't create build directory for task in getter
Since the property is public, it can be invoked from outside,
possibly trough other properties.
This can lead to unwanted side effects: we can create taskBuildDirectory,
because some other task reads the property in parallel with 'clean' task
in current project.
That's exactly what happened when we referenced the property from
'GradleCompilerRunner#buildModulesInfo'.

    #KT-24938 fixed
2018-06-22 19:15:45 +03:00
Alexey Tsvetkov
03839f6861 Test: speed up integration test by not building release variant 2018-06-22 19:15:45 +03:00
Alexey Tsvetkov
433e742d73 Fix location mapping test on Windows 2018-06-22 19:15:45 +03:00
Nikolay Krasko
36ced8a6a6 as32: Allow to override verifier checks 2018-06-22 18:56:24 +03:00
Yan Zhulanow
4aa7a95055 Android Extensions: Explicitly check if the Android plugin is enabled (EA-104651)
AndroidGradleOrderEnumerationHandler is defined in gradle.xml that doesn't depend on the Android plugin.
So we need to additionally check if the Android plugin is installed/enabled.
2018-06-22 17:48:13 +03:00
Dmitry Petrov
d35a92a81d Generate accessor for private companion object 2018-06-22 16:53:07 +03:00
Svyatoslav Scherbina
ba3411e7d7 JS IR: unmute tests 2018-06-22 13:36:47 +03:00
Ilya Gorbunov
6d027bbbfc Remove state from parts of multifile classes
Split COROUTINE_SUSPENDED marker to expect and actual because Kotlin/JS backend
expects it to be property without getter.

Update EXPECTED_REACHABLE_NODES in JS test data.

#KT-24986 Fixed
2018-06-22 11:35:05 +03:00
Svyatoslav Scherbina
cffe7fb23b backend.common: backport DefaultArgumentStubGenerator from Native 2018-06-21 18:18:03 +03:00
Svyatoslav Scherbina
830923e111 backend.common: backport LocalDeclarationsLowering from Native 2018-06-21 18:18:02 +03:00
Svyatoslav Scherbina
944c60eb66 ir.tree: fix bug in IrElementTransformerVoid 2018-06-21 18:18:01 +03:00
Simon Ogorodnik
e20ee0205a Update bunches to include performanceTest config 2018-06-21 16:05:47 +03:00
Simon Ogorodnik
0ac32ae41b Switch GC to ConcMarkSweep and add other options from IDEA defaults 2018-06-21 16:05:46 +03:00
Simon Ogorodnik
7531a103a3 Add options to use JFR 2018-06-21 16:05:45 +03:00
Alexey Tsvetkov
b97e82f604 Resolve bootstrap compiler classpath in root buildscript
Temporary workaround for bootstrapping.
Building the project with plugin version 1.2.60-dev-xxx
and deployVersion='1.3-SNAPSHOT' fails because Gradle
substitutes kotlin-stdlib dependency of kotlinCompilerClasspath
configuration with project dependency ':kotlin-stdlib'.
kotlinCompilerClasspath configuration is used to run the compiler,
which cannot be started with not yet built ':kotlin-stdlib'.
2018-06-21 16:03:27 +03:00
Denis Zharkov
a644cbb5ed Fix deserialization of kotlin.suspend when LV=1.3 is used
Before this change, kotlin.suspend was being loaded as having a common
function type instead of suspend function type.

With LV=1.3, we expect that suspend function types should have
new Continuation interface as a last type argument, while
kotlin.suspend is built with LV=1.2 and has old Continuation.

This change might be reverted once stdlib will be rebuilt with LV=1.3

NB: kotlin.suspend doesn't need to be intrinsified since it only returns
its parameter with checkcast to kotlinin.jvm.functions.Function1
(i.e., it doesn't refer the coroutines package)

 #KT-24861 Fixed
2018-06-21 16:02:13 +03:00
Denis Zharkov
3d3d21cb93 Minor. Extract function in TypeDeserializer 2018-06-21 16:02:13 +03:00
Denis Zharkov
9deb9473d2 Minor. Reformat TypeDeserializer.kt 2018-06-21 16:02:13 +03:00
Denis Zharkov
3fcf2f9c0d Minor. Move KOTLIN_SUSPEND_BUILT_IN_FUNCTION_FQ_NAME constant to 'core'
It will be used for deserialization of kotlin.suspend in the next commit
2018-06-21 16:02:13 +03:00
Denis Zharkov
effdcddeca Minor. Extract createDefaultFakeSMAP in InlineCodegen 2018-06-21 16:02:13 +03:00
Toshiaki Kameyama
5a4cba7528 "To raw/ordinary string literal" intention: Move cursor to same offset after conversion #KT-18106 Fixed (#1675) 2018-06-21 15:56:18 +03:00
Alexander Udalov
51c01c15b8 Refactor KotlinCoreEnvironment, fix warnings 2018-06-21 14:47:28 +02:00
Alexander Udalov
d2f278b601 Minimize content of version-specific bunch files for KotlinCoreEnvironment 2018-06-21 14:47:27 +02:00
Alexander Udalov
9309570752 Fix serialization of type parameters inner generic class
The call to `createTopLevel` instead of `create` (which creates
serializers for outer classes properly, with correct type parameter
contexts) caused MetadataSerializer to write type parameter metadata
incorrectly.  For example, in the following case:

    class A<E> {
        inner class B<T, E> { ... }
    }

A's type parameter E would get id 0, and B's type parameters T and E
would get ids 0 and 1. This is a problem because ids are supposed to be
unique for each class including its outer classes, and deserializer,
decompiler and stub builder rely on this assumption.

JVM metadata is unaffected because `create` is called correctly there,
see MemberCodegen#generateKotlinClassMetadataAnnotation

 #KT-24944 Fixed
2018-06-21 14:45:45 +02:00
Mikhail Zarechenskiy
c05285a23c Remove unneeded bunch file for TargetPlatform.kt
- added missing call checkers
 - fixed missing dependency for `KotlinCallComponents`

 #KT-25018 Fixed
2018-06-21 13:52:10 +03:00
Mikhail Zarechenskiy
6c06d441e5 Fix description of error type 2018-06-21 13:49:37 +03:00
Dmitry Savvinov
70714cb71e Deprecate smartcasts on local delegated properties
^KT-22517 Fixed
2018-06-21 13:36:43 +03:00
Dmitry Savvinov
31ce992ff2 Take DataFlowValueFactoryImpl from DI container instead of constructing directly 2018-06-21 13:36:43 +03:00
Dmitry Savvinov
fa72198505 Minor: narrow deprecation scope of DataFlowValueFactoryImpl to constructor 2018-06-21 13:36:43 +03:00
Dmitry Savvinov
8964b2c7a4 Minor: escape colon properly in interalArgWrongPrefix.args 2018-06-21 13:36:11 +03:00
Anton Bannykh
6edf138460 JS IR: muted newly failing tests 2018-06-21 13:27:17 +03:00
Anton Bannykh
04a2ffc0c1 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Anton Bannykh
6df9919eba JS IR: add DefaultContructorMarker to the runtime 2018-06-21 13:27:17 +03:00
Anton Bannykh
9039b75c25 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Anton Bannykh
c077b3ca5d JS IR: invoke missing lowering step for default arguments lowering 2018-06-21 13:27:17 +03:00
Dmitry Petrov
d546fca876 Enable JS_IR back-end on passing 'when' tests 2018-06-21 12:32:00 +03:00
Dmitry Petrov
8999e5bfe6 psi2ir: support unsigned integer literals
NB in FE unsigned integer constants are now represented using signed
integer types (e.g., UInt constant actually holds an Int value).
So, in IR so far we also represent unsigned constant literals as
constant values of corresponding signed types, but with corresponding
unsigned type:
0xFFFF_FFFFu becomes 'CONST Int type=kotlin.UInt value=-1'
2018-06-21 12:32:00 +03:00
Mikhael Bogdanov
c444db90fb Basic support of source mapping in inliner 2018-06-21 11:18:41 +02:00
Mikhael Bogdanov
83ab2b1d34 Minor. Code clean 2018-06-21 11:18:40 +02:00
Mikhael Bogdanov
7c615eb7ab Minor. Reformat 2018-06-21 11:18:40 +02:00
Mikhael Bogdanov
3dff3d61f5 Skip generic signature in bridges 2018-06-21 11:18:39 +02:00
Mikhael Bogdanov
0f7dc6e8af Fix IMPLICIT_COERCION_TO_UNIT 2018-06-21 11:18:38 +02:00
Mikhael Bogdanov
ede751c074 Support more cases in special bridge lowering 2018-06-21 11:18:37 +02:00
Mikhael Bogdanov
64835c1c9c Generate synthetic instructions in loops to support non standart stack transformation 2018-06-21 11:18:37 +02:00
Mikhael Bogdanov
f6038aafcc Fix IMPLICIT_NOT_NULL coercion 2018-06-21 11:18:36 +02:00
Mikhael Bogdanov
a4308e983a Set proper parent for lowered local declaration 2018-06-21 11:18:35 +02:00
Mikhael Bogdanov
c588d22e6a Don't sort descriptors in DeclarationStubGenerator
Sorting adds 30% time to test execution
2018-06-21 11:18:35 +02:00
Alexey Tsvetkov
32b1c42647 Specify root type in non-existent location warning 2018-06-20 23:58:37 +03:00
Alexey Tsvetkov
3fb26d92df Filter out non-existent java source roots in kapt tasks
#KT-24716 fixed
2018-06-20 23:58:37 +03:00
Denis Zharkov
5c04a302fa Add additional checks for RestrictsSuspension-marked functions
Namely, check that when one calls a restricted function
the reciever used for that calls is obtained exactly from the enclosing
suspend function

 #KT-24859 Fixed
2018-06-20 20:00:10 +03:00
Nikolay Krasko
35fdfc9f05 Fix running inner classes from console
#KT-24961 Fixed
2018-06-20 19:52:33 +03:00
Juan Chen
cd91cffdeb as32: Fine-tune exception handling in GooglePluginUpdateVerifier 2018-06-20 19:47:56 +03:00
Nikolay Krasko
bf890b46f3 Allow to leave decline reason empty but demand verifier name 2018-06-20 19:47:55 +03:00
Juan Chen
855c0a353c as32: Improve plugin update verification messages 2018-06-20 19:47:55 +03:00
Juan Chen
6523d4e306 as32: Implementation for GooglePluginUpdateVerifier 2018-06-20 19:47:55 +03:00
Nikolay Krasko
34111e8944 Prototype verify extension and apply it for Kotlin updater in AS 3.2 2018-06-20 19:47:55 +03:00
Dmitry Petrov
871dacbf6c Minor: generated tests update 2018-06-20 17:34:05 +03:00
Mikhail Glukhikh
e1d223937b Optimize "replace toString() with string template"
Related to KT-13782
2018-06-20 17:18:18 +03:00
Mikhail Glukhikh
7a1cf5704e MPP wizard: use more clear wording (KT-20554) 2018-06-20 17:18:18 +03:00
Mikhail Glukhikh
152327d69d Fix erroneous full resolve cache filling
Before this commit, we could store partial resolve results in full
resolve cache (for some declarations, e.g. primary constructors).
This may be done iff current partial resolve mode provides all results
from full resolve mode (CFA results & diagnostics).
Otherwise we should not do it.

This fixes four quick-fix tests on CreateTypeParameter
So #KT-23860 Fixed
So #KT-22758 Fixed
2018-06-20 17:18:18 +03:00
Mikhail Glukhikh
40668e3f96 Partial cleanup of ResolveElementCache 2018-06-20 17:18:18 +03:00
Toshiaki Kameyama
096f9fefd1 "Remove redundant '.let' call" intention: handle it inside function call
So #KT-20583 Fixed
2018-06-20 17:18:17 +03:00
Toshiaki Kameyama
d4798b699f Reformat: ReplaceSingleLineLetIntention 2018-06-20 17:18:17 +03:00
kenji tomita
817d75a47f Introduce ReplaceToStringWithStringTemplateInspection #KT-13782 Fixed 2018-06-20 17:18:17 +03:00
Dmitry Petrov
f956e8d85d Record special descriptor in REFERENCE_TARGET for type alias object
If a type alias is used to reference an object (companion object) as a
qualifier, record FakeCallableDescriptorForTypeAliasObject in
REFERENCE_TARGET. This tells IDE that type alias was used in the file,
thus, if it's imported, such import isn't redundant.
REFERENCE_TARGET is used mostly by IDE and by ClassifierUsageChecker,
which we also have to update to handle qualifiers with
FakeCallableDescriptorForTypeAliasObject in REFERENCE_TARGET.

Rewrite some parts of ClassifierUsageChecker for cleaner interaction.

 #KT-21863 Fixed Target versions 1.2.40
2018-06-20 17:16:25 +03:00
Dmitry Petrov
3b3cc5233f Minor: reformat code 2018-06-20 17:16:25 +03:00
Toshiaki Kameyama
6675d7814c KT-14779 Inspection to replace String.format with string templates (#1645)
* Add inspection to replace String.format with string templates #KT-14779 Fixed

* KT-14779 Fixed
2018-06-20 16:23:04 +03:00
Toshiaki Kameyama
e41a34af88 KT-11850 Add nested lambdas with implicit parameters warning (#1664)
* Add `Nested lambda has shadowed implicit parameter` inspection #KT-11850 Fixed

* KT-11850 Fixed
2018-06-20 15:57:03 +03:00
Roman Artemev
c0f53f3a4d Move IrSuspendableExpression and SuspensionPoint from Kotlin/Native to common part 2018-06-20 15:06:00 +03:00
Dmitry Petrov
c312fddb45 Ignore some 'when' subject variable tests in JS_IR be 2018-06-20 14:06:34 +03:00
Dmitry Petrov
a4b5d74ae3 Generate debug information for 'when' subject variable
NB debugger tests currently don't support language version or individual
language feature settings.
2018-06-20 14:06:34 +03:00
Dmitry Petrov
a7492e91c9 Check that subject expression is evaluated only once 2018-06-20 14:06:34 +03:00
Dmitry Petrov
6194cfc782 Additional IEEE754-related tests for subject variable in 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov
34b76a3718 Support subject variable in specialized code generators for 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov
3528405666 Minor: reformat 2018-06-20 14:06:34 +03:00
Dmitry Petrov
b4dc3dc91b Fix exhaustiveness check for when with subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov
6949610dcb 'val' in 'when': IEEE754 equality 2018-06-20 14:06:34 +03:00
Dmitry Petrov
67247ee490 'val' in 'when' subject can't have modifiers (annotations are ok) 2018-06-20 14:06:34 +03:00
Dmitry Petrov
53fd883e2a Additional parser tests for both subject val and expression in 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov
bf083314dd Support 'when' with subject variable in psi2ir 2018-06-20 14:06:34 +03:00
Dmitry Petrov
d6894091a9 Support 'when' with subject variable in JVM BE 2018-06-20 14:06:34 +03:00
Dmitry Savvinov
148d03e365 Add some data flow analysis tests on when 2018-06-20 14:06:34 +03:00
Dmitry Petrov
ae929d0f08 Handle nested when with subject properly
Hack: callee expression for when with subject variable is the subject
variable declaration. This solves the problem that all sub-calls in the
expression are implicitly considered to have a single common lexical
scope (and 'when (val x = ...)' introduces a new lexical scope, which
contains 'x').
2018-06-20 14:06:34 +03:00
Dmitry Petrov
758548603e Extra tests for when with val in subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov
c691d64ea8 Minor: fix & reformat after rebase 2018-06-20 14:06:34 +03:00
Dmitry Petrov
8aec99f4b5 Fix parsing variable declaration in when subject
- parse destructuring declarations
- parse annotations on variable declaration in when subject
2018-06-20 14:06:34 +03:00
Dmitry Petrov
091b935c2d Introduce separate callee expression for when with subject variable
'Subject.Error' is redundant.
'Subject.None' can be an object.
'Subject#dataFlowValue' can be a lateinit property.

TODO: fix
- parsing local extension properties in 'when' subject
- parsing destructuring declarations in 'when' subject
- non-completed calls in nested 'when' with subject variable
- non-completed calls for subject variable in 'in' pattern
2018-06-20 14:06:34 +03:00
Dmitry Petrov
a76bf57694 Minor: remove redundant cast 2018-06-20 14:06:34 +03:00
Dmitry Petrov
5f0c9490bb Add test for smart cast on a value bound to when subject variable
E.g.:
  when (val y = x?.foo()) {
    null -> ...
    else -> ... // 'x' is also non-null here
  }
2018-06-20 14:06:34 +03:00
Dmitry Petrov
0a0bc67e8a Add test for UNUSED_VALUE on when subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov
c20c1abb68 Add test for VAL_REASSIGNMENT on when subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov
f6d446da47 It's ok to have no subject expression 2018-06-20 14:06:34 +03:00
Dmitry Petrov
7bc89b8871 Report error on illegal variable declaration in when subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov
4fe894c03d Minor: extract variable subject processing to a separate fun 2018-06-20 14:06:34 +03:00
Dmitry Petrov
098d3eb235 Make smart casts work with variable declared in when subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov
1eeafc2d0e Resolve variable declaration in 'when' subject 2018-06-20 14:06:34 +03:00
Toshiaki Kameyama
84e49e5b57 JS: Fix ClassCastException that occurs when 'when' clause has map range #KT-23458 Fixed 2018-06-20 14:00:29 +03:00
Toshiaki Kameyama
65ba57bcae JS: Fix TranslationRuntimeException on 'for (x in ("a"))' #KT-22376 Fixed 2018-06-20 13:59:10 +03:00
cobr123
db3c9962a2 Updates ReadMe.md JS issue link
{Backend. JS} instead {Back-end. JavaScript}
2018-06-20 12:51:10 +03:00
Dmitry Savvinov
9c61f65c0f Support internal compiler flags (-XX) in facets importing 2018-06-20 12:40:11 +03:00
Dmitry Savvinov
3fdfb49ac6 Minor: reformat and clean-up facetUtils.kt 2018-06-20 12:40:11 +03:00
Egor Neliuba
4fd076e4f4 Fix typo in DefaultErrorMessagesAndroid
"Delegating 'Parcelable' is now allowed" -> "Delegating 'Parcelable' is not allowed"
2018-06-20 01:04:30 +03:00
Yan Zhulanow
83ec49db31 Pill: Ignore kotlin-scripting compiler plugin from compiler arguments 2018-06-20 01:00:25 +03:00
Vyacheslav Gerasimov
fa56afca08 as31: Revert unintended changes in plugin.xml.as31 2018-06-19 21:35:26 +03:00
Vyacheslav Gerasimov
ea98a892d2 as31: Set until-build to 173.* instead of last AS 3.1 version (173.4301.25)
Was 173.4301.25 because of early builds of AS 3.2 which were 173 based
2018-06-19 21:05:58 +03:00
Vyacheslav Gerasimov
fa2eafe214 as31: Update AS to 3.1.3.0 2018-06-19 21:05:57 +03:00
Mikhail Zarechenskiy
fcacdc1fc5 Fix bridge methods generation when inline class types are used 2018-06-19 20:09:35 +03:00
Mikhail Zarechenskiy
f326fd66be Propagate KotlinType into if expression codegen for inline classes 2018-06-19 19:54:22 +03:00
Mikhail Zarechenskiy
c8c943e5fe [NI] Use context for relevant nested call to run call checkers
#KT-24808 Fixed
2018-06-19 19:54:21 +03:00
Roman Artemev
f69bd54d6c [JS IR BE] Update test data 2018-06-19 17:09:31 +03:00
Roman Artemev
02628e8de3 [JS IR BE] Support exceptions in IR BE runtime 2018-06-19 17:09:24 +03:00
Roman Artemev
b65443dd25 [JS IR BE] Support try-catch-finally in new backend 2018-06-19 17:08:14 +03:00
Alexey Tsvetkov
cdfcedb897 Minor: reword progress message
#KT-24936 fixed
2018-06-19 15:43:24 +03:00
Pavel V. Talanov
5063a4ce3d JavaElementFinder: revert to using ContainerUtil.quicksort
Fix comparator contract violated exception
Scopes inherited from LibraryScopeBase violate the comparator contract
2018-06-19 13:40:23 +02:00
Alexander Udalov
e689733f69 Revert "Map Kotlin TYPE target to Java TYPE_USE in bytecode"
This reverts commit d122406dca.

See KT-23857

 #KT-24952 Fixed
2018-06-19 12:08:18 +02:00
Alexander Udalov
863639c9ab Revert changes to data class equals/hashCode (KT-12330)
This looked like a small and useful change, but caused so many issues
(KT-24474, KT-24790, 30b9caea, and another unreported one -- see the
test update in this commit) that it didn't pay off after all. The
optimization is not that critical for now, as it's only relevant for
data classes where component types have trivial equals/hashCode
implementation, which is not very often

 #KT-12330 Declined
2018-06-19 12:05:55 +02:00
Max Medvedev
21ca06dace KT-22333 Extract function: make name editor focused once again 2018-06-19 12:51:18 +03:00
Toshiaki Kameyama
1e31d24e9b Add "Remove 'const'" quickfix for TYPE_CANT_BE_USED_FOR_CONST_VAL
So #KT-24815 Fixed
2018-06-19 12:48:13 +03:00
Toshiaki Kameyama
c344354395 Add quick-fix for 'is' absence in when #KT-18810 Fixed 2018-06-19 12:48:13 +03:00
Toshiaki Kameyama
2427406a8f Add 'Change to val' quickfix for delegates without setValue
So #KT-13688 Fixed
2018-06-19 12:48:13 +03:00
Toshiaki Kameyama
3292137acb "Convert lambda to anonymous function": Don't suggest in inline function
So #KT-24792 Fixed
2018-06-19 12:48:12 +03:00
Toshiaki Kameyama
fa58da85ee Add indices: don't suggest if parameter is destructuring declaration
So #KT-22162 Fixed
2018-06-19 12:48:12 +03:00
Toshiaki Kameyama
752c576e20 Reformat: AddForLoopIndicesIntention 2018-06-19 12:48:12 +03:00
Toshiaki Kameyama
2669193755 Use "Move to companion" quick fix for CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT
So #KT-22871 Fixed
2018-06-19 12:48:12 +03:00
Toshiaki Kameyama
69d2e8898a "Main should return Unit" inspection: extend on JUnit test methods
So #KT-24509 Fixed
2018-06-19 12:48:11 +03:00
Toshiaki Kameyama
b5e3db1811 Lambda to reference: fix false positive for parameter' class reference
So #KT-22041 Fixed
2018-06-19 12:48:11 +03:00
Toshiaki Kameyama
271cbc1dd3 Reformat: ConvertLambdaToReferenceIntention 2018-06-19 12:48:11 +03:00
Mikhail Glukhikh
b87dd07dd1 Redundant companion reference: minor refactoring 2018-06-19 12:48:11 +03:00
Toshiaki Kameyama
5ad98a139d "Redundant Companion": Don't suggest if same callable name is in use
So #KT-24425 Fixed
2018-06-19 12:48:10 +03:00
Alexey Sedunov
a2435ff3b0 Configuration: Add default gradle repository to settings.gradle
#KT-24614 Fixed
2018-06-19 12:22:41 +03:00
Alexey Sedunov
70287ce974 Configuration: Use Android variant as source set name
#KT-24839 Fixed
2018-06-19 12:22:41 +03:00
Alexey Sedunov
9a3a7fbcca Debugger: Dispose ExtractionData/ExtractionResult when necessary
This fixes memory leak due to extensive use of "Evaluate expression"
2018-06-19 12:22:41 +03:00
Alexey Sedunov
16dbc6fb4d Extract Function: Forbid inappropriate declarations inside extractable fragment
#KT-20467 Fixed
 #KT-20469 Fixed
2018-06-19 12:22:40 +03:00
Alexey Sedunov
f7cda61b08 Copy/Paste: Add imports for non-qualifiable callable references
#KT-23407 Fixed
2018-06-19 12:22:40 +03:00
Alexey Sedunov
694997651a Override/Implement: Fix processing of unresolved types
#KT-17350 Fixed
2018-06-19 12:22:40 +03:00
Alexey Sedunov
ed8b4b761a Override/Implement: Add 'actual' modifier to overrides of 'expect'
#KT-23106 Fixed
2018-06-19 12:22:40 +03:00
Alexey Sedunov
5f87e84966 Override/Implement: Do not insert super-call into extension body
Such super-calls are not are supported yet

 #KT-4311 Fixed
2018-06-19 12:22:39 +03:00
Alexey Sedunov
c49eede054 Generate hashCode()/equals(): Support deep array equality
#KT-19102 Fixed
2018-06-19 12:22:39 +03:00
Mikhail Glukhikh
9ef89447b3 Sealed sub-class -> object: handle equals, suggest "add equals"
Before this commit, sealed sub-class without state was considered
a style issue.
After this commit, sealed sub-class without state AND custom equals
is considered a probable bug,
because comparison of its instances is very fragile.
Alternative fix (generate equals & hashCode by identity) is added.
2018-06-19 11:20:26 +03:00
Dmitry Petrov
ecd2709a11 psi2ir: type arguments for function references 2018-06-19 11:13:50 +03:00
Mikhail Glukhikh
84c369dc6c Highlighting settings provider: skip inspections on libraries *only*
This keeps inspection running e.g. in build.gradle.kts scripts
2018-06-19 10:42:37 +03:00
Mikhail Glukhikh
cbec005055 Add test for KT-21710 (gutters inside library sources) 2018-06-19 10:42:36 +03:00
Mikhail Glukhikh
1819878c2b Switch off inspections on Kotlin files not in project source
To switch them off, KotlinDefaultHighlightingSettingsProvider
was introduced.
So #KT-19377 Fixed
2018-06-19 10:42:34 +03:00
Mikhail Glukhikh
ef0eb5cbe9 KotlinProblemHighlightFilter: *perform* highlighting on library sources
This commit reverts fixing commit for KT-19377
So #KT-21710 Fixed
So #KT-19377 Submitted
2018-06-19 10:42:33 +03:00
Mikhail Zarechenskiy
6431934c13 Fix signature mapping for built-in methods inside erased inline class 2018-06-18 18:55:18 +03:00
Mikhail Zarechenskiy
8503194e0d Temporarily mute test for JS target 2018-06-18 18:36:36 +03:00
Nikolay Krasko
0f88565b93 Auto-add pattern for running inner tests in Gradle (KT-24961)
Since Gradle 4.7 there's a more strict pattern check. Simple include
trick doesn't work anymore.

Probably modification of TestSelectionMatcher.java in
c2067eaa12 (diff-e92afe807d7ea74cc9ab0dcef30efc93)
is responsible for the new behaviour.

 #KT-24961 Fixed
2018-06-18 17:18:43 +03:00
Nikolay Krasko
1f2d6da770 Minor: fix formatting and warnings in tasks.kt 2018-06-18 17:18:38 +03:00
Alexander Udalov
f6169337dd Use kotlinx-metadata-jvm to relocate .kotlin_module files in kotlin-reflect
Instead of custom logic which used compiler internals and was very
brittle
2018-06-18 12:35:06 +02:00
Anton Bannykh
14dfb6bd99 JS: install -> npmInstall (collides with maven tasks) 2018-06-18 13:32:59 +03:00
Anton Bannykh
b551afb202 JS IR: minor fix for callable ref translation
The caching variable has to have no initializers so that there is no
dependence on evaluation order.
2018-06-18 13:15:19 +03:00
Anton Bannykh
43e3314255 JS IR: Remove inline functions with reified type parameters
Otherwise we cannot handle type casts
2018-06-18 13:15:19 +03:00
Anton Bannykh
3808d77bf4 JS IR: inliner 2018-06-18 13:15:19 +03:00
Anton Bannykh
d938c91711 JS IR: top-level initializer lowering 2018-06-18 13:15:19 +03:00
Mikhail Zarechenskiy
c5160a6a95 Don't use methods from super interface if call was on inline class type
Some methods (like `size` from kotlin.collections.Collection) have
 special rules for mapping and overriding. For example, when we call
 `size`, normally there will be `INVOKEVIRTUAL size()` in the bytecode,
 but for inline classes it should be `INVOKESTATIC ...$Erased.getSize()`
2018-06-18 12:35:31 +03:00
Mikhail Zarechenskiy
246d5e294c Fix bytecode optimisations for consequent boxing 2018-06-18 11:52:37 +03:00
Mikhail Zarechenskiy
01d9be65bc Perform bytecode optimisations for inline classes
#KT-23742 Fixed
2018-06-18 11:52:36 +03:00
Mikhail Zarechenskiy
7465289811 Introduce jvm backend class resolver to resolve asm types
Original author is @dnpetrov
2018-06-18 11:52:34 +03:00
Mikhail Zarechenskiy
5bdd7bca65 Pass GenerationState to OptimizationMethodVisitor
Original author is @dnpetrov
2018-06-18 11:52:32 +03:00
Mikhail Zarechenskiy
605cdcd8d8 Allow to use inline classes in 1.3 with warning 2018-06-18 11:52:31 +03:00
Mikhail Zarechenskiy
6db07f71f3 Check feature dependencies targets before report diagnostics
For example, if inline classes feature would have state `ENABLED_WITH_WARNING`,
 then corresponding warning will be reported on inline functions too
2018-06-18 11:52:29 +03:00
Nikolay Krasko
423e8f9979 Depend on jre8 kotlin stdlib in idea
Use jre artifact for now because of KT-24730.
2018-06-16 01:19:15 +03:00
Natalia Selezneva
077554c438 Use field access instead of setter in clone method of KtCodeFragment
Fix EA-120381
2018-06-16 00:01:29 +03:00
Alexander Udalov
a9974a522e Use correct class loader in kotlinx-metadata to load MetadataExtensions implementations
By default, ServiceLoader.load uses thread context class loader, which
can differ from the MetadataExtensions' class loader (which also loads
JvmMetadataExtensions, since they're in the same .jar) in many cases,
for example when used in annotation processing

 #KT-24881 Fixed
2018-06-15 19:35:39 +02:00
Alexander Udalov
28da071ff6 Remove usages of deprecated ClsCustomNavigationPolicy
#KT-24891 Fixed
2018-06-15 18:58:15 +02:00
Nikolay Krasko
ea3c4fd451 Run single test after Gradle 4.7 update 2018-06-15 18:06:20 +03:00
Roman Artemev
960fba3c4e Fix test failures 2018-06-15 16:23:06 +03:00
Nikolay Krasko
e37cbe51d2 Remove outdated runtime notification
#KT-23122 Fixed
 #KT-21634 Fixed
 #KT-20324 Fixed
 #KT-18366 Fixed
 #KT-20910 Fixed

Outdated runtime notification was abandoned.
2018-06-15 16:13:17 +03:00
Ilmir Usmanov
192f311128 Minor. Ignore test is JS_IR. 2018-06-15 15:43:56 +03:00
Alexander Udalov
9bf2d129ee Improve exception message when failing to serialize anonymous object metadata
(See KT-20996)

Old message:

    Cannot get FQ name of local class: class <no name provided>

New message:

    Cannot get FQ name of local class: class <no name provided> defined in private fun x(): <no name provided> defined in root package in file 1.kt
2018-06-15 13:26:44 +02:00
Ilya Chernikov
29adf09b7e Add test with other annotation, tests fix of #KT-2496 2018-06-15 12:01:49 +02:00
Rodrigo B. de Oliveira
e24a9d08f2 Only collect annotations with a name starting with KotlinScript 2018-06-15 11:53:49 +02:00
Natalia Selezneva
0adfa7b038 182: Converting J2K: save file path before conversion to use it in commit dialog
^KT-9945 Fixed
2018-06-14 21:33:11 +03:00
Natalia Selezneva
adfa7a2418 Create new module with dependency on IDEA Git plugin 2018-06-14 21:33:10 +03:00
Roman Artemev
dbb360555c [JS IR BE] Fix logic boolean operations 2018-06-14 19:54:35 +03:00
Roman Artemev
6ac4fd2e5f [JS IR BE] Update test data 2018-06-14 19:54:30 +03:00
Roman Artemev
17d71f1e46 [JS IR BE] Implement type check
* IrTypeOperator lowering
 * runtime support
 * refactoring
2018-06-14 18:40:06 +03:00
Alexander Udalov
50eda3b8a0 Make metadata writers' properties protected
These properties are only supposed to be used from Writer classes in
KotlinClassMetadata
2018-06-14 17:19:08 +02:00
Alexander Udalov
fec2c14ea5 Support local delegated properties in kotlinx-metadata-jvm 2018-06-14 17:19:08 +02:00
Alexander Udalov
b00f765255 Pass whole ReadContext/WriteContext to kotlinx-metadata extensions 2018-06-14 17:19:08 +02:00
Anton Bannykh
05123c13f8 [JS IR BE] mute ranges' tests 2018-06-14 18:17:43 +03:00
Mikhail Glukhikh
cbcd35e2f5 Implement Kotlin sub-classes tooltip to handle MPP correctly
Before this commit, Java tooltip was in use which could not
work correctly with expect / actual classes
So #KT-21011 Fixed
2018-06-14 15:42:37 +03:00
Mikhail Glukhikh
90b6f369e0 Module-specific list cell renderer: wrap into runReadAction
This should fix KotlinGoto*ModuleTestGenerated.testExpectClassSuperclass
and related exception in IDEA
Additional fix for KT-23685
2018-06-14 13:55:31 +03:00
Mikhail Glukhikh
3d4b407d0c MPP wizard: introduce structure: root <- common <- js / jvm
This commit also removes deprecated structure with common root
So #KT-20554 Fixed
2018-06-14 13:14:45 +03:00
Ilya Chernikov
cf294b57f0 Update changelog with changes in 1.2.50 2018-06-14 12:02:40 +02:00
Alexander Udalov
5d76e463d3 Fix exception from reflection on local delegated properties
The problem was that in JvmSerializerExtension.writeLocalProperties, we
only serialized metadata for local properties, but indices generated in
MemberCodegen.generatePropertyMetadataArrayFieldIfNeeded were among all
delegated properties in the class (not only local). This behaved
incorrectly as long as there was a local and a non-local delegated
property in the same class. For example, if there were 5 non-local
properties and then one local, that local property would get the index 5
and the synthetic signature "<v#5>". But there would only be one
Property entry in the metadata, and so reflection would fail here trying
to load the 5th element of the list which contains only one element.

Now, the index for a local delegated property is computed only as the
number of _local_ delegated properties above it in the class, i.e. the
first local delegated property gets index 0 (and synthetic signature
"<v#0>"), the next one -- index 1, and so on.

 #KT-23413 Fixed
2018-06-14 11:07:26 +02:00
Alexander Udalov
b8722ad213 Fail with KotlinReflectionInternalError on non-found local delegated property
Instead of IndexOutOfBoundsException from the protobuf internals which
was thrown when loading extension with a non-existing index out of the
list of all extensions (KT-23413)
2018-06-14 11:07:26 +02:00
Pavel V. Talanov
2d7df21b0f JavaElementFinder: fix classes not being sorted as intended
This is tested by `whole project` inspection tests

 #KT-24704 Fixed
2018-06-14 10:51:13 +02:00
Vyacheslav Gerasimov
aae0f5123e Build: Specify metadata source for ivy repositories
Otherwise composite build with Kotlin Native fails unable to resolve metadata files
2018-06-13 20:43:16 +03:00
Vyacheslav Gerasimov
992a31af88 Build: introduce javaPluginConvention extension on project
`ExtensionAware.the<T>()` introduced in gradle 4.7 made existing calls `the<JavaPluginConvention>()` invalid (on wrong receiver)
2018-06-13 19:43:03 +03:00
Vyacheslav Gerasimov
94c636adc3 Build: Fix usage of jvmArgs which became nullable 2018-06-13 19:43:03 +03:00
Vyacheslav Gerasimov
4b3a989b90 Build: Workaround IndexOutOfBoundsException on configuration with gradle 4.7
Using delegated property syntax somehow causes IndexOutOfBoundsException from kotlin-reflect, needs further investigation

Should be reverted after #KT-23413 is resolved
2018-06-13 19:43:03 +03:00
Ilya Gorbunov
0065a74c7e Update to gradle 4.7, fix nullability issue in buildSrc
JavaExec args list is nullable now, so use orEmpty before copying it.
2018-06-13 19:43:03 +03:00
Mikhail Glukhikh
37124e0c0d Make collectSlowLineMarker handle parents to deal with changes correctly
So #KT-20825 Fixed
So #KT-21113 Fixed
Related to IDEA-141330 fix
2018-06-13 19:23:41 +03:00
Mikhail Glukhikh
232d340118 Expect/actual companion object: set gutter on leaf element
May fix KT-21113
2018-06-13 19:23:40 +03:00
Mikhail Glukhikh
0a2ed054f1 Add module-specific cell renderers to navigate to actuals correctly
So #KT-23685 Fixed
2018-06-13 19:23:39 +03:00
Mikhail Glukhikh
efd6b7a035 KotlinGotoTargetRenderProvider: .java -> .kt 2018-06-13 19:23:38 +03:00
Mikhail Glukhikh
ab32a9a564 Minor enhancement of "actual" gutter
This makes hint about Ctrl+Alt+B available
2018-06-13 19:23:37 +03:00
Mikhail Glukhikh
f139847e47 Cleanup: KotlinLineMarkerProvider 2018-06-13 19:23:36 +03:00
Mikhail Glukhikh
cfd1a54463 Do not create expect / actual gutters for primary constructor
So #KT-22177 Fixed
So #KT-21063 Obsolete
2018-06-13 19:19:26 +03:00
Mikhail Glukhikh
b235af0656 Can be private: correct detection of calls inside inline accessors 2018-06-13 19:17:50 +03:00
Mikhail Glukhikh
542f0a61d1 Unused receiver: optimization 2018-06-13 18:12:37 +03:00
Mikhail Glukhikh
faa8d92560 Unused receiver: do not report on actual declarations #KT-24562 Fixed 2018-06-13 18:12:36 +03:00
Mikhail Glukhikh
38632c2937 Can be private: correct detection of calls inside inline function
So #KT-22180 Fixed
So #KT-22094 Fixed
2018-06-13 18:12:34 +03:00
Mikhail Glukhikh
a8737a1278 Can be private -> could be private (violation of naming convention) 2018-06-13 18:12:33 +03:00
Mikhail Glukhikh
88974ee32b Can be private: simplification
Related to KT-22030
2018-06-13 18:12:31 +03:00
Toshiaki Kameyama
7786896e9b Can be private: don't report when object or subclass calls the function
Questionable
So #KT-22030 Fixed
2018-06-13 18:12:30 +03:00
Mikhail Glukhikh
6c8276b701 Do not report "can be private" on annotated declarations #KT-24422 Fixed 2018-06-13 18:12:28 +03:00
Mikhail Glukhikh
d1155070a7 Do not report "can be private" on expect or actual declarations
So #KT-24374 Fixed
So #KT-24537 Fixed
2018-06-13 18:12:27 +03:00
Mikhail Glukhikh
11acea51b7 Reformat: can be private inspection 2018-06-13 18:12:25 +03:00
Mikhail Glukhikh
a09f6e14a5 Do not suggest "convert to object" for sealed sub-classes with state
So #KT-24816 Fixed
2018-06-13 18:12:18 +03:00
Alexander Udalov
813d7fcb6a Fix bytecode for equals/hashCode of data classes once again
#KT-24790 Fixed
2018-06-13 16:06:20 +02:00
Alexander Udalov
8749bd901b Fix MalformedParameterizedTypeException on classes from kotlin-reflect
This allows GraalVM's `native-image` to work correctly on
kotlin-reflect.jar. The size of the artifact has increased only by 66
bytes

 #KT-23962 Fixed
2018-06-13 16:01:34 +02:00
Alexander Gorshenev
6d7dd58f70 Separated idl2k frontend and backend invocations. 2018-06-13 15:45:54 +03:00
Ilmir Usmanov
6b777356e8 Add test with java reflection 2018-06-13 15:08:32 +03:00
Ilmir Usmanov
de7aa23119 Make private inline suspend functions effectively inline-only 2018-06-13 15:08:26 +03:00
Ilmir Usmanov
8a5ae16947 Generate separate methods for inline and noinline uses of inline suspend functions
Previously, inline suspend functions were effectively inline only,
but ordinary inline functions can be used as noinline.
To fix the issue, I generate two functions: one for inline with suffix
$$forInline and without state machine; and the other one without any
suffix and state machine for direct calls.
This change does not affect effectively inline only suspend functions,
i.e. functions with reified generics, annotated with @InlineOnly
annotation and functions with crossinline parameters.
 #KT-20219: Fixed
2018-06-13 15:08:19 +03:00
Alexander Udalov
bb4972b00e Regenerate tests 2018-06-12 14:01:33 +02:00
Alexander Udalov
fab45365c9 Update .idea/misc.xml for IDEA 2018.2 2018-06-12 14:01:33 +02:00
Nicolay Mitropolsky
79487a6a21 KotlinLanguageInjector: injecting into returned literals (#KT-21673) 2018-06-09 22:56:25 +03:00
Anton Bannykh
675d02093d mute new test + regenerate tests 2018-06-09 19:59:19 +03:00
Anton Bannykh
5fdc304a51 JS_IR: mute coroutine tests 2018-06-09 19:15:38 +03:00
Anton Bannykh
96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Anton Bannykh
7e1713af44 Tests: keep "// !" directives first when auto-muting box tests 2018-06-09 19:15:38 +03:00
Anton Bannykh
1e169b0838 JS_IR: add common codegen box tests (same as for old backend) 2018-06-09 19:15:38 +03:00
Vyacheslav Gerasimov
7fb2452dba 182: Fix toNullability clash in j2k 2018-06-09 16:51:24 +03:00
Vyacheslav Gerasimov
411afb0303 182: Suppress compiler proguard warnings from intellij-core dependencies 2018-06-09 14:45:55 +03:00
Vyacheslav Gerasimov
272f8b832b 182: Set since build to 182.3040 2018-06-09 14:44:50 +03:00
Yan Zhulanow
e57463e5fd 182: Fix compatibility with the Android plugin from AS 3.1
(cherry picked from commit 0592121)
2018-06-09 14:44:50 +03:00
Vyacheslav Gerasimov
4dbcb2e50e 182: Switch 182 to SNAPSHOT builds (until next EAP)
Android plugin 3.1 is merged to IJ 182, we need to provide compatible plugin
2018-06-09 14:44:50 +03:00
Ростов Сергей
d9c9e6ef0a jps, mpp: fix GenerateTests.kt.172 2018-06-09 11:18:55 +03:00
Yan Zhulanow
3df6d63580 Minor: Fix compilation after unsuccessful rebase. Add back the isMultiplatformModule() method 2018-06-09 00:19:17 +03:00
Yan Zhulanow
3ec33f4193 Debugger: Evaluate expression in MPP common module: @JvmName is unresolved (KT-23162) 2018-06-08 19:37:47 +03:00
Yan Zhulanow
e334f693b2 Minor: Do not place line markers in code fragments and in non-Kotlin files 2018-06-08 19:37:47 +03:00
Yan Zhulanow
ab5614eaac Minor: Replace a number of trivial Guava usages with constructor calls and kotlin-stdlib function calls 2018-06-08 19:37:47 +03:00
Yan Zhulanow
61ffde54fd Minor: Remove unneeded bunch file 2018-06-08 19:37:21 +03:00
Yan Zhulanow
ed43cb57e3 PrePush: Add a pre-push warning before committing to locked branches 2018-06-08 19:37:21 +03:00
Yan Zhulanow
bf10c1162a Kapt: Fix Gradle input/output verification 2018-06-08 19:37:21 +03:00
Yan Zhulanow
8645be3ace Kapt: Remove the remaining kapt1-related code in Gradle plugin 2018-06-08 19:37:20 +03:00
Yan Zhulanow
5f43808cfd Revert "Debugger: Fix breakpoints and stepping for inline-only function lambda arguments (#KT-23064)" 2018-06-08 19:37:20 +03:00
Yan Zhulanow
d851c8679a Fix a number of potential exceptions in debugger (EA-119717) 2018-06-08 19:37:20 +03:00
Yan Zhulanow
0f15dfdfdc Handle AbsentInformationException correctly (EA-119717) 2018-06-08 19:37:20 +03:00
Yan Zhulanow
4dfcb72fa1 Print source file location/contents if possible (EA-120038) 2018-06-08 19:37:20 +03:00
Yan Zhulanow
fc6057e34f Fix NPE in DelegateSourcePosition (EA-120042) 2018-06-08 19:37:20 +03:00
Yan Zhulanow
d08dcb9f0f Add missing read action in debugger (EA-120163) 2018-06-08 19:37:20 +03:00
Yan Zhulanow
93d668ad63 Support types without backing ClassLoader in 'safeArgumentTypes()' (EA-120387) 2018-06-08 19:37:19 +03:00
Yan Zhulanow
64ea16fdfc Kapt: Allow running kapt using Workers API in Gradle 2018-06-08 19:37:19 +03:00
Yan Zhulanow
2bc45e0484 Kapt: Extract annotation processing running logic from the compiler plugin 2018-06-08 19:37:19 +03:00
Yan Zhulanow
3ecf355e7a Kapt: Leave getBasePath() in ProGuard-ed kotlinc 2018-06-08 19:37:19 +03:00
Yan Zhulanow
eb4492394e Kapt: Fix compatibility with Java 9
1. Move option set up to one place, before using any of Java context components;
2. Set Javac file manager options (new to Java 9)
2018-06-08 19:37:19 +03:00
Yan Zhulanow
386f05bb91 Fix "Run" action for Kotlin sources in non-Android modules 2018-06-08 19:37:18 +03:00
Yan Zhulanow
ab611a20c5 Kapt: Do now show a warning for APs from 'annotationProcessor' configuration also declared in 'kapt' configuration (#KT-23898) 2018-06-08 19:27:00 +03:00
Yan Zhulanow
e1d22b8515 MPP: Fix implemented modules importing in Android projects (#KT-23697) 2018-06-08 19:27:00 +03:00
Yan Zhulanow
614003ad70 Android Extensions: Allow to disable specific features of Android Extensions (#KT-23244) 2018-06-08 19:26:59 +03:00
Yan Zhulanow
a70707b72b Android Extensions: Allow to access library project resources in Gradle setup (#KT-22430) 2018-06-08 19:26:59 +03:00
Yan Zhulanow
5eedbf4177 G2K: Rewrite AndroidGradleWrapper in Kotlin 2018-06-08 19:26:59 +03:00
Yan Zhulanow
9aa02c7ae4 G2K: Move AndroidGradleWrapper to the Kotlin source set, rename to .kt 2018-06-08 19:26:59 +03:00
Mikhail Zarechenskiy
d29f3fc3c5 Add test to check work of inline classes with callable references 2018-06-08 19:14:41 +03:00
Mikhail Zarechenskiy
8148bdc4d0 Support inline classes in MPP resolver/checker model 2018-06-08 19:13:39 +03:00
Alexander Podkhalyuzin
3d57276bc6 Fixed Readme about Gradle Test Runner 2018-06-08 18:44:25 +03:00
Denis Zharkov
01a2330a70 Avoid retaining protobuf package within DeserializedPackageFragmentImpl
It's only used for DeserializedPackageMemberScope that's being created
during initialization

At the same time, protobuf objects may be not very light-weight
(see 2e933a165a)

 #KT-24513 Fixed
2018-06-08 17:49:40 +03:00
Denis Zharkov
0a3e8fbe66 Pull down some implementation details from DeserializedPackageFragment
- DeserializedPackageFragmentImpl doesn't actually need member scope to be lazy
in a sense of optimization. It was only necessary for breaking
initialization cycle: DeserializationComponents <-> DeserializedPackageFragment
- For MetadataPackageFragment it might be useful to have
member scope actually lazy since it has O(n) complexity when n is a number
of package parts

This change is helpful for avoidance of storing reference to package-proto

 #KT-24513 In Progress
2018-06-08 17:49:40 +03:00
Nikolay Krasko
99b44faf5a Add information about bunch files to ReadMe 2018-06-08 17:11:16 +03:00
Alexey Sedunov
fc5a0b6768 Misc: Fix compilation of KotlinAwareJavaGetterRenameProcessor in 172 2018-06-08 16:01:40 +03:00
Vyacheslav Gerasimov
020d941c27 Fix test compilation for AS branches
There is no devkit is AS
2018-06-08 15:26:47 +03:00
Nikolay Krasko
88bbeae270 Make Tools->Kotlin be visible in dumb mode (KT-12075)
Kotlin update check works fine in dumb mode already.

 #KT-12075 Fixed
2018-06-08 14:44:08 +03:00
Nikolay Krasko
19eaf9289b Reformat: KotlinPluginUpdater.kt 2018-06-08 14:44:07 +03:00
Nikolay Krasko
f797592365 Minor: leave bunch directive for 173-specific code 2018-06-08 14:44:07 +03:00
Nikolay Krasko
f8d352c3d0 Fix auto-indent for when entry (KT-24743)
#KT-24743 Fixed
2018-06-08 14:44:07 +03:00
Nikolay Krasko
cd54c7922d Fix lambda return hint for labeled expressions (KT-24828)
#KT-24828 Fixed
2018-06-08 14:44:07 +03:00
Nikolay Krasko
076870ee05 Fix double return hint in lambda for annotated expression (KT-23238)
#KT-23238 Fixed
2018-06-08 14:44:06 +03:00
Nikolay Krasko
c5d5f0c2e2 Minor: reformat LambdaReturnValueHints.kt 2018-06-08 14:44:06 +03:00
Nikolay Krasko
9fbb7c5d14 Reformat: search\ideaExtensions package 2018-06-08 14:44:06 +03:00
Dmitry Savvinov
6d29e14a33 Improve message for serialization crash in JavaClassTrackerImpl 2018-06-08 14:38:44 +03:00
Alexey Sedunov
0ea1784d33 Introduce Parameter: Add suspend to lambdas with nested suspend-calls
#KT-24712 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov
8a838ab5bb Change Signature: Fix parameter name for kt-function overriding Java's
#KT-24763 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov
8978c4b9e8 Rename: Fix processing of references to synthetic Java properties
#KT-17742 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov
862dc76ed9 Rename: Fix processing of overriding methods with mangled names
#KT-24460 Fixed
2018-06-08 14:34:22 +03:00
Alexey Sedunov
eea9113d1c Introduce Type Alias: Fix replacement of references to nested classes
#KT-15159 Fixed
2018-06-08 14:34:22 +03:00
Alexey Sedunov
3902e1b51d Run: Add browse button to Kotlin "main" run configuration editor
#KT-17668 Fixed
2018-06-08 14:34:22 +03:00
Alexey Sedunov
8a09dcf821 Configuration: Update settings.gradle without loading its PSI
Otherwise dumb-mode problems may happen in latest builds of 182

 #KT-24667 Fixed
2018-06-08 14:34:22 +03:00
Sergey Rostov
c71357dd76 173: jps, mpp: fix AbstractIncrementalJpsTest.kt.173 2018-06-08 13:50:05 +03:00
Mikhael Bogdanov
a0060dd25b Generate synthetic method for @JvmDefault properties in DefaultImpls 2018-06-08 10:08:23 +02:00
Sergey Rostov
5455b6c0c0 jps: add common source roots to the final platform modules as a workaround for absence of incremental k2metadata compiler 2018-06-08 09:46:56 +03:00
Sergey Rostov
e0d44ecb90 jps, daemon: pass incremental compilation flag from jps process to daemon (fix) 2018-06-08 09:46:55 +03:00
Sergey Rostov
f86c6db4bf Idea gradle: proper support for composite MPP projects
(cherry picked from commit ca841f0)

#KT-24748 fixed
2018-06-08 09:46:54 +03:00
Sergey Rostov
80ed963f97 jps, daemon: (minor) formatting 2018-06-08 09:46:53 +03:00
Sergey Rostov
e831964871 jps, daemon: pass incremental compilation flag from jps process to daemon 2018-06-08 09:46:52 +03:00
Sergey Rostov
ce96c1b9a8 jps, daemon: fix javascript inline functions tracking
inline function hash should computed after compilation
2018-06-08 09:46:50 +03:00
Sergey Rostov
5a2ed364fe jps: checkCachesVersions for js and common (BuildMetaInfo save/check) 2018-06-08 09:46:49 +03:00
Sergey Rostov
3cfb200e07 jps: improve KotlinDirtySourceFilesHolder 2018-06-08 09:46:48 +03:00
Sergey Rostov
b5acb83325 jps: (minor) fix java module detection 2018-06-08 09:46:47 +03:00
Sergey Rostov
5478a552ed jps, js: Fix exception on rebuild js module 2018-06-08 09:46:46 +03:00
Sergey Rostov
d75a2be31b jps: Don't create cache for common modules (KOTLIN-CR-2028) 2018-06-08 09:46:45 +03:00
Sergey Rostov
c24aa13f12 jps: fixes for KOTLIN-CR-2028 2018-06-08 09:46:44 +03:00
Sergey Rostov
c2d87140ec jps, daemon: fix JsFunction.toString() serialization 2018-06-08 09:46:43 +03:00
Sergey Rostov
40b9fa88b7 jps: fix mergedCompilerArguments getter (mergedCompilerArguments) 2018-06-08 09:46:42 +03:00
Sergey Rostov
1cbef873ec jps: implement mpp and js daemon compiler services
#KT-24635 fixed
2018-06-08 09:46:41 +03:00
Sergey Rostov
b2fedd7b1e jps, mpp: fix marking expect/actual complementary files as dirty
This files should be marked as dirty for current round, not next
2018-06-08 09:46:40 +03:00
Sergey Rostov
65bdfa72c1 jps: support KotlinSourceRootType
KotlinSourceRootType will added with KotlinSourceRootProvider (ex KotlinMppCommonSourceRootProvider).
New target type (with computeAllTargets) is not possible because ModuleBuildTarget is final.

#KT-24506 fixed
2018-06-08 09:46:39 +03:00
Sergey Rostov
b2f58ad9c3 jps, mpp: temporary disable mpp tests 2018-06-08 09:46:38 +03:00
Sergey Rostov
0eee2729cd jps: support multiplatform incremental compilation for jvm and js
- support common modules metadata compilation under flag (it is not required since all common source roots are included transitively for now)
- introduce expect actual tracker in jps: move implementation from gradle to build-common
- support js incremental compilation: move implementation from gradle to build-common
2018-06-08 09:46:37 +03:00
Sergey Rostov
4a6554a36d multiplatform: remove MultiplatformGradleProjectTaskRunner
JPS is now able to build multiplatform projects, so build/run actions should be delegated to gradle only with "Delegate IDE build/run action actions" setting enabled.
2018-06-08 09:46:36 +03:00
Sergey Rostov
f7695dd039 mpp: Run tests from common modules should recompile correspond JVM implementation module
#KT-23722 Fixed
2018-06-08 09:46:35 +03:00
Ivan Gavrilovic
44482dbe90 Revert access modifier change in android history 2018-06-07 19:10:09 +03:00
Ivan Gavrilovic
728508e0ae Return an error when build history for dir does not exist 2018-06-07 19:10:04 +03:00
Ivan Gavrilovic
6bb54fd9a3 Support fetching build history files from directories for Android
Android Gradle plugin will start publishing clases in directories.
This commit adds support to find build history files when changed
files come from directories. It is similar to existing implementation
for jars i.e. it looks for .kotlin_module file under META-INF.

Test: ModulesApiHistoryAndroidTest
2018-06-07 19:10:00 +03:00
Mikhail Zarechenskiy
b2d9015723 Prohibit identity equals on inline class types 2018-06-07 18:22:05 +03:00
Mikhail Zarechenskiy
9891f562cc [NI] Make subtyping algorithm more robust to error types
During subtyping/incorporation we transform types (e.g. changing nullability,
 form of the type) and, basically, we're doing this to some FIXPOINT.
 It's important that we use `KotlinType.hashCode()` to compare types, but
 for error types hashCode is a hashCode of its supertype and, for example,
 `makeNullableAsSpecified` method recreate type every time. So, we continue
 to generate new constraints and we'll never stop incorporation algorithm
2018-06-07 15:45:53 +03:00
Ilya Gorbunov
1ee37b1772 Update ReadMe for stdlib-js 2018-06-07 14:39:48 +03:00
Anton Bannykh
544222167e Update ReadMe.md
js.libraries doesn't exist anymore
2018-06-07 14:11:37 +03:00
Mikhail Zarechenskiy
177d949f75 Advance bootstrap to 1.2.60-dev-544 2018-06-07 13:13:20 +03:00
Svyatoslav Kuzmich
563637548a KJS: Fix loop levels in ContinueReplacingVisitor (KT-24777) 2018-06-07 12:57:36 +03:00
Svyatoslav Kuzmich
2ec8c4aae6 KJS: Label loops in LabeledBlockToDoWhileTransformation
Fix KT-24542: insert labes for affected loops, breaks and continues
statements during LabeledBlockToDoWhileTransformation
2018-06-07 12:57:36 +03:00
Pavel V. Talanov
463d9b690f Minor: rename PsiFile.moduleInfo -> forcedModuleInfo 2018-06-06 21:04:05 +02:00
Pavel V. Talanov
74052542b4 Minor: rename KtFile.targetPlatform -> forcedTargetPlatform
To avoid confusing with platform extension and debugging for 3 hours
2018-06-06 21:04:04 +02:00
Pavel V. Talanov
ced3cf0904 Light classes: fix multifile facades for mpp modules with jvm part
When creating multifile facades respect that facade files can be both
    in common and jvm parts

 #KT-23942 Fixed
2018-06-06 21:04:02 +02:00
Pavel V. Talanov
a8a490ea5a Test multifile facades in mpp projects 2018-06-06 21:04:00 +02:00
Pavel V. Talanov
8185b1bf02 Test accessing file facades from java in mpp project 2018-06-06 21:03:57 +02:00
Pavel V. Talanov
1be477c816 Fix "add member" quick fix when invoked from java on common class
#KT-24115 Fixed
2018-06-06 21:03:56 +02:00
Pavel V. Talanov
9e493d8b73 Mpp tests: allow to test java code in highlighting and quickfix tests 2018-06-06 21:03:55 +02:00
Pavel V. Talanov
0157d7bd5d Mpp utils: remove erroneous cache
Note: can't use Module.cached to calculate data that depends on input
   other than the module itself (isTests in this case)
2018-06-06 21:03:53 +02:00
Pavel V. Talanov
1f957de9d8 Minor: use utils appropriately 2018-06-06 21:03:52 +02:00
Pavel V. Talanov
fa7531f342 Refactor: move and prettify mpp util code 2018-06-06 21:03:51 +02:00
Pavel V. Talanov
05e6c4e0a2 Minor: move utils to more appropriate place 2018-06-06 21:03:50 +02:00
Pavel V. Talanov
e67f449476 Fix exception from kotlin bytecode window on common code
Do not show bytecode window for non-jvm platform modules

 #KT-24159 Fixed
2018-06-06 20:48:18 +02:00
Pavel V. Talanov
d18846201a JavaElementFinder: avoid returning fake light class in findClass*
findClass* are supposed to return a single visible class
    from given scope with given fqname
After sorting FakeFileForLightClass would sometimes be first in the list
    leading to exceptions like KT-24704

  #KT-24704 Fixed
2018-06-06 20:45:41 +02:00
Pavel V. Talanov
86e52f45b1 J2K JavaElementFinder: prettify code 2018-06-06 20:45:41 +02:00
Pavel V. Talanov
6cea843461 J2K JavaElementFinder: autoconvert and fix compilation errors 2018-06-06 20:45:41 +02:00
Pavel V. Talanov
00b1e9281b J2K JavaElementFinder: rename file 2018-06-06 20:45:41 +02:00
Alexey Tsvetkov
451c732b8f Test: speed up tests by minimizing number of tasks to run
E.g. avoid building release variants for Android
(extremely slow due to proguard minification, optimization)
2018-06-06 17:54:51 +03:00
Alexey Tsvetkov
0383584f33 Test: rename file to match class name 2018-06-06 17:54:51 +03:00
Alexey Tsvetkov
0c12b0e5fb Test: refactor Gradle daemon memory test
Currently the test makes more harm than use:
* It is too slow: two executions (with different Gradle versions)
take 5 minute on CI.
* It is unreliable: the test fails on CI for months
with insignificant violation of the memory growth limit.

After this change:
* the memory growth limit is increased;
* the test run count is decreased;
* changes the test to use separate project with minimal amount of classes
(we're not interested in compiler's memory leaks; only Gradle plugin specific ones);
2018-06-06 17:54:51 +03:00
Alexey Tsvetkov
43e7b0425d Test: move Gradle daemon memory test to separate class 2018-06-06 17:54:50 +03:00
Ilya Gorbunov
0f972f2412 Restore default parameter values in JS collection constructors
Even if they now have overloads that will be selected when these parameters are omitted.
This is to preserve compatibility with the libraries compiled against the older library.

#KT-24782 Fixed
2018-06-06 15:32:34 +03:00
Nicolay Mitropolsky
c150878086 172: Uast: testdata fixes 2018-06-06 14:05:31 +03:00
Nicolay Mitropolsky
5c8e4958db Uast: exposing enum constants literal values (#KT-23456) 2018-06-06 14:05:30 +03:00
Nicolay Mitropolsky
12707a6443 Uast: handling resolve to deserialized methods (KT-24679) 2018-06-06 14:05:30 +03:00
Nicolay Mitropolsky
2ede37496c 173: Uast: removing kotlinInternalUastUtils.kt.173
no sense to keep difference
2018-06-06 14:05:30 +03:00
Mikhael Bogdanov
4cf58654b2 Implement toArray lowering 2018-06-06 10:34:51 +02:00
Mikhael Bogdanov
427a8886e4 Reuse new descriptor in bridge lowering 2018-06-06 10:34:51 +02:00
Mikhael Bogdanov
c72a3e08f7 Use field original in ir transformation 2018-06-06 10:34:50 +02:00
Mikhael Bogdanov
a53fa4f6f8 Properly calculate shift for default args in enum constructor call 2018-06-06 10:34:49 +02:00
Roman Artemev
4b8d906e45 Add runtime for JS IR BE 2018-06-05 21:21:18 +03:00
Alexey Tsvetkov
2fecf07dd7 Test: do not expect copy classes task to run with Gradle 4.0+ 2018-06-05 19:27:08 +03:00
Alexey Tsvetkov
141cf43153 Test: remove KotlinGradlePluginMultiVersionIT
We run all tests with multiple Gradle versions now,
so parametrized test is not needed anymore.

Test cases are moved to relevant test classes.

testKaptProcessorPath is removed because kapt1 is not supported anymore.
2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
fdbd3cd8cb Test: remove unsupported Gradle versions from tests 2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
80731437a8 Drop forcing Java task to recompile
We don't support Gradle <= 3.5 at the moment,
it does not make sense to have the code for Gradle < 2.14
2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
0eadc76cb7 Remove unneeded code from Gradle plugin 2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
3dc314d509 Remove com.intellij usages from Gradle plugin 2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
c9e49ed198 Remove unused util 2018-06-05 19:27:07 +03:00
Alexey Tsvetkov
5f2513ee20 Get rid of split package org.jetbrains.kotlin.incremental in Gradle plugin
#KT-18621 fixed
2018-06-05 19:27:07 +03:00
Nicolay Mitropolsky
045cc253ab Uast: KotlinUEnumConstant.returnType now is evaluated from containing сlass
to make it not load additional clsDelegates
2018-06-05 18:00:15 +03:00
Nicolay Mitropolsky
0fb879dfc2 lightAnnotations: KtLightPsiClassObjectAccessExpression added
as implementation of `PsiClassObjectAccessExpression` for class literals in annotations
2018-06-05 18:00:15 +03:00
Mikhail Glukhikh
92727d2945 Downgrade "redundant type check for object" to INFORMATION level 2018-06-05 17:54:30 +03:00
Alexander Podkhalyuzin
116a99ddb8 Fixed Icon link to proper variant 2018-06-05 17:41:47 +03:00
Mikhail Glukhikh
24008cdffb If to when: do not add label to outer loop if not necessary
So #KT-24767 Fixed
2018-06-05 17:02:35 +03:00
Toshiaki Kameyama
b4962a1880 Add getter: don't suggest when property has no type or initializer
So #KT-24632 Fixed
2018-06-05 16:31:28 +03:00
Toshiaki Kameyama
8969e7a6e1 "Remove redundant toString": fix false positive for nested nullable
So #KT-24557 Fixed
2018-06-05 16:03:54 +03:00
Toshiaki Kameyama
4038d4d507 Explicit this inspection: suggest also for synthetic Java property
So #KT-22089 Fixed
2018-06-05 15:52:16 +03:00
Toshiaki Kameyama
6b37e40f99 Add quick-fix for type variance conflict #KT-23082 Fixed 2018-06-05 15:45:53 +03:00
Toshiaki Kameyama
ddf647ae96 Remove redundant receiver in "Change function signature" quick fix
So #KT-12298 Fixed
2018-06-05 15:20:18 +03:00
Toshiaki Kameyama
0cb907d637 Reformat: ChangeMemberFunctionSignatureFix 2018-06-05 15:19:34 +03:00
Toshiaki Kameyama
2c59f96ca4 Introduce "Add remaining when branches" intention #KT-23306 Fixed 2018-06-05 15:19:09 +03:00
Toshiaki Kameyama
bde9a57c9e Don't suggest map{}.filterNotNull() -> mapNotNull{} on primitive array
So #KT-21556 Fixed
2018-06-05 15:18:28 +03:00
Toshiaki Kameyama
e770aed084 Don't suggest "Remove variable" for property with function initializer
So #KT-23752 Fixed
2018-06-05 15:17:14 +03:00
Dmitry Savvinov
b8f8802cff Parse compiler arguments and configure LV properly in Platform.kt 2018-06-05 14:51:35 +03:00
Dmitry Savvinov
5f819b589c Minor: refactor Platform.kt 2018-06-05 14:51:35 +03:00
Mikhail Zarechenskiy
04c13aeae8 [NI] Fix exception on capturing type with inner typealiased typed 2018-06-05 14:05:50 +03:00
Alexander Podkhalyuzin
4883fbfd23 Fixed link to error icon in IDEA 2018.2
#KT-24736 Fixed
2018-06-05 11:00:55 +03:00
Alexander Podkhalyuzin
73ec82e544 Better description of Kotlin plugin
#KT-13948 Fixed
2018-06-05 11:00:09 +03:00
Mikhail Zarechenskiy
4893e466ac Skip test for javac diagnostics
There are problems with sharing the same `txt` file when using custom
 declarations from `kotlin` package
2018-06-05 10:41:44 +03:00
Natalia Selezneva
62929ba6f5 Fix AE in scratch for long lines
^KT-24638 Fixed
2018-06-05 08:41:17 +03:00
Natalia Selezneva
ccacf1bd23 Replace SLRUMap with ConcurrentHashMap
^KT-24645 Fixed
2018-06-05 08:41:17 +03:00
Natalia Selezneva
4767757991 Change the message in the 'new script dependencies' notification 2018-06-05 08:41:17 +03:00
Mikhail Zarechenskiy
ce7f010673 Fix wrong test data 2018-06-04 21:59:03 +03:00
Alexey Sedunov
0f80dd4ecf Navigation: Use local search scope for top-level properties in script
#KT-20465 Fixed
2018-06-04 20:17:44 +03:00
Alexey Sedunov
0110f66529 Project View: Show script declarations in "Show members" mode 2018-06-04 20:17:44 +03:00
Alexey Sedunov
3c267b206b Move: Fix exception on moving top-level declaration from/to script file
#KT-20260 Fixed
2018-06-04 20:17:43 +03:00
Alexey Sedunov
c63854948b Configuration: Fix Kotlin SDK existence check on facet configuration
AS3.1/AS3.2
2018-06-04 20:17:43 +03:00
Alexey Sedunov
24687b18cd Test Support: Support Gradle tests classes with spaces in name
#KT-18319 Fixed
2018-06-04 20:17:43 +03:00
Roman Artemev
90c7d8f485 [JS IR BE] Update test data 2018-06-04 19:31:49 +03:00
Roman Artemev
601f29b781 [JS IR BE] Minor fixes
* Global scope
* Top-level properties
* Refactoring
2018-06-04 19:31:49 +03:00
Roman Artemev
d6d0a7d804 Fix nashorn test runner 2018-06-04 19:31:49 +03:00
Roman Artemev
06a170b05d [JS IR BE] Update test data 2018-06-04 18:59:40 +03:00
Roman Artemev
eeb16a38e8 [JS IR BE] Fix callable reference to make it possible to be bound 2018-06-04 18:59:40 +03:00
Roman Artemev
11c330effd [JS IR BE] Move builder into appropriate package 2018-06-04 18:59:40 +03:00
Roman Artemev
261edd5f4c [JS IR BE] Implement property reference
Add cache for direct (which has no closured parameters) KCallable references
Refactor FunctionReferenceLowering
 * Rename FunctionReferenceLowering -> CallableReferenceLowering
 * Add util method to create value parameters
2018-06-04 18:59:40 +03:00
Mikhail Zarechenskiy
fb1fbf1473 Temporary mute tests on unsigned types for JS backend 2018-06-04 18:37:47 +03:00
Mikhail Zarechenskiy
57ffbd5941 Refactoring: Rename isUnsigned -> isUnsignedNumberLiteral 2018-06-04 18:37:46 +03:00
Mikhail Zarechenskiy
cc19e4cd73 Refactoring: Move blackbox tests about unsigned types to new directory 2018-06-04 18:37:44 +03:00
Mikhail Zarechenskiy
b30b00eedb Configure overload resolution on unsigned types same as for primitives 2018-06-04 18:37:42 +03:00
Mikhail Zarechenskiy
5b5d9dd5a0 Allow unsigned integers overflow values of corresponding signed numbers 2018-06-04 18:37:40 +03:00
Mikhail Zarechenskiy
0da3ae328e Handle case when u-literals are using without unsigned declarations 2018-06-04 18:37:39 +03:00
Mikhail Zarechenskiy
8cd2d2e44c Support WITH_UNSIGNED kind in diagnostics tests, add tests 2018-06-04 18:37:37 +03:00
Mikhail Zarechenskiy
7d5fdb660d Treat number with unsigned literal as UByte & UShort & UInt & ULong 2018-06-04 18:37:36 +03:00
Mikhail Zarechenskiy
656f6cbded Support constant evaluation of unsigned type constructors
#KT-23816 In Progress
2018-06-04 18:37:34 +03:00
Mikhail Zarechenskiy
bf5f710f39 Parse integers with unsigned ('u') suffix 2018-06-04 18:19:34 +03:00
Mikhail Zarechenskiy
e5958d228a Introduce WITH_UNSIGNED directive to use unsigned types in tests 2018-06-04 18:19:30 +03:00
Stanislav Erokhin
8f0b073c08 [NI] Prototype for SAM-conversion.
Supported:
- conversion in resolution parts. Also sam-with-receiver is supported automatically
- separate flag for kotlin function with java SAM as parameters

TODO:
- fix overload conflict error when function type is the same byte origin types is ordered
- consider case when parameter type is T, T <:> Runnable
- support vararg of Runnable

[NI] Turn off synthetic scope with SAM adapter functions if NI enabled
2018-06-04 12:21:56 +03:00
Stanislav Erokhin
4b8e95c243 Minor. Extract preparation for expected type to separate function 2018-06-04 12:21:52 +03:00
Stanislav Erokhin
232d069493 Minor. Use getExpectedType as util function for parameter type calculation
For almost all cases this change do nothing, because if parameter isn't
vararg, then both methods (FlatSignature.argumentValueType &
getExpectedType) return same value. Moreover if it is vararg parameter
and spread operator is not used, then results will be the same.
We can observe difference only when spread operator used
and when we compare two candidates corresponding parameters
for both spread arguments should be vararg parameters.
I.e. old way compares: Int vs String
new way compares: Array<out Int> vs Array<out String>.
2018-06-04 12:21:51 +03:00
Stanislav Erokhin
99e7823352 [NI] Disable test with disabled RefinedSamAdaptersPriority in NI
Such test has no ense in NI because NI it is LV = 1.4 and we cannot
repeat behaviour in 1.3 anyway, so I propose not even support old cases.
Also priority of LANGUAGE directive should be more then key enabled on
all tests -- also fixed.
2018-06-04 12:21:50 +03:00
Stanislav Erokhin
b31d027aed [NI] Report deprecation for function from companion in NI. 2018-06-04 12:21:48 +03:00
Stanislav Erokhin
18b65e7bcf [NI] Update test data 2018-06-04 12:21:47 +03:00
Mikhael Bogdanov
a4c4f048de Support compare for small primitives 2018-06-04 10:50:00 +02:00
Mikhael Bogdanov
340160de65 Don't generate setter accessors for vals 2018-06-04 10:49:59 +02:00
Mikhael Bogdanov
aa8d71f6b9 Support synthetic flag 2018-06-04 10:49:59 +02:00
Mikhael Bogdanov
8767e0924b Support extensions in bridge lowering 2018-06-04 10:49:58 +02:00
Mikhael Bogdanov
5fa54dc854 Fix array constructors coercion type 2018-06-04 10:49:57 +02:00
Mikhael Bogdanov
e58e05f9be Minor. Reformat 2018-06-04 10:49:57 +02:00
Mikhael Bogdanov
50d7e49211 Skip unmapped receiver in inner class lowering 2018-06-04 10:49:56 +02:00
Mikhael Bogdanov
5753f93a57 Support java synthetic properties in DependencyCollector 2018-06-04 10:49:56 +02:00
Alexey Sedunov
8198599ef5 Misc: Eliminate instances of IdeModifiableModelsProviderImpl or dispose them after use 2018-06-04 02:57:54 +03:00
Alexander Podkhalyuzin
e3223ab6d8 Fixed grammar and words in pull request template 2018-06-03 17:01:08 +03:00
Valeriy Zhirnov
e024a7c563 Provide template for pull requests
Signed-off-by: Valeriy Zhirnov <neonailol@gmail.com>
2018-06-03 16:50:01 +03:00
Alexey Tsvetkov
f7b32bdfa7 Refactor managing Gradle daemons for tests
Encapsulate daemon run count within DaemonRegistry to simplify reasoning
about the state.

Never count test process Gradle version as active Gradle process.

Fix the bug when daemon version hit max run count threshold
would be restarted every time after that.
2018-06-01 23:14:34 +03:00
Alexey Tsvetkov
0fd0eb9a18 Do not build release variant for Android Gradle test
This speeds up the test case significally. On my machine the time spent
in test case dropped from 1+ minute to 15 seconds.
2018-06-01 23:13:37 +03:00
Alexey Tsvetkov
87b053958b Make lint not fail on error in Android tests
It fails with meaningless (for us) errors, such as "target version 23
won't be accepted to play store soon".
2018-06-01 23:13:37 +03:00
Alexey Tsvetkov
3ccaae249a Move Android test from foo to com.example package
Otherwise the test `KotlinAndroid32GradleIT.testIncrementalCompile`
failed with Android resource linking failed error:
"attribute 'package' in <manifest> tag is not a valid Android package name: 'foo'."
2018-06-01 23:13:37 +03:00
Alexey Tsvetkov
44a845eca9 Avoid using bound class reference
Bound references require kotlin-reflect 1.1.x on runtime.
However old Gradle versions (e.g. 3.4) can leak 1.0.x reflect
into Gradle classloader, so getting bound reference fails on runtime
(in this case the plugin couldn't connect to the daemon).
2018-06-01 23:13:37 +03:00
Alexey Tsvetkov
42350ffb1a Fix applying subplugin from script
#KT-24497 fixed
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
6eebcf7f18 Add test for subplugin in nested buildscript
KT-24653
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
f720501612 Implement fallback compiler search 2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
15a372b0eb Create compiler and plugin classpath configurations in Android plugin too 2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
af8b0ffa6d Resolve compiler classpath using 'kotlinCompilerClasspath' configuration
#KT-24675 fixed
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
6fe0829cf8 Remove scripting plugin from JVM compiler classpath
#KT-24559 fixed
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
db66bfd726 Pack scripting plugin into kotlin-scripting-embeddable for use in Gradle 2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
dd731da6d1 Make 'kotlinCompilerPluginClasspath' non-transitive
Previous plugin resolution mechanism was only searching
for exact artifact without transitive dependencies.

The configuration allows resolving transitive dependencies,
but it resolves stdlib which fails because the compiler
loads plugins using parent last classloader.

Non-transitivity can be removed after parent last classloader is
removed.
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
873de17056 Resolve compiler plugin classpath using 'kotlinCompilerPluginClasspath' configuration
#KT-24653 fixed
        #KT-24676 fixed
2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
0c21b21a88 Move subplugin tests to separate class 2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
1085abedcd Test scripting with Gradle 2018-06-01 23:13:36 +03:00
Alexey Tsvetkov
0b22a3c67b Prevent starting multiple daemons from Gradle
#KT-24560 fixed
2018-06-01 23:13:36 +03:00
Alexey Sedunov
48b55edb03 Configuration: Add non-release repository to main Gradle buildfile
#KT-24725 Fixed
2018-06-01 21:36:39 +03:00
Alexey Sedunov
b826e850fd Configuration: Enable dumb-mode alternative resolve when updating settings.gradle
#KT-24667 Fixed
2018-06-01 21:36:39 +03:00
Alexander Udalov
5478dabb38 Add Maven/Gradle usage examples to kotlinx-metadata-jvm ReadMe 2018-06-01 19:14:42 +02:00
Alexander Udalov
adb129d244 Add ChangeLog for kotlinx-metadata-jvm 2018-06-01 19:14:42 +02:00
Ilya Chernikov
3171968efc Fix native-platform repo after it was suddenly moved in the gradle repo 2018-06-01 17:01:35 +02:00
Pavel V. Talanov
dae8b12872 Mpp: fix production internals not visible from tests in platform modules
Caused by change in mpp resolve
Happened in platform modules that have expectedBy dependencies

#KT-24729 Fixed
2018-06-01 14:15:04 +02:00
Pavel V. Talanov
4279dc9c05 Minor: better name for generated test 2018-06-01 14:15:04 +02:00
Nikolay Krasko
91b86d7fba Remove explicit locks for accessing and creating cached values
Working with user data in cached value manager is already thread safe.
2018-06-01 12:08:48 +03:00
Nikolay Krasko
cc04b72dfd Protect access to SLRUCache for scripts with a lock 2018-06-01 12:08:46 +03:00
Nikolay Krasko
6d7510a6f4 Minor: code cleanup in KotlinCacheServiceImpl.kt 2018-06-01 12:08:44 +03:00
Nikolay Krasko
1e5192bcff Fail with FileComparisonFailure in hierarchy tests 2018-06-01 12:08:43 +03:00
Nikolay Krasko
a5593f1f31 Render entries with outer classifiers in call hierarchy (KT-22698)
#KT-22698 Fixed
2018-06-01 12:08:41 +03:00
Nikolay Krasko
496243c3ce Remove difference in nullable state for loadState() 2018-06-01 12:08:37 +03:00
Ilya Gorbunov
f8217ef28f Extract subclasses of JvmMemberSignature sealed class to top-level
Use more specific subtypes of sealed class in visitors.
2018-06-01 06:43:48 +03:00
Ilya Gorbunov
1a290d0c73 Refactor: make JvmMemberSignature a sealed class
Use JvmMemberSignature.asString instead of toString
2018-06-01 06:43:48 +03:00
Ilya Gorbunov
2f58539200 Refactor: allow to distinguish whether JvmMemberSignature is for field or for method
Introduce a method to create org.jetbrains.kotlin.load.kotlin.MemberSignature directly from JvmMemberSignature.
Create JvmFunctionSignature from JvmMemberSignature.
2018-06-01 06:43:48 +03:00
Ilya Gorbunov
36c658fd8b Introduce JvmMemberSignature to represent name and desc of jvm methods and fields
Return member name and desc in a class in order not to parse that information
from concatenated string when required.
2018-06-01 06:43:48 +03:00
Ilya Gorbunov
eee9f8ab3f Include kotlinp tests into distTest and kotlinx-metadata-jvm tests into coreLibsTest
kotlinp tests: do not fail due to different directory separators on Windows
2018-06-01 06:43:48 +03:00
Ilya Gorbunov
d86947207c Change group of kotlinx.metadata to org.jetbrains.kotlinx
Allow to override version of the resulting artifact with a property.
Setup publishing of the library when its deployment version is specified.
2018-06-01 06:43:48 +03:00
Alexey Sedunov
fbb4914bfb Intentions: Fix insertion of necessary lambda parameter for run/let and apply/also conversions
#KT-22931 Fixed
2018-05-31 15:22:32 +03:00
Alexey Sedunov
f17053f970 Configuration: Create absent Kotlin SDK when configuring Kotlin/JS module
#KT-24412 Fixed
2018-05-31 15:22:31 +03:00
Alexey Sedunov
924db3f23e Configuration: Fix Kotlin SDK existence check on facet configuration
#KT-24072 Fixed
2018-05-31 15:22:31 +03:00
Dmitry Petrov
7b1b557250 psi2ir: Java annotations have no primary constructor 2018-05-31 10:09:31 +03:00
Dmitry Petrov
8094cb7dc5 psi2ir: Generate external dependencies in a loop
There are some cases (superclasses, overridden methods, and so on) where
external dependencies generation can require additional external
dependencies.
2018-05-31 10:09:31 +03:00
Alexey Tsvetkov
cb549cba00 Create kapt configurations before gradle script is evaluated
We cannot create kapt configurations in `KotlinGradleSubplugin.apply`,
because `apply` is invoked after a script is evaluated, so user cannot
refer to kapt configurations in script.

We cannot call `apply` before script's evaluation, because
then we might not be able to determine
if a Gradle plugin corresponding to a subplugin is appled.
For example in case of the following script:
```
apply plugin: "kotlin"
apply plugin: "kotlin-kapt"
```
subplugin's apply will exit early because Gradle plugin "kotlin-kapt"
is not applied yet, when "kotlin"'s apply is evaluated.
2018-05-30 20:24:11 +03:00
Mikhael Bogdanov
4383335168 Update @JvmDefault documentation 2018-05-30 15:24:50 +02:00
Alexander Udalov
b5007c417d Minor, restructure reflection tests a little
To allow their usage in https://github.com/udalov/kotlin-obfuscation-test-app
2018-05-30 13:03:10 +02:00
Dmitry Petrov
7a2bb79777 psi2ir: Use substituted 'hashCopy' for generated data class 'hashCopy' 2018-05-30 12:02:34 +03:00
Dmitry Petrov
cb301763f3 psi2ir: Fix implicit casts generation
Implicit cast from T to S is not required if
  T <: S.makeNullable()
2018-05-30 12:02:34 +03:00
Nikolay Krasko
dac9036969 Remove reload(PsiFile?) usage from KotlinFieldBreakpoint 2018-05-29 21:40:32 +03:00
Nikolay Krasko
439e079c94 Minor: reformat KotlinFindUsagesProvider.kt 2018-05-29 21:40:32 +03:00
Nikolay Krasko
9c305e2431 Fix getting names representation for constructor parameters (KT-23090)
#KT-23090 Fixed
2018-05-29 21:40:32 +03:00
Nikolay Krasko
c5b3092c64 Use same amount of memory for all builds and remove tasks.kt.173 2018-05-29 21:40:31 +03:00
Nikolay Krasko
e6905c9b3d Refactoring: extract function for getting project 2018-05-29 21:40:31 +03:00
Alexey Sedunov
6f8e25eae7 Configuration: Restore dependency on gradle plugin in buildscript block
#KT-24671 Fixed
2018-05-29 18:07:09 +03:00
Nicolay Mitropolsky
cbcc3d2e2e Test for java-keywords in light-annotations (KT-22883)
working with new source-based light annotations
2018-05-29 16:34:10 +03:00
Mikhael Bogdanov
ad717d5335 Support properties in compatibility mode 2018-05-29 15:08:07 +02:00
Mikhael Bogdanov
0498c3b765 Don't copy descriptor for delegation generation
Actually source element for DEFAULT_IMPL_DELEGATION_TO_SUPERINTERFACE_DEFAULT_IMPL
  was always null cause descriptor was copies with new kind=DECLARATION.
  That causes element recalculation in DiagnosticFactory:
  element = data.classOrigin.element
  So DEFAULT_IMPL_DELEGATION_TO_SUPERINTERFACE_DEFAULT_IMPL is added to EXTERNAL_SOURCES_KINDS
2018-05-29 15:08:07 +02:00
Roman Artemev
9d2092e86d Fix visibility of @JsName-annotated symbols in stdlib-js 2018-05-29 13:57:34 +03:00
Roman Artemev
06009a532b Add test case to detect name clash in stdlib-js 2018-05-29 13:57:34 +03:00
Mikhael Bogdanov
689a492b9a Minor. Fix test data 2018-05-29 12:47:07 +02:00
Mikhael Bogdanov
23a713d46b Rollback 'Don't copy interface member on DefaultImpl delegation generation, keep kind' 2018-05-29 12:47:06 +02:00
Nicolay Mitropolsky
8e2c9358bc Uast: updates for consistency tests and fixes for missed things
we should use `sourcePsi` instead of `psi` for parents matching, because light `psi` will not be tested, and it is not enough to store only PSI as map key to match parent consistency, because some different UElements could have same sourcePsi.
2018-05-29 13:30:52 +03:00
Mikhael Bogdanov
0a26f527f2 Minor. Fix test data 2018-05-29 11:26:36 +02:00
Mikhael Bogdanov
419218b9cf Rename 'jvm-default-mode' to 'jvm-default'. Add description 2018-05-29 11:26:36 +02:00
Mikhael Bogdanov
020573ef3c Don't generate compatibility suffix twice for properties 2018-05-29 09:29:48 +02:00
Mikhael Bogdanov
60f2dbeb8a Support property accessor in compatibility mode 2018-05-29 09:29:48 +02:00
Mikhael Bogdanov
7f4bd549aa Minor. Fix rebase 2018-05-29 09:28:46 +02:00
Mikhael Bogdanov
1d6665d355 Minor. Remove hack 2018-05-28 22:15:54 +02:00
Mikhael Bogdanov
b7bad2bd72 Pass accessorKind into AccessorForCallableDescriptor 2018-05-28 22:15:53 +02:00
Mikhael Bogdanov
7a649e0e74 Convert AccessorForPropertyDescriptor to Kotlin 2018-05-28 22:15:52 +02:00
Mikhael Bogdanov
6d321e7997 Rename AccessorForPropertyDescriptor.java to AccessorForPropertyDescriptor.kt 2018-05-28 22:15:51 +02:00
Mikhael Bogdanov
df13d332b3 Minor. Code clean 2018-05-28 22:15:50 +02:00
Mikhael Bogdanov
15cbb68d47 Convert AccessorForCallableDescriptor to Kotlin 2018-05-28 22:15:50 +02:00
Mikhael Bogdanov
2fa521b62a Convert AccessorForFunctionDescriptor to Kotlin 2018-05-28 22:15:49 +02:00
Mikhael Bogdanov
25af7c14e3 Rename AccessorForFunctionDescriptor.java -> AccessorForFunctionDescriptor.kt 2018-05-28 22:15:48 +02:00
Mikhael Bogdanov
8f19dea4a2 Rename FieldAccessorKind to AccessorKind 2018-05-28 22:15:47 +02:00
Mikhael Bogdanov
ad57ca7d2c Minor. Code clean 2018-05-28 22:15:46 +02:00
Mikhael Bogdanov
340920fe38 Support compatibility mode for @JvmDefault 2018-05-28 22:15:45 +02:00
Mikhael Bogdanov
9b718e83a9 Don't copy interface member on DefaultImpl delegation generation, keep kind
Old logic is redundant and obsolete
2018-05-28 22:15:44 +02:00
Mikhael Bogdanov
4421b41790 Skip annotation classes in $DefaultImpls method delegation logic
Annotation could be safely skipped (as already interfaces) cause
  compiler generates delegation to DefaultImpls only for classes
2018-05-28 22:15:43 +02:00
Mikhael Bogdanov
065780de4c Switch enableJvmDefault to jvmDefaultMode 2018-05-28 22:15:42 +02:00
Ilya Chernikov
bacc2079ed Fix/workaround lazy lcript definition test and related scenarios 2018-05-28 22:10:56 +02:00
Ilya Chernikov
6fdb8746de Fixes after review 2018-05-28 22:10:56 +02:00
Ilya Chernikov
6218b2bcf6 Fix custom script codegen test: add missing classpath entries 2018-05-28 22:10:56 +02:00
Ilya Chernikov
a46dd5b30e Avoid using reflected types in the scripting API
since it causes numerous classloading issues. Using the wrapping types
and reload them in the proper context when needed.
Note: this version supports only classes, but the wrapping type could
be extended to support other types in the future.
+ numerous fixes related to proper loading and handling of the templates.
2018-05-28 22:10:56 +02:00
Ilya Chernikov
4d65f0478b Move scripting codegen code from tests-common to compiler tests
getting rid of dependencies on scripting in the tests-common
2018-05-28 22:10:56 +02:00
Pavel V. Talanov
c54967b1b4 IdeaModuleInfos: cache Module.findImplementedModules
Calling ModuleSourceInfo.expectedBy can be quite costly otherwise
    because creating IdeModifiableModuleProvider is not cheap
2018-05-28 20:02:02 +02:00
Pavel V. Talanov
607fab994c Cache result of collectModulesFromIdeaModel
Cache base module infos from idea model until next root modification
Calculate platform specific module infos (see PlatformModuleInfo)
    on demand based on cached module infos from idea model

 #KT-24144 Fixed
2018-05-28 20:02:02 +02:00
Pavel V. Talanov
406a3888c7 Minor: split getModuleInfo into separate files 2018-05-28 20:02:01 +02:00
Alexey Sedunov
4053278119 Misc: Do not set icon via GUI Designer
Since Designer references icon by filename it fails
due to recent update in IDEA icon files

 #KT-24580 Fixed
2018-05-28 17:36:09 +03:00
Nicolay Mitropolsky
aed63d49ce WrongAnnotations.kt - disabled LAZINESS:Consistency -check
because source-based LightAnnotations produces annotation values from arguments in sources even when they are invalid as parameters. Thus they could be inconsistenct with "compiled" ones and it is not an error.
2018-05-28 17:06:35 +03:00
Nicolay Mitropolsky
da5ef06abf KtLightNullabilityAnnotation evaluated from sources 2018-05-28 17:06:35 +03:00
Nicolay Mitropolsky
eea66bea73 Making LightAnnotation work without clsDelegate (KT-20924, KT-22883) 2018-05-28 17:06:35 +03:00
Anton Bannykh
03e46ce0ca JS: more default arguments fixes (KT-24413, KT-21968 fixed)
MPP-related:
* inherited from interfaces
* inherited body from interface
* default arguments in an interface, implemented by a class delegate
* super call of a method with default argument

Also:
* inheritance from an interface and another interface descendant (KT-21968)
* inheritance through an intermediate interface
2018-05-28 15:27:21 +03:00
Dmitry Savvinov
da7b59984f Move importsDumper to compiler plugin 2018-05-28 13:02:48 +03:00
Dmitry Savvinov
16ee2df585 Fix tests for imports dumper
Remove local absolute paths from testdata, introduce new testrunner to
support relativization of imports dump.
2018-05-28 13:02:47 +03:00
Nicolay Mitropolsky
c97f4539d3 181: ideaCompatibleBuildNumber = "181.3" 2018-05-28 12:05:02 +03:00
Alexander Udalov
06d97cce51 Fix multiple issues when expanding argfiles
- treat a contiguous whitespace sequence as a single argument separator,
  not as several empty-string arguments separated by whitespaces
- fix infinite loop when reading unfinished quoted argument
- do not attempt to perform escape if the backslash is the last
  character in the file
2018-05-28 11:23:32 +03:00
Alexander Udalov
61902e1fd5 Support -Xargfile in all scenarios; refactor & prettify code
Perform command line argument preprocessing in the beginning of
parseCommandLineArguments, so that argfiles are expanded in all
scenarios, not just when the compiler is invoked via
K2{JVM,JS}Compiler.exec
2018-05-28 11:23:32 +03:00
Dmitry Savvinov
43467516ef Support argfiles in kotlin compiler
Using '-Xargfile=path/to/argfile' will substitute
that argument with the content of argfile.

See KT-24472
2018-05-28 11:23:32 +03:00
Neonailol
ede2e227c2 KT-23356 Cross-platform function to convert CharArray slice to String
Signed-off-by: Valeriy Zhirnov <neonailol@gmail.com>
2018-05-26 06:06:53 +03:00
Max Medvedev
16ebcc6e77 Extract function: make name editor focused
#KT-22333 Fixed
2018-05-25 23:30:09 +03:00
Alexey Sedunov
610cc3867b Create Class from Usage: Filter out usages in super type entry list
#KT-22918 Fixed
2018-05-25 23:03:26 +03:00
Alexey Sedunov
35517a8253 Quick Fixes: Fix adding parameter to Java constructor
#KT-24574 In Progress
2018-05-25 23:03:26 +03:00
Alexey Sedunov
6e25db990d Change Signature: Use target declaration as a context for types
#KT-22387 Fixed
2018-05-25 23:03:25 +03:00
Ilya Gorbunov
3245148206 Docs: clarify default element value of CharArray and BooleanArray 2018-05-25 21:53:52 +03:00
Ilya Gorbunov
418db53ba4 Array.copyOf docs: do not use 'primitive default' term, rewrite description
#KT-22298
2018-05-25 21:52:36 +03:00
Valeriy Zhirnov
9239de9a02 KT-22298 Improve docs for Array.copyOf(newSize: Int)
Signed-off-by: Valeriy Zhirnov <neonailol@gmail.com>
2018-05-25 21:52:36 +03:00
Ilmir Usmanov
df4dcc0f8e Ignore data flow info from assert calls
if assertions mode is not LEGACY.

This is done since assertions can be disabled (in both compile time and
runtime) and thus, the data flow info is not reliable anymore.
 #KT-24529: Fixed
2018-05-25 18:58:49 +03:00
Ilmir Usmanov
0cb73e55d0 Split kotlin-stdlib-coroutines into common and java jars
#KT-24532: Fixed
2018-05-25 18:19:19 +03:00
Alexander Udalov
9c5256434c Check function name in isGenericToArray/isNonGenericToArray
#KT-24427 Fixed
2018-05-25 14:55:26 +02:00
Ilya Chernikov
92d848b6e6 Fix scripting plugin commandline processing 2018-05-25 09:51:04 +02:00
Ilya Chernikov
705faa4792 Add lazy discovery test 2018-05-25 09:51:04 +02:00
Dmitry Petrov
ab455d6572 IR: IrSimpleFunction.correspondingProperty: IrProperty?
Non-null for a property accessor, points to a corresponding property.
2018-05-25 09:40:51 +03:00
Dmitry Petrov
216dbf9637 Drop IrDeclarationKind 2018-05-25 09:40:51 +03:00
Dmitry Petrov
2a0e7eb412 IR: split IrUtils.kt into common and backend-specific part 2018-05-25 09:40:51 +03:00
Alexey Sedunov
6a21991009 Configuration: Drop Java -> Kotlin/JS configurator
#KT-24504 Fixed
2018-05-24 22:24:24 +03:00
Alexey Sedunov
6fd060b166 Configuration: Support TeamCity repository for dev-versions 2018-05-24 22:24:23 +03:00
Alexey Sedunov
c64f93b052 Configuration: Add 'mavenCentral() to generated script 'repositories' block
#KT-24586 Fixed
2018-05-24 22:24:23 +03:00
Roman Artemev
6d29aab5e2 [JS IR BE] Implement vararg in JS BE 2018-05-24 21:36:12 +03:00
Roman Artemev
84447d59e1 [JS IR BE] Update test data 2018-05-24 21:07:25 +03:00
Roman Artemev
3ec722eaa1 [JS IR BE] Implement labeled loops 2018-05-24 21:07:09 +03:00
Roman Artemev
6811c87fc7 [JS IR BE] Implement block decomposition lowering 2018-05-24 21:06:49 +03:00
Nikolay Krasko
1eeb202a1a Use background task for Kotlin decompiler (KT-23981)
#KT-23981 Fixed
2018-05-24 20:03:23 +03:00
Nikolay Krasko
6c56a7949c Don't call an additional update check when selecting channel with enter 2018-05-24 20:03:22 +03:00
Nikolay Krasko
468f7f234f Don't show default companion name in inlay type hints (KT-22432)
#KT-22432 Fixed
2018-05-24 20:03:22 +03:00
Nikolay Krasko
918f47e832 Refactoring: extract common code to functions 2018-05-24 20:03:22 +03:00
Nikolay Krasko
0a2bb74187 Refactoring: move compatibility issue fix in decompiler to separate file 2018-05-24 20:03:22 +03:00
Nikolay Krasko
c8654a0033 Minor: reformat and fix warnings in internal package 2018-05-24 20:03:21 +03:00
Nikolay Krasko
39694835ce Do not report lambda return hint twice for postfix and prefix (KT-22653)
#KT-22653 Fixed
2018-05-24 20:03:21 +03:00
Toshiaki Kameyama
5e4d571693 Reformat RemoveModifierFix 2018-05-24 17:29:16 +03:00
Toshiaki Kameyama
0100dfb2fd Add "Remove 'lateinit'" quickfix for INAPPLICABLE_LATEINIT_MODIFIER
So #KT-24295 Fixed
2018-05-24 17:26:54 +03:00
Mikhail Glukhikh
f8f3b1c6f1 Provide language version settings correctly for platform modules
So #KT-24546 Fixed
2018-05-24 16:40:52 +03:00
Ilmir Usmanov
6c3d69f74c Minor: Add KotlinTypeMapper constructor overload 2018-05-24 15:42:53 +03:00
Alexander Udalov
d122406dca Map Kotlin TYPE target to Java TYPE_USE in bytecode
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-05-24 14:41:22 +02:00
Mikhail Glukhikh
fbb0a3e06c Convert async {}.await() to withContext(DefaultDispatcher) {}
This fixes incorrect transformation related to KT-24235
2018-05-24 15:15:25 +03:00
Mikhail Glukhikh
4ed4754d80 Additional tests for KT-21131 2018-05-24 15:15:23 +03:00
Mikhail Glukhikh
f3c2dd0526 Code inliner: keep main property if it can have side effects
So #KT-24165 Fixed
2018-05-24 15:15:22 +03:00
Mikhail Glukhikh
93a510c05b Code inliner: move lambda outside parentheses always when possible
So #KT-24215 Fixed
2018-05-24 15:15:21 +03:00
Mikhail Glukhikh
bb8c3495b8 Reformat & cleanup: CodeInliner 2018-05-24 15:15:19 +03:00
Mikhail Glukhikh
2d7e274860 Fix importing scope order in ReplaceWithAnnotationAnalyzer
So #KT-22615 Fixed
2018-05-24 15:15:13 +03:00
Mikhail Glukhikh
394a547084 Reformat: ReplaceWithAnnotationAnalyzer 2018-05-24 15:15:10 +03:00
Mikhail Glukhikh
75724c0240 Reformat: CodeToInline 2018-05-24 15:15:09 +03:00
Mikhail Glukhikh
251491757d Reformat: CallableUsageReplacementStrategy 2018-05-24 15:15:08 +03:00
Mikhail Glukhikh
0655e153c3 Reformat: DeprecatedSymbolUsageFixBase 2018-05-24 15:15:07 +03:00
Mikhail Glukhikh
7cb4c91277 Reformat: DeprecatedSymbolUsageFix 2018-05-24 15:15:06 +03:00
Mikhail Glukhikh
8d74ff4799 Fix Java inspection performance tests 2018-05-24 15:13:19 +03:00
Mikhail Glukhikh
18c59578be Light class performance test: rename test file 2018-05-24 15:13:18 +03:00
Mikhail Glukhikh
3b6d610e29 Light class performance test: access field & method types
So #KT-24085 Fixed
2018-05-24 15:13:18 +03:00
Mikhail Glukhikh
75eeb32970 Light class performance test: build also light nested classes
So #KT-24085 In Progress
2018-05-24 15:13:18 +03:00
Mikhail Glukhikh
bb4cf08d0b Light class performance test: evaluate all supertypes / methods / fields
So #KT-24085 In Progress
2018-05-24 15:13:18 +03:00
Mikhail Glukhikh
1861e0a21d Introduce performance test for light classes building (top-level)
So #KT-24085 In Progress
2018-05-24 15:13:18 +03:00
Natalia Selezneva
98fe8eaa42 Minor: add test that output at scratch line with spaces at the beginning is aligned properly 2018-05-24 15:07:37 +03:00
Natalia Selezneva
db63877690 Scratch: take into account only lines with expressions calculating inlay insert offset 2018-05-24 15:07:37 +03:00
Natalia Selezneva
aa7c13e30b Run scratch if there are some compilation error during make 2018-05-24 15:07:37 +03:00
Natalia Selezneva
5a7b58c615 Substring long scratch output with new lines
^KT-24016 Fixed
2018-05-24 15:07:37 +03:00
Natalia Selezneva
94bb19c765 Provide line info for scratch output in scratch toolwindow
^KT-24016
2018-05-24 15:07:37 +03:00
Natalia Selezneva
a505a948d2 Scratch tests: add check for toolwindow output 2018-05-24 15:07:37 +03:00
Natalia Selezneva
bce0a77a94 Scratch: fix duplicating of errors in scratch output toolwindow 2018-05-24 15:07:37 +03:00
Natalia Selezneva
e3b6fad2cd Scratch: test alignment of inlays 2018-05-24 15:07:37 +03:00
Natalia Selezneva
5da0252651 Minor: rename file and rearrange classes 2018-05-24 15:07:37 +03:00
Natalia Selezneva
420da0d213 Introduce ToolWindowScratchOutputHandler 2018-05-24 15:07:37 +03:00
Natalia Selezneva
aa1e604923 Refactoring: move ScratchToolWindowFactory to scratch.output package 2018-05-24 15:07:37 +03:00
Natalia Selezneva
614fa9d0c7 Refactoring: move ScratchFileRenderer to separate file 2018-05-24 15:07:37 +03:00
Natalia Selezneva
afa6110e6a Minor: replace assert with user-friendly error 2018-05-24 15:07:37 +03:00
Natalia Selezneva
75ad78460f Setting for auto-reloading script dependencies isn't loaded from xml on project reopening 2018-05-24 15:07:37 +03:00
Natalia Selezneva
54f9359195 Minor: fixes after review 2018-05-24 15:07:37 +03:00
Sergey Rostov
098e51d104 jps: support dev kit module types (and all other ModuleBasedBuildTargetType). fix brunch 172 2018-05-24 14:59:46 +03:00
Alexander Udalov
bf3419c3bd Introduce OptionalExpectation for annotations missing on some platforms
This commits adds a new annotation OptionalExpectation to the standard
library, which is experimental. To enable its usage, either pass
'-Xuse-experimental=kotlin.ExperimentalMultiplatform' as a compiler
argument, or '-Xuse-experimental=kotlin.Experimental' and also annotate
each usage with `@UseExperimental(ExperimentalMultiplatform::class)`

 #KT-18882 Fixed
2018-05-24 13:14:51 +02:00
Sergey Rostov
ec5110e1f4 jps: support dev kit module types (and all other ModuleBasedBuildTargetType)
#KT-24500 fixed
2018-05-24 11:12:01 +03:00
Mikhail Glukhikh
865f94eb18 Disable "make module experimental" fix on non-JPS modules
Related to KT-24243
2018-05-24 10:50:28 +03:00
Mikhail Glukhikh
d7bb8a7a21 Do not suggest -Xuse...=kotlin.Experimental in experimental world 2018-05-24 10:50:28 +03:00
Mikhail Glukhikh
f2989ee3a6 Experimental fixes: introduce experimental enabling #KT-24243 Fixed 2018-05-24 10:50:28 +03:00
Mikhail Glukhikh
c77c8d872c Experimental fixes: introduce "add -Xuse-experimental" (KT-22760) 2018-05-24 10:50:27 +03:00
Natalia Selezneva
30c62bccb2 Refactoring: do not store scriptModuleInfo inside ScriptDependenciesInfo
Cache for ScriptDependenciesInfo.ForFile is dropped because there is a cache for ScriptModuleInfo, so the facade for dependencies shouldn't be created too often
Cache for ScriptDependenciesInfo.ForProject is stored in a field
2018-05-24 08:47:32 +03:00
Natalia Selezneva
2b322ecf9c Do not store external dependencies in ScriptModuleInfo
There is a cache from ScriptModuleInfo to ScriptDependenciesInfo.
In case when only script dependencies are changed we won't recreate the facade for them and will obtain external dependencies for ScriptModuleInfo stored in ScriptDependenciesInfo. So we cannot store external dependencies inside ScriptModuleInfo. The same problem is with relatedModuleSourceInfo.
2018-05-24 08:47:32 +03:00
Natalia Selezneva
ab743ef759 Scripts: fix NPE during script dependencies update
^KT-24527 Fixed
2018-05-24 08:47:32 +03:00
Natalia Selezneva
f0a7642e1d Optimize ScriptDependenciesUpdater to find scriptDefinition only for files with KotlinFileType 2018-05-24 08:47:32 +03:00
Natalia Selezneva
bb04998159 Scripts: remove loaders when any result was received
^KT-24470 Fixed
2018-05-24 08:47:32 +03:00
Alexey Sedunov
44e7070118 Configuration: Use 'plugins' block in generated/modified Gradle scripts
Follow-up for 172/173/AS3.1/AS3.2 bunches
2018-05-24 02:54:01 +03:00
Alexey Sedunov
efc369dbe4 Misc: KtParsingTestCase fixes for 172/173/AS3.1 bunches 2018-05-24 02:54:00 +03:00
Yan Zhulanow
ece6141891 Pill: Fix module-related path rendering 2018-05-24 01:06:30 +03:00
Yan Zhulanow
0b0089711a Android Extensions: Avoid duplicating variants in compiler plugin options 2018-05-24 01:01:52 +03:00
Yan Zhulanow
015d7f3300 Kapt: Do not retain references to Kotlin compiler classes in customized Javac components
This should fix potential memory leakages.
2018-05-24 01:01:52 +03:00
Yan Zhulanow
99ecedc32e Kapt: Ensure there isn't duplicating entries in the processor loading classpath
(cherry picked from commit 1354a0d)
2018-05-24 01:01:52 +03:00
Yan Zhulanow
aa8c266940 Pill: Add kotlin-scripting-gradle and kotlin-gradle-plugin-integration-tests to JPS model (in 'full' variant) 2018-05-24 01:01:52 +03:00
Yan Zhulanow
b6d59da8a8 Kapt3: Avoid normal compilation in case if no apClasspath entries are passed (#KT-24538) 2018-05-24 01:01:52 +03:00
Yan Zhulanow
dd40b3a15c Kapt: Remove obsolete kapt1-related tests 2018-05-24 01:01:51 +03:00
Yan Zhulanow
6e362f6734 Kapt: Remove kapt1 from Kotlin compiler 2018-05-24 01:01:51 +03:00
Yan Zhulanow
662b79780d Kapt: Remove kapt1 support from Gradle and incremental compilation 2018-05-24 01:01:51 +03:00
Yan Zhulanow
58643ea99d Kapt: Remove annotation processor wrappers for kapt1 (it's obsolete now) 2018-05-24 01:01:51 +03:00
Mikhail Glukhikh
a76bb80e4d Experimental fixes: additional tests, handle local declarations 2018-05-23 19:06:55 +03:00
Mikhail Glukhikh
51fba03253 Experimental fixes: introduce "Add @UseExperimental" #KT-22760 Fixed 2018-05-23 19:00:51 +03:00
Mikhail Glukhikh
f404d6c97a Experimental fixes: introduce "add annotation" (KT-22760) 2018-05-23 18:59:22 +03:00
Sergey Igushkin
721d9df4e0 (minor) Fix testApplyWithFeaturePlugin 2018-05-23 18:41:10 +03:00
Sergey Igushkin
571905824d Add AP option providers of Android Gradle plugin as @Nested to Kapt
Also remove these option providers from the javac task compiler argument
providers so as to avoid output intersections of javac vs kapt.

The options generated by the providers are added to the Kapt subplugin
options as well in order to be passed to Kapt. Since these options
are a list, not a map, pass them without name (Kapt should decode them
into plain arguments). Remove the '-A' prefix as it is there for
command line annotation processor options, but we don't need it, it
is added by Kapt internally.

Issue #KT-23964 Fixed
Issue #KT-24420 Fixed
2018-05-23 18:41:10 +03:00
Simon Ogorodnik
77429b1ca5 Revert: Partial: Add grouping suite and improve whole kotlin tests (fea2559)
Revert occasional change in misc.xml
2018-05-23 17:08:36 +03:00
Alexey Sedunov
1650e69980 Configuration: Use 'plugins' block in generated/modified Gradle scripts
#KT-20665 Fixed
2018-05-23 16:39:20 +03:00
Alexey Sedunov
909ff3a7ec Misc: Migrate to IDEA 181.3 2018-05-23 16:39:20 +03:00
Simon Ogorodnik
78fb775e04 Cleanup duplication 2018-05-23 16:14:39 +03:00
Simon Ogorodnik
ce71e0822c Fix nsToMs 2018-05-23 16:14:38 +03:00
Simon Ogorodnik
391c516ed0 Java inspections test 2018-05-23 16:14:37 +03:00
Simon Ogorodnik
16adf383a5 Use single test project for all tests, instead of copying current 2018-05-23 16:14:36 +03:00
Simon Ogorodnik
fea2559a28 Add grouping suite and improve whole kotlin tests 2018-05-23 16:14:34 +03:00
Mikhail Glukhikh
3e2563ad73 Extract AllKotlinTest from AllKotlinInspectionTest
(cherry picked from commit 7cb31ee)
2018-05-23 16:14:33 +03:00
Simon Ogorodnik
a57a40b5a9 Fix totals 2018-05-23 16:14:33 +03:00
Simon Ogorodnik
9287d2cd24 Fix testFailed reporting 2018-05-23 16:14:31 +03:00
Simon Ogorodnik
750cb38f8c Don't include stacktrace to failure 2018-05-23 16:13:22 +03:00
Simon Ogorodnik
1a015402c8 Fail per file check on first exception 2018-05-23 16:13:21 +03:00
Simon Ogorodnik
c8fbf2d3ac Post-review fixes, add errors reporting to test 2018-05-23 16:13:20 +03:00
Simon Ogorodnik
3221900f69 Change soft refs policy 2018-05-23 16:13:19 +03:00
Simon Ogorodnik
94c8a18f10 Remove dependency from test to performanceTest 2018-05-23 16:13:18 +03:00
Simon Ogorodnik
d2a60164c6 Handle exceptions 2018-05-23 16:13:17 +03:00
Simon Ogorodnik
7b155fc9d4 Increase heap size for test 2018-05-23 16:12:57 +03:00
Simon Ogorodnik
7d9310acf4 Refactor inspection test output 2018-05-23 16:12:55 +03:00
Simon Ogorodnik
740e6fde35 Create performance test for all inspections 2018-05-23 16:12:54 +03:00
Roman Artemev
de9aea6e98 [JS BE] Fix delegation of suspend method member (KT-23094) 2018-05-23 14:59:59 +03:00
Roman Artemev
8862b26bbd Add test case to check delegation of suspend method 2018-05-23 14:59:59 +03:00
Mikhael Bogdanov
f826a253e3 Generate @JvmDefault for property accessors in LIGHT_CLASS MODE 2018-05-23 13:55:38 +02:00
Alexander Udalov
402ceefe60 Regenerate tests 2018-05-23 12:26:10 +02:00
Ilya Gorbunov
3d2a641057 Minor: explicit public visibility 2018-05-23 05:44:34 +03:00
Ilya Gorbunov
d9656a939b Do not produce libraries json declarations dump
It's no longer needed for checking binary compatibility.
Clean build of these libraries is no longer required too.

Cleanup build.gradle of binary-compatibility-validator.
2018-05-23 05:00:57 +03:00
Ilya Gorbunov
ad8c64e127 bcv: refactor: do not convert flags to string representation 2018-05-23 05:00:57 +03:00
Ilya Gorbunov
66a9a90455 bcv: cleanup the old way of reading kotlin visibilities 2018-05-23 05:00:57 +03:00
Ilya Gorbunov
84d96d9537 Use asm:6.0 in kotlinp
Some class files can't be read with asm:4.0.

Make shadowJar when assembling the project.
2018-05-23 05:00:57 +03:00
Ilya Gorbunov
fcf323851e bcv: use kotlinx-metadata-jvm to read kotlin visibilities
It's no longer required to dump kotlin-to-java declaration mapping to json
before using binary-compatibility-validator.

@JvmOverloads are not supported yet, so remove them from test.

Use asm:6.0 in bcv
2018-05-23 05:00:56 +03:00
Ilya Gorbunov
1872550f25 binary-compatibility-validator: add test case for parameters with default values
Move JvmOverloads test there.
2018-05-23 05:00:56 +03:00
Nikolay Krasko
fdc6372776 Remove runtime usage from unused receiver parameter tests 2018-05-23 01:41:02 +03:00
Toshiaki Kameyama
e7a9614fb5 "Unused receiver parameter" inspection: Fix false negative in same class (KT-23897)
#KT-23897 Fixed
2018-05-23 01:41:01 +03:00
Ilya Gorbunov
793d34b913 Suppress errors about non-public primary constructor and forbidden varargs 2018-05-22 22:27:00 +03:00
Ilya Gorbunov
0eee258fce Generate toString implementation for unsigned types 2018-05-22 22:26:56 +03:00
Ilya Gorbunov
e988ea5a1c Implement unsigned arithmetic operations including ulong division and remainder 2018-05-22 22:26:52 +03:00
Ilya Gorbunov
e01895fb0a Implement unsigned/signed conversions 2018-05-22 22:26:47 +03:00
Ilya Gorbunov
89e4fdfa9c Implement unsigned comparisons 2018-05-22 22:26:43 +03:00
Ilya Gorbunov
e4216099b3 Simplify differenceModulo for unsigned operands 2018-05-22 22:26:39 +03:00
Ilya Gorbunov
f2c01a9d9b Generate ranges, progressions and progressioniterators for UInt and ULong 2018-05-22 22:26:36 +03:00
Ilya Gorbunov
5c6719b1e6 Generate arrays of unsigned types 2018-05-22 22:26:32 +03:00
Ilya Gorbunov
4fbc48f83f Generate specialized abstract iterators for unsigned types 2018-05-22 22:26:28 +03:00
Ilya Gorbunov
188d8ab8dd Generate unsigned integers declarations, mostly without implementations
Generate and/or/xor/inv for UByte/UShort using experimental signed counterparts
2018-05-22 22:26:24 +03:00
Ilya Gorbunov
e57e3971b6 Setup separate sourceset for unsigned integer types
Build jar with unsigned types and put it to dist
2018-05-22 22:26:20 +03:00
Ilya Gorbunov
e886460130 Advance bootstrap
Need to use -XXLanguage feature switch
2018-05-22 22:26:14 +03:00
Toshiaki Kameyama
1d0a11cecd "Remove parameter" quick fix makes generic function call incompilable when type could be inferred from removed parameter only
#KT-23511 Fixed
2018-05-22 17:33:26 +03:00
Toshiaki Kameyama
8271e85dbb ReplaceArrayOfWithLiteralInspection: Remove unnecessary parentheses
#KT-21878 Fixed
2018-05-22 17:33:25 +03:00
Mikhail Glukhikh
c95ed9fd20 Result unused: a few enhancements for PSI checks
Related to KT-15063, KT-24433
2018-05-22 17:13:48 +03:00
Mikhail Glukhikh
b8375d4864 Extend "async result unused" to "Deferred result unused" #KT-15063 Fixed 2018-05-22 17:07:05 +03:00
Mikhail Glukhikh
ffcfa51fbf Introduce inspection "async result unused" #KT-24433 Fixed 2018-05-22 16:39:14 +03:00
Mikhail Glukhikh
d0c045e4ba Style fix: AbstractInspectionTest 2018-05-22 16:39:14 +03:00
Mikhail Glukhikh
feaaf5df84 Reformat: AbstractKotlinInspection 2018-05-22 16:39:14 +03:00
Mikhail Glukhikh
2a9108bcd3 Fix "Too long character literal -> string" in ILLEGAL_ESCAPE
Related to #KT-23788
2018-05-22 16:38:29 +03:00
Toshiaki Kameyama
85cd1e938e Add "Too long character literal -> string" fix to ILLEGAL_ESCAPE error
So #KT-23788 Fixed
2018-05-22 16:19:41 +03:00
Mikhail Glukhikh
6d39eb9239 Unnecessary parentheses in function call with lambda: simplify
Related to KT-23452
2018-05-22 16:18:42 +03:00
Toshiaki Kameyama
b8f3d588b7 Unnecessary parentheses in function call with lambda: fix false positive
So #KT-23452 Fixed
2018-05-22 15:45:02 +03:00
Dmitry Petrov
8dbfd85d26 psi2ir: Support class literals in annotations 2018-05-22 15:29:01 +03:00
Alexander Udalov
e7f6ac1e50 Fix data class equals codegen for type parameters with interface bounds
#KT-24474 Fixed
2018-05-22 13:45:21 +02:00
Mikhail Zarechenskiy
542b2abafa Fix migration change for new inference about coroutines
Now it's possible after 9209222

 #KT-23553 Fixed
2018-05-22 10:11:14 +03:00
Dmitry Petrov
c22dfeaf82 KT-24156 Do not optimize for-loops over Strings with custom iterator
'fun CharSequence.iterator()' is an extension function, so one can
overload it with custom implementation.
Other "predefined" containers such as arrays and ranges have member
'fun iterator()', so these containers are not affected.

Check that 'iterator' call corresponds to an extension function
'iterator' defined in package 'kotlin.text' with a receiver of type
'kotlin.CharSequence'.

 #KT-24156 Fixed
2018-05-22 10:02:52 +03:00
Ilmir Usmanov
f568149863 Implement new assert semantics in back-end
Previously, assert was just a regular function and its argument used to
be computed on each call (even if assertions are disabled on JVM).
This change adds support for 3 new behaviours of assert:
* always-enable (independently from -ea on JVM)
* always-disable (independently from -ea JVM)
* runtime/jvm (compile the calls like javac generates assert-operator)
* legacy (leave current eager semantics) - this already existed

Default behaviour is legacy for now.

The behavior is changed based on -Xassertions flag.
 #KT-7540: Fixed
2018-05-21 20:43:37 +03:00
Derek Schaller
3f5a2c6427 Link license files 2018-05-21 18:19:49 +03:00
Mikhail Zarechenskiy
1b809413d2 [NI] Fix updated type for lambda, use original type for substitution
#KT-24367 Fixed
2018-05-21 17:56:11 +03:00
Alexey Tsvetkov
005bdc46eb Update bootstrap compiler 2018-05-20 18:23:10 +03:00
Alexey Tsvetkov
7f865565a6 Improve JPS progress messages
#KT-9218 fixed
2018-05-18 23:50:08 +03:00
Alexey Tsvetkov
6210df977b Fix NPE during lookup map GC
The cause of the issue is unknown, I was not able to reproduce it as
well

    #KT-24337 fixed
2018-05-18 23:50:08 +03:00
Nicolay Mitropolsky
eeab271eff 182: IDEA-SDK fixed to 182.2371.4 2018-05-18 21:24:59 +03:00
Toshiaki Kameyama
5564102a3e Add "Create secondary constructor" quick fix on NONE_APPLICABLE error #KT-22371 Fixed 2018-05-18 18:11:13 +03:00
Toshiaki Kameyama
d32b53362d Reformat UnusedReceiverParameterInspection 2018-05-18 18:11:13 +03:00
Dmitry Savvinov
68dbeeac7a Introduce LanguageFeature.Kind
Mainly, Kind affects 'forcesPreReleaseBinaries' and
'enabledInProgressiveMode' flags, and allows to cover common
combinations of those flags.
2018-05-18 16:16:23 +03:00
Dmitry Savvinov
c33b7377da Add support of internal arguments for language feature settings
Arguments are passed in form '-XXLanguage:+LanguageFeatureName' for enabling
LanguageFeature.LanguageFeatureName, and '-XXLanguage:-LanguageFeatureName'
for disabling.

Note that they do override other settings, including 'language-version'
or extra ('-X') args.
2018-05-18 16:16:23 +03:00
Dmitry Savvinov
ae119a09eb Minor: reformat CommonToolArguments 2018-05-18 16:16:23 +03:00
Dmitry Savvinov
9ba450ffc5 Minor: reformat parseCommandLineArguments, apply intentions 2018-05-18 16:16:23 +03:00
Dmitry Savvinov
9876ecd6df Minor: reformat CommonCompilerArguments 2018-05-18 16:16:23 +03:00
Dmitry Savvinov
e8181c0473 Introduce -Xprogressive 2018-05-18 16:16:23 +03:00
Mikhael Bogdanov
2e9bf49921 Don't skip coercion to nullable Unit in codegen 2018-05-18 12:58:01 +02:00
Mikhael Bogdanov
73bd97a134 Write deprecation flag 2018-05-18 12:58:01 +02:00
Mikhael Bogdanov
61f444f846 Avoid empty clinit generation 2018-05-18 12:58:00 +02:00
Mikhael Bogdanov
aece29a95b Properly generate annotation classes 2018-05-18 12:57:59 +02:00
Mikhael Bogdanov
893e843648 Code clean 2018-05-18 12:57:59 +02:00
Mikhael Bogdanov
083bcade5f Minor. Reformat 2018-05-18 12:57:58 +02:00
Alexander Udalov
11653c6800 Move checkTypePosition to VarianceChecker in frontend
This is a partial revert of 279ff0b, which is no longer needed because
of the previous commit
2018-05-18 11:56:14 +02:00
Alexander Udalov
0e190e885a Remove UnsafeVarianceTypeSubstitution
Looks like it's not really used for anything
2018-05-18 11:56:14 +02:00
Alexey Sedunov
d2bfb8caec Configuration: Add migration of JPS project to new non-jvm source roots 2018-05-18 12:09:40 +03:00
Alexey Sedunov
9fa26c83b6 Configuration: Introduce special source roots for non-JVM Kotlin modules
#KT-5948 Fixed
 #KT-23672 Fixed
2018-05-18 12:09:40 +03:00
Alexey Sedunov
1fb1431257 Configuration: Setup project settings even if library is not detected
#KT-22305 Fixed
2018-05-18 12:09:39 +03:00
Alexey Sedunov
eb14625851 Configuration: Detect platform of libraries added via maven artifact ids
#KT-20511 Fixed
2018-05-18 12:09:39 +03:00
Alexey Sedunov
06f9be1899 Configuration: Unify presentable names of Kotlin configurators
#KT-23658 Fixed
2018-05-18 12:09:39 +03:00
Alexey Sedunov
4a98f1dccc Misc: Follow-up fixes for 172/182 bunches 2018-05-18 12:09:38 +03:00
Alexey Tsvetkov
55b61bdc53 Turn off inter-project IC when unknown task writes to java output dir 2018-05-17 20:55:27 +03:00
Alexey Tsvetkov
ea255ac854 Rebuild when dependency was built non-incrementally 2018-05-17 20:55:27 +03:00
Alexey Tsvetkov
53266300d4 Implement module detection for Gradle IC with Android
#KT-22431 fixed
2018-05-17 20:55:26 +03:00
Alexey Tsvetkov
e5cdc64f4f Track changes for jar files for non-Android Gradle projects 2018-05-17 20:55:26 +03:00
Alexey Tsvetkov
61e330fa57 Track inter-project IC changes for Java 2018-05-17 20:46:52 +03:00
Alexey Tsvetkov
6a45310830 Remove global artifact history cache in Gradle
Each Kotlin task now writes build history to separate file.
A map of output directories to history files is used to get changes for
modified files.

    #KT-22623 fixed
2018-05-17 20:46:52 +03:00
Alexander Udalov
598e89c03d Update bunch files for KotlinTestUtils after 9dbeb79340 2018-05-17 12:43:30 +02:00
Alexander Udalov
d7c77e522c Do not render UnsafeVariance in tests on built-ins
This fixes LoadBuiltInsTest which failed because UnsafeVariance was
rendered in the lazy resolve result, but was not in the deserialized
result (because it has SOURCE retention)
2018-05-17 12:38:57 +02:00
Nikolay Krasko
2754429573 Minor: fix in comment 2018-05-17 12:27:30 +03:00
Nikolay Krasko
580e2972db Initial settings for incompatible API inspection 2018-05-17 12:27:30 +03:00
Nikolay Krasko
3ef67e1d9d Inspection for highlighting problem API usage
It's planned to use this inspection for show patchset branches problems
during development process.
2018-05-17 12:27:29 +03:00
Nikolay Krasko
a95ec598f2 Refactoring: move accessor name generators to companion object for reuse 2018-05-17 12:27:28 +03:00
Nikolay Krasko
0acb7d8200 Minor: reformat files 2018-05-17 12:27:28 +03:00
Alexey Tsvetkov
f9af48c19e Test Java is up-to-date when Kotlin ABI is unchanged 2018-05-16 21:36:48 +03:00
Alexey Tsvetkov
b2d13ac89b Fix Kapt incremental test with Gradle >= 4.3 2018-05-16 21:36:48 +03:00
Alexander Udalov
ed2439c905 Minor, move version declaration to the correct place 2018-05-16 19:16:08 +02:00
Alexander Udalov
e1a4bd01f5 Add anonymousObjectOriginName/lambdaClassOriginName to kotlinx-metadata
#KT-21320
 #KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
b97379b39b Provide stable JVM names for kotlinx-metadata file facades
#KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
c87218ac6c Use JvmMetadataVersion/JvmBytecodeBinaryVersion in kotlinx-metadata
#KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
ffa6b6233b Minor, make BinaryVersion.numbers private
Use BinaryVersion.toArray instead, as in all other usages
2018-05-16 17:16:22 +02:00
Alexander Udalov
1b15619457 Move BinaryVersion to metadata, JVM versions to metadata.jvm
To be used in kotlinx-metadata
2018-05-16 17:16:22 +02:00
Alexander Udalov
e5a5d834ab Add "-verbose" to kotlinp tool, change type parameter name rendering
Only render the actual name of the type parameter in the verbose mode

 #KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
23d107c11d Support multiple MetadataExtensions instances in kotlinx-metadata
#KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
c42001f550 Refactor flags in kotlinx-metadata
- rename object Flags to Flag and merge it with MetadataFlag
- use typealias Flags instead of Int
- use top level function "flagsOf" instead of "Flags.invoke" to
  construct a bitmask

 #KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
002310ff6e Add ReadMe for kotlinx-metadata and kotlinx-metadata-jvm
#KT-23198
2018-05-16 17:16:22 +02:00
Alexander Udalov
9dbeb79340 Test kotlinx-metadata and kotlinp on compiler test data
#KT-23198
2018-05-16 17:16:21 +02:00
Alexander Udalov
bef759161f Support .kotlin_module files in kotlinx-metadata
#KT-23198
2018-05-16 17:16:21 +02:00
Alexander Udalov
a751d02306 Implement writing visitors for kotlinx-metadata
#KT-23198
2018-05-16 17:16:21 +02:00
Alexander Udalov
4b284a4890 Add kotlinp, a tool to print Kotlin metadata in class/module files
At the moment, it's not published anywhere, but that may change soon

 #KT-23198
2018-05-16 17:16:21 +02:00
Alexander Udalov
e4062f6447 Add kotlinx-metadata library for handling Kotlin metadata
#KT-23198
2018-05-16 17:16:21 +02:00
Ilya Gorbunov
8ab49a70e9 Make dexMethodCount task incremental unless teamcity output is required
Declare details file as output, circumvent task up-to-date check if teamcity statistics output is required.
2018-05-16 17:48:05 +03:00
Ilya Gorbunov
e7b445e4b5 Fix incorrect @returns tag usage and improve padStart/End docs
#KT-24371 Fixed
2018-05-16 17:43:12 +03:00
Ilya Gorbunov
15d21a0532 Remove UnsafeVariance from expected testdata for serialized builtins tests
UnsafeVariance source annotation is no longer serialized as a result of KT-23360
2018-05-16 17:37:02 +03:00
Ilya Gorbunov
a69694a5d5 Advance bootstrap to build 1.2.60-dev-58 2018-05-16 17:37:02 +03:00
Yan Zhulanow
20cb4e91b3 Do not retain proxy-based components for compiler plugin settings in project model 2018-05-16 17:04:03 +03:00
Nicolay Mitropolsky
29ef8650f7 182: gson set to 2.8.4 2018-05-16 13:16:26 +03:00
Mikhail Glukhikh
6a1ddd6c70 Lambda to anonymous: report only from left brace to arrow 2018-05-16 13:01:38 +03:00
Mikhail Glukhikh
f4acaae364 Lambda to anonymous: use type renderer & shorten references 2018-05-16 13:01:38 +03:00
Mikhail Glukhikh
0f2879aa32 Rename: SOURCE_CODE_SHORT_NAMES_IN_TYPES -> *_SHORT_NAMES_NO_ANNOTATIONS 2018-05-16 13:01:37 +03:00
Mikhail Glukhikh
06f7e77006 Introduce new type renderers (no parameters & built-in annotations) 2018-05-16 13:01:37 +03:00
Mikhail Glukhikh
1ba99fde56 "lambda to anonymous": add tests for qualified types (KT-7710) 2018-05-16 13:01:37 +03:00
Mikhail Glukhikh
257664cf1b Make "lambda to anonymous" low-priority (KT-7710) 2018-05-16 13:01:36 +03:00
Mikhail Glukhikh
bd6fdb743c Lambda to anonymous function: use callable builder (KT-7710) 2018-05-16 13:01:36 +03:00
Toshiaki Kameyama
8a20d1bf01 Add intention to convert lambda to anonymous function #KT-7710 Fixed 2018-05-16 13:01:36 +03:00
Nikolay Krasko
8ef4b9a8e1 Don't show type hierarchy for elements without name 2018-05-16 12:55:09 +03:00
Nikolay Krasko
062a212b61 Don't build light classes for local classes with parse errors (KT-24323, EA-107235)
Also use checks for building light classes in `getLightClassDataHolder`.
2018-05-16 12:55:09 +03:00
Nikolay Krasko
15a704fe36 Use comment directive for not generated case to be valid Java file 2018-05-16 12:55:08 +03:00
Nikolay Krasko
f2c642eefb Fight with valid absent, corrupted and missing files in archives (EA-119686)
Inspired by ClassFileViewProvider.
2018-05-16 12:55:08 +03:00
Nikolay Krasko
c35f8d621a Use separate dirs in pill for running IDE to avoid test misbehaviour 2018-05-16 12:55:08 +03:00
Ilya Chernikov
612de2e342 Fix the invalid code after "Fix order of jars" commit 2018-05-16 07:24:21 +02:00
Vyacheslav Gerasimov
a1c551faaf as32: Make use of createIfNecessaryParameter of AndroidModuleInfoProviderImpl.getApplicationResourceDirectories 2018-05-15 22:32:20 +03:00
Vyacheslav Gerasimov
995352c20f Restore j2k.jar in cidr plugin
Excluding it requires more complex refactoring, wip
2018-05-15 22:11:01 +03:00
Ilya Chernikov
b2bda5c017 Enumerate roots for script definitions only if project is initialized
fixes #KT-23805
2018-05-15 19:27:09 +02:00
Ilya Chernikov
4b949ef303 Fix order of jars for the scripting plugin:
if gradle project is being built with JPS, the gradle scripting plugin
is passed in the plugin classpath. Since it is rebased on the embeddable
compiler, it hides expected plugin registrar signature, which leads to
the AbstractMethodError on attempt to load the plugin. Putting incoming
classpath at the end of the resulting one fixes the issue.
Fixes #KT-24448
2018-05-15 19:26:42 +02:00
Alexey Tsvetkov
ea1a4f75ba Fix incremental android extensions test
Weirdly merge resource task was failing when run incrementally
if support library is present
2018-05-15 18:40:54 +03:00
Alexey Tsvetkov
6edba56adb Fix Android IC test
Previously some Kotlin files were recompiled, because Java files
were regenerated.
However this is no longer true for some time since
precise Java tracking was implemented.
2018-05-15 18:40:54 +03:00
Mike
a038a88bfa More correct NOTHING_TO_INLINE description
Strictly speaking, they are not 'lambda parameters', they are 'functional parameters' or 'parameters of functional types'.
Sorry for my pedantry.
2018-05-15 16:27:45 +02:00
Mikhael Bogdanov
f4f01efd1f Avoid descriptors usage in IrFunction flag calculation 2018-05-15 16:07:07 +02:00
Mikhael Bogdanov
e9216625f0 Update logic to $default function lowering (don't skip interface members) 2018-05-15 16:06:31 +02:00
Mikhael Bogdanov
9d36367fbd Minor. Code clean: use class kind utils 2018-05-15 16:06:30 +02:00
Mikhael Bogdanov
678b1101cb Add class kind utils 2018-05-15 16:06:28 +02:00
Mikhael Bogdanov
6590666983 Run ir test in parallel 2018-05-15 16:06:00 +02:00
Mikhael Bogdanov
9546c36c3c Get rid of 'descriptor.isInner()' call 2018-05-15 16:06:00 +02:00
Mikhael Bogdanov
b9da331dcd Migrate DescriptorsFactory.getInnerClassConstructorWithOuterThisParameter() API to symbols 2018-05-15 16:05:59 +02:00
Mikhael Bogdanov
9103b6a51b Migrate DescriptorsFactory.getOuterThisFieldSymbol() API to symbols 2018-05-15 16:05:59 +02:00
Mikhael Bogdanov
ee98556669 Migrate DescriptorsFactory caching to symbols 2018-05-15 16:05:58 +02:00
Mikhael Bogdanov
d4d8fe4995 Migrate DescriptorsFactory.getSymbolForObjectInstance() API to symbols 2018-05-15 16:05:57 +02:00
Mikhael Bogdanov
2631d149b2 Migrate DescriptorsFactory.getFieldDescriptorForEnumEntry() API to symbols 2018-05-15 16:05:55 +02:00
Mikhael Bogdanov
9fad3f25f3 Minor. Reformat 2018-05-15 16:04:47 +02:00
Yan Zhulanow
9277d6a160 Pill: Import Kotlin facets 2018-05-15 16:29:52 +03:00
Yan Zhulanow
215053efc9 Pill: Fetch kotlin compilation arguments 2018-05-15 16:29:51 +03:00
Yan Zhulanow
923fbaaca6 Pill: Fix launching debuggable Android Studio on 'as' bunches 2018-05-15 16:29:50 +03:00
Yan Zhulanow
614033d64c Pill: Import all defined source sets, not only "src" and "test" 2018-05-15 16:29:49 +03:00
Yan Zhulanow
2bf439d3fb Pill: Attach gradle-api dependency 2018-05-15 16:29:48 +03:00
Yan Zhulanow
c439b6d38b Pill: Import common modules as libraries 2018-05-15 16:29:47 +03:00
Yan Zhulanow
33a8843d34 Pill: Download Android jars only if pill.android.tests option is set 2018-05-15 16:29:46 +03:00
Yan Zhulanow
5fc18755ca Pill: Exclude 'build' dirs from excluded projects 2018-05-15 16:29:46 +03:00
Yan Zhulanow
ba5836d666 Pill: Introduce pill{} extension to set extended Pill configuration
Also introduce the flavor concept which allows to specify what part of Kotlin project should be imported.
2018-05-15 16:29:45 +03:00
Dmitry Petrov
a57869993d Fix asserted cast in IrBuilderWithScope.irReturn 2018-05-15 15:43:56 +03:00
Dmitry Petrov
21dfee4565 psi2ir: inferred type for 'when' is Nothing only if it's exhaustive
TODO: fix inference bug
2018-05-15 15:43:56 +03:00
Dmitry Savvinov
70622ff668 Introduce -Xoutput-imports mode of JVM compiler
In this mode, instead of analyzing files and generating bytecode for
them, compiler just saves imports of each file in JSON map of form

'<path to file> -> [<import1>, <import2>, ...]'

It is needed for some external tools, notably for Google3 toolchain.
2018-05-15 15:36:14 +03:00
Mikhail Glukhikh
bec1ae3d94 Reformat: replace with operator assignment 2018-05-15 13:28:08 +03:00
Mon_chi
c49eaf2604 Fix hint text for replace with operator assignment #KT-23559 Fixed 2018-05-15 13:26:23 +03:00
Mikhail Glukhikh
8c3e787584 Convert KFunction to Function in type mismatch fixes #KT-16770 Fixed 2018-05-15 13:22:48 +03:00
Mikhail Glukhikh
25609f1159 Create kotlin file: create abstract class if its name contains Abstract
So #KT-21844 Fixed
2018-05-15 11:30:32 +03:00
Mikhail Glukhikh
1f8e24fa82 Reformat: NewKotlinFileAction 2018-05-15 11:30:30 +03:00
Mikhail Glukhikh
c61b5671c9 Fix testSuspend (protect it from flaky error about disabled coroutines) 2018-05-15 11:30:29 +03:00
Ilya Chernikov
0026a138d3 Add changelog from 1.2.40 - 1.2.41 2018-05-14 21:48:40 +02:00
Ilya Gorbunov
1d0d801744 Minor merge cleanup: remove unused variable 2018-05-14 18:24:31 +03:00
Ilya Gorbunov
864f0fecf6 KT-24353 Include kotlin-test-junit5 into coreLibraries, use JDK_18 to build and test it 2018-05-14 17:37:06 +03:00
evgzakharov
634279621d KT-24353 change junit5 version to minimal possible (5.2.0 -> 5.0.0)
However use the latest version of junit engine for running tests.
2018-05-14 17:36:34 +03:00
evgzakharov
84ee97cae9 KT-24353 add support for junit 5 in kotlin.test 2018-05-14 17:36:34 +03:00
Simon Ogorodnik
6967028fdb KT-24146: Fix inserts imports automatically
Even if "add unambiguous imports on the fly" is off

 #KT-24146 fixed
2018-05-14 17:28:16 +03:00
Denis Zharkov
9de174959e Support androidx under-migration-like nullability annotations
They are hardcoded to avoid having dependency from android.jar on
our annotations' jar with UnderMigration.

Even while it could be a compile-only dependency we need to make sure
that annotated types are read properly without RecentlyNonNull/RecentlyNullable
in the classpath

 #KT-24278 Fixed
2018-05-14 17:16:15 +03:00
Denis Zharkov
e0f09e5571 Minor. Reformat signature enhancement parts 2018-05-14 17:16:15 +03:00
Igor Chevdar
6daabca90b Fixed forgotten receivers during copying 2018-05-14 16:01:13 +03:00
Natalia Selezneva
4ee41d502a Scratch: report errors at the correct line
^KT-24364 Fixed
2018-05-14 15:55:44 +03:00
Natalia Selezneva
6427c79110 Trim last newline in scratch output with REPL
^KT-24362 Fixed
2018-05-14 15:55:39 +03:00
Natalia Selezneva
02fa8b5bab Check for dumb mode before compiling scratch file
^KT-23560
2018-05-14 15:55:35 +03:00
Natalia Selezneva
57b24007ac Log exceptions thrown during Run Scratch Action 2018-05-14 15:55:30 +03:00
Natalia Selezneva
5148a51ea2 Minor: reformat 2018-05-14 15:55:26 +03:00
Nicolay Mitropolsky
31b21a7bc8 182: compilation fix due to quickFixActionMarkers made nullble 2018-05-14 15:05:03 +03:00
Ilya Chernikov
b3219cb762 Implement lazy script definition and light discovery in cli plugin, ...
update appropriate parts of the scripting infrastructure
2018-05-14 11:13:44 +02:00
Dmitry Petrov
0feb50021c IrClass.isInner 2018-05-14 10:37:27 +03:00
Natalia Selezneva
1e92dbf806 Fix tests: attach script reports in cli 2018-05-14 09:21:09 +03:00
Ilya Chernikov
f89d5e94c5 Fix build in 182 branch 2018-05-13 10:59:47 +02:00
Ilya Chernikov
c74924fb8c Fix lz4 dependency...
after snappy was replaced by lz4 in the platform (see the previous commit
with related test for the more info)
2018-05-12 19:02:04 +02:00
Alexey Tsvetkov
38ffd6f85e Add test for missing lz4 dependency
Adds Gradle test for the exception:
`java.lang.ClassNotFoundException: net.jpountz.lz4.LZ4Factory`

The exception breaks IC in Gradle. Gradle compiles non-incrementally as
a fallback strategy, so the build succeeds, but IC is not working.

IC uses persistent hash tables from Intellij as caches.
These tables's buffers are compressed when full.
Previously snappy was used for compression, but 181 platform switched to
LZ4, which was cut out by proguard.

The problem could only be reproduced with Gradle,
since in JPS plugin all caches are managed by JPS process,
which contains the necessary library.

To reproduce the compiler needs to be processed by proguard
(which always happens on TeamCity).
Many classes are needed to trigger the compression.
2018-05-12 19:02:04 +02:00
Vyacheslav Karpukhin
e329af0932 Excluded declarations for classes in CIDR plugin.xml 2018-05-11 19:43:21 +02:00
Zalim Bashorov
0ca6dbcb82 [JS IR BE] remove no longer needed descriptor based utils 2018-05-11 20:27:54 +03:00
Roman Artemev
c9b8aadfff Update test data 2018-05-11 18:50:41 +03:00
Natalia Selezneva
4ee0f401c6 Fix master_172
Remove GradleScriptDefaultDependenciesProvider as unused
2018-05-11 18:46:54 +03:00
Mikhail Glukhikh
1012bdb577 Convert to primary constructor: minor enhancement (KT-19629) 2018-05-11 18:17:42 +03:00
Mikhail Glukhikh
67d2abbe5e Reformat: Convert to primary constructor 2018-05-11 17:36:41 +03:00
Toshiaki Kameyama
a41064295b "Convert to primary constructor": do not move init section down
So #KT-19629 Fixed
2018-05-11 17:36:40 +03:00
Mikhail Glukhikh
9a1253c5c7 Specify type explicitly: suggest also types from overridden
So #KT-22092 Fixed
2018-05-11 17:36:38 +03:00
Mikhail Glukhikh
bf15d22ef1 Reformat: SpecifyTypeExplicitlyIntention 2018-05-11 17:36:37 +03:00
Mikhail Glukhikh
13be7803bb Introduce "redundant async" inspection #KT-24235 Fixed 2018-05-11 17:36:35 +03:00
Mikhail Glukhikh
365c13c38e Extract AbstractCallChainChecker from SimplifiableCallChainInspection 2018-05-11 17:36:29 +03:00
Mikhail Glukhikh
9fa352e5c0 Reformat: simplifiable call chain inspection 2018-05-11 17:36:26 +03:00
Pavel V. Talanov
a584de8a7e Prefer platform specific declarations when searching for library sources
Untested: test infrastructure needed

 #KT-23223 Fixed
2018-05-11 16:25:16 +02:00
Pavel V. Talanov
f6b094781f Mpp resolve: ignore module dependencies on libraries of other platforms
These are not read by the compiler

Untested: test infrastructure needed

 #KT-20406 Fixed
2018-05-11 16:25:14 +02:00
Roman Artemev
24e477c378 Update test data 2018-05-11 17:14:30 +03:00
Roman Artemev
131fb642aa Fix initializer lowering crash during deep copy 2018-05-11 17:14:30 +03:00
Toshiaki Kameyama
449943da01 "Merge with next when": made applicable when delimited by ';' or comment
So #KT-12042 Fixed
2018-05-11 16:37:36 +03:00
Toshiaki Kameyama
cdbd7a7c5a Reformat MergeWhenIntention 2018-05-11 16:36:57 +03:00
Toshiaki Kameyama
4ee9db7a6c Use property access: suppress for reserved words #KT-23775 Fixed 2018-05-11 16:32:44 +03:00
Toshiaki Kameyama
240b9fd97a Reformat: UsePropertyAccessSyntaxIntention 2018-05-11 16:32:06 +03:00
Derek
c12bd9b506 fix gradle license path (#1658) 2018-05-11 16:08:40 +03:00
Alexey Sedunov
805010e75c Misc: Permit refactorings/intentions/quick fixes inside script files
#KT-20123 Fixed
2018-05-11 16:05:20 +03:00
Alexey Sedunov
a5a13b74f5 Create from Usage: Support smart casts on explicit receivers
#KT-24069 Fixed
2018-05-11 16:05:20 +03:00
Alexey Sedunov
a92a4a2a6d Add Parameter Fix: Support smart casts
#KT-24207 Fixed
2018-05-11 16:05:19 +03:00
Alexey Sedunov
a4a10c7ba4 Create from Usage: Fix generation of extensions with nullable receiver
#KT-23796 Fixed
2018-05-11 16:05:19 +03:00
Alexey Sedunov
4e3c1e9f56 Rename: Do not search text occurrences of local declarations
#KT-23838 Fixed
2018-05-11 16:05:19 +03:00
Derek
f8111c9f23 fix bullet point indentation in license readme (#1659) 2018-05-11 16:04:45 +03:00
Sergey Igushkin
2a46648e3e In Android MPP target, add common module dependency to api configuration
Since Android considers the `compile` configuration as deprecated and
reports a warning when a dependency is added to it, use the `api`
configuration when dealing with an Android platform module.

Issue #KT-23719 Fixed
2018-05-11 16:03:33 +03:00
Natalia Selezneva
37d7c36b11 Fix missing internal template declaration in plugin.xml 2018-05-11 15:51:52 +03:00
Natalia Selezneva
9535c82149 Backport ScriptSeverity.FATAL to old script API
(cherry picked from commit dceb063)
2018-05-11 15:51:47 +03:00
Natalia Selezneva
41653e9a50 Introduce separate cache for scripts
^KT-22588 Fixed
2018-05-11 15:51:42 +03:00
Natalia Selezneva
71703636bc Optimization: do not load dependencies for scripts not under expected location 2018-05-11 15:51:37 +03:00
Natalia Selezneva
61c31ce030 Refactoring: move logic that script shouldn't be highlighted if there are any FATAL error to KotlinHighlightingUtil 2018-05-11 15:51:33 +03:00
Natalia Selezneva
3cc3ca97ac Show notification in the editor when new script dependencies available
^KT-23616 Fixed
2018-05-11 15:51:28 +03:00
Natalia Selezneva
d422eb6833 Add a delay to reload script dependencies
^KT-23616
2018-05-11 15:51:24 +03:00
Natalia Selezneva
3eac391793 Add setting to reload script dependencies on file change
^KT-23616
2018-05-11 15:51:19 +03:00
Natalia Selezneva
082916be70 Refactoring of ScriptDependenciesUpdater
Extract classes for sync and async dependencies loading
2018-05-11 15:51:14 +03:00
Natalia Selezneva
97848f2812 Minor: reformat 2018-05-11 15:51:09 +03:00
Natalia Selezneva
3f8245988e Remove GradleScriptDefaultDependenciesProvider as unused 2018-05-11 15:51:04 +03:00
Florian Steitz
8453ed1803 [KT-10456] Move tests from StringNumberConversionJVMTest to StringNumberConversionTest 2018-05-11 15:42:11 +03:00
Florian Steitz
d7bada0c29 [KT-10456] Added JS implementation for Int.toString(radix) and similar overloads 2018-05-11 15:42:11 +03:00
Sergey Igushkin
284b5b9860 (minor fix) Remove extra underscore from module names 2018-05-11 15:37:17 +03:00
Vyacheslav Karpukhin
d56ba1e7a4 Excluded declarations for classes in CIDR plugin.xml 2018-05-11 13:28:22 +02:00
Nicolay Mitropolsky
05be8f7536 UastKotlinPsiVariable: hashCode nullability fix (EA-119715) 2018-05-11 12:57:23 +03:00
Nikolay Krasko
bea77900ff Fix NPE in KotlinCompletionCharFilter (EA-120148) 2018-05-11 12:00:43 +03:00
Nikolay Krasko
c469a4d9b9 Bad condition for cast in KotlinStatementsSurrounder (EA-119701) 2018-05-11 12:00:43 +03:00
Nikolay Krasko
9e2412b887 Create dummy method for light class without reformat (EA-115803) 2018-05-11 12:00:43 +03:00
Nikolay Krasko
c9f31099f2 Fix binary compatibility issue after moving ModuleTestSourceInfo
Compatibility check revealed problem in truth-postfix-plugin.

b06adbf4e6/plugin/src/main/kotlin/com/github/droibit/plugin/truth/postfix/utils/TemplateUtils.kt
2018-05-11 12:00:43 +03:00
Roman Artemev
d71ff1818d Add test 2018-05-11 11:33:23 +03:00
Roman Artemev
455edae7de Fix name clashing between constructors in function reference lowering 2018-05-11 11:33:23 +03:00
Roman Artemev
4f2d5baa5d [KT-24335]
Fix inheritance from interface which is also inherited from an external interface
Add test case
2018-05-11 11:26:34 +03:00
Dmitry Petrov
93f5fe2451 IrField is 'final' if corresponding property is 'val' 2018-05-11 11:24:46 +03:00
Dmitry Petrov
d83849eec5 IR: IrValueSymbol.owner: IrValueDeclaration 2018-05-11 11:24:46 +03:00
Dmitry Petrov
1592aa499f IR: IrFunctionSymbol.owner: IrFunction
This requires some class hierarchy juggling around
IrFunction and IrReturnableBlock.
2018-05-11 11:24:46 +03:00
Dmitry Petrov
f500329dac IR: IrFunction.name 2018-05-11 11:24:46 +03:00
Dmitry Petrov
729efaf912 IR: IrConstructor.isPrimary
NB this is required for Kotlin/JS.
2018-05-11 11:24:46 +03:00
Dmitry Petrov
a6057fb499 IR: {IrClass, IrFunction, IrProperty, IrField}.isExternal 2018-05-11 11:24:46 +03:00
Dmitry Petrov
9717345e3b IR: IrField.isFinal 2018-05-11 11:24:46 +03:00
Vyacheslav Gerasimov
9721ca8d09 as32: Update compiler.pro for AS 3.2 C14 2018-05-10 23:28:42 +03:00
Nikolay Krasko
6f6237aedb Unneeded bunch file for autowiredConstructor.test in 172 2018-05-10 23:28:41 +03:00
Nikolay Krasko
4e26b04bb2 Remove unneeded files after move to 181 from 173 2018-05-10 23:28:41 +03:00
Vyacheslav Gerasimov
c1f5ebb28e as32: Fix usages of AppResourceRepository in AS 3.2 C14 plugin 2018-05-10 23:28:41 +03:00
Vyacheslav Gerasimov
4adc0a94ab as32: Update to 181 platform api 2018-05-10 23:28:41 +03:00
Vyacheslav Gerasimov
ab25145458 as32: Restore uast to 181 platform state 2018-05-10 23:28:41 +03:00
Vyacheslav Gerasimov
daa860651f as32: Update AS 3.2 version to 3.2.0.13 2018-05-10 23:28:41 +03:00
Alexey Tsvetkov
c026c7f24b Filter out non-Java files from kapt inputs
#KT-23878 fixed
2018-05-10 22:01:06 +03:00
Alexey Tsvetkov
5f3c57e69a Filter out generated Java files from stubs generation inputs 2018-05-10 21:58:35 +03:00
Anton Bannykh
23fb5107c7 JS: fix Long inlining (private, companion) (KT-24189 fixed). 2018-05-10 21:06:50 +03:00
Toshiaki Kameyama
da92c844a6 Might be 'const': fix false positive in object literal #KT-23756 Fixed 2018-05-10 20:42:32 +03:00
Mikhail Glukhikh
84d71e5a8c "Wrap with let": minor enhancement (related to KT-6364) 2018-05-10 20:41:53 +03:00
Toshiaki Kameyama
b6564ed19a "Wrap with let": fix for nullable extension function call #KT-6364 Fixed 2018-05-10 20:28:14 +03:00
Sergey Igushkin
093842932f Filter some characters out of module names passed to Kotlin from Gradle
This addresses the cases when a module name contains a slash
 (e.g. when the Gradle project name was set this way to point
Gradle to the directory), which led to Kotlin module file being placed
under a subdirectory of META-INF and thus undiscoverable for the
compiler and reflect.

Additionally, this fix removes characters \n, \r, \t whose
presence in a module name caused compilation failures.

Issue #KT-20608 Fixed
2018-05-10 19:17:03 +03:00
Mikhail Glukhikh
a8ad980910 If to when: label break / continue if necessary #KT-11427 Fixed 2018-05-10 18:46:24 +03:00
Mikhail Glukhikh
2812601e2d Reformat: add loop label 2018-05-10 18:46:18 +03:00
Mikhail Glukhikh
73a756084e Reformat: if to when 2018-05-10 18:46:17 +03:00
Ilya Gorbunov
d9d7b87fd9 Reformat kotlin.test library 2018-05-10 16:27:15 +03:00
Vyacheslav Gerasimov
06aaa990be Build: Exclude maven from CIDR plugin artifact 2018-05-08 21:49:08 +03:00
Vyacheslav Gerasimov
3d7f2f663f Build: Extract maven ide module from kotlin-plugin.jar to standalone jar 2018-05-08 21:49:08 +03:00
Vyacheslav Gerasimov
f666db74f9 Build: Exclude standalone kotlin compiler and jps from CIDR artifact 2018-05-08 21:49:08 +03:00
Vyacheslav Gerasimov
f2b323fbe3 Build: Extract jps-common ide module from kotlin-plugin.jar to standalone jar 2018-05-08 21:49:08 +03:00
Vyacheslav Gerasimov
4d4ff636d2 Build: Extract jvm ide module from kotlin-plugin.jar to standalone jar 2018-05-08 21:49:07 +03:00
Vyacheslav Gerasimov
80f5a1d44d Build: Exclude j2k from CIDR plugin artifact 2018-05-08 21:49:07 +03:00
Vyacheslav Gerasimov
282f2a46b1 Build: Exclude kapt from CIDR plugin artifact 2018-05-08 21:49:07 +03:00
Vyacheslav Gerasimov
42cfacdf0c Build: Extract j2k to standalone jar 2018-05-08 21:49:07 +03:00
Vyacheslav Gerasimov
8773e2d6f3 Build: Fix zipCidrPlugin destination file name, missed zip extension 2018-05-08 21:49:07 +03:00
Toshiaki Kameyama
3aab68d635 Add "Make variable immutable" quickfix for const #KT-24263 Fixed 2018-05-08 18:37:10 +03:00
Toshiaki Kameyama
d1c2ea4095 Reformat: QuickFixRegistrar 2018-05-08 18:37:10 +03:00
Toshiaki Kameyama
e26ab28d45 Reformat: ChangeVariableMutabilityFix 2018-05-08 18:37:10 +03:00
Mikhail Glukhikh
e141f4f407 Convert array to vararg: extract text variants to constants 2018-05-08 18:37:09 +03:00
Toshiaki Kameyama
da92eb63a0 Add intention replacing vararg with array and vice versa #KT-23419 Fixed 2018-05-08 18:37:09 +03:00
Mikhail Glukhikh
e933bb8220 Unused symbol suppression: get annotation descriptors via entries
Otherwise we miss use-site targeted annotations,
and getUseSiteTargetedAnnotations does not help
So #KT-20332 Fixed
2018-05-08 18:37:09 +03:00
Mikhail Glukhikh
59c019cb00 Reformat: unused symbol inspection 2018-05-08 18:37:08 +03:00
Mikhail Glukhikh
78ed39856e UnnecessaryVariableInspection: do not show dialogs #KT-22989 Fixed 2018-05-08 18:37:08 +03:00
Mikhail Glukhikh
39c0b57724 Reformat: UnnecessaryVariableInspection 2018-05-08 18:37:08 +03:00
Mikhail Glukhikh
de85235bd7 Reformat: KotlinInlineValHandler 2018-05-08 18:37:07 +03:00
Mikhail Glukhikh
5246c54dad Do not suggest removing empty parentheses if lambda is on the next line
So #KT-15195 Fixed
2018-05-08 18:37:07 +03:00
Mikhail Glukhikh
6968540889 Reformat: RemoveEmptyParenthesesFromLambdaCallIntention 2018-05-08 18:37:07 +03:00
Nicolay Mitropolsky
24b8d12eca 182: fixing SlicePanel compilation after isToShowCloseButton method removal 2018-05-08 18:35:04 +03:00
Ilya Chernikov
e727e20973 [minor] Improve daemon exceptions logging 2018-05-08 15:59:45 +02:00
Alexey Tsvetkov
89da660186 Replace assertContains with assertTasksExecuted/assertTasksUpToDate 2018-05-08 15:24:45 +03:00
Alexey Tsvetkov
f00e243822 Reformat :kotlin-gradle-plugin-integration-tests 2018-05-08 15:24:45 +03:00
Alexey Tsvetkov
39c000bb4d Add vararg overloads for Gradle test utils 2018-05-08 15:24:45 +03:00
Nicolay Mitropolsky
cf43be9fa3 UAST: replacing deprecated JvmDeclarationUElement with JvmDeclarationUElementPlaceholder (#KT-23887)
To make it possible to delete `JvmDeclarationUElement` in IDEA-182
2018-05-08 15:21:13 +03:00
Nikolay Krasko
7b80fb0431 Mark actions as internal to prevent "Other" group creation (KT-24268)
#KT-24268 Fixed
2018-05-08 13:04:27 +03:00
Nikolay Krasko
b19ad7e94c Reformat: idea.highlighter package 2018-05-08 13:04:27 +03:00
Nicolay Mitropolsky
732e25a3f0 KotlinElementActionsFactory: fix for getting names from dead pointers (EA-116215) 2018-05-08 12:57:29 +03:00
Mikhail Zarechenskiy
37a8844050 Update bunch files for kotlinInternalUastUtils
After 5815e790ba and d6405c8147
2018-05-08 12:03:17 +03:00
Mikhail Zarechenskiy
eee59cb23c Fix deserialization of inline functions from inline classes
This fixes:
 CompileKotlinAgainstInlineKotlinTestGenerated$InlineClasses.testInlineFunctionInsideInlineClassesBox 

 Consider the following binary dependency:

 inline class UInt(val u: Int) {
    inline fun foo() {}
 }

 Now, if we want to inline function `foo`, we have to load it from bytes
 as ASM method and to do this we should know the container of this function.

 Note that because of inline class, actual signature of this function
 would be `foo(I)` and it will be stored in UInt$Erased class, not `UInt`
2018-05-08 11:54:24 +03:00
Natalia Selezneva
7fe21f3035 Do not throw exception when script template doesn't have required annotation
^KT-23746 Fixed
2018-05-08 11:40:51 +03:00
Natalia Selezneva
522587dc5d Align checkbox labels in scratch panel
^KT-24315 Fixed
2018-05-08 11:40:51 +03:00
Natalia Selezneva
e5a40c8c7f Scratch: substring output and print it to separate tool window if it is too long
^KT-24016 In Progress
2018-05-08 11:40:51 +03:00
Natalia Selezneva
613ea94376 Allow reference search in scratches
^KT-23563 Fixed
^KT-23587 Fixed
2018-05-08 11:40:51 +03:00
Natalia Selezneva
db2bcff390 Restore scratch options after IDE restart
^KT-23441 Fixed
2018-05-08 11:40:51 +03:00
Natalia Selezneva
178dad3b4e Refactoring: introduce file attribute utils 2018-05-08 11:40:51 +03:00
Natalia Selezneva
bed5a3c8f3 Scratch: find correct line to report error at
^KT-23480 Fixed
EA-117936 Fixed
2018-05-08 11:40:51 +03:00
Natalia Selezneva
62fadd9086 Scripts: GradleScriptTemplateProvider should be the first in the contributors list.
This is needed to avoid broking .gradle.kts support by external plugins
2018-05-08 11:40:51 +03:00
Dmitry Savvinov
58eb117ae1 Improve message of exception thrown from codegen
Don't lose information about which file caused crash.
2018-05-08 11:28:40 +03:00
Natalia Selezneva
47bafb8c75 Regenerate IntentionTestGenerated 2018-05-08 09:10:51 +03:00
Natalia Selezneva
1aecd2058c Fix testdata after 534cbae4ef
^KT-14391
2018-05-08 09:02:35 +03:00
Vyacheslav Gerasimov
838f1f91fc Build: Extract android ide modules from kotlin-plugin.jar to standalone jars
So we could exclude them in IDEs which don't have android plugin (AppCode, CLion)
2018-05-08 00:26:04 +03:00
Vyacheslav Gerasimov
ec1a9d9907 Move uast service registration to jvm.xml 2018-05-08 00:25:22 +03:00
Vyacheslav Gerasimov
da9175febd Build: Exclude uast and lint artifacts from CIDR plugin
There is no java in CIDR platform and java dependent modules should be excluded
2018-05-08 00:25:07 +03:00
Vyacheslav Gerasimov
e6f64519e4 Build: Copy uast to idea plugin as separate artifacts 2018-05-08 00:24:22 +03:00
Sergey Igushkin
8fda174fb0 Add the compiler classpath of the KotlinCompile task as KaptTask's input
KaptTask was not declaring the compiler classpath (which it takes from
compileKotlin task for calling the compiler) as input. This commit fixes
that and adds a test that checks compiler classpath input checks for the
kapt tasks.

Issue #KT-23879 Fixed
2018-05-07 15:55:55 +03:00
Sergey Igushkin
352fb4a1c8 Add a user-friendly report that the JDK tools are missing
Issue #KT-20214 Fixed
2018-05-07 15:47:11 +03:00
Mikhail Zarechenskiy
50116fd8fc Fix coercion result for inline classes, add comment 2018-05-07 15:25:48 +03:00
Mikhail Zarechenskiy
b25a1d9522 Support inline functions inside inline classes 2018-05-07 15:25:46 +03:00
Mikhail Zarechenskiy
5c57c799fc Fix generation of elvis with null constant for inline classes 2018-05-07 15:25:45 +03:00
Mikhail Zarechenskiy
043c3d9a97 Prohibit properties with backing fields inside inline classes 2018-05-07 15:25:43 +03:00
Mikhail Zarechenskiy
29d15b9990 Prohibit varargs on parameters of inline class types 2018-05-07 15:25:42 +03:00
Mikhail Zarechenskiy
d3c1c11dc5 Prohibit initializer blocks inside inline classes 2018-05-07 15:25:40 +03:00
Mikhail Zarechenskiy
6a120d2f85 Require presence of public primary constructor for inline class 2018-05-07 15:25:38 +03:00
Mikhail Zarechenskiy
096fe1c411 Don't report diagnostics on the whole declaration, use main keyword 2018-05-07 15:25:37 +03:00
Mikhail Zarechenskiy
ed4fd2bb2f Mark inline classes feature as experimental 2018-05-07 15:25:35 +03:00
Mikhail Zarechenskiy
71de2e3265 Report diagnostics for inline classes even if the feature is unsupported
This would help for those who use inline classes by suppressing error
 about unsupported feature
2018-05-07 15:25:34 +03:00
Mikhael Bogdanov
8834ea74f2 Revert "Don't generate reified inline function as privates"
This reverts commit 56859f7
2018-05-07 14:14:07 +02:00
Mikhael Bogdanov
56859f7b87 Don't generate reified inline function as privates
#KT-18563 Fixed
2018-05-07 12:49:31 +02:00
Mikhael Bogdanov
99284316d6 Don't shrink psi utils class
Shrinker removes all unused private methods
 that could be reified inline functions

 #KT-23402 Fixed
2018-05-07 12:19:09 +02:00
Toshiaki Kameyama
534cbae4ef KT-14391 RemoveUnnecessaryParenthesesIntention lost comment
on closing parenthesis

 ^KT-14391 Fixed
2018-05-07 12:40:57 +03:00
Alexander Udalov
143c3ccb95 Disallow usages of experimental markers as qualifiers
Only allow explicit imports of markers, but not of nested classes
declared in them
2018-05-07 11:37:31 +02:00
Alexander Udalov
d27657e8f6 Minor, move loadWasExperimentalMarkerClasses closer to usage 2018-05-07 11:37:31 +02:00
Alexander Udalov
2fea2135f8 Add TYPEALIAS target to UseExperimental 2018-05-07 11:37:31 +02:00
Alexander Udalov
7d74508529 Report experimental diagnostics on inaccessible (wrt SinceKotlin) API
If a declaration is annotated both with SinceKotlin and WasExperimental
and the SinceKotlin version makes it inaccessible, the experimental
checker must regard it as experimental, with markers specified in the
WasExperimental annotation arguments. So only errors/warnings about the
experimentality are going to be reported in this case, and no error that
the declaration is unavailable because of a low API version
2018-05-07 11:37:31 +02:00
Alexander Udalov
1f0d3d9c7c Load WasExperimental values correctly for associated declarations
For example, if a class is `@SinceKotlin("X")
@WasExperimental(M::class)`, then its constructor should also be
accessible if API < X, provided that the opt-in to M is given
2018-05-07 11:37:31 +02:00
Alexander Udalov
9995438b37 Forbid non-intended usages of Experimental and markers
Experimental and UseExperimental can only be used as annotations or
qualifiers (to allow "Experimental.Level.*"); experimental markers can
only be used as annotations or qualifiers, or as left-hand side of a
::class literal in arguments to UseExperimental/WasExperimental.

This is needed because we're not yet sure of the design of this feature
and would like to retain the possibility to drop these declarations
(Experimental, UseExperimental) altogether. If they were going to be
used as types, it would be problematic because we can't simply delete
something from stdlib, should deprecate it first. With this change,
these declarations can only be used if the user has opted into using the
experimental API somehow (for example, with
`-Xuse-experimental=kotlin.Experimental`), so we won't stop conforming
to our deprecation policy if we decide to remove these declarations in
the future
2018-05-07 11:37:31 +02:00
Alexander Udalov
ed6f044fb0 Add internal WasExperimental for stdlib
Usages of declarations annotated with WasExperimental are allowed even
if the API version requirement is not satisfied, provided that the
opt-in to all mentioned markers is given. This is needed for smooth
graduation of API in kotlin-stdlib
2018-05-07 11:37:31 +02:00
Alexander Udalov
fdc4313860 Minor, fix bodyUsagesAndInline.kt test data 2018-05-07 11:37:31 +02:00
Ilmir Usmanov
fad5596ef9 Minor: remove builtins from kotlin-stdlib-coroutines.jar 2018-05-07 10:34:50 +03:00
Ilmir Usmanov
5e4ce4f880 Remove coroutineContext from kotlin.coroutines.experimental.intrinsics package
#KT-22400: Fixed
2018-05-07 10:28:54 +03:00
Mikhail Zarechenskiy
54ca2cbbe0 Introduce original for ReceiverValue and use it inside coroutine checker 2018-05-04 19:54:14 +03:00
Mikhail Zarechenskiy
b23e9f771b [NI] Fix checking for the same instance inside for suspend functions 2018-05-04 19:53:54 +03:00
Mikhail Zarechenskiy
64b10d827d [NI] Refactoring: rename NonFixedType -> StubType 2018-05-04 19:08:22 +03:00
Mikhail Zarechenskiy
5187f6b060 [NI] Improve performance of resolution part for postoned variables 2018-05-04 19:08:21 +03:00
Mikhail Zarechenskiy
a30a1f2a96 [NI] Update calls after inference for coroutines 2018-05-04 19:08:21 +03:00
Mikhail Zarechenskiy
99a95f31d3 [NI] There is no need in copying constraint storage as it read-only 2018-05-04 19:08:20 +03:00
Mikhail Zarechenskiy
e0ca3421ca [NI] Use only receiver from coroutine call to mark postponed variable 2018-05-04 19:08:20 +03:00
Mikhail Zarechenskiy
59c4b9ad2f [NI] Make it possible to use nullable non-fixed type 2018-05-04 19:08:20 +03:00
Mikhail Zarechenskiy
9209222112 [NI] Introduce inference for coroutines and builder-like constructions 2018-05-04 19:08:19 +03:00
Mikhail Glukhikh
54fc846dea Minor: fix parcel test (related to KT-21129) 2018-05-04 18:16:57 +03:00
Mikhail Glukhikh
e76debb12b Report UNUSED_PARAMETER in setter #KT-21129 Fixed 2018-05-04 18:04:57 +03:00
Mikhail Glukhikh
bcc1c02e73 Cleanup: constructor consistency checker 2018-05-04 17:53:00 +03:00
Mikhael Bogdanov
643e4f5c5a Get rid of descriptors in TailrecLowering 2018-05-04 16:35:44 +02:00
Mikhael Bogdanov
dc68936e69 Get rid of descriptors in StaticDefaultFunctionLowering 2018-05-04 16:35:44 +02:00
Mikhael Bogdanov
489808ec38 Get rid of descriptors in PropertiesLowering 2018-05-04 16:35:43 +02:00
Mikhael Bogdanov
17e2f1a61e Get rid of descriptors in LateinitLowering 2018-05-04 16:35:42 +02:00
Mikhael Bogdanov
74fa7ee676 Minor. Code clean 2018-05-04 16:35:42 +02:00
Mikhael Bogdanov
fdbc863e60 Minor. Reformat 2018-05-04 16:28:12 +02:00
Sergey Igushkin
e82170a04e Tracks and match source sets for MPP after the plugins are applied
Since the custom source sets may be added after the plugins are applied in both common and platform module, we need to handle `.all { ... }` source sets in both modules and add common sources to the platform module once a match is found.

Issue #KT-22510 Fixed
2018-05-04 15:37:08 +03:00
Dmitry Savvinov
97d455729b Add -Xdump-perf 2018-05-04 15:00:43 +03:00
Dmitry Savvinov
9996a1bc7e Rewrite performance statistics collection
This commit introduces notion of 'PerformanceManager' in CLI, suitable
for collecting performance metrics of the compiler. It:

- provides `notifyX{Started/Finished}` API, where 'X' is some
measurable event (previously there were just ad hoc manual time
measurements using System.nanoTime() and stuff)

- collects measurements, so that later they can be reported in an
appropriate way (previously measurements were reported immediately to
MessageCollector as plain strings)

- allows overriding to collect metrics, specific for just one target
platform compilation

Also, common logic of compiler performance statistics collection was
extracted from platform-compilers (K2JVMCompiler) to common classes
(CLICompiler), to allow other platform-compilers (e.g. K2JSCompiler)
re-use it.
2018-05-04 15:00:43 +03:00
Dmitry Savvinov
c3745c9040 Drop -Xrepeat flag
This flag hadn't been maintained for a long time and isn't working
properly at the moment.
2018-05-04 15:00:43 +03:00
Dmitry Savvinov
e3073be726 Minor: reformat KotlinToJvmBytecodeCompiler 2018-05-04 15:00:43 +03:00
Alexander Udalov
c57864e46c Require "-Xuse-experimental=kotlin.Experimental" on usages of Experimental
Since we're not yet sure of the design of Experimental/UseExperimental,
we're making them "experimental" themselves in some sense, in that the
user is required to provide the magic argument
"-Xuse-experimental=kotlin.Experimental" to be allowed to use either
Experimental or UseExperimental. This is more convenient than the
previous approach of "-language-version 1.3
-Xskip-metadata-version-check" because it's simpler and does not cause
pre-release binaries to be produced
2018-05-04 13:48:24 +02:00
Alexander Udalov
2a61d42fc1 Refactor and simplify ExperimentalUsageChecker 2018-05-04 13:48:24 +02:00
Alexander Udalov
4f53a54115 Drop Experimental.Impact, simplify related code and tests
See https://github.com/Kotlin/KEEP/issues/95#issuecomment-383889404

Drop Experimental.changesMayBreak, Experimental.Impact, the concept of
signature/body usage, same module exemption. Make the majority of tests
single-module because there is now no difference in the checker between
usages from the same module or from another module
2018-05-04 13:48:24 +02:00
Alexander Udalov
1719eecb67 Minor, init slice debug names for FilesByFacadeFqNameIndexer 2018-05-04 13:48:24 +02:00
Mikhael Bogdanov
12ba1b002c Refactor SharedVariablesManager: get rid of descriptors in API 2018-05-04 12:33:44 +02:00
Mikhael Bogdanov
f1c0db346a Code clean 2018-05-04 12:33:35 +02:00
Sergey Rostov
9fafe0473c jps (refactor): reimplement KotlinModuleBuildTarget data binding using CompileContext 2018-05-04 11:14:45 +03:00
Sergey Rostov
91b703d529 jps: common modules metadata compiler
(cherry picked from commit cde333d)
2018-05-04 11:05:13 +03:00
Sergey Rostov
41dcc9ad4d jps: minor: refine kotlin.jps.model package
(cherry picked from commit 2a31e78)
2018-05-04 11:05:12 +03:00
Sergey Rostov
a390fc36e2 jps: Refactor module/project settings getters/setters
(cherry picked from commit d29ffa0)
2018-05-04 11:05:12 +03:00
Sergey Rostov
75e6be7802 jps(refactor): Extract platform related code
#KT-23656 Fixed

(cherry picked from commit 18a751d)
2018-05-04 11:05:12 +03:00
Ilya Chernikov
22439250e2 Use kts file extension instead of kt in tests...
since all "kt" files are now considered - definitely non-scripts
2018-05-03 22:15:10 +02:00
Ilya Chernikov
24e8e7c40d Eliminate script dependencies queries for non-scripts 2018-05-03 22:15:10 +02:00
Ilya Chernikov
d4070cc4d7 Return null on directories in script definition wrappers for files 2018-05-03 22:15:10 +02:00
Ilya Chernikov
9eab7a627d Add script API libs sources to the IDEA plugin 2018-05-03 22:15:10 +02:00
Alexander Udalov
64f5c2c9a3 Refactor and simplify AbstractCustomScriptCodegenTest
Remove copy-paste, use CodegenTestCase's infrastructure as much as
possible, use InTextDirectiveUtils instead of regexps
2018-05-03 22:15:10 +02:00
Alexander Udalov
c48bb9c981 Minor, drop unused parameter in CodegenTestCase, add testJdkKind 2018-05-03 22:15:10 +02:00
Ilya Chernikov
48cf0bd949 Fixes and refactorings after review 2018-05-03 22:15:10 +02:00
Ilya Chernikov
dff4be9e04 Implement script environment variables in backend, add simple test 2018-05-03 22:15:09 +02:00
Ilya Chernikov
a9600e34bf Add test infrastructure for custom scripts testing, add receiver test 2018-05-03 22:15:09 +02:00
Ilya Chernikov
57db77a295 Refactor script infrastructure for easier usage and testability:
- add script annotation for specifying default configuration for a script
- add support for this annotation in the default configurator
- rename configurator accordingly
- add default implementation of the refineConfiguration method
- make property bag class open
2018-05-03 22:15:09 +02:00
Ilya Chernikov
516924cda1 Add support for script environment variables to the frontend 2018-05-03 22:15:09 +02:00
Ilya Chernikov
15f9ad9531 Implement quick non-script detection and lazy script discovery..
so ".kt" and ".java" files are not considered as scripts and quickly
filtered out, and for the other files the the checks are implemented
using sequences, mechanisms provided to supply script definitions
lazily, and script discovery is implemented using this mechanisms.
2018-05-03 22:15:09 +02:00
Ilya Chernikov
969340167f Apply scripting plugin in gradle plugin by default 2018-05-03 22:15:09 +02:00
Ilya Chernikov
a29411a211 Process script templates everywhere properly:
- add options to disable scripting plugin and standard script definition
- move standard definition adding logic into appropriate place
- fix logic of scripting plugin loading
- add standard script definition on the environment creation to
  ensure compatibility with all usages
- fix testdata
- some minor fixes
2018-05-03 22:15:09 +02:00
Toshiaki Kameyama
b5da48c566 Don't report suspicious callable reference on invoke with parameters
So #KT-23465 Fixed
2018-05-03 18:47:12 +03:00
Toshiaki Kameyama
13356d32fd Redundant SAM-constructor: highlight nested class name with outer class
So #KT-11156 Fixed
2018-05-03 18:32:44 +03:00
Toshiaki Kameyama
204c68070a Reformat RedundantSamConstructorInspection 2018-05-03 18:31:34 +03:00
Toshiaki Kameyama
c43311ba9a Move to constructor: change default use-site target: property -> field
So #KT-23801 Fixed
2018-05-03 18:12:11 +03:00
Toshiaki Kameyama
012227dd73 Reformat MovePropertyToConstructorIntention 2018-05-03 18:11:23 +03:00
Toshiaki Kameyama
633679ac16 Preserve comments in "Remove variable" quick fix #KT-23753 Fixed 2018-05-03 18:09:22 +03:00
Alexey Tsvetkov
61edfaced5 Speed up pill
Pill runs 10x faster on my machine after the change
2018-05-03 18:03:18 +03:00
Toshiaki Kameyama
66d738848b Convert foreach to for loop: place caret on the variable declaration
So #KT-7822 Fixed
2018-05-03 17:54:56 +03:00
Toshiaki Kameyama
3221fbdca9 Don't "Remove explicit type" for callable with function initializer
So #KT-12168 Fixed
2018-05-03 17:46:47 +03:00
Toshiaki Kameyama
5204c73bec Quick-fix "use spread operator": make working with mapOf #KT-14556 Fixed 2018-05-03 17:11:33 +03:00
Toshiaki Kameyama
a7110a1517 Add intention to indent a raw string #KT-9943 Fixed 2018-05-03 17:05:14 +03:00
Alexander Udalov
a2d45062c2 Fix another non-determinism in CommonSupertypes 2018-05-03 16:02:49 +02:00
Mikhail Glukhikh
e07f83ddbc "Redundant Unit" inspection: new tests, simplification & fixes
Related to KT-23977 and KT-24066
2018-05-03 16:12:20 +03:00
Toshiaki Kameyama
6e150d27f1 "Redundant Unit" inspection: fix for Unit returned as Any
So #KT-24066 Fixed
2018-05-03 16:12:19 +03:00
Toshiaki Kameyama
c44cab4565 "Redundant Unit" inspection: Fix for labeled return #KT-23977 Fixed 2018-05-03 16:12:19 +03:00
Mikhael Bogdanov
b4853d9293 Minor. Reformat 2018-05-03 12:04:47 +02:00
Mikhael Bogdanov
eefc49a617 Use symbols to find local declarations in codegen 2018-05-03 12:04:45 +02:00
Mikhael Bogdanov
f0e4420259 Don't recreate ir declarations to set body 2018-05-03 12:04:45 +02:00
Mikhael Bogdanov
35df7966cf Use symbols in IrGet/SetValue in JvmSharedVariablesManager 2018-05-03 12:04:32 +02:00
Mikhael Bogdanov
bb6c837f6b Use symbols in IrGet/SetValue in EnumClassLowering 2018-05-03 11:38:52 +02:00
Mikhael Bogdanov
5a2e62dd4f Use symbols in IrGet/SetValue 2018-05-03 11:38:50 +02:00
Mikhael Bogdanov
077f3a4ed2 Minor. Reformat 2018-05-03 11:27:57 +02:00
Mikhael Bogdanov
ed44327569 Properly set parents in JvmLower 2018-05-03 11:23:57 +02:00
Mikhael Bogdanov
e793a7eea7 Use symbols in synthetic accessor to access accessor parameters 2018-05-03 11:23:56 +02:00
Mikhael Bogdanov
92e02e35fc Convert FrameMap to Kotlin and extract base logic 2018-05-03 11:23:56 +02:00
Mikhael Bogdanov
76bab8f3b0 Rename FrameMap.java to FrameMap.kt 2018-05-03 11:23:55 +02:00
Natalia Selezneva
49a1788728 Update testData after switching on kotlin internal mode in tests 2018-05-03 11:32:52 +03:00
Mikhail Zarechenskiy
5815e790ba Minor, use utility to get default type for number type constructor 2018-05-03 11:04:55 +03:00
Mikhail Zarechenskiy
d6405c8147 Fix exception on mapping internal types to UAST types with NI
#EA-119071 Fixed
2018-05-03 11:04:54 +03:00
Ilmir Usmanov
f507a26a12 Generate decomposed lambda params in suspend lambda's local variables
Unlike ordinary lambdas, suspend lambdas do the computation in
doResume(Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
method. As you can see, there are no decomposed parameters. As a result,
they used not to be generated.
To fix the issue, I add decomposed parameters to value parameters while
generating local variables table.

In addition, when generating suspend lambda for inline, the codegen
does not take this kind of parameters into account. This is also fixed.

 #KT-18576: Fixed
2018-05-03 10:35:13 +03:00
Alexander Udalov
712a796637 Fix MultiModuleHighlightingTestGenerated.testUseCorrectBuiltInsForCommonModule
Add dependency from a_jvm8 on stdlib. Otherwise, `getEmptyList` from
a_common was resolved to have an error return type
2018-05-02 16:56:54 +02:00
Alexander Udalov
ac4edbba5b Regenerate tests 2018-05-02 16:17:14 +02:00
Alexander Udalov
f59963ef73 Simplify test case on deterministic null-checks 2018-05-02 14:40:15 +02:00
Denis Vnukov
c5373c9029 Ensure deterministic insertion of checkExpressionValueIsNotNull.
Kotlinc source’s file DescriptorUtils.kt demonstarted non-deterministic
insertion of checkExpressionValueIsNotNull for value returned by
CallableDescriptor::getOriginal(). It was difficult to reproduce
this behavior on ф smaller example, but I added a test which was
failing once in 5-10 times while I was testing manually.

I believe this bug is close to KT-23704.

This PR addresses non-determinism to a degree when I can run 120
Compilations with './gradlew dist' and get same classes in all
jars in 'dist'.

NOTE that thew fact that insertion of checkExpressionValueIsNotNull may
depend on order of the types seems suspicios. This CL only addresses
non-determinism part, but I believe it’s worth looking into this more
from semantics point of view.
2018-05-02 14:36:04 +02:00
Alexander Udalov
10da41b136 Regenerate tests 2018-04-30 18:51:28 +02:00
Alexander Udalov
c63cd430d1 Fix no-arg constructor generation for actual class 2018-04-30 15:26:50 +02:00
Alexander Udalov
adb15d2d1a Do not report JvmOverloads warning on actual function with expected defaults
#KT-23910
2018-04-30 15:26:50 +02:00
Alexander Udalov
056c41bc00 Minor, improve kdoc of default args utilities in ArgumentsUtils.kt 2018-04-30 15:26:50 +02:00
Alexander Udalov
a8488cf298 Fix JvmOverloads generation for actual methods
`countDefaultParameters` uses `hasDefaultValue` to compute the number of
parameters which have default values, which handles actual parameters
(who have default values in the expected declaration) correctly. Thus,
`getRemainingParameters` should use it as well to determine the list of
parameters to be skipped in each generated overload

 #KT-23910 Fixed
2018-04-30 15:26:50 +02:00
Alexander Udalov
516e7df4b7 Reformat DefaultParameterValueSubstitutor, fix inspections 2018-04-30 15:26:49 +02:00
Nicolay Mitropolsky
efd743284e CommonIntentionActionsTest.testRemoveConstructorParameters test fix for 181, 182, as32 2018-04-29 11:48:28 +03:00
Nikolay Krasko
398795b832 Fix AddRequireModuleTest in 181
- Application is null before setUp call in individual run
- Inline "module.info.add.requires.family.name" as 181 has other constant
- isScriptDependenciesUpdaterDisabled call seems to be useless
2018-04-28 22:27:35 +03:00
Nikolay Krasko
af930b8364 Review and fix raw string quotes inserting and remove (KT-2582)
- Add more tests
 - Fix inserting close quotes after multiline string in file end
 - Use parent instead of parentOfType where possible
 - Add bunch files

 #KT-2582 Fixed
2018-04-28 22:27:34 +03:00
Steven Spungin
8252b35ed5 Add support for closing and deleting raw strings (KT-2582)
#KT-2582 Fixed
2018-04-28 22:27:34 +03:00
Nikolay Krasko
5216dfcc59 Add internal errors to test data in multi module tests
Tests started to fail after 82a21b3955.
2018-04-28 22:24:39 +03:00
Ilya Gorbunov
2c9c6eb746 Reformat stdlib: new coroutines 2018-04-28 18:58:56 +03:00
Mikhail Glukhikh
2854e6b7a1 Reformat: BranchedFoldingUtils 2018-04-28 18:44:29 +03:00
Toshiaki Kameyama
89981ecbbb Lift Assignment: process lambda assignments in when correctly
So #KT-23346 Fixed
2018-04-28 18:44:29 +03:00
Ilya Gorbunov
7438d12ad7 Move builtins generators to their own source set
Make them depend on bootstrap stdlib.
This is to prevent recompiling the entire project when we need just to
generate builtins sources.
2018-04-28 17:38:13 +03:00
Ilya Gorbunov
a704a1b6d0 Allow to create new sourcesets with our helper
New sourceSet is created if it doesn't exist, instead of being silently ignored.
Fix receiver of `none()`: it was applied on sourceSetName rather than on the sourceSet,
therefore it was a no-operation.
2018-04-28 17:35:30 +03:00
Denis Zharkov
8e1b0c5ab7 Optimize memory footprint for PartialBodyResolveFilter
There is a single PartialBodyResolveFilter instance per module
and each of them were containing just the same sets of available
in project Nothing-typed functions (including duplicating String instances),
in case of Kotlin project it might sum up to 27M of heap.

The solution is to share the global sets between all modules in a project
2018-04-28 17:12:52 +03:00
Denis Zharkov
26714d56d8 Use WeakKeySoftValueMap in ResolveElementCache
Otherwise results are effectively retained in the maps until we're close
to OutOfMemory.
While we mostly need them for a short time (especially in the case we
run resolution during usages search).

The possible problem is that the values may become too short-living,
but now using these maps is a conventional solution for similar tasks in
Java resolve
2018-04-28 17:12:52 +03:00
Denis Zharkov
96ab705de1 Use PsiField::computeConstantValue to avoid building AST 2018-04-28 17:12:52 +03:00
Denis Zharkov
bb45959470 Avoid switching to AST in CodegenAnnotatingVisitor for light classes 2018-04-28 17:12:52 +03:00
Denis Zharkov
2a713a972d Postpone computing AST when it's used only for reporting 2018-04-28 17:12:52 +03:00
Denis Zharkov
0788afe92c Avoid computing AST for IdentifierChecker
Basically, it's unnecessary to check anything when analysing stubs,
but it's complicated now to avoid that, so we just postpone
computing AST until reporting happens
2018-04-28 17:12:52 +03:00
Mikhail Glukhikh
6e8247f7cf Fix leaking this test in 181 branch 2018-04-28 15:46:37 +03:00
Roman Artemev
d9fdddceb9 Update test data 2018-04-27 20:02:59 +03:00
Roman Artemev
8bc80a9829 Fix secondary constructor lowering 2018-04-27 20:02:57 +03:00
Roman Artemev
8721990a7f Implement access to members of super class 2018-04-27 20:02:56 +03:00
Roman Artemev
cf31e544eb Implement default interface members 2018-04-27 20:01:45 +03:00
Roman Artemev
d861fb498f Implement string plus operator 2018-04-27 20:00:41 +03:00
Roman Artemev
01fea13467 Fix name clashing between local variables 2018-04-27 20:00:41 +03:00
Roman Artemev
997328f584 Refactoring and fixes 2018-04-27 20:00:40 +03:00
Roman Artemev
deab0a017b Add support for inner clases 2018-04-27 20:00:40 +03:00
Roman Artemev
746eb4b93e Implement object class in JS BE 2018-04-27 20:00:39 +03:00
Roman Artemev
17ee38a0b7 Refactor secondary constructor lowering using new builders 2018-04-27 20:00:38 +03:00
Roman Artemev
752cbf2714 Implemented KFunction interface 2018-04-27 20:00:32 +03:00
Roman Artemev
09c54f1da3 Add symbol & IR builders to JS backend 2018-04-27 19:53:47 +03:00
Roman Artemev
c1a4aeb67f Lift InnerClassesLowering from JVM to common since it is used by every backend in the same way 2018-04-27 19:53:47 +03:00
Roman Artemev
ed0c26ef07 Implement function literals in JS BE 2018-04-27 19:53:47 +03:00
Nikolay Krasko
c83ff5e75f Remove files introduced in 181 from 173 branch 2018-04-27 19:45:23 +03:00
Nikolay Krasko
6683e07112 181: [Tests] Revert "Allow different diagnostics in Javac tests - workaround for IDEA-184289"
It is fixed in 181
2018-04-27 18:29:57 +03:00
Vyacheslav Gerasimov
c16a5c2538 Switch .bunch file to 181 2018-04-27 18:25:23 +03:00
Vyacheslav Gerasimov
8c88ac69df Cleanup .181 bunch files 2018-04-27 18:25:21 +03:00
Vyacheslav Gerasimov
bc403ce744 Switch to 181 platform 2018-04-27 18:25:17 +03:00
Mikhail Glukhikh
df59af8ee8 Move sort modifiers test to inspection local group
This should fix test in 181 branch
2018-04-27 17:26:56 +03:00
Mikhail Glukhikh
8f0c53d0de If then to elvis: handle nullability even with implicit receiver
So #KT-22741 Fixed
2018-04-27 17:26:50 +03:00
Mikhail Glukhikh
49165bdbef Cleanup: better visibility 2018-04-27 17:26:37 +03:00
Mikhail Glukhikh
7601aaf89f Reformat IfThenToElvisIntention 2018-04-27 17:26:36 +03:00
Denis Zharkov
b75024e3e0 Fix memory leak related to diagnostics computation within light classes
Before this change, when somebody has requested the exact light class
we also store LazyJvmDiagnostic for it in a map inside DiagnosticHolder.

The problem is that LazyJvmDiagnostic retains a lot of memory:
GenerationState, bindingContext, etc.

At the same time, it commonly happens that light classes are being computed from Java resolve and diagnostics are obviously
unnecessary there.

The solution has two parts:
1. We don't retain diagnostics until somebody explicitly requested them
2. We force computation of LazyJvmDiagnostic to avoid retaining
backend's parts

The solution has a kind of drawback: for an opened in editor Kotlin file,
we'll run back-end twice for contained classes (analysis parts should be reused, though)

 #KT-24048 Fixed
2018-04-27 16:13:59 +03:00
Natalia Selezneva
26f1d6ae7c Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
2018-04-27 13:52:31 +03:00
Natalia Selezneva
9107ef6490 New Script File Action
^KT-10935 Fixed
2018-04-27 13:52:26 +03:00
Natalia Selezneva
1d8d1e847a Minor: add debug name for ErrorGradleScriptDefinition 2018-04-27 13:52:22 +03:00
Natalia Selezneva
ec63efec3c Debugger: refactor list of breakpoints for the line with lambdas.
^KT-24136 Fixed

Rename main line breakpoint to "Line"
Change icon for lambda-breakpoint
Move "all breakpoint" to the end of the breakpoints list
2018-04-27 13:52:06 +03:00
Nikolay Krasko
8bce29df3a Show plugin installation status in Kotlin Updates settings (KT-23980)
#KT-23980 Fixed
2018-04-27 13:08:28 +03:00
Nikolay Krasko
bf82da7584 Perform auto-check initial and checks after switching channels (KT-23980)
#KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko
64845ac3b7 Better UI for configure plugin updates (KT-23980)
- Control with Alt + Letter
 - Don't stretch channel combobox
 - Focus on label selection

 #KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko
748e213598 Move Kotlin update channel setting to settings dialog (KT-23980)
#KT-23980 Fixed
2018-04-27 12:16:37 +03:00
Nikolay Krasko
144c41576e Refactoring: inline KotlinInternalMode.enabled 2018-04-27 12:16:37 +03:00
Nikolay Krasko
82a21b3955 Move Kotlin internal actions to Internal menu and unify modes (KT-23975)
#KT-23975 Fixed
2018-04-27 12:16:36 +03:00
Ilya Chernikov
5af490f5e5 Remove script discovery files from example projects to avoid discovery problems:
- exception during loading of the definition with maven dependencies
- shading of the gradle script definition (if not fixed by the previous commit)

The discovery files should be restored after fixing/rewriting the discovery
and implementing definition prioritization in IDEA plugin
2018-04-27 09:03:15 +02:00
Ilya Chernikov
51888154e1 Change custom script examples file extensions:
fixes shadowing of the gradle script definitions after these example
script defs are loaded via discovery mechanisms
2018-04-27 09:03:15 +02:00
Ilya Gorbunov
ecf0d7ec0d Reformat stdlib tests and samples
#KT-5558
2018-04-27 05:28:57 +03:00
Ilya Gorbunov
add09e0f2e Reformat stdlib: js part
#KT-5558
2018-04-27 05:28:48 +03:00
Ilya Gorbunov
e3883d8d6d Reformat stdlib: jvm part
#KT-5558
2018-04-27 05:28:38 +03:00
Ilya Gorbunov
c53a2d57c3 Reformat stdlib: common code
#KT-5558
2018-04-27 00:50:16 +03:00
Ilya Gorbunov
ad43c0f4cb Reformat stdlib: collections
#KT-5558
2018-04-27 00:49:06 +03:00
Ilya Gorbunov
bea94d1d59 Update line numbers of inlined stdlib functions after updating copyright
This should not be needed, see KT-23862
2018-04-26 21:57:50 +03:00
Ilya Gorbunov
3354d44fce Fix false positives in CodeConformanceTest on identifiers like readCopyright 2018-04-26 21:57:50 +03:00
Ilya Gorbunov
ffc975550f Add/update copyrights in kotlin-stdlib-gen 2018-04-26 21:57:50 +03:00
Ilya Gorbunov
2e12834b6a Update copyrights in kotlin.test library
Change line number in StackTraceJVMTest due to the added copyright
2018-04-26 21:57:50 +03:00
Ilya Gorbunov
d3156c33be Update copyrights in builtin sources
Read copyright template from .idea/copyright/apache.xml profile
2018-04-26 21:57:50 +03:00
Ilya Gorbunov
502418e690 Put copyrights to the generated standard library sources
Read copyright template from .idea/copyright/apache.xml profile
2018-04-26 21:57:50 +03:00
Ilya Gorbunov
e21c235bbb Add or update copyrights in the standard library sources 2018-04-26 21:57:50 +03:00
Ilya Gorbunov
40cd02bba6 idl2k: read copyright from profile and put it in the generated files
Also reword autogenerated warning a bit.
2018-04-26 21:57:50 +03:00
Nicolay Mitropolsky
8e91f31182 UnimplementedKotlinInterfaceMemberAnnotator: use modifier list to be compatible with 172 2018-04-26 20:40:26 +03:00
Vyacheslav Gerasimov
72c9dc7d35 Build: Remove buildSrc/intellij-sdk/build.gradle.kts.182 2018-04-26 19:33:01 +03:00
Nicolay Mitropolsky
e8af8edf87 AnnotationUtil.kt.172 removed (should be equal to master) 2018-04-26 19:29:18 +03:00
Simon Ogorodnik
9e6cf5708e Fix J2K plain-text copy conversion test in 181 2018-04-26 17:37:29 +03:00
Mikhael Bogdanov
ec0b9aa343 Skip @JvmDefault in UnimplementedKotlinInterfaceMemberAnnotator
#KT-23967 Fixed
2018-04-26 15:36:42 +02:00
Mikhael Bogdanov
5efc9f2257 Revert "Get rid of 'BRIDGE' flag on $default functions"
Removed bridge flag triggers problem with Spring Boot: KT-23973
 This reverts commit cdcb651

 #KT-23973 Fixed
2018-04-26 15:36:42 +02:00
Pavel V. Talanov
a4e327c137 Mpp: KT-23457, fix importing common classes into common modules
Add test for KT-23457
NOTE: fixes 'importClassInCommon' test
Other test cases added to increase coverage

 #KT-23457 Fixed
2018-04-26 15:33:51 +02:00
Pavel V. Talanov
64a28dd542 QuickFixMultiModuleTest: fix test code
Adjust test data
2018-04-26 15:33:48 +02:00
Vyacheslav Gerasimov
c10c5a44d1 Remove exclusions from kotlin-stdlib dependency of published artifacts
Log warning about it, this is probably a project configuration bug and should be checked.
2018-04-26 16:11:56 +03:00
Denis Zharkov
003f381fcd Replace default-type dependencies to :kotlin-stdlib with distJar
Use distJar configuration instead.
It's necessary because currently when using default-type, subproject
starts having a transitive dependency to :kotlin-stdlib-common
and that leads to exception from KT-20897 when building light classes

This change might be reverted once KT-23942 is fixed

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

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

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

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

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

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

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

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

 #KT-23360 Fixed
2018-04-23 18:42:33 +02:00
Alexander Udalov
7bac9b62c7 Reformat VersionRequirement and move to 'metadata' 2018-04-23 18:42:33 +02:00
Alexander Udalov
361f686124 Move ModuleMapping and BinaryModuleData to metadata.jvm 2018-04-23 18:42:32 +02:00
Alexander Udalov
d0544a148a Minimize dependencies of ModuleMapping
Prepare it to be moved to metadata.jvm
2018-04-23 18:42:32 +02:00
Ilya Gorbunov
6b800c4230 Remove conditional-preprocessor compiler module 2018-04-23 19:05:13 +03:00
Ilya Gorbunov
2c74b91de4 Remove JvmVersion annotation and its usages 2018-04-23 19:05:13 +03:00
Dmitry Petrov
1eca402332 Use correctElementType to determine array element type for withIndex
Rather unkind "gotcha" in ASM API.

 #KT-23900 Fixed Target versions 1.2.50
2018-04-23 18:00:12 +03:00
Nikolay Krasko
5817a7fdac Prevent endless processing of problem pending events
If some pending event processing caused exception in PerModulePackageCacheService,
log the problem and consider event processed. Otherwise it is going to
be stuck there forever.
2018-04-23 16:41:14 +03:00
Nikolay Krasko
00119c309c Don't call findChild on invalid file in ImplicitPackagePrefixCache 2018-04-23 16:41:14 +03:00
Nikolay Krasko
3f6022d74e Don't show several lambda return inlay hints for elvis (KT-22436)
Don't show inlay hints on binary expression operands

 #KT-22436
2018-04-23 16:41:14 +03:00
Nikolay Krasko
2a7f195bbc Fix FoldingAfterOptimizeImportsTest for case-sensitive file systems
Broken in b6699d7522
2018-04-23 16:41:13 +03:00
Nikolay Krasko
d085f3e474 Don't call elementAtCaret for file usage test (fix for 181)
Fix testPropertyFileUsages test in 181.

Starting from 181, call `elementAtCaret` with zero offset returns
null element, when file starts with comment. Test fails because
of that.

fdebc4084b
2018-04-23 16:41:13 +03:00
Nikolay Krasko
ffca06d8a8 Drop specific behaviour in AbstractFindUsagesTest.kt for 172
It's OK to run find usages test under progress manager.
2018-04-23 16:41:13 +03:00
Nikolay Krasko
c6f8c868ce Minor: remove unused FIND_FILE_USAGES directive 2018-04-23 16:41:13 +03:00
Alexey Tsvetkov
2b4aa74c0b Add test cases for FQ-name parsing in IC 2018-04-23 15:03:42 +03:00
Leonid Startsev
01b40d4d02 Review fixes:
Use `StorageManager.createLazyValue` instead of default lazy delegate
Introduce `initialize` method instead of exposing type parameters
2018-04-23 14:39:17 +03:00
Leonid Startsev
666553e413 Add correct type parameter information to synthetic declarations
Needed by kapt due to https://github.com/Kotlin/kotlinx.serialization/issues/76
2018-04-23 14:39:17 +03:00
Alexey Tsvetkov
adc3e61742 Make assertion message more readable in JPS test
The test was failing recently on CI, but assertion message
does not give enough info: arrays' sizes are not equal,
so there were extra warnings, but what they were?
2018-04-22 23:05:59 +03:00
Nicolay Mitropolsky
06e65e5f48 182: removing Spring from Kotlin-Ultimate
because all necessary functionality is already in IDEA-Ultimate
2018-04-21 11:25:49 +03:00
Mikhail Glukhikh
00a9dea7cb KotlinAbstractUElement+KotlinUElementWithComments(172): add imports 2018-04-21 11:04:13 +03:00
Ilya Gorbunov
c239d346f7 Correctly indent upper bound separator in the generated stdlib code 2018-04-20 23:14:57 +03:00
Ilya Gorbunov
5381d0ed58 Move sequence operation classification higher than sample
Otherwise it gets eaten by that @sample tag.
2018-04-20 22:40:35 +03:00
Ilya Gorbunov
908d2d6975 Introduce kotlin-stdlib-generator dsl block for specifying sample reference 2018-04-20 22:40:35 +03:00
Mikhail Glukhikh
5dd7ff4d7f Up KotlinAbstractUElement / UElementWithComments / UVariable in branches 2018-04-20 21:29:55 +03:00
Mikhail Glukhikh
3e1d05f146 Update KotlinUMethod for 172/181/as32 branches 2018-04-20 21:23:05 +03:00
Pavel V. Talanov
521357a22d Add tests for KT-20824, KT-23745, KT-23124, KT-20605, KT-23760
#KT-20824 Fixed
 #KT-23745 Fixed
 #KT-23124 Fixed
 #KT-20605 Fixed
 #KT-23760 Fixed
2018-04-20 20:00:12 +02:00
Pavel V. Talanov
94fe170b7b MPP: analyze platform sources with expectedBy common sources
This allows to emulate current compiler behaviour

Introduce CombinedModuleInfo which is a combination of several other modules intended to be analyzed together
2018-04-20 20:00:11 +02:00
Pavel V. Talanov
94dfcba5c5 Minor: adjust quick fix test data to avoid "conflicting overloads" 2018-04-20 20:00:07 +02:00
Pavel V. Talanov
3949fc70c9 Adjust test data for previously ignored tests 2018-04-20 20:00:05 +02:00
Pavel V. Talanov
5ddb7c71d1 Mpp resolve: fix actual/expect declaration lookup
Previously we would look fo expect declaration in common dependencies
    as opposed to looking inside the module exclusively
2018-04-20 20:00:04 +02:00
Pavel V. Talanov
cdb49511e6 Mpp highlighting test: make generated, adjust test data
Note: this spawns new test cases which were ignored previously
2018-04-20 20:00:02 +02:00
Pavel V. Talanov
5a85f2437d Mpp test utils: allow to setup dependencies on stdlib and fulljdk
Allow to specify jjvm8 as platform
2018-04-20 20:00:00 +02:00
Mikhail Glukhikh
c69dd98c86 Build fix: quick-fix tests (forgotten actions) 2018-04-20 20:55:27 +03:00
Mikhail Glukhikh
a25e971d19 UAST: property delegates consistency #KT-22527 Fixed 2018-04-20 20:39:56 +03:00
Mikhail Glukhikh
f179b2ba13 Test for KT-22527 2018-04-20 20:39:54 +03:00
Mikhail Glukhikh
29c16f9561 Improve KotlinUElementWithComments & use it in most KotlinUElements
Related to KT-22135
2018-04-20 20:39:45 +03:00
J.T. Gilkeson
7a538accff Fix problem with trimEnd wiping out spans in SpannableStringBuilder
If I pass in a CharSequence with different spans, the original trimEnd using substring incorrectly wiped out the spans.
changing to subSequence correctly preserves the span data

#KT-23920 Fixed
2018-04-20 18:04:13 +03:00
Alexey Sedunov
36975786e8 Gradle: Import project dependency with non-default configuration by its artifacts 2018-04-20 16:57:43 +03:00
Dmitry Jemerov
2a684684a5 Pass canChangeWhitespaceOnly flag in reformat inspection
Otherwise IDEA will run preformat and postformat processors, which don't
expect to run outside of EDT (IDEA-185991)
2018-04-20 15:38:35 +02:00
Alexey Sedunov
38808118b1 Misc: Update test data for MavenUpdateConfigurationQuickFixTest (181/182) 2018-04-20 16:19:25 +03:00
Dmitry Petrov
54cf11fd0a Skip empty string entries when generating string template expression
#KT-19738 Fixed Target versions 1.2.50
2018-04-20 14:52:14 +03:00
Dmitry Petrov
22c2d8b563 Introduce a separate StackValue class for lateinit local vars
Local lateinit var differs in behavior from a simple local var,
and logic that relies of 'instanceof Local' checks assuming that all
instances of Local are simple local vars can produce faulty code
(as in KT-23260, where a local lateinit var was not explicitly put on
stack when passed as an argument to an inline function, thus causing
null propagation).

 #KT-23260 Fixed Target versions 1.2.50
2018-04-20 14:51:34 +03:00
Dmitry Petrov
7be4f5d31f Minor: reformat code in InlineCodegen 2018-04-20 14:51:34 +03:00
Nikolay Krasko
c86e157a48 Fix KotlinFileStructureTestGenerated in 181
Use common code for 173 and 181.
2018-04-20 14:37:02 +03:00
Nikolay Krasko
846a1a0179 Remove deprecated marker for JVM debugging in Kotlin code (KT-23886)
#KT-23886 Fixed
2018-04-20 14:37:01 +03:00
Nikolay Krasko
b6699d7522 Postpone analyze and remove direct working with BindingContext in folding
#KT-5206 Fixed
2018-04-20 14:37:01 +03:00
Aaron Nwabuoku
3a83983bfc Support code folding for standard library collection factory functions (KT-5206)
#KT-5206 Fixed
2018-04-20 14:37:01 +03:00
Mikhail Glukhikh
c4cdc0543d KT-23266 (forgotten change): modify plugin.xml for all branches 2018-04-20 13:17:06 +03:00
Mikhail Zarechenskiy
4f3fde2334 Regenerate tests 2018-04-20 13:06:22 +03:00
Mikhail Zarechenskiy
4a1c63cbbd [NI] Rename: isVariableReceiverForInvoke -> isForImplicitInvoke 2018-04-20 13:06:21 +03:00
Mikhail Zarechenskiy
397cc4f772 [NI] Support implicit invoke calls on parenthesized receivers 2018-04-20 13:06:21 +03:00
Mikhail Zarechenskiy
1e7682afc0 Minor, rename property according to the style 2018-04-20 13:06:20 +03:00
Mikhail Zarechenskiy
f039ec3625 Refactoring: get rid KotlinCallKind inside ResolutionKind 2018-04-20 13:06:20 +03:00
Alexey Sedunov
898105a5fa [REVERT/172] Test Support: Implement proper detection of existing TestNG configurations 2018-04-20 12:57:36 +03:00
Vyacheslav Gerasimov
0c6fb77637 Build: Set dependency on :dist for js.tests project test tasks 2018-04-20 11:35:55 +03:00
Vyacheslav Gerasimov
09a347b2d4 Disable assertion in RecompilableScriptFunctionData for js tests
which fails due to a bug in nashorn

 #KT-23637 Fixed
2018-04-20 11:35:42 +03:00
Ilya Gorbunov
481620ba32 Suppress dokka warnings for external classes exposing JS API to Kotlin
Usually MDN link in the class description is enough.
2018-04-20 06:39:01 +03:00
Swapnil Sankla
b93e385181 Add sample for setOf method
Ilya Gorbunov: Improve sample to illustrate stable iteration order and set equality.
2018-04-20 06:03:05 +03:00
Ilya Gorbunov
c5aed06110 Clarify docs for downTo and until 2018-04-20 05:25:31 +03:00
Ilya Gorbunov
501d969a38 Improve docs wording of zip function 2018-04-20 02:44:48 +03:00
Ilya Gorbunov
0eae27e03f Add samples for zip on sequences and strings 2018-04-20 02:00:36 +03:00
TakuyaKodama
2d4e591b5d Add samples for zip on arrays and collections
Write the sample references in the template and run the generator
2018-04-20 02:00:36 +03:00
Alexey Tsvetkov
137698d967 Minor: move BuildTimeReporter from buildSrc to report.gradle.kts 2018-04-19 21:03:32 +03:00
Ilya Gorbunov
b1f6ba703d Remove obsolete ant build scripts 2018-04-19 20:46:15 +03:00
Alexey Sedunov
48984fb3bf Maven: Support "javaParameters" tag in Kotlin/JVM configurations (181) 2018-04-19 19:11:54 +03:00
Alexey Sedunov
4819fc337d Misc: Fix dialog text for CallableRefactoring implementations
#KT-23778 Fixed
2018-04-19 19:06:48 +03:00
Alexey Sedunov
f69a807ae6 Change Signature: Fix original method info for Java method used in Kotlin
#KT-23714 Fixed
2018-04-19 19:06:48 +03:00
Alexey Sedunov
53a4baac8b Safe Delete: Do not replace SafeDeleteOverrideAnnotation for Java methods
#KT-23613 Fixed
2018-04-19 19:06:48 +03:00
Alexey Sedunov
4938825e19 Test Support: Implement proper detection of existing TestNG configurations
#KT-8407 Fixed
2018-04-19 19:06:48 +03:00
Alexey Sedunov
3b5227d6ea Maven: Support "javaParameters" tag in Kotlin/JVM configurations
#KT-23845 Fixed
2018-04-19 19:06:47 +03:00
Alexey Tsvetkov
7606cfd84f Print short build time summary after build 2018-04-19 18:23:10 +03:00
Claus Holst
84f0b327b1 KT-17608 Kotlin plugin says missing apply() call for SharedPreferences.Editor in With expression (#1164) 2018-04-19 16:29:27 +03:00
Alexey Sedunov
0f588955a9 Misc: Fix test data after updating to IDEA 181.3870.7 2018-04-19 15:27:56 +03:00
Zalim Bashorov
9c5e3ac629 Regenerate tests after rebase to master 2018-04-19 14:27:20 +03:00
Zalim Bashorov
d40b0b556c Regenerate tests after fix usages of IGNORE_BACKEND_WITHOUT_CHECK 2018-04-19 13:18:31 +03:00
Zalim Bashorov
09d5a0cb89 Fix usages of IGNORE_BACKEND_WITHOUT_CHECK 2018-04-19 13:17:28 +03:00
Zalim Bashorov
ad2ea8f999 Remove IGNORE_BACKEND_WITHOUT_CHECK and introduce DONT_RUN_GENERATED_CODE
Support DONT_RUN_GENERATED_CODE in JS Box tests.

IGNORE_BACKEND_WITHOUT_CHECK is removed because of
it's often wrongly used and in most cases can be
replaced with IGNORE_BACKEND or DONT_RUN_GENERATED_CODE
or with combination of them.
2018-04-19 13:17:28 +03:00
Zalim Bashorov
d03a128aa5 [JS IR BE] mute failed tests 2018-04-19 13:17:28 +03:00
Zalim Bashorov
ab03ab84bb Regenerate tests 2018-04-19 13:17:27 +03:00
Zalim Bashorov
a63b2e1bbd Some changes in test generating infrastructure:
* add separate run function for each test class to simplify and deduplicate generated code
* move the code that process IGNORE_BACKEND directive to the separate function, outside of generated code.
** it reduces size and complexity of a generated code
** it allows to mute and unmute tests w/o regenerate tests
* add an ability to generate IGNORE_BACKEND directive automatically, it's disabled by default
* add an ability to remove IGNORE_BACKEND directive automatically, it's enabled by default
* remove whitelists
2018-04-19 13:17:22 +03:00
Zalim Bashorov
4227d8e73a Remove accidentally left test classes: BytecodeTextTestGenerated and JsTypedArraysBoxTestGenerated 2018-04-19 13:17:22 +03:00
Zalim Bashorov
86fe2cc404 Minor: reformat DeprecatedSymbolUsageFixSpecialTest.kt 2018-04-19 13:17:21 +03:00
Toshiaki Kameyama
fee74273aa Invert if condition intention: do not remove line breaks #KT-11740 Fixed 2018-04-19 10:00:46 +03:00
Toshiaki Kameyama
dce5cb3ce9 Reformat InvertIfConditionIntention 2018-04-19 10:00:12 +03:00
Ilya Gorbunov
20b2277951 Minor: fix docs of internal getProgressionLastElement 2018-04-19 05:40:55 +03:00
Alexey Tsvetkov
701f96998a Remove unused SourceInfo interface 2018-04-19 05:18:54 +03:00
Alexey Tsvetkov
87558873b5 Fix source element for JsSwitch generated from 'when'
Before this change we set JsSwitch source to subject's JsExpression.
We ignore these types of source elements during:
1. js ast serialization (see 'JsAstSerializer.extractLocation');
2. source map generation (see 'SourceMapBuilderConsumer.addMapping').

However we might add indent during source generation
(see 'JsToStringGenerationVisitor.pushSourceInfo').

That seemingly broken 'testEnumEntryRemoved' in
'IncrementalJsCompilerRunnerTestGenerated.ClassHierarchyAffected',
because deserialized ast during incremental build would not
have source element at all (JsExpression was ignored), but ast
during rebuild would have JsExpression source element.
2018-04-19 05:18:54 +03:00
Alexey Tsvetkov
b0e8c85e88 Compare JS source maps in readable way in IC tests 2018-04-19 05:18:54 +03:00
Alexey Tsvetkov
dee8b403e3 Turn sourcemap generation on 2018-04-19 05:18:54 +03:00
Ilya Gorbunov
4f80f6d715 Sort .js files before passing them to merger to ensure stable output
#KT-23705 Fixed
2018-04-19 01:22:13 +03:00
Vyacheslav Gerasimov
c4da0e572d Remove comment about TeamCityBuild.xml from build.gradle.kts.182 2018-04-18 22:39:21 +03:00
Nicolay Mitropolsky
46ff4f2bbf 182: KotlinElementActionsFactory: "value"-parameters in generated java-annotations is putted without explicit parameter name #KT-23644 2018-04-18 21:17:24 +03:00
Mikhail Glukhikh
de0cbf5844 Join parameter/argument list: use document to delete whitespaces
Otherwise fix has no effect in IDE. Related to KT-23266
2018-04-18 20:45:31 +03:00
Toshiaki Kameyama
03902030ed Add intentions to put arguments / parameters on one line #KT-23266 Fixed 2018-04-18 20:45:31 +03:00
Ilya Gorbunov
96581f1ecb Do not read manifest properties into build script, remove allProjectsRecursive
Neither this helper, nor manifest properties are used in the build.
2018-04-18 19:41:22 +03:00
Vyacheslav Gerasimov
1753ae8d57 Remove obsolete TeamCityBuild.xml 2018-04-18 19:17:16 +03:00
Toshiaki Kameyama
3992f0215c "map.put() to assignment": handle case with labeled return inside
So #KT-23194 Fixed
2018-04-18 18:50:15 +03:00
Mikhail Glukhikh
77f62f1666 Move to separate file: minor optimization, related to KT-23321 2018-04-18 18:41:24 +03:00
Toshiaki Kameyama
a8d0e8995d Don't suggest to move type to separate file for sealed classes
So #KT-23321 Fixed
2018-04-18 18:41:23 +03:00
Vyacheslav Gerasimov
02578bc378 Add dependency on com.intellij.modules.androidstudio to AS 3.1 & 3.2 plugin.xml 2018-04-18 18:31:39 +03:00
Vyacheslav Gerasimov
8f1defa267 Fix plugin.xml formatting 2018-04-18 18:25:42 +03:00
Vyacheslav Gerasimov
cec554ead2 182: Remove snappy-in-java from IntellijCoreDependencies 2018-04-18 18:00:05 +03:00
Vyacheslav Gerasimov
2a04d08d3e Build: Use fromEmbeddedComponents helper in :prepare:android-lint 2018-04-18 17:53:32 +03:00
Vyacheslav Gerasimov
3b472f4411 Build: Use lazy from with trailing lambda in fromEmbeddedComponents
configurations shouldn't be resolved at project configuration step
2018-04-18 17:53:32 +03:00
Vyacheslav Gerasimov
49bb722f70 Remove update_dependencies from .idea/ant.xml 2018-04-18 17:53:32 +03:00
Nicolay Mitropolsky
0aa236d1ac 182: KotlinElementActionsFactory.createAddFieldActions no more generates private @JvmField and lateinit @JvmField 2018-04-18 17:41:35 +03:00
Alexander Udalov
789a6f9c63 Add test for deterministic bridge order
The test didn't fail before fixin the issue (in the previous commit),
but may still be useful in the future

 #KT-23707 Fixed
2018-04-18 15:55:33 +02:00
Denis Vnukov
e3829a70b0 Stable order of synthesized bridges.
In some cases when several bridge methods are generated, their order
is undetermenistic. For example for class ClassLowerWithContext in the
following example

```
interface IrElement
class IrClassContext

interface IrElementVisitor<out R, in D> {
    fun visitElement(element: IrElement, data: D): R
}

interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
    override fun visitElement(element: IrElement, data: D): IrElement =
            element.also { throw RuntimeException() }
}

abstract class ClassLowerWithContext : IrElementTransformer<IrClassContext?>
```

kotlin compiler synthesizes two additional bridges:

  public IrElement visitElement(IrElement, IrClassContext);
  [bridge] public Object visitElement(IrElement, Object);
  [bridge] public IrElement visitElement(IrElement, Object);

Unfortunately the behavior is not deterministic and not easy to reproduce.
2018-04-18 15:36:33 +02:00
Mikhail Glukhikh
5212b97047 Remove reformatting in intentions isApplicable via createByPattern 2018-04-18 16:15:57 +03:00
Mikhail Glukhikh
ef3ba5f0b1 Test local inspections on the fly via highlighting
Fixes problem with INFORMATION highlight type in batch mode (IDEA 181).
It's no more required to report INFORMATIONs in unit tests in batch.
2018-04-18 16:14:43 +03:00
Mikhail Glukhikh
b6661710dd Use expression body: reformat 2018-04-18 16:14:08 +03:00
Mikhail Glukhikh
28fe30c70d Use expression body: extend range if default level is INFORMATION
So #KT-23167 Fixed
2018-04-18 16:13:54 +03:00
Nikolay Krasko
f62e0dc5f7 Use com.intellij.modules.idea as dependency to forbid install in AS
`com.intellij.modules.idea` was introduced in 182 to distinguish
AS and IDEA installation (IDEA-187502).

Dependency should be removed in CLion and AppCode installation.
2018-04-18 15:49:41 +03:00
Nikolay Krasko
78a5fa766f Remove com.intellij.modules.remoteServers dependency from AS 3.2
Otherwise plugin won't be compatible with AS.
2018-04-18 15:49:40 +03:00
Nikolay Krasko
1ad2ed6761 Add com.intellij.modules.cidr.lang module dependency for CLion and AppCode
Otherwise after removing java dependency it would be possible to
install plugin non only in CLion and AppCode, but also in WebStorm,
PHPStorm, etc.
2018-04-18 15:49:40 +03:00
Nikolay Krasko
c4917d6d1c Use only hard dependency to java module and use include for jvm.xml (KT-23638)
Trick with both optional/non-optional dependency doesn't work in IDEA,
as it doesn't do an additional check optional dependency is found.

See com.intellij.ide.plugins.PluginManagerCore#checkDependants(
  IdeaPluginDescriptor, Function<PluginId, IdeaPluginDescriptor>,
  Condition<PluginId>, Set<PluginId>)

 #KT-23638 Fixed
2018-04-18 15:49:40 +03:00
Alexey Sedunov
03cca448d3 Misc: Make test superclass abstract 2018-04-18 14:37:23 +03:00
Nikolay Krasko
349f16aa64 Fix AbstractScratchRunActionTest.kt and remove usages of projectDisposable 2018-04-18 13:59:36 +03:00
Toshiaki Kameyama
ff63ba4dc1 Add inspection: redundant internal in local anonymous object / class
So #KT-23617 Fixed
2018-04-18 11:17:52 +03:00
Mikhail Glukhikh
1d3ba5641d "Main should return Unit": report on identifier, delete block body type 2018-04-18 11:16:03 +03:00
Toshiaki Kameyama
1cd438c3f7 Add inspection "main should return Unit" #KT-16085 Fixed 2018-04-18 10:59:23 +03:00
Ilya Gorbunov
8784d89f38 Use kotlin-stdlib-sources.jar in tests
Instead of deprecated kotlin-runtime-sources
2018-04-18 05:22:40 +03:00
Alexey Sedunov
3f147aabb0 Misc: Extract AbstractConfigureKotlinInTempDirTest superclass (181/AS32) 2018-04-17 20:38:00 +03:00
Alexey Sedunov
183559dcfa Misc: Extract AbstractConfigureKotlinInTempDirTest superclass
This avoids duplicating runs of ConfigureKotlinInTempDirTest
2018-04-17 17:46:50 +03:00
Pavel V. Talanov
33a312c26d Do not throw when trying to resolve java outside project model
#KT-23444 Fixed
 #KT-22825 Fixed
2018-04-17 16:19:49 +02:00
Mikhail Zarechenskiy
4af8833f08 Render unwrapped suspend function in backend
Hierarchy of specially wrapped suspend function may have inconsistent
 overridden descriptors: some of them may be wrapped, some unwrapped.
 To mitigate this problem, currently it's proposed to render only
 unwrapped functions, which are always have stable overridden descriptors

 #KT-23809 Fixed
2018-04-17 16:24:13 +03:00
Mikhail Zarechenskiy
c216749eb6 [NI] Fix substitutor for anonymous types with captured type parameters 2018-04-17 16:06:55 +03:00
Juan Chen
b7fa06cca4 Add "Convert Java to Kotlin" to ProjectViewPopupMenu and
EditorTabPopupMenu.
2018-04-17 15:36:55 +03:00
Alexey Sedunov
01b0518a61 Gradle Support: Declare 'gradleFrameworkSupport' extension point
This fixes exception in the New Project wizard (IDEA 172)

 #KT-23835 Fixed
2018-04-17 13:37:52 +03:00
Dmitry Petrov
d3a1d93460 Type translation, initial import 2018-04-17 10:35:52 +03:00
Dmitry Petrov
d1fe32a486 IrType: basic interface & implementation 2018-04-17 10:35:52 +03:00
Yan Zhulanow
b665a1b2b6 Android Extensions: Create application resource directories if missing (181, as31) 2018-04-16 20:42:58 +03:00
Mikhail Zarechenskiy
3318549622 [NI] Fix smartcasts computation for dot-qualifier expressions 2018-04-16 18:13:12 +03:00
Mikhail Glukhikh
55da251ffc Resolve problem with too long command line path in Gradle Windows 2018-04-16 17:08:27 +03:00
Vyacheslav Gerasimov
8b5faca2d1 Delete obsolete update_dependencies.xml 2018-04-16 16:23:28 +03:00
Alexey Sedunov
e58f8763fe Minor: Fix NPE in tests which doesn't use facets 2018-04-16 16:14:01 +03:00
Nikolay Krasko
9bce8759bb Remove accidentally added *.173.as32 files 2018-04-16 15:55:53 +03:00
Nikolay Krasko
ecd2db3b48 Remove bunch files that are equal to base files 2018-04-16 15:55:53 +03:00
Vyacheslav Gerasimov
b06e644753 as32: Fix tests compilation for AS 3.2 C10 2018-04-16 15:48:12 +03:00
Zalim Bashorov
e1ba08e03d [JS IR BE] add new items to whitelist and regenerate tests 2018-04-16 14:34:44 +03:00
Zalim Bashorov
ac42a0a23e [JS IR BE] don't materialize Unit for toplevel expressions 2018-04-16 14:34:44 +03:00
Zalim Bashorov
8408bada76 [JS IR BE] basic support for the case when IrBlock is used as expression
In this case compiler generates comma separated expressions.
2018-04-16 14:34:43 +03:00
Zalim Bashorov
77ac0a5d95 [JS IR BE] use most of new intrinsics in IR -> IR 2018-04-16 14:34:43 +03:00
Zalim Bashorov
48219e4a9a [JS IR BE] support new intrinsics in IR -> JS 2018-04-16 14:34:43 +03:00
Zalim Bashorov
76e102a2d2 [JS IR BE] declare more intrinsics
* jsGt
* jsGtEq
* jsLt
* jsLtEq
* jsUnaryPlus
* jsUnaryMinus
* jsPrefixInc
* jsPostfixInc
* jsPrefixDec
* jsPostfixDec
* jsAnd
* jsOr
* jsBitAnd
* jsBitOr
* jsBitXor
* jsBitNot
* jsBitShiftR
* jsBitShiftRU
* jsBitShiftL
* jsInstanceOf
2018-04-16 14:34:42 +03:00
Zalim Bashorov
2ed82f136c [JS IR BE] move intrinsic for Object.create calls to JsIntrinsics 2018-04-16 14:34:42 +03:00
Zalim Bashorov
89aefb2e3f [JS IR BE] add basic support for some binary and equality operations; add some intrinsic infrastructure 2018-04-16 14:34:41 +03:00
Zalim Bashorov
1f7d818307 [JS IR BE] use mapTo instead of map when translate call arguments 2018-04-16 14:34:41 +03:00
Zalim Bashorov
194f5d575a [JS IR BE] use IrMemberAccessExpression.valueArgumentsCount instead of descriptor based IrFunctionSymbol.parameterCount and remove last one 2018-04-16 14:34:40 +03:00
Nikolay Krasko
1fb2b40684 Fix 182 branch after QueryExecutor and subclasses update
Parameter taking Processor<T> were replaced with Processor<? super T>.
aaed1ccb91
c6b40a53ee

Instead of updating all usages, use ExecutorProcessor to avoid
different source code for different IDEAs.
2018-04-14 15:29:38 +03:00
Vyacheslav Gerasimov
879c7f3837 as32: Revert KotlinCallerChooser to 173 state 2018-04-13 21:33:17 +03:00
Vyacheslav Gerasimov
16b314f860 as32: Remove JavaBuilderExtension from AS 3.2 C10 2018-04-13 21:33:16 +03:00
Vyacheslav Gerasimov
76cbdf08aa as32: Update AndroidResourceReferenceAnnotator to AS 3.2 C10 2018-04-13 21:33:15 +03:00
Vyacheslav Gerasimov
8efee7bd9c as32: Revert uast to the state of idea 173, AS 3.2 C10 has uast from idea 173 2018-04-13 21:33:15 +03:00
Vyacheslav Gerasimov
a6bd0f618e as32: Remove platform-api & platform-impl from build scripts
since they are not present in AS 3.2 C10
2018-04-13 21:33:14 +03:00
Vyacheslav Gerasimov
00b5d5fa05 as32: Setup versions for AS 3.2 C10 2018-04-13 21:33:13 +03:00
Vyacheslav Gerasimov
4299455dc1 as32: Update to AS 3.2 C10 2018-04-13 21:33:03 +03:00
Vyacheslav Gerasimov
6fab21f916 Bunch: update bunch structure as32 <- 181 2018-04-13 20:55:37 +03:00
Alexey Sedunov
0647ffca36 MPP: Show error popups for module names in the New Kotlin/Multiplatform wizard
#KT-23261 Fixed
2018-04-13 20:23:08 +03:00
Alexey Sedunov
e51b6927b6 Refactor: Introduce JTextComponent.onTextChange() function 2018-04-13 20:23:07 +03:00
Alexey Sedunov
62f654b3d2 Introduce Variable: Avoid explicit types for expression of anonymous type
#KT-12078 Fixed
2018-04-13 20:23:07 +03:00
Alexey Sedunov
c7e72af170 Override/Implement Members: Copy @Experimental-annotated annotations
#KT-22922 Fixed
2018-04-13 20:23:06 +03:00
Alexey Sedunov
c1d8ba9c2b Parameter Info: Do not render nullability annotations
#KT-23408 Fixed
2018-04-13 20:23:06 +03:00
Alexey Sedunov
e5b915661a Rename: Do not suggest camel names for backquoted non-identifiers
#KT-22888 Fixed
2018-04-13 20:23:05 +03:00
Alexey Sedunov
ea66e1e3f7 Copy: Fix exception on copying KtFile to non-KtFile
#KT-22669 Fixed
2018-04-13 20:23:05 +03:00
Alexey Sedunov
bf106d01b8 Find Usages: Restrict search scope of private top-level declarations
#KT-7622 Fixed
2018-04-13 20:23:04 +03:00
Mikhail Glukhikh
c172810d1d Simplify boolean with constants optimization: use partial analysis 2018-04-13 19:11:55 +03:00
Toshiaki Kameyama
90be6235f7 Expand Selection on opening curly brace should select the entire block right away #KT-18769 Fixed 2018-04-13 13:23:42 +03:00
Nikolay Krasko
2227d205c7 Bunch: update "MoveLambdaOutsideParentheses: intention -> inspection"
decf9939fe
2018-04-13 10:45:32 +03:00
Nikolay Krasko
0253fe7c16 Bunch: update after "Wire StorageManager into a ..."
934c56a4da
2018-04-13 10:45:28 +03:00
Alexander Udalov
30b9caeae6 Fix NPE in data class 'equals' codegen
Do not perform the optimization from 0a11385006 for data class
properties of nullable types
2018-04-12 22:19:30 +02:00
Nikolay Krasko
579b773388 172: Remove 172 specific from psiModificationUtils.kt and KtPsiFactory.kt 2018-04-12 19:29:01 +03:00
Nikolay Krasko
2260f66e02 Unify usage of ProgressManager.progressIndicator 2018-04-12 19:29:01 +03:00
Alexander Udalov
1b1e4ab970 Fix stdlib test path in GenerateRangesCodegenTestData
This fixes `./gradlew generateTests`
2018-04-12 18:28:17 +02:00
Alexey Tsvetkov
ea8f2b5cd8 Clear MockApplication in ClassesFqNamesTest 2018-04-12 18:26:50 +03:00
Ilya Gorbunov
9c7fefba69 Restore default values in actual functions that have default values in expect
Suppress error about default argument values in actuals.
The suppression can be removed when/if KT-23548 is implemented.

This is to avoid degrading experience in docs and IDE when working with
these functions.
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
f7546c809d Minor: use common implementation of doubleTotalOrderEquals for tests 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
2826733e87 Put common sources into kotlin-stdlib-sources going into dist 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
136e6b64f2 In tests use stdlib sources from jar rather than from original locations 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
7ccbd36304 Set module name for common projects, this isn't done automatically yet 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
0e4925a20f Remove UNUSED_PARAMETER warning suppression from actual declarations 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
ac3de447ae Do not use code preprocessing anymore 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
37787f9769 Stdlib docs build: use multiplatform sources 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
9dd87d89ba Remove default values in actual functions that have default values in expect
Remove suppressions about default values in expect declarations
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
f7b2eba680 Do not mix expect/non-expect overloads of minOf/maxOf
Workaround for KT-22520
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
912c69aaa3 Suppress expect-actual mismatch for relaxed array extensions
Due to KT-21937
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
38be99daa3 Build stdlib-jdk7/8 tests as multiplatform manually 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
9b38e5e7b5 stdlib tests: move JVM-only test source files 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
ba873e2b46 stdlib tests: provide expect/actual helper functions 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
ee9608f8db stdlib-js: add actual modifiers where required 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
1be55db681 stdlib-common: remove common migration typealias for Volatile annotation
Otherwise it gets to jvm stdlib as new API.
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
0164f9b730 stdlib-common: correct common exception type declarations 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
10be42ddaa stdlib-common: suppress missing Comparator SAM constructor in JVM 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
d97707d6f7 Add JvmMultifileClass to preserve public API surface 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
23d0e5f2e1 Workarounds to build parts of stdlib as kotlin-runtime and mock runtime
Fix source paths of kotlin-stdlib-minimal-for-tests
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
7c74083f09 runtime-jvm: add actual modifiers where required 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
22255a5cc4 stdlib-jvm: move JVM specific sources, add actual modifier where required
Update copyright path after moving JVM sources
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
93f7a46ba4 stdlib-jvm: build as multiplatform, move project to jvm subfolder
Fix path with stdlib-jvm artifacts for public api test
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
0fb3393ee1 stdlib-js: build as multiplatform 2018-04-12 17:53:00 +03:00
Ilya Gorbunov
69ebb3bfb0 Switch to the new stdlib source generation scheme
Remove old generated sources for stdlib-jvm and stdlib-js
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
ae62cd6570 Do not produce original kotlin-stdlib public api dump anymore
It was produced from the kotlin-stdlib of 1.0 which was separate from the kotlin-runtime.
The actual dump is in kotlin-stdlib-runtime-merged.txt
2018-04-12 17:53:00 +03:00
Ilya Gorbunov
70236d4824 Build standard library for JVM from a single source set
Add explicit imports for kotlin.* and kotlin.text.* to prevent typealiases
conflicting with their aliased types from default imports.
2018-04-12 17:53:00 +03:00
Mikhail Zarechenskiy
cfc940af66 Avoid deprecated access by short name though companion object 2018-04-12 17:35:07 +03:00
Raluca Sauciuc
89d61ee12d Support androidx packages
... in the IDE plugin and the Android extensions compiler.

Change-Id: Iffd58351b0592e12ffc937c06d871d26958fe161
2018-04-12 16:29:13 +03:00
Mikhail Zarechenskiy
612baacc25 Make useless elvis diagnostic more consistent for new and old inference
Also, remove diagnostics that can be covered by usual USELESS_ELVIS diagnostic
2018-04-12 14:38:55 +03:00
Anton Bannykh
4e11555c46 JS: fix BasicIrBoxTest constructor & regenerate the tests 2018-04-12 13:52:21 +03:00
Dmitry Savvinov
934c56a4da Wire StorageManager into a ClassTypeConstructorImpl and ClassDescriptorImpl 2018-04-12 13:44:10 +03:00
Mikhail Glukhikh
1477e67076 Optimize KtPropertyAccessor.hasBlockBody() 2018-04-12 11:03:41 +03:00
Mikhail Glukhikh
876563ca91 Move lambda outside: use INFORMATION for named and multiple lambdas case 2018-04-12 11:03:40 +03:00
Mikhail Glukhikh
b0553a3863 Move lambda outside parentheses: fix inspection text / formatting 2018-04-12 11:03:40 +03:00
kenji tomita
decf9939fe MoveLambdaOutsideParentheses: intention -> inspection #KT-21413 Fixed 2018-04-12 11:03:40 +03:00
Nicolay Mitropolsky
83573ed517 181: Uast: more implementations of UCallExpressionEx 2018-04-12 10:29:07 +03:00
Alexey Tsvetkov
bd50ad87ba Use KotlinCoreEnvironment for parsing Kotlin in IC
Creating and disposing CoreApplicationEnvironment on each call leads to
problems with parallel builds, while KotlinCoreEnvironment
avoids disposing application environment in case of parallel builds.

    #KT-23694 fixed
2018-04-11 19:56:15 +03:00
Alexey Tsvetkov
13ac64b84a Move parseFileUtils to incremental-compilation-impl 2018-04-11 19:56:15 +03:00
Denis Zharkov
1442dd6c2b Avoid exponential complexity in LexicalScope::findLocalVariable
There was an exponential complexity in case we have a chain
of nested LexicalScopeWrapper instances:
we were walking through the chain and on each step running
the algorithm recursively.

Such a case is possible in scripts where each line contains LexicalScopeWrapper

The fix looks safe to me because delegate was used there
for checking !is ImportingScope && !is LexicalChainedScope

In all other means, being recursively run the algorithm does the same job.

 #KT-22740 Fixed
2018-04-11 17:53:19 +03:00
Denis Zharkov
a3c8afade5 Minor. Reformat ScopeUtils.kt 2018-04-11 17:53:19 +03:00
Nikolay Krasko
d93dff5657 Bunch: update QuickFixMultiFileTestGenerated.java.172 2018-04-11 17:20:37 +03:00
Toshiaki Kameyama
52d72ab920 Fix AE exception in "Convert too long character literal to string"
So #KT-23608 Fixed
2018-04-11 17:00:38 +03:00
Toshiaki Kameyama
1cbaab1531 Preserve annotation arguments in "Add use-site target" intention
So #KT-23634 Fixed
2018-04-11 17:00:38 +03:00
Toshiaki Kameyama
a5aad22fe7 Don't report "Redundant Companion reference" on accessing nested object
So #KT-23620 Fixed
2018-04-11 17:00:37 +03:00
Toshiaki Kameyama
94c5344fd1 Check explicit type specification in "Might be const" inspection
So #KT-23303 Fixed
2018-04-11 17:00:37 +03:00
Felix Guo
9539212180 Take Java source file into account in "Add annotation target"
So #KT-22860 Fixed
2018-04-11 17:00:37 +03:00
Nikolay Krasko
5559a6edd3 Fix quick fix, refactoring and slice tests - ignore bunch files 2018-04-11 16:28:45 +03:00
Nikolay Krasko
a3d01443b9 Update bunch plugin.xml after adding "Refactor sealed sub-class to object"
df7968678a
2018-04-11 16:28:45 +03:00
Nikolay Krasko
672169f3be Forgotten bunch file commit reminder 2018-04-11 16:28:45 +03:00
Nikolay Krasko
c8fb384465 Fix call to static PlatformTestCase.createModuleAt in 181 2018-04-11 16:28:45 +03:00
Vyacheslav Gerasimov
b98b02b56e 182: Suppress proguard warnings for com.intellij.util.SVGLoader
Depends on apache batick which has lots of dependencies, probably should be refactored out in idea
2018-04-11 16:28:44 +03:00
Vyacheslav Gerasimov
2514800ce0 182: Suppress proguard warnings for new guava nullability annotations 2018-04-11 16:28:44 +03:00
Vyacheslav Gerasimov
d9f9bf7564 182: Set picocontainer version to 1.2 2018-04-11 16:28:44 +03:00
Yan Zhulanow
6d5e49eeae 182: Android Extensions: Create application resource directory storage if absent 2018-04-11 16:28:44 +03:00
Nicolay Mitropolsky
abe0ca3bd1 182: multiPlatformSetup.kt: createTempDir is non-static in 182 2018-04-11 16:28:44 +03:00
Nicolay Mitropolsky
7a2fc4301b 182: CommonIntentionActionsTest updated to new ExpectedParameter 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky
001c5d6e3e 182: PsiReferenceBase nullability change fixes 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky
e7c3086db7 182: dep javax.annotation:jsr250-api:1.0 added to compiler/frontend.java 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky
072af7304f 182: jdk.internal.org.objectweb.asm.Opcodes -> org.jetbrains 2018-04-11 16:28:43 +03:00
Vladislav.Soroka
a1023953b4 182: KT-23383 Optional plugin dependency for kotlin gradle plugin 'java' subsystem dependent features 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky
c7c565ffa7 182: velocity-dependency fix for idea 182 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky
316826ef9b 182: CommonIntentionActionsTest-tests fix after createPropertyActions dropping in platform 2018-04-11 16:28:42 +03:00
Nicolay Mitropolsky
1b783070b5 182: generic PopupChooserBuilder<T> compilation fix 2018-04-11 16:28:42 +03:00
Nicolay Mitropolsky
fdb98fd4ab 182: KotlinOutputChecker.myTestName compilation fix 2018-04-11 16:28:42 +03:00
Nicolay Mitropolsky
41c30f06bb 182: KotlinElementActionsFactory.createAddAnnotationActions implementation (KT-22876) 2018-04-11 16:28:42 +03:00
Alexey Tsvetkov
d5f26f2d8d 182: Add oro version for 182 2018-04-11 16:28:41 +03:00
Alexey Tsvetkov
2f4dcd609c 182: Remove deprecated StoragePathMacros usages
Deprecated `StoragePathMacros.PROJECT_CONFIG_DIR` and
`StoragePathMacros.PROJECT_FILE` were removed in Intellij.
2018-04-11 16:28:41 +03:00
Alexey Tsvetkov
619663cc88 182: Remove com.android.annotations.NonNull usage from TestUtils.java
It is not present in Intellij (182.*) anymore.
Also `org.jetbrains.annotations.NotNull` seems OK here as well.
2018-04-11 16:28:41 +03:00
Alexey Tsvetkov
4fc89631a5 182: Update Guava version 2018-04-11 16:28:41 +03:00
Nicolay Mitropolsky
29b7e460dd 182: fixup: compilation fix: PlatformTestCase.myFilesToDelete made non-static in Platform 2018-04-11 16:28:41 +03:00
Nicolay Mitropolsky
44605580f3 182: compilation fix: PlatformTestCase.myFilesToDelete made non-static in Platform
some code from `PlatformTestCase` were copy-pasted to `KotlinLightCodeInsightFixtureTestCaseBase` because `PlatformTestCase` is not in it's type hierarchy, and thus we cant use these methods from `PlatformTestCase` when they became non-static
2018-04-11 16:28:40 +03:00
Nicolay Mitropolsky
22186c05b4 182: KotlinDecompilerServiceImpl and KtParsingTestCase compilation fixes 2018-04-11 16:28:40 +03:00
Vyacheslav Gerasimov
9e64b240ac 182: Set since-build to "182.1" & until-build to "182.*" 2018-04-11 16:28:40 +03:00
Vyacheslav Gerasimov
b37496c3fc 182: Fix compilation for idea 182, nullability changes mostly 2018-04-11 16:28:39 +03:00
Vyacheslav Gerasimov
ff1ce44c8b 182: Fix build scripts for idea 182 2018-04-11 16:28:39 +03:00
Vyacheslav Gerasimov
67d4ba200a 182: Build against idea 182-SNAPSHOT 2018-04-11 16:28:39 +03:00
Vyacheslav Gerasimov
75b2a29a91 182: Build: Add versions for 182 platform 2018-04-11 16:28:39 +03:00
Vyacheslav Gerasimov
1c9a2c5d30 182: Build: Support idea SNAPSHOT version 2018-04-11 16:28:39 +03:00
Vyacheslav Gerasimov
8af4ae0409 182: == 181 -> 182 ^^^ == 2018-04-11 16:28:39 +03:00
Yan Zhulanow
2e4b04bac5 181: Fix API wrapper in Android extensions 2018-04-11 16:28:38 +03:00
Nicolay Mitropolsky
6e1edb420e 181: StringTemplateExpressionManipulatorTest compilation fix 2018-04-11 16:28:38 +03:00
Alexey Tsvetkov
39f7ecc9a3 181: Reimplement constant search in JPS
The API in Intellij have been changed after the PR was merged
(see 8227d8e2dd)

This commit implements new API.
Also mocked Kotlin constant search is removed from JPS tests.
Mocked Java search is in place, but now
it is does not use hardcoded file and constant names.

   #KT-16091 fixed
2018-04-11 16:28:38 +03:00
Alexey Tsvetkov
5ed66c3998 181: Update Idea to 181.4203.6 2018-04-11 16:28:38 +03:00
Alexey Tsvetkov
8d2508e351 181: Fix oromatcher dependency 2018-04-11 16:28:38 +03:00
Vyacheslav Gerasimov
1b36724495 181: Set until-build to "181.*" 2018-04-11 16:28:37 +03:00
Alexey Sedunov
25d19b45e9 181: Safe Delete: Do not delegate class search to Java
This fixes tests failing in IDEA 181
2018-04-11 16:28:37 +03:00
Vyacheslav Gerasimov
4cf804f30f 181: Restore broken android lint quickfixes 2018-04-11 16:28:37 +03:00
Vyacheslav Gerasimov
207247347e 181: Fix test data for android lint based tests 2018-04-11 16:28:37 +03:00
Nicolay Mitropolsky
94d18581e3 181: FakeFileForLightClass made return "virtualFile" from "ktFile" 2018-04-11 16:28:37 +03:00
Nicolay Mitropolsky
44a37f5dad 181: Uast: KotlinAccessorCallExpression.methodIdentifier fix 2018-04-11 16:28:36 +03:00
Alexey Sedunov
7413e09dc1 181: Move: Replace deprecated method call 2018-04-11 16:28:36 +03:00
Alexey Sedunov
bd6b96341f 181: Move: Remove unnecessary runSynchronouslyWithProgress() call
This method is already invoked under progress manager
2018-04-11 16:28:36 +03:00
Alexey Sedunov
ffc059a0a1 181: Misc: Update Move test data 2018-04-11 16:28:36 +03:00
Vyacheslav Gerasimov
212d218bc6 181: Fix test runtime for 181 platform compiler tests 2018-04-11 16:28:36 +03:00
Vyacheslav Gerasimov
ae338566c2 181: Fix test data for android lint based tests 2018-04-11 16:28:35 +03:00
Nicolay Mitropolsky
585348c590 181: LightClasses: using viewProvider from KtFile
#KT-22929
2018-04-11 16:28:35 +03:00
Nicolay Mitropolsky
1125926009 181: Revert "Fix OOM in tests for 181 (Temporary workaround)"
This reverts commit 5cf45ef
2018-04-11 16:28:35 +03:00
Nicolay Mitropolsky
f0a85eeefb 181: IDEA updated to 181.3870.7 2018-04-11 16:28:35 +03:00
Nicolay Mitropolsky
55753d79e8 181: using InjectedFileViewProvider for light-files in language-injections
#KT-22929
2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky
5951fbb390 181: KotlinFinalClassOrFunSpringInspection dropped 2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky
4d65147373 181: KotlinSpringClassAnnotator dropped 2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky
f539ed76a8 181: SpringKotlinAutowiringInspection dropped 2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky
9bac6c5a71 181: Light annotations made strictly non-physical (KT-22565)
(cherry picked from commit cf6e21d)
2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky
5a1a6a3780 181: ultimate: smali dependency added 2018-04-11 16:28:33 +03:00
Simon Ogorodnik
d361e0f5ea 181: Try to fix OOM in 181 by rising Xmx 2018-04-11 16:28:33 +03:00
Nikolay Krasko
48d357136d 181: Idea update to 181.3494.3 (Fixup on rebase) 2018-04-11 16:28:33 +03:00
Alexey Sedunov
4934b45b61 181: Change Signature: Restore node generation method
#KT-22817 Fixed
2018-04-11 16:28:33 +03:00
Alexey Sedunov
aee9938c70 181: Kotlin Ultimate: Update NodeJS plugin version 2018-04-11 16:28:33 +03:00
Nikolay Krasko
8e147bf3f0 181: Idea update to 181.3494.3 2018-04-11 16:28:32 +03:00
Nicolay Mitropolsky
7e5b417955 181: Uast: don't use com.intellij.psi.util.parentOfType (KT-22734) 2018-04-11 16:28:32 +03:00
Simon Ogorodnik
3fd9ec1b18 181: Fix OOM in tests for 181 (Temporary workaround) 2018-04-11 16:28:32 +03:00
Nicolay Mitropolsky
8cde41850e 181: Uast: support for object literals 2018-04-11 16:28:32 +03:00
Nicolay Mitropolsky
036c0fd6a4 181: Uast: fixes for non-leaf identifiers 2018-04-11 16:28:32 +03:00
Nicolay Mitropolsky
8a4ef83b3d 181: Uast: identifiers testdata updates 2018-04-11 16:28:31 +03:00
Vyacheslav Gerasimov
327cff0876 181: Set until-build to "182.*" 2018-04-11 16:28:31 +03:00
Nicolay Mitropolsky
f40ea754cb 181: Uast: identifiers fixes for KotlinUFunctionCallExpression and AbstractKotlinUVariable 2018-04-11 16:28:31 +03:00
Alexey Sedunov
7988fcabcc 181: Misc: Refine nullability to match changes in the platform 2018-04-11 16:28:31 +03:00
Nicolay Mitropolsky
8ce65dc715 181: Uast: weak consistency check and fixes for UIdentifiers 2018-04-11 16:28:31 +03:00
Vyacheslav Gerasimov
1bf12841ae 181: Set 'versions.intellijSdk' to '181.3007.14' 2018-04-11 16:28:30 +03:00
Nicolay Mitropolsky
224480ac5e 181: UAST: UAnchorOwner and type-specific javaPsi support 2018-04-11 16:28:30 +03:00
Nicolay Mitropolsky
ffe33844b7 181: compilation fix: KotlinCallerChooser and KotlinAwareMoveClassesOrPackagesToNewDirectoryDialog 2018-04-11 16:28:30 +03:00
Nicolay Mitropolsky
26a0dbe910 181: KotlinElementActionsFactory: makes elements public by removing other visibility modifiers 2018-04-11 16:28:30 +03:00
Nicolay Mitropolsky
e48b905075 181: Uast: getArgumentForParameter(i: Int) implementation for Kotlin (IDEA-184046) 2018-04-11 16:28:29 +03:00
Nicolay Mitropolsky
1507eed1cf 181: Uast: Constructors.identifiers.txt testdata fix 2018-04-11 16:28:29 +03:00
Vyacheslav Gerasimov
a0e20eefc6 181: Fix dependencies for 181 2018-04-11 16:28:29 +03:00
Vyacheslav Gerasimov
95c854121a 181: Fix compilation MockUpdateParameterInfoContext 2018-04-11 16:28:29 +03:00
Vyacheslav Gerasimov
283ac840c2 181: Add smali plugin required by android plugin to test runtime 2018-04-11 16:28:29 +03:00
Nikolay Krasko
d32c9ada59 181: Remove deprecated API from language injection in 181 2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
aae4bb1e1f 181: KotlinElementActionsFactory fix for switching on new API
one test is still falling (
2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
96ac913a6d 181: Uast: parents for UIdentifiers from toUElement 2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
4e078fe94b 181: Android-related compilation fix (klint.AndroidLintInspectionBase) 2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
984c2329b4 181: Uast: KotlinUIdentifier almost everywhere (KT-21688) 2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
9efa79f352 181: Uast: KotlinUIdentifier introduced to store proper sourcePsi (KT-21688) 2018-04-11 16:28:28 +03:00
Nicolay Mitropolsky
c3decbb62c 181: KotlinCoreEnvironment: set ideaCompatibleBuildNumber = "181.1" 2018-04-11 16:28:27 +03:00
Vyacheslav Gerasimov
5f96b5c4d0 181: build fix: IdeaForkJoinWorkerThreadFactory.setupForkJoinCommonPool
now has parameter headless
2018-04-11 16:28:27 +03:00
Vyacheslav Gerasimov
8e20d540d5 181: Fix RunConfigurationTest.kt, nullability changed in 181 platform 2018-04-11 16:28:27 +03:00
Vyacheslav Gerasimov
f31b56a936 181: Fix compatibility after AS 3.0 was merged to 181 2018-04-11 16:28:27 +03:00
Nicolay Mitropolsky
e322c2d70b 181: yet another PersistentStateComponent-related compilation fix 2018-04-11 16:28:26 +03:00
Alexander Podkhalyuzin
f5e0dfaf8c 181: Parameter state in PersistenceStateComponent is not null now in platform 2018-04-11 16:28:26 +03:00
Nicolay Mitropolsky
1f0f99dc82 181: KotlinTestUtils compilation fix: ShutDownTracker.invokeAndWait removed 2018-04-11 16:28:26 +03:00
Vyacheslav Gerasimov
b61ba4a87a 181: Set correct since-build for Idea 181 plugin 2018-04-11 16:28:26 +03:00
Nicolay Mitropolsky
fe9138f658 181: Using setText instead of text = in EditorTextField after nullability changes in platform 2018-04-11 16:28:26 +03:00
Nicolay Mitropolsky
f291873cf8 181: compilation fix when access progressIndicator in ProgressManager by adding !! 2018-04-11 16:28:25 +03:00
Nicolay Mitropolsky
395a817ada 181: compilation fixes related to BackspaceHandlerDelegate and DocumentWindowImpl changes in IDEA 181 2018-04-11 16:28:25 +03:00
Nicolay Mitropolsky
52acefbb18 181: fix for KotlinDebuggerTestCase compilation 2018-04-11 16:28:25 +03:00
Nicolay Mitropolsky
6ce2c079a7 181: UAST: lazy computation made SYNCHRONIZED in UAST
because of UElement caching in platform, which leads to multithreaded usage
2018-04-11 16:28:25 +03:00
Vyacheslav Gerasimov
e3387953f2 181: == 173 -> 181 ^^^ == 2018-04-11 16:28:25 +03:00
Raluca Sauciuc
cab1813dcd as32: Fix compilation to match changes in SdkConstants (#1533)
... and match the intended semantics for AndroidxName.

Change-Id: If2148ab8cefcc124a72f63458b7dbddf1a6cfe04
2018-04-11 16:28:24 +03:00
Vyacheslav Gerasimov
86f8174093 as32: Set intellijEnforceCommunitySdk for AS 2018-04-11 16:28:24 +03:00
Vyacheslav Gerasimov
6929764672 as32: Set since-build to "173.4548.28" for AS 3.2 C3 2018-04-11 16:28:24 +03:00
Vyacheslav Gerasimov
054ae37ef4 as32: Fix fqname constant usages for AS 3.2 C3 2018-04-11 16:28:24 +03:00
Raluca Sauciuc
25e193546d as32: Android framework resource refactoring fixes
Change-Id: I5dc44306eb315bc9463aaf3d55ad1a75c1e12015
2018-04-11 16:28:24 +03:00
Vyacheslav Gerasimov
86e221f867 as32: Build against AS 3.2 C3 2018-04-11 16:28:23 +03:00
Vyacheslav Gerasimov
b83da08708 as32: Fix compilation against AS 3.2 C2 2018-04-11 16:28:23 +03:00
Vyacheslav Gerasimov
7b69459ad0 as32: Update to AS 3.2 C2 2018-04-11 16:28:23 +03:00
Vyacheslav Gerasimov
2d65e5a60c as32: Fix gradle plugin dependencies for AS 3.2 2018-04-11 16:28:23 +03:00
Vyacheslav Gerasimov
4c76ae12d1 as32: Build against AS 3.2 2018-04-11 16:28:23 +03:00
Vyacheslav Gerasimov
302ff12444 as32: == as31 -> as32 ^^^ == 2018-04-11 16:28:23 +03:00
Yan Zhulanow
5efe6b40af as31: Fix Android-related compilation problems 2018-04-11 16:28:22 +03:00
Nikolay Krasko
fac4be2c1f as31: Remove remoteServers dependency to make compatible with AS 2018-04-11 16:28:22 +03:00
Vyacheslav Gerasimov
1ea093c0bc as31: Set until-build to "173.4301.25" for AS 3.1 2018-04-11 16:28:22 +03:00
Nicolay Mitropolsky
60fe6a911f as31: KotlinTestUtils: resolving PathUtil conflict 2018-04-11 16:28:22 +03:00
Nicolay Mitropolsky
0f6df38211 as31: fixup: Kotlin Facet: Configure facet based on Android build variant (in AS) 2018-04-11 16:28:22 +03:00
Nicolay Mitropolsky
a300682f04 as31: facetUtils.kt compilation fix (configureSdkIfPossible-nullability) 2018-04-11 16:28:21 +03:00
Vyacheslav Gerasimov
e2578b6a17 as31: Add smali plugin required by android plugin to test runtime 2018-04-11 16:28:21 +03:00
Vyacheslav Gerasimov
00d9dc7cc0 as31: Fix GenerateTests.kt compilation for AS 2018-04-11 16:28:21 +03:00
Vyacheslav Gerasimov
b250d20dde as31: Disable ultimate for Android Studio 2018-04-11 16:28:21 +03:00
Vyacheslav Gerasimov
fd0045cf6b as31: Fix build scripts for AS 3.1 2018-04-11 16:28:21 +03:00
Vyacheslav Gerasimov
25fddaacfb as31: Fix compilation ResourceReferenceAnnotatorUtil 2018-04-11 16:28:20 +03:00
Vyacheslav Gerasimov
ec460d88a7 as31: Fix compilation KotlinAndroidGradleLibraryDataService.kt for AS 3.1 2018-04-11 16:28:20 +03:00
Vyacheslav Gerasimov
06efb037fd as31: Fix test data for testAddArrayOfTypeForJavaAnnotation 2018-04-11 16:28:20 +03:00
Vyacheslav Gerasimov
c78c82a366 as31: Fix GradleFacetImportTest for AS 2018-04-11 16:28:20 +03:00
Simon Ogorodnik
d58b0798cc as31: Fix AbstractImportsTest, add missing project parameter
Settings by default taken from per-project settings manager
instead of app settings
2018-04-11 16:28:20 +03:00
Vyacheslav Gerasimov
9bb3bb2777 as31: Remove duplicate registration of KotlinUastBindingContextProviderService
from android-lint.xml, it is already registered in plugin.xml
2018-04-11 16:28:20 +03:00
Vyacheslav Gerasimov
4c498b004f as31: Fix test data for android lint based tests for AS 3.0 2018-04-11 16:28:19 +03:00
Vyacheslav Gerasimov
e12e63572c as31: Fix TypeParameterFindViewByIdInspection for AS 3.0 2018-04-11 16:28:19 +03:00
Nikolay Krasko
589487951c as31: Remove ultimate settings from AS branch 2018-04-11 16:28:19 +03:00
Ilya Gorbunov
f22093ee7b as31: Comment out some new code in ClasspathRootsResolver
Relates to disabled modular JDK9 support.
2018-04-11 16:28:18 +03:00
Yan Zhulanow
48ae0651c6 as31: Add typealias for AndroidGradleModel
(cherry picked from commit f6c6845)

(cherry picked from commit d13c2c2)
2018-04-11 16:28:18 +03:00
Simon Ogorodnik
e9caa54afa as31: Remove dependencies on jps/test 2018-04-11 16:28:18 +03:00
Simon Ogorodnik
647ff74612 as31: Disable maven for AS30 2018-04-11 16:28:18 +03:00
Alexey Sedunov
6636c4376b as31: Kotlin Facet: Configure facet based on Android build variant (in AS)
#KT-19958 Fixed
2018-04-11 16:28:18 +03:00
Alexey Sedunov
a9cdccc6de as31: Misc: Fix compilation 2018-04-11 16:28:18 +03:00
Dmitry Jemerov
8568bde4df as31: Fix compilation
(cherry picked from commit bc0bc0e)
2018-04-11 16:28:17 +03:00
Mikhael Bogdanov
554b834f2c as31: Revert "Fix codegen tests on JDK 9 with jdkKind = FULL_JDK" 2018-04-11 16:28:17 +03:00
Dmitry Jemerov
932e9c74b6 as31: No Maven in AS 2018-04-11 16:28:17 +03:00
Dmitry Jemerov
abce7170be as31: Implement ConvertJavaToKotlinProvider
(cherry picked from commit 34dfa24)
2018-04-11 16:28:17 +03:00
Vyacheslav Gerasimov
38b38511a0 as31: Fix KotlinAndroidLineMarkerProvider for AS 3.0 2018-04-11 16:28:17 +03:00
Vyacheslav Gerasimov
13b192cd47 as31: Moved getRequiredVersion to KotlinAndroidQuickFixProvider 2018-04-11 16:28:16 +03:00
Vyacheslav Gerasimov
11ee744340 as31: Drop custom Kotlin Android lint, register quickfixes with extension point 2018-04-11 16:28:16 +03:00
Dmitry Jemerov
686d8a1756 as31: Compilation fixes for as24 2018-04-11 16:28:16 +03:00
Vyacheslav Gerasimov
ab532732ed as31: Fix compilation AndroidResourceReferenceAnnotator 2018-04-11 16:28:15 +03:00
Vyacheslav Gerasimov
02f842f8b5 as31: Revert "Quickfix to enable language feature works for Maven project"
This reverts commit aabd560eef.
2018-04-11 16:28:15 +03:00
Vyacheslav Gerasimov
3dcca14a50 as31: Revert "Quickfix to enable coroutine support works in Maven projects"
This reverts commit 7346fee513.
2018-04-11 16:28:15 +03:00
Vyacheslav Gerasimov
78140fb304 as31: Fix compilation JavaRuntimePresentationProvider 2018-04-11 16:28:15 +03:00
Vyacheslav Gerasimov
7d7fff52b8 as31: Fix build for AS 2.4.0.3
(cherry picked from commit a79f7a7)
2018-04-11 16:28:15 +03:00
Pavel V. Talanov
8eb80a8f4a as31: Add step to patch plugin xml so that it only works in Android Studio
(cherry picked from commit fcee4eb)

(cherry picked from commit 14f7731)

(cherry picked from commit b1f5df2)
2018-04-11 16:28:14 +03:00
Vyacheslav Gerasimov
7c30e80382 as31: Kotlin Facet: Configure facet on Gradle project sync in Android Studio 2.3
#KT-15909 Fixed

(cherry picked from commit 6a490bc681)
2018-04-11 16:28:14 +03:00
Vyacheslav Gerasimov
6bca651848 as31: Fix compilation for Android Studio 2.4 2018-04-11 16:28:14 +03:00
Vyacheslav Gerasimov
a4699add8e as31: Fix gotoResourceHelper: MyReferredResourceFieldInfo now requires module 2018-04-11 16:28:14 +03:00
Vyacheslav Gerasimov
b6abe84357 as31: Fix ResourceFoldingBuilder for AS 2.4 2018-04-11 16:28:14 +03:00
Yan Zhulanow
bb4b1f5b9c as31: Remove Maven components from all-open and no-arg plugins 2018-04-11 16:28:13 +03:00
Yan Zhulanow
72e66f6175 as31: Disable Maven and JPS modules which is not available in AS 2018-04-11 16:28:13 +03:00
Nikolay Krasko
e1fe148561 as31: Run AS properly 2018-04-11 16:28:13 +03:00
Nikolay Krasko
9f8ab7b98e as31: == 173 -> as31 ^^^ == 2018-04-11 16:28:13 +03:00
Natalia Selezneva
5ba337e998 172: Replace missing property from GradleConstants 2018-04-11 16:28:13 +03:00
Nicolay Mitropolsky
9af4f8c66b 172: psiModificationUtils.kt: compilation fixes 2018-04-11 16:28:13 +03:00
Nikolay Krasko
ef6c8c6a10 172: Revert "UAST: support for JvmDeclarationUElement"
This reverts commit db6a2390a22d4b35246cc4c6d246a5d7752f3506.
2018-04-11 16:28:12 +03:00
Nikolay Krasko
e2fb63729d 172: Revert "Data Inflow: Support grouping by leaf expressions"
This reverts commit d5af2db2f259c7d55d38be73b9a5136e3aefd580.
2018-04-11 16:28:12 +03:00
Mikhael Bogdanov
b785aca98e 172: Fix compilation 2018-04-11 16:28:12 +03:00
Nikolay Krasko
cdc0f60fe8 172: Restore KotlinCommonCodeStyleSettings behaviour for 172 Idea
There are no soft margins in CommonCodeStyleSettings.
2018-04-11 16:28:12 +03:00
Nikolay Krasko
ca7f25d52f 172: Fix compilation in 172 after AbstractApplicationUsagesCollector rename
See c299f7d10a93a055cc868a9d9d20d68cc47c35e3 to intellij_community
2018-04-11 16:28:12 +03:00
Nicolay Mitropolsky
18198ee33c 172: Uast-revert: test-data-revert 2018-04-11 16:28:11 +03:00
Nicolay Mitropolsky
a15d48c444 172: Uast-revert: reverting to previous rebase state 2018-04-11 16:28:11 +03:00
Nicolay Mitropolsky
c6bb0ad712 172: Uast-revert: AbstractKotlinRenderLogTest 2018-04-11 16:28:11 +03:00
Nicolay Mitropolsky
302bdebd3a 172: AbstractSlicerTest.kt reverted to previous rebase 2018-04-11 16:28:11 +03:00
Nicolay Mitropolsky
8c7269ea9a 172: KotlinUCollectionLiteralExpression: remove override modifier 2018-04-11 16:28:11 +03:00
Nicolay Mitropolsky
fb0b9221f9 172: IDEA-172-related compilation fix PluginTestCaseBase.addJdk(myFixture.projectDisposable 2018-04-11 16:28:10 +03:00
Natalia Selezneva
39d9ac1250 172: Remove textAttributes parameter from EditorCustomElementRenderer:paint 2018-04-11 16:28:10 +03:00
Nikolay Krasko
934f2d6e2c 172: Restore usage of PathUtil.getLocalFile in 172 idea
There's no VfsUtil.getLocalFile
2018-04-11 16:28:10 +03:00
Vyacheslav Gerasimov
7dcbb909a6 172: Set intellijSdk to 172.4343.14 2018-04-11 16:28:10 +03:00
Vyacheslav Gerasimov
e72007901a 172: Revert "UAST: override getFunctionalInterfaceType + test"
This reverts commit 92c23aa
2018-04-11 16:28:10 +03:00
Vyacheslav Gerasimov
8d3f71a04f 172: Revert "Quick Fixes: Support cross-language "Create from Usage" with Kotlin target"
This reverts commit 908bf71
2018-04-11 16:28:09 +03:00
Vyacheslav Gerasimov
747f397f40 172: Revert "Quick Fixes: Drop deprecated KotlinCommonIntentionActionsFactory"
This reverts commit ba0a91d
2018-04-11 16:28:09 +03:00
Vyacheslav Gerasimov
deb2ffb49f 172: Revert "Refactoring: Use modifier list in CallableInfo where possible"
This reverts commit 99be75c
2018-04-11 16:28:09 +03:00
Nikolay Krasko
577e6e5206 172: Try to remove unneeded commits in 172 branch
Revert "[Unneeded?] Revert "ExpressionOfTypeProcessor: get member name in read action""
This reverts commit 7ec59fc

Revert "[Unneeded] Revert "AbstractNavigateToLibraryTest: fix for invalid files""
This reverts commit 9e80c60

Revert "[Unneeded?] Revert "AbstractExtractionTest: fix for invalid files""
This reverts commit 0b2113b

Revert "[Unneeded] Revert "AbstractIntentionTest: `isApplicableOnPooled` made run under ProgressIndicator""
This reverts commit a41c247
2018-04-11 16:28:09 +03:00
Nikolay Krasko
9c38454c2e 172: [Unneeded?] Revert "ExpressionOfTypeProcessor: get member name in read action"
This reverts commit 32d8e0c72b877f0c0123bb56e0d92beaab410daa.
2018-04-11 16:28:09 +03:00
Nikolay Krasko
0df179de3b 172: [Unneeded] Revert "AbstractNavigateToLibraryTest: fix for invalid files"
This reverts commit e71b1757be6ca4b9ef49d65c6250a94f5f724f53.
2018-04-11 16:28:08 +03:00
Nikolay Krasko
8eb40466ee 172: [Unneeded?] Revert "AbstractExtractionTest: fix for invalid files"
This reverts commit b3b71ac53bb5150457ff228ecccb15060dd2de1f.
2018-04-11 16:28:08 +03:00
Nikolay Krasko
2cc2ea0ce1 172: [Unneeded] Revert "AbstractIntentionTest: isApplicableOnPooled made run under ProgressIndicator"
This reverts commit d1ad207fdbed6698ec352bd8b759f9ae62baebb3.
2018-04-11 16:28:08 +03:00
Nikolay Krasko
9de5b83f6e 172: Revert "UAST: Properly handle annotations on local variables"
This reverts commit 70de7cff5e23abf723009c8df8bc2df2f646a675.
2018-04-11 16:28:08 +03:00
Nikolay Krasko
9db35f27d7 172: Revert "UAST: Add testConvertTypeInAnnotation"
This reverts commit 7d1b28b2b6bc80411ef19bb7619181bee637cf20.
2018-04-11 16:28:08 +03:00
Nikolay Krasko
c106c6a5d2 172: Revert "UAST: Fix testPropertyWithAnnotation"
This reverts commit 36a405cb55198592ee017c7eed9bd50fd6433f22.
2018-04-11 16:28:07 +03:00
Nikolay Krasko
334ae82b04 172: Revert "UAST test data fixes: @null in render"
This reverts commit 2f366b8209206b32792919f35f896fc63ad4b0e5.
2018-04-11 16:28:07 +03:00
Nikolay Krasko
99f74af006 172: Revert "UAST test data fixes: LocalVariableWithAnnotationKt fix for variable type"
This reverts commit ef61beb53ae1030afe11b3d15a2750959136ad65.
2018-04-11 16:28:07 +03:00
Nikolay Krasko
b02ec40a4c 172: Revert "UAST: support for JvmDeclarationUElement"
This reverts commit db6a2390a22d4b35246cc4c6d246a5d7752f3506.
2018-04-11 16:28:07 +03:00
Nikolay Krasko
17a5ce809f 172: Revert "UAST: SimpleKotlinRenderLogTest.testWhenAndDestructing testdata fix"
This reverts commit c6c71dc5e82e5eec547fb6fe3fe6eb578e8183c9.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
5a072fffd2 172: Revert "UAST: StringTemplateComplex testdata fix"
This reverts commit 2ef0be9b2af14438aa7d899f78e2da327e9a8a07.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
72b4b2b9bf 172: Revert "Uast: AbstractKotlinUClass compilation fix"
This reverts commit 86ee036ae7d89f8acc885d54157d9b9ce5f2cb17.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
bf27a16144 172: Revert "Uast: SuperCalls.render.txt testdata fix"
This reverts commit 28a0267dc131ab37ede64f38de0dc2722aba1762.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
fbf722e0bd 172: Revert "Uast: Constructors.kt testData fixes"
This reverts commit 0d35e32b1ee7006b9c9febf1f8992fbbe3246230.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
633eafb902 172: Revert "Uast: WrappedUAnnotation as replacement for usage of JavaUAnnotation (KT-21025)"
This reverts commit 9701403889fbed93d9ea1e8fa4df58c720b3be72.
2018-04-11 16:28:06 +03:00
Nikolay Krasko
7b89b28015 172: Revert "Uast: AbstractKotlinUVariable annotations now are retrieved from Kotlin Psi, not from compiled (KT-21025)"
This reverts commit ebbfc4a3845159ba8f0e3d94a5f70489c348c403.
2018-04-11 16:28:05 +03:00
Nikolay Krasko
50419db87d 172: Revert "Uast: removing java-uast usage from KotlinUastLanguagePlugin and KotlinEnumConstantClassReference"
This reverts commit dfab8a6888a44d41253477eefb5db75368bb0803.
2018-04-11 16:28:05 +03:00
Nikolay Krasko
57789b8c3d 172: Revert "Uast: making AbstractKotlinUClass not inherit from AbstractJavaUClass"
This reverts commit d35f79963c810365451f09e98c148f9ce7fc3263.
2018-04-11 16:28:05 +03:00
Nikolay Krasko
f9af79c6d9 172: Revert "Uast: no more need to exclude UIdentifier from JvmDeclarationUElement check"
This reverts commit a92791a1f3cdec9ece602c5778eb04d5ffbd7505.
2018-04-11 16:28:05 +03:00
Nikolay Krasko
d402412208 172: Revert "Uast: uastParent made final in KotlinAbstractUElement"
This reverts commit 9b006787581cca8167714d07ad36aea195ff9c02.
2018-04-11 16:28:04 +03:00
Nikolay Krasko
affa1e232f 172: Revert "Uast: Constructors.kt testdata fixes"
This reverts commit a725f43588a6d2f2d1c79649f46849f8cbabbc8f.
2018-04-11 16:28:04 +03:00
Nikolay Krasko
b3a534431d 172: Revert "Uast: handling @receiver annotations"
This reverts commit 2f3b1485a30442db016e7f529d273483315067cf.
2018-04-11 16:28:04 +03:00
Nikolay Krasko
6881559ec3 172: Revert "Uast: KotlinAccessorCallExpression made implement JvmDeclarationUElement"
This reverts commit f75a5d8372ab3041d8a1a8073beaa96a79a50b03.
2018-04-11 16:28:04 +03:00
Nikolay Krasko
c6b888678f 172: [Spring] Revert "Fixes for 173 after 28.08.17 changes in IDEA (#1271)"
This reverts commit 3a37d18e5d65043fc99a28772303d948e0f89f6c.
2018-04-11 16:28:04 +03:00
Nikolay Krasko
060ed5db88 172: [Spring] Revert "Spring-Kotlin: Gutter repaired (KT-20550, KT-20566)"
This reverts commit 37752694df794cc07492d21a3924ee735e6d3b9d.
2018-04-11 16:28:03 +03:00
Nikolay Krasko
a4d5a93454 172: [Srping] Revert "Spring gutter icons SpringApiIcons -> SpringApiIcons.Gutter fix."
This reverts commit 2323e9dc75dbdf109564f1a0d28494e6b5e41075.
2018-04-11 16:28:03 +03:00
Nikolay Krasko
f6e829d7f7 172: [Spring?] Revert "SpringKotlinAutowiringInspection: getting rid of SpringJavaInjectionPointsAutowiringInspection"
This reverts commit d0446b0aed0707ef616484c9fda04915c08598b0.
2018-04-11 16:28:03 +03:00
Nikolay Krasko
1a8b58cd14 172: [Spring?] Revert "SpringTestFixtureExtension: option to forbid facet autoconfigure added"
This reverts commit 0c90753c5bd9ac3fa492a61589d2c8aad3b96cc1.
2018-04-11 16:28:03 +03:00
Nikolay Krasko
92a9ed62a2 172: [Spring] Revert "KotlinSpringComponentScanInspection made to support platform JamReferenceContributor"
This reverts commit f6a3b2eae4b0c49359bb477b320bc433988bec37.
2018-04-11 16:28:03 +03:00
Nikolay Krasko
1421895aa6 172: [Spring] Revert "Spring: removing needless EP-s because they ported to UAST in platform"
This reverts commit 9355f79c6b06fdcd365f23b40e93ea841b372b27.
2018-04-11 16:28:02 +03:00
Nikolay Krasko
368dd193ac 172: Revert "Fix compilation after moving to idea 173"
This reverts commit fe121cc6aeadf63ca2c2819c9c7df59cc81caf5d.
2018-04-11 16:28:02 +03:00
Nikolay Krasko
fbed7f9c08 172: Restore compilation against Idea 172
Revert "Fix proguard settings for 173"
4dadae2e9c8419bfda9d77f56797e68edbd8ecd7.

Revert "Fix compilation in 173"
0633aa925c8e862519ae699e5e3fe81a2bd227c2.

Revert "Fix compilation (MockParameterInfoUIContext.java)"
01a7fbfb60d786c56c54f4fd77d9f1233f599ede.

Revert "Fix compilation"
043a5dac796f6bf92bbe6c9573c1af07fadcfe4e.

Revert "Fix compatibility with BuildScriptDataBuilder API changes"
c7df054d0e90a86fbe67f23802e9be49b2117ded.
2018-04-11 16:28:02 +03:00
Nikolay Krasko
3b434eeb13 172: Restore KotlinCoreEnvironment for 172 branch
Revert "`KotlinCoreEnvironment`: set `ideaCompatibleBuildNumber = "173.1"`"
This reverts commit d3321cc77a6b55d8b8ff3c3a16473f2f3b378533.

Revert "`JvmFacade`-related tests repair"
This reverts commit faeacdd17d37a4d733b686f3a1d5e8fc6ea54d79.

Revert "Register new service and EPs added in 173"
This reverts commit 5d227c0e714c1b4316e7b8daca1f208ee423f448.
2018-04-11 16:28:02 +03:00
Nikolay Krasko
e090775974 172: Revert "KtLightAbstractAnnotation build fix for 173 (#1283)"
This reverts commit b401cc19e07ad632d61ca0d402dc6017f9559d18.
2018-04-11 16:28:02 +03:00
Nikolay Krasko
49cc4fe3b6 172: Revert 173 specific changes in language injection
Revert "`KotlinLanguageInjector` using Registry to enable annotation injections"
This reverts commit c16a1d598c2bacc849dd16fed974ccdbf8b80754.

Revert "`KotlinLanguageInjector#injectInAnnotationCall` optimization: using `PsiClassNamePatternCondition` to avoid calling `getResolvedCall`"
This reverts commit f9eaaeab61b1dd50de9341846e129b58eb47f247.

Revert "`KotlinLanguageInjector` can inject into files modified for autocompletion"
This reverts commit 7212b22b083023201700696d775355051321b120.

Revert "`KotlinLanguageInjector` understands patterns-injections into Java annotations"
This reverts commit 45847b515bdfd27cfa5d23ff8b9147054ffa6f60.
2018-04-11 16:28:01 +03:00
Nikolay Krasko
1dcaaf1fe4 172: Revert "Fix GradleNoduleBuilder use qualified names check"
This reverts commit aec020a404d367195d58c7bb5d30185bfb85f202.
2018-04-11 16:28:01 +03:00
Nikolay Krasko
b9f16920aa 172: Revert "idea-version set to since-build="173.1" until-build="181.*""
This reverts commit 48701780db05e3c0928521f5fb95a5b89d417d95.
2018-04-11 16:28:01 +03:00
Nikolay Krasko
2d2b296f79 172: Revert "Update file structure tests as FileStructurePopup api was changed in 173"
This reverts commit 5244d48fde8e373b046a8ccb602a280b946f8d41.
2018-04-11 16:28:01 +03:00
Nikolay Krasko
df4b345def 172: Revert "Workaround for CoreEnvironment initialization: explicitly setting versions for extensions"
This reverts commit 2e50bd19a83ab4a4f2b3a5d0cc09300ec1b7b1f7.
2018-04-11 16:28:01 +03:00
Nikolay Krasko
c255df0a74 172: Revert "Fix find usages tests in 173 (run via ProgressIndicator)"
This reverts commit 1363306d562ad7ef5af9fd1642e139aa23abdd32.
2018-04-11 16:28:00 +03:00
Nikolay Krasko
1821007fda 172: Revert "AbstractJavaToKotlinConverterForWebDemoTest: setup fix: JvmElementProvider and JavaModuleSystem added"
This reverts commit e1f340f59a9ec83c38ad2a0fe32ba47dbf4cdfb1.
2018-04-11 16:28:00 +03:00
Nikolay Krasko
d6cc3d64fe 172: Revert "EdtTestUtil.runInEdtAndWait fix for proper user action emulation"
This reverts commit 4ebe750d36e86545a72177f91dc3baaa235fa92d.
2018-04-11 16:28:00 +03:00
Nikolay Krasko
1010c1285a 172: Revert "RecursiveMethodCallMarkerInfo and SuspendCallMarkerInfo forced to target Leaf-elements"
This reverts commit c78ec71e17c09ddb1094e44c84d9a1b92a3b509f.
2018-04-11 16:28:00 +03:00
Nikolay Krasko
984d9feeae 172: Revert "AbstractQuickFixTest: FORCE_PACKAGE_FOLDER directive added"
This reverts commit 91e10ae8bb6d2748a7a8b02fa661daa4cb00d0f8.
2018-04-11 16:28:00 +03:00
Nikolay Krasko
67303f925e 172: Revert "Ultimate-plugin: multiplePropertiesAnnotationConfig.kt test data fixes"
This reverts commit 4f2ee7359f8dfd3322329799475ff99dd88ed756.
2018-04-11 16:27:59 +03:00
Nikolay Krasko
47df9bc428 172: Revert "Drop new Kotlin Dsl gradle project wizard which has been merged to idea"
This reverts commit 742d337ad722fe6ddcd6ad5dab27d52eda970489.
2018-04-11 16:27:59 +03:00
Nikolay Krasko
b56a0550a4 172: Revert "Fix formatting for new kotlin dsl gradle project build script"
This reverts commit 75a46e66d18f69ff196749ba436b572b4462ea0d.
2018-04-11 16:27:59 +03:00
Nikolay Krasko
d9008bec80 172: Revert "Move: Fix applicability check in IDEA 173"
This reverts commit 74c28b2a564a859a20b3f799df24405ba634c175.
2018-04-11 16:27:59 +03:00
Nikolay Krasko
bac132d94d 172: Revert "Line Markers: Respect subclass module when filtering out duplicates"
This reverts commit 8df0a58586abf42572aff15d4bdd70e51e5cad29.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
ee77f865cd 172: Revert "Drop missing gradle extensions from gradle.xml"
This reverts commit 1f7a145942f0489e18b281878ac711e7505dce15.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
00c9ed8861 172: Revert "Update file name replace in QuickFix tests"
This reverts commit 01051618aa21c3502463c699f1d178136ef7c6b6.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
a7d705b5d8 172: Revert "Fix inAnnotation test in 173 branch"
This reverts commit 955842f2009a2c5aa9ac955340696bd7e1a2651d.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
25b10238e9 172: Revert "Safe Delete: Suppress walking through light field initializer"
This reverts commit 34d3173ba79535591adb3e55a7af7cb9d1e49e40.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
afc37b9fed 172: Revert "Data Inflow: Support grouping by leaf expressions"
This reverts commit d5af2db2f259c7d55d38be73b9a5136e3aefd580.
2018-04-11 16:27:58 +03:00
Nikolay Krasko
236191bb89 172: Revert "Data Inflow: Support grouping by expression nullability"
This reverts commit e608f1ca159d55df39c8f33704220f360d54ba92.
2018-04-11 16:27:57 +03:00
Nikolay Krasko
81a2e2a340 172: Revert "Fixing non-running tests, that used MockApplication environment"
This reverts commit 49fb7aab2a67f09c2832d759448ad07c1bb3023a.
2018-04-11 16:27:57 +03:00
Nikolay Krasko
56ab1f8add 172: [172] Revert "Set correct until-build for Idea 173 plugin"
This reverts commit 0f378217684879491c3184b7db84e3ce3750a8b5.
2018-04-11 16:27:57 +03:00
Nikolay Krasko
99acec0970 172: [Tests] Revert "Allow different diagnostics in Javac tests - workaround for IDEA-184289"
This reverts commit 5212153463dcefbde28b4ca1814f6888fa9c57c1.
2018-04-11 16:27:56 +03:00
Nikolay Krasko
4c8f366e46 172: [Tests] Revert "Modify incremental test in 173 branch - files are not create anymore"
This reverts commit 0cc5d163d7d620565a28681dab31f3d3061a1324.
2018-04-11 16:27:56 +03:00
Nikolay Krasko
fa3edbf01e 172: == 173 -> 172 ^^^ == 2018-04-11 16:27:56 +03:00
Nikolay Krasko
520b3e2f95 Add branches tree description 2018-04-11 16:27:56 +03:00
Dmitry Savvinov
d438988fc6 Fix javadoc for StorageManager.createLazyValueWithPostCompute 2018-04-11 16:03:19 +03:00
Mikhail Glukhikh
e4275cc027 Refactor sealed subclass to object: add tests, fix type parameter case 2018-04-11 14:51:00 +03:00
Gabryel Monteiro
df7968678a Add inspection: Refactor sealed sub-class to object #KT-20305 Fixed 2018-04-11 14:51:00 +03:00
Dmitry Petrov
7cf6c70fbf Use NoScopeRecordCliBindingTrace as default trace in GenerationUtils
NB we use 'Intrinsics.areEqual(Double, Double)' and
'Intrinsics.areEqual(Float, Float)', because right now we take
nullability from the inferred type of the expression (which is 'Any?' in
the test cases).
We should probably reconsider this in case of more exact information
available from the data flow analysis, e.g., in case of

  fun test(x: Any?) =
    x is Serializable && x is Double? && x == 0.0

We statically know that 'x' is not null in 'x == 0.0' (although it's
neither nullability of it's numeric type 'Double?' nor the nullability
of the inferred type 'Any?').

There might be some edge effects in the performance related to byte code
size and preventive unboxing and so on.
2018-04-11 10:49:02 +03:00
Dmitry Petrov
665d6c82ad Fix Android tests for IEEE 754 2018-04-11 10:49:02 +03:00
Ilmir Usmanov
2cfe387bab Move coroutines to kotlin.coroutines package: compiler
Generate continuation type as kotlin.coroutines.Continuaion. This code will
fail at runtime since there is no stdlib backing this change yet.
However, in order to generate compatible stdlib we need a compiler, which
generates continuation type as kotlin.coroutines.Continuation.
Thus, firstly we support the change in the compiler, make it bootstrap
compiler and only then change stdlib and tests accordingly.
 #KT-23362
2018-04-10 22:51:46 +03:00
Anton Bannykh
f8c0c54a66 Revert "Clean up test skips after KT-17137"
This reverts commit 715d5e9
2018-04-10 20:45:07 +03:00
Anton Bannykh
703611a15c Revert "JS: remove -XtypedArraysEnabled flag (always true now)"
This reverts commit 4a5e9bb
2018-04-10 20:45:07 +03:00
Mikhael Bogdanov
56d1184515 Restrict conditions for @JvmDefault super calls
Condition was too strict
  if @JvmDefault implicitly hidden by class in inheritance.
  Diagnostic is redundant cause there isn't breaking
  change depending on interface method generation strategy and
  delegating stub generation in inheriting class.
2018-04-10 16:33:26 +02:00
Mikhael Bogdanov
e23c406285 Minor. Avoid recursion 2018-04-10 16:33:25 +02:00
Mikhael Bogdanov
6d1af263ba Restrict conditions for @JvmDefault super calls
Condition was too strict if we actually make super call
  through super class. Diagnostic is redundant cause there isn't breaking
  change depending on interface method generation strategy.
2018-04-10 16:33:25 +02:00
Mikhael Bogdanov
5f235a8342 Update documentation for @JvmDefault 2018-04-10 16:33:24 +02:00
Dmitry Savvinov
2d8e4e752c Fallback to Any type in case supertypes are empty
This can happen e.g. if all supertypes were on the cycle (A : B, B : A)
-- then SupertypesLoopChecker will cut all supertypes that are on cycle,
leaving set of supertypes empty.

Some clients in the compiler are not ready to work with empty list of
supertypes -- notably, CommonSupertypes.

^KT-23029 Fixed
2018-04-10 17:25:43 +03:00
Ilmir Usmanov
eb3b9032d6 Add synthetic flag to generated private suspend functions
Private suspend functions need to be generated as package-local, since
they are called from their continuations.
However, this means that they can be called from Java, which breaks
their private visibility.
Adding synthetic to them fixes the issue.
 #KT-17584: Fixed
2018-04-10 17:25:12 +03:00
Natalia Selezneva
a487543827 Fix Repl System.in wrapper. Do not exit after readline in user code
^KT-23622 Fixed
2018-04-10 16:14:23 +03:00
Roman Artemev
3bc323807f Fix function lookup in modules with similar names [KT-23582] 2018-04-10 15:58:30 +03:00
Roman Artemev
96b6cec33f Add warning in case similar module names 2018-04-10 15:58:30 +03:00
Roman Artemev
4cdd121c21 Add test for issue KT-23582 2018-04-10 15:58:30 +03:00
Tudor Luca
129c0e4c9c Updates ReadMe.md to name the Sublime Text Package
Changes the link name for the Sublime Text Package from "TextMate" to Sublime Text
2017-05-18 13:11:57 +03:00
20190 changed files with 1323276 additions and 308765 deletions

10
.bunch Normal file
View File

@@ -0,0 +1,10 @@
183
182
181_182
173_181_182
as31_173_181_182
as32_181_182
as33_182
as34
191
cidr183

1
.gitignore vendored
View File

@@ -38,3 +38,4 @@ build/
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
kotlin-ultimate/

9
.idea/ant.xml generated
View File

@@ -1,17 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />
<buildFile url="file://$PROJECT_DIR$/TeamCityBuild.xml">
<maximumHeapSize value="512" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/idea-runner/runner.xml" />
<buildFile url="file://$PROJECT_DIR$/libraries/build-docs.xml">
<maximumHeapSize value="1024" />
<properties>
<property name="dokka.path" value="../../dokka" />
</properties>
</buildFile>
<buildFile url="file://$PROJECT_DIR$/TeamCityRelay.xml" />
</component>
</project>

View File

@@ -1,289 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="PREFER_LONGER_NAMES" value="false" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="java.awt" withSubpackages="false" static="false" />
<package name="javax.tools" withSubpackages="true" static="false" />
<package name="javax.swing" withSubpackages="false" static="false" />
</value>
</option>
<option name="STATIC_METHODS_ORDER_WEIGHT" value="5" />
<option name="METHODS_ORDER_WEIGHT" value="4" />
<option name="RIGHT_MARGIN" value="140" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CFML">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="CoffeeScript">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="GSP">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Groovy">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="Scala">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

View File

@@ -1,50 +1,7 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="RIGHT_MARGIN" value="140" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<GroovyCodeStyleSettings>
<option name="STATIC_METHODS_ORDER_WEIGHT" value="5" />
<option name="METHODS_ORDER_WEIGHT" value="4" />
</GroovyCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="PREFER_LONGER_NAMES" value="false" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
@@ -56,102 +13,15 @@
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CONTINUATION_INDENT_IN_PARAMETER_LISTS" value="false" />
<option name="CONTINUATION_INDENT_IN_ARGUMENT_LISTS" value="false" />
<option name="CONTINUATION_INDENT_FOR_EXPRESSION_BODIES" value="false" />
<option name="CONTINUATION_INDENT_FOR_CHAINED_CALLS" value="false" />
<option name="CONTINUATION_INDENT_IN_SUPERTYPE_LISTS" value="false" />
<option name="CONTINUATION_INDENT_IN_IF_CONDITIONS" value="false" />
<option name="WRAP_EXPRESSION_BODY_FUNCTIONS" value="1" />
<option name="IF_RPAREN_ON_NEW_LINE" value="true" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CFML">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
</codeStyleSettings>
<codeStyleSettings language="CoffeeScript">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="GSP">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Groovy">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
@@ -192,9 +62,6 @@
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<indentOptions>
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
@@ -221,72 +88,17 @@
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Scala">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
</codeStyleSettings>
</code_scheme>
</component>

View File

@@ -3,6 +3,7 @@
<words>
<w>cidr</w>
<w>foldable</w>
<w>redirector</w>
</words>
</dictionary>
</component>

View File

@@ -7,9 +7,9 @@
<w>fqname</w>
<w>goto</w>
<w>gradle</w>
<w>infos</w>
<w>intrinsics</w>
<w>kdoc</w>
<w>kompiler</w>
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>

View File

@@ -4,6 +4,7 @@
<w>ctor</w>
<w>inlining</w>
<w>interner</w>
<w>intrinsicify</w>
<w>kclass</w>
<w>lookups</w>
<w>minification</w>

7
.idea/dictionaries/dmitriy_dolovov.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>konan</w>
</words>
</dictionary>
</component>

View File

@@ -7,6 +7,7 @@
<w>experimentality</w>
<w>insn</w>
<w>liveness</w>
<w>parameterless</w>
</words>
</dictionary>
</component>
</component>

View File

@@ -1,12 +1,16 @@
<component name="ProjectDictionaryState">
<dictionary name="yan">
<words>
<w>debuggee</w>
<w>deserializes</w>
<w>hacky</w>
<w>impls</w>
<w>kapt</w>
<w>parceler</w>
<w>repl</w>
<w>uast</w>
<w>unboxed</w>
<w>unmute</w>
</words>
</dictionary>
</component>

3
.idea/encodings.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/libraries" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example-with-library" charset="UTF-8" />
@@ -14,6 +14,7 @@
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin-test" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-sam-with-receiver" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-serialization" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-osgi-bundle" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js" charset="UTF-8" />

View File

@@ -55,9 +55,6 @@
<inspection_tool class="DoubleCheckedLocking" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreOnVolatileVariables" value="true" />
</inspection_tool>
<inspection_tool class="DuplicateCondition" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreSideEffectConditions" value="true" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_reportEmptyBlocks" value="false" />
</inspection_tool>
@@ -98,6 +95,30 @@
<option name="insideTryAllowed" value="false" />
</inspection_tool>
<inspection_tool class="IfStatementWithIdenticalBranches" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Not null starting from 181. Use getProgressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#copyFrom" reason="Absent in 173. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettingsManager#copy" reason="Removed since 181. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.notification.NotificationAction#createSimple" reason="Absent in 173." />
<Problem reference="com.intellij.notification.NotificationAction#create" reason="Absent in 173." />
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
<Problem reference="com.intellij.execution.configurations.RunConfigurationBase" reason="Generalized in 183. Use RunConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.LocatableConfigurationBase" reason="Generalized in 183. Use LocatableConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.ModuleBasedConfiguration" reason="Generalized in 183. Use ModuleBasedConfigurationElement instead." />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<Problem reference="com.intellij.testFramework.codeInsight.hierarchy.HierarchyViewTestFixture" reason="Absent in &lt;= 181. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="org.jetbrains.kotlin.test.HierarchyViewTestFixtureCompat" reason="Do not use the wrapper for 181 directly. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="com.intellij.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
</list>
</option>
</inspection_tool>
<inspection_tool class="InnerClassMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="InstanceofCatchParameter" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="InstanceofIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -275,13 +296,28 @@
<inspection_tool class="PackageDirectoryMismatch" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="all except testData" level="WARNING" enabled="true" />
</inspection_tool>
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
</inspection_tool>
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
</list>
</option>
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">
<option name="fromVersion" value="2.4" />
<option name="toVersion" value="3.1" />
</inspection_tool>
<inspection_tool class="Reformat" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="Reformat" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="processChangedFilesOnly" value="true" />
</inspection_tool>
<inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreLazyOperators" value="true" />
<option name="ignoreObscureOperators" value="true" />

36
.idea/misc.xml generated
View File

@@ -6,8 +6,10 @@
</properties>
</component>
<component name="EntryPointsManager">
<list size="1">
<list size="3">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
<item index="1" class="java.lang.String" itemvalue="org.gradle.api.tasks.TaskAction" />
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="FacetAutodetectingManager">
@@ -44,6 +46,38 @@
</list>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myNullables">
<value>
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="javax.validation.constraints.NotNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>

View File

@@ -1,171 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<ADDITIONAL_INDENT_OPTIONS fileType="css">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="groovy">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="gsp">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="haml">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="js">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="jsp">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="php">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="py">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="sass">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="scala">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="sql">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="xml">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="yml">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<codeStyleSettings language="JAVA">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions />
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="PHP">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

View File

@@ -10,9 +10,6 @@
</option>
<option name="taskNames">
<list>
<option value=":kotlin-runtime:clean" />
<option value=":kotlin-stdlib:clean" />
<option value=":kotlin-reflect:clean" />
<option value=":tools:binary-compatibility-validator:cleanTest" />
<option value=":tools:binary-compatibility-validator:test" />
</list>

View File

@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run IR test in node.js" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/js/js.translator/testData/package.json" />
<command value="run" />
<scripts>
<script value="runIrTestInNode" />
</scripts>
<arguments value="$FilePath$" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>

6
.idea/upsource.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UpsourceSharedProjectSettings">
<option name="upsourceUrl" value="https://upsource.jetbrains.com/" />
</component>
</project>

3
.idea/vcs.xml generated
View File

@@ -25,5 +25,4 @@
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
</project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
<a href="http://slack.kotlinlang.org/"><img src="http://slack.kotlinlang.org/badge.svg" height="20"></a>
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
@@ -10,7 +9,7 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](https://try.kotlinlang.org/)
* [Try Kotlin](https://play.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/)
@@ -23,7 +22,7 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Kotlin Eclipse Plugin](https://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin TextMate Bundle](https://github.com/vkostyukov/kotlin-sublime-package)
* [Kotlin Sublime Text Package](https://github.com/vkostyukov/kotlin-sublime-package)
## Build environment requirements
@@ -81,16 +80,34 @@ command line parameters on the first run:
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately with Maven.
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
### Building for different versions of IntelliJ IDEA and Android Studio
Kotlin plugin is indented to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
Usually, there's no need to care about multiple platforms as all features are enabled everywhere by default. Additional counterparts should be created if there's an expected difference in behavior or an incompatible API usage is required **and** there's no reasonable workaround to save source compatibility. Kotlin plugin contains a pre-commit check that shows a warning if a file has been updated without its counterparts.
Development for some particular platform is possible after 'switching' that can be done with [Bunch Tool](https://github.com/JetBrains/bunches/releases) from the command line.
```sh
cd kotlin-project-dir
# switching to IntelliJ Idea 2018.2
bunch switch . 182
```
## <a name="working-in-idea"></a> Working with the project in IntelliJ IDEA
Working with the Kotlin project requires IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
Working with the Kotlin project requires at least IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
To import the project in Intellij choose project directory in Open project dialog. Then, after project opened, Select
After cloning the project, to import the project in Intellij choose the project directory in the Open project dialog. Then, after project opened, Select
`File` -> `New...` -> `Module from Existing Sources` in the menu, and select `build.gradle.kts` file in the project's root folder.
In the import dialog, select `use default gradle wrapper`.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` in the Gradle runner settings.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings after importing the project.
At this time, you can use the latest released 1.2.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
@@ -121,7 +138,7 @@ We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://slack.kotlinlang.org/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20and%20State:%20Open) which should find all open Kotlin issues that are marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
@@ -133,14 +150,16 @@ In particular it'd be great if all functions included a nice example of how to u
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.
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 to run the code generator. The existing templates can be used as examples for creating new ones.
Also the [JavaScript back-end](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
If you want to contribute a new language feature, it is important to discuss it through a [KEEP](https://github.com/Kotlin/KEEP) first and get an approval from the language designers. This way you'll make sure your work will be in line with the overall language evolution plan and no other design decisions or considerations will block its acceptance.
## Submitting patches
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).
The best way to submit a patch is to [fork the project on GitHub](https://help.github.com/articles/fork-a-repo/) and 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
@@ -149,3 +168,14 @@ git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.
## Checklist
Before submitting the pull request, make sure that you can say "YES" to each point in this short checklist:
- You provided the link to the related issue(s) from YouTrack
- You made a reasonable amount of changes related only to the provided issues
- You can explain changes made in the pull request
- You ran the build locally and verified new functionality
- You ran related tests locally and they passed
- You do not have merge commits in the pull request

View File

@@ -1,121 +0,0 @@
<project name="Kotlin CI Steps" default="none">
<import file="common.xml" optional="false"/>
<property name="kotlin-home" value="${output}/kotlinc"/>
<property name="build.number" value="snapshot"/>
<property name="fail.on.plugin.verifier.error" value="true"/>
<property name="version_substitute_dir" value="${basedir}/versions_temp/"/>
<property name="artifact.output.path" value="${basedir}/dist/artifacts/ideaPlugin"/>
<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="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="pluginArtifactDir" value="Kotlin" />
<macrodef name="echoprop">
<attribute name="prop"/>
<sequential>
<echo>@{prop}=${@{prop}}</echo>
</sequential>
</macrodef>
<echoprop prop="os.name"/>
<echoprop prop="os.version"/>
<echoprop prop="os.arch"/>
<echoprop prop="java.home"/>
<echoprop prop="java.vendor"/>
<echoprop prop="java.version"/>
<echoprop prop="user.name"/>
<echoprop prop="user.home"/>
<echoprop prop="user.dir"/>
<macrodef name="run-gradle">
<attribute name="tasks" />
<attribute name="args" default="" />
<sequential>
<java classname="org.gradle.wrapper.GradleWrapperMain"
fork="true"
dir="${basedir}"
failonerror="true"
timeout="4000000"
maxmemory="400m"
taskname="gradle">
<classpath>
<pathelement location="${basedir}/gradle/wrapper/gradle-wrapper.jar"/>
</classpath>
<arg line="--no-daemon" />
<arg line="@{tasks}" />
<arg line="@{args}" />
</java>
</sequential>
</macrodef>
<target name="cleanupArtifacts">
<run-gradle tasks="cleanupArtifacts" />
</target>
<target name="zip-compiler">
<run-gradle tasks="zipCompiler" args="-PdeployVersion=${build.number}" />
</target>
<target name="zip-test-data">
<run-gradle tasks="zipTestData" />
</target>
<target name="writeCompilerVersionToTemplateFile">
<!-- empty, version is written in gradle build -->
</target>
<target name="writePluginVersionToTemplateFile">
<run-gradle tasks="writePluginVersion" args="-PpluginVersion=${plugin.xml.version.number}" />
</target>
<target name="zipArtifacts">
<run-gradle tasks="zipPlugin" args="-PpluginArtifactDir=${pluginArtifactDir} -PpluginZipPath=${plugin.zip}"/>
</target>
<macrodef name="print-statistic">
<attribute name="key"/>
<attribute name="value"/>
<sequential>
<echo message="##teamcity[buildStatisticValue key='@{key}' value='@{value}']"/>
</sequential>
</macrodef>
<macrodef name="print-file-size-statistic">
<attribute name="path"/>
<attribute name="file-name"/>
<sequential>
<local name="file.size"/>
<length file="@{path}/@{file-name}" property="file.size"/>
<print-statistic key="@{file-name} size" value="${file.size}"/>
</sequential>
</macrodef>
<target name="printStatistics">
<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-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="kotlin-test.js"/>
<print-file-size-statistic path="${basedir}/libraries/stdlib/js/build/classes/main" file-name="kotlin.meta.js"/>
</target>
<target name="none">
<fail message="Either specify pre_build or post_build"/>
</target>
</project>

View File

@@ -1,92 +0,0 @@
<project name="Change plugins version" default="change-version">
<property name="relay.origin.version" value="1.0.0-beta-2423"/>
<property name="relay.substitute.version" value="1.0.0-beta-2423-IJ-141-3"/>
<property name="relay.plugins.dir" value="artifacts"/>
<property name="relay.unpack.directory" value="relay-dir"/>
<macrodef name="substituteRegexpInFile">
<attribute name="src.file"/>
<attribute name="output.dir"/>
<attribute name="origin.version"/>
<attribute name="substituted.version"/>
<sequential>
<copy todir="@{output.dir}">
<fileset file="@{src.file}"/>
<filterchain>
<replaceregex pattern="@{origin.version}" replace="@{substituted.version}" />
</filterchain>
</copy>
</sequential>
</macrodef>
<macrodef name="substitudeVersionInPlugin">
<attribute name="plugin.path"/>
<attribute name="plugin.jar.name"/>
<attribute name="origin.version"/>
<attribute name="substituted.version"/>
<attribute name="plugin.subdir"/>
<attribute name="output-dir" default="@{substituted.version}"/>
<attribute name="output.plugin.file.name" default="@{plugin.jar.name}-@{substituted.version}.zip"/>
<attribute name="temp.origin.dir" default="${relay.unpack.directory}/@{plugin.jar.name}/plugin-origin"/>
<attribute name="temp.substitute.dir" default="${relay.unpack.directory}/@{plugin.jar.name}/substitute"/>
<sequential>
<delete dir="${relay.unpack.directory}/@{plugin.jar.name}"/>
<mkdir dir="${relay.unpack.directory}/@{plugin.jar.name}"/>
<unzip src="@{plugin.path}" dest="@{temp.origin.dir}">
<patternset>
<include name="**/lib/@{plugin.jar.name}.jar" />
</patternset>
<flattenmapper/>
</unzip>
<unzip src="@{temp.origin.dir}/@{plugin.jar.name}.jar" dest="@{temp.origin.dir}">
<patternset>
<include name="**/META-INF/plugin.xml" />
</patternset>
<flattenmapper/>
</unzip>
<substituteRegexpInFile
src.file="@{temp.origin.dir}/plugin.xml" output.dir="@{temp.substitute.dir}"
origin.version="@{origin.version}" substituted.version="@{substituted.version}"/>
<!-- Copy updated file back into jar -->
<copy file="@{temp.origin.dir}/@{plugin.jar.name}.jar" todir="@{temp.substitute.dir}"/>
<jar destfile="@{temp.substitute.dir}/@{plugin.jar.name}.jar" update="true">
<zipfileset file="@{temp.substitute.dir}/plugin.xml" prefix="META-INF"/>
</jar>
<!-- Pack updated plugin.jar back to zip file -->
<copy file="@{plugin.path}" tofile="@{substituted.version}/@{output.plugin.file.name}"/>
<zip destfile="@{substituted.version}/@{output.plugin.file.name}" update="true">
<zipfileset file="@{temp.substitute.dir}/@{plugin.jar.name}.jar" prefix="@{plugin.subdir}/lib"/>
</zip>
</sequential>
</macrodef>
<target name="change-version" description="Repack plugin with other version">
<delete dir="${relay.unpack.directory}"/>
<delete dir="${relay.substitute.version}"/>
<mkdir dir="${relay.unpack.directory}"/>
<mkdir dir="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-plugin"
plugin.path="${relay.plugins.dir}/kotlin-plugin-${relay.origin.version}.zip"
origin.version="${relay.origin.version}"
plugin.subdir="Kotlin"
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"
origin.version="${relay.origin.version}"
plugin.subdir="KotlinAndroidExtensions"
substituted.version="${relay.substitute.version}"/>
</target>
</project>

View File

@@ -8,7 +8,7 @@ plugins {
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(projectDist(":kotlin-stdlib"))
compile(project(":kotlin-stdlib"))
}
sourceSets {
@@ -18,7 +18,7 @@ sourceSets {
runtimeJar {
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar")
manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar")
}
dist()

View File

@@ -38,7 +38,7 @@ internal object KotlinAntTaskUtil {
}
val compilerJar: File by jar("kotlin-compiler.jar")
val runtimeJar: File by jar("kotlin-runtime.jar")
val runtimeJar: File by jar("kotlin-stdlib.jar")
val reflectJar: File by jar("kotlin-reflect.jar")
private fun jar(name: String) = lazy {

View File

@@ -14,17 +14,17 @@ dependencies {
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util") }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":compiler:cli-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(projectDist(":kotlin-stdlib"))
testCompile(project(":kotlin-stdlib"))
testCompileOnly(intellijDep()) { includeJars("openapi") }
testRuntime(projectDist(":kotlin-reflect"))
testRuntime(project(":kotlin-reflect"))
}
sourceSets {

View File

@@ -0,0 +1,81 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.config.isPreRelease
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
import kotlin.reflect.KClass
interface BuildMetaInfo {
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 ownVersion: Int
val coroutinesVersion: Int
val multiplatformVersion: Int
}
abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass: KClass<T>) {
protected abstract fun create(
isEAP: Boolean,
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): T
fun create(args: CommonCompilerArguments): T {
val languageVersion = args.languageVersion?.let((LanguageVersion)::fromVersionString) ?: LanguageVersion.LATEST_STABLE
return create(
isEAP = languageVersion.isPreRelease(),
compilerBuildVersion = KotlinCompilerVersion.VERSION,
languageVersionString = languageVersion.versionString,
apiVersionString = args.apiVersion ?: languageVersion.versionString,
coroutinesEnable = args.coroutinesState == CommonCompilerArguments.ENABLE,
coroutinesWarn = args.coroutinesState == CommonCompilerArguments.WARN,
coroutinesError = args.coroutinesState == CommonCompilerArguments.ERROR,
multiplatformEnable = args.multiPlatform,
ownVersion = OWN_VERSION,
coroutinesVersion = COROUTINES_VERSION,
multiplatformVersion = MULTIPLATFORM_VERSION,
metadataVersionArray = args.metadataVersion?.let((BinaryVersion)::parseVersionArray)
)
}
fun serializeToString(args: CommonCompilerArguments): String =
serializeToString(create(args))
fun serializeToString(info: T): String =
serializeToPlainText(info, metaInfoClass)
fun deserializeFromString(str: String): T? =
deserializeFromPlainText(str, metaInfoClass)
companion object {
const val OWN_VERSION: Int = 0
const val COROUTINES_VERSION: Int = 0
const val MULTIPLATFORM_VERSION: Int = 0
}
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
/**
* If you want to add a new field, check its type is supported by [serializeToPlainText], [deserializeFromPlainText]
*/
data class CommonBuildMetaInfo(
override val isEAP: Boolean,
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
override val metadataVersionPatch: Int,
override val ownVersion: Int,
override val coroutinesVersion: Int,
override val multiplatformVersion: Int
) : BuildMetaInfo {
companion object : BuildMetaInfoFactory<CommonBuildMetaInfo>(CommonBuildMetaInfo::class) {
override fun create(
isEAP: Boolean,
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): CommonBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JvmMetadataVersion) ?: JvmMetadataVersion.INSTANCE
return CommonBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.utils.JsMetadataVersion
/**
* If you want to add a new field, check its type is supported by [serializeToPlainText], [deserializeFromPlainText]
*/
data class JsBuildMetaInfo(
override val isEAP: Boolean,
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
override val metadataVersionPatch: Int,
override val ownVersion: Int,
override val coroutinesVersion: Int,
override val multiplatformVersion: Int
) : BuildMetaInfo {
companion object : BuildMetaInfoFactory<JsBuildMetaInfo>(JsBuildMetaInfo::class) {
override fun create(
isEAP: Boolean,
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): JsBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JsMetadataVersion) ?: JsMetadataVersion.INSTANCE
return JsBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}
}

View File

@@ -16,66 +16,66 @@
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.config.isPreRelease
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.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)
override val isEAP: Boolean,
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
override val metadataVersionPatch: Int,
val bytecodeVersionMajor: Int,
val bytecodeVersionMinor: Int,
val bytecodeVersionPatch: Int,
override val ownVersion: Int,
override val coroutinesVersion: Int,
override val multiplatformVersion: Int
) : BuildMetaInfo {
companion object : BuildMetaInfoFactory<JvmBuildMetaInfo>(JvmBuildMetaInfo::class) {
override fun create(
isEAP: Boolean,
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): JvmBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JvmMetadataVersion) ?: JvmMetadataVersion.INSTANCE
return JvmBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
bytecodeVersionMajor = JvmBytecodeBinaryVersion.INSTANCE.major,
bytecodeVersionMinor = JvmBytecodeBinaryVersion.INSTANCE.minor,
bytecodeVersionPatch = JvmBytecodeBinaryVersion.INSTANCE.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}
}
fun JvmBuildMetaInfo(args: CommonCompilerArguments): JvmBuildMetaInfo {
val languageVersion = args.languageVersion?.let((LanguageVersion)::fromVersionString) ?: LanguageVersion.LATEST_STABLE
return JvmBuildMetaInfo(
isEAP = languageVersion.isPreRelease(),
compilerBuildVersion = KotlinCompilerVersion.VERSION,
languageVersionString = languageVersion.versionString,
apiVersionString = args.apiVersion ?: languageVersion.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

@@ -17,7 +17,7 @@
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
import org.jetbrains.kotlin.load.kotlin.ModuleMapping
import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping
import org.jetbrains.kotlin.utils.sure
import java.io.File

View File

@@ -0,0 +1,9 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
val DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS = listOf("kt", "kts")

View File

@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
import kotlin.reflect.KProperty1;
@@ -26,6 +27,7 @@ import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
import org.jetbrains.kotlin.cli.common.arguments.ParseCommandLineArgumentsKt;
import org.jetbrains.kotlin.utils.StringsKt;
@@ -46,6 +48,7 @@ public class ArgumentUtils {
Class<? extends CommonToolArguments> argumentsClass = arguments.getClass();
convertArgumentsToStringList(arguments, argumentsClass.newInstance(), JvmClassMappingKt.getKotlinClass(argumentsClass), result);
result.addAll(arguments.getFreeArgs());
result.addAll(CollectionsKt.map(arguments.getInternalArguments(), InternalArgument::getStringRepresentation));
return result;
}

View File

@@ -0,0 +1,202 @@
/*
* 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.incremental
import com.intellij.util.io.EnumeratorStringDescriptor
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolver
import org.jetbrains.kotlin.metadata.deserialization.TypeTable
import org.jetbrains.kotlin.metadata.deserialization.supertypes
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import java.io.File
import java.util.*
/**
* Incremental cache common for JVM and JS, ClassName type aware
*/
interface IncrementalCacheCommon {
val thisWithDependentCaches: Iterable<AbstractIncrementalCache<*>>
fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName>
fun getSubtypesOf(className: FqName): Sequence<FqName>
fun getSourceFileIfClass(fqName: FqName): File?
fun markDirty(removedAndCompiledSources: Collection<File>)
fun clearCacheForRemovedClasses(changesCollector: ChangesCollector)
fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File>
fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl)
fun dump(): String
}
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
private val COMPLEMENTARY_FILES = "complementary-files"
@JvmStatic
protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic
protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
}
private val dependents = arrayListOf<AbstractIncrementalCache<ClassName>>()
fun addDependentCache(cache: AbstractIncrementalCache<ClassName>) {
dependents.add(cache)
}
override val thisWithDependentCaches: Iterable<AbstractIncrementalCache<ClassName>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
result
}
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
/**
* A file X is a complementary to a file Y if they contain corresponding expect/actual declarations.
* Complementary files should be compiled together during IC so the compiler does not complain
* about missing parts.
* TODO: provide a better solution (maintain an index of expect/actual declarations akin to IncrementalPackagePartProvider)
*/
private val complementaryFilesMap = registerMap(FilesMap(COMPLEMENTARY_FILES.storageFile))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
override fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
override fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
override fun markDirty(removedAndCompiledSources: Collection<File>) {
for (sourceFile in removedAndCompiledSources) {
val classes = sourceToClassesMap[sourceFile]
classes.forEach {
dirtyOutputClassesMap.markDirty(it)
}
sourceToClassesMap.clearOutputsForSource(sourceFile)
}
}
protected fun addToClassStorage(proto: ProtoBuf.Class, nameResolver: NameResolver, srcFile: File) {
val supertypes = proto.supertypes(TypeTable(proto.typeTable))
val parents = supertypes.map { nameResolver.getClassId(it.className).asSingleFqName() }
.filter { it.asString() != "kotlin.Any" }
.toSet()
val child = nameResolver.getClassId(proto.fqName).asSingleFqName()
parents.forEach { subtypesMap.add(it, child) }
val removedSupertypes = supertypesMap[child].filter { it !in parents }
removedSupertypes.forEach { subtypesMap.removeValues(it, setOf(child)) }
supertypesMap[child] = parents
classFqNameToSourceMap[child] = srcFile
}
protected fun removeAllFromClassStorage(removedClasses: Collection<FqName>, changesCollector: ChangesCollector) {
if (removedClasses.isEmpty()) return
val removedFqNames = removedClasses.toSet()
for (removedClass in removedFqNames) {
for (affectedClass in withSubtypes(removedClass, thisWithDependentCaches)) {
changesCollector.collectSignature(affectedClass, areSubclassesAffected = false)
}
}
for (cache in thisWithDependentCaches) {
val parentsFqNames = hashSetOf<FqName>()
val childrenFqNames = hashSetOf<FqName>()
for (removedFqName in removedFqNames) {
parentsFqNames.addAll(cache.supertypesMap[removedFqName])
childrenFqNames.addAll(cache.subtypesMap[removedFqName])
cache.supertypesMap.remove(removedFqName)
cache.subtypesMap.remove(removedFqName)
}
for (child in childrenFqNames) {
cache.supertypesMap.removeValues(child, removedFqNames)
}
for (parent in parentsFqNames) {
cache.subtypesMap.removeValues(parent, removedFqNames)
}
}
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())
}
override fun dumpValue(value: String) = value
}
override fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File> {
val complementaryFiles = HashSet<File>()
val filesQueue = ArrayDeque(dirtyFiles)
while (filesQueue.isNotEmpty()) {
val file = filesQueue.pollFirst()
complementaryFilesMap[file].forEach {
if (complementaryFiles.add(it)) filesQueue.add(it)
}
}
complementaryFiles.removeAll(dirtyFiles)
return complementaryFiles
}
override fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl) {
dirtyFiles.forEach {
complementaryFilesMap.remove(it)
}
val actualToExpect = hashMapOf<File, MutableSet<File>>()
for ((expect, actuals) in expectActualTracker.expectToActualMap) {
for (actual in actuals) {
actualToExpect.getOrPut(actual) { hashSetOf() }.add(expect)
}
complementaryFilesMap[expect] = actuals
}
for ((actual, expects) in actualToExpect) {
complementaryFilesMap[actual] = expects
}
}
}

View File

@@ -1,112 +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.incremental
import org.jetbrains.annotations.TestOnly
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 DATA_CONTAINER_VERSION = 2
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
class CacheVersion(
private val ownVersion: Int,
private val versionFile: File,
private val whenVersionChanged: CacheVersion.Action,
private val whenTurnedOn: CacheVersion.Action,
private val whenTurnedOff: CacheVersion.Action,
isEnabled: ()->Boolean
) {
private val isEnabled by lazy(isEnabled)
private val actualVersion: Int?
get() = try {
versionFile.readText().toInt()
}
catch (e: NumberFormatException) {
null
}
catch (e: IOException) {
null
}
private val expectedVersion: Int
get() {
val metadata = JvmMetadataVersion.INSTANCE
val bytecode = JvmBytecodeBinaryVersion.INSTANCE
return ownVersion * 1000000 +
bytecode.major * 10000 + bytecode.minor * 100 +
metadata.major * 1000 + metadata.minor
}
fun checkVersion(): Action =
when (versionFile.exists() to isEnabled) {
true to true -> if (actualVersion != expectedVersion) whenVersionChanged else Action.DO_NOTHING
false to true -> whenTurnedOn
true to false -> whenTurnedOff
else -> Action.DO_NOTHING
}
fun saveIfNeeded() {
if (!isEnabled) return
if (!versionFile.parentFile.exists()) {
versionFile.parentFile.mkdirs()
}
versionFile.writeText(expectedVersion.toString())
}
fun clean() {
versionFile.delete()
}
@get:TestOnly
val formatVersionFile: File
get() = versionFile
// Order of entries is important, because actions are sorted in KotlinBuilder::checkVersions
enum class Action {
REBUILD_ALL_KOTLIN,
REBUILD_CHUNK,
CLEAN_NORMAL_CACHES,
CLEAN_DATA_CONTAINER,
DO_NOTHING
}
}
fun normalCacheVersion(dataRoot: File, enabled: Boolean? = null): CacheVersion =
CacheVersion(ownVersion = NORMAL_VERSION,
versionFile = File(dataRoot, NORMAL_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
isEnabled = { enabled ?: IncrementalCompilation.isEnabled() })
fun dataContainerCacheVersion(dataRoot: File, enabled: Boolean? = null): CacheVersion =
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOn = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOff = CacheVersion.Action.CLEAN_DATA_CONTAINER,
isEnabled = { enabled ?: IncrementalCompilation.isEnabled() })

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
import java.io.File
class ExpectActualTrackerImpl : ExpectActualTracker {
private val expectToActual = hashMapOf<File, MutableSet<File>>()
val expectToActualMap: Map<File, Set<File>>
get() = expectToActual
override fun report(expectedFile: File, actualFile: File) {
expectToActual.getOrPut(expectedFile) { hashSetOf() }.add(actualFile)
}
}

View File

@@ -1,144 +0,0 @@
/*
* 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.incremental
import com.intellij.util.io.EnumeratorStringDescriptor
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolver
import org.jetbrains.kotlin.metadata.deserialization.TypeTable
import org.jetbrains.kotlin.metadata.deserialization.supertypes
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import java.io.File
/**
* Incremental cache common for JVM and JS
*/
abstract class IncrementalCacheCommon<ClassName>(workingDir: File) : BasicMapsOwner(workingDir) {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
@JvmStatic protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
}
private val dependents = arrayListOf<IncrementalCacheCommon<ClassName>>()
fun addDependentCache(cache: IncrementalCacheCommon<ClassName>) {
dependents.add(cache)
}
val thisWithDependentCaches: Iterable<IncrementalCacheCommon<ClassName>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
result
}
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
open fun markDirty(removedAndCompiledSources: Collection<File>) {
for (sourceFile in removedAndCompiledSources) {
val classes = sourceToClassesMap[sourceFile]
classes.forEach {
dirtyOutputClassesMap.markDirty(it)
}
sourceToClassesMap.clearOutputsForSource(sourceFile)
}
}
protected fun addToClassStorage(proto: ProtoBuf.Class, nameResolver: NameResolver, srcFile: File) {
val supertypes = proto.supertypes(TypeTable(proto.typeTable))
val parents = supertypes.map { nameResolver.getClassId(it.className).asSingleFqName() }
.filter { it.asString() != "kotlin.Any" }
.toSet()
val child = nameResolver.getClassId(proto.fqName).asSingleFqName()
parents.forEach { subtypesMap.add(it, child) }
val removedSupertypes = supertypesMap[child].filter { it !in parents }
removedSupertypes.forEach { subtypesMap.removeValues(it, setOf(child)) }
supertypesMap[child] = parents
classFqNameToSourceMap[child] = srcFile
}
abstract fun clearCacheForRemovedClasses(changesCollector: ChangesCollector)
protected fun removeAllFromClassStorage(removedClasses: Collection<FqName>, changesCollector: ChangesCollector) {
if (removedClasses.isEmpty()) return
val removedFqNames = removedClasses.toSet()
for (removedClass in removedFqNames) {
for (affectedClass in withSubtypes(removedClass, thisWithDependentCaches)) {
changesCollector.collectSignature(affectedClass, areSubclassesAffected = false)
}
}
for (cache in thisWithDependentCaches) {
val parentsFqNames = hashSetOf<FqName>()
val childrenFqNames = hashSetOf<FqName>()
for (removedFqName in removedFqNames) {
parentsFqNames.addAll(cache.supertypesMap[removedFqName])
childrenFqNames.addAll(cache.subtypesMap[removedFqName])
cache.supertypesMap.remove(removedFqName)
cache.subtypesMap.remove(removedFqName)
}
for (child in childrenFqNames) {
cache.supertypesMap.removeValues(child, removedFqNames)
}
for (parent in parentsFqNames) {
cache.subtypesMap.removeValues(parent, removedFqNames)
}
}
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())
}
override fun dumpValue(value: String) = value
}
}

View File

@@ -36,11 +36,13 @@ import java.io.DataInput
import java.io.DataOutput
import java.io.File
open class IncrementalJsCache(cachesDir: File) : IncrementalCacheCommon<FqName>(cachesDir) {
open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName>(cachesDir) {
companion object {
private val TRANSLATION_RESULT_MAP = "translation-result"
private val INLINE_FUNCTIONS = "inline-functions"
private val HEADER_FILE_NAME = "header.meta"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile))

View File

@@ -25,12 +25,12 @@ import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.inline.inlineFunctionsJvmNames
import org.jetbrains.kotlin.load.kotlin.ModuleMapping
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
import org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto
import org.jetbrains.kotlin.metadata.jvm.deserialization.BitEncoding
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
@@ -42,9 +42,9 @@ import java.util.*
val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : IncrementalCacheCommon<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
@@ -80,16 +80,16 @@ open class IncrementalJvmCache(
// used in gradle
@Suppress("unused")
fun classesBySources(sources: Iterable<File>): Iterable<JvmClassName> =
sources.flatMap { sourceToClassesMap[it] }
sources.flatMap { sourceToClassesMap[it] }
fun sourceInCache(file: File): Boolean =
sourceToClassesMap.contains(file)
fun sourcesByInternalName(internalName: String): Collection<File> =
internalNameToSource[internalName]
internalNameToSource[internalName]
fun isMultifileFacade(className: JvmClassName): Boolean =
className in multifileFacadeToParts
className in multifileFacadeToParts
override fun getClassFilePath(internalClassName: String): String {
return toSystemIndependentName(File(outputDir, "$internalClassName.class").canonicalPath)
@@ -128,7 +128,7 @@ open class IncrementalJvmCache(
}
KotlinClassHeader.Kind.MULTIFILE_CLASS -> {
val partNames = kotlinClass.classHeader.data?.toList()
?: throw AssertionError("Multifile class has no parts: ${kotlinClass.className}")
?: throw AssertionError("Multifile class has no parts: ${kotlinClass.className}")
multifileFacadeToParts[className] = partNames
// When a class is replaced with a facade with the same name,
// the class' proto wouldn't ever be deleted,
@@ -176,15 +176,15 @@ open class IncrementalJvmCache(
}
fun getObsoleteJavaClasses(): Collection<ClassId> =
dirtyOutputClassesMap.getDirtyOutputClasses()
.mapNotNull {
javaSourcesProtoMap[it]?.classId
}
dirtyOutputClassesMap.getDirtyOutputClasses()
.mapNotNull {
javaSourcesProtoMap[it]?.classId
}
fun isJavaClassToTrack(classId: ClassId): Boolean {
val jvmClassName = JvmClassName.byClassId(classId)
return dirtyOutputClassesMap.isDirty(jvmClassName) ||
jvmClassName !in javaSourcesProtoMap
jvmClassName !in javaSourcesProtoMap
}
fun isJavaClassAlreadyInCache(classId: ClassId): Boolean {
@@ -209,8 +209,7 @@ open class IncrementalJvmCache(
if (notRemovedParts.isEmpty()) {
multifileFacadeToParts.remove(facade)
}
else {
} else {
multifileFacadeToParts[facade] = notRemovedParts
}
}
@@ -262,11 +261,6 @@ open class IncrementalJvmCache(
return protoMap[JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)]?.bytes
}
override fun clean() {
super.clean()
normalCacheVersion(targetDataRoot).clean()
}
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
fun process(kotlinClass: LocalFileKotlinClass, changesCollector: ChangesCollector) {
@@ -289,9 +283,11 @@ open class IncrementalJvmCache(
val key = kotlinClass.className.internalName
val oldData = storage[key]
val newData = ProtoMapValue(header.kind != KotlinClassHeader.Kind.CLASS,
BitEncoding.decodeBytes(header.data!!),
header.strings!!)
val newData = ProtoMapValue(
header.kind != KotlinClassHeader.Kind.CLASS,
BitEncoding.decodeBytes(header.data!!),
header.strings!!
)
storage[key] = newData
val packageFqName = kotlinClass.className.packageFqName
@@ -299,10 +295,10 @@ open class IncrementalJvmCache(
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
operator fun get(className: JvmClassName): ProtoMapValue? =
storage[className.internalName]
storage[className.internalName]
fun remove(className: JvmClassName, changesCollector: ChangesCollector) {
val key = className.internalName
@@ -318,15 +314,16 @@ open class IncrementalJvmCache(
}
}
private inner class JavaSourcesProtoMap(storageFile: File) : BasicStringMap<SerializedJavaClass>(storageFile, JavaClassProtoMapValueExternalizer) {
private inner class JavaSourcesProtoMap(storageFile: File) :
BasicStringMap<SerializedJavaClass>(storageFile, JavaClassProtoMapValueExternalizer) {
fun process(jvmClassName: JvmClassName, newData: SerializedJavaClass, changesCollector: ChangesCollector) {
val key = jvmClassName.internalName
val oldData = storage[key]
storage[key] = newData
changesCollector.collectProtoChanges(
oldData?.toProtoData(), newData.toProtoData(),
collectAllMembersForNewClass = true
oldData?.toProtoData(), newData.toProtoData(),
collectAllMembersForNewClass = true
)
}
@@ -339,13 +336,13 @@ open class IncrementalJvmCache(
}
operator fun get(className: JvmClassName): SerializedJavaClass? =
storage[className.internalName]
storage[className.internalName]
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
override fun dumpValue(value: SerializedJavaClass): String =
java.lang.Long.toHexString(value.proto.toByteArray().md5())
java.lang.Long.toHexString(value.proto.toByteArray().md5())
}
// todo: reuse code with InlineFunctionsMap?
@@ -367,7 +364,7 @@ open class IncrementalJvmCache(
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
fun process(kotlinClass: LocalFileKotlinClass, changesCollector: ChangesCollector) {
val key = kotlinClass.className.internalName
@@ -376,8 +373,7 @@ open class IncrementalJvmCache(
val newMap = getConstantsMap(kotlinClass.fileContents)
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -391,7 +387,7 @@ open class IncrementalJvmCache(
}
override fun dumpValue(value: Map<String, Any>): String =
value.dumpMap(Any::toString)
value.dumpMap(Any::toString)
}
private inner class PackagePartMap(storageFile: File) : BasicStringMap<Boolean>(storageFile, BooleanDataDescriptor.INSTANCE) {
@@ -404,21 +400,22 @@ open class IncrementalJvmCache(
}
fun isPackagePart(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
override fun dumpValue(value: Boolean) = ""
}
private inner class MultifileClassFacadeMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
private inner class MultifileClassFacadeMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
operator fun set(className: JvmClassName, partNames: Collection<String>) {
storage[className.internalName] = partNames
}
operator fun get(className: JvmClassName): Collection<String>? =
storage[className.internalName]
storage[className.internalName]
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
@@ -427,13 +424,14 @@ open class IncrementalJvmCache(
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
}
private inner class MultifileClassPartMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor.INSTANCE) {
private inner class MultifileClassPartMap(storageFile: File) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor.INSTANCE) {
fun set(partName: String, facadeName: String) {
storage[partName] = facadeName
}
fun get(partName: JvmClassName): String? =
storage[partName.internalName]
storage[partName.internalName]
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
@@ -442,20 +440,21 @@ open class IncrementalJvmCache(
override fun dumpValue(value: String): String = value
}
inner class InternalNameToSourcesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
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)
(storage[internalName] ?: emptyList()).map(::File)
fun remove(internalName: String) {
storage.remove(internalName)
}
override fun dumpValue(value: Collection<String>): String =
value.dumpCollection()
value.dumpCollection()
}
private fun addToClassStorage(kotlinClass: LocalFileKotlinClass, srcFile: File) {
@@ -463,7 +462,8 @@ open class IncrementalJvmCache(
addToClassStorage(proto, nameResolver, srcFile)
}
private inner class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private inner class InlineFunctionsMap(storageFile: File) :
BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: ByteArray): Map<String, Long> {
val inlineFunctions = inlineFunctionsJvmNames(header)
if (inlineFunctions.isEmpty()) return emptyMap()
@@ -471,7 +471,13 @@ open class IncrementalJvmCache(
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
override fun visitMethod(
access: Int,
name: String,
desc: String,
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
@@ -498,30 +504,35 @@ open class IncrementalJvmCache(
val newMap = getInlineFunctionsMap(kotlinClass.classHeader, kotlinClass.fileContents)
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
for (fn in oldMap.keys + newMap.keys) {
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(), functionNameBySignature(fn), oldMap[fn], newMap[fn])
changesCollector.collectMemberIfValueWasChanged(
kotlinClass.scopeFqName(),
functionNameBySignature(fn),
oldMap[fn],
newMap[fn]
)
}
}
// TODO get name in better way instead of using substringBefore
private fun functionNameBySignature(signature: String): String =
signature.substringBefore("(")
signature.substringBefore("(")
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}
}
private object PathCollectionExternalizer : CollectionExternalizer<String>(PathStringDescriptor, { THashSet(FileUtil.PATH_HASHING_STRATEGY) })
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) {
@@ -541,10 +552,10 @@ sealed class ChangeInfo(val fqName: FqName) {
}
private fun LocalFileKotlinClass.scopeFqName() =
when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
else -> className.packageFqName
}
when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
else -> className.packageFqName
}
fun ByteArray.md5(): Long {
val d = MessageDigest.getInstance("MD5").digest(this)!!
@@ -556,23 +567,24 @@ fun ByteArray.md5(): Long {
or ((d[5].toLong() and 0xFFL) shl 40)
or ((d[6].toLong() and 0xFFL) shl 48)
or ((d[7].toLong() and 0xFFL) shl 56)
)
)
}
@TestOnly
fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V)->String): String =
buildString {
append("{")
for (key in keys.sorted()) {
if (length != 1) {
append(", ")
}
val value = get(key)?.let(dumpValue) ?: "null"
append("$key -> $value")
fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V) -> String): String =
buildString {
append("{")
for (key in keys.sorted()) {
if (length != 1) {
append(", ")
}
append("}")
}
@TestOnly fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
"[${sorted().joinToString(", ", transform = Any::toString)}]"
val value = get(key)?.let(dumpValue) ?: "null"
append("$key -> $value")
}
append("}")
}
@TestOnly
fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
"[${sorted().joinToString(", ", transform = Any::toString)}]"

View File

@@ -16,34 +16,49 @@
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.builtins.BuiltInSerializerProtocol
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.load.java.JavaVisibilities
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
import org.jetbrains.kotlin.metadata.java.JavaClassProtoBuf
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import org.jetbrains.kotlin.metadata.serialization.MutableVersionRequirementTable
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.serialization.DescriptorSerializer
import org.jetbrains.kotlin.serialization.KotlinSerializerExtensionBase
import org.jetbrains.kotlin.serialization.deserialization.builtins.BuiltInSerializerProtocol
// It uses BuiltInSerializerProtocol for annotations serialization
class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSerializerProtocol) {
override fun serializeClass(descriptor: ClassDescriptor, proto: ProtoBuf.Class.Builder) {
super.serializeClass(descriptor, proto)
override val metadataVersion: BinaryVersion
get() = JvmMetadataVersion.INVALID_VERSION
override fun serializeClass(
descriptor: ClassDescriptor,
proto: ProtoBuf.Class.Builder,
versionRequirementTable: MutableVersionRequirementTable,
childSerializer: DescriptorSerializer
) {
super.serializeClass(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateClass, true)
}
}
override fun serializeConstructor(descriptor: ConstructorDescriptor, proto: ProtoBuf.Constructor.Builder) {
super.serializeConstructor(descriptor, proto)
override fun serializeConstructor(descriptor: ConstructorDescriptor,
proto: ProtoBuf.Constructor.Builder,
childSerializer: DescriptorSerializer) {
super.serializeConstructor(descriptor, proto, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateConstructor, true)
}
}
override fun serializeFunction(descriptor: FunctionDescriptor, proto: ProtoBuf.Function.Builder) {
super.serializeFunction(descriptor, proto)
override fun serializeFunction(descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
childSerializer: DescriptorSerializer) {
super.serializeFunction(descriptor, proto, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateMethod, true)
}
@@ -53,8 +68,13 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
}
}
override fun serializeProperty(descriptor: PropertyDescriptor, proto: ProtoBuf.Property.Builder) {
super.serializeProperty(descriptor, proto)
override fun serializeProperty(
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable,
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateField, true)
}

View File

@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.metadata.java.JavaClassProtoBuf
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
import org.jetbrains.kotlin.serialization.DescriptorSerializer
@@ -94,8 +95,15 @@ fun JavaClassDescriptor.convertToProto(): SerializedJavaClassWithSource {
val file = javaSourceFile.sure { "convertToProto should only be called for source based classes" }
val extension = JavaClassesSerializerExtension()
val serializer = DescriptorSerializer.createTopLevel(extension)
val classProto = serializer.classProto(this).build()
val classProto = try {
DescriptorSerializer.create(this, extension, null).classProto(this).build()
} catch (e: Exception) {
throw IllegalStateException(
"Error during writing proto for descriptor: ${DescriptorRenderer.DEBUG_TEXT.render(this)}\n" +
"Source file: $file",
e
)
}
val (stringTable, qualifiedNameTable) = extension.stringTable.buildProto()

View File

@@ -177,10 +177,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsClassVersionRequirement(old, new)) return false
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) return false
if (old.hasVersionRequirementTable()) {
@@ -251,7 +248,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
TYPE_TABLE,
VERSION_REQUIREMENT,
VERSION_REQUIREMENT_LIST,
VERSION_REQUIREMENT_TABLE,
JVM_EXT_CLASS_MODULE_NAME,
JVM_EXT_CLASS_LOCAL_VARIABLE_LIST,
@@ -302,10 +299,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT)
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) result.add(ProtoBufClassKind.VERSION_REQUIREMENT)
}
if (!checkEqualsClassVersionRequirement(old, new)) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_LIST)
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_TABLE)
if (old.hasVersionRequirementTable()) {
@@ -404,10 +398,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsFunctionVersionRequirement(old, new)) return false
if (old.hasContract() != new.hasContract()) return false
if (old.hasContract()) {
@@ -510,16 +501,18 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (old.setterFlags != new.setterFlags) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsPropertyVersionRequirement(old, new)) 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
}
if (old.hasExtension(JvmProtoBuf.flags) != new.hasExtension(JvmProtoBuf.flags)) return false
if (old.hasExtension(JvmProtoBuf.flags)) {
if (old.getExtension(JvmProtoBuf.flags) != new.getExtension(JvmProtoBuf.flags)) return false
}
if (old.getExtensionCount(JsProtoBuf.propertyAnnotation) != new.getExtensionCount(JsProtoBuf.propertyAnnotation)) {
return false
}
@@ -529,6 +522,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertyGetterAnnotation, i), new.getExtension(JsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertySetterAnnotation, i), new.getExtension(JsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(JsProtoBuf.compileTimeValue) != new.hasExtension(JsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(JsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(JsProtoBuf.compileTimeValue), new.getExtension(JsProtoBuf.compileTimeValue))) return false
@@ -558,6 +569,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue) != new.hasExtension(BuiltInsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.compileTimeValue), new.getExtension(BuiltInsProtoBuf.compileTimeValue))) return false
@@ -598,10 +627,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsTypeAliasAnnotation(old, new)) return false
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsTypeAliasVersionRequirement(old, new)) return false
return true
}
@@ -783,10 +809,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsConstructorValueParameter(old, new)) return false
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsConstructorVersionRequirement(old, new)) return false
if (old.hasExtension(JvmProtoBuf.constructorSignature) != new.hasExtension(JvmProtoBuf.constructorSignature)) return false
if (old.hasExtension(JvmProtoBuf.constructorSignature)) {
@@ -990,6 +1013,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsAnnotationArgumentValueArrayElement(old, new)) return false
if (old.hasArrayDimensionCount() != new.hasArrayDimensionCount()) return false
if (old.hasArrayDimensionCount()) {
if (old.arrayDimensionCount != new.arrayDimensionCount) return false
}
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
}
return true
}
@@ -1252,6 +1285,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsClassVersionRequirement(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1272,6 +1315,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsFunctionVersionRequirement(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsPropertyTypeParameter(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1282,6 +1335,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsPropertyVersionRequirement(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsTypeAliasTypeParameter(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1302,6 +1365,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsTypeAliasVersionRequirement(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsTypeTableType(old: ProtoBuf.TypeTable, new: ProtoBuf.TypeTable): Boolean {
if (old.typeCount != new.typeCount) return false
@@ -1362,6 +1435,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsConstructorVersionRequirement(old: ProtoBuf.Constructor, new: ProtoBuf.Constructor): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsAnnotationArgument(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (old.argumentCount != new.argumentCount) return false
@@ -1552,8 +1635,8 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasVersionRequirementTable()) {
@@ -1632,8 +1715,8 @@ fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasContract()) {
@@ -1716,18 +1799,30 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + setterFlags
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasExtension(JvmProtoBuf.propertySignature)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.propertySignature).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.flags)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.flags)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertyAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1748,6 +1843,14 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1788,8 +1891,8 @@ fun ProtoBuf.TypeAlias.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int
hashCode = 31 * hashCode + getAnnotation(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
return hashCode
@@ -1946,8 +2049,8 @@ fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
hashCode = 31 * hashCode + getValueParameter(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasExtension(JvmProtoBuf.constructorSignature)) {
@@ -2120,6 +2223,14 @@ fun ProtoBuf.Annotation.Argument.Value.hashCode(stringIndexes: (Int) -> Int, fqN
hashCode = 31 * hashCode + getArrayElement(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasArrayDimensionCount()) {
hashCode = 31 * hashCode + arrayDimensionCount
}
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
return hashCode
}

View File

@@ -34,11 +34,14 @@ import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import java.io.File
import java.util.*
const val DELETE_MODULE_FILE_PROPERTY = "kotlin.delete.module.file.after.build"
fun makeModuleFile(
name: String,
isTest: Boolean,
outputDir: File,
sourcesToCompile: Iterable<File>,
commonSources: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpath: Iterable<File>,
friendDirs: Iterable<File>
@@ -53,6 +56,7 @@ fun makeModuleFile(
sourcesToCompile.map { it.absoluteFile },
javaSourceRoots,
classpath,
commonSources.map { it.absoluteFile },
null,
"java-production",
isTest,
@@ -81,10 +85,10 @@ fun makeCompileServices(
}
fun updateIncrementalCache(
generatedFiles: Iterable<GeneratedFile>,
cache: IncrementalJvmCache,
changesCollector: ChangesCollector,
javaChangesTracker: JavaClassesTrackerImpl?
generatedFiles: Iterable<GeneratedFile>,
cache: IncrementalJvmCache,
changesCollector: ChangesCollector,
javaChangesTracker: JavaClassesTrackerImpl?
) {
for (generatedFile in generatedFiles) {
when {
@@ -119,8 +123,8 @@ data class DirtyData(
)
fun ChangesCollector.getDirtyData(
caches: Iterable<IncrementalCacheCommon<*>>,
reporter: ICReporter
caches: Iterable<IncrementalCacheCommon>,
reporter: ICReporter
): DirtyData {
val dirtyLookupSymbols = HashSet<LookupSymbol>()
val dirtyClassesFqNames = HashSet<FqName>()
@@ -130,6 +134,7 @@ fun ChangesCollector.getDirtyData(
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
dirtyClassesFqNames.addAll(fqNames)
for (classFqName in fqNames) {
assert(!classFqName.isRoot) { "$classFqName is root when processing $change" }
@@ -173,10 +178,10 @@ fun mapLookupSymbolsToFiles(
}
fun mapClassesFqNamesToFiles(
caches: Iterable<IncrementalCacheCommon<*>>,
classesFqNames: Iterable<FqName>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
caches: Iterable<IncrementalCacheCommon>,
classesFqNames: Iterable<FqName>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
@@ -195,7 +200,7 @@ fun mapClassesFqNamesToFiles(
fun withSubtypes(
typeFqName: FqName,
caches: Iterable<IncrementalCacheCommon<*>>
caches: Iterable<IncrementalCacheCommon>
): Set<FqName> {
val types = LinkedList(listOf(typeFqName))
val subtypes = hashSetOf<FqName>()

View File

@@ -21,11 +21,8 @@ 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.isKotlinFile(sourceFilesExtensions: List<String>): Boolean =
!isJavaFile() && sourceFilesExtensions.any { it.equals(extension, ignoreCase = true) }
fun File.isClassFile(): Boolean =
extension.equals("class", ignoreCase = true)

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.js
import org.jetbrains.kotlin.incremental.IncrementalJsCache
import org.jetbrains.kotlin.utils.JsMetadataVersion
import java.io.File
class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) : IncrementalDataProvider {
override val headerMetadata: ByteArray
get() = cache.header
override val compiledPackageParts: Map<File, TranslationResultValue>
get() = cache.nonDirtyPackageParts()
override val metadataVersion: IntArray
get() = JsMetadataVersion.INSTANCE.toArray() // TODO: store and load correct metadata version
}

View File

@@ -223,7 +223,7 @@ class DifferenceCalculatorForClass(
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
// TODO
}

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescriptor, IntExternalizer) {
@@ -34,5 +33,12 @@ internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescri
storage.remove(file)
}
fun toMap(): Map<File, Int> = storage.keys.keysToMap { storage[it]!! }
fun toMap(): Map<File, Int> {
val result = HashMap<File, Int>()
for (key in storage.keys) {
val value = storage[key] ?: continue
result[key] = value
}
return result
}
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class FilesMap(storageFile: File)
: BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, outputFiles: Collection<File>) {
storage[sourceFile.absolutePath] = outputFiles.map { it.absolutePath }
}
operator fun get(sourceFile: File): Collection<File> =
storage[sourceFile.absolutePath].orEmpty().map(::File)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(file.absolutePath) }
}

View File

@@ -34,16 +34,18 @@ class KotlinModuleXmlBuilder {
}
fun addModule(
moduleName: String,
outputDir: String,
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
friendDirs: Iterable<File>): KotlinModuleXmlBuilder {
moduleName: String,
outputDir: String,
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
commonSourceFiles: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
friendDirs: Iterable<File>
): KotlinModuleXmlBuilder {
assert(!done) { "Already done" }
p.println("<!-- Module script for ${if (isTests) "tests" else "production"} -->")
@@ -62,6 +64,10 @@ class KotlinModuleXmlBuilder {
p.println("<", SOURCES, " ", PATH, "=\"", getEscapedPath(sourceFile), "\"/>")
}
for (commonSourceFile in commonSourceFiles) {
p.println("<", COMMON_SOURCES, " ", PATH, "=\"", getEscapedPath(commonSourceFile), "\"/>")
}
processJavaSourceRoots(javaSourceRoots)
processClasspath(classpathRoots, directoriesToFilterOut)
@@ -78,7 +84,7 @@ class KotlinModuleXmlBuilder {
directoriesToFilterOut: Set<File>) {
p.println("<!-- Classpath -->")
for (file in files) {
val isOutput = directoriesToFilterOut.contains(file) && !IncrementalCompilation.isEnabled()
val isOutput = directoriesToFilterOut.contains(file) && !IncrementalCompilation.isEnabledForJvm()
if (isOutput) {
// For IDEA's make (incremental compilation) purposes, output directories of the current module and its dependencies
// appear on the class path, so we are at risk of seeing the results of the previous build, i.e. if some class was

View File

@@ -0,0 +1,84 @@
/*
* 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 BuildMetaInfoTest : TestCase() {
@Test
fun testJvmSerialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo.create(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 testJvmSerializationDeserialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo.create(args)
val serialized = JvmBuildMetaInfo.serializeToString(info)
val deserialized = JvmBuildMetaInfo.deserializeFromString(serialized)
assertEquals(info, deserialized)
}
@Test
fun testJsSerializationDeserialization() {
val args = K2JVMCompilerArguments()
val info = JvmBuildMetaInfo.create(args)
val serialized = JvmBuildMetaInfo.serializeToString(info)
val deserialized = JvmBuildMetaInfo.deserializeFromString(serialized)
assertEquals(info, deserialized)
}
@Test
fun testJvmEquals() {
val args1 = K2JVMCompilerArguments()
args1.coroutinesState = CommonCompilerArguments.ENABLE
val info1 = JvmBuildMetaInfo.create(args1)
val args2 = K2JVMCompilerArguments()
args2.coroutinesState = CommonCompilerArguments.WARN
val info2 = JvmBuildMetaInfo.create(args2)
assertNotEquals(info1, info2)
assertEquals(info1, info2.copy(coroutinesEnable = true, coroutinesWarn = false))
}
}

View File

@@ -1,75 +0,0 @@
/*
* 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

@@ -27,10 +27,11 @@ data class BuildLogFinder(
private const val JS_LOG = "js-build.log"
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
const val JS_JPS_LOG = "js-jps-build.log"
private const val SIMPLE_LOG = "build.log"
fun isJpsLogFile(file: File): Boolean =
file.name.let { it == SIMPLE_LOG || it == DATA_CONTAINER_LOG }
file.name in arrayOf(SIMPLE_LOG, JS_JPS_LOG, DATA_CONTAINER_LOG)
}
fun findBuildLog(dir: File): File? {
@@ -39,6 +40,7 @@ data class BuildLogFinder(
val matchedName = when {
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG
SIMPLE_LOG in files -> SIMPLE_LOG
else -> null

View File

@@ -17,7 +17,11 @@
package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapError
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapParser
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapSuccess
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.metadata.DebugProtoBuf
import org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf
@@ -25,6 +29,7 @@ import org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf
import org.jetbrains.kotlin.metadata.jvm.deserialization.BitEncoding
import org.jetbrains.kotlin.protobuf.ExtensionRegistry
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadata
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils
import org.jetbrains.kotlin.utils.Printer
@@ -32,14 +37,10 @@ import org.jetbrains.org.objectweb.asm.ClassReader
import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor
import org.junit.Assert
import org.junit.Assert.assertNotNull
import java.io.ByteArrayInputStream
import java.io.File
import java.io.PrintWriter
import java.io.StringWriter
import java.io.*
import java.util.*
import java.util.zip.CRC32
import java.util.zip.GZIPInputStream
import kotlin.comparisons.compareBy
// Set this to true if you want to dump all bytecode (test will fail in this case)
private val DUMP_ALL = System.getProperty("comparison.dump.all") == "true"
@@ -186,6 +187,39 @@ private fun metaJsToString(metaJsFile: File): String {
return out.toString()
}
private fun kjsmToString(kjsmFile: File): String {
val out = StringWriter()
val stream = DataInputStream(kjsmFile.inputStream())
// Read and skip the metadata version
repeat(stream.readInt()) { stream.readInt() }
val (header, content) =
DebugJsProtoBuf.Header.parseDelimitedFrom(stream, JsSerializerProtocol.extensionRegistry) to
DebugJsProtoBuf.Library.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
out.write("\n------ header -----\n$header")
out.write("\n------ library -----\n$content")
return out.toString()
}
private fun sourceMapFileToString(sourceMapFile: File, generatedJsFile: File): String {
val sourceMapParseResult = SourceMapParser.parse(StringReader(sourceMapFile.readText()))
return when (sourceMapParseResult) {
is SourceMapSuccess -> {
val bytesOut = ByteArrayOutputStream()
PrintStream(bytesOut).use { printStream ->
sourceMapParseResult.value.debugVerbose(printStream, generatedJsFile)
}
bytesOut.toString()
}
is SourceMapError -> {
sourceMapParseResult.message
}
}
}
private fun getExtensionRegistry(): ExtensionRegistry {
val registry = ExtensionRegistry.newInstance()!!
DebugJvmProtoBuf.registerAllExtensions(registry)
@@ -200,6 +234,13 @@ private fun fileToStringRepresentation(file: File): String {
file.name.endsWith(KotlinJavascriptMetadataUtils.META_JS_SUFFIX) -> {
metaJsToString(file)
}
file.name.endsWith(KotlinJavascriptSerializationUtil.CLASS_METADATA_FILE_EXTENSION) -> {
kjsmToString(file)
}
file.name.endsWith(".js.map") -> {
val generatedJsPath = file.canonicalPath.removeSuffix(".map")
sourceMapFileToString(file, File(generatedJsPath))
}
else -> {
file.readText()
}

View File

@@ -39,14 +39,14 @@ fun copyTestSources(testDataDir: File, sourceDestinationDir: File, filePrefix: S
if (!file.isFile) continue
val renamedFile =
if (filePrefix.isEmpty()) {
file
}
else {
File(sourceDestinationDir, file.name.removePrefix(filePrefix)).apply {
file.renameTo(this)
}
if (filePrefix.isEmpty()) {
file
}
else {
File(sourceDestinationDir, file.name.removePrefix(filePrefix)).apply {
file.renameTo(this)
}
}
mapping[renamedFile] = File(testDataDir, file.name)
}
@@ -55,10 +55,10 @@ fun copyTestSources(testDataDir: File, sourceDestinationDir: File, filePrefix: S
}
fun getModificationsToPerform(
testDataDir: File,
moduleNames: Collection<String>?,
allowNoFilesWithSuffixInTestData: Boolean,
touchPolicy: TouchPolicy
testDataDir: File,
moduleNames: Collection<String>?,
allowNoFilesWithSuffixInTestData: Boolean,
touchPolicy: TouchPolicy
): List<List<Modification>> {
fun getModificationsForIteration(newSuffix: String, touchSuffix: String, deleteSuffix: String): List<Modification> {
@@ -67,12 +67,18 @@ fun getModificationsToPerform(
val underscore = fileName.indexOf("_")
if (underscore != -1) {
val module = fileName.substring(0, underscore)
var moduleName = fileName.substring(0, underscore)
var moduleFileName = fileName.substring(underscore + 1)
if (moduleName.all { it.isDigit() }) {
val (moduleName1, moduleFileName1) = moduleFileName.split("_")
moduleName = moduleName1
moduleFileName = moduleFileName1
}
assert(moduleNames != null) { "File name has module prefix, but multi-module environment is absent" }
assert(module in moduleNames!!) { "Module not found for file with prefix: $fileName" }
assert(moduleName in moduleNames!!) { "Module not found for file with prefix: $fileName" }
return Pair(module, fileName.substring(underscore + 1))
return Pair(moduleName, moduleFileName)
}
assert(moduleNames == null) { "Test is multi-module, but file has no module prefix: $fileName" }
@@ -80,9 +86,9 @@ fun getModificationsToPerform(
}
val rules = mapOf<String, (String, File) -> Modification>(
newSuffix to { path, file -> ModifyContent(path, file) },
touchSuffix to { path, _ -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, _ -> DeleteFile(path) }
newSuffix to { path, file -> ModifyContent(path, file) },
touchSuffix to { path, _ -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, _ -> DeleteFile(path) }
)
val modifications = ArrayList<Modification>()
@@ -122,8 +128,8 @@ fun getModificationsToPerform(
}
else {
return (1..10)
.map { getModificationsForIteration(".new.$it", ".touch.$it", ".delete.$it") }
.filter { it.isNotEmpty() }
.map { getModificationsForIteration(".new.$it", ".touch.$it", ".delete.$it") }
.filter { it.isNotEmpty() }
}
}

View File

@@ -12,6 +12,8 @@ public final class DebugBuiltInsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.parameterAnnotation);
@@ -73,6 +75,28 @@ public final class DebugBuiltInsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 152;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 153;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 151;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -153,22 +177,28 @@ public final class DebugBuiltInsProtoBuf {
"notation:p\n\023property_annotation\022\'.org.je" +
"tbrains.kotlin.metadata.Property\030\226\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati" +
"on:~\n\022compile_time_value\022\'.org.jetbrains" +
".kotlin.metadata.Property\030\227\001 \001(\01328.org.j" +
"etbrains.kotlin.metadata.Annotation.Argu" +
"ment.Value:s\n\025enum_entry_annotation\022(.or",
"g.jetbrains.kotlin.metadata.EnumEntry\030\226\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:w\n\024parameter_annotation\022-.org.je" +
"tbrains.kotlin.metadata.ValueParameter\030\226" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:h\n\017type_annotation\022#.org.jetbra" +
"ins.kotlin.metadata.Type\030\226\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:{\n\031ty" +
"pe_parameter_annotation\022,.org.jetbrains." +
"kotlin.metadata.TypeParameter\030\226\001 \003(\0132).o",
"rg.jetbrains.kotlin.metadata.AnnotationB" +
"\027B\025DebugBuiltInsProtoBuf"
"on:w\n\032property_getter_annotation\022\'.org.j" +
"etbrains.kotlin.metadata.Property\030\230\001 \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:w\n\032property_setter_annotation\022\'.org.",
"jetbrains.kotlin.metadata.Property\030\231\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\227\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar" +
"gument.Value:s\n\025enum_entry_annotation\022(." +
"org.jetbrains.kotlin.metadata.EnumEntry\030" +
"\226\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:w\n\024parameter_annotation\022-.org." +
"jetbrains.kotlin.metadata.ValueParameter",
"\030\226\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:h\n\017type_annotation\022#.org.jetb" +
"rains.kotlin.metadata.Type\030\226\001 \003(\0132).org." +
"jetbrains.kotlin.metadata.Annotation:{\n\031" +
"type_parameter_annotation\022,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\030\226\001 \003(\0132)" +
".org.jetbrains.kotlin.metadata.Annotatio" +
"nB\027B\025DebugBuiltInsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -188,11 +218,13 @@ public final class DebugBuiltInsProtoBuf {
constructorAnnotation.internalInit(descriptor.getExtensions().get(2));
functionAnnotation.internalInit(descriptor.getExtensions().get(3));
propertyAnnotation.internalInit(descriptor.getExtensions().get(4));
compileTimeValue.internalInit(descriptor.getExtensions().get(5));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(6));
parameterAnnotation.internalInit(descriptor.getExtensions().get(7));
typeAnnotation.internalInit(descriptor.getExtensions().get(8));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(9));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(5));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(8));
parameterAnnotation.internalInit(descriptor.getExtensions().get(9));
typeAnnotation.internalInit(descriptor.getExtensions().get(10));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(11));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}

View File

@@ -14,6 +14,8 @@ public final class DebugJsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.enumEntryAnnotation);
@@ -4752,6 +4754,28 @@ public final class DebugJsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 132;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 133;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 131;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -4900,27 +4924,33 @@ public final class DebugJsProtoBuf {
"ion\030\207\001 \001(\005:p\n\023property_annotation\022\'.org." +
"jetbrains.kotlin.metadata.Property\030\202\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\203\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar",
"gument.Value:M\n\033property_containing_file" +
"_id\022\'.org.jetbrains.kotlin.metadata.Prop" +
"erty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(.o" +
"rg.jetbrains.kotlin.metadata.EnumEntry\030\202" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:w\n\024parameter_annotation\022-.org.j" +
"etbrains.kotlin.metadata.ValueParameter\030" +
"\202\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:h\n\017type_annotation\022#.org.jetbr" +
"ains.kotlin.metadata.Type\030\202\001 \003(\0132).org.j",
"etbrains.kotlin.metadata.Annotation:{\n\031t" +
"ype_parameter_annotation\022,.org.jetbrains" +
".kotlin.metadata.TypeParameter\030\202\001 \003(\0132)." +
"org.jetbrains.kotlin.metadata.Annotation" +
":x\n\026package_fragment_files\022..org.jetbrai" +
"ns.kotlin.metadata.PackageFragment\030\202\001 \001(" +
"\0132\'.org.jetbrains.kotlin.metadata.js.Fil" +
"esB\021B\017DebugJsProtoBuf"
"tion:w\n\032property_getter_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\204\001 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Annot",
"ation:w\n\032property_setter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\205\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:~\n\022compile_time_value\022\'.org.jetbr" +
"ains.kotlin.metadata.Property\030\203\001 \001(\01328.o" +
"rg.jetbrains.kotlin.metadata.Annotation." +
"Argument.Value:M\n\033property_containing_fi" +
"le_id\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(" +
".org.jetbrains.kotlin.metadata.EnumEntry",
"\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:w\n\024parameter_annotation\022-.org" +
".jetbrains.kotlin.metadata.ValueParamete" +
"r\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata" +
".Annotation:h\n\017type_annotation\022#.org.jet" +
"brains.kotlin.metadata.Type\030\202\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:{\n" +
"\031type_parameter_annotation\022,.org.jetbrai" +
"ns.kotlin.metadata.TypeParameter\030\202\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati",
"on:x\n\026package_fragment_files\022..org.jetbr" +
"ains.kotlin.metadata.PackageFragment\030\202\001 " +
"\001(\0132\'.org.jetbrains.kotlin.metadata.js.F" +
"ilesB\021B\017DebugJsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4972,13 +5002,15 @@ public final class DebugJsProtoBuf {
functionAnnotation.internalInit(descriptor.getExtensions().get(4));
functionContainingFileId.internalInit(descriptor.getExtensions().get(5));
propertyAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(8));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(9));
parameterAnnotation.internalInit(descriptor.getExtensions().get(10));
typeAnnotation.internalInit(descriptor.getExtensions().get(11));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(12));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(13));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(7));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(8));
compileTimeValue.internalInit(descriptor.getExtensions().get(9));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(10));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(11));
parameterAnnotation.internalInit(descriptor.getExtensions().get(12));
typeAnnotation.internalInit(descriptor.getExtensions().get(13));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(14));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(15));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}

View File

@@ -11,6 +11,7 @@ public final class DebugJvmProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.methodSignature);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.lambdaClassOriginName);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.propertySignature);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.flags);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.typeAnnotation);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.isRaw);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.typeParameterAnnotation);
@@ -4558,6 +4559,22 @@ public final class DebugJvmProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmPropertySignature.class,
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmPropertySignature.getDefaultInstance());
public static final int FLAGS_FIELD_NUMBER = 101;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*
* <pre>
**
*isMovedFromInterfaceCompanion true if this property is declared in an interface companion, and the field is stored in the interface
* </pre>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.lang.Integer> flags = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int TYPE_ANNOTATION_FIELD_NUMBER = 100;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Type { ... }</code>
@@ -4726,25 +4743,27 @@ public final class DebugJvmProtoBuf {
"perty_signature\022\'.org.jetbrains.kotlin.m" +
"etadata.Property\030d \001(\01327.org.jetbrains.k" +
"otlin.metadata.jvm.JvmPropertySignature:" +
"g\n\017type_annotation\022#.org.jetbrains.kotli" +
"n.metadata.Type\030d \003(\0132).org.jetbrains.ko" +
"tlin.metadata.Annotation:3\n\006is_raw\022#.org",
".jetbrains.kotlin.metadata.Type\030e \001(\010:z\n" +
"\031type_parameter_annotation\022,.org.jetbrai" +
"ns.kotlin.metadata.TypeParameter\030d \003(\0132)" +
".org.jetbrains.kotlin.metadata.Annotatio" +
"n:E\n\021class_module_name\022$.org.jetbrains.k" +
"otlin.metadata.Class\030e \001(\005B\004\230\265\030\001:k\n\024clas" +
"s_local_variable\022$.org.jetbrains.kotlin." +
"metadata.Class\030f \003(\0132\'.org.jetbrains.kot" +
"lin.metadata.Property:P\n\034anonymous_objec" +
"t_origin_name\022$.org.jetbrains.kotlin.met",
"adata.Class\030g \001(\005B\004\230\265\030\001:I\n\023package_modul" +
"e_name\022&.org.jetbrains.kotlin.metadata.P" +
"ackage\030e \001(\005B\004\230\265\030\001:o\n\026package_local_vari" +
"able\022&.org.jetbrains.kotlin.metadata.Pac" +
"kage\030f \003(\0132\'.org.jetbrains.kotlin.metada" +
"ta.PropertyB\022B\020DebugJvmProtoBuf"
"9\n\005flags\022\'.org.jetbrains.kotlin.metadata" +
".Property\030e \001(\005:\0010:g\n\017type_annotation\022#." +
"org.jetbrains.kotlin.metadata.Type\030d \003(\013",
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:3\n\006is_raw\022#.org.jetbrains.kotlin.met" +
"adata.Type\030e \001(\010:z\n\031type_parameter_annot" +
"ation\022,.org.jetbrains.kotlin.metadata.Ty" +
"peParameter\030d \003(\0132).org.jetbrains.kotlin" +
".metadata.Annotation:E\n\021class_module_nam" +
"e\022$.org.jetbrains.kotlin.metadata.Class\030" +
"e \001(\005B\004\230\265\030\001:k\n\024class_local_variable\022$.or" +
"g.jetbrains.kotlin.metadata.Class\030f \003(\0132" +
"\'.org.jetbrains.kotlin.metadata.Property",
":P\n\034anonymous_object_origin_name\022$.org.j" +
"etbrains.kotlin.metadata.Class\030g \001(\005B\004\230\265" +
"\030\001:I\n\023package_module_name\022&.org.jetbrain" +
"s.kotlin.metadata.Package\030e \001(\005B\004\230\265\030\001:o\n" +
"\026package_local_variable\022&.org.jetbrains." +
"kotlin.metadata.Package\030f \003(\0132\'.org.jetb" +
"rains.kotlin.metadata.PropertyB\022B\020DebugJ" +
"vmProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4794,14 +4813,15 @@ public final class DebugJvmProtoBuf {
methodSignature.internalInit(descriptor.getExtensions().get(1));
lambdaClassOriginName.internalInit(descriptor.getExtensions().get(2));
propertySignature.internalInit(descriptor.getExtensions().get(3));
typeAnnotation.internalInit(descriptor.getExtensions().get(4));
isRaw.internalInit(descriptor.getExtensions().get(5));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(6));
classModuleName.internalInit(descriptor.getExtensions().get(7));
classLocalVariable.internalInit(descriptor.getExtensions().get(8));
anonymousObjectOriginName.internalInit(descriptor.getExtensions().get(9));
packageModuleName.internalInit(descriptor.getExtensions().get(10));
packageLocalVariable.internalInit(descriptor.getExtensions().get(11));
flags.internalInit(descriptor.getExtensions().get(4));
typeAnnotation.internalInit(descriptor.getExtensions().get(5));
isRaw.internalInit(descriptor.getExtensions().get(6));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(7));
classModuleName.internalInit(descriptor.getExtensions().get(8));
classLocalVariable.internalInit(descriptor.getExtensions().get(9));
anonymousObjectOriginName.internalInit(descriptor.getExtensions().get(10));
packageModuleName.internalInit(descriptor.getExtensions().get(11));
packageLocalVariable.internalInit(descriptor.getExtensions().get(12));
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);

File diff suppressed because it is too large Load Diff

View File

@@ -5,49 +5,51 @@ import java.util.*
import java.io.File
import org.gradle.api.tasks.bundling.Jar
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import proguard.gradle.ProGuardTask
buildscript {
extra["defaultSnapshotVersion"] = "1.2-SNAPSHOT"
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.2.50-dev-310", onlySuccessBootstrap = false))
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.20-dev-1708", onlySuccessBootstrap = false))
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
val repos = listOfNotNull(
mirrorRepo,
bootstrapKotlinRepo,
"https://jcenter.bintray.com/",
"https://plugins.gradle.org/m2",
"http://dl.bintray.com/kotlin/kotlinx",
"https://repo.gradle.org/gradle/libs-releases-local", // for native-platform
"https://jetbrains.bintray.com/intellij-third-party-dependencies", // for jflex
"https://dl.bintray.com/jetbrains/markdown" // for org.jetbrains:markdown
)
extra["repos"] = repos
repositories {
for (repo in repos) {
maven(url = repo)
}
repositories.withRedirector(project) {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
// kotlin-stdlib external dependency with local project :kotlin-stdlib in kotlinCompilerClasspath configuration.
// see also configureCompilerClasspath@
val bootstrapCompilerClasspath by configurations.creating
dependencies {
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlinDep("gradle-plugin", bootstrapKotlinVersion))
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:5.3.3")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
}
}
plugins {
`build-scan`
`build-scan` version "1.15"
idea
id("jps-compatible")
}
pill {
excludedDirs(
"out",
"buildSrc/build",
"buildSrc/prepare-deps/android-dx/build",
"buildSrc/prepare-deps/intellij-sdk/build"
)
}
buildScan {
setTermsOfServiceUrl("https://gradle.com/terms-of-service")
setTermsOfServiceAgree("yes")
@@ -64,7 +66,7 @@ val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
val kotlinVersion by extra(findProperty("deployVersion")?.toString() ?: buildNumber)
val kotlinLanguageVersion by extra("1.2")
val kotlinLanguageVersion by extra("1.3")
allprojects {
group = "org.jetbrains.kotlin"
@@ -73,20 +75,18 @@ allprojects {
extra["kotlin_root"] = rootDir
val bootstrapCompileCfg = configurations.create("bootstrapCompile")
repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) {
maven(url = repo)
}
}
val cidrKotlinPlugin by configurations.creating
val appcodeKotlinPlugin by configurations.creating
val clionKotlinPlugin by configurations.creating
val includeCidr by extra(project.getBooleanProperty("cidrPluginsEnabled") ?: false)
dependencies {
bootstrapCompileCfg(kotlinDep("compiler-embeddable", bootstrapKotlinVersion))
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
if (includeCidr) {
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
appcodeKotlinPlugin(project(":prepare:appcode-plugin", "runtimeJar"))
clionKotlinPlugin(project(":prepare:clion-plugin", "runtimeJar"))
}
}
val commonBuildDir = File(rootDir, "build")
@@ -96,9 +96,13 @@ val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val clionSandboxDir = "$commonLocalDataDir/clionSandbox"
val appcodeSandboxDir = "$commonLocalDataDir/appcodeSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
val appcodePluginDir = "$distDir/artifacts/appcodePlugin/Kotlin"
val clionPluginDir = "$distDir/artifacts/clionPlugin/Kotlin"
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
@@ -106,29 +110,46 @@ extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["clionSandboxDir"] = project.file(ideaSandboxDir)
extra["appcodeSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
extra["appcodePluginDir"] = project.file(appcodePluginDir)
extra["clionPluginDir"] = project.file(clionPluginDir)
extra["isSonatypeRelease"] = false
Properties().apply {
load(File(rootDir, "resources", "kotlinManifest.properties").reader())
forEach {
val key = it.key
if (key != null && key is String)
extra[key] = it.value
}
}
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
val jdkNotFoundConst = "JDK NOT FOUND"
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
extra["JDK_18"] = jdkPath("1.8")
extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPathIfFound("10")
extra["JDK_10"] = jdkPath("10")
extra["JDK_11"] = jdkPath("11")
gradle.taskGraph.beforeTask() {
checkJDK()
}
var jdkChecked: Boolean = false
fun checkJDK() {
if (jdkChecked) {
return
}
var unpresentJdks = JdkMajorVersion.values().filter { it.isMandatory() }.map { it -> it.name }.filter { it == null || extra[it] == jdkNotFoundConst }.toList()
if (!unpresentJdks.isEmpty()) {
throw GradleException("Please set environment variable${if (unpresentJdks.size > 1) "s" else ""}: ${unpresentJdks.joinToString()} to point to corresponding JDK installation.")
}
jdkChecked = true
}
rootProject.apply {
from(rootProject.file("versions.gradle.kts"))
from(rootProject.file("report.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
extra["versions.protobuf-java"] = "2.6.1"
extra["versions.javax.inject"] = "1"
@@ -139,8 +160,8 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
extra["versions.kotlinx-coroutines-core"] = "0.20"
extra["versions.kotlinx-coroutines-jdk8"] = "0.20"
extra["versions.kotlinx-coroutines-core"] = "1.0.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.0.1"
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -148,6 +169,7 @@ extra["versions.robolectric"] = "3.1"
extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
@@ -161,35 +183,33 @@ extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf("annotations",
"asm-all",
"guava-21.0",
if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java-0.5.1",
"snappy-in-java",
"streamex",
"trove4j")
extra["nativePlatformVariants"] =
listOf("windows-amd64",
"windows-i386",
"osx-amd64",
"osx-i386",
"linux-amd64",
"linux-i386",
"freebsd-amd64-libcpp",
"freebsd-amd64-libstdcpp",
"freebsd-i386-libcpp",
"freebsd-i386-libstdcpp")
extra["compilerModules"] = arrayOf(
":compiler:util",
":compiler:container",
":compiler:conditional-preprocessor",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
*if (project.findProperty("fir.enabled") == "true") {
arrayOf(
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir"
)
} else {
emptyArray()
},
":compiler:frontend",
":compiler:frontend.java",
":compiler:frontend.script",
@@ -198,6 +218,7 @@ extra["compilerModules"] = arrayOf(
":compiler:daemon",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.js",
":compiler:backend-common",
":compiler:backend",
@@ -232,6 +253,7 @@ val coreLibProjects = listOf(
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
@@ -262,11 +284,6 @@ apply {
}
}
fun Project.allprojectsRecursive(body: Project.() -> Unit) {
this.body()
this.subprojects { allprojectsRecursive(body) }
}
fun Task.listConfigurationContents(configName: String) {
doFirst {
project.configurations.findByName(configName)?.let {
@@ -276,13 +293,18 @@ fun Task.listConfigurationContents(configName: String) {
}
val defaultJvmTarget = "1.8"
val defaultJavaHome = jdkPath(defaultJvmTarget!!)
val defaultJavaHome = jdkPath(defaultJvmTarget)
val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toString()?.toBoolean() ?: project.hasProperty("teamcity"))
allprojects {
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
if (defaultJavaHome != null) {
javaHome = defaultJavaHome
} else {
logger.error("Could not find default java home. Please set environment variable JDK_${defaultJavaHome} to point to JDK ${defaultJavaHome} installation.")
}
// There are problems with common build dir:
// - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location
@@ -290,19 +312,23 @@ allprojects {
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val repos: List<String> by rootProject.extra
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
for (repo in repos) {
maven(repo)
}
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
}
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOf("-Xallow-kotlin-package", "-Xread-deserialized-contracts")
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
@@ -341,22 +367,50 @@ allprojects {
task("listDistJar") { listConfigurationContents("distJar") }
afterEvaluate {
logger.info("configuring project $name to compile to the target jvm version $jvmTarget using jdk: $javaHome")
if (javaHome != defaultJavaHome || jvmTarget != defaultJvmTarget) {
logger.info("configuring project $name to compile to the target jvm version $jvmTarget using jdk: $javaHome")
configureJvmProject(javaHome!!, jvmTarget!!)
}
} // else we will actually fail during the first task execution. We could not fail before configuration is done due to impact on import in IDE
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
fun FileCollection.printClassPath(role: String) =
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() } }")
try { the<JavaPluginConvention>() } catch (_: UnknownDomainObjectException) { null }?.let { javaConvention ->
try { javaPluginConvention() } catch (_: UnknownDomainObjectException) { null }?.let { javaConvention ->
task("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
task("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
}
run configureCompilerClasspath@ {
val bootstrapCompilerClasspath by rootProject.buildscript.configurations
configurations.findByName("kotlinCompilerClasspath")?.let {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
}
}
}
gradle.taskGraph.whenReady {
if (isTeamcityBuild) {
logger.warn("CI build profile is active (IC is off, proguard is on). Use -Pteamcity=false to reproduce local build")
for (task in allTasks) {
when (task) {
is AbstractKotlinCompile<*> -> task.incremental = false
is JavaCompile -> task.options.isIncremental = false
}
}
} else {
logger.warn("Local build profile is active (IC is on, proguard is off). Use -Pteamcity=true to reproduce TC build")
for (task in allTasks) {
when (task) {
// todo: remove when Gradle 4.10+ is used (Java IC on by default)
is JavaCompile -> task.options.isIncremental = true
is org.gradle.jvm.tasks.Jar -> task.entryCompression = ZipEntryCompression.STORED
}
}
}
}
@@ -382,96 +436,112 @@ val ideaPlugin by task<Task> {
}
tasks {
"clean" {
create("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
}
}
// TODO: copied from TeamCityBuild.xml (with ultimate-related modification), consider removing after migrating from it
"cleanupArtifacts" {
create("cleanupArtifacts") {
doLast {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
delete(appcodePluginDir)
delete(clionPluginDir)
}
}
"coreLibsTest" {
create("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
dependsOn(it + ":check")
}
}
"gradlePluginTest" {
create("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn(it + ":check")
}
}
"gradlePluginIntegrationTest" {
create("gradlePluginIntegrationTest") {
dependsOn(":kotlin-gradle-plugin-integration-tests:check")
}
"jvmCompilerTest" {
create("jvmCompilerTest") {
dependsOn("dist")
dependsOn(":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test")
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests")
dependsOn(":plugins:jvm-abi-gen:test")
}
"jsCompilerTest" {
create("jsCompilerTest") {
dependsOn(":js:js.tests:test")
dependsOn(":js:js.tests:runMocha")
}
"scriptingTest" {
create("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-jvm-host:test")
}
"compilerTest" {
create("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
dependsOn(":core:descriptors.runtime:test")
}
"examplesTest" {
create("toolsTest") {
dependsOn(":tools:kotlinp:test")
}
create("examplesTest") {
dependsOn("dist")
(project(":examples").subprojects + project(":kotlin-gradle-subplugin-example")).forEach { p ->
dependsOn("${p.path}:check")
}
}
"distTest" {
create("distTest") {
dependsOn("compilerTest")
dependsOn("toolsTest")
dependsOn("gradlePluginTest")
dependsOn("examplesTest")
}
"androidCodegenTest" {
create("specTest") {
dependsOn("dist")
dependsOn(":compiler:tests-spec:test")
}
create("androidCodegenTest") {
dependsOn(":compiler:android-tests:test")
}
"jps-tests" {
create("jps-tests") {
dependsOn("dist")
dependsOn(":jps-plugin:test")
}
"idea-plugin-main-tests" {
create("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
}
"idea-plugin-additional-tests" {
create("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(":idea:idea-gradle:test",
":idea:idea-maven:test",
@@ -479,20 +549,20 @@ tasks {
":eval4j:test")
}
"idea-plugin-tests" {
create("idea-plugin-tests") {
dependsOn("dist")
dependsOn("idea-plugin-main-tests",
"idea-plugin-additional-tests")
}
"android-ide-tests" {
create("android-ide-tests") {
dependsOn("dist")
dependsOn(":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test")
}
"plugins-tests" {
create("plugins-tests") {
dependsOn("dist")
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
@@ -500,11 +570,12 @@ tasks {
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test")
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test")
}
"ideaPluginTest" {
create("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
@@ -515,12 +586,15 @@ tasks {
}
"test" {
create("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
}
}
"check" { dependsOn("test") }
create("check") {
dependsOn("test")
}
}
fun CopySpec.setExecutablePermissions() {
@@ -548,6 +622,8 @@ val zipTestData by task<Zip> {
from("compiler/testData") { into("compiler") }
from("idea/testData") { into("ide") }
from("idea/idea-completion/testData") { into("ide/completion") }
from("libraries/stdlib/common/test") { into("stdlib/common") }
from("libraries/stdlib/test") { into("stdlib/test") }
doLast {
logger.lifecycle("Test data packed to $archivePath")
}
@@ -577,22 +653,48 @@ val zipPlugin by task<Zip> {
}
}
val cidrPlugin by task<Copy> {
fun cidrPlugin(product: String, pluginDir: String) = tasks.creating(Copy::class.java) {
if (!includeCidr) {
throw GradleException("CIDR plugins require 'cidrPluginsEnabled' property turned on")
}
val prepareCidrPlugin = getTasksByName("cidrPlugin", true)
val prepareCurrentPlugin = (getTasksByName(product.toLowerCase() + "Plugin", true) - this)
prepareCurrentPlugin.forEach { it.mustRunAfter(prepareCidrPlugin) }
dependsOn(ideaPlugin)
into(cidrPluginDir)
from(ideaPluginDir) { exclude("lib/kotlin-plugin.jar") }
dependsOn(prepareCidrPlugin)
dependsOn(prepareCurrentPlugin)
into(pluginDir)
from(ideaPluginDir) {
exclude("lib/kotlin-plugin.jar")
exclude("lib/android-lint.jar")
exclude("lib/android-ide.jar")
exclude("lib/android-output-parser-ide.jar")
exclude("lib/android-extensions-ide.jar")
exclude("lib/android-extensions-compiler.jar")
exclude("lib/kapt3-idea.jar")
exclude("lib/jps-ide.jar")
exclude("lib/jps/**")
exclude("kotlinc/**")
exclude("lib/maven-ide.jar")
}
from(cidrKotlinPlugin) { into("lib") }
from(configurations[product.toLowerCase() + "KotlinPlugin"]) { into("lib") }
}
val zipCidrPlugin by task<Zip> {
fun zipCidrPlugin(product: String, productVersion: String) = tasks.creating(Zip::class.java) {
// Note: "cidrPluginVersion" has different format and semantics from "pluginVersion" used in IJ and AS plugins.
val cidrPluginVersion = project.findProperty("cidrPluginVersion") as String? ?: "beta-1"
val destPath = project.findProperty("pluginZipPath") as String?
?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-CIDR"
?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-$product-$cidrPluginVersion-$productVersion.zip"
val destFile = File(destPath)
destinationDir = destFile.parentFile
archiveName = destFile.name
from(cidrPlugin)
from(tasks[product.toLowerCase() + "Plugin"])
into("Kotlin")
setExecutablePermissions()
@@ -601,6 +703,16 @@ val zipCidrPlugin by task<Zip> {
}
}
if (includeCidr) {
val appcodePlugin by cidrPlugin("AppCode", appcodePluginDir)
val appcodeVersion = extra["versions.appcode"] as String
val zipAppCodePlugin by zipCidrPlugin("AppCode", appcodeVersion)
val clionPlugin by cidrPlugin("CLion", clionPluginDir)
val clionVersion = extra["versions.clion"] as String
val zipCLionPlugin by zipCidrPlugin("CLion", clionVersion)
}
configure<IdeaModel> {
module {
excludeDirs = files(
@@ -613,14 +725,12 @@ configure<IdeaModel> {
}
}
fun jdkPathIfFound(version: String): String? {
fun jdkPath(version: String): String {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath?:jdkNotFoundConst
}
fun jdkPath(version: String): String = jdkPathIfFound(version)
?: throw GradleException ("Please set environment variable JDK_${version.replace(".", "")} to point to JDK $version installation")
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<JavaCompile> {
@@ -652,7 +762,7 @@ tasks.create("findShadowJarsInClasspath").doLast {
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(File(task.archivePath))
shadowJars.add(fileFrom(task.archivePath))
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
@@ -679,3 +789,12 @@ tasks.create("findShadowJarsInClasspath").doLast {
project.checkConfig("testCompileClasspath")
}
}
allprojects {
afterEvaluate {
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}

View File

@@ -1,11 +1,17 @@
buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
extra["versions.shadow"] = "2.0.2"
extra["versions.native-platform"] = "0.14"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
}
buildSrcKotlinRepo?.let {
maven(url = it)
}
@@ -17,6 +23,8 @@ buildscript {
}
}
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
logger.info("buildSrcKotlinVersion: " + extra["buildSrcKotlinVersion"])
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
@@ -32,12 +40,12 @@ plugins {
}
gradlePlugin {
(plugins) {
"jps-compatible-base" {
id = "jps-compatible-base"
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatibleBasePlugin"
plugins {
register("pill-configurable") {
id = "pill-configurable"
implementationClass = "org.jetbrains.kotlin.pill.PillConfigurablePlugin"
}
"jps-compatible" {
register("jps-compatible") {
id = "jps-compatible"
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
}
@@ -58,17 +66,24 @@ val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
extra["intellijRepo"] = "https://www.jetbrains.com/intellij-repository"
extra["intellijReleaseType"] = "releases" // or "snapshots"
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
else
"releases"
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
}
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
}
maven(url = "https://repo.gradle.org/gradle/libs-releases-local") // for native-platform
jcenter()
}
@@ -77,9 +92,7 @@ dependencies {
compile("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
compile("com.jakewharton.dex:dex-method-list:3.0.0")
// TODO: adding the dep to the plugin breaks the build unexpectedly, resolve and uncomment
// compile("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["bootstrap_kotlin_version"]}")
// Shadow plugin is used in many projects of the main build. Once it's no longer used in buildSrc, please move this dependency to the root project
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.ow2.asm:asm-all:6.0_BETA")
}

View File

@@ -3,5 +3,7 @@ org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50

View File

@@ -0,0 +1,11 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -0,0 +1,11 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -0,0 +1,11 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -0,0 +1,11 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,5 +1,5 @@
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
@@ -24,8 +24,11 @@ val dxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
repositories {
ivy {
artifactPattern("https://dl-ssl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://dl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$dxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
}
@@ -89,8 +92,8 @@ val prepareIvyXml by tasks.creating {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, dxModuleName, dxRevision))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
addArtifact(DefaultIvyArtifact(File(dxRepoModuleDir, "dx.jar"), "dx", "jar", "jar", null).also { it.conf = "default" })
addArtifact(DefaultIvyArtifact(File(dxRepoModuleDir, "dx-sources.jar"), "dx", "jar", "sources", "sources").also { it.conf = "sources" })
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "default" })
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx-sources.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "sources" })
writeTo(ivyFile)
}
}

View File

@@ -1,25 +1,15 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
}
}
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijRepo: String by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
@@ -28,8 +18,12 @@ val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val platformBaseVersion = intellijVersion.substringBefore('.', "").takeIf { it.isNotEmpty() }
?: error("Invalid IDEA version $intellijVersion")
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
@@ -56,20 +50,29 @@ val studioOs by lazy {
repositories {
if (androidStudioRelease != null) {
ivy {
if (cacheRedirectorEnabled) {
artifactPattern("https://cache-redirector.jetbrains.com/dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
}
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
metadataSources {
artifact()
}
}
}
maven { setUrl("$intellijRepo/$intellijReleaseType") }
maven { setUrl("https://plugins.jetbrains.com/maven") }
ivy {
artifactPattern("https://raw.github.com/JetBrains/intellij-community/[revision]/lib/src/[artifact].zip")
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven")
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `asm-shaded-sources` by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
@@ -93,7 +96,6 @@ dependencies {
}
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`asm-shaded-sources`("asmsources:asm-src:$platformBaseVersion@zip")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
@@ -150,19 +152,9 @@ val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyAsmShadedSources by tasks.creating(Copy::class.java) {
from(`asm-shaded-sources`)
rename(".zip", ".jar")
destinationDir = File(repoDir, `asm-shaded-sources`.name)
}
val copyIntellijSdkSources by tasks.creating(ShadowJar::class.java) {
from(copyAsmShadedSources)
val copyIntellijSdkSources by tasks.creating(Copy::class.java) {
from(sources)
baseName = "ideaIC"
version = intellijVersion
classifier = "sources"
destinationDir = File(repoDir, sources.name)
into(File(repoDir, sources.name))
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
@@ -173,22 +165,31 @@ fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection,
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
jarFiles.asFileTree.files.forEach {
if (it.isFile && it.extension == "jar") {
val relativeName = it.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(DefaultIvyArtifact(it, relativeName, "jar", "jar", null).also { it.conf = "default" })
jarFiles.asFileTree.files.forEach { jarFile ->
if (jarFile.isFile && jarFile.extension == "jar") {
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(
FileBasedIvyArtifact(jarFile, DefaultIvyPublicationIdentity(customDepsOrg, relativeName, intellijVersion)).also {
it.conf = "default"
}
)
}
}
if (sourcesJar != null) {
val sourcesArtifactName = sourcesJar.name.removeSuffix(".jar").substringBefore("-")
addArtifact(DefaultIvyArtifact(sourcesJar, sourcesArtifactName, "jar", "sources", "sources").also { it.conf = "sources" })
val sourcesArtifactName = sourcesJar.name.substringBefore("-")
addArtifact(
FileBasedIvyArtifact(sourcesJar, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also {
it.conf = "sources"
it.classifier = "sources"
}
)
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest, copyAsmShadedSources)
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
@@ -205,7 +206,7 @@ val prepareIvyXmls by tasks.creating {
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`, `asm-shaded-sources`)
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))

View File

@@ -1,3 +1,15 @@
pluginManagement {
repositories {
if (cacheRedirectorEnabled == 'true') {
maven {
url "https://cache-redirector.jetbrains.com/plugins.gradle.org/m2"
}
}
gradlePluginPortal()
}
}
include "prepare-deps:android-dx",
"prepare-deps:intellij-sdk"

View File

@@ -4,6 +4,7 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.kotlin.dsl.extra
import java.io.File
fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = File("${project.rootDir}/buildSrc/prepare-deps/android-dx/build/repo")

View File

@@ -15,11 +15,12 @@ fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?
val teamCityVersion = project.findProperty("bootstrap.teamcity.kotlin.version") as String?
val teamCityBuild = project.findProperty("bootstrap.teamcity.build.number") as String?
val teamCityProject = project.findProperty("bootstrap.teamcity.project") as String?
val bootstrapSource = when {
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(project.findProperty("bootstrap.local.version") as String?, project.findProperty("bootstrap.local.path") as String?)
teamCityVersion != null -> BootstrapOption.TeamCity(teamCityVersion, projectExtId = teamCityProject, onlySuccessBootstrap = false)
teamCityVersion != null -> BootstrapOption.TeamCity(teamCityVersion, teamCityBuild, projectExtId = teamCityProject, onlySuccessBootstrap = false)
customVersion != null -> BootstrapOption.Custom(kotlinVersion = customVersion, repo = customRepo)
else -> defaultSource
}
@@ -47,14 +48,15 @@ sealed class BootstrapOption {
/** Get bootstrap from teamcity maven artifacts of the specified build configuration
*
* [kotlinVersion] build number and the version of maven artifacts
* [kotlinVersion] the version of maven artifacts
* [buildNumber] build number of a teamcity build, by default the same as [kotlinVersion],
* [projectExtId] extId of a teamcity build configuration, by default "Kotlin_dev_Compiler",
* [onlySuccessBootstrap] allow artifacts only from success builds of the default branch tagged with 'bootstrap' tag
*/
class TeamCity(val kotlinVersion: String, val projectExtId: String? = null, val onlySuccessBootstrap: Boolean = true) : BootstrapOption() {
class TeamCity(val kotlinVersion: String, val buildNumber: String? = null, val projectExtId: String? = null, val onlySuccessBootstrap: Boolean = true) : BootstrapOption() {
override fun applyToProject(project: Project) {
val query = if (onlySuccessBootstrap) "status:SUCCESS,tag:bootstrap,pinned:true" else "branch:default:any"
project.bootstrapKotlinRepo = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"}),number:$kotlinVersion,$query/artifacts/content/maven/"
project.bootstrapKotlinRepo = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinVersion = kotlinVersion
}
}

View File

@@ -1,4 +1,5 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import groovy.lang.Closure
import org.gradle.api.Project
@@ -6,11 +7,11 @@ import org.gradle.api.Task
import org.gradle.api.file.CopySourceSpec
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.the
import java.io.File
import java.util.concurrent.Callable
@@ -21,7 +22,7 @@ fun Project.callGroovy(name: String, vararg args: Any?): Any? {
return (property(name) as Closure<*>).call(*args)
}
inline fun<T: Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
inline fun <T : Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
var res: T? = null
pluginManager.withPlugin("java") {
res = body()
@@ -29,31 +30,30 @@ inline fun<T: Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
return res
}
fun Project.getCompiledClasses(): SourceSetOutput? = withJavaPlugin {
the<JavaPluginConvention>().sourceSets.getByName("main").output
}
fun Project.getCompiledClasses(): SourceSetOutput? = withJavaPlugin { mainSourceSet.output }
fun Project.getSources(): SourceDirectorySet? = withJavaPlugin {
the<JavaPluginConvention>().sourceSets.getByName("main").allSource
}
fun Project.getSources(): SourceDirectorySet? = withJavaPlugin { mainSourceSet.allSource }
fun Project.getResourceFiles(): SourceDirectorySet? = withJavaPlugin {
the<JavaPluginConvention>().sourceSets.getByName("main").resources
}
fun Project.getResourceFiles(): SourceDirectorySet? = withJavaPlugin { mainSourceSet.resources }
fun File(root: File, vararg children: String): File = children.fold(root, { f, c -> File(f, c) })
fun File(root: String, vararg children: String): File = children.fold(File(root), { f, c -> File(f, c) })
fun fileFrom(root: File, vararg children: String): File = children.fold(root) { f, c -> File(f, c) }
fun fileFrom(root: String, vararg children: String): File = children.fold(File(root)) { f, c -> File(f, c) }
var Project.jvmTarget: String?
get() = extra.takeIf { it.has("jvmTarget") }?.get("jvmTarget") as? String
set(v) { extra["jvmTarget"] = v }
set(v) {
extra["jvmTarget"] = v
}
var Project.javaHome: String?
get() = extra.takeIf { it.has("javaHome") }?.get("javaHome") as? String
set(v) { extra["javaHome"] = v }
set(v) {
extra["javaHome"] = v
}
fun Project.generator(fqName: String) = task<JavaExec> {
classpath = the<JavaPluginConvention>().sourceSets["test"].runtimeClasspath
fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaExec {
classpath = (sourceSet ?: testSourceSet).runtimeClasspath
main = fqName
workingDir = rootDir
}
@@ -65,3 +65,5 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
}
inline fun CopySourceSpec.from(crossinline filesProvider: () -> Any?): CopySourceSpec = from(Callable { filesProvider() })
fun Project.javaPluginConvention(): JavaPluginConvention = the()

View File

@@ -0,0 +1,98 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project
interface CompatibilityPredicate {
fun matches(ide: Ide): Boolean
operator fun invoke(): Boolean = matches(IdeVersionConfigurator.currentIde)
operator fun invoke(block: () -> Unit): Unit {
if (matches(IdeVersionConfigurator.currentIde)) {
block()
}
}
}
val CompatibilityPredicate.not: CompatibilityPredicate get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = !this@not.matches(ide)
}
fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredicate = object : CompatibilityPredicate {
override fun matches(ide: Ide) = this@or.matches(ide) || other.matches(ide)
}
enum class Platform : CompatibilityPredicate {
P173, P181, P182, P183, P191;
val version: Int = name.drop(1).toInt()
override fun matches(ide: Ide) = ide.platform == this
companion object {
operator fun get(version: Int): Platform {
return Platform.values().firstOrNull { it.version == version }
?: error("Can't find platform $version")
}
}
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ173(Platform.P173),
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
AS31(Platform.P173),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()
override fun matches(ide: Ide) = ide == this
enum class Kind(val shortName: String) {
AndroidStudio("AS"), IntelliJ("IJ")
}
companion object {
val IJ: CompatibilityPredicate = IdeKindPredicate(Kind.IntelliJ)
val AS: CompatibilityPredicate = IdeKindPredicate(Kind.AndroidStudio)
}
}
val Platform.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version >= version
}
val Platform.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version <= version
}
val Ide.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version >= version
}
val Ide.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version <= version
}
object IdeVersionConfigurator {
lateinit var currentIde: Ide
fun setCurrentIde(project: Project) {
val platformVersion = project.rootProject.extensions.extraProperties["versions.platform"].toString()
val ideName = if (platformVersion.startsWith("AS")) platformVersion else "IJ$platformVersion"
currentIde = Ide.valueOf(ideName)
}
}
private class IdeKindPredicate(val kind: Ide.Kind) : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.tasks.JavaExec
/**
* Workaround for IDEA-200192:
* IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
*/
open class NoDebugJavaExec : JavaExec() {
private fun String.isDebuggerArgument(): Boolean =
startsWith("-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=")
override fun setJvmArgs(arguments: MutableList<String>?) {
super.setJvmArgs(arguments?.filterNot { it.isDebuggerArgument() })
}
}

View File

@@ -0,0 +1,48 @@
import org.gradle.api.Project
import org.gradle.api.tasks.JavaExec
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaExec@{
configure()
val jarTask = project.task("${name}WriteClassPath", Jar::class) {
val classpath = classpath
val main = main
dependsOn(classpath)
inputs.files(classpath)
inputs.property("main", main)
doFirst {
val classPathString = classpath.joinToString(" ") { project.file(it).toURI().toString() }
manifest {
attributes(
mapOf(
"Class-Path" to classPathString,
"Main-Class" to main
)
)
}
}
archiveName = "$main.${this@javaExec.name}.classpath.container.$extension"
destinationDir = temporaryDir
}
dependsOn(jarTask)
doFirst {
main = "-jar"
classpath = project.files()
val copyArgs = args.orEmpty().toList()
args(jarTask.outputs.files.singleFile)
args(copyArgs)
}
}

View File

@@ -8,7 +8,6 @@ import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import java.io.File
@@ -23,7 +22,7 @@ fun Project.classesDirsArtifact(): FileCollection {
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
val classesDirs = the<JavaPluginConvention>().sourceSets["main"].output.classesDirs
val classesDirs = mainSourceSet.output.classesDirs
val classesTask = tasks["classes"]
@@ -44,7 +43,7 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
return task<Jar>(MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME) {
dependsOn("testClasses")
pluginManager.withPlugin("java") {
from(project.the<JavaPluginConvention>().sourceSets.getByName("test").output)
from(testSourceSet.output)
}
classifier = "tests"
body()
@@ -55,15 +54,21 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
fun Project.noDefaultJar() {
tasks.findByName("jar")?.let { defaultJarTask ->
defaultJarTask.enabled = false
configurations.findByName("archives")?.artifacts?.removeAll {
(it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false
defaultJarTask.actions = emptyList()
configurations.forEach { cfg ->
cfg.artifacts.removeAll { artifact ->
artifact.file in defaultJarTask.outputs.files
}
}
}
}
fun<T> Project.runtimeJarArtifactBy(task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
addArtifact("archives", task, artifactRef, body)
addArtifact("runtimeJar", task, artifactRef, body)
configurations.findByName("runtime")?.let {
addArtifact(it, task, artifactRef, body)
}
}
fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
@@ -72,23 +77,23 @@ fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
configurations.getOrCreate("archives").artifacts.removeAll { (it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false }
}
return task.apply {
setupPublicJar()
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
body()
project.runtimeJarArtifactBy(this, this)
}
}
fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask(taskName, body))
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(sourceSet: String? = "main", body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("sourcesJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.the<JavaPluginConvention>().sourceSets[sourceSet].allSource)
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
}
} catch (e: UnknownDomainObjectException) {
@@ -100,7 +105,7 @@ fun Project.sourcesJar(sourceSet: String? = "main", body: Jar.() -> Unit = {}):
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "javadoc"
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
@@ -181,25 +186,26 @@ private fun Project.runtimeJarTaskIfExists(): Task? =
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(classifier: String = "") {
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {
val buildNumber = project.rootProject.extra["buildNumber"] as String
this.baseName = baseName
this.classifier = classifier
manifest.attributes.apply {
put("Implementation-Vendor", "JetBrains")
put("Implementation-Title", project.the<BasePluginConvention>().archivesBaseName)
put("Implementation-Version", project.rootProject.extra["buildNumber"])
put("Build-Jdk", System.getProperty("java.version"))
put("Implementation-Title", baseName)
put("Implementation-Version", buildNumber)
}
}
fun<T> Project.addArtifact(configuration: Configuration, task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun Project.addArtifact(configuration: Configuration, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
artifacts.add(configuration.name, artifactRef) {
builtBy(task)
body()
}
}
fun<T> Project.addArtifact(configurationName: String, task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) =
fun Project.addArtifact(configurationName: String, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun Project.cleanArtifacts() {

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package tasks
import groovy.util.Node
import groovy.util.XmlParser
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import java.io.File
import java.util.*
open class WriteCopyrightToFile : DefaultTask() {
@InputFile
var path = project.file("${project.rootDir}/.idea/copyright/apache.xml")
@OutputFile
var outputFile: File? = null
@Input
var commented: Boolean = true
@TaskAction
fun write() {
if (commented) {
outputFile!!.writeText(project.readCopyrightCommented())
} else {
outputFile!!.writeText(project.readCopyright())
}
}
fun Project.readCopyright(): String {
val file = rootDir.resolve(".idea/copyright/apache.xml")
assert(file.exists()) {
"File $file with copyright not found"
}
val xmlParser = XmlParser()
val node = xmlParser.parse(file)
assert(node.attribute("name") == "CopyrightManager") {
"Format changed occasionally?"
}
val copyrightBlock = node.children().filterIsInstance<Node>().single()
val noticeNode = copyrightBlock.children().filterIsInstance<Node>().single { it.attribute("name") == "notice" }
return noticeNode.attribute("value").toString().replace("&#36;today.year", GregorianCalendar()[Calendar.YEAR].toString())
}
fun Project.readCopyrightCommented(): String {
return "/*\n" + readCopyright().prependIndent(" * ") + "\n */"
}
}

View File

@@ -50,14 +50,15 @@ fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File
}
fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir: String? = null): ConfigurableFileCollection {
val ultimateDepsDir = File(rootDir, "ultimate", "dependencies")
val ultimateDepsDir = fileFrom(rootDir, "ultimate", "dependencies")
return if (ultimateDepsDir.isDirectory) preloadedDeps(*artifactBaseNames, baseDir = ultimateDepsDir, subdir = subdir)
else files()
}
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name, configuration = "distJar").apply { isTransitive = false }
@Deprecated("Depend on the default configuration instead", ReplaceWith("project(name)"))
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name)
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
@@ -103,6 +104,9 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): File? =
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
val compilerManifestClassPath
get() = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
object EmbeddedComponents {
val CONFIGURATION_NAME = "embeddedComponents"
}
@@ -112,6 +116,37 @@ fun AbstractCopyTask.fromEmbeddedComponents() {
if (this is ShadowJar) {
from(embeddedComponents)
} else {
embeddedComponents.forEach { from(if (it.isDirectory) it else project.zipTree(it)) }
dependsOn(embeddedComponents)
from {
embeddedComponents.map { file ->
if (file.isDirectory)
project.files(file)
else
project.zipTree(file)
}
}
}
}
}
// TODO: it seems incomplete, find and add missing dependencies
val testDistProjects = listOf(
"", // for root project
":kotlin-stdlib:jvm-minimal-for-test",
":kotlin-compiler",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-stdlib-js",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-js",
":kotlin-preloader",
":plugins:android-extensions-compiler",
":kotlin-ant",
":kotlin-annotations-jvm",
":kotlin-annotations-android"
)

View File

@@ -6,6 +6,7 @@ import org.gradle.api.file.DuplicatesStrategy
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
import org.gradle.kotlin.dsl.*
import java.io.File
val kotlinEmbeddableRootPackage = "org.jetbrains.kotlin"
@@ -17,7 +18,6 @@ val packagesToRelocate =
"org.jdom",
"org.picocontainer",
"org.jline",
"gnu",
"org.fusesource",
"kotlinx.coroutines")
@@ -64,7 +64,7 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
return task<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerJar)
body()
}
@@ -96,7 +96,7 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "
return task<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerDummyJar)
configureEmbeddableCompilerRelocation(withJavaxInject = false)
body()
@@ -118,7 +118,7 @@ fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, bod
// which leads to the content of that JAR being excluded as well:
exclude { it.file == compilerDummyJarFile }
classifier = null
classifier = ""
body()
}
}

View File

@@ -45,7 +45,6 @@ fun Project.configureInstrumentation() {
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
val mainSourceSet = the<JavaPluginConvention>().sourceSets.getByName("main")
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
@@ -55,11 +54,11 @@ fun Project.configureInstrumentation() {
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
dependencies {
instrumentationClasspathCfg(intellijDep()) { includeJars("javac2", "jdom", "asm-all", "jgoodies-forms") }
instrumentationClasspathCfg(intellijDep()) { includeJars("javac2", "jdom", "asm-all", rootProject = rootProject) }
}
afterEvaluate {
the<JavaPluginConvention>().sourceSets.all { sourceSetParam ->
sourceSets.all { sourceSetParam ->
// This copy will ignore filters, but they are unlikely to be used.
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
@@ -106,12 +105,12 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@get:OutputDirectory
var output: File? = null
lateinit var output: File
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
output?.deleteRecursively()
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
@@ -150,7 +149,7 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
// Instrumentation needs to have access to sources of forms for inclusion
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.the<JavaPluginConvention>().sourceSets.getByName("main").allSource.sourceDirectories }
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")

View File

@@ -0,0 +1,180 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
/*
* 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.
*/
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
fun Project.configureInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
// When we change the output classes directory, Gradle will automatically configure
// the test compile tasks to use the instrumented classes. Normally this is fine,
// however, it causes problems for Kotlin projects:
// The "internal" modifier can be used to restrict access to the same module.
// To make it possible to use internal methods from the main source set in test classes,
// the Kotlin Gradle plugin adds the original output directory of the Java task
// as "friendly directory" which makes it possible to access internal members
// of the main module. Also this directory should be available on classpath during compilation
// This fails when we change the classes dir. The easiest fix is to prepend the
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
dependencies {
instrumentationClasspathCfg(intellijDep()) { includeJars("javac2", "jdom", "asm-all", "jgoodies-forms", rootProject = rootProject) }
}
afterEvaluate {
sourceSets.all { sourceSetParam ->
// This copy will ignore filters, but they are unlikely to be used.
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
val classesDirsCopy = project.files(classesDirs.toTypedArray()).filter { it.exists() }
(sourceSetParam as ExtensionAware).extra.set("classesDirsCopy", classesDirsCopy)
logger.info("Saving old sources dir for project ${project.name}")
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask = project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
}
instrumentTask.outputs.dir(instrumentedClassesDir)
// Ensure that our task is invoked when the source set is built
sourceSetParam.compiledBy(instrumentTask)
@Suppress("UNUSED_EXPRESSION")
true
}
}
}
@CacheableTask
open class IntelliJInstrumentCodeTask : ConventionTask() {
companion object {
private const val FILTER_ANNOTATION_REGEXP_CLASS = "com.intellij.ant.ClassFilterAnnotationRegexp"
private const val LOADER_REF = "java2.loader"
}
var sourceSet: SourceSet? = null
var instrumentationClasspath: Configuration? = null
@Input
var originalClassesDirs: FileCollection? = null
@get:InputFiles
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@get:OutputDirectory
lateinit var output: File
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
ant.withGroovyBuilder {
"taskdef"("name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions")
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
val instrumentNotNull = prepareNotNullInstrumenting(classpath.asPath)
instrumentCode(sourceDirs, instrumentNotNull)
}
private fun copyOriginalClasses() {
project.copy {
from(originalClassesDirs)
into(output)
}
}
private fun prepareNotNullInstrumenting(classpath: String): Boolean {
ant.withGroovyBuilder {
"typedef"("name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS)
}
return true
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
val headlessOldValue = System.setProperty("java.awt.headless", "true")
// Instrumentation needs to have access to sources of forms for inclusion
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
logger.info("Running instrumentIdeaExtensions with srcdir=${srcDirs.asPath}}, destdir=$output and classpath=$instrumentationClasspath")
ant.withGroovyBuilder {
"instrumentIdeaExtensions"("srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")
}
}
}
}
if (headlessOldValue != null) {
System.setProperty("java.awt.headless", headlessOldValue)
} else {
System.clearProperty("java.awt.headless")
}
}
}

View File

@@ -43,12 +43,17 @@ fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository =
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij.plugin.[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij/plugins/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact](-[revision])(-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/sources/[artifact]-[revision]-[classifier].[ext]")
metadataSources {
ivyDescriptor()
}
}
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}"
@@ -118,7 +123,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
return task<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = the<JavaPluginConvention>().sourceSets["main"].runtimeClasspath
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
@@ -136,9 +141,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}",
"-Dkotlin.internal.mode.enabled=true",
"-Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar"
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (rootProject.findProperty("versions.androidStudioRelease") != null) {

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import java.net.URI
// https://youtrack.jetbrains.com/issue/ADM-23180
val mirroredUrls = listOf(
"https://dl.bintray.com/groovy/maven",
"https://dl.bintray.com/kotlin/kotlin-dev",
"https://dl.bintray.com/kotlin/kotlin-eap",
"https://dl.google.com/dl/android/maven2",
"https://dl.google.com/go",
"https://download.jetbrains.com",
"https://jcenter.bintray.com",
"https://jetbrains.bintray.com/dekaf",
"https://jetbrains.bintray.com/intellij-jdk",
"https://jetbrains.bintray.com/intellij-plugin-service",
"https://jetbrains.bintray.com/intellij-third-party-dependencies",
"https://jetbrains.bintray.com/markdown",
"https://jetbrains.bintray.com/teamcity-rest-client",
"https://jetbrains.bintray.com/test-discovery",
"https://jetbrains.bintray.com/jediterm",
"https://jitpack.io",
"https://maven.exasol.com/artifactory/exasol-releases",
"https://plugins.gradle.org/m2",
"https://plugins.jetbrains.com/maven",
"https://repo.grails.org/grails/core",
"https://repo.jenkins-ci.org/releases",
"https://repo.spring.io/milestone",
"https://repo1.maven.org/maven2",
"https://services.gradle.org",
"https://www.jetbrains.com/intellij-repository",
"https://www.myget.org/F/intellij-go-snapshots/maven",
"https://www.myget.org/F/rd-snapshots/maven",
"https://www.myget.org/F/rd-model-snapshots/maven",
"https://www.python.org/ftp",
"https://dl.google.com/dl/android/studio/ide-zips",
"https://dl.bintray.com/kotlin/ktor",
"https://cdn.azul.com/zulu/bin"
)
fun URI.toCacheRedirectorUri() = URI("https://cache-redirector.jetbrains.com/$host/$path")
fun RepositoryHandler.redirect() = filterIsInstance<MavenArtifactRepository>().forEach { repository ->
val uri = repository.url
if (uri.toString().trimEnd('/') in mirroredUrls) {
repository.url = uri.toCacheRedirectorUri()
}
}
fun Project.cacheRedirectorEnabled(): Boolean = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
fun RepositoryHandler.withRedirector(project: Project, configuration: RepositoryHandler.() -> Unit) {
configuration()
if (project.cacheRedirectorEnabled()) {
redirect()
}
}

View File

@@ -8,8 +8,10 @@ import java.io.File
import net.rubygrapefruit.platform.WindowsRegistry.Key.HKEY_LOCAL_MACHINE
import org.gradle.internal.os.OperatingSystem
enum class JdkMajorVersion {
JDK_16, JDK_17, JDK_18, JDK_9, JDK_10
enum class JdkMajorVersion(private val mandatory: Boolean = true) {
JDK_16, JDK_17, JDK_18, JDK_9, JDK_10(false), JDK_11(false);
fun isMandatory(): Boolean = mandatory
}
val jdkAlternativeVarNames = mapOf(JdkMajorVersion.JDK_9 to listOf("JDK_19"))
@@ -133,7 +135,7 @@ fun MutableCollection<JdkId>.discoverJdksOnUnix(project: Project) {
val installedJdks = File(loc).listFiles { dir ->
dir.isDirectory &&
unixConventionalJdkDirRex.containsMatchIn(dir.name) &&
File(dir, "bin", "java").isFile
fileFrom(dir, "bin", "java").isFile
} ?: continue
for (dir in installedJdks) {
val versionMatch = javaVersionRegex.find(dir.name)
@@ -172,7 +174,7 @@ fun MutableCollection<JdkId>.discoverJdksOnWindows(project: Project) {
else {
javaHome.takeIf { it.isNotEmpty() }
?.let { File(it) }
?.takeIf { it.isDirectory && File(it, "bin", "java.exe").isFile }
?.takeIf { it.isDirectory && fileFrom(it, "bin", "java.exe").isFile }
?.let {
addIfBetter(project, versionMatch.value, jdkKey, it)
}

View File

@@ -4,12 +4,27 @@ package org.jetbrains.kotlin.pill
import org.gradle.api.artifacts.*
class DependencyMapper(
val group: String,
val module: String,
val predicate: (ResolvedDependency) -> Boolean,
vararg val configurations: String,
val mapping: (ResolvedDependency) -> MappedDependency?
)
) {
constructor(
group: String,
module: String,
vararg configurations: String,
version: String? = null,
mapping: (ResolvedDependency) -> MappedDependency?
) : this(
{ dep ->
dep.moduleGroup == group
&& dep.moduleName == module
&& (version == null || dep.moduleVersion == version)
},
configurations = *configurations,
mapping = mapping
)
}
class MappedDependency(val main: PDependency, val deferred: List<PDependency> = emptyList())
class MappedDependency(val main: PDependency?, val deferred: List<PDependency> = emptyList())
class ParserContext(val dependencyMappers: List<DependencyMapper>)
class ParserContext(val dependencyMappers: List<DependencyMapper>, val variant: PillExtension.Variant)

View File

@@ -0,0 +1,39 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
open class PillExtension {
enum class Variant {
// Default variant (./gradlew pill)
BASE() { override val includes = setOf(BASE) },
// Full variant (./gradlew pill -Dpill.variant=full)
FULL() { override val includes = setOf(BASE, FULL) },
// Do not import the project to JPS model, but set some options for it
NONE() { override val includes = emptySet<Variant>() },
// 'BASE' if the "jps-compatible" plugin is applied, 'NONE' otherwise
DEFAULT() { override val includes = emptySet<Variant>() };
abstract val includes: Set<Variant>
}
open var variant: Variant = Variant.DEFAULT
open var importAsLibrary: Boolean = false
open var excludedDirs: List<File> = emptyList()
fun Project.excludedDirs(vararg dirs: String) {
excludedDirs = excludedDirs + dirs.map { File(projectDir, it) }
}
open var libraryPath: File? = null
set(v) {
importAsLibrary = true
field = v
}
}

View File

@@ -77,8 +77,15 @@ sealed class ArtifactElement {
override fun render(context: PathContext) = xml("element", "id" to "module-output", "name" to moduleName)
}
data class FileCopy(val source: File) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "file-copy", "path" to context(source))
data class FileCopy(val source: File, val outputFileName: String? = null) : ArtifactElement() {
override fun render(context: PathContext): xml {
val args = mutableListOf("id" to "file-copy", "path" to context(source))
if (outputFileName != null) {
args += "output-file-name" to outputFileName
}
return xml("element", *args.toTypedArray())
}
}
data class DirectoryCopy(val source: File) : ArtifactElement() {
@@ -138,6 +145,15 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
}
}
fun fileCopySnapshotAware(file: File): FileCopy {
val SHAPSHOT_JAR_SUFFIX = "-SNAPSHOT.jar"
if (file.name.endsWith(SHAPSHOT_JAR_SUFFIX)) {
return FileCopy(file, file.name.dropLast(SHAPSHOT_JAR_SUFFIX.length).substringBeforeLast("-") + ".jar")
}
return FileCopy(file)
}
when (sourcePath) {
is Jar -> {
val targetDir = ("lib/" + task.destinationDir.toRelativeString(gradleArtifactDir)).withoutSlash()
@@ -153,8 +169,11 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
.findByName(EmbeddedComponents.CONFIGURATION_NAME)?.resolvedConfiguration
if (embeddedComponents != null) {
for ((_, _, dependency) in listOf(embeddedComponents to Scope.COMPILE).collectDependencies()) {
if (dependency.configuration == "runtimeElements") {
val configuration = CollectedConfiguration(embeddedComponents, Scope.COMPILE)
for (dependencyInfo in listOf(configuration).collectDependencies()) {
val dependency = (dependencyInfo as? DependencyInfo.ResolvedDependencyInfo)?.dependency ?: continue
if (dependency.isModuleDependency) {
archiveForJar.add(ModuleOutput(dependency.moduleName + ".src"))
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
error("Test configurations are not allowed here")
@@ -169,7 +188,7 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
is Configuration -> {
require(sourcePath.name == "sideJars") { "Configurations other than 'sideJars' are not supported" }
for (file in sourcePath.resolve()) {
root.getDirectory("lib").add(FileCopy(file))
root.getDirectory("lib").add(fileCopySnapshotAware(file))
}
}
else -> error("${task.name} Unexpected task type ${task.javaClass.name}")

View File

@@ -1,16 +1,26 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Project
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.*
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.kotlin.dsl.configure
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.HasConvention
import org.gradle.api.internal.file.copy.CopySpecInternal
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.language.jvm.tasks.ProcessResources
import org.jetbrains.kotlin.pill.POrderRoot.*
import org.jetbrains.kotlin.pill.PSourceRoot.*
import org.jetbrains.kotlin.pill.PillExtension.*
import java.io.File
import java.util.LinkedList
@@ -41,13 +51,34 @@ data class PContentRoot(
data class PSourceRoot(
val path: File,
val kind: Kind
val kind: Kind,
val kotlinOptions: PSourceRootKotlinOptions?
) {
enum class Kind {
PRODUCTION, TEST, RESOURCES, TEST_RESOURCES;
enum class Kind { PRODUCTION, TEST, RESOURCES, TEST_RESOURCES }
}
val isResources get() = this == RESOURCES || this == TEST_RESOURCES
}
data class PSourceRootKotlinOptions(
val noStdlib: Boolean?,
val noReflect: Boolean?,
val moduleName: String?,
val apiVersion: String?,
val languageVersion: String?,
val jvmTarget: String?,
val addCompilerBuiltIns: Boolean?,
val loadBuiltInsFromDependencies: Boolean?,
val extraArguments: List<String>
) {
fun intersect(other: PSourceRootKotlinOptions) = PSourceRootKotlinOptions(
if (noStdlib == other.noStdlib) noStdlib else null,
if (noReflect == other.noReflect) noReflect else null,
if (moduleName == other.moduleName) moduleName else null,
if (apiVersion == other.apiVersion) apiVersion else null,
if (languageVersion == other.languageVersion) languageVersion else null,
if (jvmTarget == other.jvmTarget) jvmTarget else null,
if (addCompilerBuiltIns == other.addCompilerBuiltIns) addCompilerBuiltIns else null,
if (loadBuiltInsFromDependencies == other.loadBuiltInsFromDependencies) loadBuiltInsFromDependencies else null,
extraArguments.intersect(other.extraArguments).toList()
)
}
data class POrderRoot(
@@ -83,9 +114,16 @@ fun parse(project: Project, libraries: List<PLibrary>, context: ParserContext):
error("$project is not a root project")
}
val modules = project.allprojects
.filter { it.plugins.hasPlugin(JpsCompatiblePlugin::class.java) }
.flatMap { parseModules(it) }
fun Project.matchesSelectedVariant(): Boolean {
val extension = this.extensions.findByType(PillExtension::class.java) ?: return true
val projectVariant = extension.variant.takeUnless { it == Variant.DEFAULT } ?: Variant.BASE
return projectVariant in context.variant.includes
}
val (includedProjects, excludedProjects) = project.allprojects
.partition { it.plugins.hasPlugin(JpsCompatiblePlugin::class.java) && it.matchesSelectedVariant() }
val modules = includedProjects.flatMap { parseModules(it, excludedProjects) }
return PProject("Kotlin", project.projectDir, modules, libraries)
}
@@ -108,12 +146,7 @@ private val TEST_CONFIGURATION_MAPPING = mapOf(
listOf("jpsTest") to Scope.TEST
)
private val SOURCE_SET_MAPPING = mapOf(
"main" to Kind.PRODUCTION,
"test" to Kind.TEST
)
private fun ParserContext.parseModules(project: Project): List<PModule> {
private fun ParserContext.parseModules(project: Project, excludedProjects: List<Project>): List<PModule> {
val (productionContentRoots, testContentRoots) = parseContentRoots(project).partition { !it.forTests }
val modules = mutableListOf<PModule>()
@@ -121,7 +154,10 @@ private fun ParserContext.parseModules(project: Project): List<PModule> {
fun getJavaExcludedDirs() = project.plugins.findPlugin(IdeaPlugin::class.java)
?.model?.module?.excludeDirs?.toList() ?: emptyList()
val allExcludedDirs = getJavaExcludedDirs() + project.buildDir
fun getPillExcludedDirs() = project.extensions.getByType(PillExtension::class.java).excludedDirs
val allExcludedDirs = getPillExcludedDirs() + getJavaExcludedDirs() + project.buildDir +
(if (project == project.rootProject) excludedProjects.map { it.buildDir } else emptyList())
var productionSourcesModule: PModule? = null
@@ -162,8 +198,8 @@ private fun ParserContext.parseModules(project: Project): List<PModule> {
}
}
val mainModuleFileRelativePath = when {
project == project.rootProject -> File(project.rootProject.projectDir, project.name + ".iml")
val mainModuleFileRelativePath = when (project) {
project.rootProject -> File(project.rootProject.projectDir, project.name + ".iml")
else -> getModuleFile()
}
@@ -199,48 +235,60 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
return emptyList()
}
val kotlinTasksBySourceSet = project.tasks.names
.filter { it.startsWith("compile") && it.endsWith("Kotlin") }
.map { project.tasks.getByName(it) }
.associateBy { it.invokeInternal("getSourceSetName") }
val sourceRoots = mutableListOf<PSourceRoot>()
project.configure<JavaPluginConvention> {
for ((sourceSetName, kind) in SOURCE_SET_MAPPING) {
val sourceSet = sourceSets.findByName(sourceSetName) ?: continue
for (sourceSet in project.sourceSets) {
val kotlinCompileTask = kotlinTasksBySourceSet[sourceSet.name]
val kind = if (sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME) Kind.TEST else Kind.PRODUCTION
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
val oldIsAccessible = kotlinMethod.isAccessible
try {
kotlinMethod.isAccessible = true
return kotlinMethod(this) as SourceDirectorySet
} finally {
kotlinMethod.isAccessible = oldIsAccessible
}
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
val oldIsAccessible = kotlinMethod.isAccessible
try {
kotlinMethod.isAccessible = true
return kotlinMethod(this) as SourceDirectorySet
} finally {
kotlinMethod.isAccessible = oldIsAccessible
}
}
val kotlinSourceDirectories = (sourceSet as HasConvention).convention
.plugins["kotlin"]?.getKotlin()?.srcDirs
?: emptySet()
val directories = (sourceSet.java.sourceDirectories.files + kotlinSourceDirectories).toList()
.filter { it.exists() }
.takeIf { it.isNotEmpty() }
?: continue
val kotlinOptions = kotlinCompileTask?.let { getKotlinOptions(it) }
for (resourceRoot in sourceSet.resources.sourceDirectories.files) {
if (!resourceRoot.exists() || resourceRoot in directories) {
continue
}
val kotlinSourceDirectories = (sourceSet as HasConvention).convention
.plugins["kotlin"]?.getKotlin()?.srcDirs
?: emptySet()
val directories = (sourceSet.java.sourceDirectories.files + kotlinSourceDirectories).toList()
.filter { it.exists() }
.takeIf { it.isNotEmpty() }
?: continue
for (resourceRoot in sourceSet.resources.sourceDirectories.files) {
if (!resourceRoot.exists() || resourceRoot in directories) {
continue
}
val resourceRootKind = when (kind) {
Kind.PRODUCTION -> Kind.RESOURCES
Kind.TEST -> Kind.TEST_RESOURCES
else -> error("Invalid source root kind $kind")
}
sourceRoots += PSourceRoot(resourceRoot, resourceRootKind)
val resourceRootKind = when (kind) {
Kind.PRODUCTION -> Kind.RESOURCES
Kind.TEST -> Kind.TEST_RESOURCES
else -> error("Invalid source root kind $kind")
}
for (directory in directories) {
sourceRoots += PSourceRoot(directory, kind)
sourceRoots += PSourceRoot(resourceRoot, resourceRootKind, kotlinOptions)
}
for (directory in directories) {
sourceRoots += PSourceRoot(directory, kind, kotlinOptions)
}
for (root in parseResourceRootsProcessedByProcessResourcesTask(project, sourceSet)) {
if (sourceRoots.none { it.path == root.path }) {
sourceRoots += root
}
}
}
@@ -248,6 +296,70 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
return sourceRoots
}
private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project, sourceSet: SourceSet): List<PSourceRoot> {
val isMainSourceSet = sourceSet.name == SourceSet.MAIN_SOURCE_SET_NAME
val isTestSourceSet = sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME
val resourceRootKind = if (isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val taskNameBase = "processResources"
val taskName = if (isMainSourceSet) taskNameBase else sourceSet.name + taskNameBase.capitalize()
val task = project.tasks.findByName(taskName) as? ProcessResources ?: return emptyList()
val roots = mutableListOf<File>()
fun collectRoots(spec: CopySpecInternal) {
if (spec is SingleParentCopySpec && spec.children.none()) {
roots += spec.sourcePaths.map { File(project.projectDir, it.toString()) }.filter { it.exists() }
return
}
spec.children.forEach(::collectRoots)
}
collectRoots(task.rootSpec)
return roots.map { PSourceRoot(it, resourceRootKind, null) }
}
private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions? {
val compileArguments = kotlinCompileTask.invokeInternal("getSerializedCompilerArguments") as List<String>
fun parseBoolean(name: String) = compileArguments.contains("-$name")
fun parseString(name: String) = compileArguments.dropWhile { it != "-$name" }.drop(1).firstOrNull()
val addCompilerBuiltins = "Xadd-compiler-builtins"
val loadBuiltinsFromDependencies = "Xload-builtins-from-dependencies"
fun isOptionForScriptingCompilerPlugin(option: String)
= option.startsWith("-Xplugin=") && option.contains("kotlin-scripting-compiler")
val extraArguments = compileArguments.filter {
it.startsWith("-X") && !isOptionForScriptingCompilerPlugin(it)
&& it != "-$addCompilerBuiltins" && it != "-$loadBuiltinsFromDependencies"
}
return PSourceRootKotlinOptions(
parseBoolean("no-stdlib"),
parseBoolean("no-reflect"),
parseString("module-name"),
parseString("api-version"),
parseString("language-version"),
parseString("jvm-target"),
parseBoolean(addCompilerBuiltins),
parseBoolean(loadBuiltinsFromDependencies),
extraArguments
)
}
private fun Any.invokeInternal(name: String, instance: Any = this): Any? {
val method = javaClass.methods.single { it.name.startsWith(name) && it.parameterTypes.isEmpty() }
val oldIsAccessible = method.isAccessible
try {
method.isAccessible = true
return method.invoke(instance)
} finally {
method.isAccessible = oldIsAccessible
}
}
private fun ParserContext.parseDependencies(project: Project, forTests: Boolean): List<POrderRoot> {
val configurationMapping = if (forTests) TEST_CONFIGURATION_MAPPING else CONFIGURATION_MAPPING
@@ -255,33 +367,42 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
fun collectConfigurations(): List<Pair<ResolvedConfiguration, Scope>> {
val configurations = mutableListOf<Pair<ResolvedConfiguration, Scope>>()
fun collectConfigurations(): List<CollectedConfiguration> {
val configurations = mutableListOf<CollectedConfiguration>()
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = findByName(configurationName)?.also { it.resolve() } ?: continue
configurations += Pair(configuration.resolvedConfiguration, scope)
val extraDependencies = resolveExtraDependencies(configuration)
configurations += CollectedConfiguration(configuration.resolvedConfiguration, scope, extraDependencies)
}
}
return configurations
}
nextDependency@ for ((configuration, scope, dependency) in collectConfigurations().collectDependencies()) {
nextDependency@ for (dependencyInfo in collectConfigurations().collectDependencies()) {
val scope = dependencyInfo.scope
if (dependencyInfo is DependencyInfo.CustomDependencyInfo) {
val files = dependencyInfo.files
val library = PLibrary(files.firstOrNull()?.nameWithoutExtension ?: "unnamed", classes = files)
mainRoots += POrderRoot(PDependency.ModuleLibrary(library), scope)
continue
}
val dependency = (dependencyInfo as DependencyInfo.ResolvedDependencyInfo).dependency
for (mapper in dependencyMappers) {
if (dependency.moduleGroup == mapper.group
&& dependency.moduleName == mapper.module
&& dependency.configuration in mapper.configurations
) {
if (dependency.configuration in mapper.configurations && mapper.predicate(dependency)) {
val mappedDependency = mapper.mapping(dependency)
if (mappedDependency != null) {
val orderRoot = POrderRoot(mappedDependency.main, scope)
if (mappedDependency.main is PDependency.Module) {
mainRoots += orderRoot
} else {
mainRoots += orderRoot
val mainDependency = mappedDependency.main
if (mainDependency != null) {
mainRoots += POrderRoot(mainDependency, scope)
}
for (deferredDep in mappedDependency.deferred) {
@@ -293,10 +414,10 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
}
}
if (dependency.configuration == "runtimeElements" && scope != Scope.TEST) {
mainRoots += POrderRoot(PDependency.Module(dependency.moduleName + ".src"), scope)
mainRoots += if (dependency.isModuleDependency && scope != Scope.TEST) {
POrderRoot(PDependency.Module(dependency.moduleName + ".src"), scope)
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
mainRoots += POrderRoot(
POrderRoot(
PDependency.Module(dependency.moduleName + ".test"),
scope,
isProductionOnTestDependency = true
@@ -304,7 +425,7 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
} else {
val classes = dependency.moduleArtifacts.map { it.file }
val library = PLibrary(dependency.moduleName, classes)
mainRoots += POrderRoot(PDependency.ModuleLibrary(library), scope)
POrderRoot(PDependency.ModuleLibrary(library), scope)
}
}
@@ -312,9 +433,23 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
}
}
private fun resolveExtraDependencies(configuration: Configuration): List<File> {
return configuration.dependencies
.filterIsInstance<SelfResolvingDependency>()
.map { it.resolve() }
.filter { isGradleApiDependency(it) }
.flatMap { it }
}
private fun isGradleApiDependency(files: Iterable<File>): Boolean {
return listOf("gradle-api", "groovy-all").all { dep ->
files.any { it.extension == "jar" && it.name.startsWith("$dep-") }
}
}
private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
val dependenciesByScope = roots.groupBy { it.scope }.mapValues { it.value.mapTo(mutableSetOf()) { it.dependency } }
fun depenciesFor(scope: Scope) = dependenciesByScope[scope] ?: emptySet<PDependency>()
fun dependenciesFor(scope: Scope) = dependenciesByScope[scope] ?: emptySet<PDependency>()
val result = mutableSetOf<POrderRoot>()
for (root in roots.distinct()) {
@@ -325,16 +460,16 @@ private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
continue
}
if ((scope == Scope.PROVIDED || scope == Scope.RUNTIME) && dependency in depenciesFor(Scope.COMPILE)) {
if ((scope == Scope.PROVIDED || scope == Scope.RUNTIME) && dependency in dependenciesFor(Scope.COMPILE)) {
continue
}
if (scope == Scope.PROVIDED && dependency in depenciesFor(Scope.RUNTIME)) {
if (scope == Scope.PROVIDED && dependency in dependenciesFor(Scope.RUNTIME)) {
result += POrderRoot(dependency, Scope.COMPILE)
continue
}
if (scope == Scope.RUNTIME && dependency in depenciesFor(Scope.PROVIDED)) {
if (scope == Scope.RUNTIME && dependency in dependenciesFor(Scope.PROVIDED)) {
result += POrderRoot(dependency, Scope.COMPILE)
continue
}
@@ -345,17 +480,32 @@ private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
return result.toList()
}
data class DependencyInfo(val configuration: ResolvedConfiguration, val scope: Scope, val dependency: ResolvedDependency)
data class CollectedConfiguration(
val configuration: ResolvedConfiguration,
val scope: Scope,
val extraDependencies: List<File> = emptyList())
fun List<Pair<ResolvedConfiguration, Scope>>.collectDependencies(): List<DependencyInfo> {
sealed class DependencyInfo(val scope: Scope) {
class ResolvedDependencyInfo(scope: Scope, val dependency: ResolvedDependency) : DependencyInfo(scope)
class CustomDependencyInfo(scope: Scope, val files: List<File>) : DependencyInfo(scope)
}
val ResolvedDependency.isModuleDependency
get() = configuration in JpsCompatiblePlugin.MODULE_CONFIGURATIONS
fun List<CollectedConfiguration>.collectDependencies(): List<DependencyInfo> {
val dependencies = mutableListOf<DependencyInfo>()
val unprocessed = LinkedList<DependencyInfo>()
val existing = mutableSetOf<Pair<Scope, ResolvedDependency>>()
for ((configuration, scope) in this) {
for ((configuration, scope, extraDependencies) in this) {
for (dependency in configuration.firstLevelModuleDependencies) {
unprocessed += DependencyInfo(configuration, scope, dependency)
unprocessed += DependencyInfo.ResolvedDependencyInfo(scope, dependency)
}
if (!extraDependencies.isEmpty()) {
unprocessed += DependencyInfo.CustomDependencyInfo(scope, extraDependencies)
}
}
@@ -363,17 +513,26 @@ fun List<Pair<ResolvedConfiguration, Scope>>.collectDependencies(): List<Depende
val info = unprocessed.removeAt(0)
dependencies += info
info as? DependencyInfo.ResolvedDependencyInfo ?: continue
val data = Pair(info.scope, info.dependency)
existing += data
for (child in info.dependency.children) {
if (child.moduleGroup != "org.jetbrains.kotlin" && Pair(info.scope, child) in existing) {
if (Pair(info.scope, child) in existing) {
continue
}
unprocessed += DependencyInfo(info.configuration, info.scope, child)
unprocessed += DependencyInfo.ResolvedDependencyInfo(info.scope, child)
}
}
return dependencies
}
}
private val Project.sourceSets: SourceSetContainer
get() {
lateinit var result: SourceSetContainer
project.configure<JavaPluginConvention> { result = sourceSets }
return result
}

View File

@@ -4,6 +4,20 @@ package org.jetbrains.kotlin.pill
import org.gradle.api.Project
import java.io.File
private val USER_HOME_DIR_PATH = System.getProperty("user.home").withSlash()
private fun replacePrefix(path: String, prefix: String, variableName: String): String {
if (path.startsWith(prefix)) {
return "$" + variableName + "$/" + path.drop(prefix.length)
}
return path
}
private fun simplifyUserHomeDirPath(path: String): String {
return replacePrefix(path, USER_HOME_DIR_PATH, "USER_HOME")
}
interface PathContext {
operator fun invoke(file: File): String
@@ -17,25 +31,22 @@ interface PathContext {
}
}
class ProjectContext private constructor(val projectDir: File) : PathContext {
class ProjectContext private constructor(private val projectDir: File) : PathContext {
constructor(project: PProject) : this(project.rootDirectory)
constructor(project: Project) : this(project.projectDir)
override fun invoke(file: File): String {
return file.absolutePath.replace(projectDir.absolutePath, "\$PROJECT_DIR\$")
return simplifyUserHomeDirPath(replacePrefix(file.absolutePath, projectDir.absolutePath.withSlash(), "PROJECT_DIR"))
}
}
class ModuleContext(val project: PProject, val module: PModule) : PathContext {
override fun invoke(file: File): String {
if (!file.startsWith(project.rootDirectory)) {
return file.absolutePath
return simplifyUserHomeDirPath(file.absolutePath)
}
return "\$MODULE_DIR\$/" +
project.rootDirectory.toRelativeString(module.moduleFile.parentFile).withSlash() +
module.rootDirectory.toRelativeString(project.rootDirectory).withSlash() +
file.toRelativeString(module.rootDirectory)
return "\$MODULE_DIR\$/" + file.toRelativeString(module.moduleFile.parentFile)
}
}

View File

@@ -1,3 +1,4 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Plugin
@@ -10,15 +11,16 @@ import shadow.org.jdom2.output.Format
import shadow.org.jdom2.output.XMLOutputter
import java.io.File
class JpsCompatibleBasePlugin : Plugin<Project> {
class PillConfigurablePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
project.extensions.create("pill", PillExtension::class.java)
}
}
class JpsCompatiblePlugin : Plugin<Project> {
companion object {
private const val JPS_LIBRARY_PATH = "jpsLibraryPath"
val MODULE_CONFIGURATIONS = arrayOf("apiElements", "runtimeElements")
private fun mapper(module: String, vararg configurations: String): DependencyMapper {
return DependencyMapper("org.jetbrains.kotlin", module, *configurations) { MappedDependency(PDependency.Library(module)) }
@@ -27,41 +29,56 @@ class JpsCompatiblePlugin : Plugin<Project> {
private fun getDependencyMappers(projectLibraries: List<PLibrary>): List<DependencyMapper> {
val mappersForKotlinLibrariesExeptStdlib = projectLibraries
.filter { it.name != "kotlin-stdlib" }
.mapTo(mutableListOf()) { mapper(it.name, "default", "distJar", "runtimeElements") }
.mapTo(mutableListOf()) { mapper(it.name, "default", "distJar", *MODULE_CONFIGURATIONS) }
return mappersForKotlinLibrariesExeptStdlib + listOf(
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib", "distJar", "runtimeElements") {
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib", "distJar", *MODULE_CONFIGURATIONS) {
MappedDependency(
PDependency.Library("kotlin-stdlib"),
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-reflect-api", "runtimeElements") {
DependencyMapper("org.jetbrains", "annotations", "default", version = "13.0") {
MappedDependency(
null,
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-reflect-api", *MODULE_CONFIGURATIONS) {
MappedDependency(PDependency.Library("kotlin-reflect"))
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler-embeddable", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "compiler", "runtimeElements") { null }
DependencyMapper("org.jetbrains.kotlin", "compiler", *MODULE_CONFIGURATIONS) { null },
DependencyMapper("kotlin.build.custom.deps", "android", "default") { dep ->
val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" }
val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars))
val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon))
MappedDependency(mainLibrary, listOf(deferredLibrary))
}
)
}
fun getProjectLibraries(rootProject: Project): List<PLibrary> {
val distLibDir = File(rootProject.extra["distLibDir"].toString())
fun distJar(name: String) = File(rootProject.projectDir, "dist/kotlinc/lib/$name.jar")
fun projectFile(path: String) = File(rootProject.projectDir, path)
val libraries = rootProject.allprojects
.filter { it.extra.has(JPS_LIBRARY_PATH) }
.map { library ->
val libraryPath = library.extra.get(JPS_LIBRARY_PATH).toString()
.mapNotNull { library ->
val libraryExtension = library.extensions.findByType(PillExtension::class.java)
?.takeIf { it.importAsLibrary }
?: return@mapNotNull null
val libraryPath = libraryExtension.libraryPath ?: distLibDir
val archivesBaseName = library.convention.findPlugin(BasePluginConvention::class.java)?.archivesBaseName ?: library.name
fun List<File>.filterExisting() = filter { it.exists() }
PLibrary(
library.name,
classes = listOf(File(libraryPath, archivesBaseName + ".jar")).filterExisting(),
sources = listOf(File(libraryPath, archivesBaseName + "-sources.jar")).filterExisting()
classes = listOf(File(libraryPath, "$archivesBaseName.jar")).filterExisting(),
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting()
)
}
@@ -70,15 +87,18 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
override fun apply(project: Project) {
project.plugins.apply(JpsCompatibleBasePlugin::class.java)
project.plugins.apply(PillConfigurablePlugin::class.java)
// 'jpsTest' does not require the 'tests-jar' artifact
project.configurations.create("jpsTest")
if (project == project.rootProject) {
project.tasks.create("pill") {
doLast { pill(project) }
TaskUtils.useAndroidSdk(this)
TaskUtils.useAndroidJar(this)
if (System.getProperty("pill.android.tests", "false") == "true") {
TaskUtils.useAndroidSdk(this)
TaskUtils.useAndroidJar(this)
}
}
project.tasks.create("unpill") {
@@ -91,20 +111,37 @@ class JpsCompatiblePlugin : Plugin<Project> {
private lateinit var platformVersion: String
private lateinit var platformBaseNumber: String
private lateinit var platformDir: File
private var isAndroidStudioPlatform: Boolean = false
private fun initEnvironment(project: Project) {
projectDir = project.projectDir
platformVersion = project.extensions.extraProperties.get("versions.intellijSdk").toString()
platformBaseNumber = platformVersion.substringBefore(".", "").takeIf { it.isNotEmpty() }
?: error("Invalid platform version: $platformVersion")
?: platformVersion.substringBefore("-", "").takeIf { it.isNotEmpty() }
?: error("Invalid platform version: $platformVersion")
platformDir = IntellijRootUtils.getIntellijRootDir(project)
isAndroidStudioPlatform = project.extensions.extraProperties.has("versions.androidStudioRelease")
}
private fun pill(rootProject: Project) {
initEnvironment(rootProject)
val variantOptionValue = System.getProperty("pill.variant", "base").toUpperCase()
val variant = PillExtension.Variant.values().firstOrNull { it.name == variantOptionValue }
?: run {
rootProject.logger.error("Invalid variant name: $variantOptionValue")
return
}
rootProject.logger.lifecycle("Pill: Setting up project for the '${variant.name.toLowerCase()}' variant...")
if (variant == PillExtension.Variant.NONE || variant == PillExtension.Variant.DEFAULT) {
rootProject.logger.error("'none' and 'default' should not be passed as a Pill variant property value")
return
}
val projectLibraries = getProjectLibraries(rootProject)
val parserContext = ParserContext(getDependencyMappers(projectLibraries))
val parserContext = ParserContext(getDependencyMappers(projectLibraries), variant)
val jpsProject = parse(rootProject, projectLibraries, parserContext)
.mapLibraries(this::attachPlatformSources, this::attachAsmSources)
@@ -145,12 +182,19 @@ class JpsCompatiblePlugin : Plugin<Project> {
val runConfigurationsDir = File(projectDir, "buildSrc/src/main/resources/runConfigurations")
val targetDir = File(projectDir, ".idea/runConfigurations")
val platformDirProjectRelative = "\$PROJECT_DIR\$/" + platformDir.toRelativeString(projectDir)
val additionalIdeaArgs = if (isAndroidStudioPlatform) "-Didea.platform.prefix=AndroidStudio" else ""
targetDir.mkdirs()
fun substitute(text: String): String {
return text
.replace("\$IDEA_HOME_PATH\$", platformDirProjectRelative)
.replace("\$ADDITIONAL_IDEA_ARGS\$", additionalIdeaArgs)
}
runConfigurationsDir.listFiles()
.filter { it.extension == "xml" }
.map { it.name to it.readText().replace("\$IDEA_HOME_PATH\$", platformDirProjectRelative) }
.map { it.name to substitute(it.readText()) }
.forEach { File(targetDir, it.first).writeText(it.second) }
}
@@ -202,8 +246,9 @@ class JpsCompatiblePlugin : Plugin<Project> {
.map { it.trim() }
.filter { it.isNotEmpty() }
fun addOrReplaceOptionValue(name: String, value: Any) {
options = options.filter { !it.startsWith("-D$name=") } + listOf("-D$name=$value")
fun addOrReplaceOptionValue(name: String, value: Any?) {
val optionsWithoutNewValue = options.filter { !it.startsWith("-D$name=") }
options = if (value == null) optionsWithoutNewValue else (optionsWithoutNewValue + listOf("-D$name=$value"))
}
val robolectricClasspath = project.rootProject
@@ -211,16 +256,25 @@ class JpsCompatiblePlugin : Plugin<Project> {
.configurations.getByName("robolectricClasspath")
.files.joinToString(File.pathSeparator)
val androidJarPath = project.configurations.getByName("androidJar").singleFile
val androidSdkPath = project.configurations.getByName("androidSdk").singleFile
if (options.none { it == "-ea" }) {
options += "-ea"
}
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.pill", "true")
addOrReplaceOptionValue("android.sdk", "\$PROJECT_DIR\$/" + androidSdkPath.toRelativeString(projectDir))
addOrReplaceOptionValue("android.jar", "\$PROJECT_DIR\$/" + androidJarPath.toRelativeString(projectDir))
val isAndroidStudioBunch = project.findProperty("versions.androidStudioRelease") != null
addOrReplaceOptionValue("idea.platform.prefix", if (isAndroidStudioBunch) "AndroidStudio" else null)
val androidJarPath = project.configurations.findByName("androidJar")?.singleFile
val androidSdkPath = project.configurations.findByName("androidSdk")?.singleFile
if (androidJarPath != null && androidSdkPath != null) {
addOrReplaceOptionValue("android.sdk", "\$PROJECT_DIR\$/" + androidSdkPath.toRelativeString(projectDir))
addOrReplaceOptionValue("android.jar", "\$PROJECT_DIR\$/" + androidJarPath.toRelativeString(projectDir))
}
vmParams.setAttribute("value", options.joinToString(" "))
}

View File

@@ -54,10 +54,58 @@ private fun renderModule(project: PProject, module: PModule) = PFile(
xml("component", "name" to "TestModuleProperties", "production-module" to moduleForProductionSources.name)
}
xml("component", "name" to "NewModuleRootManager", "inherit-compiler-output" to "true") {
xml("exclude-output")
val kotlinCompileOptionsList = module.contentRoots.flatMap { it.sourceRoots }.mapNotNull { it.kotlinOptions }
var kotlinCompileOptions = kotlinCompileOptionsList.firstOrNull()
for (otherOptions in kotlinCompileOptionsList.drop(1)) {
kotlinCompileOptions = kotlinCompileOptions?.intersect(otherOptions)
}
val pathContext = ModuleContext(project, module)
val pathContext = ModuleContext(project, module)
val platformVersion = (kotlinCompileOptions?.jvmTarget ?: "1.8")
val classesDirectory = File(project.rootDirectory, "out/production/${module.name}")
if (kotlinCompileOptions != null) {
xml("component", "name" to "FacetManager") {
xml("facet", "type" to "kotlin-language", "name" to "Kotlin") {
xml("configuration", "version" to 3, "platform" to "JVM $platformVersion", "useProjectSettings" to "false") {
xml("compilerSettings") {
xml(
"option",
"name" to "additionalArguments",
"value" to kotlinCompileOptions.extraArguments.joinToString(" ")
)
}
xml("compilerArguments") {
xml("option", "name" to "destination", "value" to pathContext(classesDirectory))
fun Any?.option(name: String) {
if (this != null) xml("option", "name" to name, "value" to this.toString())
}
kotlinCompileOptions.noStdlib.option("noStdlib")
kotlinCompileOptions.noReflect.option("noReflect")
kotlinCompileOptions.moduleName.option("moduleName")
xml("option", "name" to "jvmTarget", "value" to platformVersion)
kotlinCompileOptions.addCompilerBuiltIns.option("addCompilerBuiltIns")
kotlinCompileOptions.loadBuiltInsFromDependencies.option("loadBuiltInsFromDependencies")
kotlinCompileOptions.languageVersion.option("languageVersion")
kotlinCompileOptions.apiVersion.option("apiVersion")
xml("option", "name" to "pluginOptions") { xml("array") }
xml("option", "name" to "pluginClasspaths") { xml("array") }
}
}
}
}
}
xml("component",
"name" to "NewModuleRootManager",
"LANGUAGE_LEVEL" to "JDK_${platformVersion.replace('.', '_')}",
"inherit-compiler-output" to "true"
) {
xml("exclude-output")
for (contentRoot in module.contentRoots) {
xml("content", pathContext.url(contentRoot.path)) {
@@ -82,35 +130,39 @@ private fun renderModule(project: PProject, module: PModule) = PFile(
xml("orderEntry", "type" to "inheritedJdk")
xml("orderEntry", "type" to "sourceFolder", "forTests" to "false")
for (orderRoot in module.orderRoots) {
val dependency = orderRoot.dependency
var args = when (dependency) {
is PDependency.ModuleLibrary -> arrayOf(
val args = when (dependency) {
is PDependency.ModuleLibrary -> mutableListOf(
"type" to "module-library"
)
is PDependency.Module -> arrayOf(
is PDependency.Module -> mutableListOf(
"type" to "module",
"module-name" to dependency.name
)
is PDependency.Library -> arrayOf(
is PDependency.Library -> mutableListOf(
"type" to "library",
"name" to dependency.name,
"level" to "project"
)
else -> error("Unsupported dependency type: $dependency")
}
if (orderRoot.scope != POrderRoot.Scope.COMPILE) {
args.add(1, "scope" to orderRoot.scope.toString())
}
if (dependency is PDependency.Module && orderRoot.isProductionOnTestDependency) {
args += ("production-on-test" to "")
}
args += ("scope" to orderRoot.scope.toString())
if (orderRoot.isExported) {
args += ("exported" to "")
}
xml("orderEntry", *args) {
xml("orderEntry", *args.toTypedArray()) {
if (dependency is PDependency.ModuleLibrary) {
add(renderLibraryToXml(dependency.library, pathContext, named = false))
}

View File

@@ -6,7 +6,7 @@ import shadow.org.jdom2.Element
import shadow.org.jdom2.output.Format
import shadow.org.jdom2.output.XMLOutputter
class xml(val name: String, vararg val args: Pair<String, Any>, block: xml.() -> Unit = {}) {
class xml(val name: String, private vararg val args: Pair<String, Any>, block: xml.() -> Unit = {}) {
private companion object {
fun makeXml(name: String, vararg args: Pair<String, Any>, block: xml.() -> Unit = {}): xml {
return xml(name, *args, block = block)

View File

@@ -1,17 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
import com.jakewharton.dex.*
@@ -30,6 +19,10 @@ open class DexMethodCount : DefaultTask() {
val byClass: Map<String, Int>
)
init {
outputs.upToDateWhen { !shouldPrintTeamCityStatistics } // always execute when teamCityStatistics output is required
}
@InputFile
lateinit var jarFile: File
@@ -42,6 +35,9 @@ open class DexMethodCount : DefaultTask() {
@Optional
var teamCityStatistics: Boolean? = null
private val shouldPrintTeamCityStatistics = teamCityStatistics ?: project.hasProperty("teamcity")
@Input
@Optional
var artifactName: String? = null
@@ -54,8 +50,12 @@ open class DexMethodCount : DefaultTask() {
dependsOn(jar)
}
@Internal // plain output properties are not supported, mark as internal to suppress warning from validateTaskProperties
lateinit var counts: Counts
@get:OutputFile
val detailOutputFile: File get() = project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
@TaskAction
fun invoke() {
val methods = dexMethods(jarFile)
@@ -96,7 +96,7 @@ open class DexMethodCount : DefaultTask() {
}
private fun printTCStats(counts: Counts) {
if (teamCityStatistics ?: project.hasProperty("teamcity")) {
if (shouldPrintTeamCityStatistics) {
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}' value='${counts.total}']")
counts.totalOwnPackages?.let { value ->
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}_OwnPackages' value='$value']")
@@ -108,8 +108,7 @@ open class DexMethodCount : DefaultTask() {
}
private fun outputDetails(counts: Counts) {
val detailFile = project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
detailFile.printWriter().use { writer ->
detailOutputFile.printWriter().use { writer ->
writer.println("${counts.total.padRight()}\tTotal methods")
ownPackages?.let { packages ->
writer.println("${counts.totalOwnPackages?.padRight()}\tTotal methods from packages ${packages.joinToString { "$it.*" }}")

View File

@@ -85,6 +85,16 @@ open class PublishedKotlinModule : Plugin<Project> {
dependencies.removeIf {
InvokerHelper.getMetaClass(it).getProperty(it, "scope") == "test"
}
dependencies
.find {
InvokerHelper.getMetaClass(it).getProperty(it, "groupId") == "org.jetbrains.kotlin"
&& InvokerHelper.getMetaClass(it).getProperty(it, "artifactId") == "kotlin-stdlib"
}
?.also {
InvokerHelper.getMetaClass(it).setProperty(it, "exclusions", emptyList<Any>())
logger.warn("WARNING! Removed exclusions from kotlin-stdlib dependency of ${this.artifactId} artifact's maven metadata, check kotlin-stdlib dependency of ${project.path} project")
}
}
}
@@ -98,7 +108,7 @@ open class PublishedKotlinModule : Plugin<Project> {
val password: String? by preparePublication.extra
val repoUrl: String by preparePublication.extra
var repository: MavenRemoteRepository by Delegates.notNull()
var repository by Delegates.notNull<MavenRemoteRepository>()
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {

View File

@@ -4,6 +4,8 @@ import org.gradle.api.*
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.language.jvm.tasks.ProcessResources
//import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) =
@@ -11,14 +13,11 @@ inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) =
class SourceSetsBuilder(val project: Project) {
inline operator fun String.invoke(crossinline body: SourceSet.() -> Unit) {
inline operator fun String.invoke(crossinline body: SourceSet.() -> Unit): SourceSet {
val sourceSetName = this
project.configure<JavaPluginConvention>
{
sourceSets.matching { it.name == sourceSetName }.forEach {
none()
it.body()
}
return project.sourceSets.maybeCreate(sourceSetName).apply {
none()
body()
}
}
}
@@ -28,18 +27,18 @@ fun SourceSet.none() {
resources.setSrcDirs(emptyList<String>())
}
fun SourceSet.projectDefault() {
when (name) {
"main" -> {
java.srcDirs("src")
resources.srcDir("resources").apply { include("**") }
resources.srcDir("src").apply { include("META-INF/**", "**/*.properties") }
}
"test" -> {
java.srcDirs("test", "tests")
val SourceSet.projectDefault: Project.() -> Unit
get() = {
when (this@projectDefault.name) {
"main" -> {
java.srcDirs("src")
this@projectDefault.resources.srcDir("resources")
}
"test" -> {
java.srcDirs("test", "tests")
}
}
}
}
// TODO: adding KotlinSourceSet dep to the plugin breaks the build unexpectedly, resolve and uncomment
//val SourceSet.kotlin: SourceDirectorySet
@@ -55,8 +54,14 @@ fun SourceSet.projectDefault() {
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
evaluationDependsOn(projectPath)
return project(projectPath).the<JavaPluginConvention>().sourceSets
return project(projectPath).sourceSets
}
val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets
val Project.mainSourceSet: SourceSet
get() = sourceSets.getByName("main")
val Project.testSourceSet: SourceSet
get() = sourceSets.getByName("test")

View File

@@ -6,6 +6,7 @@ import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
import java.util.jar.JarFile
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
/**
@@ -47,8 +48,8 @@ fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFil
error("Size increased for ${entry.name}: was ${inBytes.size} bytes, became ${outBytes.size} bytes")
}
entry.compressedSize = -1L
outJar.putNextEntry(entry)
val newEntry = ZipEntry(entry.name)
outJar.putNextEntry(newEntry)
outJar.write(outBytes)
outJar.closeEntry()
}

View File

@@ -14,44 +14,58 @@
* limitations under the License.
*/
@file:Suppress("unused") // usages in build scripts are not tracked properly
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.task
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.*
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
doFirst {
val patterns = filter.includePatterns + ((filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet())
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
val patterns = filter.includePatterns + commandLineIncludePatterns
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
patterns.forEach { pattern ->
var isClassPattern = false
val maybeMethodName = pattern.substringAfterLast('.')
val maybeClassFqName = if (maybeMethodName.isFirstChar(::isLowerCase))
val maybeClassFqName = if (maybeMethodName.isFirstChar(::isLowerCase)) {
pattern.substringBeforeLast('.')
else
} else {
isClassPattern = true
pattern
}
if (!maybeClassFqName.substringAfterLast('.').isFirstChar(::isUpperCase)) {
return@forEach
}
val classFileNameWithoutExtension = maybeClassFqName.replace('.', '/')
val classFileName = classFileNameWithoutExtension + ".class"
val classFileName = "$classFileNameWithoutExtension.class"
if (isClassPattern) {
val innerClassPattern = "$pattern$*"
if (pattern in commandLineIncludePatterns) {
commandLineIncludePatterns.add(innerClassPattern)
(filter as? DefaultTestFilter)?.setCommandLineIncludePatterns(commandLineIncludePatterns)
} else {
filter.includePatterns.add(innerClassPattern)
}
}
include {
val path = it.path
if (it.isDirectory) {
classFileNameWithoutExtension.startsWith(path)
} else {
path == classFileName || (path.endsWith(".class") && path.startsWith(classFileNameWithoutExtension + "$"))
path == classFileName || (path.endsWith(".class") && path.startsWith("$classFileNameWithoutExtension$"))
}
}
}
@@ -67,14 +81,22 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
dependsOn(":test-instrumenter:jar")
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1100m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
maxHeapSize = "1100m"
jvmArgs(
"-ea",
"-XX:+HeapDumpOnOutOfMemoryError",
"-Xmx1600m",
"-XX:+UseCodeCacheFlushing",
"-XX:ReservedCodeCacheSize=128m",
"-Djna.nosys=true"
)
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.asPath)
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", buildDir)
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"])
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
body()
}
@@ -82,7 +104,7 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, body: T.() -> Unit): T =
(tasks.findByName(taskName)?.let { it as T } ?: task<T>(taskName)).apply { body() }
(tasks.findByName(taskName)?.let { it as T } ?: task<T>(taskName)).apply { body() }
object TaskUtils {
fun useAndroidSdk(task: Task) {
@@ -120,4 +142,4 @@ fun Task.useAndroidSdk() {
fun Task.useAndroidJar() {
TaskUtils.useAndroidJar(this)
}
}

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=128m -Djna.nosys=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -9,16 +9,16 @@
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<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 -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">

View File

@@ -3,7 +3,7 @@
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$IDEA_HOME_PATH$/system -Didea.config.path=$IDEA_HOME_PATH$/config -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" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />

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