Compare commits

..

4831 Commits

Author SHA1 Message Date
Ilya Ryzhenkov
5f88107565 Initial import of benchmarks from https://github.com/dzharkov/kotlin-compiler-benchmarks 2019-08-20 21:19:45 +03:00
pyos
7ff700ff97 JVM_IR: lower calls to @JvmStatic functions from other files.
Note: this currently results in invalid IR (but valid bytecode) if the
@JvmStatic function is imported, because its IR representation is
unlowered and therefore has a dispatch receiver, but the call will not.
2019-08-20 11:39:25 +03:00
Ilya Kirillov
24adc09e2d J2K: Change old/new J2K switch checkbox text from "Use New J2K" to "Use New Java to Kotlin Converter"
Relates to #KT-33371
2019-08-20 11:13:13 +03:00
Alexander Udalov
ad43bc23ea Minor, add test case on SAM conversion over smart cast 2019-08-19 18:09:32 +02:00
Vladimir Dolzhenko
dd0e296af1 Use KotlinExceptionWithAttachments for ToFromOriginalFileMapper and MainFunctionDetector 2019-08-19 17:55:49 +02:00
victor.petukhov
fa29297fb1 Introduce workaround for back-end exception in the test cases parser code 2019-08-19 18:31:48 +03:00
victor.petukhov
9487d291da Fail spec box tests if they have unexpected behaviour and passed 2019-08-19 18:31:48 +03:00
victor.petukhov
d8e5b068d5 Relinking spec tests 2019-08-19 18:31:46 +03:00
victor.petukhov
8465d690f1 Add spec tests for 'Type system' (introduction and 'kotlin.Any' type) 2019-08-19 18:31:45 +03:00
victor.petukhov
f78faeaa3c Add test for consistency check between the Kotlin specification and spec tests 2019-08-19 18:31:44 +03:00
victor.petukhov
4f73e100d0 Add task to generate tests json map (is used for tool 'spec-tests-relinking recommender') 2019-08-19 18:31:43 +03:00
victor.petukhov
0e439263ce Group spec tests and accompanying functionality into to packages: org.jetbrains.kotlin.spec (tests only) and org.jetbrains.kotlin.spec.utils (accompanying functionality) 2019-08-19 18:31:42 +03:00
victor.petukhov
cf692fb257 Implement tests map generator and refactor folder structure to spec tests linking 2019-08-19 18:31:40 +03:00
victor.petukhov
28da325a11 Actualize DFA spec tests 2019-08-19 18:31:39 +03:00
SatoShun
c43df55965 Type parameters are placed before the name of the function 2019-08-19 16:16:51 +03:00
Igor Yakovlev
9c861a111f Fix move refactoring conflict window output
1) Refactoring
2) #KT-32496 Fixed
2019-08-19 13:28:23 +03:00
Igor Yakovlev
ae3f36ebde Change ExtractDeclarationFromCurrentFileIntention applicability range
Fixed #KT-33362
2019-08-19 13:28:23 +03:00
Yanis Batura
e9e3df23fc Fix typos and improve grammar in stdlib readmes (#2527)
* Fix typos in the main ReadMe.md

* Fix typos in the stdlib samples ReadMe.md

Co-Authored-By: ilya-g <ilya.gorbunov@jetbrains.com>
2019-08-16 19:56:56 +03:00
Igor Chevdar
ad8bcda99e [IR] Merged K/N inliner with the common one 2019-08-16 18:32:19 +03:00
Vyacheslav Gerasimov
32153c26a8 Build: Rewrite upload_plugins.gradle in Kotlin 2019-08-16 15:42:18 +03:00
Vyacheslav Gerasimov
af2cd36c3d Build: Rename upload_plugins.gradle -> kts 2019-08-16 15:42:18 +03:00
Ilya Gorbunov
fba22606e6 Introduce erroneous operators ClockMark.minus/compareTo(ClockMark)
To provide a better diagnostic message on their misuse.
2019-08-16 15:29:17 +03:00
Ilya Gorbunov
ac07cb686b Change status of ExperimentalTime API to a more risky one 2019-08-16 15:29:17 +03:00
Ilya Gorbunov
a985402507 Introduce ClockMark.hasPassedNow, hasNotPassedNow functions
Makes it more clear to use them than comparing elapsed with Duration.ZERO.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov
44195d436e Rename: Clock.markNow, ClockMark.elapsedNow
Add "Now" suffix to the names of functions that depend on the current
time moment.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov
a493d46a6e Make effectively private properties actually private to avoid accessors 2019-08-16 15:29:16 +03:00
Ilya Gorbunov
f889d25287 Introduce TestClock.plusAssign(Duration) and hide implementation details
TestClock.plusAssign(Duration) is for advancing TestClock time.
Hide reading value, do not allow to provide initial reading,
fix clock unit to nanoseconds at construction time.
2019-08-16 15:28:45 +03:00
Ilya Gorbunov
4de9361c37 Introduce Duration.isPositive method 2019-08-16 15:25:57 +03:00
Ilya Kirillov
4befca95d6 Add an ability to switch between old and new J2K via settings window
Before that it was possible to do only via registry

#KT-33371 fixed
2019-08-16 09:37:05 +03:00
Shagen Ogandzhanian
3b8da0afe4 Update dukat dependency to 0.0.16 2019-08-16 06:29:11 +03:00
Igor Yakovlev
1aa8e28dd8 Add JvmOverloads to KtLightClassImpl
Added @JvmOverloads annotation to primary constructor for binary compatibility issues
2019-08-15 15:49:14 +03:00
Alexey Tsvetkov
8e6a80bed7 Add test logs specific for IC with JS IR
Incremental inline will be handled during lowerings,
after all klibs are generated
2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
12c209d360 Do not compare output for IC with JS IR BE
Temporary measure until output could be updated incrementally
2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
3366ac4b18 Save incremental data with KLIB compiler 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
fc49510049 Add tests for IC with JS IR BE 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
9572800ef7 Add missing dependency 2019-08-15 15:11:52 +03:00
Stanislav Erokhin
b5a407371c Update the year in LICENSE.txt 2019-08-15 13:31:09 +03:00
Mikhail Zarechenskiy
d59b910403 Add tests for obsolete issues
#KT-32207 Obsolete
 #KT-32836 Obsolete
 #KT-32949 Obsolete
 #KT-9384 Obsolete
2019-08-15 13:01:39 +03:00
Mikhail Zarechenskiy
1969ad6e9d [NI] Take into account use-site variance for constraint from LHS of CR
#KT-32851 Fixed
2019-08-15 13:01:38 +03:00
Mikhail Zarechenskiy
0620762b97 Enable new inference explicitly for MPP tests with type refinement 2019-08-15 12:50:19 +03:00
Mikhail Zarechenskiy
735e1ecec1 Disable new inference for IDE analysis by default in releases 2019-08-15 12:50:09 +03:00
Mikhail Zarechenskiy
69942681a3 Refactoring: move versioning.kt file to idea-analysis module 2019-08-15 12:49:54 +03:00
Mikhail Zarechenskiy
50e7ff4097 Refactoring: move isSnapshot function closer to similar ones 2019-08-15 12:49:53 +03:00
Dmitry Gridin
2c0d6ab1a5 [Compatibility] Restore GradleBuildScriptManipulator.addKotlinLibraryToModuleBuildScript(scope, libraryDescriptor)
#KT-33336 Fixed
2019-08-15 15:54:12 +07:00
Abduqodiri Qurbonzoda
63895483fd Fix take method from iterating one extra element (KT-32024) 2019-08-15 01:01:36 +03:00
Abduqodiri Qurbonzoda
01a613dca4 Add tests for floating-point to integral conversion 2019-08-15 00:57:27 +03:00
Abduqodiri Qurbonzoda
432828a2db Clarify floating-point to integral conversion rounding behaviour 2019-08-15 00:57:27 +03:00
Igor Yakovlev
fd5bf33861 Removed asserts for mirror files for java stubs on kt files
The behavior of this part of code is following:
1) We wrap the kotlin light class to the object that wraps the kt files into compiled (!) cls stub (notice, that most of the time it is a single file wrapper)
2) Platform wishes to get the mirror psi of this "compiled" stub work with text of it.
3) Platform request mirror element that asserted to be ok ONLY for multifiles stub.
4) It leads to EA-209577

There is no idea why so, but the exception is high-rated, so this assertion was deleted.

Fixed EA-209577
2019-08-14 20:12:55 +03:00
Vyacheslav Gerasimov
8cfdd140bb Upgrade plugin-repository-rest-client & use token auth
#KT-33338
2019-08-14 19:10:43 +03:00
Georgy Bronnikov
20351b7c1b IR: correct type for a null const argument 2019-08-14 18:26:09 +03:00
Roman Golyshev
e915bc2a69 fix expected output for when statement in scratch files
- the behaviour changed due to KT-33127 fixing
2019-08-14 15:35:38 +03:00
Roman Golyshev
1a0edd37ef KT-31295: fix issue with NewKotlinScriptAction incorrect identity
- this problem leads to the duplication of the `New Kotlin Script` action in the drop-down menu
- ^KT-31295 Fixed
2019-08-14 15:35:38 +03:00
Dmitry Petrov
986654b709 psi2ir: fix unsubstituted type parameters around SAM conversions
Preserve type substitution:
- when obtaining function type for SAM type;
- when generating SAM conversions for SAM adapter arguments;
- for "original" method corresponding to a SAM adapter.
2019-08-14 14:18:42 +03:00
Alexander Udalov
6b208f7c9c JVM IR: support LanguageFeature.UseGetterNameForPropertyAnnotationsMethodOnJvm 2019-08-14 12:34:57 +02:00
Ivan Gavrilovic
0a26742501 Run KAPT non-incrementally if annotation processor classpath changes
Annotation processor classpath for a KAPT run is recorded, and the current
run is compared against the previous one. If those differ, KAPT should
run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testChangingAnnotationProcessorClasspath
2019-08-14 18:05:04 +09:00
Ivan Gavrilovic
2412b5f992 Delete output when unable to run KAPT incrementally
When comparing previous and current classpath snapshots, and it is not
possible to compute the types that changed, make sure to delete the outputs
before invoking KAPT.

Test: KaptIncrementalWithAggregatingApt.testIncompatibleClasspathChanges
2019-08-14 18:05:04 +09:00
Dmitry Petrov
e4f9314f94 Use ISE instead of NPE in serialization 2019-08-14 11:16:11 +03:00
Dmitry Petrov
a9c961931c JS_IR: Support 'CHECK_NOT_NULL' intrinsic 2019-08-14 11:16:11 +03:00
Dmitry Petrov
7d49b72b79 JVM_IR: Support 'CHECK_NOT_NULL' intrinsic
TODO: migrate to changes related to KT-22275
2019-08-14 11:16:10 +03:00
Dmitry Petrov
7170439517 IR: '!!' is generated as 'CHECK_NOT_NULL' intrinsic
```
fun <T : Any> CHECK_NOT_NULL(x: T?): x =
  if (x != null) x else throw NullPointerException(...)
```

This allows to compile both Kotlin/JVM and Kotlin/JS effectively.
2019-08-14 11:16:10 +03:00
Georgy Bronnikov
b9db4148cc Check whether test is ignored before reporting failure 2019-08-13 19:37:11 +03:00
Vyacheslav Gerasimov
0089de7f7f Build: Workaround dependency cycle in kotlinCompilerPluginClasspath
When bootstrap version is less than from current version dependencies
of `kotlin-scripting-compiler-embeddable` are resolved into projects
which leads to circular dependencies

 #KT-33287
2019-08-13 18:03:04 +03:00
Mikhael Bogdanov
8ff081a596 Don't trigger 'testJvm6ServerRuntime' initialization during configuration phase 2019-08-13 16:35:58 +02:00
Ilya Chernikov
19ce279611 Fix script config saving to file attributes
also make reading from file attribute more robust
2019-08-13 15:40:09 +02:00
Ilya Matveev
949bb9d150 IR: Get rid of descriptors in tailrec calls collection
Issue #KT-33279 fixed
2019-08-13 19:56:46 +07:00
Ilya Matveev
cafe2cdb12 IR: Fix fake-override resolution for fields
Earlier we used a result of a corresponding getter resolution to
obtain a fake overridden field. This approach is incorrect because
the getter resolved may not contain a backing field. This patch
fixes the issue by using the overriddenSymbols property of an
IrField directly.

Issue #KT-33034 fixed
2019-08-13 19:56:45 +07:00
Steven Schäfer
ac667403ef (Un)mute and add tests for vararg codegen 2019-08-13 14:24:55 +02:00
Steven Schäfer
d22814f6da JVM IR: Fix vararg handling in DefaultParameterInjector 2019-08-13 14:24:55 +02:00
Steven Schäfer
1543accf40 JVM IR: Remove vararg handling from ExpressionCodegen 2019-08-13 14:24:55 +02:00
Steven Schäfer
4d8d65abec JVM IR: Remove varargs from CallableReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
99f1329c14 JVM IR: Remove varargs from PropertyReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
4cef1c4901 JVM IR: Remove varargs from EnumClassLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
8d9f2f4238 JVM IR: Add a lowering to desugar varargs to arrays 2019-08-13 14:24:55 +02:00
Steven Schäfer
a7b31ba42b Add a utility function to compute type substitutions for call 2019-08-13 14:24:55 +02:00
Steven Schäfer
d61b276ebf JVM IR: Fix types in ArrayGet/Set intrinsics 2019-08-13 14:24:55 +02:00
Toshiaki Kameyama
a1c52f69f2 New J2K: convert Long.parseLong(s) to s.toLong()
#KT-21504 Fixed
2019-08-13 12:37:16 +03:00
Dmitry Savvinov
9290ec34db Provide proper platformSpecficContainer in CompositePlatformConfigurator
Now, call 'configureDefaultCheckers' and 'configureExtensionsAndCheckers'
from all childs configurators, instead of taking just container from
CommonPlatformAnalyzerServices

This is needed because some IDE services tend to re-create containers
(in particular, PerFileAnalysisCache and ResolveElementCache do that to
re-inject new trace) and use usual injection DSL, which, in particular,
takes 'platformSpecificContainer'.

Returning 'common'-conatiner leads to losing all platform-specific checkers.
On the other hand, calling exactly 'configureDefaultCheckers' +
'configureExtensionsAndCheckers' should be correct, because that's how
single-platform 'platformSpecificContainer' is composed (see
PlatformConfiguratorBase), and in 'createContainerForCompositePlatform'
we don't use 'platformSpecificContainer' anyways

^KT-23305 Fixed
2019-08-13 12:12:29 +03:00
Dmitry Savvinov
1b7fa21a83 Minor. Add comments to creation of DelegatingBindingTrace 2019-08-13 12:12:29 +03:00
Sergey Igushkin
5578434629 Fix: No value has been specified for 'binaryResultsDirectory' (KT-33246)
With Gradle 5.5+, set the property `binaryResultsDirectory` that
replaces `binResultsDir`.

Issue #KT-33246 Fixed
2019-08-12 18:23:50 +03:00
Alexander Udalov
01ddac58e1 Add language feature for changed name of property annotations method
#KT-31352 Fixed
2019-08-12 16:48:26 +02:00
Alexander Udalov
ea0142da60 Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
2019-08-12 16:48:25 +02:00
Alexander Udalov
dfea94aef5 Minor, use INTRINSICS_CLASS_NAME constant instead of hardcoded string 2019-08-12 16:09:24 +02:00
Alexander Udalov
b970a57adb Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's
passing a lambda parameter into the new parameter null check method
`Intrinsics.checkNotNullParameter` because that usage is not considered as
inlinable by the old compiler (it only knows about
`Intrinsics.checkParameterIsNotNull`). Therefore we require that these
functions can only be read by compilers of version 1.3.50 or greater.

 #KT-22275 Fixed
2019-08-12 16:09:23 +02:00
Alexander Udalov
e207c96336 Throw NPE instead of TypeCastException since 1.4
#KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
2baddb029c Use Intrinsics.checkNotNullParameter to throw NPE in parameter null checks
Similarly to previous commits, this method was unused, so we're changing
its semantics in API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
480313210a Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its
introduction before 1.0, so we're changing its semantics to throw NPE
and starting to use it with API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
a7c8fdcbe2 Use Intrinsics.checkNotNull and throw NPE in !! operator generation
This method was introduced in c204e8fc67 "just in case" and was never
used. Therefore we're free to change its semantics and use it in all new
generated code (with API version >= 1.4), without even worrying that the
newly used API will leak from inline functions in stdlib when used with
an older API version. Since we agreed to change the type of thrown
exceptions to java.lang.NPE in KT-22275, invoke a new method
throwJavaNpe now which throws that exception instead of KNPE.

Note that the additional method that takes an exception message is still
unused and exists just in case we need to use it in the future. The new
method throwJavaNpe is public also "just in case" we need to invoke it
in the future; currently it's not invoked from the bytecode.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Igor Chevdar
6106b72283 [IR] Fixed bug with fake override building 2019-08-12 17:07:44 +03:00
Igor Chevdar
ffdf3c361e [K/N libraries] Used fictitious functional interfaces factory 2019-08-12 17:07:44 +03:00
Igor Chevdar
226013353d [IrSerializer] Removed hacks with functional interfaces 2019-08-12 17:07:43 +03:00
Igor Chevdar
00dc335559 [IrSerializer] Preparations for functional interfaces handling 2019-08-12 17:07:43 +03:00
Alexander Udalov
c007f3efb3 Minor, move lazyClosure out of TypeUtils.kt 2019-08-12 14:57:21 +02:00
Alexander Udalov
cb8f70189d Minor, add debug info to assertion in AddContinuationLowering 2019-08-12 14:57:21 +02:00
Dmitry Savvinov
0065236bde Move default implementation of TargetPlatform.platformName to leaf classes
Otherwise, we have a static initialization loop, leading to null-leaks

Removing default interface method indeed disconnects the loop, as per JVM
Specification, "5.5 Initialization".

See KT-33245 for detailed explanations

^KT-33245 Fixed
2019-08-12 13:06:51 +03:00
Sergey Rostov
555e1a35e9 .idea: remove maven project from default config
Currently maven was not support in our JPS build.
You can still import them manually.
2019-08-12 10:58:15 +03:00
Sergey Rostov
ba9c632f15 Gradle, npm: use state file as fake output for :kotlinNpmInstall task
This is required in case when NpmSimpleLinker works (instead of yarn).
NpmSimpleLinker will not produce yarn.lock file, so :kotlinNpmInstall
was always up-to-date. Adding fake state file fixes the problem.

#KT-32874 Fixed
2019-08-12 10:41:16 +03:00
Sergey Rostov
6b5739bd6a Gradle, ProcessedFilesCache: don't report on clashes with for targets with removed source 2019-08-12 10:41:15 +03:00
Abduqodiri Qurbonzoda
84971d2003 Mention union in intersect documentation and vice versa (KT-26212) 2019-08-12 01:15:20 +03:00
Ilmir Usmanov
e88dce3e19 Use CFG to recognize suspension point's end
Previously it was linear scan, failing on unbalanced suspension markers.
Now, I use CFG to find end markers, which are reachable from start
markers. Using CFG allows to walk through suspension point instructions
only, since they form region.
If, for some reason, end marker does not exist (inliner or unreachable
code elimination pass remove unreachable code) or is unreachable,
just ignore the whole suspension point, as before.
 #KT-33172 Fixed
 #KT-28507 Fixed
2019-08-09 21:05:03 +03:00
Alexander Udalov
570d66be46 Support "// !API_VERSION: LATEST" directive in tests
Useful for tests that check behavior which depends on having a recent
API version enabled, and that don't want to depend on a specific fixed
API version (to prevent eventual obsoletion)
2019-08-09 15:47:58 +02:00
Alexander Udalov
13b07e71e8 Set AnalysisFlags.explicitApiVersion in tests with API_VERSION directive
To mimic the case of user passing an explicit "-api-version" flag to
avoid API version being inferred to the version of stdlib in
dependencies by JvmRuntimeVersionsConsistencyChecker
2019-08-09 15:47:09 +02:00
Alexander Udalov
9456763576 Minor, fix debug info when inferring API version 2019-08-09 15:47:09 +02:00
Alexander Udalov
d0385e4e7c Recognize Intrinsics.checkNotNullParameter call on lambdas in inline functions
We're going to start using this method since 1.4 for parameter null
checks, and without this change the compiler would fail if it
encountered a call to such method on a lambda parameter inside an inline
function, since that call is not inlinable.

 #KT-22275 In Progress
2019-08-09 15:47:09 +02:00
Ilya Kirillov
09ab98a4f8 New J2K: Don't fail on captured types & don't use functional interface with captured types
Note: we have to print captured types for lambda parameters.
It is needed for nullability inference as it requires explicit types specification to work.
Later in post-processing we remove explicit type specifications for lambda parameters which have captured types

#KT-33186 fixed
2019-08-09 16:31:58 +03:00
Steven Schäfer
0c3c0989b4 JVM IR: Don't move inaccessible const fields out of interface companions 2019-08-09 15:22:30 +02:00
Yan Zhulanow
3742425547 Move out compiler plugins from the main IDE plugin JAR (KT-31279) 2019-08-09 20:07:28 +09:00
Georgy Bronnikov
310237a8b1 Correct expected test output 2019-08-09 13:09:49 +03:00
Steven Schäfer
73d2ae961c JVM IR: BridgeLowering boxing fixes 2019-08-09 12:14:44 +03:00
Steven Schäfer
6aa8ecd745 JVM IR: Remove bridge construction from CallableReferenceLowering 2019-08-09 12:14:44 +03:00
Ilya Gorbunov
ebb59d51d2 Fix incorrect Double.toLong conversion for infinite values in JS
#KT-33225 Fixed
2019-08-09 11:49:28 +03:00
Dmitriy Novozhilov
8bf61a12df Minor. Remove UNREACHABLE_CODE slice from BindingContext
There was no reading from that slice, so it is redundant
2019-08-09 09:56:37 +03:00
Toshiaki Kameyama
154cf46f7c New J2K: add ReplaceGuardClause inspection to post-processing
#KT-22412 Fixed
2019-08-09 00:43:28 +03:00
Nicolay Mitropolsky
51e007116f KotlinLineMarkerProvider: ignore non-leaf elements when putting gutters (KT-28075, KT-30052, KT-33182)
previously for instance `KtClassBody` could get here as `leaf` and `leaf.parent` will return `KtClass` for it, making gutter for `KtClass` appear twice if origingal identifier and `KtClassBody` got here in different passes (one in "inner" other in "outer")
2019-08-08 16:38:47 +03:00
Dmitriy Novozhilov
c3ea0a1e5b [FIR] Add forgotten visit of annotation for FirAbstractLoop 2019-08-08 15:47:24 +03:00
Mikhael Bogdanov
1eda42cb88 JVM_IR. Generate SMAP information for anonymous classes
#KT-28092 Fixed
2019-08-08 12:02:50 +02:00
Mikhael Bogdanov
a444a40849 JVM_IR. Basic support of 'inlineCallSiteInfo' 2019-08-08 12:02:49 +02:00
Steven Schäfer
f34a08cbbf JVM IR: Convert interface companion fields to static fields. 2019-08-08 12:01:52 +02:00
Yan Zhulanow
e6211c4995 Debugger: Fix the compilation error in as33 bunch 2019-08-08 04:26:10 +09:00
Toshiaki Kameyama
f5c0a30c51 Add intention to replace "Map.getOrDefault"
#KT-21503 Fixed
2019-08-07 17:38:15 +03:00
Mikhail Zarechenskiy
e09ae645b3 Advance bootstrap version to 1.3.60-dev-770
Follow-up of KT-33157.
 This is needed to have proper signatures in stdlib afte the fix (80acc56c10)
2019-08-07 17:29:44 +03:00
Mikhail Zarechenskiy
9f0991f0aa Minor, clean up type approximator a bit 2019-08-07 16:06:45 +03:00
Mikhail Zarechenskiy
04e57f712e [NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new
 inference. Note that as for `SamConversionPerArgument`, this feature
 is enabled in the compiler and not in the IDE to avoid breaking code
 for those users that already enabled new inference in the compiler
2019-08-07 15:58:36 +03:00
Mikhail Zarechenskiy
0219b86d06 [NI] Fix poor performance of recursive types approximation
#KT-32407 Fixed
2019-08-07 15:21:16 +03:00
Mikhail Zarechenskiy
5f76918c90 [NI] Use approximator as a component, don't recreate it during resolve 2019-08-07 15:21:15 +03:00
Ilya Chernikov
cddabf140b Implement proper expression generation for the last script line
fixes problem with result fields
#KT-33127 fixed
2019-08-07 11:26:37 +02:00
Sergey Igushkin
ec54246b3a Fix TCServiceMessagesClient not removing an empty line prefix on Windows 2019-08-07 12:20:13 +03:00
Steven Schäfer
471b515adb Avoid getTopLevelClass in firMode 2019-08-07 10:34:43 +02:00
Steven Schäfer
43a27ab58c (Un)mute tests 2019-08-07 10:34:43 +02:00
Steven Schäfer
70aee4f9e2 JVM IR: Handle -Xassertion modes 2019-08-07 10:34:43 +02:00
Steven Schäfer
7b2edc6de8 Extract simple inlining utility from ArrayConstructorLowering 2019-08-07 10:34:43 +02:00
Steven Schäfer
d11344ce2e Add more tests for -Xassertions=jvm corner cases 2019-08-07 10:34:43 +02:00
Sergey Rostov
3e25166832 Gradle, js, karma: require webpack npm dependencies 2019-08-07 09:29:22 +03:00
Sergey Rostov
99762193f9 Gradle, js, npm: proper disambiguation classifier for npm and tools configurations
#KT-32293 Fixed
2019-08-07 09:29:22 +03:00
Sergey Rostov
1dc860f206 Gradle, js, npm: fix targets and compilation listener
#KT-32293 Fixed
2019-08-07 09:29:21 +03:00
Sergey Rostov
87e80317a0 Gradle, js, external declarations: read flags from properties 2019-08-07 09:29:21 +03:00
Jim S
88db93853f Make context available to suppressors
We've found that the BindingContext is necessary for any meaningful suppressor.
This change adds the ability for suppressors to use the BindingContext when available.

Change-Id: I14d8148ef659eca273445bf0638bcdb8c3b21f02
2019-08-07 03:16:24 +03:00
Ilya Kirillov
5151659006 Do not use dummy resolving for light data classes which extend other classes
When using dummy resolving for creating stubs of data classes we do not have overriding information
which is needed to determine whether we need to generate synthetic members or not.
As a result of that, we may have two different versions of member scope: the first one is
resolved by dummy resolving and the second one resolved via an ordinary one.

As light methods depend on the index of them in the class body,
we can have two different methods with the same index
which breaks mapping from dummy resolved methods to normal ones.

This behaviour can be reproduced when having data class which
extends other class with some synthetic members overridden and marked as final
like described in #KT-32969

#KT-32969 fixed
2019-08-06 20:08:43 +03:00
Yan Zhulanow
39e15782b2 Debugger: Fix compatibility with AS 3.3 2019-08-07 01:15:34 +09:00
Yan Zhulanow
01805e8878 Debugger: Fix read action in 'createLineSourcePosition' (KT-33064) 2019-08-07 01:15:34 +09:00
Yan Zhulanow
8211e73f7e Revert "Evaluator: Do not report parsing error on empty block/expression (KT-11938)"
KT-11938 reopened because of KT-32699.

This reverts commit 6686ed2e
2019-08-07 01:15:33 +09:00
Yan Zhulanow
d86bede293 Fix compatibility issue with the 'kotlinttest' plugin 2019-08-07 01:15:33 +09:00
Yan Zhulanow
0a092d6613 Debugger: Fix breakpoint firing in '$suspendImpl' (KT-27645) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
9096d211d3 Debugger, minor: Fix line breakpoint popup (add containing declaration name) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
1f13c4b87b Parcelize: Remove remaining experimental status checks (KT-32096) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
b3941c4ed0 Pill: Fix platform source attachment in compiler modules 2019-08-07 01:15:33 +09:00
Yan Zhulanow
086b151e1f Pill: Fix project build, add kotlin-scripting-jvm-host module 2019-08-07 01:15:32 +09:00
Yan Zhulanow
89c45e9e3f Fix stub loading for crossinline lambdas compiled by older Kotlinc (EA-105730)
Older kotlinc versions (1.1.5?) didn't generate the 'INNERCLASS' attribute for some anonymous classes, e.g. for 'crossinline' lambdas.
An example: 'Timer().schedule(1000) { foo () }'

Normally, stub loader checks if the class is 'ClassFileViewProvider.isInnerClass()', and ignores the class file.
Without the 'INNERCLASS' attribute this check fails. As the stub loaded isn't created to deal with anonymous classes nicely, it fails miserably.
This commit explicitly ignores classes with local visibility.
2019-08-07 01:15:32 +09:00
Yan Zhulanow
cc3f1b3501 Debugger: Fix exception in "Smart step into" for Java method calls (KT-32813) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
79a5375ad1 Debugger: Fix NPE in CFA during evaluation (KT-32830) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
ecce34e02b Debugger: Fix infinite recursion in inline callable searcher (EA-108938) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
ea97926c66 Debugger: Add verbose logging for EA-125569, fix possible issue 2019-08-07 01:15:32 +09:00
Yan Zhulanow
527df35bf3 Debugger: Handle case when we can't calculate the anonymous class name gracefully (EA-141202) 2019-08-07 01:15:31 +09:00
Yan Zhulanow
0f568a395f Debugger: Recognize exceptions from target VM in FUS 2019-08-07 01:15:31 +09:00
Yan Zhulanow
71e8cddaa6 Minor: Fix NI error in KotlinPositionManager 2019-08-07 01:15:31 +09:00
Yan Zhulanow
17c3406097 Debugger: Gracefully handle debugger exceptions we can't do anything reasonable with (EA-128154, EA-139473) 2019-08-07 01:15:31 +09:00
Yan Zhulanow
70745f233f Debugger: Fix reference value evaluation in Java contexts
Before this commit, Kotlin evaluator used the precise value type for variable finding.
As a result, VariableFinder often failed to find such a variable (cause the real one has a super type).
2019-08-07 01:15:31 +09:00
Yan Zhulanow
ed03d6e48e Debugger, minor: Move FrameInfo out of KotlinCodeFragmentFactory 2019-08-07 01:15:30 +09:00
Yan Zhulanow
98b4844f51 Debugger, minor: Reformat KotlinCodeFragmentFactory 2019-08-07 01:15:30 +09:00
Yan Zhulanow
bb3091429f Debugger: Keep a reference to stack trace element (EA-208000) 2019-08-07 01:15:30 +09:00
Yan Zhulanow
a664df8143 Debugger: Unwrap EvaluateExceptions on checking (EA-105847) 2019-08-07 01:15:30 +09:00
Yan Zhulanow
e301ddde9e Pill: Ignore KotlinPlugin artifact in Git 2019-08-07 01:15:30 +09:00
Yan Zhulanow
52a958256d Debugger: Disable exception on 'variable not found' event (EA-138365)
The error message is still visible to the user, so it doesn't make much sense to duplicate it as an exception.
2019-08-07 01:15:30 +09:00
Yan Zhulanow
e0c4a1c6f1 Debugger: Improve error diagnostics in FUS 2019-08-07 01:15:29 +09:00
Yan Zhulanow
a20014a7e6 Reformat eval4j 2019-08-07 01:15:29 +09:00
Yan Zhulanow
eb173893b0 Debugger: Minor, check evaluator preconditions as in Java evaluator 2019-08-07 01:15:29 +09:00
Yan Zhulanow
d6487e89ad Debugger: Prohibit 'suspend fun' calls in evaluated expressions
Currently, it's impossible to call suspend functions in evaluated code fragments (see KT-31701).
This commit officially prohibits such calls, so users will see a semi-friendly error message.
2019-08-07 01:15:29 +09:00
Yan Zhulanow
910133dbfb Debugger: Fix line numbers on String literal 'when' condition checks
Before this commit, line numbers were only available on 'when' clause bodies.
So, if a clause condition check didn't succeed, the entirely clause could be ignored.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
3d3bde5483 Debugger: Do not ignore duplicated locations for line breakpoints 2019-08-07 01:15:28 +09:00
Yan Zhulanow
de361f0b6c Minor: Add 'kotlinc' to the project dictionary 2019-08-07 01:15:28 +09:00
Yan Zhulanow
780c0518e5 Debugger: Disallow breakpoints for @InlineOnly function bodies (KT-32687, KT-24408)
Kotlin compiler strips all debug information for @InlineOnly functions, making them non-debuggable.
This commit disables breakpoints inside @InlineOnly functions to prevent false expectations.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
25fb77e7ad Debugger: Add breakpoint applicability tests
This commit adds a number of tests that check breakpoint placing behavior, and an inline action that work the same way as tests.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
a8d08815a6 Simplify call: Fix false positive in "filter {}" detection (KT-32468)
"Simplify filter {}" conversion changes semantics when the casted type is not a subtype if an initial collection element type.
This commit limits a replacement suggestion to subtype cases.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
b1f132d750 Debugger: Add stepping tests for function breakpoints 2019-08-07 01:15:27 +09:00
Yan Zhulanow
023baf6233 Debugger: Ask for light class generation in background 2019-08-07 01:15:27 +09:00
Yan Zhulanow
129ca7f2d8 Debugger: Fix breakpoint applicability (KT-10984)
Ensure that breakpoints of each type can be placed only on lines where it makes sense to place a breakpoint.

Here is a quick summary of the rules:
1. Method breakpoints are available for functions, property accessors, constructors;
2. Line breakpoints are available on any line with an expression, excluding some cases like 'const' property initializers or annotations;
3. Line breakpoints should be available on a '}' in functions and lambdas;
4. Line breakpoints are not suggested for one-liners;
5. Lambda breakpoints should be shown for single-line lambdas.
2019-08-07 01:15:27 +09:00
Yan Zhulanow
22c18ffaa9 Debugger: Add Kotlin Function breakpoints (KT-22116)
Now it's possible to put a function breakpoint.
In JVM, function breakpoints behave as JVM method breakpoints. Normally, they're triggered twice – once on enter, and once on exit.
2019-08-07 01:15:27 +09:00
Yan Zhulanow
55ea0840b1 Debugger: Keep continuation and spilled variables until the whole trace is processed (EA-208000) 2019-08-07 01:15:27 +09:00
Vyacheslav Gerasimov
89b152809f Build: Make dependencies on builtins compileOnly
for kotlin-annotations-android & kotlin-annotations-jvm, to prevent
builtins from occurring in maven pom compile scope.

 #KT-33140
2019-08-06 18:09:20 +03:00
Mikhail Zarechenskiy
80acc56c10 Don't lost type parameters for members of inline classes in the bytecode
#KT-33157 Fixed
2019-08-06 17:53:08 +03:00
Sergey Igushkin
a874f4f5c3 Don't use addIfNotNull core util in the JS Gradle plugin
The function was placed in a package whose another top-level function
used coroutines. This led to a NCDFE kotlin.coroutines.Continuation
with Gradle versions that bundle Kotlin pre-1.3 stdlib.

Instead, use the existing util function `lowerCamelCaseName` which also
filters nulls.
2019-08-06 16:55:46 +03:00
Mikhael Bogdanov
47bee6a6c5 JVM_IR. Support reified parameters in anonymous object super constructor call 2019-08-06 14:48:16 +02:00
Mikhael Bogdanov
645736f167 JVM_IR. Support anonymous object/lambda reification 2019-08-06 14:48:16 +02:00
Vyacheslav Gerasimov
0571f90762 Build: Add kotlin.build.jar.compression property
Is `true` on teamcity and `false` locally by default

 #KT-32573
2019-08-06 15:40:40 +03:00
Vyacheslav Gerasimov
659c399d30 Build: Add kotlin.build.dependencies.dir property
To specify directory downloaded dependencies stored in

 #KT-30310
2019-08-06 15:40:40 +03:00
Dmitry Petrov
1d0ba4edd4 IR: IrTypeAlias: update testData after rebase on master 2019-08-06 12:42:44 +03:00
Dmitry Petrov
f590d4da9e IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations.
Implement WrappedTypeAliasDescriptor.
2019-08-06 12:42:43 +03:00
Dmitry Petrov
b3525b077c IR: IrTypeAlias: isActual 2019-08-06 12:42:02 +03:00
Dmitry Petrov
2b43b09444 IR: IrTypeAlias: Strip 'typealias' declarations in back-ends 2019-08-06 12:42:02 +03:00
Dmitry Petrov
6abb0ffe28 IR: IrTypeAlias: Update FIR2IR testData
NB a lot of FIR2IR tests actually don't pass, and we don't care much at
the moment.
2019-08-06 12:42:02 +03:00
Dmitry Petrov
48ae76ac28 IR: Introduce IrTypeAlias element 2019-08-06 12:42:02 +03:00
Ilya Matveev
499f9330d2 Gradle: Don't use the deprecated "layout" method for Ivy repos
Issue #KT-30258 fixed
2019-08-06 14:13:27 +07:00
Roman Golyshev
b8bdef0005 Refactoring: introduce isKotlinScratch function 2019-08-06 09:31:17 +03:00
Roman Golyshev
f35ce1e9f6 Refactoring: remove duplicate of kotlin script extension constant 2019-08-06 09:29:45 +03:00
Alexander Udalov
49b534e894 JVM IR: move non-private const properties from multifile part to facade 2019-08-05 21:27:22 +02:00
Alexander Udalov
f01b0f6467 JVM IR: generate correct metadata for multi-file classes 2019-08-05 21:27:21 +02:00
Alexander Udalov
4be0e00071 JVM IR: support multi-file classes
Without the `-Xmultifile-parts-inherit` mode for now.

This is implemented as follows: FileClassLowering collects information
about multifile parts and the corresponding facades, which a later
GenerateMultifileFacades phase uses to generate new IrFile instances and
add it to the module fragment that's being compiled.

Note that GenerateMultifileFacades is in the end of lowering phases
because delegates in the facade should be generated for all additional
functions generated by certain lowerings (default arguments,
JvmOverloads, etc.). If GenerateMultifileFacades was right after
FileClassLowering, they would still be generated, but we'd then process
them in lowerings mentioned above, which would result in duplicated
logic in the bytecode. There's a new bytecode text test which checks
that this doesn't happen for functions with default arguments.
2019-08-05 21:27:21 +02:00
Alexander Udalov
73a671af7c JVM IR: generate tests on incremental compilation 2019-08-05 21:27:21 +02:00
Alexander Udalov
e1fc2c57cb JVM IR: introduce global serialization bindings for convenience
In the old JVM backend, JvmSerializationBindings are created per
ClassBuilder, and special care must be taken to make sure that
JVM-specific metadata ends up in the correct bindings. This is
especially relevant for declarations whose metadata is moved to other
classes away from the place where the original declaration lies, for
example properties moved from companion object to the outer class, or
synthetic methods for annotation properties in interfaces moved to
DefaultImpls, or const properties in multifile parts moved to the
facade.

In the JVM IR backend, this seems not necessary and actually it's
complicated to ensure that we use the correct ClassBuilder for bindings
(see the code simplification in ClassCodegen). Therefore, in case we
don't have an easy way to retrieve the correct ClassBuilder instance, we
now write all JVM-specific metadata to the new _global_ bindings map in
GenerationState, which is used by JvmSerializerExtension as a fallback
if the ClassBuilder's local map has no relevant key.
2019-08-05 21:27:21 +02:00
Alexander Udalov
babbbd0ff6 JVM IR: generate facade class for property accessors from dependencies 2019-08-05 21:27:20 +02:00
Alexander Udalov
28e2fd63ca IR: introduce WrappedProperty{G,S}etterDescriptor
This is needed in order to support wrapped properties properly in
KotlinTypeMapper (see the `is PropertyAccessorDescriptor` call in
`mapFunctionName`) which is still being used when mapping function call
signatures
2019-08-05 21:27:20 +02:00
Alexander Udalov
cfd3d974d1 JVM IR: perform substitution in IrTypeSystemContext.getSubstitutedUnderlyingType 2019-08-05 21:27:20 +02:00
Alexander Udalov
908498a560 JVM IR: deduplicate exception message text in FunctionCodegen
See 37002748c8
2019-08-05 21:27:20 +02:00
Alexander Udalov
5f06c9e86c JVM IR: do not generate generic signature for $delegate field
See ee7bbbf530
2019-08-05 21:27:20 +02:00
Alexander Udalov
45f93521d9 JVM IR: add IrWriteSignatureTestGenerated 2019-08-05 21:27:20 +02:00
Alexander Udalov
26346d88cc JVM IR: take IrFunction in IrTypeMapper.mapFunctionName/mapReturnType 2019-08-05 21:27:20 +02:00
Alexander Udalov
8c1b2a7f20 JVM IR: record DELEGATED_PROPERTIES slice for correct metadata serialization
This is needed in order to get rid of CodegenAnnotatingVisitor in JVM IR
2019-08-05 21:27:19 +02:00
Ilmir Usmanov
d9caeca249 JVM_IR: Copy suspend lambda's attributes 2019-08-05 20:25:31 +03:00
Sergey Igushkin
88e5d2bc70 Fix unrelated tasks being configured at execution time, KT-31666
Replace iteration over all tasks with `.matching { ... }` with `
.configureEach { if (...) ... }`, so that the check iterates
just over those tasks which are triggered to configure from
somewhere else.

Issue #KT-31666 Fixed
2019-08-05 17:08:22 +03:00
Steven Schäfer
9182fe887e Fix inline class handling in DefaultParameterInjector 2019-08-05 16:48:18 +03:00
Steven Schäfer
79f71f61d5 JVM BE: Add more tests for default arguments
- Inline class parameters should not be boxed.
- Empty vararg parameters should not allocate an empty array.
2019-08-05 16:48:18 +03:00
Roman Golyshev
9d7de8e9ec KT-32791: Avoid EDT when acquiring editor for setting line mark in scratches
^KT-32791 Fixed
2019-08-05 16:28:56 +03:00
Mikhael Bogdanov
971d36837a JVM_IR. Don't generate annotations and signature on synthetic methods 2019-08-05 15:00:51 +02:00
Ilya Kirillov
2dabb91a1f J2K, minor: clean copy-paste conversion code 2019-08-05 15:14:28 +03:00
Ilya Kirillov
f1482177b4 Fix NPE in J2K copy-paste handler for invalid offset 2019-08-05 15:14:28 +03:00
Ilya Kirillov
838582c926 Fix "Assertion failed: Write access is allowed inside write-action only" in Kotlin refactoring dialog
#KT-33059 fixed
2019-08-05 15:14:28 +03:00
Ilya Kirillov
b4a0436aba Show occurrences chooser in EDT thread in KotlinIntroduceVariableHandler 2019-08-05 15:14:27 +03:00
Ilya Kirillov
02f2009f2a Do not show "Replace overloaded operator with function call" intention on incomplete expressions
#KT-33115 fixed
2019-08-05 15:14:27 +03:00
Toshiaki Kameyama
892135ae23 Unused symbol: don't report for enum entry when enum builtin function is used
#KT-31133 Fixed
2019-08-05 12:50:28 +03:00
Toshiaki Kameyama
776cccf57c FunctionWithLambdaExpressionBodyInspection: fix ClassCastException for "Remove braces" quick fix
#KT-32580 Fixed
2019-08-05 12:35:23 +03:00
Louis CAD
e5e5e9084e Improve error message (#2505)
Fore the case where a target has been created or configured twice with different presets,
avoid showing "null" inside the error message if existing target has not preset,
and append a point.
2019-08-05 10:35:10 +03:00
Ilya Gorbunov
b2753a22a2 Advance bootstrap to 1.3.60-dev-607 2019-08-04 06:01:56 +03:00
Ilya Gorbunov
103e16c40f kotlin-maven-plugin: avoid adding sourceroots to read-only freeArgs list 2019-08-04 03:15:54 +03:00
Georgy Bronnikov
5d12603d73 JVM_IR: remove unused code 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
ce6e2621cf Unmute working tests 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
f9391ec790 Remove handling of default arguments from codegen 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
4d50086d35 JVM_IR: reorder lowerings
Some lowerings have to come before DefaultParameterInjector.
2019-08-04 01:35:05 +03:00
Georgy Bronnikov
924fa6f9d3 JVM_IR: use DefaultParameterInjector 2019-08-04 01:35:05 +03:00
Dmitry Gridin
52c00ba2a1 Extract JvmStartupActivity class 2019-08-02 19:23:23 +03:00
Dmitry Gridin
77a630ce34 UnsupportedAbiVersionNotificationPanelProvider: fix project leak 2019-08-02 19:19:47 +03:00
Dmitry Gridin
584b42d9f9 Add missing EP for StartupActivity 2019-08-02 19:19:47 +03:00
Dmitry Gridin
832c8e0e20 Fix "Non default constructors for extension class" 2019-08-02 19:19:47 +03:00
Dmitry Gridin
9ea2446ec0 KotlinLanguageInjector: cleanup code 2019-08-02 19:19:47 +03:00
Dmitry Gridin
49aa4aba71 UnsupportedAbiVersionNotificationPanelProvider: cleanup code 2019-08-02 19:19:47 +03:00
Simon Ogorodnik
7c24ad39ea Remove fir:lightTree test on kotlinx.coroutines as it caused problems in IDEA 2019-08-02 17:33:29 +03:00
Ilya Kirillov
be7b228cf6 Fix "Attempt to modify PSI for non-committed document" for some cases
It can be thrown after an action when optimize imports is called
2019-08-02 12:03:59 +03:00
Ilya Kirillov
1981e8b9bf New J2K: Add better error reporting in AST builder 2019-08-02 12:03:59 +03:00
Ilya Kirillov
6b0c1da42c Do not use methods which may show UI dialog in write action in refactorings
#KT-33082 fixed
2019-08-02 12:03:59 +03:00
Ilya Kirillov
474a8850b3 Do not show error message in decompiler in write action
#EA-209667 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
3205b25f80 Fix code completion for the injected Kotlin code
Allow completion of physical files as it is the case for injected Kotlin code.
Also, fix function completion for that case as `document.charsSequence` for injected code document is not dynamically updated as for usual document.
So, we should to do it manually

#KT-31117 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
84498513f6 Do not allow optimize imports for uncommitted document
Optimize imports may be called after executing command, and document can be uncommitted after command is finished. In that case we will get ISE: Attempt to modify PSI for non-committed Document

#EA-209693 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
7b659a73c7 Check if document is writable on converting Java to Kotlin 2019-08-02 12:03:57 +03:00
Ilya Kirillov
0d42d3f0a1 Fix CCE in move-refactoring
It happens when companion object's descriptor doesn't correspond to PSI object declaration

#EA-126981 fixed
2019-08-02 12:03:57 +03:00
Ilya Kirillov
46ff959415 Fix using invalidated PSI element in Remove Braces Intention
#EA-142427 fixed
2019-08-02 12:03:57 +03:00
Ilya Gorbunov
65b0a5f903 Unify withIndex docs wording 2019-08-01 19:55:36 +03:00
Ilya Gorbunov
2e445ebad6 Enable test that uses Array.fill in JS and Native 2019-08-01 19:02:39 +03:00
Ilya Gorbunov
3751a8a797 Common Array.fill for unsigned arrays, improve docs, native impl name
KT-32359
2019-08-01 19:02:39 +03:00
Jake Wharton
1a6069382e Provide Array.fill in common stdlib
KT-32359
2019-08-01 19:02:38 +03:00
Nikolay Krasko
83e422fc3b Workaround copied kotlin element happened to be outside the KtFile
Can be reproduced after revert with
IdeLightClassTestGenerated$Local.testDollarsInNameLocal test.
2019-08-01 18:21:13 +03:00
Nikolay Krasko
5614afed14 Fix over-caching content in light classes for local declarations (KT-32820)
Use combination of OOCB and file tracker for local classes.

#KT-32820 Fixed
2019-08-01 18:16:36 +03:00
Nikolay Krasko
ce3ad8f4da Use kotlin specific OOCB tracker for light classes inner cache
ClassInnerStuffCache from the platform caches everything with platform
OUT_OF_CODE_BLOCK tracker.
2019-08-01 18:16:35 +03:00
Dmitry Savvinov
78ae1a5745 Annotate default interface method with JvmDefault
To keep compatibility with external plugin(s) which inherit their
Java-classes from KotlinProjectConfigurator and make
CompatibilityChecker happy
2019-08-01 17:31:34 +03:00
Vyacheslav Gerasimov
784483e7ac as36: Add required plugins to test runtime
#KT-33063
2019-08-01 17:07:11 +03:00
Vyacheslav Gerasimov
14bd8f4eef as36: Update AS build version to 192.5765565 2019-08-01 17:07:11 +03:00
Vyacheslav Gerasimov
67b84cf35d Use properties bintray.user & bintray.apikey for AS repo 2019-08-01 17:07:11 +03:00
Dmitry Gridin
645bbc93cb KotlinWithGradleConfigurator: support addKotlinLibraryToModuleBuildScript for multiplatform
#KT-27270 Fixed
2019-08-01 16:09:04 +03:00
Dmitry Gridin
c88d4f43d3 ConfigureKotlinInProjectUtils: minor cleanup 2019-08-01 16:09:04 +03:00
Dmitry Gridin
3ea195e1a2 DescriptorRenderedImpl: fix order of val & vararg modifier for actual class
#KT-31921 Fixed
2019-08-01 16:08:45 +03:00
Dmitry Gridin
a2f937e282 DescriptorRender: cleanup code 2019-08-01 16:08:45 +03:00
Toshiaki Kameyama
80b09b9a08 Replace 'if' with 'when': don't remove branch brances
#KT-32650 Fixed
2019-08-01 16:05:06 +03:00
Mikhail Glukhikh
f3b42507d9 Do not search for bad substrings inside compiler/fir/lightTree/testData
This folder is auto-generated and git ignored
2019-08-01 15:14:29 +03:00
Ivan Cilcic
00f880a5a0 Make all necessary refactoring after merge
1) Removed all unnecessary sessions
2) Added delegation converter
3) Moved property accessor initialization to apply block instead of constructor
4) Removed unnecessary AnotationContainer class
2019-08-01 15:14:29 +03:00
Ivan Cilcic
f3a7db2428 Add auto test in gradle (light tree)
Additionally removed benchmarks from auto test because they require manual setting.
Instruction was also added.
2019-08-01 15:14:29 +03:00
Ivan Cilcic
2ca7978544 Remove duplicate code from convertIsExpresion and convertBinaryWithType 2019-08-01 15:14:29 +03:00
Ivan Cilcic
d03b6cc014 Remove extra test methods (light tree) 2019-08-01 15:14:29 +03:00
Ivan Cilcic
250d86b692 Rename "MyKotlinParser" to "KotlinLightParser" 2019-08-01 15:14:28 +03:00
Ivan Cilcic
2e05fe9976 Remove extra method toFirExpression 2019-08-01 15:14:28 +03:00
Ivan Cilcic
f3299c4636 Delete extra files with util methods (raw FIR) 2019-08-01 15:14:28 +03:00
Ivan Cilcic
01daa90f5c Extract bangbang and bindLabel methods (raw FIR) 2019-08-01 15:14:28 +03:00
Ivan Cilcic
c5547a2229 Extract some information to separate Context class 2019-08-01 15:14:28 +03:00
Ivan Cilcic
cad0dbf087 Rewrite RawFirBuilder and its utils to be able to reuse it in LightTree converter 2019-08-01 15:14:27 +03:00
Ivan Cilcic
084bad4c25 Fix bug in import directives converter (light tree to FIR) 2019-08-01 15:14:27 +03:00
Ivan Cilcic
1af7063a47 Made primary constructor wrapper to avoid recreating value parameter instances 2019-08-01 15:14:27 +03:00
Ivan Cilcic
2a60f95a32 Add FIR session argument to LightTree2Fir constructor 2019-08-01 15:14:27 +03:00
Ivan Cilcic
c253ff7953 Write syntactically incorrect constructions processing (light tree to FIR) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
ef535a2d85 Resolve converter errors after merge (light tree to FIR) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
86097bdcce Write method to test data from diagnostic test folder (light tree) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
b5293e7df7 Edit light tree to FIR benchmarks to support off stub mode 2019-08-01 15:14:26 +03:00
Ivan Cilcic
c8c37fd86e Move object literal parsing, rewrite the determination that member is local 2019-08-01 15:14:26 +03:00
Ivan Cilcic
531ee03a92 Write if and when parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
b7d57690c5 Write try expression parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
a0e79449fd Write throw expression parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
a714515527 Write break and continue parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
e0a92c5ed5 Write local variable parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
c0fdbec358 Write loops parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
26290746f3 Write object literal parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
8dd72a5cf2 Write lambda expressions and local members parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
50573066fe Write double colon suffix parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
e15b91ea16 Write arrayOf call parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
9d36855cb6 Write type operator call parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
e0bebba42e Fix some light tree to FIR converter bugs after testing 2019-08-01 15:14:23 +03:00
Ivan Cilcic
08ab530ef0 Write this and super expression parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
a13a043169 Write binary and unary expressions parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
be073ce2e6 Reformat LightTree2Fir class to be able to parse block of code 2019-08-01 15:14:23 +03:00
Ivan Cilcic
bfe83d0bfd Write some simple FIR dummy comparator 2019-08-01 15:14:22 +03:00
Ivan Cilcic
5a24c2253a Write annotation's conversion (light tree to FIR) 2019-08-01 15:14:22 +03:00
Ivan Cilcic
8bcea1cf85 Change parseCharacter visibility to be visible from lightTree module 2019-08-01 15:14:22 +03:00
Ivan Cilcic
b0a04b1061 Fix bug in abstract benchmark class (light tree) 2019-08-01 15:14:22 +03:00
Ivan Cilcic
a66adffdcf Create ExpressionsConverter class and took out light tree node handlers 2019-08-01 15:14:21 +03:00
Ivan Cilcic
05757c1ada Write basis for separate testing some of fir nodes 2019-08-01 15:14:21 +03:00
Ivan Cilcic
e9ddbc412c Took out common code of dir walking 2019-08-01 15:14:21 +03:00
Ivan Cilcic
5b5eadeeaa Change method's order in converter according to KotlinParsing class 2019-08-01 15:14:21 +03:00
Ivan Cilcic
840e627f1f Add annotation processing in joinTypeParameters method 2019-08-01 15:14:21 +03:00
Ivan Cilcic
8b1a63b54d Move modifiers enum set to separate file 2019-08-01 15:14:20 +03:00
Ivan Cilcic
7cbd838720 Change AbstractBenchmark code to avoid collisions in files map 2019-08-01 15:14:20 +03:00
Ivan Cilcic
c9d5202971 Add reference to parse value parameters methods in light tree converter 2019-08-01 15:14:20 +03:00
Ivan Cilcic
bbf7263ddc Summarize methods that convert value parameter nodes 2019-08-01 15:14:20 +03:00
Ivan Cilcic
5fc3367c25 Write ClassWrapper class to transmit information to lower FIR nodes
Additionally a number of further optimization in Converter class
2019-08-01 15:14:20 +03:00
Ivan Cilcic
b5d617492a Change modifiers parsing and some minor changes in fir conversion 2019-08-01 15:14:19 +03:00
Ivan Cilcic
05a2b2fac8 Add some minor changes to fix errors after merge in lightTree module 2019-08-01 15:14:19 +03:00
Ivan Cilcic
d0dfcbb2f2 Add simple documentation to convert methods 2019-08-01 15:14:19 +03:00
Ivan Cilcic
311964acea Made some code refactoring to make it more readable 2019-08-01 15:14:19 +03:00
Ivan Cilcic
f07d85eb83 Create benchmark for light tree FIR builder (including coroutines test) 2019-08-01 15:14:19 +03:00
Ivan Cilcic
0a8d0baa59 Write benchmarks for some generated cases 2019-08-01 15:14:18 +03:00
Ivan Cilcic
c47a8e2025 Add JMH for benchmark 2019-08-01 15:14:18 +03:00
Ivan Cilcic
0e8bbab925 Change total kotlin tests architecture 2019-08-01 15:14:18 +03:00
Ivan Cilcic
45faf76b4a Write test to compare FIR from light tree with FIR from PSI 2019-08-01 15:14:18 +03:00
Ivan Cilcic
9dbacb5380 Put the common code into a separate function 2019-08-01 15:14:17 +03:00
Ivan Kylchik
16d7d202d2 Add separated tests for tree generation and fir convertion 2019-08-01 15:14:17 +03:00
Ivan Kylchik
343dcca79d Add some test cases to test performance and tree construction correctness 2019-08-01 15:14:17 +03:00
Ivan Kylchik
d1e87eb90c Implement LightTree to Fir converter for declarations 2019-08-01 15:14:17 +03:00
Ivan Kylchik
5b577b9754 Refactor light tree test compare for better result 2019-08-01 15:14:16 +03:00
Ivan Kylchik
f0a5408eb6 Modify previously added test 2019-08-01 15:14:16 +03:00
Ivan Kylchik
200fe63fca Implement basic class to test light tree builder performance 2019-08-01 15:14:16 +03:00
Dmitriy Novozhilov
14d6f8009d [NI] Update diagnostic messages in testdata 2019-08-01 14:37:54 +03:00
Dmitriy Novozhilov
8107d1515c [NI] Minor. Remove redundant code that was added for debugging 2019-08-01 14:37:49 +03:00
Dmitriy Novozhilov
b6a7d21579 [NI] Fix extracting type variables for flexible types in in captured types
Bug was introduced in b99efb because of lack of tests.
All code in `AbstractTypeCheckerContextForConstraintSystem.extractTypeVariableForSubtype`
  related to IN projection looks suspicious and needs further investigation
2019-08-01 14:37:41 +03:00
Alexander Podkhalyuzin
71a1a0e2f5 Do not highlight annotations as keyword (new default like in Java)
#KT-17993 Fixed
2019-08-01 13:49:03 +03:00
Ilya Gorbunov
695d657ca8 Random.nextLong: use progression properties consistently
Apply inspection suggestion that helps to reduce boxing.
2019-07-31 21:53:16 +03:00
Ilmir Usmanov
06388b885c JVM_IR: Support suspend lambdas with receiver 2019-07-31 21:17:09 +03:00
Toshiaki Kameyama
3742993dea Change to star projection: do not suggest when type paramer is generic type
#KT-30794 Fixed
2019-07-31 20:51:57 +03:00
Mikhail Glukhikh
10e42a55c9 FIR: set PSI elements in JavaSymbolProvider / enhancement scope
Related to KT-24351
2019-07-31 13:24:20 +03:00
Mikhail Glukhikh
0c4134bef4 Remove FirResolvePhase from FirElement hierarchy 2019-07-31 12:55:36 +03:00
Steven Schäfer
efb938a7c8 (Un)mute tests 2019-07-31 11:18:44 +02:00
Steven Schäfer
06274b1339 JVM_IR: Simplify RemoveDeclarationsThatWouldBeInlinedLowering 2019-07-31 11:18:44 +02:00
Steven Schäfer
93d414ac01 JVM_IR: Change CallableReferenceLowering to match the JVM backend
In particular, the JVM backend inlines the bodies of lambdas into the
generated lambda subclasses and stores bound receivers in the receiver
field of CallableReference. Both are required for reflection.
2019-07-31 11:18:44 +02:00
Steven Schäfer
917435a50c Extract IrBody.statements utility function 2019-07-31 11:18:44 +02:00
Steven Schäfer
509d257475 JVM_IR: Fixes to SyntheticAccessorLowering
This commit fixes the handling of accessors for super calls, changes the
naming scheme to avoid accessor name clashes and uses a more robust test
to determine the placement of accessors for protected static members.
2019-07-31 11:18:44 +02:00
Steven Schäfer
173f1fc7d1 Fix statement order in LocalDeclarationsLowering
Previously, the order of IrSetField statements in this lowering was
non-deterministic. This broke the inliner in the JVM backend which
expects statements to be in argument order.
2019-07-31 11:18:44 +02:00
Steven Schäfer
c38fb27676 JVM_IR: Run CallableReferenceLowering before LocalDeclarationsLowering 2019-07-31 11:18:44 +02:00
Steven Schäfer
9816e62d08 JVM_IR: Fix inlining of interface methods 2019-07-31 11:18:44 +02:00
Dmitry Petrov
bdec8b04e8 Minor: trim in RenderIrElementVisitor 2019-07-31 10:37:35 +03:00
Alexey Tsvetkov
efe62c983a Decrease max heap size for test process on Windows
Test processes themselves don't do much
(RAM heavy work is done in Kotlin and Gradle daemons).
The default 1600m max heap size is unreasonably high
for copying test projects and checking output logs.
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
4db3dcc28f Use short temp dirs names only in gradle integration tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
1a0c6fe8b8 Unify test tasks configuration in gradle tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
847af4456a Remove KotlinGradlePluginJpsParametrizedIT
We've stopped running it on CI some time ago,
does not seem very useful now
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
54227e15ff Do not set max heap size twice
The parameter is also set in the next statement (`maxHeapSize = "1600m"`)
2019-07-31 04:48:20 +03:00
Ivan Gavrilovic
de5335b17f Fix gradle integration tests on Windows
Android Gradle Plugin 3.0 and 3.1 use aapt that does not handle
long paths on Windows. This commit uses shorter paths for the project
working directory on Windows.

Test: running integration tests on Windows
2019-07-31 04:48:20 +03:00
Ty Smith
e74a00789d Add embeddable artifact for jvm-abi-gen
#KT-28824 Fixed
2019-07-30 20:47:56 +03:00
Alexey Tsvetkov
37042801c4 Fix CompilerDaemonTest#testDaemonJvmOptionsParsing
Forgot to update test data after 560f1483e8 and 317c39f27d

    #KT-33048 Fixed
2019-07-30 20:35:23 +03:00
Alexey Tsvetkov
0a91a663b1 Always keep Serializable#serialVersionUID
It is usually set explicitly for a reason,
so ProGuard should not throw it away.

    #KT-33027 Fixed
2019-07-30 20:20:58 +03:00
Andrey Uskov
a6f50c71bd Fixed import of package prefix in non-MPP projects
#KT-33038 Fixed
2019-07-30 18:43:30 +03:00
Mikhail Glukhikh
eedebcfe4c FIR lazy resolve: fix test data 2019-07-30 17:42:51 +03:00
Mikhail Glukhikh
869e970bfd FIR resolution API: fix handling of expressions inside imports 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
14e9404afd FIR (raw / resolution API): set correctly elvis/bang-bang bound PSIs 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
1f771a2407 FIR resolution API: fix handling of expressions inside secondary ctors 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
2a69efba8a FIR resolution API: fix handling of expressions inside local functions 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
760fb668bb Introduce FIR resolution API with lazy resolve to use in IDE
Now lazy resolve atomic element is a file (declaration-level resolve)
or a callable declaration (expression-level resolve)

#KT-24351 In Progress
2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
1cd559a626 Remove FirTotalKotlinResolveInIde test with its provider as obsolete 2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
c3a31dcdf5 Optimize FirSession component storage 2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
7529d557fe FIR resolution: introduce FirResolvePhase & FirAbstractPhaseTransformer
The phase determines which transformers were already applied to declaration.
The transformer controls current resolve phase in phasedFir and
performs additional resolve if necessary.
2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
a38b4756b5 FIR tree refactoring: move FirElement.session to FirDeclaration
#KT-30275 Fixed
2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
98f75669a5 [FIR] Make resolution sequence of CallKind static field 2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
53404e5dac [FIR] Extract ResolutionStageRunner component
That component is responsible to run all resolution stages on candidate
  and calculating resulting applicability.

This is needed for completion of `when` and `try` as function calls
2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
8bbb60df25 [FIR] Refactoring. Split CallResolver.kt to several files 2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
3c7b25b8c9 [FIR] Minor. Cleanup code in ConeTypes.kt 2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
a226e40e34 [FIR] Refactor FirResolveBodyTransformer
Extract from it components responsible for call completion,
  call resolution and resolution of FQN
2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
43e7f54fae [FIR] Add string representation for ConeKotlinType
`ConeKotlinType.render` moved from `tree` module to `types` module
2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
6c26fc1943 [FIR] Don't render Any? upper bounds of type parameters 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
7245475196 [FIR] Add DeclaredUpperBoundConstraintPosition to Fir 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
d3670d4f5f [FIR] Add Any? as default bound for all type parameters 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
8a21785883 [FIR] Add Any? builtin typeref 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
2a360272f6 [FIR] Add Any to supertypes of functional types 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
71ca1aa608 [Type system] Fix algorithm of folding recursive types
There was a problem when we get type from type projection even if
  it is a star projection what is meaningless. Now we try to fold argument
  only if it's not a star projection
2019-07-30 16:28:13 +03:00
Dmitriy Novozhilov
a453ed50fa [FIR] Fix class cast exception in ConeInferenceContext 2019-07-30 16:28:13 +03:00
Dmitriy Novozhilov
6215662e33 Replace usage of ClassicTCContext with abstract context in NewCSTCalculator 2019-07-30 16:28:13 +03:00
Andrey Uskov
0276a6262f Fix compilation of NewMultiplatformKaptProjectImportingTest in AS 3.3,3.4 2019-07-30 14:34:36 +03:00
Dmitry Savvinov
6177b3e8dc Minor. Add empty file to previously empty directory in test
Otherwise Git doesn't commit empty folder into repository and test fails
later with "invalid directory exception"
2019-07-30 14:19:02 +03:00
pyos
d715344639 psi2ir: precompute sort keys when generating members
On kotlinx.serialization, this improves the performace of the compiler
with -Xuse-ir by about 5% (average of 30 runs after 10 warmup runs:
3096 ms -> 2970 ms, minimum: 3037 ms -> 2884 ms). Flamegraphs for
comparison (careful, huge SVG images):

https://drive.google.com/open?id=1BlIFN4ivSKrXjY6vZ0xkZymwucGc7bSI
https://drive.google.com/open?id=1xIW2IvW7LMCaAe4P2dOGOG8nCcpWI9PW
2019-07-30 12:07:12 +02:00
Vladimir Dolzhenko
2d5a1e19d0 Perform GC between performance test runs, add geometric mean calculation and close stats in the end 2019-07-30 11:59:33 +02:00
Vladimir Dolzhenko
3f9480e1c5 Specify parent disposable in JavaOutsideModuleDetector Vfs listener 2019-07-30 11:59:22 +02:00
Dmitry Savvinov
ddb685a8f9 Add test on nonMPP -> MPP dependency 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
79313037d1 Minor. Merge multiplatformTypeRefinement testdata with multiplatform testdata 2019-07-30 12:41:41 +03:00
Dmitriy Novozhilov
9f90486893 [Misc] Update spec testData according changes in NI 2019-07-30 12:41:41 +03:00
Denis Zharkov
ffaca279bc Minor. Turn TypeBasedStarProjectionImpl into StarProjectionForAbsentTypeParameter
It's needed to avoid abusing of the class
Star projections should be created based on the relevant type parameter
whenever it's possible
2019-07-30 12:41:41 +03:00
Denis Zharkov
579838cb4e Avoid recursive refinement in NewCapturedTypeConstructor
Potentially, it might contain infinite recursive supertypes
And for such cases, we have to perform lazy refinement (one level per request)
2019-07-30 12:41:41 +03:00
Denis Zharkov
a2a1c7e50f Avoid recursive refinement with star projections
Otherwise StackOverflowError or recursion-detection in LockBasedStorageManager
may happen

It's fine to have non-refined type there because it only can affect
content of containing type member scope that should be refined after
being requested
2019-07-30 12:41:41 +03:00
Denis Zharkov
d042eb2cfb Fix type refinement for qualified expressions
Previously, type for "c.a"-receiver in "c.a.platformFun()"
has not been refined because typechecking of "c.a" doesn't go
through common facade org.jetbrains.kotlin.types.expressions.ExpressionTypingServices#getTypeInfo
where the most of expressions are expected to be type checked.

(see org.jetbrains.kotlin.resolve.calls.CallExpressionResolver#getUnsafeSelectorTypeInfo)
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
6695ddd1d5 Change 'hashCode' of 'TypeProjection'
according to bug when there was exception in
`hashCode` call when projection has some `SpecialType`
like `NO_EXPECTED_TYPE`
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
b103f42ca8 Add test on using correct builtins in MPP
Note that Native built-ins are not resolved correctly in this module
(CPointed and similar). This is not a bug, but rather a technical
limitation of the current testing infrastructure: we can't depend on
kotlin-native stdlib in "big-Kotlin" repo, and native stdlib is used as
the only one source of Native built-ins.
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
1fe8e4ba15 Use CompositeResolve in HierarchicalExpectActual tests 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
aaf76a0e46 Enable TypeRefinement in COMPOSITE resolution mode 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
2b4d70fcf0 [Resolve] Rewrite how built-ins are created
Under COMPOSITE mode we don't have a globally known way to create
built-ins, instead, we have to create them on per-module basis.

So, in this commit we:

1. Use builtInsProvider: (ModuleInfo) -> KotlinBuiltIns instead of
precomputed builtIns instance, in order to be able to calculate
builtIns on per-module basis

2. Introduce new entity, called BuiltInsCache, which, roughly
speaking, is a map of form ModuleInfo -> KotlinBuiltIns, to prevent
creation of multiple builtInsInstances
NB. Actually, it's of form BuiltInsCacheKey -> KotlinBuiltIns, because
we shouldn't create new builtIns for each module. Also, currently,
each platform has its own BuiltInsCacheKey implementation, because
parameters by which built-ins are created, are a bit different across
different platforms. Ideally, we should eliminate those differences
and they use one concrete implementation as a key.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
9f2a03947c [Resolve] Compute dependency on SDK properly
Under COMPOSITE resolution mode (see ResolutionModeComponent) we have
no fixed and globally known SDK, instead, for each module we have to
find SDK it it's transitive dependencies.

Currently, this is necessary in order to create proper JvmBuiltIns,
which need dependency on SDK to be present in immediate dependencies.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
02c07a4a6c [Resolve] Introduce an ability to get all moduleInfos without filtering by platform
Previously, each ProjectResolutionFacade was tied to the respective
platform, so there were no point in collection moduleInfos for all
possible platforms.

For composite resolution mode, we have to get all modules no matter
what their platform is (because all modules will be analyzed in one
facade), so this commit adds such an ability.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
f9b8ab3a3a [Resolve] Introduce CompositeResolver
This commit introduces CompositeResolverForModuleFactory, which should
work under so-called "composite resolution mode", where sources of all
all modules are analyzed in one global facade.

This allows to:
- avoid re-analyzation of common sources
- avoid retaining memory for all platforms (which can be very bad as
soon as we'll start distinguishing various flavours of platforms,
especially "flavours" of common platform)
- support running platform-specific checks in common modules (e.g.,
report JVM_PLATFORM_DECLARATION_CLASH if common sources are going to have
it)
- support analysis of shared platform modules, like commonNative

This mode heavily depends on so-called "type refinement" support in the
compiler, which is introduced in other series of commits.

In this commit, CompositeResolver and related codepaths are left unused.
Also, this commit misses several important pieces of logic in
resolvers-setup code, which should be different for CompositeResolver
- computation of 'firstDependency'
- computation of built-ins
- computation of modules owned by facade

They will be covered in the following commits
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
adb0f5eaf9 [Resolve] Introduce CompositeAnalysisSettings
Because we want to support both COMPOSITE and SEPARATE resolution modes
at once, we have to leave 'globalFacadesPerPlatformAndSdk'-map, but in
COMPOSITE mode it should use less parameters for that map, and, in
particular, we shouldn't use Platform and SDK for equality.

This commit introduces separate instance which should be used in
COMPOSITE mode.

COMPOSITE mode itself will be introduced in the following commits.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
5e95890028 [Resolve] Introduce KotlinMultiplatformAnalysisModeComponent
Introduce a component which tells which resolution mode should be used.

COMPOSITE mode will analyze all sources for all platforms in one facade,
and will use proper support in the frontend instead of
CombinedModuleInfo.

SEPARATE mode is essentially a "legacy" mode, where each platform is
analyzed in separate facade (leading, in particular, to multiple
re-analyzation of common sources)

Facilities for support of COMPOSITE mode will be introduced in the
following commits.

resolution component
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
90cf9daff3 [Resolve] Abstract creation of platform-specific package fragment providers 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
b48218e722 [Resolve] Make ResolversForModule less static
As consequence, remove IdePlatformKindTooling.resolverForModule, because
it became more than just field, and it duplicates similar API in
IdePlatformKindResolution anyways
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
0f56d243cb [Resolve] Support test/production/dependsOn internal-visibility 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
c50eeb3edb Add few tests on internal visibility in MPP 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
43ef0ffa50 [Testing] Support diagnostics filters in MultiModuleIdeResolveTest 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
68c1a7cedd Use stable order for dependsOn and related diagnostics 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
769ccde43b Closure over dependencies in multiPlatformSetup 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
3c2e34ee08 [Misc] Fix bug in multiPlatformSetup
Due to a typo, dependency on fullJdk were added to the wrong module
2019-07-30 12:41:39 +03:00
Dmitry Savvinov
61ec5ed5dd [Misc] Introduce lazyClosure 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
54cdd3bfef [Misc] Refactor Module.cached extension to accept lambda instead of FunctionalInterface 2019-07-30 12:41:39 +03:00
Dmitriy Novozhilov
b477184a3c Fix creating of refined FlexibleType and RawType
There was an issue that `KotlinType.equals` called in `KotlinTypeFactory.flexibleType`
  and `RawType` constructor produced endless recursion of types that wasn't
  computed yet
2019-07-30 12:41:39 +03:00
Denis Zharkov
33a31fb688 [Tesdata fix] Fix test data for multiplatform highlighting test
Once refinement is introduced the behavior becomes correct
2019-07-30 12:41:39 +03:00
Denis Zharkov
d744192e6f [Invariant fix] Fix false positive internal visibility diagnostic
Effectively, this commit allows for common module
to see internal content of all expect-modules

The problem is that when computing the member scope for A (see the test)
we're building a special member scope for CommonAbstract viewed from JVM
and it's effectively has a fake override of actual member from Jvm/ExpectBase.

OverridingUtil checks if it's visible in CommonAbstract and finds that it's not
thus creating a fake_invisible fake override

The latter results in A::foo override being marked as INVISIBLE_MEMBER_OVERRIDE

Probably, the fix might be smarter
(passing a requested module to OverridingUtil::createAndBindFakeOverride)
but allowing using internal member seems to be safe & simple
because it's reasonable to assume there's no cyclic dependencies
between expected/actual modules
2019-07-30 12:41:39 +03:00
Denis Zharkov
d20516779a [Invariant Fix] Avoid using invalid descriptors in RemovePartsFromPropertyFix
org.jetbrains.kotlin.descriptors.InvalidModuleException: Accessing invalid module descriptor <production sources for module light_idea_test_case> is a module[ModuleDescriptorImpl@89f9a78]
	at org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl.assertValid(ModuleDescriptorImpl.kt:51)
	at org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl.getPackage(ModuleDescriptorImpl.kt:70)
	at org.jetbrains.kotlin.descriptors.FindClassInModuleKt.findClassifierAcrossModuleDependencies(findClassInModule.kt:23)
	at org.jetbrains.kotlin.types.KotlinTypeKt.refineDescriptor(KotlinType.kt:185)
	at org.jetbrains.kotlin.descriptors.impl.AbstractClassDescriptor$1$1.invoke(AbstractClassDescriptor.java:50)
	at org.jetbrains.kotlin.descriptors.impl.AbstractClassDescriptor$1$1.invoke(AbstractClassDescriptor.java:47)
	at org.jetbrains.kotlin.types.SimpleTypeImpl.refine(KotlinTypeFactory.kt:210)
	at org.jetbrains.kotlin.types.SimpleTypeImpl.refine(KotlinTypeFactory.kt:182)
	at org.jetbrains.kotlin.types.AbstractTypeConstructor$ModuleViewTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:38)
	at org.jetbrains.kotlin.types.AbstractTypeConstructor$ModuleViewTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:33)
	at org.jetbrains.kotlin.types.TypeUtils.getImmediateSupertypes(TypeUtils.java:230)
	at org.jetbrains.kotlin.types.TypeUtils.collectAllSupertypes(TypeUtils.java:255)
	at org.jetbrains.kotlin.types.TypeUtils.getAllSupertypes(TypeUtils.java:268)
	at org.jetbrains.kotlin.idea.util.TypeUtils.getResolvableApproximations(TypeUtils.kt:128)
	at org.jetbrains.kotlin.idea.util.TypeUtils.getResolvableApproximations$default(TypeUtils.kt:126)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion$createTypeExpressionForTemplate$1.invoke(SpecifyTypeExplicitlyIntention.kt:133)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.createTypeExpressionForTemplate(SpecifyTypeExplicitlyIntention.kt:149)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotationWithTemplate(SpecifyTypeExplicitlyIntention.kt:234)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotationWithTemplate$default(SpecifyTypeExplicitlyIntention.kt:229)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotation(SpecifyTypeExplicitlyIntention.kt:195)
	at org.jetbrains.kotlin.idea.quickfix.RemovePartsFromPropertyFix.invoke(RemovePartsFromPropertyFix.kt:82)
	at org.jetbrains.kotlin.idea.quickfix.KotlinQuickFixAction.invoke(KotlinQuickFixAction.kt:37)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:179)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java

See QF tests like QuickFixTestGenerated$RemoveRedundantInitializer.testSimple
2019-07-30 12:41:39 +03:00
Denis Zharkov
5f10252185 [Invariant fix] Avoid using obsolete desciptors as scope content in change signature
After type refinement was introduced we sometimes may request
some additional data from ModuleDescriptor

But if it's been invalidated after first part of refactoring's been applied
requesting content may fail (see ModuleDescriptorImpl::assertValid)

See the test:
org.jetbrains.kotlin.idea.refactoring.introduce.ExtractionTestGenerated.IntroduceLambdaParameter#testLambdaParamInPrimaryConstructor
2019-07-30 12:41:39 +03:00
Denis Zharkov
01f0589ddf [Invariant Fix] Use the same lock inside single GlobalFacade
Before refinement, order of accessing compiler's entities (supertypes,
descriptors, memberscopes) was always the following:

    sources -> libraries -> SDK (built-ins)

With refinement, it is sometimes possible to inverse this order, e.g.
access sources after libraries or SDK. This mainly happens in the following
scenario:

- we reference some library/SDK class, but do not acquire source-lock
  This might seem a bit weird, but actually it is quite easy to achieve
  as soon as we understand that analysis sources doesn't necessarily
  acquires respective lock, only forcing lazy computations does so.
  E.g., we can just traverse PSI tree and meet some refernce to "Any?" -
  this doesn't involves acquiring source-lock

- we start resolving it, which usually involves acquiring library/SDK-lock
  (e.g., in order to get it supertypes or memberScope)

- because we reference it from the source-module, we may like to refine
  it, in which case we will have to acquire source-lock on refinement
  cache

Obviously, that may lead to deadlocks, so, in this commit we disable
creating granular locks when we work with refinement.

Note that if refinement is disabled (which is the case for all non-MPP
projects), we still create separate locks.
2019-07-30 12:41:39 +03:00
Denis Zharkov
fd4d8176dd [Misc Invariant Fix] Do not use KotlinType::toString in inspections
Because, there's no strict limitations on toString format there
and ModuleViewTypeConstructor#toString violates it
2019-07-30 12:41:38 +03:00
Denis Zharkov
daa27016ca [Invariant Fix] Adjust DataFlowValue::Identifier for refinement
After refinement is introduced it becomes possible to have a different
descriptors instances for effectively the same descriptors

Also, it accidentally fixes KT-25432 because is caused by a different
version of descriptors created for NewCapturedType

^KT-25432 Fixed
2019-07-30 12:41:38 +03:00
Denis Zharkov
21cc93860b [Invariant Fix] Fix KotlinPsiUnifier after types refinement introduction
Refined types with non-trivial substitution may result in different
descriptors instances
See PsiUnifierTestGenerated$Equivalence$Expressions.testArrayAccess
2019-07-30 12:41:38 +03:00
Denis Zharkov
c49791f8bb [Invariant Fix] Fix equality for NewCapturedTypeConstructor after refinement 2019-07-30 12:41:38 +03:00
Denis Zharkov
471134d31e [Invariant Fix] Fix callable equivalence definition in case of refined scopes
Before types refinement has been introduced it was reasonable to assume
that whenever we have two callables in the same declaration
they are actually different

But it become false once types refinement were introduced
and the same declarations may appear as different descriptors' instances
when viewing from different modules

The change does look very fragile because in many cases
source element is NO_SOURCE

At the same time, declaring actually different members
with the same signature is prohibited and may make sense only
in case of source-based members
2019-07-30 12:41:38 +03:00
Denis Zharkov
5c2c7e7776 [Invariant fix] Avoid re-resolving declared descriptors in lazy member scopes
It becomes necessary after scopes/types refinement
Without it being applied the code might fail with slice-rewrite errors

KT-32841
2019-07-30 12:41:38 +03:00
Dmitry Savvinov
ab9ff786d7 [Invariant Fix] Use structural descriptor equivalence in JsNamesClashChecker
It's needed for situation when we have JS module with expect declaration,
so we refine member scope for that expect declaration and try to
compare to function descriptors (e.g. of `equals` function) from
different class descriptors (expect and actual) and report diagnostic
about name clash. So, since we can earn descriptors from type refinement,
they can be not identical but still equals, so with should use structural
equality to comparing them
2019-07-30 12:41:38 +03:00
Dmitriy Novozhilov
9add14a2a1 [API Usage] Add refinement to ConstraintInjector (NI) 2019-07-30 12:41:38 +03:00
Dmitry Savvinov
6c44b6b859 [API Usage] Refine type of lambda's receiver in NI
It's needed because of lambda's receiver is not an expression and
  we can not refine it in usual way in TypingVisitor
2019-07-30 12:41:38 +03:00
Dmitriy Novozhilov
696aea004d [API Usage] Add type refinement for callable references 2019-07-30 12:41:38 +03:00
Denis Zharkov
53334c038f [API Usage] Use refinement in NI 2019-07-30 12:41:37 +03:00
Denis Zharkov
2bf6bd3724 Do not consider descriptors equality as a reason not to refine type
Otherwise, it results in skipping refinement for JobNode when requested
from JVM module while it's necessary because CompletionHandlerBase's content
depends on the module
2019-07-30 12:41:37 +03:00
Denis Zharkov
9c27abde7f [API Usage] Support type refinement from expect class to type aliases
It's necessary when expect class is actualized via typealias
To support it properly, we need to return AbbriviatedType instead of
SimpleTypeImpl, thus scopeFactory is not enough anymore
2019-07-30 12:41:37 +03:00
Dmitry Savvinov
04717b57c9 [API Usage] Support refinement for Java classes' scope
Also, we should skip supertypes refinement for additional
    built-in members scope
2019-07-30 12:41:37 +03:00
Denis Zharkov
b7e011a29b [API Usage] Use type refinements in overrides-related facilities 2019-07-30 12:41:37 +03:00
Denis Zharkov
694f521bfd [API Usage] Refine type for each separate element in ExpressionTypingVisitorDispatcher 2019-07-30 12:41:37 +03:00
Dmitriy Novozhilov
a1b52b2f90 [API Usage] Inject Refiner into KotlinTypeChecker, use it for subtyping 2019-07-30 12:41:37 +03:00
Dmitry Savvinov
9047ddfc2f [API Usage] Refine supertypes when getting content of member scope 2019-07-30 12:41:37 +03:00
Dmitry Savvinov
1d61d75225 [Core API] Introduce KotlinType.refine
The most interesting part happens in SimpleType.refine, other types
either don't implement refinement at all (they return just 'this',
mainly it's some special types, like ErrorType and such) or implement
it trivially via recursion (those are "composite" types)

SimpleType.refine captures so-called refinement factory, which is essentially
an injected callback which tells how to reconstruct the type with new
(refined) memberScope.

We have to inject callback because we express quite different types with
SimpleTypeImpl, and some of them need different refinement logic.
Another possible implementation approach (more invasive one) would be
to extract those types in separate subtypes of KotlinType and implement
'refine' via overrides.

The most meaningful callbacks are injected from
'AbstractClassDescriptor.defaultType' and from 'KotlinTypeFactory'.
2019-07-30 12:41:37 +03:00
Dmitry Savvinov
c12f5f6055 [Core API] Introduce TypeConstructor.refine
This commit introduces TypeConstructor.refine method.

It's implementation can be roughly split in three parts:
- trivial implementations which just return 'this': mostly, it used for
typeConstructors which can not be refined at all (e.g.
IntegerValueTypeConstructor and other special cases of constructors)

- delegating implementations which call 'refine' recursively for
component typeConstructors -- obviously, they are used in composite
typeConstructors (like IntersectionTypeConstructor)

- finally, the most interesting one is in 'AbstractTypeConstructor'
which returns lightweight wrapper called 'ModuleViewTypeConstructor'.
The idea here is to propagate refinement to supertypes without eagerly
computing them all.

VERY IMPORTANT CAVEAT of TypeConstructor.refine is that call to this
method CAN NOT add new supertypes, so returned supertypes are not
entirely "valid". See the KDoc for TypeConstructor.refine for details
2019-07-30 12:41:37 +03:00
Denis Zharkov
c20d565d93 [Core API] Introduce API for getting scopes with refinement
- All refinement-related methods are incapsulated in
ModuleAwareClassDescriptor

- most of classes implement it trivially by retning unchanged scope

- LazyClassDescriptor and DeserializedClassDescriptor have non-trivial
implementations of the refinement-related methods

- General idea is to return new scope which captures refiner and will
later use it to get correct content of itself (currently, refiner is
unused, and will be used for that in later commits)

- In order to not repeat similar work, those new instances of scopes are
cached in ScopeHolderForClass, which is essentially a cache of form
KotlinTypeRefiner -> MemberScope
2019-07-30 12:41:37 +03:00
Dmitry Savvinov
d08bed888c [Core API] Introduce useTypeRefinement analysis flag 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
2fe3a23183 [Core API] Introduce KotlinTypeRefiner component 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
5c17148146 [Core API] Introduce TypeRefinement annotations 2019-07-30 12:41:36 +03:00
Denis Zharkov
38bcedc451 [Tests] Add tests for types refinement in IDE 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
d000341178 [Misc] Add missing type to lambda in ILTConstructor 2019-07-30 12:41:36 +03:00
Dmitry Savvinov
fe78e153f7 [Misc] Introduce helper-method 'IntersectionTypeConstructor.createType()' 2019-07-30 12:41:36 +03:00
Dmitry Savvinov
5c13e02e9c [Misc] Clean-up and deduplicate code in 'findClassInModule.kt' 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
a0f339ffc7 [Misc] Enable @Experimental project-wide 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
f026a98403 [Misc] Make NewKotlinTypeChecker non-static 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov
4f1e85b468 [Misc] Add caching of hashCode in KotlinType
KT-32852
2019-07-30 12:41:35 +03:00
Denis Zharkov
8d1b063d62 [Misc] Add test on typealiased SAM 2019-07-30 12:41:35 +03:00
Denis Zharkov
c1144f35f1 [Misc] Move TypeAliasExpander to core 2019-07-30 12:41:35 +03:00
Denis Zharkov
7ba3f7e599 [Misc] Make ArgumentTypeResolver::isSubtypeOfForArgumentType not static
Later, it will use type-refinement component that'll be injected there
2019-07-30 12:41:35 +03:00
Denis Zharkov
529763b9bd [Misc] Get rid of public Companion methods in SmartCastManager
It's necessary for type-refinement component to be injected
2019-07-30 12:41:35 +03:00
Denis Zharkov
e7d6a9508e [Misc] Reformat CallType.kt 2019-07-30 12:41:35 +03:00
Denis Zharkov
edb9623556 [Misc] Reformat DescriptorEquivalenceForOverrides.kt 2019-07-30 12:41:35 +03:00
Andrey Uskov
4e486e7738 Fix NewMultiplatformKaptProjectImportingTest (KT-32974)
Fix test case when importing module per source set is not supported
in Android Studio
#KT-32974 Fixed
2019-07-30 11:56:07 +03:00
Andrey Uskov
c17a5bc8f2 Disable KaptImportingTest.testModulePerSourceSet in AS (KT-32683)
#KT-32683 Fixed
2019-07-30 11:55:17 +03:00
Andrey Uskov
02ee950836 Add transitive dependencies on common MPP modules
Transitive dependencies on modules available via
'dependsOn' dependencies are added to java modules
depending on MPP projects
#KT-33025 Fixed
2019-07-30 11:38:51 +03:00
Steven Schäfer
3ce731cf7c Avoid eager deserialization of array classes in ArrayConstructorLowering 2019-07-30 10:35:00 +02:00
Ilmir Usmanov
2910d8e9b2 Also check predecessors of PUSH Unit in unit tail-call optimization 2019-07-29 20:34:53 +03:00
Ilmir Usmanov
e60674f5e1 Fix test data 2019-07-29 20:34:51 +03:00
Ilmir Usmanov
cc06798e2c Implement unit suspend functions tail-call optimisation
Unlike previously, this optimisation works on every callee return type.
Tail-calls inside unit functions can be either
INVOKE...
ARETURN
or
INVOKE
POP
GETSTATIC kotlin/Unit.INSTANCE
ARETURN
The first pattern is already covered. The second one is a bit tricky,
since we cannot just assume than the function is tail-call, we also need
to check whether the callee returned COROUTINE_SUSPENDED marker.
Thus, resulting bytecode of function's 'epilogue' look like
DUP
INVOKESTATIC getCOROUTINE_SUSPENDED
IF_ACMPNE LN
ARETURN
LN:
POP

 #KT-28938 Fixed
2019-07-29 20:34:48 +03:00
Alexey Tsvetkov
a16e03681b Substitute kotlin-reflect in compileOnly configurations too
This fixes running IDEA with JPS build.
Gradle only uses compileClasspath configurations
for compilation. Hence the substitution introduced in 5c99243c10
affected only compile tasks (without affecting existing POMs).

However, Intellij import also looks into compileOnly configurations
in order to determine PROVIDED dependencies.
Only dependencies, that are present in both
compileOnly and compileClasspath confgurations,
are considered to have PROVIDED scope.

The substitution was replacing kotlin-reflect with kotlin-reflect-api
in compileClasspath configuration. CompileOnly configurations still resolved
to kotlin-reflect, so a compileOnly dependency to kotlin-reflect
would result in kotlin-reflect-api dependency with COMPILE scope in
IDEA.
This is exactly what happened in 'idea-runner' module, thus breaking
running IDEA from JPS build.

This change fixes the issue by configuring the same substitution
for compileOnly configurations.
2019-07-29 19:48:10 +03:00
Alexey Tsvetkov
317c39f27d Enable assertions in Kotlin Compile Daemon process
#KT-32992 Fixed
2019-07-29 19:40:36 +03:00
Alexey Tsvetkov
560f1483e8 Drop MaxPermSize support from compiler daemon
#KT-17045 Fixed
2019-07-29 19:38:40 +03:00
Dmitry Gridin
db23131611 AbstractFindUsagesTest: add read lock 2019-07-29 17:16:41 +03:00
Igor Chevdar
e575ca4f53 [IR] Fixed parents during constructors moving 2019-07-29 16:18:15 +03:00
Vyacheslav Gerasimov
2c61572c50 Build: Fix artifact pattern for Android Studio bintray repo 2019-07-26 19:01:53 +03:00
Vyacheslav Gerasimov
10f5204f67 as36: Fix groovy-all dependency version 2019-07-26 18:27:41 +03:00
Ilya Chernikov
aed9b13455 Fix jvm-host-embeddable artefact generation 2019-07-26 16:29:45 +02:00
Ilya Chernikov
333c7ff688 Filter out local classes on JSR-223 properties mapping
fixes e.g. Spring framework usages of the JSR-223 engine
2019-07-26 16:28:56 +02:00
Alexey Tsvetkov
2ae19e1d42 Run :kotlin-gradle-plugin:validateTaskProperties on every install
Previously `validateTaskProperties` was run with tests
(`test` task depends on `validateTaskProperties` task).
Tests run with `--continue` argument on TeamCity,
so the validation was not failing remote-run builds.
To fix this, make `install` depend on `validateTaskProperties`.
2019-07-26 15:31:59 +03:00
Alexey Tsvetkov
aff66b6a29 Make KotlinJpsBuildTestBase abstract
Otherwise TeamCity warns that it does not contain any tests
2019-07-26 15:09:47 +03:00
Roman Artemev
ce9ed26918 [DEBUGGER] Improve computation of source position for breakpoint
in KotlinLineBreakpointType more precise.

 - make `getOffset` of returned position point to lambda body start.

 Fix [WEB-29329]
2019-07-26 15:05:41 +03:00
Dmitry Gridin
2e0ec3b490 AbstractFindUsagesTest: add read lock 2019-07-26 12:57:29 +03:00
Dmitry Gridin
dbb9b3b6fd AbstractFindUsagesTest: cleanup code 2019-07-26 12:52:02 +03:00
Nikolay Krasko
58f294a757 Fix kotlin compiler tests in 192 (KT-32193)
#KT-32193 Fixed
2019-07-26 12:38:40 +03:00
Georgy Bronnikov
3729c4e770 JVM: simplify choice of wrapped receiver descriptors 2019-07-26 11:57:51 +03:00
Dmitry Gridin
a10e57eaec JavaOutsideModuleDetector: should refresh notification after move
#KT-32967 Fixed
2019-07-26 10:33:54 +03:00
Dmitry Gridin
4c8d0acb5d CreateExpectFix: shouldn't suggest create expect property with lateinit or const modifier
#KT-32705 Fixed
2019-07-26 10:33:28 +03:00
Ilya Chernikov
a858607fac Fix script classpath utility functions that use classpath filtering by "keys"
The problem was that only the first matching classpath entry were used.
The problem was reported by @lion7 on github (67ad3773de (commitcomment-34443927))
2019-07-26 08:55:16 +02:00
Ilya Chernikov
ec3ccf1ba8 Properly handle REPL snippets with exceptions ...
so the REPL remain operational after exception in one of the snippets:
- separately return script class and script instance on evaluation (
  because in case of an exception the class is valid, while the instance
  is not).
- store both the class and the instance in the history
- handle this data accordingly
2019-07-26 08:55:16 +02:00
Ilya Chernikov
288fdc0952 Add a handler for providing evaluation context for scripts
use it on refinement.
also some refactoring on context class and around
2019-07-26 08:55:16 +02:00
Ilya Chernikov
2a5c4a2409 Move caching to after all configuration refinements and ...
move compilation cache setting to the scripting host configuration
The cache implementation can now take into account all external
dependencies that may appear during refinement.
Also change initial refinement location accordingly and rearrange
caching interfaces to make it available in scripting plugin.
2019-07-26 08:55:16 +02:00
Ilya Chernikov
e41bbe9328 Introducing transient properties in scripting API 2019-07-26 08:55:16 +02:00
Ilya Chernikov
5fe843d754 Refactor main-kts build scripts - fix red code in IDEA 2019-07-26 08:55:15 +02:00
Ilya Chernikov
42dde50b6b Implement base zip cache with tests...
plus some relevant fixes and refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov
c7eb9e9520 Move caching tests into a dedicated class
plus some tests refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov
ef23033936 Add net.jpountz and one.util.streamex to the list of shadowed packages
should fix problem with using REPL infrastructure with Apache Zeppelin
2019-07-26 08:55:15 +02:00
Ilya Chernikov
cefd4a35c5 Fix and test evaluation of scripts with default configurations 2019-07-26 08:55:15 +02:00
Ilya Chernikov
961607673d [minor] Refactor properties collection builder:
add a helper to replace the value only if it is absent or default
rearrange some functions
2019-07-26 08:55:15 +02:00
Ilya Chernikov
0af52f2fa6 Implement composable refinement handlers...
for compilation and evaluation configurations.
Add utilities to apply refinements uniformly.
Also fix one invoke for list values - it was not consistent with
other builders
2019-07-26 08:55:14 +02:00
Ilya Chernikov
65e6d3b0ff [minor] Add a small diagnostics handling utility fun 2019-07-26 08:55:14 +02:00
Ilya Chernikov
0072f8c265 Improve JSR-223 engine diagnostics
also abstract invoke wrapper creation
2019-07-26 08:55:14 +02:00
Ilya Chernikov
b68ab0d968 Add test on repl with implicit receiver 2019-07-26 08:55:14 +02:00
Ilya Chernikov
a13d452cd8 Implement JSR223 host in the main-kts jar
also improve diagnostics on configuration instantiation
2019-07-26 08:55:14 +02:00
Ilya Chernikov
0108a76e99 Extract arguments calculation for base JSR223 engine into an argument 2019-07-26 08:55:13 +02:00
Ilya Chernikov
e8fa139dc8 Move direct properties configuration code into public functions in scripting host jar 2019-07-26 08:55:13 +02:00
Andrey Uskov
89a53fe028 Safe get of registry key in KotlinAndroidGradleMPPModuleDataService 2019-07-26 09:33:56 +03:00
Andrey Uskov
5f2aca5856 Fix NewMultiplatformProjectImportingTest in bunch 183 2019-07-26 09:33:39 +03:00
Victor Petukhov
e25b315319 Introduce -Xpolymorphic-signature compiler flag as more priority than -XXLanguage:+PolymorphicSignature 2019-07-26 09:01:25 +03:00
Victor Petukhov
944ee8fcd5 Introduce -Xinline-classes compiler flag as more priority than -XXLanguage:+InlineClasses 2019-07-26 09:01:25 +03:00
Mikhail Mazurkevich
45644c224e JPS: Add temporary non caching jps storage for 192
This storage available under separate flag. Temporary non caching storage
should be removed after Intellij SDK version update.
2019-07-26 04:57:05 +03:00
Andrey Uskov
584d441587 Fix import when android gradle plugin is involved in IDEA 183
All dependencies on MPP modules are added in KotlinAndroidGradleMPPModuleDataService
including transitive ones. Fixes KT-30510 in IDEA 183 and below
2019-07-26 01:18:29 +03:00
Andrey Uskov
91365d9fad Fix import library dependencies when transitive MPP are involved
Fix import dependencies of java modules on MPP modules when
project was not build before import. Unresolved jar dependencies
are not created any more on import of MPP project.
#KT-28822 Fixed
#KT-29757 Fixed
2019-07-26 01:17:55 +03:00
Andrey Uskov
0b8ad5c6c0 Fixed setting production-on-test flag if project was not build
Make importing production-on-test flag more accurate when
the project to be imported was not previously build
2019-07-26 01:16:56 +03:00
Andrey Uskov
17dec7b389 Add transitive test dependencies on MPP with jvmWithJava on import
Fixed case when production and test source sets depend on MPP module
with jvmWithJava involved and have dependency on the same jar artifact.
2019-07-26 01:16:17 +03:00
Andrey Uskov
86a26f0cca Add jvmWithJava IDE import test 2019-07-26 01:15:32 +03:00
Andrey Uskov
6c0469cee0 Fix importing transitive dependencies on MPP project
Fix importing dependencies of java projects on MPP projects
when external dependency is resolved into file collection dependency
2019-07-26 01:14:45 +03:00
Andrey Uskov
8592396a9a Fix combobox size in facet settings tab (KT-32784)
Size of the select platform combobox fixed in order to fit all elements
#KT-32784 Fixed
2019-07-26 01:14:12 +03:00
Andrey Uskov
9ce9b5945e Fix order of platforms in Facets (KT-32783)
#KT-32783 Fixed
2019-07-26 01:13:42 +03:00
ilgonmic
b8400a16f0 Fix webpack dsl with closure
(cherry picked from commit 795e0eef200bb24b9cba06002b48737c01de02be)
2019-07-25 23:26:42 +03:00
ilgonmic
deb6b7105a Remove duplicated source-map-loader configuring and cleanup kotlin webpack config writer
(cherry picked from commit 681eeaedfb359e85cf98e0e9a7239a0364a5d41c)
2019-07-25 23:26:41 +03:00
Vyacheslav Gerasimov
3b78ef9cb2 as36: Add bunches for AS 3.6 C6 based on 192 platform 2019-07-25 20:50:02 +03:00
Vyacheslav Gerasimov
5c6dedc623 Build: Add repo for prerelease Android Studio 2019-07-25 20:50:02 +03:00
Yan Zhulanow
ccff347ffc Kapt: Attach generated Kotlin sources in 'compilation' mode (KT-32535) 2019-07-26 02:40:32 +09:00
Ivan Gavrilovic
1c63d3aa2f KT-32210: Handle long compiler plugin options
Some of the KAPT compiler plugin options were longer than 0xFFFF bytes in
UTF-8 encoding, causing UTFDataFormatException when serializing them. This
commit avoids that issue by encoding changed files and changed classpath types
one by one instead of joining them to a single string.
2019-07-26 02:40:32 +09:00
Alexey Tsvetkov
4b9a852745 Sort source to output mapping before writing to caches
#KT-32902 Fixed
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
afa10cc125 Rewrite test of relocatable JPS IC caches
* Caches are compared as files now. It is a more robust approach
than comparing strings with dumped contents. E.g previous test
ignored differences in keys ordering, because dumping caches to string
was added for comparing caches after incremental and non-incremental builds,
which cannot be compared without sorting keys (see KT-32674).
* Calling setUp/tearDown twice within the same test instance was
relatively hacky and fragile. Also it complicated adding new test cases.
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
98aad3e00c Extract EnableICFixture 2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
a4c62d156f Make lookup storage addAll order independent
Lookup storage output files could differ for projects
with different absolute paths.
This happened because, paths for lookups were
relativized only before writing to the underlying storage.
Storing absolute paths in a hash table could
result in different order of adding files to the lookup storage.
This commit fixes the issue by sorting lookups and files in
LookupStorage#addAll

    #KT-32674 Fixed
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
57caca4b0e Improve exception message for directories comparison in tests
It was unclear what dirs were compared (e.g when rebuilding and
comparing caches dirs, it's not obvious which dir is "expected" and
which is "actual"). To improve this, compare resulting strings
with the placeholder for a root dir first. If the comparison fails,
then replace the placeholder with an actual directory and call
assertEquals.
2019-07-25 20:30:56 +03:00
Dmitry Gridin
6914a9dd3d KotlinFindUsagesHandler: fix read access (flaky tests) 2019-07-25 19:16:52 +03:00
Alexander Podkhalyuzin
66fdc148be Revert strong references for compiler only
#KT-32521 Fixed
2019-07-25 16:13:47 +03:00
Alexey Tsvetkov
f3112f752d Inherit max metaspace size of client VM for Kotlin compile daemon
#KT-32521 In Progress
    #KT-32950 Fixed
2019-07-25 16:13:47 +03:00
Alexey Tsvetkov
5c99243c10 Substitute kotlin-reflect with kotlin-reflect-api in compile classpath
Currently Kotlin IC can only track changes in "default" jar files by
associating a history of ABI diffs with a source set's jar file.

kotlin-reflect is a non-default fat jar, which causes
non-inremental builds when it gets changed and included in
a compile classpath. To avoid this problem, kotlin-reflect-api
project was added. It is assumed that only kotlin-reflect-api
should be used for compilation.

However, Gradle is known to leak transitive runtime dependencies
to a compile classpath, i.e. when `:b` has a runtime dependency on `:a`,
and `:c` has a compile dependency on `:b`, `:c` also gets `:a`
in its compile classpath.

Before this change kotlin-reflect was leaked to compiler tests's
classpath through kotlin-scripting-compiler-impl.

To work around this issue, and to prevent similar issues from happening,
this change introduces a dependency substitution from kotlin-reflect
to kotlin-reflect-api in all compile classpath configurations.

        #KT-32954 Fixed
2019-07-25 16:09:32 +03:00
Alexey Tsvetkov
33b7745b17 Find only non-default shadow jars in findShadowJarsInClasspath diagnostic
We are interested only in shadow jars that might break the incremental compilation
2019-07-25 16:09:31 +03:00
Alexey Tsvetkov
e91eefe709 Remove unnecessary dependencies on kotlin-compiler-runner 2019-07-25 16:09:31 +03:00
Alexey Tsvetkov
cd641c9047 Set source and target compatibility in buildSrc
If source and target compatibility are not set explicity,
Gradle will assume they are equal to current JVM version.
This may cause unwanted rebuilds, when a build is run on
different JDK versions (it might happen when switching between
CLI and IDE).
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a7403b7ee7 Do not fork java compile tasks when current JDK can be used
I see the following improvements:
* `clean dist --parallel` is ~10% faster (from 3:40 to 3:20)
* incremental `dist --parallel` is ~50% faster
(adding public method to org.jetbrains.kotlin.utils.SmartList)

    #KT-32955 Fixed
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a372f181d2 Check JDK env vars once during configuration when not syncing
Previous code (callback in `beforeTask`) was added to allow
opening project without setting up all env. variables.
This change simplifies the code and avoids a callback,
while keeping the ability to open the project without
setting up all variables by checking `kotlinBuildProperties.isInIdeaSync`
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a20627fa2c Set sourceCompatibility and targetCompatibility for JavaCompile tasks
Currently running build with JAVA_HOME pointing to
any JDK != 1.8 results in errors like

    #KT-30382 Fixed
2019-07-25 16:03:07 +03:00
Ilmir Usmanov
a35d405892 Do not generate accessor if private function is accessed from
coroutines intrinsic lambda.
The logic is if the lambda is crossinline we need to generate the
accessor. However, suspendCoroutine's and
suspendCoroutineUninterceptedOrReturn's parameter, despite being
crossinline, are effectively inline. Thus, we do not need to generate
the accessor.
 #KT-27503 Fixed
2019-07-25 15:25:59 +03:00
Ilmir Usmanov
b3e80e6a14 Look for classfile in implementing modules when building inline function
hyperlinks.
 #KT-32864 Fixed
2019-07-25 15:10:03 +03:00
Ilya Kirillov
58db64a478 J2K: Fix old J2K test data's error messages which has changed due to new inference 2019-07-25 14:34:36 +03:00
Ilya Kirillov
4e5e14046d New J2K: use old J2K for evaluate expression instead of new one
#KT-32693 fixed
2019-07-25 14:34:36 +03:00
Ilya Kirillov
e795e4b73d New J2K: add conversion of binary literals & fix conversion of octal ones
#KT-32835 fixed
2019-07-25 14:34:36 +03:00
Ilya Kirillov
72a09ab59b New J2K: correctly convert number literals with underscores
#KT-32837 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov
4ead820395 New J2K: correctly print comments for qualified expression 2019-07-25 14:34:35 +03:00
Ilya Kirillov
2bd5a1f196 New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference

#KT-21467 fixed
#KT-32609 fixed
#KT-32572 fixed
#KT-24677 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov
d7960caf89 New J2K: move all symbols definitions to symbols package 2019-07-25 14:34:35 +03:00
Ilya Kirillov
f79b282c60 New J2K: add better support of implicit functional interfaces
#KT-32702 fixed
#KT-19327 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov
96ca4712a0 New J2K: consider in-context declarations while performing conversion on copy-paste plain text conversion
#KT-32602 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov
c865d74965 New J2K: remove unused dependencies from nj2k modules 2019-07-25 14:34:34 +03:00
Ilya Kirillov
1bbdd0bf15 New J2K: remove unused classes 2019-07-25 14:34:34 +03:00
Ilya Kirillov
6e04b1549c New J2K: remove JKVisitor with type parameters 2019-07-25 14:34:33 +03:00
Leonid Startsev
9c8905ccb6 Patch serializable class with addtional annotation
(which contains actual serializer) to make use of it with @AssociatedObjectKey
2019-07-25 14:07:22 +03:00
Leonid Startsev
3896992b12 Fixes for IR serialization plugin
- Do not insert typeParameters into IrConstructor;
- Set correct property symbol to IrField;

- Use upper bound as a class descriptor for type parameters.
This will allow to get upper bound's KClass in polymorphic serialization.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/490;

- Lazily add all serializer functions.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/502;

- Don't generate constructor invocation for abstract(sealed) classes deserializer.
Such code is incorrect anyway (you can't create an instance of abstract class) and causes problems in devirtualization when exporting Native libraries.
2019-07-25 14:07:24 +03:00
Leonid Startsev
6494227c64 Change order in SerializableProperties initialization logic
in that way so binding context would be checked only after resolve is triggered (via .getContributed descriptors).
Empty binding context led to some subtle bugs.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/508
2019-07-25 14:07:22 +03:00
Leonid Startsev
822b4556e3 Rewrite IDE check whether serialization plugin is enabled
In a such way so it wouldn't check for actual JAR file and wouldn't touch filesystem.
Fixes KT-32346
2019-07-25 14:07:22 +03:00
Mikhail Glukhikh
2381aa330a FIR: fix delegate expression consistency tests 2019-07-25 09:46:46 +03:00
Mikhail Glukhikh
d32e5065c5 FIR: implementation of delegateProvider in delegate resolve 2019-07-25 09:46:42 +03:00
Mikhail Glukhikh
213f951da3 FIR: partial implementation of delegate resolve #KT-32217 Fixed 2019-07-25 09:46:34 +03:00
Mikhail Glukhikh
63b7fa70f9 FIR2IR: add extension receiver parameters to functions 2019-07-25 09:46:29 +03:00
Ivan Gavrilovic
be3fe9495c Report non-incremental annotation processors correctly
This commit fixes an issue when all APs would be reported as non-incremental,
even if only a single one is non-incremental. Now, additional declared type
is added that is used to denote processors that are incremental, but have
been forced to run non-incrementally in presence of non-incremental APs.

This means that only APs that do not support incremental annotation processing,
or APs that are dynamic and are non-incremental at runtime will be reported.
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
ad352355de KT-23880: Enable incremental APT mode with KAPT by default
The feature has been present since 1.3.30 behind a flag. This
commit enables it by default.
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
a108af76d6 Mark property as output instead of local state when needed
Kapt task incremental annotation processing cache directory
was using @LocalState annotation that was added in Gradle 4.3.
However, minimum supported version is 4.2, so this commit registers
this directory as output of a task for pre 4.3 versions. This is safe
as caching is enabled only for Gradle 4.3+.

Test: verified manually
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
5a2ff86691 Handle classpath snapshot changes better
Because Kapt Gradle task uses PathSensitivity.NONE for the input representing
the classpath structure, there are cases when paths of the files may change,
but because content is the same, there will be no incremental changes.

Classpath snapshot comparison did not handle this case correctly, but this
commit fixes that. In more details:
- classpath entries with the same path and that are not reported as changed
will have their information loaded from the previous snapshot
- any other entry (changed path or changed content) will be reloaded

Test: ClasspathSnapshotTest
2019-07-25 04:57:26 +09:00
Georgy Bronnikov
f66b475867 Create wrapped receiver descriptors where needed 2019-07-24 20:25:47 +03:00
Roman Artemev
46b98a1e98 [JS BE] Make sourceMap generation more precise
- Don't produce mapping for closing bracket in case of expressionBody
 - Map Kt*Function declaration into corresponding js fun declaration
 - Update test data & add new test
2019-07-24 18:56:40 +03:00
Kirill Shmakov
12a1b0296b Clean up useless code 2019-07-24 18:25:11 +03:00
Nikolay Krasko
d3bc2ec855 Remove internal jdk to fix flaky MavenUpdateConfigurationQuickFixTest 2019-07-24 17:28:01 +03:00
Nikolay Krasko
6176373713 Test data update for JavaWithGroovyInvoke since 183 2019-07-24 17:28:01 +03:00
Nicolay Mitropolsky
5f9660cd33 KtLightParameter introduced as interface 2019-07-24 10:11:45 +03:00
Nicolay Mitropolsky
50158e508a org.jetbrains.kotlin.asJava.elements.LightParameter converted to Kotlin
to avoid clashes in `getMethod` with `KtLightParameter`
2019-07-24 10:11:44 +03:00
Nicolay Mitropolsky
7dcd3849e0 org.jetbrains.kotlin.asJava.elements.LightParameter converted to Kotlin: Rename .java to .kt 2019-07-24 10:11:44 +03:00
Nicolay Mitropolsky
8982a49dcb renaming KtLightParameter to KtLightParameterImpl 2019-07-24 10:11:44 +03:00
Anton Yalyshev
4a20a440a7 Cleanup: remove redundant semicolon 2019-07-24 07:41:58 +03:00
Anton Yalyshev
6d53151256 Add statistics (FUS) collector for IDE Settings. At the moment - New Inference only. 2019-07-24 07:41:58 +03:00
Ilmir Usmanov
56b6b957d1 Generate line numbers for RHS of elvis expression if both LHS and RHS
are at the same line.
 #KT-32689 Fixed
2019-07-23 18:00:44 +03:00
Alexander Udalov
1f36f60f43 JVM IR: remove CrIrType, use class container in callable reference lowerings
This is possible now because after 3a9b94235f, 0423d0f41e and
5341de253f, all top level functions/properties in sources and in
binaries have a corresponding containing facade class
2019-07-23 16:39:38 +02:00
Igor Chevdar
a048a11074 Enabled/disabled some tests for K/N 2019-07-23 19:16:46 +05:00
Igor Chevdar
c4da5cb95c [IR] Added IrType.isKSuspendFunction() 2019-07-23 19:16:46 +05:00
Dmitriy Dolovov
e398804663 Show the actual Kotlin version in error message in nativeLibrariesUtil.kt 2019-07-23 20:54:39 +07:00
Dmitry Gridin
4e2989e884 CreateExpectActualFix: fix package for files with root package from non-root directory
#KT-28746 Fixed
2019-07-23 16:24:43 +03:00
Dmitry Gridin
c76ca988eb KotlinCreateTestIntention: disallow intention for expect classes
#KT-26242 Fixed
2019-07-23 16:24:16 +03:00
Dmitry Gridin
311cfc3806 UnimplementedKotlinInterfaceMemberAnnotator: shouldn't report methods with @JvmStatic
#KT-27208 Fixed
2019-07-23 16:23:04 +03:00
Dmitry Gridin
cf07585b11 UnimplementedKotlinInterfaceMemberAnnotator: cleanup code 2019-07-23 16:23:03 +03:00
Andrey Uskov
ad1b795a69 Disable KaptImportingTest in IDEA 183 and below 2019-07-23 11:43:36 +03:00
Andrey Uskov
6e10126c6f Fix matching file paths under Windows in NewMultiplatformKaptProjectImportingTest 2019-07-23 11:43:16 +03:00
Toshiaki Kameyama
22c5e208a6 ReplaceGuardClause inspection: do not report when 'if' expression is used as expression 2019-07-22 20:49:20 +03:00
Toshiaki Kameyama
a6690e4e35 ReplaceGuardClause inspection: do not remove 'else' branch
#KT-32797 Fixed
2019-07-22 20:49:20 +03:00
Toshiaki Kameyama
a3a3c52c24 ReplaceGuardClause inspection: fix highlight range 2019-07-22 20:49:20 +03:00
Alexander Udalov
35e4295e16 IR: deduplicate code in DeepCopyWithWrappedDescriptors/DeepCopyIrTreeWithDescriptors 2019-07-22 19:47:25 +02:00
Alexander Udalov
96efae2b48 IR: fix endless recursion in IrTypeSystemContext.isMarkedNullable 2019-07-22 19:47:25 +02:00
Nikolay Krasko
72fdb47f13 Fix maven import tests by adding java-ide-customization dependency [KT-32833]
Need java-ide-customization because of JavaAwareModuleTypeManagerImpl
registration. Otherwise there were two instances of JavaModuleType that
were not equal and that prevented facets creating after Maven project
importing.

 #KT-32833 Fixed
2019-07-22 19:13:51 +03:00
Dmitry Gridin
0993fb82fe multiplatformUtil: implementedModules shouldn't ignore android test module
Relates to #KT-30799
2019-07-22 17:56:25 +03:00
Andrey Uskov
8294e5afc2 Increase heap size for gradle importing tests due to memory
leak in the gradle daemon
#KT-32731 Fixed
2019-07-22 16:10:33 +03:00
Andrey Uskov
db743aa6e8 Calculation of supported platforms in AndroidSourceSetDataService fixed
for IDEA versions 183 and below.
A deep copy of MPP model for Android source sets is created
2019-07-22 16:06:03 +03:00
Andrey Uskov
d69fbf1177 Fix serialization of iml files for IDEA 192
#KT-32629 Fixed
2019-07-22 15:53:48 +03:00
Mikhael Bogdanov
74e49d91ca Proper implement 'classForImplicitThis' 2019-07-22 10:35:03 +02:00
Dmitry Gridin
a9f0d1a53b AddOperatorModifierInspection: decrease severity to INFORMATION
#KT-32796 Fixed
2019-07-22 11:17:15 +03:00
Dmitriy Novozhilov
b99efb9a2b [NI] Look for type variables in captured flexible types
#KT-32434 Fixed
2019-07-22 11:08:39 +03:00
Dmitriy Novozhilov
58b4ab35f0 [NI] Fix passing callable references to suspend functions as functional parameter
#KT-32452
2019-07-22 11:06:19 +03:00
Dmitry Petrov
127be9be03 psi2ir: Fix KT-30796 ErrorType for '?:' in OI 2019-07-22 09:46:21 +03:00
Anton Yalyshev
959b720e3f Cleanup: specify description for Gradle Kotlin/Multiplatform wizard 2019-07-21 16:57:54 +03:00
Vladimir Dolzhenko
0f6c381cd7 Fixed a corner case for invalidate package cache for default package
relates to KT-25264
2019-07-19 18:02:20 +02:00
Ilya Chernikov
5ed6573a60 Fix testLazyScriptDefinitionProvider:
The KtUsefulTestCase functionality is not used here but seems causes
the side effects resulting in failing test, probably exactly because
the infrastructure loaded by the KtUsefulTestCase is never called
2019-07-19 16:37:50 +02:00
Ilya Chernikov
853f2a9c3f Fix flaky failures in main-kts IT 2019-07-19 16:37:50 +02:00
Ilya Chernikov
c0804000eb Shorten temp paths used in tests
#KT-32490 fixed
2019-07-19 16:37:50 +02:00
Ilya Chernikov
ee0f55d8e1 Fix gradle IT with scripting discovery
The test is not designed to fail if the definitions are not discovered -
the script files have completely custom extensions and therefore ignored.
So checking for the warning in the build log is enough.
#KT-32697 fixed
2019-07-19 16:37:50 +02:00
Ilya Chernikov
747c488a78 Fix entries closing on saving compiled script to jar:
also adding a short sleep in tests, otherwise in some cases the
classloader was not able to find class in the jar.
Fixes script to jar saving tests on windows
2019-07-19 16:37:49 +02:00
Ilya Chernikov
5b3164ee87 Ignoring resolver tests that failing on TC:
should be rewritten to the new scripting API
Some additional diagnostics improvements are remained for possible
future usage.
2019-07-19 16:37:49 +02:00
Ilya Chernikov
823cb70ba0 Fix script definition matching for REPL console
fixes IdeReplCompletionTestGenerated tests
in addition, fix default ScriptDefinition generation
2019-07-19 16:37:49 +02:00
Ilya Chernikov
425deb42ec Convert paths to unix format before matching with filePathPattern
should also fix testPathPattern5_kts test
2019-07-19 16:37:49 +02:00
Natalia Selezneva
7d6bb023a8 Invalid script dependencies should be removed from fileAttributes to avoid 'all red file highlighting'
^KT-32061 Fixed
2019-07-19 12:45:56 +03:00
Natalia Selezneva
dd437b585b Scratch tests: check output after repl stop because error output is printed only after repl process termination
This should fix flacky tests
2019-07-19 12:45:03 +03:00
Natalia Selezneva
b9968ee1af Do not call onFinish for executor that wasn't started 2019-07-19 12:45:03 +03:00
Natalia Selezneva
2fa7ef2482 Tests, refactoring: replace invokeLater with TransactionGuard to avoid situations that project isDisposed during inlays printing 2019-07-19 12:45:03 +03:00
Natalia Selezneva
ec1bef639f Tests, refactoring: do not search for psi file twice 2019-07-19 12:45:02 +03:00
Natalia Selezneva
fe662fcb2e Provide a mesaage for NPE in scratch tests 2019-07-19 12:45:02 +03:00
Roman Golyshev
a32b1970e6 KT-31295: Disable module selection toolbar for .ws.kts files
^KT-31295 Fixed
2019-07-19 12:45:02 +03:00
Roman Golyshev
e54b43bab1 KT-31295: Enable support for .ws.kts files as for scratch files 2019-07-19 12:45:02 +03:00
Roman Golyshev
232c7fdd0e KT-31295: Add New Kotlin Worksheet action
- creates new kotlin file with `.ws.kts` extension
2019-07-19 12:45:01 +03:00
Natalia Selezneva
f6b03dc02f Add Show Kotlin Gradle DSL Logs Action (KT-31440)
Provide a label for this action in some script diagnostics from gradle dsl resolver
^KT-31440 Fixed
2019-07-19 12:06:09 +03:00
Dmitry Petrov
dd3f8ecaac IR BE Common: Provisional IrFunctionExpression lowering
Transforms IrFunctionExpression elements to local function references,
as it was done before IrFunctionExpression introduction.
2019-07-19 11:36:19 +03:00
Dmitry Petrov
92984b2626 Serialize/deserialize IrFunctionExpression 2019-07-19 11:36:19 +03:00
Dmitry Petrov
ffd9b45ef3 IrFunctionExpression: add 'origin'
This is actually either a LAMBDA or an ANONYMOUS_FUNCTION.
Not quite sure if it's really required, but some tools such as IR-based
decompiler might require this information.
2019-07-19 11:36:19 +03:00
Dmitry Petrov
41b59f9b9a IrFunctionExpression: update fir2ir tests 2019-07-19 11:36:19 +03:00
Dmitry Petrov
ed2b4a8bec Introduce IrFunctionExpression IR element
Use it to represent proper function expressions (lambdas and anonymous
functions).
2019-07-19 11:36:18 +03:00
Vladimir Dolzhenko
022275b781 Do not invalidate package caches on generic events, KT-25264 2019-07-19 09:14:26 +02:00
Nikolay Krasko
3e9765f5bb Don't over-cache own methods list in KtUltraLightClass
The might be code that stores light class references (for example
ChangeMethodSignatureFromUsageFix) and tries to find methods
after invalidating. Internal class caches has an additional assert that
methods obtained are valid and this assert can be violated if the list
of methods was cached before some method invalidation.

This a major problem of current light-classes implementation. Other
places should be checked and fixed as well.

Check test:
QuickFixMultiFileTestGenerated$ChangeSignature$Jk.testJkKeepValOnAddingParameter1

Caused by: java.lang.AssertionError: Element: class org.jetbrains.kotlin.asJava.classes.KtUltraLightMethodForSourceDeclaration #kotlin  because: File language:Language: JAVA != Provider base language:Language: kotlin
invalidated at: no info

Attachments:

	at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:61)
	at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase$setUp$1.processError(KotlinLightCodeInsightFixtureTestCase.kt:84)
	at com.intellij.testFramework.TestLogger.error(TestLogger.java:40)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:170)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:442)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:423)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:422)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:398)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:164)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:218)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:396)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:174)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.intellij.psi.PsiInvalidElementAccessException: Element: class org.jetbrains.kotlin.asJava.classes.KtUltraLightMethodForSourceDeclaration #kotlin  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.PsiClassImplUtil$1.add(PsiClassImplUtil.java:380)
	at com.intellij.psi.scope.processor.FilterScopeProcessor.execute(FilterScopeProcessor.java:59)
	at com.intellij.psi.impl.PsiClassImplUtil.processDeclarationsInClassNotCached(PsiClassImplUtil.java:684)
	at com.intellij.psi.impl.PsiClassImplUtil.lambda$createMembersMap$2(PsiClassImplUtil.java:395)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:181)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:45)
	at com.intellij.psi.impl.PsiClassImplUtil$MembersMap.get(PsiClassImplUtil.java:357)
	at com.intellij.psi.impl.PsiClassImplUtil$MembersMap.access$000(PsiClassImplUtil.java:349)
	at com.intellij.psi.impl.PsiClassImplUtil.getMap(PsiClassImplUtil.java:207)
	at com.intellij.psi.impl.PsiClassImplUtil.findByMap(PsiClassImplUtil.java:153)
	at com.intellij.psi.impl.PsiClassImplUtil.findMethodsByName(PsiClassImplUtil.java:96)
	at com.intellij.psi.impl.source.ClassInnerStuffCache.findMethodsByName(ClassInnerStuffCache.java:67)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassBase.findMethodsByName(KtLightClassBase.kt:52)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getShortText(ChangeMethodSignatureFromUsageFix.java:94)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.isAvailable(ChangeMethodSignatureFromUsageFix.java:152)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.availableFor(ShowIntentionActionsHandler.java:127)
	at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapActionsTo(CachedIntentions.java:183)
	at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapAndUpdateActions(CachedIntentions.java:135)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:222)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:430)
	... 15 more
2019-07-18 22:10:20 +03:00
Nikolay Krasko
73356cbb4b Check self before complex equivalence check in light parameter 2019-07-18 22:10:20 +03:00
Nikolay Krasko
484c4ca268 Try to postpone activating decompiler from light element equivalence 2019-07-18 22:10:20 +03:00
Nikolay Krasko
9fd46c105d Reformat and cleanup in asJava/elements 2019-07-18 22:10:20 +03:00
Nikolay Krasko
353ca9752f Better validity check for kotlin light element
There're exceptions from `isWritable` method in light classes caused by
accessing invalid elements.

Override KtLightMemberImpl implementation to avoid activating
decompiler during validity check.
2019-07-18 22:10:20 +03:00
victor.petukhov
60c4eb68ff Add condition for checkNonParenthesizedAnnotationsOnFunctionalType call to except error reporting in stub mode 2019-07-18 17:34:51 +03:00
Igor Chevdar
4bad92d28c Fixed bug in LateinitLowering 2019-07-18 17:08:11 +03:00
Kirill Shmakov
407e5a5270 Use same models in MPP and CIDR 2019-07-18 15:02:17 +03:00
Stanislav Erokhin
2cc6bf31e0 Add link to license folder into README.md 2019-07-18 13:20:55 +03:00
Natalia Selezneva
a2d284c769 ScriptDefinitionsManager shouldn't be ready if definitions aren't initialized yet (KT-32554)
Otherwise this can lead to wrong script definition detection on project opening
^KT-32554 Fixed
2019-07-18 12:30:03 +03:00
Natalia Selezneva
e40cdef257 Scripts: pass script definition as parameter to loader (KT-32554)
This should avoid situation when script definition for file is changed between isApplicable and loadDependencies calls

^KT-32554 Fixed
2019-07-18 12:30:03 +03:00
Natalia Selezneva
763f1e8606 Scripts: check that file is non-script starting script compilation configuration update
Replace FileType check with more precise method isNonScript
2019-07-18 12:30:03 +03:00
Nikolay Krasko
c14f842aa0 Fix dependency between idea core environment and jdom 2019-07-17 23:50:32 +03:00
Nikolay Krasko
20fedb040f Update 192 branch to 2019.2 BETA2 (192.5728.12) 2019-07-17 23:50:32 +03:00
Nikolay Krasko
59c5bcc11c Fix Jsr305HighlightingTest in 192 - don't ask project for not initialized fixture 2019-07-17 23:50:32 +03:00
Nikolay Krasko
9e002b3ff8 Fix inability to instantiate UsefulTestCase because of JdomSerializer
Stack Trace
	  at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:184)
	  at com.intellij.configurationStore.XmlSerializer.<clinit>(xmlSerializer.kt:15)
	  at com.intellij.codeInsight.CodeInsightSettings.writeExternal(CodeInsightSettings.java:228)
	  at com.intellij.testFramework.UsefulTestCase.<clinit>(UsefulTestCase.java:104)
	  at com.intellij.testFramework.TestLoggerFactory.log(TestLoggerFactory.java:154)
	  at com.intellij.testFramework.TestLogger.info(TestLogger.java:70)
	  at org.jetbrains.kotlin.scripting.compiler.plugin.definitions.CliScriptDependenciesProvider.calculateRefinedConfiguration(CliScriptDependenciesProvider.kt:45)
	  ...
2019-07-17 23:50:32 +03:00
Alexander Udalov
5341de253f JVM IR: run FileClass & ExpectDeclarationsRemoving phases on whole module
Since we now generate file classes even for IR loaded from dependencies
(see 3a9b94235f) to simplify code in certain lowerings, it makes sense
to do that for all source files together before any meaningful
lowerings. The easiest way to do so is to make FileClassLowering a
module-wide phase.

ExpectDeclarationsRemoveLowering is now also a module-wide phase because
it needs to be run before FileClassLowering (to avoid producing empty
facades for files that only contain `expect` declarations)
2019-07-17 18:15:02 +02:00
Alexander Udalov
e867830eab JVM IR: inline JvmBackend, JvmCodegen 2019-07-17 18:15:02 +02:00
Alexander Udalov
9d639bc9a4 Minor, remove code duplication in WrappedDescriptors 2019-07-17 18:15:01 +02:00
Georgy Bronnikov
0423d0f41e JVM_IR: specify facadeClassGenerator properly in Psi2IrTranslator 2019-07-17 18:15:01 +02:00
Dmitriy Dolovov
1d3b1ed0cb CIDR: Filter aux library order entries that do not represent K/N libraries
Issue #KT-32726 Fixed
2019-07-17 22:37:42 +07:00
Dmitriy Dolovov
10b79816ab Always analyze KTS with JVM platform
Issue #KT-29953
2019-07-17 22:37:37 +07:00
Dmitriy Dolovov
80d2e2ac0d Make [Jvm|Js]IdePlatformKind and [Jvm|Js]IdePlatformKindTooling available in all IDEs
Issue #KT-29953 Fixed
2019-07-17 22:37:31 +07:00
Dmitriy Dolovov
f37c81f1be Dependency on K/N platform-deps is no more required in plugin.xml 2019-07-17 22:37:25 +07:00
victor.petukhov
7ee5583c89 Fix error message for non-parenthesized annotations on functional types 2019-07-17 17:02:46 +03:00
victor.petukhov
6a679d86ab Support non-parenthesized annotations on functional types without receiver
^KT-31734 Fixed
2019-07-17 16:18:15 +03:00
Vadim Brilyantov
60e3787800 Tests for Sealed Class move + Fix invalid move declaration test
MoveDeclarationToSeparateFile.testSealed test was threated to check that the intention is not applicable but it currently is.
2019-07-17 15:53:58 +03:00
Vadim Brilyantov
91d603292c #KT-27389 : Change JavaSourceRoot usages to Kotlin analogs 2019-07-17 15:53:58 +03:00
Vadim Brilyantov
895b49c0b9 Disable default search in comments and strings when renaming 2019-07-17 15:53:58 +03:00
Vadim Brilyantov
145a4b24ca #KT-29622: Support sealed classes with non-nested impls move 2019-07-17 15:53:57 +03:00
Vadim Brilyantov
a16551557c #KT-29622: Support sealed classes with nested impls move 2019-07-17 15:53:57 +03:00
Vyacheslav Gerasimov
a8e0dfabc7 Add -XX:+HeapDumpOnOutOfMemoryError for gradle in import tests
#KT-32643
2019-07-17 15:39:44 +03:00
Alexander Udalov
9595c815f1 JVM IR: invent names for SAM wrapper classes
Similarly to how it's done for callable references. This is needed for
IrTypeMapper to be able to correctly compute the name of the SAM wrapper
IrClass without resorting to the name of the underlying descriptor
(computed in CodegenAnnotatingVisitor)
2019-07-17 13:55:37 +02:00
Alexander Udalov
a15575d546 JVM IR: do not use KotlinTypeMapper in IrTypeMapper.mapType 2019-07-17 13:55:37 +02:00
Alexander Udalov
1e16c0a447 JVM IR: minimize public API of IrTypeMapper 2019-07-17 13:55:37 +02:00
Alexander Udalov
59ce76e9fd JVM IR: do not use misleading names for callable reference classes
The real JVM name is invented in InventNamesForLocalClasses and will be
used by the codegen when generating the actual class
2019-07-17 13:55:36 +02:00
Alexander Udalov
29fa1793d3 JVM IR: add InventNamesForLocalClasses pass 2019-07-17 13:55:36 +02:00
Alexander Udalov
529efff8cb IR: introduce IrAttributeContainer
This is useful to store data that must be kept when the element is
transformed, such as names of local/anonymous classes and
EnclosingMethod values on JVM which are computed before any lowerings.

For now, this is implemented very conservatively: the only field
`attributeOwnerId` which can be used in BackendContext implementation as
a key in the map
2019-07-17 13:55:36 +02:00
Alexander Udalov
d399144b80 Use TypeSystemCommonBackendContext in mapBuiltInType 2019-07-17 13:55:36 +02:00
Alexander Udalov
13bc5f0c47 Use TypeSystemCommonBackendContext in computeExpandedTypeForInlineClass 2019-07-17 13:55:36 +02:00
Alexander Udalov
c27d9c4546 Use TypeSystemCommonBackendContext in KotlinTypeMapper.writeGenericArguments 2019-07-17 13:55:36 +02:00
Alexander Udalov
2585ce0aa7 Introduce TypeSystemCommonBackendContext, use in KotlinTypeMapper.getVarianceForWildcard 2019-07-17 13:55:35 +02:00
Alexander Udalov
0460b2990f Use TypeSystemContext in KotlinTypeMapper.hasNothingInNonContravariantPosition
Thanks to this abstraction, this code will now easily work with
IrType-based TypeSystemContext implementation in the new IR type mapper
2019-07-17 13:55:35 +02:00
Alexander Udalov
1896537091 Minor, extract inline class type mapping to separate file 2019-07-17 13:55:35 +02:00
Alexander Udalov
bd8c09bfb5 JVM IR: move CollectionToArray creation to JvmSymbols
Also simplify it to use IR builder DSL
2019-07-17 13:55:35 +02:00
Alexander Udalov
15e0fd93bd Minor, rename IrBuiltIns.IrTypeMapper -> BuiltInIrTypePair
To avoid name clash with the new IrTypeMapper in JVM backend
2019-07-17 13:55:35 +02:00
Alexander Udalov
f9a1e582b2 Minor, somewhat simplify ClassCodegen construction 2019-07-17 13:55:35 +02:00
Alexander Udalov
edaff968ad Minor optimization in MutableList.transformFlat 2019-07-17 13:55:35 +02:00
Ilya Gorbunov
945e058586 Document return value of removeAll and retainAll with predicate
#KT-32532 Fixed
2019-07-17 14:27:26 +03:00
Dmitry Gridin
7d173ed385 GradleBuildScript: throw exception when trying to change level of language features to disable in multiplatform & fix tests 2019-07-17 12:55:12 +03:00
Dmitry Gridin
0d49ffa831 UpdateConfigurationQuickFixTest: update tests 2019-07-17 12:55:12 +03:00
Dmitry Gridin
cb432acfb7 BuildScriptManipulator: implement new syntax for enable experimental features in MPP
#KT-28295 Fixed
2019-07-17 12:55:12 +03:00
Dmitry Gridin
8887031962 GradleConfiguratorTest: fix configureJvmEAPWithBuildGradleKts test 2019-07-17 12:55:11 +03:00
Dmitry Gridin
46dfff7d82 KotlinBuildScriptManipulator: cleanup code 2019-07-17 12:55:11 +03:00
Dmitry Gridin
b1d1a4b2e1 FeatureSupportIntentionActionsFactory: add the missing branch else 2019-07-17 12:55:11 +03:00
Dmitry Petrov
28215186ca IR serialization: migrate to new generated Java classes structure 2019-07-17 12:00:34 +03:00
Dmitry Petrov
8baa7dfe22 Generated Java classes for Kotlin IR protobuf 2019-07-17 12:00:34 +03:00
Dmitry Petrov
2305bea2b5 Generate IR protobuf classes as multiple Java files
Otherwise KotlinIr.java becomes too big for IDEA to swallow in the
default configuration.
2019-07-17 12:00:34 +03:00
Dmitry Petrov
d6eee37481 GenerateProtoBuf: support java_multiple_files mode 2019-07-17 12:00:34 +03:00
Anton Yalyshev
19dfbfa42c Cleanup: make comments more informative 2019-07-17 10:58:57 +03:00
Anton Yalyshev
1cdcde86e3 Extract adding of sourceSets to subclass, cause superclass is also used in other wizards where this procedure breaks build.gradle
#KT-32105 Fixed
2019-07-17 10:58:39 +03:00
Anton Yalyshev
5b66063650 Add clarifications about single/multi targeting to framework descriptions 2019-07-17 10:58:13 +03:00
Anton Yalyshev
a864715cb8 Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed 2019-07-17 10:57:22 +03:00
Anton Yalyshev
9d6367a9be Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed 2019-07-17 10:57:04 +03:00
Mikhail Glukhikh
7ccf21c5c8 FIR resolve: fix vararg parameter types 2019-07-17 10:45:07 +03:00
Mikhail Glukhikh
592cf4f4e8 Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
08f44d4f14 FIR resolve: add early protection against cyclic property resolve 2019-07-17 10:45:06 +03:00
Simon Ogorodnik
1222449dc8 FIR resolve: perform inference completion for property access 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
99680a2ad7 FIR: refactor & simplify invoke resolve a bit 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
fff954ed3f FIR: skip extra non-valid groups during candidate resolve 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
b813f22cfe Extract part of utility FIR transformers into TransformUtils 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
0ac23eef93 Minor (FIR resolve): replace session with fileSession 2019-07-17 10:45:05 +03:00
Simon Ogorodnik
3da11cc85b Use no-op substitutor instead of substitutor with empty map 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
2d74dac4f2 FIR: set constructor parameter scope correctly for designated transformer 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
b8c3947827 Measure unresolved function call & qualified access # in FIR bench 2019-07-17 10:45:05 +03:00
Roman Artemev
af45e1c5dc [JS BE] Do not produce source mapping for fake KtElement
Fix [KT-26701], [KT-12935]
2019-07-17 10:21:34 +03:00
Anton Yalyshev
12736edfc1 Revert "Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed"
This reverts commit 6b3117cc
2019-07-16 18:10:49 +03:00
Anton Yalyshev
eb608770e7 Revert "Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed"
This reverts commit f742e000
2019-07-16 18:10:19 +03:00
Anton Yalyshev
067978e613 Revert "Add clarifications about single/multi targeting to framework descriptions"
This reverts commit 101a3a94
2019-07-16 18:09:47 +03:00
Dmitry Gridin
b1e371a2dd MPP: don't return Main modules from implementedModules for Test modules
#KT-28529 Fixed
#KT-30799 Fixed
2019-07-16 17:08:42 +03:00
Dmitry Gridin
60421c441e IDE: add warn on java files outside java source roots
#KT-28121 Fixed
2019-07-16 17:07:31 +03:00
Dmitry Gridin
4928f3ff57 CreateExpectedFix: fix KNPE from init block
#KT-32639 Fixed
2019-07-16 17:06:36 +03:00
Alexander Udalov
f38e4d618e Support Array::class literal, forbid Array<X>::class on non-JVM
#KT-31230 Fixed
2019-07-16 15:57:26 +02:00
Alexander Udalov
8103f0ba60 Fix compilation in AbstractAndroidBytecodeShapeTest.kt 2019-07-16 15:51:30 +02:00
Mikhael Bogdanov
496765f41e Support target templates in bytecode tests
Avoid test data duplication
2019-07-16 14:08:27 +02:00
Mark Punzalan
de1e27c584 Make all progression headers inclusive, and decrement last for
last-exclusive progressions (i.e., "until" progressions and loop over
array indices).

This change makes it possible to correctly implement the handling of
"step" progressions. Computing the last element of a stepped progression
requires that the last is inclusive.

Also invert the while loop (into if + do-while) that is used when
lowering for-loops over progressions that cannot overflow. This keeps
the performance characteristics closer to the ForLoopsLowering in
kotlin-native, since the goal is to converge to this shared version.

Also used IrType instead of KotlinType, where possible.

 https://github.com/JetBrains/kotlin/pull/2390
 https://github.com/JetBrains/kotlin/pull/2305
2019-07-16 14:08:21 +02:00
Vladimir Dolzhenko
39f6416757 Show progress on remove unused imports, KT-30748 2019-07-16 13:06:59 +02:00
Ilya Chernikov
cfab89385f Do not override path calculation in light virtual files in tests:
seems unnecessary anymore and breaks some script testing logic
2019-07-16 12:20:21 +02:00
Andrey Uskov
0c1d8e29b9 Fix creation of empty source sets in tests 2019-07-16 13:08:20 +03:00
Andrey Uskov
1336f65535 Improve diagnostics in importing tests and fix android test 2019-07-16 13:07:46 +03:00
Andrey Uskov
afd2af01cd NewMultiplatformProjectImportingTest - bunched 2019-07-16 13:06:53 +03:00
Jake Wharton
4386518c4d Add intrinsic for ULong/UInt.toString on Java 8+
Unfortunately this cannot currently be done for the extension overload which accepts a radix due to behavior difference with regard to invalid radix values.
2019-07-16 11:15:19 +02:00
Ilya Kirillov
b7917978b8 New J2K: correctly create AST for Java call of Kotlin data class derived members
#KT-32604 fixed
2019-07-16 11:56:08 +03:00
Ilya Kirillov
d29d7fb257 New J2K: do not resolve unary expressions method symbols
As we already have its type and may fail on unresolved declaration

#KT-32603 fixed
2019-07-16 11:55:04 +03:00
Ilya Kirillov
84872e064f New J2K: use test data for nj2k conversion tests from nj2k tests data instead of old one 2019-07-16 11:55:04 +03:00
Anton Yalyshev
101a3a9420 Add clarifications about single/multi targeting to framework descriptions 2019-07-16 11:04:52 +03:00
Anton Yalyshev
f742e000f8 Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed 2019-07-16 11:03:51 +03:00
Anton Yalyshev
6b3117cc2c Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed 2019-07-16 11:03:51 +03:00
Ilya Gorbunov
5e8192bf74 Make kotlin-test-js integration test tasks incremental
Define their inputs and outputs, so they are run only
when js files in build/node-modules change. These don't include external
libraries node-modules
2019-07-15 19:41:44 +03:00
Alexander Udalov
385366384c Psi2ir: ignore unresolved annotations
Note that the test is an exact copy of an existing test
missingDependencyNestedAnnotation, but with -Xuse-ir
2019-07-15 18:40:00 +02:00
scache
9062f4229b QuickDoc: Show sample code containing type parameters correctly
#KT-20777 Fixed
2019-07-15 19:36:24 +03:00
Ilya Chernikov
2ef575d94e Fix nullability in the instrumenter, avoid exceptions on tests setup 2019-07-15 16:37:06 +02:00
Ivan Gavrilovic
4caddd2c1c KT-31291: Wrap ASM version in a method to avoid having it inlined
This commit adds a method to get the value of org.jetbrains.org.objectweb.asm.Oopcodes.API_VERSION.
In general, this should not be a problem, but some Gradle plugins package
Jetbrains ASM version. At runtime, their version may be loaded which may be
different than the one this code was compiled against.
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
6619106af2 Improve incremental KAPT logging
This commit improves incremental KAPT logging. It reports processor
stats using their actual names. Also, warning is printed if incremental
annotation processing is requested, but not all APs are incremental
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
5cab6fd6cf KAPT: Mark incremental cache as LocalState
Use @LocalState to mark incremental annotation processing cache directory.
This is to make sure this is not stored in the build cache as it contains
absolute paths and cannot be shared between machines.
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
251d8ccd97 KT-31840: Fix caching for incremental annotation processing
Artifact transform that uses ASM to analyze KAPT classpath stored absolute
paths in the output artifact. This resulted in remote build cache misses.

This commit changes how analysis is stored. Actual analysis file is the
output of the transform, and there is not need to use a marker file any more.
Output does not store the classpath entry absolute path. Instead, it uses
task action incremental information to find analysis outputs that changed.

Additionally, class that handles analysis snapshot comparison has been
simplified, and lazy loading of the structural information is handled in
a more straightforward way.
2019-07-15 16:53:03 +09:00
Dmitry Petrov
6963424dfc psi2ir: Empty 'if' branches have type 'kotlin.Unit' 2019-07-15 08:58:04 +03:00
Mikhael Bogdanov
0774f800a0 Split android box tests by flavours 2019-07-15 07:31:35 +02:00
nikita.movshin
7c77565bb8 Add changelog for 1.3.41 2019-07-13 14:44:40 +03:00
Sergey Rostov
aee1dd2379 Gradle, test runner: fix failed test (typo) 2019-07-12 21:44:05 +03:00
Sergey Rostov
abb1a9892b Gradle, webpack: use only archivesBaseName as outputFileName 2019-07-12 21:40:26 +03:00
Sergey Rostov
6658c1da2f IDE, Wizards, JS for browser: create index.html in resources
For gradle build scripts only

#KT-31953
2019-07-12 21:40:26 +03:00
Ilya Gorbunov
4fc942c5e9 KT-16602: Improve mutable sorting samples, fix sample references 2019-07-12 21:34:54 +03:00
Dat Trieu
38d26b1d92 KT-16602: Provide samples for sorting API usage 2019-07-12 21:32:03 +03:00
keijumt
3f5d64e635 Add sample of hashMapOf 2019-07-12 17:10:15 +03:00
Igor Yakovlev
cd6abcd4c9 Expect modifier definitions is not exposed by UL-classes 2019-07-12 16:33:52 +03:00
Igor Yakovlev
0602a6da72 Fix invalid FakeJvmFieldConstant inspection for UL classes
Test MultiFileInspectionTestGenerated.testFakeJvmFieldConstant_FakeJvmFieldConstant now correctly works with ultra-light annotation classes.
2019-07-12 16:33:52 +03:00
Igor Yakovlev
a9aa60491e Fix UL-classes test renders and test data 2019-07-12 16:33:51 +03:00
Igor Yakovlev
4b1226e3d7 Set correct nullability and Companion support to annotations 2019-07-12 16:33:51 +03:00
Igor Yakovlev
eea469939e Kotlin meta-annotation converter for UL-annotations 2019-07-12 16:33:51 +03:00
Igor Yakovlev
afe784e79e Add UL-annotations support 2019-07-12 16:33:51 +03:00
Natalia Selezneva
4fed624942 Append for commit: switch ScriptReportSink to new scripting API
Commit hash e4d0c2cb0e
2019-07-12 16:24:57 +03:00
Natalia Selezneva
63767b4dca Performance: do not check file type for scripts with standard extension 2019-07-12 16:24:57 +03:00
Pavel Semyonov
2577dfa06a docs: added KDoc for Comparator, fixed KDoc for comparison binarySearch() 2019-07-12 16:08:37 +03:00
Alexander Gorshenev
09b3b2e5b7 Enable adroid_arm64 on mingw hosts 2019-07-12 16:06:32 +03:00
Dmitry Gridin
fc45948da6 CreateActualFix: should create source root directory if it doesn't exist
#KT-27555 Fixed
2019-07-12 15:51:30 +03:00
Dmitry Gridin
f310bd3324 RemoveRedundantQualifierNameInspection: apply on idea module 2019-07-12 15:51:12 +03:00
Dmitry Gridin
229b8cb6a3 RemoveRedundantQualifierNameInspection: shouldn't analysis import and package directives 2019-07-12 15:51:12 +03:00
Dmitry Gridin
694c231689 RemoveRedundantQualifierNameInspection: fix false negative for java constructor
#KT-32506 Fixed
2019-07-12 15:51:12 +03:00
Ilya Chernikov
bd50454a73 Change default for script displayName parameter to empty, generate name from base class in definition 2019-07-12 13:44:09 +03:00
Ilya Chernikov
0cc40440fb Implement filePathPattern in the script configuration with handling
also
- tests
- extending kdoc for the definitions
2019-07-12 13:44:09 +03:00
Sergey Rostov
dface77b5c NodeJS Test runner: update build time dependencies 2019-07-12 12:47:21 +03:00
Sergey Rostov
38ff228bc8 Gradle, Tests runner: handle case when test runtime exits abnormally
In this case we should close all test nodes with failures and gracefully
close all other enclosing nodes.

#KT-32136 Fixed
2019-07-12 12:31:09 +03:00
Abduqodiri Qurbonzoda
96dcafdf35 Document order of array elements initialization (KT-32353) 2019-07-11 21:18:47 +03:00
Sergey Igushkin
dfcd28da2c Use the direct test descriptor parent for test start events in Gradle
The reportingParent previously used for that purpose was null in test
start events, resulting in ungrouped tests.
2019-07-11 20:47:59 +03:00
Sergey Igushkin
f6679f27f4 Add test tasks to the Gradle model built for MPP
Add `testTasks` to KotlinTarget model class, build them
based on task names until proper test runs API is available.
2019-07-11 20:47:58 +03:00
Vyacheslav Gerasimov
9b32670738 Build: Use stripMetadata task for result jar when relocation is enabled
to cleanup invalid metadata left after relocation
2019-07-11 20:07:14 +03:00
Roman Artemev
efafb6585e [JS IR BE] Refactored js("...") function
- support object expression
 - do not wrap in function in statement-level position
 - support implicit return
 - code clean up
2019-07-11 18:00:28 +03:00
Roman Artemev
946bc75cda [JS IR BE] Code clean up
- Remove hacks for unbound symbols in TypeOperatorLowering
 - Replace hacker intrinsics with dynamic operations
 - Fix return type for `Object$create` intrinsic
2019-07-11 18:00:28 +03:00
Roman Artemev
f9336555da [IR] Remove code duplication in IrTypeCheckerContext 2019-07-11 18:00:28 +03:00
Ilya Chernikov
c08b88281c Remove accidetial usages of the internal jdk classes 2019-07-11 15:50:27 +02:00
Ilya Chernikov
1396b3e682 Return default configuration when refinement failed on resolving script descriptor
also fixes appropriate IDE tests
2019-07-11 15:50:27 +02:00
Ilya Chernikov
ab938efa68 Attempt to fix Windows detection in main-kts tests 2019-07-11 15:50:27 +02:00
Ilya Chernikov
382e55284c Fix legacy definitions error propagation
also fixes script-util test with resolving errors
2019-07-11 15:50:26 +02:00
Ilya Chernikov
10e19bccb1 Abort script evaluation if environment is created with errors
also fixes appropriate test
2019-07-11 15:50:26 +02:00
Ilya Chernikov
c9a4328feb Fix compiled scripts saving tests:
The tests were broken some time ago by applying script isolation, so
it was necessary to add base libraries into the classpath.
Also refactored some classpath building utilities.
2019-07-11 15:50:26 +02:00
Ilya Chernikov
9c004c3a52 Refactor scripting compiler plugin - move cli dependent parts out of the -impl jar
The kotlin-scripting-compiler-impl jar is used in the idea plugin and
therefore should not depend on the cli parts of the compiler to avoid
dependency from the plugin to the kotlin-compiler.jar.
Therefore the cli-dependent parts were moved to the scripting plugin
jar, which is used only in cli compiler based environments.
Also implement required abstractions to allow this movement and
drop some redundant dependencies to the cli parts in other projects.
2019-07-11 15:50:26 +02:00
Ilya Chernikov
9ae0ff03fa Improve script and REPL result handling:
- implement error result
- refactor other result classes
- implement handling in the script evaluation extension - also restores
  previous script error reporting functionality
- add possibility to customize result fileds in script and REPL
- refactor result calculation in the backend: cleanup, rename (since
  it is not only about REPL now)
2019-07-11 15:50:26 +02:00
Ilya Chernikov
dc4370ff08 Implement support for new script customizations in command line compiler
refactor and fix internals in many places to make it work
add appropriate tests for main-kts case
2019-07-11 15:50:25 +02:00
Ilya Chernikov
1ab255eafb Use kotlin home for automatic loading of the scripting plugin 2019-07-11 15:50:25 +02:00
Dmitry Petrov
6ea33986fa psi2ir: Provide substituted descriptor for property references 2019-07-11 15:32:43 +03:00
Igor Yakovlev
1968fd7fcb Remove check for files count for mirror elements set in light classes
It is workaround about intensive exception #EA-121413. There is no idea how to fix it fast but it is a try. In case of using UltraLight classes we hope not to
use old fashion light classes anymore soon. (Fixed #KT-28193)
2019-07-11 14:21:32 +03:00
Dmitry Gridin
e0c5f897fb KotlinGenerateToStringAction: should generate .contentToString instead java.util.Arrays.toString
#KT-27563 Fixed
2019-07-11 12:53:03 +03:00
Mikhail Glukhikh
43c6049f02 FIR2IR: set origin correctly for synthetic property accesses 2019-07-11 12:46:48 +03:00
Mikhail Glukhikh
c6a09dba4e FIR: consider Java default constructors as primary ones 2019-07-11 12:40:29 +03:00
Mikhail Glukhikh
2ceffa241b FIR: make Java default constructor visibility same with class visibility 2019-07-11 12:38:53 +03:00
Mikhail Glukhikh
14bbbb5bf5 FIR: add test for synthetic property access 2019-07-11 12:37:45 +03:00
Mikhail Glukhikh
c35d7eab70 Refactor FIR symbols to make them and their FIR element types more clear
This commit also fixes work with Java synthetic properties
2019-07-11 12:37:32 +03:00
Sergey Igushkin
701b9ce166 (minor) Minor corrections in K/A/30GradleIT#testOmittedStdlibVersion 2019-07-11 02:04:58 +03:00
technoir
15feeddc46 Allow omitting version of standard artifacts when kotlin-android plugin is used 2019-07-11 01:44:52 +03:00
Sergey Igushkin
0aa80d1912 Fix org.jetbrains.kotlin.native.disabledTargets registered as extension
Do not register an extension, use an extra property instead. This way,
it is less visible for a build author.

Hotfix for commit c292380aff
Issue #KT-29693
2019-07-10 21:12:23 +03:00
Sergey Igushkin
26a8c16166 Fix Gradle task input annotations for Gradle 5.5 checks
* Interface and abstract properties are now checked, too.
  For them, copy the @Input/@Internal annotations from the
  implementations (luckily, they were all consistent).

* Annotating a private property without a public accessor is not not
  allowed. Remove one such annotation.
2019-07-10 21:06:57 +03:00
Nikolay Krasko
e804b58f5f Fix getting logger factory in 182 2019-07-10 20:38:13 +03:00
Sergey Igushkin
4516902aaf Fix metadata transformation for non-published dependencies, KT-32225
Fix dependencies that are added in non-published source sets, which were
omitted from the requested dependencies since their configurations were
not added to the extendsFrom set of the merged configurations.

Also, don't resolve both merged configurations (compile and runtime) in
GranularMetadataTransformation, as the IDE can anyway import only the
compile-scoped dependencies from api & implementation.

Issue #KT-32225 Fixed
2019-07-10 19:37:03 +03:00
Sergey Igushkin
dbc8007c63 Fix visibility for MPP dependencies from non-root source sets, KT-32204
Fix incorrect source sets visibility when a dependency is added to a
non-root source set and its visible source sets are mistakenly treated
as already visible by the dependsOn parents and are thus not extracted
from the metadata package.

To simplify the logic, reuse the GranularMetadataTransformation
instances from the dependsOn parent source sets: they can provide the
requested dependencies sets for the parents and their transformation
results, so that excluding the dependency source sets which are seen
the parents gets simpler.

The issue is then fixed by naturally excluding only the source sets
which are mentioned in the parents' transformation results.

Issue #KT-32204 Fixed
2019-07-10 19:36:57 +03:00
Nikolay Krasko
0da55e8284 Unregister custom logger after use in AbstractGradleMultiplatformWizardTest 2019-07-10 17:52:29 +03:00
Max Medvedev
5d35bebacd Keyword completion: use proper prefix matcher for keyword completion
fixes #KT-32519
2019-07-10 15:54:44 +03:00
Mikhail Glukhikh
ee37a0aa9f Inline callable: keep all usages inside annotation entries
#KT-24596 Fixed
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
eb00af6b96 CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
NB: only classes / function / properties annotations are considered here,
not including local declarations and other annotations
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
b24b8bfb28 BindingContextUtils: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
b97f187cf6 ControlFlowInformationProvider: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5e94f537ef Refactoring: use isUsedAsExpression instead of USED_AS_EXPRESSION slice 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5afa5de1d7 ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
615aa265f5 Inline: do more precise check before adding this@Labeled #KT-30762 Fixed 2019-07-10 15:10:51 +03:00
Dmitry Gridin
6605e0dfc0 Update test 'moveMultipleFIlesWithImplicitPrefix' 2019-07-10 14:09:37 +03:00
Dmitry Gridin
d2b8535548 Move/copy refactoring: add base support of implicit package prefix
#KT-29720 Fixed
2019-07-10 14:09:37 +03:00
Dmitry Gridin
7c547d8c5a Minor: clean up copy refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
1a9abaeb2a Clean up move refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
beba1d82fc ReplaceJavaStaticMethodWithKotlinAnalogInspection: add CommentSaver for case with transform to extension 2019-07-10 14:09:37 +03:00
Dmitry Gridin
56d2961cd9 ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more tests 2019-07-10 14:09:37 +03:00
Dmitry Gridin
82bf21f195 ReplaceJavaStaticMethodWithKotlinAnalogInspection: rename isApplicable(call, context) to isApplicableInContext 2019-07-10 14:09:37 +03:00
Dmitry Gridin
71c0b3caa0 ReplaceJavaStaticMethodWithKotlinAnalogInspection: clean up comments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8314dbffd5 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null arguments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8b8858b223 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null receiver 2019-07-10 14:09:36 +03:00
Dmitry Gridin
d47a7234bb ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module 2019-07-10 14:09:36 +03:00
Dmitry Gridin
026949a758 ReplaceJavaStaticMethodWithKotlinAnalogInspection: remove non-implemented cases 2019-07-10 14:09:36 +03:00
Dmitry Gridin
632158cd52 ReplaceJavaStaticMethodWithKotlinAnalogInspection: simplify Transform for default action 2019-07-10 14:09:36 +03:00
Dmitry Gridin
3aa2401f19 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transform interface
#KT-32454 Fixed
2019-07-10 14:09:36 +03:00
Dmitry Gridin
835532c206 ReplaceJavaStaticMethodWithKotlinAnalogInspection: move to move to inspections.jdk2k subpackage 2019-07-10 14:09:36 +03:00
Dmitry Gridin
b2a60795da ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more cases for Arrays
#KT-32512 Fixed
#KT-30124 Fixed
2019-07-10 14:09:35 +03:00
Dmitry Gridin
24caca1882 ReplaceJavaStaticMethodWithKotlinAnalogInspection: fix false positive for 'Arrays.copyOf'
#KT-32477
2019-07-10 14:09:35 +03:00
Sergey Rostov
4a8dbeda1b Gradle, webpack: add conventional archive properties
#KT-31890 Fixed
#KT-32209 Fixed
2019-07-10 13:26:56 +03:00
Sergey Rostov
b6ca323a5e Gradle, karma, webpack: add required dependencies 2019-07-10 13:26:55 +03:00
Sergey Rostov
8b622955fe Gradle, js, minor: fix typos, formatting and imports 2019-07-10 13:26:55 +03:00
Sergey Rostov
b68582656e Gradle, DtsResolver: use canonical path to avoid files duplication 2019-07-10 13:26:55 +03:00
Sergey Rostov
80068c0a40 Gradle, js: fix task annotations 2019-07-10 13:26:55 +03:00
Sergey Rostov
3c606c27a1 Gradle, js: support generating kotlin external declarations from .d.ts
#KT-31703 Fixed
2019-07-10 13:26:55 +03:00
Sergey Rostov
2fb4d23f1e Gradle, js, KotlinProjectNpmResolution: index by compilation 2019-07-10 13:26:54 +03:00
Sergey Rostov
7332290ece Gradle, js, NpmDependency: getDependenciesRecursively 2019-07-10 13:26:54 +03:00
Sergey Rostov
50e07330f4 Gradle, js, resolver, requireInstalled: close resolving if kotlinNpmResolve is up-to-date 2019-07-10 13:26:54 +03:00
Sergey Rostov
1860097c08 Gradle, js, npm resolver: support custom package json entries, index files and extensions 2019-07-10 13:26:54 +03:00
Sergey Rostov
88fa396d26 Gradle, js, resolver: don't skip reading lock file while skipping package manager execution 2019-07-10 13:26:54 +03:00
Sergey Rostov
d1789b07ad Gradle, js, yarn: store resolved version and integrity hash to NpmDependency 2019-07-10 13:26:54 +03:00
Sergey Rostov
d051748e2b Gradle, js, npm: support scopes 2019-07-10 13:26:54 +03:00
Sergey Rostov
5e6c76a6e7 Gradle, execWithProgress: report description as first progress 2019-07-10 13:26:53 +03:00
Sergey Rostov
638554ba1c Gradle, JS, resolver: don't add files that are not existed, add kjsm files 2019-07-10 13:26:53 +03:00
Sergey Rostov
bcf894aba3 Gradle, JS, resolver: return null if npm dependency being resolved before kotlinNpmInstall 2019-07-10 13:26:53 +03:00
Sergey Rostov
8b0dffe182 Gradle, JS, compilation resolver: close dependent compilation resolver when it's packageJson task is up-to-date 2019-07-10 13:26:53 +03:00
Sergey Rostov
3658ad785f Gradle, JS, NpmResolutionManager: cleanup and document states 2019-07-10 13:26:53 +03:00
Sergey Rostov
327d75dc5d Gradle, JS: Extract NpmResolutionManager 2019-07-10 13:26:53 +03:00
Sergey Rostov
982f08ce7a Gradle, JS: replace NodeJs plugin and extension with NpmResolver plugin 2019-07-10 13:26:52 +03:00
Sergey Rostov
2f90742809 Gradle, JS: rework nodejs extensions and plugins
Get rid of Project.nodeJs
2019-07-10 13:26:52 +03:00
Sergey Rostov
24f08a614e Gradle, GradleNodeModulesCache: use new ProcessedFilesCache API 2019-07-10 13:26:52 +03:00
Sergey Rostov
fd2d99e205 Gradle, ProcessedFilesCache: use file as target type (not string)
recompute removed target directories
2019-07-10 13:26:52 +03:00
Sergey Rostov
9679403831 Gradle, ProcessedFilesCache: optimize serialization
JSON kept for debugability
2019-07-10 13:26:52 +03:00
Sergey Rostov
dff48b251d Gradle, JS: rework extension registering and resolver phasing
This allows to resolve projects lazily.

#KT-32393 Fixed
#KT-31565
#KT-32015
#KT-31917
2019-07-10 13:26:52 +03:00
Sergey Rostov
f4dcc18baf Gradle, JS: rework NpmResolver
Now resolving works per compilation, so transitive dependency between
 compilations in same project can be resolved (KT-31917).

Resolving gradle configurations now occurs in separate
per-project `KotlinPackageJsonTask`s. Global install called in
`KotlinNpmInstallTask`. Tasks inputs configured, so tasks now
reported as UP-TO-DATE if nothing was changed.

#KT-31565 Fixed
#KT-32015 Fixed
#KT-31917 Fixed
2019-07-10 13:26:51 +03:00
Ilya Kirillov
196e3f968e New J2K: fix generating nj2k tests bunch files 2019-07-10 13:21:53 +03:00
Ilya Kirillov
cabc26184b New J2K: convert single Java static import statements 2019-07-10 13:19:23 +03:00
Ilya Kirillov
b18350e9c8 New J2K: fix ExceptionInInitializerError in JKJavaPrimitiveTypeImpl 2019-07-10 13:19:23 +03:00
Ilya Kirillov
f0dd21790a New J2K: add plain text copy-paste conversion test for new J2K 2019-07-10 13:18:36 +03:00
Ilya Kirillov
041677ab1b New J2K: force use old j2k for all not file/copy-paste conversions 2019-07-10 13:16:54 +03:00
Ilya Kirillov
8f69cca2b3 New J2K: enable new J2K by default 2019-07-10 13:16:53 +03:00
Ilya Kirillov
ba3927b580 New J2K: add default null value to property with type parameter type when it is implicit in Java
#KT-32436 fixed
2019-07-10 13:16:53 +03:00
Ilya Kirillov
9d6338afb2 New J2K: do not fail conversion if some of post-processings throws exception 2019-07-10 13:16:53 +03:00
Ilya Kirillov
a9865e5d7b New J2K: check for element validity before applying fix in diagnostic-based post processings 2019-07-10 13:16:53 +03:00
Ilya Kirillov
236f62be2a New J2K, minor: refactor code builder 2019-07-10 13:16:52 +03:00
Ilya Kirillov
934425e86a New J2K: rearrange and optimize some post-processings 2019-07-10 13:16:52 +03:00
Ilya Kirillov
370f113b78 New J2K: run add/remove modifiers post-processings only single time && do not call resolve in them for some corner cases 2019-07-10 13:16:52 +03:00
Ilya Kirillov
3e04bfb156 New J2K: do not print modifiers which are going to be removed in postprocessing 2019-07-10 13:16:52 +03:00
Natalia Selezneva
0b7b16162d 182: scripts, pass File finding script definition instead of File.name 2019-07-10 12:05:17 +03:00
Roman Artemev
6ab46204cb [JS IR BE] Properly handle primary constructors
- force primary constructor to be created by codegen
 - make sure initializer is invoked once in primary constructor
 - make one of coroutine constructor primary
 - remove hack from codegen
2019-07-10 10:39:11 +03:00
Roman Artemev
a112345418 [JS IR BE] Fix builtin constructor lowering
- Do not touch delegation construction call
2019-07-10 10:39:11 +03:00
Roman Artemev
131158df65 [JS IR BE] Refact MultipleCatchLowering
- catch dynamic type instead of common super type over all catch blocks
2019-07-10 10:39:11 +03:00
Roman Artemev
1605dc3251 [JS IR BE] Remove unused classifier symbol from IrTypeOperatorCall builder 2019-07-10 10:39:10 +03:00
Nicolay Mitropolsky
69c4db82d4 Uast: IdeaKotlinUastResolveProviderService analyze as BodyResolveMode.PARTIAL_WITH_CFA
it is required for `isUsedAsResultOfLambda` in `KotlinULambdaExpression`
2019-07-10 10:33:10 +03:00
Dmitry Gridin
fda5692fc6 RemoveCurlyBracesFromTemplateInspection: add heuristic to change severity
Change severity to INFORMATION if a variable hasn't whitespace around & add an option to return the old behavior
 #KT-31717 Fixed
2019-07-10 10:28:45 +03:00
Natalia Selezneva
e4d0c2cb0e Scripts: switch ScriptReportSink to new scripting API
Use ScriptDiagnostic instead of ScripReport
2019-07-10 10:10:21 +03:00
Natalia Selezneva
bd0f947222 Refactor script reports: introduce getter, check that report are changed inside attach method 2019-07-10 10:10:21 +03:00
Natalia Selezneva
68b45ce1dc FromFileAttributeScriptDependenciesLoader should be applicable when there are scriptCompilationConfiguration file attribute 2019-07-10 10:10:20 +03:00
Natalia Selezneva
923e89db69 Provide toString method for ScriptCompilationConfigurationWrapper
This is needed for debug and logging proposes
2019-07-10 10:10:20 +03:00
Natalia Selezneva
7215e03a47 Scripts: rewrite search without usage of legacy script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
4853190752 Scratch: should always have default script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
b0c9339dee Scripts: search for script definition using PsiFile instead of file name 2019-07-10 10:10:07 +03:00
Natalia Selezneva
fbe965be9d Scripts: pass File finding script definition instead of File.name 2019-07-10 10:08:19 +03:00
Vladimir Dolzhenko
ac4df86fa6 Fix performance test compilation 2019-07-10 09:44:11 +03:00
Andrey Uskov
9da630a1ac Fix compilation of KotlinMPPGradleProjectResolver in bunch 192 2019-07-10 02:07:37 +03:00
Vladimir Dolzhenko
3c41db654a Fix performance test compilation for 192 2019-07-09 20:49:21 +03:00
Ilya Gorbunov
7d14fb756d Make Duration storageUnit inline val to avoid state initialization
Avoid state initialization in JS and Native
2019-07-09 20:39:28 +03:00
Alexander Udalov
f7fc5d2ffa Fix codegen for JvmOverloads with more than 32 parameters
Use DefaultCallArgs to handle mask list construction correctly

 #KT-31070 Fixed
2019-07-09 19:31:59 +02:00
Andrey Uskov
40633768bc Implement dependency deduplication in order to reduce memory
consumption during import process
2019-07-09 20:14:07 +03:00
Andrey Uskov
09c2b2800c Migrate collections to arrays for memory optimisation
during import process
2019-07-09 20:13:44 +03:00
Andrey Uskov
f6f072693a Fully disable editing target platforms for HMPP modules. Show
java target platform version in Facets
2019-07-09 20:13:17 +03:00
Andrey Uskov
c98ad923bd Import list of pure kotlin source roots from gradle
in facet settings for inspections
#KT-32300 Fixed
2019-07-09 20:12:55 +03:00
Andrey Uskov
2665fff373 Import package prefix from MPP projects 2019-07-09 20:12:13 +03:00
Andrey Uskov
2b6f566d58 Import package prefix from gradle
#KT-19693 Fixed
2019-07-09 20:11:48 +03:00
Vladimir Dolzhenko
dbec626a49 Fix performance test compilation for 182 2019-07-09 19:43:18 +03:00
Vyacheslav Gerasimov
ffb65b2655 Build: Fix kotlinBuildProperties, should always proguard on teamcity 2019-07-09 19:19:58 +03:00
Vyacheslav Gerasimov
8605ad6630 Build: Upgrade gradle to 5.5 2019-07-09 19:19:27 +03:00
Alexander Udalov
a6be6f4986 Use Class.forName instead of ClassLoader.loadClass in reflection
This fixes an issue in constructing annotation instances with array
class elements. For some reason, behavior of `ClassLoader.loadClass`
differs from `Class.forName` in handling arrays, namely:

* `loadClass("[Ltest.Foo;")` returns null
* `Class.forName("[Ltest.Foo;")` returns class for array of test.Foo

Overall, there doesn't seem to be any way to load an array class with
`CLassLoader.loadClass`.

We pass initialize=false to forName because this is the behavior of
ClassLoader.loadClass: it doesn't perform class initialization (e.g.
<clinit> is not executed).

 #KT-31318 Fixed
2019-07-09 18:14:45 +02:00
Vladimir Dolzhenko
72d74ff888 Add build gradle kts performance tests 2019-07-09 17:27:33 +03:00
Sergey Igushkin
c292380aff Improve Kotlin/Native disabled targets warning, KT-29693
* Group all disabled targets from all subprojects in a single warning
* Make the warning optional, suggest disabling it with a Gradle property

Issue #KT-29693 Fixed
2019-07-09 16:01:18 +03:00
Alexander Udalov
dabb7bb496 Fix new inference CLI tests on Windows 2019-07-09 11:52:54 +02:00
Mikhael Bogdanov
b82c32a807 Use default target for android tests 2019-07-09 09:46:34 +02:00
Roman Artemev
d4fb76c1da [JS IR BE] Fix overriding property of Throwable 2019-07-09 10:40:01 +03:00
Roman Artemev
d9c6d38715 [JS IR BE] Fix private members lowering
- visit over file instead of class
2019-07-09 10:40:01 +03:00
Ilya Gorbunov
7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
Ilya Gorbunov
686bcb830e Bit query and bit rotation functions for UInt, ULong, UShort, UByte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
39bdf34b9f Use common implementation of fastLog2 based on countLeadingZeroBits 2019-07-08 19:09:32 +03:00
Ilya Gorbunov
f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
32fc131d62 Rename jvm actuals from Numbers to NumbersJVM
Rename multifile facade to from MathKt to NumbersKt to avoid confusion
with kotlin.math.MathKt
2019-07-08 19:09:32 +03:00
Steven Schäfer
da8fb3a195 JVM_IR: Respect -Xno-param-assertions 2019-07-08 17:48:33 +02:00
Steven Schäfer
dd20b74030 Split GenerateNotNullAssertionsTests into standard box and bytecode tests 2019-07-08 17:48:33 +02:00
Simon Ogorodnik
dfd0042a5b Do not create single element list if only one candidate 2019-07-08 16:59:50 +03:00
Mikhail Glukhikh
f434248cb7 FIR property getter: take return type from property even if it's error 2019-07-08 16:59:45 +03:00
Mikhail Glukhikh
d96c66adac FIR: partially implement invoke resolution 2019-07-08 16:59:37 +03:00
Toshiaki Kameyama
2ca0056cd0 ReplaceGuardClause inspection: check contracts availability 2019-07-08 16:36:19 +03:00
Toshiaki Kameyama
8cbcb66197 ReplaceGuardClause inspection: don't report when argument is not String 2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
90b0ea73dc Add inspection for check/require/checkNotNull/requireNotNull
#KT-30640 Fixed
#KT-22412 Fixed
2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
64780293d3 "Redundant visibility modifier" inspection: don't report for property getter
#KT-32347 Fixed
2019-07-08 16:14:35 +03:00
Ilya Chernikov
a96a938f87 Fix creating of the script definition from legacy template
adding classpath needed to load template and related class to the
appropriate host configuration
fixes tests
2019-07-08 13:20:06 +02:00
Dmitry Gridin
d3810bfcae Add operator modifier by inspection on idea module 2019-07-08 13:03:22 +03:00
Dmitry Gridin
795dcfa8ff Minor: clean up some quickfixes & refactorings 2019-07-08 13:03:22 +03:00
Yan Zhulanow
9ba7907b81 Fix compatibility issues with third-party plugins
This commit fixes compatibility with these plugins:
1. com.wuhao.code.check:1.4.5
2. net.lagerwey.cucumber-kotlin:1.1.1
3. cat.helm.clean:0.1.1-SNAPSHOT
4. no.tornado.tornadofx.idea:1.7.17.2
5. com.gmail.blueboxware.libgdxplugin:1.20
2019-07-08 16:25:20 +09:00
Yan Zhulanow
36e1149e51 Light classes: Fix getTextOffset() and getTextRange() for property accessors
Before this commit, getTextOffset() and getTextRange() coming from the super class, returned numbers for the property, not for its accessor. This commit fixes the inconsistency.
2019-07-08 16:25:20 +09:00
Yan Zhulanow
7078302e6c Light classes: Fix getTextOffset() for identifiers
Before this commit, getTextOffset() and getTextRange() implementations were inconsistent.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
0f4085066f Debugger: Do not assume we are inside the class body when in '}' (KT-15259) 2019-07-08 16:25:19 +09:00
Yan Zhulanow
a8efb349ed Debugger, minor: Remove debugger labels in dispatch receivers
In anonymous classes/lambdas the debug name becomes something like 'this@<anonymous>' that doesn't make much sense to the user.
It's more correct to show just 'this'.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
8f20f0b963 Debugger: Do not calculate default source file if an alternative one is available 2019-07-08 16:25:19 +09:00
Yan Zhulanow
d45bbaabcd Debugger: Fix missing NOPs in optimized Unit.INSTANCE calls (KT-31702) 2019-07-08 16:25:19 +09:00
Ivan Gavrilovic
f60bf5cb97 KT-31127: register only generated Java sources to AGP
When adding generated Java sources to AGP using Variant API,
add only Java sources. This was already done in
a6ae4494167c9d4cca23995457c59fb2daedad39 for Java projects, and this
commit fixes the same issue for Android projects.

Test: Kapt3Android33IT.testKotlinProcessorUsingFiler
2019-07-08 16:25:18 +09:00
Jiaxiang Chen
2c102ecd57 Replicate old backend's naming logic for captured receiver parameter and extension receiver parameters.
Context for determine if a value parameter is captured from outer
context is not directly available after lowering, hence introduce a new
IrDeclarationOrigin for captured receiver parameter to avoid duplicate
calculation.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
9760c156a4 Debugger: Fix breakpoints on if/loops with constant conditions (KT-14421) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6fc801afd2 Debugger: Make calls to LocalVariableProxyImpl.type lazy
Avoid unnecessary calls to getType() in variables and fields.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
91565076e2 Debugger: Fix property accessor evaluation in scripts (KT-23526) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6686ed2e38 Evaluator: Do not report parsing error on empty block/expression (KT-11938) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6d7d524b9b Debugger: Fix 'expect fun' evaluation from common code (KT-26742) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
873f4a1b08 Debugger: Accept empty code fragment contexts (KT-19556) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
188ed82081 Debugger: Handle closure receivers came from outer callables properly (KT-31709) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
577f32740e Debugger: Fix isDumb contract in evaluator (KT-31510) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
c2f0286183 Debugger: Prefer the closest captured values 2019-07-08 16:25:17 +09:00
Yan Zhulanow
4fe6431b0f Debugger: Disable value rendering in watches by default (KT-19084) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
0f3d85716c Debugger: Fix test, synthetic this variable is now hidden in Kotlin variables mode 2019-07-08 16:25:16 +09:00
Yan Zhulanow
1eab78124a Debugger: Fix private member priority test 2019-07-08 16:25:16 +09:00
Yan Zhulanow
54f78a2920 Debugger: Remove debugger-related hacks in resolution
Candidate ordering should be the same in ordinary Kotlin code and in evaluated expressions.
With the invention of 'foo_field' syntax, there is no need to do these nasty things any more.
2019-07-08 16:25:16 +09:00
Yan Zhulanow
b4f515a436 Debugger: Support Kotlin variables for inlined lambdas inside inline functions (KT-31418) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
afa0bec6f6 Debugger: Change the inline depth calculation heuristics, fix debugging for inlined lambdas (KT-30919) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
9c9d2b5ad4 Minor: Rename constant to match its meaning 2019-07-08 16:25:16 +09:00
Yan Zhulanow
5777592024 Debugger: Support captured values (KT-30740) 2019-07-08 16:25:15 +09:00
Yan Zhulanow
f16459df32 Pill: Support 'runtimeOnly' dependency configuration 2019-07-08 16:25:15 +09:00
Mikhail Zarechenskiy
6eefea6715 Add tests for obsolete issues
#KT-32395 Obsolete (fixed in 42a5c488)
 #KT-32388 Obsolete (fixed in f3e4c9cd)
 #KT-32271 Obsolete (fixed in 60a0cf1)
2019-07-06 10:06:04 +03:00
Svyatoslav Kuzmich
675f01ee80 [JS IR BE] Set Throwable subtype name in extendThrowable function 2019-07-05 19:31:23 +03:00
Leonid Startsev
4379780ff8 Fixed extra argument in function call after rebase 2019-07-05 18:48:51 +03:00
Leonid Startsev
80ddac64e0 Add serializers for primitive arrays to default types list 2019-07-05 18:14:34 +03:00
Ilya Chernikov
cfceeb1e8c Implement direct bindings to script properties mapping in the JSR-223 implementation
fix infrastructure and codegen parts
2019-07-05 17:02:10 +02:00
Ilya Chernikov
4940f64265 Refactor scripting infrastructure - convert usages to the new entities 2019-07-05 17:02:10 +02:00
Ilya Chernikov
80ada5113e Fix flaky test 2019-07-05 17:02:10 +02:00
Alexander Udalov
37002748c8 Do not wrap and display cause's message in compiler exceptions
In case the wrapped exception message contains some long text (bytecode,
IR, etc.), it could be displayed several times in the same stack trace,
which significantly worsened the experience of parsing such stack traces
2019-07-05 15:55:01 +02:00
Dmitry Gridin
430aed6559 Minor: clean up code 2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
1f89c0f730 "Convert to sealed class" intention: don't suggest when no "class" keyword
#KT-32365 Fixed
2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
9786564d75 "Remove argument name" intention: remove array literal brackets for annotation vararg argument
#KT-32318 Fixed
2019-07-05 19:18:40 +07:00
Juan Chen
d33d1913cb Not throw exception when cidr has been registered already
This is to avoid failures from some Android Studio tests depending on cidr.
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
9f6e88d571 Formatter: format around safe cast operator as? (KT-32324)
#KT-32324 Fixed
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
44e9090931 Formatter: format between type reference and 'by' keyword (KT-32277)
#KT-32277 Fixed
2019-07-05 12:57:47 +03:00
Nikolay Krasko
0b8f35c04d Revert "Register mock injection language manager in compiler"
This reverts commit 674badc6

Since idea 192.5587.17 idea has own InjectedLanguageManager registration
and fails because of duplicate.

org.junit.ComparisonFailure: exception: org.picocontainer.defaults.DuplicateComponentKeyRegistrationException: Key com.intellij.lang.injection.InjectedLanguageManager duplicated
	at com.intellij.util.pico.DefaultPicoContainer.registerComponent(DefaultPicoContainer.java:123)
	at com.intellij.util.pico.DefaultPicoContainer.registerComponentInstance(DefaultPicoContainer.java:331)
	at com.intellij.mock.MockComponentManager.registerService(MockComponentManager.java:89)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerJavaPsiFacade(KotlinCoreEnvironment.kt:162)
	at com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:55)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:27)
	...
2019-07-05 09:08:15 +03:00
Dmitry Gridin
f9b53da0fa Attempt to fix some inspection tests 2019-07-05 13:02:52 +07:00
Roman Artemev
8a569cc698 [JS IR BE] Do not create $default stub for external function and any its fake override 2019-07-04 22:59:12 +03:00
Roman Artemev
28a108a205 [JS IR BE] Visit callable reference members in private member lowering 2019-07-04 22:59:12 +03:00
Roman Artemev
b4c68025a7 [JS IR BE] Improve error reporting 2019-07-04 22:59:12 +03:00
Vyacheslav Karpukhin
940c9e5604 192: build against IDEA 192.5587.17 2019-07-04 20:23:58 +02:00
Svyatoslav Kuzmich
a2625c7bc8 [JS IR BE] Don't render null messages in Throwable
Set message property to 'undefined' to make Error.prototype.toString
skip it
2019-07-04 18:33:23 +03:00
Svyatoslav Kuzmich
94aebd0101 [JS IR BE] Proper support for String and Any constructors
Remove workarounds from codegen
2019-07-04 17:03:47 +03:00
Roman Artemev
d7cb3e05ef [JS IR BE] Replace 32bit default String.hashcode with 64bit cityhash for UniqID
Split uniqID space into two part 63 bit each.
2019-07-04 12:49:30 +03:00
Dmitry Gridin
46eb929bd1 ControlFlowWithEmptyBodyInspection: shouldn't report on while with comments
#KT-32419 Fixed
2019-07-04 16:33:24 +07:00
Nikolay Krasko
6e750b0857 Enable API watcher in Kotlin
When Api Watcher plugin is installed this will activates pre-commit
checks in the project.
2019-07-04 11:54:22 +03:00
Nikolay Krasko
ef90353831 Another test-runtime java plugin dependency 2019-07-04 11:54:22 +03:00
Nicolay Mitropolsky
5d081efe60 Uast: tests for no implicit returns in lambdas (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky
a180d78eaf Uast: implicit returns for local function bodies (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky
f85ebe7f43 Uast: implicit returns for lambda expressions (KT-32370) 2019-07-04 10:53:48 +03:00
Svyatoslav Kuzmich
631a09e541 [JS IR BE] ThrowableLowering: Use dynamic operators instead of jsSetJSField intrinsic 2019-07-03 20:37:49 +03:00
Svyatoslav Kuzmich
871180cdc0 [JS IR BE] Fix setting names of Throwable subclasses without primary constructor 2019-07-03 20:37:49 +03:00
Svyatoslav Kuzmich
918d470e1b [JS IR BE] Simplify throwable lowering.
- Make kotlin.Throwable class extenral
- Add runtime function 'extendThrowable' to use instead of delegating
  constructors to Throwable
2019-07-03 20:37:48 +03:00
Svyatoslav Kuzmich
6d1f893a5a [JS IR BE] Move object instance creation lowerings to IR 2019-07-03 20:37:48 +03:00
Svyatoslav Kuzmich
5dcb0ee016 [JS IR BE] Reduce JsScope usage in codegen 2019-07-03 20:37:48 +03:00
Jeffrey van Gogh
a9c8fd903b reduce calls to Object.hashCode originating from LabelNormailizationMethodTransformer
Building on the work in #2403, shaves 1% of compilation time on kotlinx.serialization
by using SmartIdentityTable instead of hashMap in LabelNormailizationMethodTransformer.

Metrics on the prior hashMap use in this code:

| What      | Count |
| --------- | ----- |
| instances | 21530 |
| min       | 0     |
| max       | 174   |
| mean      | 4     |
| stddev    | 8.24  |
| median    | 4     |
| 90p       | 8     |
| 95p       | 15    |
2019-07-03 19:25:57 +02:00
Alexander Udalov
361c468c33 IR: move type utilities from IrTypeUtils.kt to irTypePredicates.kt
Multiple IrType extensions were incorrectly calling isNameInPackage
which actually checked if the name of the type's classifier _starts_
with the given string, not equals it. Move them to irTypePredicates,
which seems a more natural place for these extensions anyway. Move
isKClassArray to JVM backend utilities, since this is JVM-specific
behavior at the moment. Fix minor warnings/inspections
2019-07-03 19:10:03 +02:00
Alexey Tsvetkov
7c6f48df39 Revert "Set sourceCompatibility and targetCompatibility for JavaCompile tasks"
This reverts commit 290aded9
2019-07-03 12:47:36 +03:00
Alexey Tsvetkov
2a3bb2968e Revert "Call configureJvmProject once per project in afterEvaluate"
This reverts commit 33de71f7
2019-07-03 12:47:23 +03:00
Alexey Tsvetkov
ab6174defd Revert "Check JDK env vars once during configuration when not syncing"
This reverts commit 48b86bba
2019-07-03 12:47:10 +03:00
Alexey Tsvetkov
aa7aff84fc Revert "Do not fork java compile tasks when current JDK can be used"
This reverts commit f2021b58
2019-07-03 12:46:50 +03:00
Alexey Tsvetkov
9340bffd02 Revert "Add ext.jvmTarget and ext.javaHome to core:descriptors.runtime"
This reverts commit 35dea296fa.
2019-07-03 12:40:02 +03:00
Andrey Uskov
1a290621b0 Minor. Update multiplatform kotlin plugin version in HMPP tests 2019-07-03 11:49:04 +03:00
Andrey Uskov
e079615cdf Add possibility to edit target platform for non-HMPP projects in order to keep ability to edit target platform for IDEA-based projects 2019-07-02 22:46:48 +03:00
Andrey Uskov
efb0e692ae Minor. Reformat KotlinFacetEditorGeneralTab 2019-07-02 22:46:47 +03:00
Andrey Uskov
9fc60be9d8 Fix serialization of facet settings in order to read properly
settings of native platforms
2019-07-02 22:46:47 +03:00
Andrey Uskov
404ce1a8c1 Facet serialization changed in order to keep compatibility with previous
versions of Kotlin plugin
2019-07-02 22:46:46 +03:00
Andrey Uskov
87e75bd4cc HMPP: fix importing target platforms for case when JVM targets are involved 2019-07-02 22:46:45 +03:00
Andrey Uskov
8445e3a2a4 HMPP: add importing tests 2019-07-02 22:46:45 +03:00
Andrey Uskov
8280c647af HMPP: Migration of source root types for middle HMPP source sets fixed 2019-07-02 22:41:49 +03:00
Andrey Uskov
90187c959e Add test for 'isHMPP' flag 2019-07-02 22:41:02 +03:00
Andrey Uskov
e791b9d3f7 HMPP: import flag indicating that the project uses HMPP feature 2019-07-02 22:40:19 +03:00
Alexey Tsvetkov
35dea296fa Add ext.jvmTarget and ext.javaHome to core:descriptors.runtime
After the following changes:
* 290aded94f
* 33de71f792

default values of jvmTarget and javaHome started to overwrite properties
set through compileJava in core:descriptors.runtime
2019-07-02 17:37:59 +03:00
Vyacheslav Gerasimov
d3f9d0866a Build: Improve cache redirector usage in buildSrc settings.gradle 2019-07-02 17:30:06 +03:00
Nikolay Krasko
8b05d4df46 More NoClassDefFoundError fixes in tests after 192 update 2019-07-02 16:45:42 +03:00
Ilya Matveev
ba64600ee5 Gradle: Make K/N properties uniform with other Kotlin properties
Names of project properties used by K/N (e.g.
org.jetbrains.kotlin.native.home) are not uniform
with other kotlin properties (e.g. kotlin.coroutines).

This patch renames these properties by dropping the
'org.jetbrains' prefix and adds corresponding
deprecation warnings.

Issue #KT-32302 Fixed
2019-07-02 19:46:50 +07:00
Ilya Matveev
fd1fc7d28a Gradle: Support K/N restricted distribution
Restricted distribution is a K/N distribution built for MacOS only
alongside with a regular distribution and containing no platform
libraries for MacOS. This commit allows switching between
distribution types using a special project property.

Issue #KT-32301 Fixed
2019-07-02 19:46:49 +07:00
Ilya Matveev
35d7fff035 Gradle: Fix input annotation for the Webpack task 2019-07-02 19:46:48 +07:00
Alexey Tsvetkov
f2021b580e Do not fork java compile tasks when current JDK can be used
I see the following improvements:
* `clean dist --parallel` is ~10% faster (from 3:40 to 3:20)
* incremental `dist --parallel` is ~50% faster
(adding public method to org.jetbrains.kotlin.utils.SmartList)
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
48b86bba69 Check JDK env vars once during configuration when not syncing
Previous code (callback in `beforeTask`) was added to allow
opening project without setting up all env. variables.
This change simplifies the code and avoids a callback,
while keeping the ability to open the project without
setting up all variables by checking `kotlinBuildProperties.isInIdeaSync`
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
33de71f792 Call configureJvmProject once per project in afterEvaluate
Calling it twice does not seem to make sense now
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
290aded94f Set sourceCompatibility and targetCompatibility for JavaCompile tasks
Currently running build with JAVA_HOME pointing to
any JDK != 1.8 results in errors like

    #KT-30382 Fixed
2019-07-02 15:18:19 +03:00
Anton Bannykh
f8035096ea JS: lock tape version to avoid kotlin.test + tape integration test failure 2019-07-02 15:14:07 +03:00
Mikhail Zarechenskiy
60ac2056bd Update diagnostic message in test data
Follow-up of 42a5c488: function `unCapture` is used to render
 diagnostic messages, therefore we have this change now
2019-07-02 14:02:07 +03:00
Nikolay Krasko
a67c3ef855 Update 183 branch to 183.6156.11 2019-07-02 14:00:26 +03:00
Nikolay Krasko
2d85d18a74 Minor: add more exceptions to project dictionary 2019-07-02 14:00:25 +03:00
Nikolay Krasko
28a45909a0 Fix compatibility with 192 branch (KT-32364) 2019-07-02 14:00:24 +03:00
Nikolay Krasko
ba2ca5ae3c Fallback to simple oocb when per-language trackers are disabled (KT-32364) 2019-07-02 14:00:11 +03:00
Nikolay Krasko
f605d4e73b Revise per module out-of-code-block (KT-32364) 2019-07-02 13:59:35 +03:00
Nikolay Krasko
73eea6f4b6 Minor: rename file before refactoring 2019-07-02 13:59:21 +03:00
Nikolay Krasko
4f678c8289 Create project service with Kotlin trackers (KT-32364) 2019-07-02 13:59:19 +03:00
Nikolay Krasko
263d8eea16 Use Kotlin oocb instead of platform oocb tracker (KT-32364) 2019-07-02 13:59:06 +03:00
Nikolay Krasko
557ea54a9f Introduce Kotlin specific out-of-code-block tracker (KT-32364) 2019-07-02 13:59:04 +03:00
Nikolay Krasko
12bb1a5bd1 Make invalidateOnOOCB explicit in ResolverForProjectImpl and remove usage in tests 2019-07-02 13:45:35 +03:00
Nikolay Krasko
b32b362810 Extract KotlinModuleModificationTracker to separate file 2019-07-02 13:45:35 +03:00
Nikolay Krasko
26c7eddb03 Move trackers to caches.trackers package 2019-07-02 13:45:35 +03:00
Nikolay Krasko
2ddcd9f0af Minor: cleanup and reformat KotlinCodeBlockModificationListener.kt 2019-07-02 13:45:35 +03:00
Vladimir Dolzhenko
2029d16062 Add add-imports performance tests
Add missed auto generated perf tests
2019-07-02 09:58:04 +03:00
Dmitry Gridin
57a732c247 Minor: fixes after review 2019-07-02 11:54:38 +07:00
Dmitry Gridin
9316f45a5c Optimize Imports: improve tooltip information
#KT-21374 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
074829bcea Import: IDE should import class from root package
#KT-21422 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
148eed2a12 ShortenReferences: fix false negative for object call chain
#KT-32320 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
33914a3a94 ImportMemberIntention: make more flexible based on caret position
#KT-31924 Fixed
2019-07-02 11:54:38 +07:00
Dmitriy Dolovov
6f2f60869c Minor: Don't create unnecessary PluginId instances
(to avoid PluginId cache pollution)
2019-07-02 10:49:43 +07:00
Anton Bannykh
208c8f9339 JS: fix bootstrap 2019-07-01 20:22:05 +03:00
Svyatoslav Kuzmich
69962cbf8c [JS IR BE] Add JsExport annotations 2019-07-01 18:55:41 +03:00
Svyatoslav Kuzmich
685597d20a [JS IR BE] Codegen class model refactorings
Reduce JsScope usage
2019-07-01 18:55:41 +03:00
Steven Schäfer
e7a5e5b4a0 JVM_IR: Handle annotation KClass fields in external declarations 2019-07-01 16:16:23 +02:00
Steven Schäfer
1ab0b76af3 Minor: use more descriptive argument name 2019-07-01 15:49:12 +02:00
Steven Schäfer
078ccbf077 JVM_IR: Implement name mangling exceptions for Result class. 2019-07-01 15:49:12 +02:00
Steven Schäfer
d458e4a7b2 JVM_IR: Enable inlining for external declarations with inline class parameters. 2019-07-01 15:49:12 +02:00
Natalia Selezneva
da86ef8454 Fix tests for long command line: create folder instead of file
Compiler doesn't allow files as classpath roots
2019-07-01 16:41:56 +03:00
Natalia Selezneva
30222582f4 Scratch tests: print test output at onFinish to avoid multiple calls of invokeLater
Multiple calls of invokeLater significantly affects test speed
2019-07-01 16:41:56 +03:00
Natalia Selezneva
85f07927c9 Minor: check output with errors in scratch tests 2019-07-01 16:41:55 +03:00
Natalia Selezneva
784cc17d21 Do not use deprecated UIUtil.invokeLaterIfNeeded. Use TransactionGuard instead 2019-07-01 16:41:55 +03:00
Natalia Selezneva
63246f57d2 Scripts: drop sdk caches on project root change event
Otherwise old invalid roots may be saved
2019-07-01 16:41:55 +03:00
Natalia Selezneva
d981135c4b Scratch: finish execution if no new lines was executed
^KT-32062
2019-07-01 16:41:55 +03:00
Leonid Startsev
7ef9fb5511 Export deserialization constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/443
2019-07-01 14:56:10 +03:00
Mark Punzalan
969478481e Move extension receiver to value parameters for static functions created
during InlineClassLowering phase.

This was the only place where both dispatch and extension receivers were
NOT moved to value parameters, which meant that the receivers were not
following the conventional ordering.

Merged createStaticBodilessMethod with createStaticFunctionWithReceivers
and the latter was moved to backend/common/ir/IrUtils.kt.
2019-07-01 13:24:08 +02:00
Mark Punzalan
1abdf0561a Generate synthetic functions for local functions with default values, by
re-ordering the lowering phases.

The changes in InterfaceLowering are necessary so that IrElements that
target the removed functions are re-targeted to the new functions in
DefaultImpls. This affects local functions in interface functions since
now LocalDeclarationsLowering comes before InterfaceLowering.
2019-07-01 13:24:08 +02:00
Vyacheslav Gerasimov
d2f1852c5e Build: Upgrade gradle to 5.4.1 2019-07-01 14:14:55 +03:00
Alexey Tsvetkov
ffa191d91d Fix filling Main-Class attribute in manifest file of output jar
Before 5b7cee6221 JVM CLI compiler
was calling `KotlinToJVMBytecodeCompiler.compileBunchOfSources`.
`compileBunchOfSources` detected possible main classes,
and filled the Main-Class attribute in output jar
if if there was only one candidate.

After the change JVM CLI began calling
`KotlinToJVMBytecodeCompiler.compileModules`, which was not searching for a main class.

This change adds searching for main classes to `compileModules`.
We search for a main class only when one module is compiled,
and an output is written a jar file (so the change only affects JVM CLI compilation).

    #KT-32272 Fixed
2019-07-01 13:57:04 +03:00
Mikhail Zarechenskiy
515e666733 [NI] Fix exception on incomplete try/catch block
There was an inconsistency on creating PSI call and corresponding
 descriptor. See variable `catchBlocks` from visitor, it's created
 only if PSI elements are not null, but for descriptor parameters
 there wasn't such check

 #KT-32134 Fixed
 #EA-139748 Fixed
2019-07-01 12:59:37 +03:00
Mikhail Zarechenskiy
42a5c488c1 [NI] Fix OnlyInputTypes annotation support for top-level captured types
#KT-32157 Fixed
 #KT-32116 Fixed
 #KT-32235 Fixed
 #KT-32218 Fixed
2019-07-01 12:59:35 +03:00
Mikhail Zarechenskiy
c2cf4aa2b5 [NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature
 will be disabled to reduce difference between new and old inference,
 but if new inference is enabled in the compiler, then this feature
 will be enabled too to preserve behavior of new inference for
 compilation

 #KT-32175 Fixed
 #KT-32143 Fixed
 #KT-32123 Fixed
 #KT-32230 Fixed
2019-07-01 12:53:33 +03:00
Mikhael Bogdanov
4d82b02f83 Properly set parent inside copied bodies 2019-07-01 07:56:32 +02:00
Toshiaki Kameyama
3a77b63c85 Completion: don't propose the same name for arguments of lambda (KT-9792)
#KT-9792 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
c442d69db6 Extend selection: select just KDoc if cursor is just before the KDoc (KT-16476)
#KT-16476 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
8afa938723 Extend selection: select escaped identifier name without backticks (KT-31499)
#KT-31499 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
9b04af9968 Complete statment for function call: fix wrong right parenthesis place (KT-31595)
#KT-31595 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
bd661fcf82 Method sepatators: separate single-expression functions (KT-30782)
#KT-30782 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
ade51588f9 Insert paired brackets: insert space after right brace of nested lambda (KT-28098)
#KT-28098 Fixed
2019-06-29 20:36:54 +03:00
Toshiaki Kameyama
49d6bbbd6b Quick doc: fix missing line break for enum constant (KT-30985)
#KT-30985 Fixed
2019-06-29 20:36:54 +03:00
Georgy Bronnikov
f332aff4ce Mute back tests that still fail 2019-06-28 19:44:04 +03:00
Georgy Bronnikov
3a9b94235f JVM_IR: generate facade classes for imported toplevel declarations 2019-06-28 17:34:49 +03:00
Sergey Rostov
bb0f467f63 Gradle, JS: don't project.getTasksByName inside task realization callback
Or project evaluation would be called

#KT-32072 Fixed
2019-06-28 15:28:21 +03:00
Anton Bannykh
fadeac083f JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed) 2019-06-28 13:49:22 +03:00
Anton Yalyshev
d972d50296 small fix of FUS J2K merge conflict 2019-06-28 12:32:17 +03:00
Ilya Kirillov
01c866632d New J2K: add FUS statistics for J2K conversions 2019-06-28 12:32:17 +03:00
Anton Yalyshev
cf885789ff created FUS Group for J2K 2019-06-28 12:32:16 +03:00
Vladimir Dolzhenko
ccfe155f58 Add highlight and completion performance tests 2019-06-28 10:37:29 +02:00
Vyacheslav Gerasimov
4531d2a7b4 Build: restore service files relocation for kotlin-reflect 2019-06-27 19:51:58 +03:00
Igor Chevdar
e8ac22e238 Fixed some IR tests on enums 2019-06-27 19:04:01 +03:00
Igor Chevdar
1e8f7c2b7d Removed IrCallWithShallowCopy 2019-06-27 19:04:01 +03:00
Igor Chevdar
5a01ad799e [Serializer] Bumped ABI version 2019-06-27 19:04:00 +03:00
Igor Chevdar
dff0ac8866 [Serializer] UniqId clashes handling 2019-06-27 19:04:00 +03:00
Igor Chevdar
b62e9487d1 Fixes in IrValidator 2019-06-27 19:04:00 +03:00
Igor Chevdar
595a549188 [IR] Fixes related to IR validation 2019-06-27 19:04:00 +03:00
Igor Chevdar
175dfb41b6 [IrSerializer] Supported all annotations + refactoring 2019-06-27 19:04:00 +03:00
Vyacheslav Gerasimov
bdcf674c79 Build: Remove dependency on missing task :kotlin-main-kts:dist 2019-06-27 18:33:51 +03:00
Sergey Rostov
59411e1a28 Build: flags for comparing gradle and jps 2019-06-27 17:56:52 +03:00
Sergey Rostov
f35680e823 Build: cleanup stdlib/jps-build/build.gradle.kts 2019-06-27 17:56:52 +03:00
Sergey Rostov
6647d8fd93 Build: remove mergeServiceFiles from reflectShadowJar 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
2d6a3cb2c8 Build: Introduce flag for disabling jar post processing
proguard, relocation, etc.
2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
6e20e03cbc Build: Reuse archive from project build logic for building jars 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
ec157a43ba Build: Add jar-resources directory to kotlin-main-kts 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
22bbbeb1ec Build: Fix manifest for kotlin-compiler in jps build
Trigger manifest generation from jar task during jps import
2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
fc68bb46dc Build: Move compiler.xml extensions to cli-common 2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
e49cd527bc Build: Remove version from libraries copied to lib of ide plugin 2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
373a250b28 Build: Exclude common stdlib only from dist/lib contents configurations 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
e7ba9e5e4e Build: Fix kotlin-daemon-client-new compile classpath for jps build 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
0e7de4df41 Build: Fix embedded configuration import in jps build
Should affect only test configurations
2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
ca37cb0028 Build: Remove jps hacks from kotlin-main-kts-test 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
7864c40bb1 Build: Force child projects evaluation while importing jps 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
947783833f Minor: Cleanup jps.gradle.kts 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
286b9f5233 Build: Add jps artifact for kotlinc 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
c76138c55c Build: Drop obsolete jps artifact generation 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
db8a4a52da Build: Add JPS artifact for kotlin-compiler.jar
JPS build assumes fat jar is built from embedded configuration,
but we can't use it in gradle build in :prepare:compiler project
since slightly more complex processing is required like stripping
metadata & services from some jars
2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
64f2298703 Build: Extract jarContentsFromConfiguration dsl helper 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
31c3955940 Build: Add workaround dist root artifact referencing auto-generated dist
We can't set output-path and build-on-make from idea-ext plugin
2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
72be81ba46 Build: Add JPS artifact for dist 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
86ad25ba55 Build: Add jps artifact for kotlin-reflect 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
3138757d66 Build: Add jps artifact for kotlin-compiler-client-embeddable 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
7149fc75f5 Build: Add jps artifact for kotlin-main-kts 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
1f795882c4 Build: Extract kotlin-plugin.jar to separate jps artifact 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
5c72fed918 Build: Add jps artifact for kotlin-imports-compiler-dumper 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
9b7a5e87d1 Build: Include project main source set output in jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
d24c56e08d Build: Add jps artifact for kotlin-daemon-client.jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
12b4cf3f0e Build: Add jps artifact for kotlin-jps-plugin.jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
55b1ee9a17 Build: Fix premature configuration resolution in kotlin-test-js-it 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
62126d0e43 Build: Fix idea plugin dependencies for JPS build
we interpret embedded configuration as runtime in JPS and need to exclude embedded jars while copying libs
2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
12ba0efd19 Build: Use embedded configuration in kotlin-compiler-client-embeddable 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
6cf5514f6e Build: Fix jps import for jvm-abi-gen plugin 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
4f090f2744 Build: Use default jar task in kotlin-daemon-client 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
a10a261894 Build: Workaround wrong import of transitive libraries in Idea 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
bbfa2646fd Minor: Cleanup :prepare:compiler build script 2019-06-27 17:56:47 +03:00
Alexander Udalov
3800d57691 Fix behavior of multiple methods in IrTypeSystemContext
Make sure implementations are the same as in ClassicTypeSystemContext
and ConeTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
445c4ebe65 Do not inherit IrTypeSystemContext from TypeSystemInferenceExtensionContext
This inheritance was not used. Moreover, multiple methods were
implemented incorrectly and/or inconsistently with the base
implementation at ClassicTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
cf6ff8c6b3 Simplify implementation of TypeSystemCommonSuperTypesContext.typeDepth 2019-06-27 16:43:07 +02:00
Alexander Udalov
331f0291ce Minor, remove TypeSystemContext.isNotNullNothing
Use equivalent isNothing instead
2019-06-27 16:43:07 +02:00
Alexander Udalov
c452934f5b Pull isNullableType and related extensions up into TypeSystemContext 2019-06-27 16:43:07 +02:00
Alexander Udalov
9131ff3626 Move IrType.isNullable to 'ir.tree' 2019-06-27 16:43:06 +02:00
Alexander Udalov
29a144cee7 Minor, move IrClass.primaryConstructor to 'ir.tree' 2019-06-27 16:43:06 +02:00
Ilmir Usmanov
0a37cb561b Minor. Regenerate IrBlackBoxInlineCodegenTestGenerated 2019-06-27 17:02:22 +03:00
Nikolay Krasko
78aaf62734 Disable internal plugin bunch check if separate plugin is installed 2019-06-27 16:03:39 +03:00
Igor Yakovlev
a1462407f9 Avoid to change singleton test project descriptor
#KT-32276
2019-06-27 16:01:50 +03:00
Leonid Startsev
a3218da1c3 Add IDE diagnostic on @Serializable classes for non-applied serialization plugin 2019-06-27 15:55:38 +03:00
Toshiaki Kameyama
fb94cb141f Add "Add constructor parameter" quick fix for NO_VALUE_FOR_PARAMETER
#KT-27353 Fixed
2019-06-27 19:19:25 +07:00
Alexander Gorshenev
aa73420312 Provide the default hashing function 2019-06-27 13:56:25 +03:00
Igor Yakovlev
8b40005b0c UL classes flaky tests partially fix
#KT-32276 - Reduce affected tests count from 117 cases to 2 cases
2019-06-27 12:46:02 +03:00
Ilya Chernikov
5fe85e4767 Attempt to fix flaky testSimpleRepl 2019-06-27 10:42:16 +02:00
Mikhael Bogdanov
9b6fef005f Simplify LocalDeclarationsLowering, support declaration pop up via separate lower
1. Scheme of capturing local variables not touched
 2. Lowered local functions are transposed to the nearest class (including local) or file
 3. Local classes are also transpose to the nearest class (including local) or file
2019-06-27 08:07:01 +02:00
Mikhael Bogdanov
bb48e756ca Minor. Simplify and clean IrElementVisitorVoidWithContext/IrElementTransformerVoidWithContext 2019-06-27 08:06:59 +02:00
Ilya Gorbunov
d58c8c68d5 Fix replacement for deprecated Math.pow #KT-32083 2019-06-27 05:22:25 +03:00
AJ Alt
ed96197d6b Always use LF line endings in generated stdlib code
The code generation uses a mixture of literal `\n` characters and `appendln`. The latter insert `\r\n` on Windows by default, causing generated files to contain a mixture of line endings.

This commit sets the `line.separator` system property for the generator to `\n` so that `appendln` will never insert `\r` characters. As an additional measure, `.gitattributes` files were added to checkout generated stdlib files always with LF line endings.
2019-06-27 03:02:10 +03:00
Ilmir Usmanov
7a096b305f Do not mangle functions with inline classes when the only inline class
in arguments is kotlin.Result.
Fix returnTarget for suspend function views.
2019-06-26 22:28:08 +03:00
Vladimir Dolzhenko
4ac324a939 Fix performanceTests compilation errors on 182 2019-06-26 20:13:21 +02:00
Ilya Kirillov
3926be900d New J2K: remove accidentally added println call in conversions 2019-06-26 18:36:05 +03:00
Ilya Kirillov
0dfaae2bb4 New J2K: add some tests from obsolete issues 2019-06-26 18:36:05 +03:00
Ilya Kirillov
98be5d8ed0 New J2K: add copy-paste tests for new j2k 2019-06-26 18:36:05 +03:00
Ilya Kirillov
dc469cbdbf New J2K: remove incorrect modifiers in post processing 2019-06-26 18:36:05 +03:00
Ilya Kirillov
3beef2b22e New J2K: do not apply diagnostic based inspections if target element is not in the converting range 2019-06-26 18:36:05 +03:00
Ilya Kirillov
1b681a7dd6 New J2K: correctly handle empty range marker in post processings 2019-06-26 18:36:05 +03:00
Igor Yakovlev
d7f28d9e19 Fix flaky tests for incorrect language version recognition
(UltraLightFacadeClassTestGenerated.testCoroutines and UltraLightClassLoadingTestGenerated.testCoroutines tests)
2019-06-26 16:32:24 +03:00
Igor Yakovlev
4c1d0678eb Remove class delegate requests from annotations and modifier lists
(#EA-144876 and #EA-144882 Fixed)
2019-06-26 16:32:24 +03:00
Igor Yakovlev
3146b12471 Fix UL inline class delegate loading for tooComplex case (#KT-31950 Fixed) 2019-06-26 16:32:24 +03:00
Sergey Igushkin
685f56e179 Fix slow AndroidSubPlugin#getCommonResDirectories, KT-29538
Replace a functionally-built file collection that filters files against
multiple original file collections upon each evaluation with a
lazy file sets intersection that is evaluated only once.

Issue #KT-29538 Fixed
2019-06-26 16:18:08 +03:00
Dmitry Petrov
991c87b9c2 Minor: remove empty JvmCoercionToUnitPatcher.kt 2019-06-26 16:16:04 +03:00
Nikolay Krasko
b7c12014ee Modify dependencies for 192 branch: more dependencies to full java plugin 2019-06-26 14:11:23 +03:00
Ilya Chernikov
6ea1d92841 Implement main-kts test with command-line compiler 2019-06-26 13:01:40 +02:00
Ilya Chernikov
432d500c40 Fix custom script definition cashing and script validity check:
- reorder initialization logic, so that script definitions are
  requested only after plugins loading
- clear definitions cache after adding explicit definitions or sources

#KT-32206 fixed
#KT-32169 fixed

Note: any of these modification fix the problem alone, but the second
may prevent other similar problems, while the first fixes actual logic
of the script validity checks as well.
2019-06-26 13:01:39 +02:00
Ilya Chernikov
1b8cd9b731 Implement command-line REPL smoke test 2019-06-26 13:01:39 +02:00
Ilya Chernikov
3c1c9ca523 Fix jline proguarding in the compiler: fixes cli REPL
#KT-32085 fixed
2019-06-26 13:01:39 +02:00
Natalia Selezneva
b3e08c0b61 Minor: remove debug code 2019-06-26 13:47:34 +03:00
Natalia Selezneva
b503b29c51 Report exception from script definition loading to third party plugin if it's present 2019-06-26 13:47:34 +03:00
Natalia Selezneva
2fce671d0d Scripts, AsyncScripDependenciesLoader: notifyRootsChanged should return false in case when no dependencies are loaded 2019-06-26 13:47:33 +03:00
Natalia Selezneva
be82979a49 Add dot before file extension at Scripting Settings Tab 2019-06-26 13:47:33 +03:00
Natalia Selezneva
cccc17b139 Fix compatibility for 'com.centurylink.mdw.studio' plugin 2019-06-26 13:47:33 +03:00
Natalia Selezneva
08e599ea5b Scripts: show notification only when compilation configuration is changed 2019-06-26 13:47:32 +03:00
Natalia Selezneva
fa2b9b11d6 Check classpath jars before applying script compilation result from file attributes
^KT-32061 Fixed
2019-06-26 13:47:32 +03:00
Anton Bannykh
d6c10d24e1 JS IR: move inliner to common part; inline suspendCoroutineUninterceptedOrReturnJS 2019-06-26 13:13:39 +03:00
Toshiaki Kameyama
e3c9134904 Add "Convert to notNull delegate" quick fix for INAPPLICABLE_LATEINIT_MODIFIER
#KT-12515 Fixed
2019-06-26 17:07:32 +07:00
Dmitry Petrov
b3b7e26985 Make InsertImplicitCasts work with Descriptors and KotlinTypes again
This is a temporary change to make sure IrType infrastructure work is in
master.

It causes some of irText tests to work incorrectly (as in master).
2019-06-26 10:07:13 +03:00
Dmitry Petrov
8da5f6b955 IR: fixes after rebase 2019-06-26 09:39:17 +03:00
Dmitry Petrov
339291b01f psi2ir: update testData 2019-06-26 09:39:16 +03:00
Dmitry Petrov
7a44b0f951 IR: IrTypeOperatorCall.classifierSymbol can be computed from typeOperand 2019-06-26 09:39:16 +03:00
Dmitry Petrov
18c3778250 Minor: cleanup IrLazyProperty 2019-06-26 09:39:16 +03:00
Dmitry Petrov
1b5d077452 Minor: explicitly throw exception if declaration parent is not set 2019-06-26 09:39:16 +03:00
Dmitry Petrov
8e7ae3a996 Minor: IrTypeCheckerContext.removeExactAnnotation 2019-06-26 09:39:16 +03:00
Roman Artemev
6a82ffdc5e [JS IR BE] Make tests work 2019-06-26 09:39:16 +03:00
Dmitry Petrov
760806a1ac IR: IMPLICIT_DYNAMIC_CAST
Generate IMPLICIT_DYNAMIC_CAST for implicit casts from `dynamic` to `T`
2019-06-26 09:39:16 +03:00
Dmitry Petrov
422c13bd03 IR: add docs for IrTypeOperator's 2019-06-26 09:39:16 +03:00
Dmitry Petrov
1d9cb39915 psi2ir: fix nullability assertion generation for platform types
Incorporate PR from Steven Schäfer into IrType-based implicit cast
insertion (commit 17b925636e8717e7648c5d7b792c6ab4d18f776d).

NB this still uses originalKotlinType to determine if the type was
nullability flexible. It is somewhat error-prone and something we want
to get rid of. However, it boils down to some design questions related
to implicit null checks in Kotlin - e.g., it might be Ok to just treat
nullability flexible type `T!` as `T?` in IR, generate null checks for
all usages of type `T?` where a non-null type is expected, and later
eliminate the null checks that are redundant according to the (quite
conservative) criterion in the redundant null check elimination.
2019-06-26 09:39:16 +03:00
Dmitry Petrov
ab38430ded psi2ir: irText/.../types: NI vs OI 2019-06-26 09:39:15 +03:00
Dmitry Petrov
38ad56fb78 psi2ir: Update testData for intersection type tests
Actually, IrType-based InsertImplicitCasts provides proper casts here.
2019-06-26 09:39:15 +03:00
Dmitry Petrov
3fa671943c psi2ir: coerce SAM conversion arguments to corresponding function types
Given an expression with SAM conversion, e.g.:
```
  fun test(a: Any?) {
    if (a is () -> Unit) {
      Runnable(a).run()
    }
  }
```
Here `Runnable(a)` expects `a` to be a value of functional type
`() -> Unit` (and corresponding type check makes smart cast possible).

Relation between `Runnable` and `() -> Unit` is somewhat non-trivial,
is implemented in terms of KotlinTypes and DeclarationDescriptors,
and so should be encapsulated in psi2ir if possible.
Thus, psi2ir generates IR such as
```
TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION ...
  TYPE_OP type=kotlin.Function0<kotlin.Unit> origin=IMPLICIT_CAST ...
    [| a |]
```
and InsertImplicitCasts knows that IMPLICIT_CAST actually might be
unnecessary (which also allows to use InsertImplicitCasts in some other
context that might require IMPLICIT_CAST rewriting, such as inlining).
2019-06-26 09:39:15 +03:00
Roman Artemev
332b191546 Fix ir type substitutor 2019-06-26 09:39:15 +03:00
Roman Artemev
7ac3f56a43 Fix InsertImplicitCasts to test isSubtypeOf 2019-06-26 09:39:15 +03:00
Roman Artemev
0c74eef500 Implement IrType context 2019-06-26 09:39:15 +03:00
Roman Artemev
3fc1419d01 [IR] Implement TypeChecker context and full isSubtypeOf/commonSuperType for IrType 2019-06-26 09:39:15 +03:00
Roman Artemev
b7d098af56 [IR] Implement captureFromArguments for IrType 2019-06-26 09:39:15 +03:00
Roman Artemev
d4e561baf6 [IR] Support IrType in type checker 2019-06-26 09:39:15 +03:00
Mikhail Zarechenskiy
c77f18fbe6 [NI] Support callable references on qualified types with generics
#KT-32154 Fixed
2019-06-26 00:23:12 +03:00
nikita.movshin
b8ccd98a17 Add changelog for 1.3.40 2019-06-25 19:33:10 +03:00
Pavel Punegov
e9aec54f59 Ignore test in native because it doesn't support 40 parameters 2019-06-25 19:12:41 +03:00
Ilmir Usmanov
0ada383281 Move addFunctionOverride to AddContinuationLowering 2019-06-25 16:30:02 +03:00
Ilmir Usmanov
c613e04962 Do not try to create view of suspend function descriptor on IR BE
Keep container source in wrapped descriptor
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
53878b6961 Do not generate synthetic accessors of local functions as suspend 2019-06-25 16:30:02 +03:00
Ilmir Usmanov
48e64e8a07 Use WrappedSimpleFunctionDescriptor instead of real one for
suspend function views
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
ca421e0aa5 Do not generate empty bodies for suspend functions 2019-06-25 16:30:01 +03:00
Ilmir Usmanov
95a65ba94d Restore order of lowerings 2019-06-25 16:30:01 +03:00
Ilmir Usmanov
60cbf0696d Do not generate tests with experimental coroutines on JVM_IR backend
Enable working tests.
2019-06-25 16:30:01 +03:00
Ilmir Usmanov
0628783308 Move coroutines-related stuff to AddContinuationLowering 2019-06-25 16:30:00 +03:00
Ilmir Usmanov
8306c28117 Generate continuation class for suspend lambdas
generate state-machine for coroutines.
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
f369324520 Generate continuation class for named functions
TODO: Generate label and result for suspend lambdas
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
379390c472 Introduce add continuation pass, which transforms each suspend function
and call to have additional continuation parameter.
2019-06-25 16:30:00 +03:00
Mikhail Zarechenskiy
b3a05b1e0d [IDE-NI-MIGRATE] Update test-data after switching to NI 2019-06-25 15:55:47 +03:00
Alexander Gorshenev
76088cdf00 Bind WrappedVariableDescriptorWithAccessors in IR deserializer 2019-06-25 15:18:04 +03:00
Mikhail Zarechenskiy
48f25385ac [NI] Don't use old common supertype calculator in NI 2019-06-25 14:09:45 +03:00
Mikhail Zarechenskiy
60a0cf1fcc [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-25 14:09:42 +03:00
Mikhail Zarechenskiy
a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy
bc0773b219 [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-25 14:09:34 +03:00
pyos
54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Nikolay Krasko
674badc692 Register mock injection language manager in compiler
In 192 it's important to have service registered since
f204718c88

Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'value' of com/intellij/openapi/util/UserDataHolderBase.putUserDataIfAbsent must not be null
	at com.intellij.openapi.util.UserDataHolderBase.$$$reportNull$$$0(UserDataHolderBase.java)
	at com.intellij.openapi.util.UserDataHolderBase.putUserDataIfAbsent(UserDataHolderBase.java)
	at com.intellij.openapi.util.NotNullLazyKey.getValue(NotNullLazyKey.java:41)
	at com.intellij.lang.injection.InjectedLanguageManager.getInstance(InjectedLanguageManager.java:41)
	at com.intellij.psi.impl.PsiCachedValue.isVeryPhysical(PsiCachedValue.java:74)
	at com.intellij.psi.impl.PsiCachedValue.anyChangeImpliesPsiCounterChange(PsiCachedValue.java:57)

Reproduced with Fir2IrTextTestGenerated
2019-06-25 11:49:00 +03:00
Nikolay Krasko
ebcf306ecc Update proguard rules for 192 idea 2019-06-25 11:48:59 +03:00
Nikolay Krasko
5119979571 Fix compile warnings with 192.5118.30 in backward compatible way 2019-06-25 11:48:59 +03:00
Nikolay Krasko
beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Nikolay Krasko
997d896557 Inline ORDER_ENTRY_TYPE_ATTR to fix compilation in 192 branch 2019-06-25 11:48:58 +03:00
Nikolay Krasko
96f0f444ad Remove dependency to IconLoader from compiler 2019-06-25 11:48:58 +03:00
Nikolay Krasko
aa079376e7 Fix signing artifacts (KT-32192)
Broken in f1e3e26e6cd6e38b473ffe1a23b19b68ebb2d11f.

----
> Task :kotlin-reflect:signArchives FAILED
Build time for tasks:
Compiling kotlin: 1.44s (12.33% of total time)
Processing jars: 4.28s (36.75% of total time)
Uncategorized: 5.39s (46.26% of total time)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlin-reflect:signArchives'.
> Duplicate key Signature kotlin-reflect:jar.asc:asc:
---

 #KT-32192 Fixed
2019-06-25 11:46:17 +03:00
Dmitry Gridin
2ef2c358c4 RedundantLetInspection: fix descriptions 2019-06-25 15:10:17 +07:00
Dmitry Gridin
7e0db3d612 ComplexRedundantLetInspection: fix highlight for multiple line receiver
#KT-31278 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin
b97aaf0f71 Split ReplaceSingleLineLetInspection to SimpleRedundantLet & ComplexRedundantLet
Relates to #KT-32010
2019-06-25 14:37:04 +07:00
Dmitry Gridin
8e0bbe7d4a Convert ReplaceSingleLineLetIntention to inspection & decrease severity to INFORMATION
#KT-32010 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin
ea76ea6fb8 Minor: cleanup ReplaceSingleLineLetIntention 2019-06-25 14:37:04 +07:00
Amaury
bb0ee8ca0a Fix typo in jdksFinder.kt 2019-06-25 09:33:43 +02:00
Anton Yalyshev
c8ad7b95cd small refactoring: hashSets are replaced by sets 2019-06-25 09:14:04 +03:00
Anton Yalyshev
de02fcb626 it doesn't need to override second invoke(..) for FUS, as they both are called during refactoring 2019-06-25 09:14:04 +03:00
Anton Yalyshev
1acb89d760 added PullUp and PushDown cases to set of possible values for Refactorings collector 2019-06-25 09:14:04 +03:00
Anton Yalyshev
2adcb6d616 fixed a set of possible values for New File Templates collector 2019-06-25 09:14:03 +03:00
Anton Yalyshev
edf467febf added lists of possible values for Evaluator collector 2019-06-25 09:14:03 +03:00
Anton Yalyshev
1a4a6bb0ff added lists of possible values for Refactoring, NewFileTemplate and NPWizards collectors 2019-06-25 09:14:03 +03:00
Anton Yalyshev
eb5ab1cc52 added lists of possible values for buildSystemTarget collectors 2019-06-25 09:14:03 +03:00
Alexander Udalov
edce35a643 Minor, remove obsolete coroutines-related code from mapBuiltInType 2019-06-24 19:15:17 +02:00
Alexander Udalov
10d1adca03 Minor, fix typo in kdoc in JavaToKotlinClassMap 2019-06-24 19:15:17 +02:00
Roman Artemev
97203973ac [JS IR BE] Fix coroutine context 2019-06-24 20:14:19 +03:00
Roman Artemev
544443f113 [JS IR BE] Initialize module dependencies in the correct order 2019-06-24 20:14:19 +03:00
Simon Ogorodnik
9d4fbf8cbd FIR: reuse scopeSession in call resolver & implicit typed ref resolution 2019-06-24 18:51:15 +03:00
Simon Ogorodnik
bc7c822b74 FIR resolve: stop visiting receiver hierarchy during call completion 2019-06-24 18:51:14 +03:00
Mikhail Glukhikh
046c82ab60 FIR: remove unused utility function 2019-06-24 18:51:13 +03:00
Simon Ogorodnik
0e60af95bf Optimization: make every FIR node extend FirPureAbstractElement 2019-06-24 18:51:12 +03:00
Mikhail Glukhikh
d41c50d6cf FIR: support type inference for assignments, fix related lambda inference 2019-06-24 18:51:03 +03:00
Mikhail Glukhikh
48cea4b800 FIR: take expected type into account during inference
NB: this commit provokes some inference problems,
which are fixed by next commit about type inference for assignments
2019-06-24 18:42:52 +03:00
Mikhail Glukhikh
1e1f4d4472 ConeTypeContext: handle "recursive type alias" situation 2019-06-24 18:42:51 +03:00
Mikhail Glukhikh
152abbfb4c ConeTypeContext: handle star projection more correctly
See substitutionSupertypePolicy & testInnerTP in FIR smoke diagnostics
2019-06-24 18:42:29 +03:00
pyos
6a21285aed JVM_IR: do not generate two nullary constructors
when the primary constructor with @JvmOverloads has default values for
all arguments.
2019-06-24 14:58:45 +02:00
ghedeon
40957ad46a KT-17916: Import popup does not indicate deprecated classes 2019-06-24 16:49:33 +07:00
Dmitry Gridin
8c84f885ac Cleanup: apply RemoveRedundantQualifierNameInspection to idea 2019-06-24 15:56:33 +07:00
Dmitry Gridin
f1e2ba728f RemoveRedundantQualifierNameInspection: fix case with non-static java functions 2019-06-24 15:56:30 +07:00
Dmitry Gridin
0b16c51baf RemoveRedundantQualifierNameInspection: fix false positive
#KT-32112 Fixed
2019-06-24 15:17:10 +07:00
Dmitry Gridin
a170de2c56 RemoveRedundantQualifierNameInspection: support class literal expression
#KT-32046 Fixed
2019-06-24 15:17:09 +07:00
Dmitry Gridin
b930c061a8 RemoveRedundantQualifierNameInspection: context should evaluated once for KtUserType 2019-06-24 15:17:09 +07:00
Mikhail Glukhikh
ac730a693a FIR: don't count implicit built-in type as a kind of implicit type
Before this commit, implicit Unit type for function with body and
without type, implicit Boolean type for conditions etc. were 'implicit'
types and resolved types together.
Sometimes this could lead to hard-to-find issues in FIR resolve, because
'implicit' types are usually handled there as 'necessary to resolve'
which is wrong for such effectively-resolved types.
2019-06-24 10:13:26 +03:00
Toshiaki Kameyama
2efbc6e914 Explicit this inspection: fix false positive with subclass and extension
#KT-27550 Fixed
2019-06-24 09:34:08 +03:00
Jeffrey van Gogh
1dbe487077 Reduce compiler runtime overhead of MaxStackFrameSizeAndLocalsCalculator
Profiling the compilation of kotlinx.serialization, MaxStackFrameSizeAndLocalsCalculator
causes ~7% of the runtime to be spent in java.lang.Object.hashCode

This is through two uses:
- visitMaxs(..) has a pushed hashSet that causes ~2%
- labelWrappersMap used to attach additional data to asm Labels, causes ~ 5%

visitMaxs can use the existing SmartSet (not to be confused with SmartHashSet)

Analysis of the visitMaxs HashSet creation & sizes:

| What               | Amount |
| calls to visitMaxs | 4416   |
| max pushed	     | 158    |
| median pushed	     | 4      |
| average pushed     | 5.20   |
| stddev pushed	     | 7.66   |
| 90 percentile      | 10     |

Analysis of labelWrappersMap creation & sizes:

| What               | Amount |
| ------------------ | ------ |
| hashtables created | 4006   |
| max entries        | 175    |
| median entries     | 5      |
| average entries    | 6.10   |
| stdev entries      | 8.28   |
| 90 percentile      | 11     |

testing with a non hash based map using an array for keys and an array for values
showed that the cost of MaxStackFrameSizeAndLocalsCalculator became neglible to
the overall running time.

SmartIdentityTable is a Map like structure that uses reference identity for keys.
It uses 2 arrays to store keys & values until the number of entries stored is larger than 10.
At that point it switches to using an IdentityHashMap.

This structure can be used instead of HashMap when reference identity can be used and
the number of entries inserted is small (<= 10) on average, drastically reducing the overhead
of calls to Object.hashCode

Between the two changes, compilation of kotlinx.serialization through kotlinc
commandline decreased from 14 seconds to 11 seconds on my machine
2019-06-21 18:51:22 +02:00
Svyatoslav Kuzmich
0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
3e10de9cd1 [JS IR BE] Fixup property accessors 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
84d48b8c7b [IR BE] Don't override private declarations 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
7796d084e1 [JS IR BE] Generate fileds for all properties 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
14ec30dd5a [JS IR BE] Lower property accessors in PrimitiveCompanionLowering 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
19b0bb8d0f [JS IR BE] Minor codegen refactoring 2019-06-21 17:02:01 +03:00
Dmitry Petrov
79d4b46d2b KT-32044 Fix unsigned integer coercion in loop intrinsics 2019-06-21 16:30:23 +03:00
Dmitry Petrov
0b580b2741 Refactor: SimpleBoundedValue, AbstractBoundedValue -> BoundedValue class 2019-06-21 16:30:22 +03:00
victor.petukhov
bfeb9537ee Exclude functional types for the warning reporting about implicitly inferred a type parameter to Nothing 2019-06-21 15:52:01 +03:00
Dmitry Gridin
66795db042 PackageDirectoryMismatchInspection: fix visibility in editor
#KT-31816 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin
59325900df KotlinInvalidBundleOrPropertyInspection: fix false positive for a bundle with several properties files
#KT-31359 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin
d9808b70b6 LeakingThisInspection: fix false positives for enum class
#KT-25905 Fixed
2019-06-21 18:40:31 +07:00
Vladimir Dolzhenko
efd004c997 Add j2k, nj2k performance tests 2019-06-21 13:04:08 +02:00
Mikhail Zarechenskiy
fe0282809e [NI] Skip fake call for descriptor from object in builder-inference
This call have interesting rules for resolution, see
 `KtQualifiedExpression.elementChain` function and it's usages:
 resolution results for such call can be omitted and be replaced with
 some other information, while diagnostics will be reported from
 builder-inference.

 To mitigate this problem, we'll just skip this call from builder-inference
 as such calls can't have type parameters anyway

 #KT-32094 Fixed
2019-06-21 11:56:09 +03:00
Mikhail Zarechenskiy
bebdf6fcef [NI] Added test for KT-32094 2019-06-21 11:52:44 +03:00
Mikhail Zarechenskiy
f3e4c9cdb3 [NI] Don't avoid Nothing-like constraints if Nothing was in initial type
#KT-32081 Fixed
 #KT-32951 Fixed
2019-06-21 11:52:39 +03:00
Mikhail Glukhikh
4b2175c8f8 FIR: do not resolve constructors / initializers in implicit type mode 2019-06-20 23:43:04 +03:00
Georgy Bronnikov
48b0cac92e Update tests 2019-06-20 22:37:56 +03:00
pyos
8cca74c932 JVM_IR: support vararg & defaults in function references 2019-06-20 22:37:56 +03:00
pyos
b45e8c7021 JVM_IR: make CallableReferenceLowering a bit shorter 2019-06-20 22:37:56 +03:00
Denis Zharkov
6d63214d1b Optimize AbstractTypeChecker::collectAllSupertypesWithGivenTypeConstructor
Add fast path for a case when subType is a class and super is not
Classes may only have classes supertypes
2019-06-20 15:42:42 +03:00
Denis Zharkov
7a31a14002 Clarify parameter names in AbstractTypeChecker 2019-06-20 15:42:42 +03:00
Denis Zharkov
1a2ccb50c6 Minor. Drop unused functions 2019-06-20 15:42:42 +03:00
Denis Zharkov
bf0781d790 FIR: Implement fast path for classes subtyping 2019-06-20 15:42:42 +03:00
Mikhail Glukhikh
cafe92639b [FIR] Output total time & set passes in old FE performance test 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
c8003518a5 FIR: set super type reference properly 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
65d14ff097 FIR: do not try to calculate annotation call type
Annotation type is used instead
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
ca401cb01d FIR2IR: support backing field symbols from FIR, fix test data 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
54078c4e9c FIR resolve: support inferring property type from getter 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
16ead49967 FIR: implement backing field references via 'field' synthetic variable 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
11620d848b FIR resolve: set property accessor return type to initializer type 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
7e2828c276 FIR: provide error type for property/variable without initializer 2019-06-20 15:26:39 +03:00
Ilya Matveev
65b7da9d0a Gradle: Add a shortcut DSL method for linuxArm64 target
Issue #KT-32034 Fixed
2019-06-20 18:05:25 +07:00
Roman Artemev
88e92be091 [IR] Fix name clash between properties with the same fqn
Promote ABI version
2019-06-20 12:08:55 +03:00
Simon Ogorodnik
2995e9fcac FIR deserializer optimization: avoid calling findKotlinClass twice
This commit influences enum entries deserialization.
In particular, now we don't deserialize enum entry members,
but deserialize its supertype correctly (see test data changes).
2019-06-19 23:04:41 +03:00
Mikhail Glukhikh
b3c21d6e14 Optimize FirClassSymbol.hashCode() 2019-06-19 22:54:14 +03:00
Mikhail Glukhikh
f4fefa042d Optimization: directly call transformChildren on FirExpression
This is done instead of calling super transformer function,
which does the same after several redirections to other functions.
2019-06-19 22:53:24 +03:00
Mikhail Glukhikh
688c2cf74f Optimization: make FIR expression an abstract class
NB: this commit does significant fir:tree refactoring.
It provides some boost due to faster abstract class dispatching in JVM.
2019-06-19 22:52:44 +03:00
Mikhail Glukhikh
dab6fe29b1 Optimization: make property 'FirExpression.resultType' inline 2019-06-19 22:52:20 +03:00
Mikhail Glukhikh
f6f879302f Optimization: make FirFunctionCall an abstract class 2019-06-19 22:52:13 +03:00
Mikhail Glukhikh
d85ad650d5 Optimization: make FirWrappedArgumentExpression an abstract class 2019-06-19 22:52:04 +03:00
Mikhail Glukhikh
b71de954ff Forbid manipulations with FirWrappedArgumentExpression type reference
The type of this expression is bound to the type of wrapped expression,
so it's better not to change it directly.
2019-06-19 22:51:26 +03:00
Mikhail Glukhikh
b7da2f2ad8 FIR resolve: check early receivers on kotlin.* only
To provide more stable behaviour, the check introduced in the previous
commit is now applied only to extensions from kotlin.* package.
2019-06-19 22:48:52 +03:00
Mikhail Glukhikh
374b59dee3 FIR resolve: add early explicit receiver type check
Before this commit, explicit extension receiver type check was performed
during found candidates analysis (together with arguments type check etc.)
Now we do it just after candidate is found, and filter the candidate
out if explicit receiver type is inappropriate.

This commit slightly changes resolve semantics,
replacing WRONG_RECEIVER with UNRESOLVED_REFERENCE in certain situations.
However, it provides significant performance boost.
2019-06-19 22:45:15 +03:00
Mikhail Glukhikh
d820b6ca52 More accurate messages about types in FirResolveBench 2019-06-19 22:45:14 +03:00
Dmitry Gridin
22a73bc09d ChangeFunctionSignatureFix: fix wrong result
#KT-32001 Fixed
2019-06-19 18:52:53 +07:00
Pavel Punegov
85210d5db0 Update zipTestData: use zip64, add coroutineTestUtil and remove stdlib tests 2019-06-19 14:43:36 +03:00
Natalia Selezneva
b2109a2e65 Get rid of bunch file in AbstractScratchRunActionTest 2019-06-19 13:39:32 +03:00
Vladimir Dolzhenko
47a16cb252 Fixed and extended performance tests 2019-06-19 11:39:29 +02:00
Natalia Selezneva
5010824167 Fix compilation for 182, 183 branches 2019-06-19 12:17:23 +03:00
Alexander Podkhalyuzin
661d50de18 Do not search for Kotlin classes, when looking for Java classes 2019-06-19 11:03:54 +02:00
Natalia Selezneva
91ac38aaf4 Scratch: get editor from data context if possible 2019-06-19 11:29:15 +03:00
Natalia Selezneva
a1564fe696 Scratch: get scratch expression using last commited version of document to avoid differences between PsiFile and Document 2019-06-19 11:29:14 +03:00
Natalia Selezneva
414f98aa29 Implement REPL Mode for scratches
^KT-27963 Fixed
2019-06-19 11:29:14 +03:00
Natalia Selezneva
8bc03e54f7 Scratch: do not clear inlays in onStart
This is needed for sequential executor
2019-06-19 11:22:20 +03:00
Natalia Selezneva
b5b35a9037 Extract ScratchCompilingSession to allow calling executor multiple times 2019-06-19 11:22:20 +03:00
Natalia Selezneva
7038d9b8db Do not use ConfigurationFileCrcFactory comparing scratch content because it needed the document to be saved
Check only if new fragment is not empty to avoid recompilation on minor changes
2019-06-19 11:22:20 +03:00
Natalia Selezneva
ab0877390b Use after line end inlays to avoid moving inlay on the next line pressing enter
^KT-29534 Fixed
2019-06-19 11:22:19 +03:00
Natalia Selezneva
5bff3ac927 Report errors from REPL to Scratch Console 2019-06-19 11:22:19 +03:00
Natalia Selezneva
a6221cf594 Refactor scratch tests: add ability to set scratch options in test file 2019-06-19 11:22:19 +03:00
Alexander Podkhalyuzin
b59bd9d6a6 Faster component loading (better cache data structures) 2019-06-19 10:13:09 +02:00
Mikhail Zarechenskiy
796cdea50e [NI] Require all proper constraints for Exact return type
Consider call `foo(bar())` where bar() returns some type variable `T`;
 We had a contract that call `bar` can be completed without completion
 of foo (type variables can be inferred from the current context) if `T`
 has at least one proper lower constraint (ProperType <: T).
 Indeed, new constraints can be added only as upper ones, so there is
 no need to grow constraint system.

 Unfortunately, we have Exact annotation that is used on return type of
 elvis. Now, consider the following situation:
 ```
 fun foo(a: Any) {}
 fun bar(e: T): @Exact T

 foo(bar("str"))
 ```

 Here, because of Exact annotation, constraint with `Any`-type will be
 added as an equal one => our prerequisite that there will be no new
 lower constraints is false. `bar("str")` is inferred to Any in OI,
 this seems conceptually wrong, but it's another topic of discussion.

 In NI we can't just grow constraint system to use outer call because
 of another important use-case:
 ```
 fun <T> generic(i: Inv<T>) {}

 fun test(a: Inv<*>?, b: Inv<*>) {
     generic(a ?: b)
 }
 ```

 Common constraint system for these two calls can't be solved
 (fundamentally) for this example, only if (a ?: b) and generic(result)
 are computed separately.

 So, to mitigate initial issue, we'll grow constraint system only if
 there is at least one non-proper constraint.

 #KT-31969 Fixed
2019-06-19 11:07:31 +03:00
Mikhail Zarechenskiy
ca997de6a7 [NI] Test data to understand changes in the next commit
##KT-31969 In Progress
2019-06-19 10:47:05 +03:00
Roman Artemev
50ad21e388 [IR BE] Fix symbol remapping for IrField/IrProperty
- Use appropriate wrapped descriptor
 - Add test
2019-06-19 10:24:15 +03:00
Vladimir Dolzhenko
f11a87e0c5 Revert "Do not resolve import to get imported name"
This reverts commit 60c3e644
2019-06-19 09:20:28 +02:00
Dmitry Gridin
7040639c38 Fix false positive "Not-null extension receiver of inline function can be made nullable" with operator fun invoke
#KT-25786 Fixed
2019-06-19 12:16:41 +07:00
Ilya Gorbunov
eae1813ead stdlib-js(-v1/-ir): rename source files to avoid duplicates in sources
Prohibit having duplicates in sources jar and rename those source files,
that clash with the same named source files coming from
the common js source root.

Relates to KT-31965
2019-06-18 20:03:04 +03:00
Ilya Gorbunov
5bafba6bff stdlib-js-ir: preserve source directory structure of common js sources 2019-06-18 19:58:47 +03:00
Ilya Gorbunov
ff9d2744ce Provide conversions between Kotlin and Java time durations 2019-06-18 19:49:50 +03:00
Ilya Gorbunov
d7252548fc Add symmetric number * duration operators 2019-06-18 19:49:50 +03:00
Ilya Gorbunov
a2b1c537af Change Duration.toString scientific exponent formatting
- use 'e+' for positive exponents in scientific format
2019-06-18 19:49:35 +03:00
Ilya Gorbunov
a5b7c270ae Change Duration.toString(unit, decimals) formatting
- switch to scientific notation when value is too big (greater than 1e14)
- allow at most 12 decimals, larger values are coerced to 12
- use scientific format with exactly two decimals in mantissa in JVM
2019-06-18 19:49:35 +03:00
Mikhail Zarechenskiy
5cf7c7e5bf [NI] Fix composite substitution for stubbed type in builder-inference
#KT-32038 Fixed
2019-06-18 19:38:04 +03:00
Mikhail Zarechenskiy
7df13c986e [NI] Coerce to Unit expression in last block with explicit Unit
#KT-32037 Fixed
2019-06-18 19:38:02 +03:00
Alexander Podkhalyuzin
25342240b5 Do not resolve top level annotation even in case of inner class conflict 2019-06-18 17:55:50 +02:00
Alexander Podkhalyuzin
60c3e6442f Do not resolve import to get imported name 2019-06-18 17:51:23 +02:00
Denis Zharkov
9d02fe564c FIR: Avoid calling ClassId::asString from ConeTypeContext 2019-06-18 17:20:23 +03:00
Sergey Rostov
7d7f4a8783 Gradle, JS: fix TCServiceMessageOutputStreamHandlerTest on windows 2019-06-18 15:11:08 +03:00
Alexander Podkhalyuzin
4babde5b46 Faster startup avoiding unnecessary class loading in HelloWorld.java 2019-06-18 12:08:28 +02:00
Alexander Podkhalyuzin
c853ae49a2 Faster startup avoiding unnecessary class loading 2019-06-18 12:08:04 +02:00
Denis Zharkov
f7d0be980b FIR: Optimize ConeTypeContext::isIntegerLiteralType
See ConeTypeContext::isIntegerLiteralTypeConstructor
2019-06-18 11:55:15 +03:00
Denis Zharkov
3c8ed21e59 Optimize ConstraintInjector::isMyTypeVariable
Do not look into the map for constructors that are not
type variables
2019-06-18 11:55:15 +03:00
Denis Zharkov
b43f717f6d Optimize AbstractTypeChecker::hasNothingSupertype
It doesn't make sense to go through all supertypes because
Nothing is a final class
2019-06-18 11:55:15 +03:00
Denis Zharkov
115ab38423 FIR: Optimize ConeTypeContext::captureFromArguments 2019-06-18 11:55:15 +03:00
Simon Ogorodnik
2c5bd46a97 [FIR] Handle non-kotlin class results from findKotlinClassOrContent 2019-06-18 11:36:42 +03:00
Simon Ogorodnik
2f53bd24dd [FIR] Reorder providers to make builtins load first 2019-06-18 11:34:18 +03:00
Simon Ogorodnik
03c3469a14 [FIR] Enhance caches in providers 2019-06-18 11:33:11 +03:00
Simon Ogorodnik
f88fafea9d [FIR] Use proper collections for override scope 2019-06-18 11:14:58 +03:00
Simon Ogorodnik
321e948eca [FIR] Improve typing to get rid of cast 2019-06-18 11:14:57 +03:00
Simon Ogorodnik
95409b35ca [FIR] Use abstract classes for FIR scopes 2019-06-18 11:14:56 +03:00
Simon Ogorodnik
810fa9c171 [FIR] Make session & symbolProvider abstract classes 2019-06-18 11:14:55 +03:00
Simon Ogorodnik
5a06027c53 [FIR] Avoid instanceof List in transformInplace 2019-06-18 11:14:54 +03:00
ilgonmic
024636f704 Gradle, JS, webpack: run js directly (don't use bin script)
On windows, bin script wrapped with bashsh and cmd shell, so node failed
 to run it

#KT-31985 Fixed
2019-06-18 10:50:41 +03:00
ilgonmic
a4427773a5 Gradle, JS, webpack: escape strings inside webpack config
#KT-31985
2019-06-18 10:50:40 +03:00
Ilya Gorbunov
aa69933ee0 Update EXPECTED_REACHABLE_NODES
DCE doesn't remove DurationUnit and some other kotlin.time stuff in these cases
2019-06-18 04:02:36 +03:00
Ilya Gorbunov
58b04c7974 Add remaining docs for Duration members, runnable samples for toString 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
ffd9d8c71d Remove unneeded buildString from Duration.toString 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
155dfeaf35 Generate kotlin.time package public API dump 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
c66740a7ed Explicit public visibility, SinceKotlin and ExperimentalTime status
Use file level ExperimentalTime opt-in in tests.
2019-06-18 04:02:35 +03:00
Ilya Gorbunov
16111ab79f Opt-in for Experimental/UseExperimental annotation usage in tests 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
3b989cc815 Avoid using 'D' component in ISO duration string representation
Days in ISO have nominal duration, they are not always equal to 24H
2019-06-18 04:02:34 +03:00
Ilya Gorbunov
6dbc2eeb90 Provide more efficient ClockMark implementation
Do not use default 'plus' operator implementation, that creates a wrapping
AdjustedClockMark instance, create instance of the same type instead.
2019-06-18 04:02:34 +03:00
Ilya Gorbunov
8c730e180c Make ClockMark an abstract class instead of an interface 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
04ec90164e Use ThreadLocals to cache DecimalFormat instances 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
368452748b Move convertDurationUnit into Duration companion 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
ca10d13f34 Rename Duration storage property to 'value' 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
365cbb94cd Change Duration.absoluteValue to property 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
3f7a0d0845 Rename DurationMeasured to TimedValue, withMeasureTime to measuredTimeValue
Add measureTime docs
2019-06-18 04:02:33 +03:00
Ilya Gorbunov
9deac2a591 Rename withComponents to toComponents and add two overloads of them 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
796ad29637 Add shortcuts to convert duration to milliseconds and nanoseconds 2019-06-18 04:02:32 +03:00
Ilya Gorbunov
8004c34e44 Reduce Duration API surface, add top-level docs
- toDuration(unit) extension instead of constructors
- toDouble/Long/Int(unit) function instead of inUnits()
- remove static factory functions
- remove MIN_VALUE/MAX_VALUE constants
2019-06-18 04:02:32 +03:00
Ilya Gorbunov
682430766b Add ClockMark and measureTime tests with test clock 2019-06-18 04:02:32 +03:00
Ilya Gorbunov
b5d16f1a9b Simplify Clock/ClockMark design
- Do not require initialElapsed parameter
- Introduce instead ClockMark +- Duration operators
- Do not require ClockMark to expose its originating Clock back
- Turn elapsedFrom property into elapsed() function
- Rename abstract clock classes
- Fix unit of abstract clocks when constructing them

Add top-level docs for Clocks
2019-06-18 04:02:32 +03:00
Ilya Gorbunov
ca29cfb88d Implement MonoClock in JS
It uses either process.hrtime() in node.js or performance.now() in browser,
falling back to Date.now() if the latter is not available
2019-06-18 04:02:31 +03:00
Ilya Gorbunov
b816f50d4d Implement and test default string formatting in JVM and JS
Relax Duration.toString tests for JS and Native rounding specifics
2019-06-18 04:01:55 +03:00
Ilya Gorbunov
804d2b2d8c Helper utilities to execute test code on particular platforms 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
95139252b7 Exclude kotlin.time.* from reduced js runtime 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
c1f7fd0281 Duration: test toString in particular units 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
b9c56af9ba Change Duration value storage unit to ns 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
690049c082 Duration unit tests 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
7977b6cdb8 Implement DurationUnit in JS, add doc summary and conversion test 2019-06-18 03:59:51 +03:00
Ilya Gorbunov
37c5f2c54f Initial prototype of Duration and Clocks API 2019-06-18 03:59:51 +03:00
Mikhail Zarechenskiy
7749afb13e [NI] Fix exception for type check callable reference against error type
#KT-32029 Fixed
 #EA-145311 Fixed
2019-06-17 19:18:04 +03:00
Mikhail Zarechenskiy
8fe632f52b [NI] Record DFI for callable reference arguments
#KT-31941 Fixed
2019-06-17 19:18:04 +03:00
Roman Artemev
1f70284b18 [JS IR BE] Fix charSequenceLength function for JS IR 2019-06-17 18:10:53 +03:00
Vyacheslav Gerasimov
e69ae451cf Build: Fix performanceTestCompileOnly configuration 2019-06-17 17:49:12 +03:00
Sergey Igushkin
41d8c536c3 Update Gradle module metadata warnings: don't warn when it's enabled
Also add a suggestion to enable the module metadata publishing in
Gradle 5.3+ projects that consume Gradle module metadata by default but
don't produce it unless explicitly enabled.

Issue #KT-31023 Fixed
2019-06-17 17:29:41 +03:00
Mikhail Zarechenskiy
2964be8caa Remove "experimental" suffix from IDE settings for NI 2019-06-17 16:59:18 +03:00
Vyacheslav Gerasimov
54222bd429 Build: compiler tests-common test runtime 2019-06-17 16:30:14 +03:00
Vyacheslav Gerasimov
1da2bc5dab Build: Fix idea performance tests runtime 2019-06-17 15:52:18 +03:00
Ilya Kirillov
d6dec2a066 New J2K: use PsiModifierListOwner instead of JvmAnnotatedElement for getting annotations from declaration while building AST as PsiLocalVariable is no longer a JvmAnnotatedElement in 192
#KT-31821 fixed
2019-06-17 12:18:05 +03:00
Andrey Uskov
ae2ef0ac79 Fix MultiModuleHighlightingTest 2019-06-17 11:53:10 +03:00
Mikhail Glukhikh
5f896936ae Fix broken test (related to "Convert to lazy property") 2019-06-17 11:06:38 +03:00
Natalia Selezneva
20d19ee66f Temporary workaround for ProcessCanceledException that may happen during dependencies update
This happens during finding script definition (especially during virtual file to psi file search)
In this case dependencies may be already saved to cache, so makeRootChangeEvent should be generated, otherwise indexes aren't updated and highlighting in the script can be broken
2019-06-17 10:30:58 +03:00
Natalia Selezneva
233c37db57 Scripts: provide more concrete scope for files from script dependencies 2019-06-17 10:30:58 +03:00
Natalia Selezneva
213b0a37d1 Do not include jdks dependencies into run configuration of script
^KT-25187 Fixed
2019-06-17 10:30:57 +03:00
Natalia Selezneva
151c12dd85 Scripts: clear modification stamps cache when script dependencies cache is cleared
Otherwise it prevents script dependencies reloading
It may occur when script definitions are reloaded, cache is cleared, but dependencies aren't reloaded

^KT-31826 Fixed
2019-06-17 10:30:57 +03:00
Natalia Selezneva
2b748ccd9a Scripts: if sdk isn't use for some module in project, PsiElementFinder doesn't return jdk classes
For example in Android project all modules can have AndroidSDK, but JavaSDK can be set as ProjectSdk
In this case build.gradle.kts couldn't resolve jdk classes
2019-06-17 10:30:56 +03:00
Natalia Selezneva
a69b5345d5 Fix RunConfigurationTest 2019-06-17 10:30:56 +03:00
Natalia Selezneva
39f6a6b249 Scripts: replace notification with traffic light icon
When script dependencies aren't loaded yet prevent editor to show green arrow in the top right corner.
Now pause is shown with the correct status
Remove tray notification as obsolete

^KT-31779 Fixed
2019-06-17 10:30:56 +03:00
Denis Zharkov
fdebb38706 Disable slow assertions in type checker everywhere except for tests 2019-06-17 10:29:23 +03:00
Dmitry Gridin
46d8f45c11 Apply LiftReturnOrAssignmentInspection on idea 2019-06-17 11:24:28 +07:00
Toshiaki Kameyama
05a132357b Lift assignment: suggest for assignment of null
#KT-30191 Fixed
 #KT-28595 Fixed
2019-06-17 11:24:28 +07:00
Toshiaki Kameyama
4b4be07942 Add Inspection for lateinit var overrides another lateinit var
#KT-30775 Fixed
2019-06-17 01:28:55 +03:00
Toshiaki Kameyama
fbd992f8c7 Add intentions to convert lazy <--> ordinary property
#KT-23501 Fixed
2019-06-17 01:10:19 +03:00
Toshiaki Kameyama
a2205cfc98 Add "'equals()' between objects of inconvertible types" inspection
#KT-25006 Fixed
2019-06-17 01:09:54 +03:00
Ilya Gorbunov
a1979677d0 Docs: mark all experimental annotations as MustBeDocumented
So that they are shown in the docs of annotated experimental API
2019-06-15 16:37:45 +03:00
Ilya Gorbunov
a55563f5ec Docs: suppress docs for newly introduced hidden API 2019-06-15 16:37:44 +03:00
Kirill Shmakov
ae45bbcead Explicit misconfiguration signalization 2019-06-15 12:47:56 +03:00
Kirill Shmakov
47afd9ec1c Remove ultimate dir 2019-06-15 11:27:37 +03:00
Kirill Shmakov
0df8b7f610 Support ultimate transition
KOTLIN-CR-3025
2019-06-15 11:25:43 +03:00
Nicolay Mitropolsky
a1e9259465 Revert "Remove broken 192 bunch files"
They are not broken anymore as long as we build with "real" IDEA 192
This reverts commit 67a194fa
2019-06-14 20:05:23 +03:00
Nicolay Mitropolsky
2a5be78db3 Kotlinx-coroutines version set to 1.2.1 for IDEA 192 2019-06-14 20:05:23 +03:00
Vyacheslav Gerasimov
55f86af67f Build: Fix test runtime for source-sections-compiler-plugin tests 2019-06-14 19:42:28 +03:00
Vyacheslav Gerasimov
986e1ceefb Build: Fix test runtime for sam-with-receiver-compiler-plugin tests 2019-06-14 19:38:13 +03:00
Nikolay Krasko
61a6c646ab Explicitly call virtual method to be compatible with 192 branch 2019-06-14 19:30:43 +03:00
Roman Artemev
8015152bfc [JS IR BE] Support JS IR in maven plugin 2019-06-14 18:41:00 +03:00
Roman Artemev
cc46657c99 [JS IR BE] Fix misprint 2019-06-14 18:40:59 +03:00
Roman Artemev
6d2ad63db3 [IR] Support IrLocalDelegatedPropertyReference in klib 2019-06-14 18:40:59 +03:00
Roman Artemev
008cf03b06 [IR] Consider TypeParameter as public declaration and serialize it properly
- Add test case when TypeParameter of generic property is exposed outside its module
2019-06-14 18:40:59 +03:00
Roman Artemev
efaf5a9947 [IR] Fix serialization of ENUM_SPECIAL members 2019-06-14 18:40:59 +03:00
Vyacheslav Gerasimov
e32bbcecc2 Build: Fix test runtime for kotlinx-serialization-compiler-plugin tests 2019-06-14 18:18:08 +03:00
Vyacheslav Gerasimov
5a664a86a8 Build: Fix test runtime for kotlin-scripting-compiler tests 2019-06-14 18:10:24 +03:00
Vyacheslav Gerasimov
52303d65ab Build: Fix test runtime for kotlinp tests 2019-06-14 18:06:04 +03:00
Vyacheslav Gerasimov
f18b3bcfda Build: Fix test runtime for descriptors tests 2019-06-14 17:59:17 +03:00
Alexander Gorshenev
a816de4865 Added a test for members of EnumEntry in a library. 2019-06-14 17:12:39 +03:00
Alexander Gorshenev
d13b350716 Don't serialize descriptor references for EnumEntry members 2019-06-14 17:12:39 +03:00
Vyacheslav Gerasimov
33a5a3ff81 Build: Fix test runtime for incremental compilation tests 2019-06-14 17:09:36 +03:00
Natalia Selezneva
fea3001dac Fix target platform for scripts
^KT-31837 Fixed
2019-06-14 12:27:21 +03:00
Natalia Selezneva
8d6bbb9e2e Check that file is in common module sources before enlarging its scope
This is needed for build.gradle.kts files that are in module content, but not is source
2019-06-14 12:27:21 +03:00
Toshiaki Kameyama
b650c7ab00 Add "Redundant empty initializer block" inspection
^KT-5008 Fixed
2019-06-14 12:27:21 +03:00
Dmitry Gridin
c155bf680f MoveVariableDeclarationIntoWhenInspection should move caret to subject expression
#KT-31954 Fixed
2019-06-14 15:28:06 +07:00
Yan Zhulanow
a9057e914b Move back the hardcoded artifacts needed for JPS build 2019-06-14 17:13:50 +09:00
Sergey Rostov
99275deb30 JPS Build: fix building buildSrc 2019-06-14 10:21:05 +03:00
Vyacheslav Gerasimov
9f5b1a5101 Build: Fix runtime for generateFullRuntimeKLib 2019-06-14 01:06:06 +03:00
Vyacheslav Gerasimov
c4e33728a8 Build: Fix test runtime for gradle plugin tests 2019-06-14 00:44:36 +03:00
Vyacheslav Gerasimov
dc2a7fdc13 Build: Fix compiler tests, add missing test runtime dependencies 2019-06-14 00:35:01 +03:00
Toshiaki Kameyama
5dd0110a59 Use safe cast 2019-06-13 23:16:31 +03:00
Toshiaki Kameyama
0fad3fafa8 Replace deprecated symbol usage: fix message in case of generic parameter
#KT-8958 Fixed
2019-06-13 23:16:31 +03:00
Vyacheslav Gerasimov
e8e457a16c Build: Fix uast compilation against 192 platform 2019-06-13 21:57:57 +03:00
Ilya Gorbunov
1960161e78 Exclude inline reified functions and properties from public API
Public inline reified functions are getting into public API dump after
changing their visibility generation strategy (see KT-18563)
from always private to public synthetic. However, they still do not
constitute public binary API, since they can be removed without breaking
compatibility with an already compiled code.
2019-06-13 21:23:21 +03:00
Vyacheslav Gerasimov
95a71f60ca Build: Fix Ide performance tests configuration for jps build 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov
0514437fba Build: Workaround scripting dependencies on full Idea 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov
5a39c637c2 Build: Fix intellij dependency leak from ir tree module 2019-06-13 21:03:55 +03:00
Kevin Peek
4c91ba90bb Add links to Scope Functions docs (PR #2407)
Add links to Scope Functions docs on kotlinlang.org to 'with', 'run', 'let', 'apply', and 'also' extension function docs
2019-06-13 20:49:38 +03:00
Andrey Uskov
1f17ff5d38 Fix compilation of KotlinAndroidGradle MPPModuleDataService
in bunch 182
2019-06-13 20:31:12 +03:00
Alexander Udalov
18a4247226 Add kdoc for new API of kotlinx-metadata-jvm
#KT-26602
2019-06-13 18:00:42 +02:00
Alexander Udalov
980b7ace40 Minor, fix kdoc of KmModuleVisitor.visitPackageParts
Implementation implies that this method is called exactly once for each
package, and that makes more sense to require in the function contract
2019-06-13 18:00:42 +02:00
Alexander Udalov
41eedb69ca Update kotlinx-metadata-jvm usage example in MetadataSmokeTest and ReadMe 2019-06-13 18:00:42 +02:00
Alexander Udalov
a680067ac3 Use new kotlinx-metadata API in binary-compatibility-validator 2019-06-13 18:00:42 +02:00
Alexander Udalov
5ee34503c0 Introduce new API for kotlinx-metadata-jvm
Kdocs are provided in a subsequent commit

 #KT-26602 Fixed
2019-06-13 18:00:33 +02:00
Alexander Udalov
aa54a7e11a Minor, move jvmExtensions.kt -> jvmExtensionVisitors.kt 2019-06-13 17:55:46 +02:00
Andrey Uskov
d02bf74215 Fixed creation of module dependencies on MPP module from non-mpp modules. Case when one artifact is produced by several mpp actualized sources sets is supported.
#KT-30667 Fixed
2019-06-13 18:30:54 +03:00
Andrey Uskov
c0bf5a6566 Import of middle HMPP target platforms is supported 2019-06-13 18:30:01 +03:00
Vyacheslav Gerasimov
c0594c2ee3 Build: Remove dependency on internal indenting stream writer 2019-06-13 18:27:12 +03:00
Andrey Uskov
98a443c12f Fix compatibility with IDEA after unlinking external api from java
#KT-31952 Fixed
2019-06-13 17:42:12 +03:00
Yan Zhulanow
1ec6ca7dd6 Fix rebase issue, move KotlinDebuggerEvaluator to the debugger-util module 2019-06-13 22:34:33 +09:00
Yan Zhulanow
2754deca98 Move FUS components to the 'idea-core' module 2019-06-13 21:58:23 +09:00
Yan Zhulanow
7e564e94ed Debugger: Implement error reporting for evaluator 2019-06-13 21:58:23 +09:00
Anton Yalyshev
8a5fd44a55 created FUS Group for Debugger Evaluator 2019-06-13 21:58:23 +09:00
Yan Zhulanow
6fdcb69b43 Fix Spring tests for ultimate build 2019-06-13 21:58:22 +09:00
Steven Schäfer
41ce88cb9b Move eraseTypeParameters to IrUtils and use it in PromisedValue.coerce 2019-06-13 12:25:06 +02:00
Steven Schäfer
3ce0c336bc Move IrReturnTarget.returnType to IrUtils 2019-06-13 12:25:06 +02:00
Steven Schäfer
ea3bae5fc9 Split voidValue into immaterialUnitValue and defaultValue 2019-06-13 12:25:06 +02:00
Steven Schäfer
27a850be92 Fix genValueAndPut in IrInlineCodegen 2019-06-13 12:25:06 +02:00
Steven Schäfer
917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00
Steven Schäfer
f1f0c7e0a0 Take inline classes into account in JvmBuiltinOptimizationLowering 2019-06-13 11:24:16 +02:00
Steven Schäfer
69cf8d4df4 Produce source function names in CallableReferenceLowering 2019-06-13 11:24:15 +02:00
Steven Schäfer
9c957edcea Implement inline classes in the JVM_IR backend 2019-06-13 11:24:15 +02:00
Steven Schäfer
ad3e03bdbd Disable type mapper name mangling for inline classes in the JVM_IR backend 2019-06-13 11:24:15 +02:00
Steven Schäfer
f5b9eee83a Add builder for variable declarations without initializers 2019-06-13 11:24:15 +02:00
Yan Zhulanow
f450a8ed89 Disable Kapt tests for new multiplatform in Android Studio 2019-06-13 17:35:27 +09:00
Yan Zhulanow
bd342e765d SamWithReceiver: Fix IDE plugin JAR name 2019-06-13 17:33:24 +09:00
Yan Zhulanow
12861595f5 MPP: Attach all classes/resources directories to the runtime classpath (KT-30710) 2019-06-13 17:33:24 +09:00
Yan Zhulanow
bc0f10449a Kapt: Fix source root importing in MPP projects 2019-06-13 17:33:24 +09:00
Yan Zhulanow
9eab9f386d Activate Kapt importer only for JVM compilations (KT-30578) 2019-06-13 17:33:24 +09:00
Mikhail Zarechenskiy
d9dca067f6 [NI] Propagate non-null info on supertypes for capturing from bounds
#KT-31941 Fixed
2019-06-13 00:57:51 +03:00
Sergey Rostov
b2607b47e2 Gradle, tests runner, output stream handler: don't treat flush as new line
#KT-31931 Fixed
2019-06-12 17:03:22 +03:00
Leonid Startsev
2488b40d52 Fix accidentally added comment which broke 183 bunch 2019-06-12 15:30:31 +03:00
Ting-Yuan Huang
f07be024b7 JVM_IR: handle JvmDefault for bridges. 2019-06-12 07:43:45 +02:00
Leonid Startsev
b78d84c120 Add some tests for kotlinx.serialization plugin:
- declaration checker
- bytecode listings
- JVM IR

Improve @Transient redundant reporting
2019-06-11 19:32:40 +03:00
Ilya Kirillov
2dd604cd70 New J2K, minor: remove unused declarations, fix typos 2019-06-11 18:16:06 +03:00
Ilya Kirillov
b80f2c78a0 New J2K, minor: reformat code, optimize imports 2019-06-11 18:16:06 +03:00
Ilya Kirillov
59f66d5882 New J2K: split diagnostic based processing from inspection ones
Analysing file file with diagnostics on each step of post-processings is rather expensive operation so the inspection-like post-processings which don't require diagnostic information was separated from ones that need it

Related to #KT-31848
2019-06-11 18:16:06 +03:00
Dmitry Savvinov
2f8e83d6b9 Minor: regenerate tests 2019-06-11 18:11:44 +03:00
Alexander Udalov
c67517cb2b JVM IR: use fast class reading mode in boxAgainstJava tests
annotationsViaActualTypeAliasFromBinary.kt is ignored because
ExpectActualRemover can't find actual for the expected constructor of
Anno now, because `ExpectedActualResolver.findActualForExpected`
incorrectly filters out actual declarations without any source file, and
Java classes loaded in the fast mode don't have any source files.

This will need to be fixed separately, probably by making
ExpectedActualResolver look for the actual class of an expected class
member first (with source file-based filtering), and then
unconditionally locating the corresponding member there
2019-06-11 15:26:07 +02:00
Alexander Udalov
c6d61346dd Avoid compiling Java files twice in boxAgainstJava tests
After b602c08773, this test started to put all .java files to the
dependencies when compiling .kt files, _in addition_ to the already
compiled class files from those Java sources. This is incorrect because
the test should actually check how Kotlin compiles _against_ Java
binaries. The other behavior (compiling against Java sources) is already
supported and used in normal box tests with .java sources.

However, we can't simply filter out all .java files before calling
`super.doMultiFileTest` because many of those contain directives
(WITH_RUNTIME, FULL_JDK, etc.) and we should load them in
`CodegenTestCase.compile`. As a workaround, remove '.java' file
extension to prevent their compilation but still be able to resolve
directives.
2019-06-11 15:26:07 +02:00
Vasily Levchenko
e3d2419beb [tests][codegen][coroutines] disable test simpleSuspendCallableReference for NATIVE too. 2019-06-11 12:07:58 +03:00
Dmitry Savvinov
32a102a99d Fix bug in ExpectedActualResolver
'getContributedDescriptors' isn't obliged to apply filters, inlcuding
kindFilter, and may return declarations of different kind, so we have to
call 'filterIsInstance' explicitly
2019-06-11 11:07:01 +03:00
Ilya Kirillov
3854a323fa New J2K: do not ignore errors in new j2k tests comparison 2019-06-11 10:37:26 +03:00
Ilya Kirillov
ce569ca6e0 New J2K: remove static modifier for the case when member is converted without containing class 2019-06-11 10:37:25 +03:00
Ilya Kirillov
9929dba74d New J2K: fix ConcurrentModificationException while analysing implicit initializers 2019-06-11 10:35:32 +03:00
Ilya Kirillov
184825d59d New J2K: remove open modifier for top level functions on post-processing
#KT-31678 fixed
2019-06-11 10:35:32 +03:00
Ilya Kirillov
6d3967d922 New J2K: add tests for some obsolete J2K issues 2019-06-11 10:35:31 +03:00
Ilya Kirillov
04fe51b0aa New J2K: use default test file directives for choosing SDK in tests instead of by filename approach 2019-06-11 10:35:31 +03:00
Ilya Kirillov
8375a12733 New J2K: properly remove redundant modifiers in post-processing as #KT-30804 is fixed 2019-06-11 10:35:31 +03:00
Ilya Kirillov
2aa20d003d New J2K: convert vararg type parameter Java length call to Kotlin size call 2019-06-11 10:35:30 +03:00
Ilya Kirillov
b211ae1070 New J2K: correctly convert Kotlin function type 2019-06-11 10:35:30 +03:00
Ilya Kirillov
a2b832e5be New J2K: correctly convert Java String type to Kotlin String 2019-06-11 10:35:30 +03:00
Ilya Kirillov
0fc0f99acb New J2K: do not commit document after each inspection in post-processing
Related to #KT-31848
2019-06-11 10:35:29 +03:00
Ilya Kirillov
110611d690 New J2K: group post-processings to named groups 2019-06-11 10:35:29 +03:00
Ilya Kirillov
cacb4ed9f3 New J2K: correctly handle field symbol in EnumFieldAccessConversion 2019-06-11 10:35:29 +03:00
Ilya Kirillov
ca34c55dde New J2K: do not call shortenClassReferences on AST building for addTypeArguments 2019-06-11 10:35:28 +03:00
Ilya Kirillov
417717914d New J2K: use IDEA indexes for resolving
Related to #KT-31848
2019-06-11 10:35:28 +03:00
Ilya Kirillov
5f8b5efd66 New J2K: do not find import usages in AST building phase
It is a rather heavy operation and it increases conversion time
Related to #KT-31848
2019-06-11 10:34:34 +03:00
Sergey Rostov
d0e3ab1beb Gradle, tests runner: don't use separate thread to parse process output
Or --scan will fail (see KT-31891 for more details).
To do it in same thread we should parse output on output stream calls.
TCServiceMessageOutputStreamHandler will do that.

Also, all new lines now preserved, so TCServiceMessagesClient should
ignore new lines after messages. New ignoreLineEndingAfterMessage setting
will do that.

#KT-31891 Fixed
2019-06-11 09:18:27 +03:00
Sergey Rostov
84b87a22e6 Gradle, tests runner: use OperationIdentifier object as id (not long)
#KT-31448 Fixed
#KT-30691 Fixed
2019-06-11 09:18:26 +03:00
Mikhail Zarechenskiy
991e60c9e4 Add tests for obsolete issues
#KT-31784 Obsolete
 #KT-31757 Obsolete
2019-06-10 17:37:52 +03:00
Leonid Startsev
414c116d93 Fix too strict serializer lookup for generic type parameters 2019-06-10 16:49:19 +03:00
Igor Chevdar
acf9670306 Fixed bug with file descriptors leakage 2019-06-10 13:41:57 +03:00
Igor Chevdar
3e8f3e6f00 [Klib] Split up IR header tables onto three parts
There was one monolith protobuf at irHeader.knd, it was
split up onto 4 parts due to performance issues:
  - a small irHeader with some basic info about a module
  - symbols table
  - types table
  - strings table
These 3 tables are then mmapped and accessed by index.
2019-06-10 13:41:57 +03:00
Alexander Gorshenev
5faccaa49e Got rid of delegation in library impl hierarchy 2019-06-10 13:41:57 +03:00
Dmitry Savvinov
65a6b08fd3 Fix lines joining of TextDiagnostics on Windows
The initial assumption were that inside compiler and test framework all
line breaks are normalized, because we read text files only through IDEA
utils (which do normalization).

The mistake was that 'StringBuilder.appendln()' appends
'System.lineSeparator()' as well, so it's not enough to only check that
we don't load files from disk without normalizing whitespaces.

Note that using 'it.replace(System.lineSeparator(), ...)' would be
incorrect too, because actually we have strings with two kinds of line
breaks here (normalized and not normalized), so we're looking for both
via simple regex.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov
8df759b05c [Expect/Actual] Adjust IdeaModuleStructureOracle to old IDE Resolve
The main issue is that we have CombinedModuleInfo in old IDE Resolve,
which essentially merges platfor-modules together with its
dependsOn-parents. It conceals real module structure, which is fine for
practically all clients except for ExpectedActualDeclarationChecker.

In particular, it is nearly impossible to check expect/actual via
ModuleDescriptors, because you'll always get one and the same
'merged'-module descriptor.

So, this commit rewrites IdeaModuleStructureOracle in the following way:
- use ModuleInfos instead of ModuleDescriptor, as they allow more
fine-grained way to work with modules
- use 'unwrapModuleSourceInfo' in seemingly random places in order to
get real, non-merged moduleInfos
- carefully convert them back to ModuleDescriptors, because EADC work
with descriptors

This is still not an ideal solution. In particular, last step is flawed:
conversion back to ModuleDescriptors will always return merged
moduleDescriptor for platform-modules. There's no easy way to fix that
except for removing CombinedModuleInfo altogether, so we leave it as
known issue.

Also, there are some weird changes in testdata (again, because sometimes
we see several modules merged together), but they are mostly confusing
rather than plain incorrect.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov
54b8f9da28 [Expect/Actual] Add testdata on hierarchical expect/actual matching 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
cac326bf4a [Expect/Actual] Adjust old testdata after changes in expect/actual
matching

This commit makes several changes in testdata:

- compiler multiplatform tests now contain newly introduced diagnostics
about AMBIGIOUTS_ACTUALS
- MultiModuleHighlighitng tests now contain proper reports about
ACTUAL_MISSING:
  - ACTUAL_MISSING should be indeed reported in them, because those
  tests don't contain dependsOn edges, only usual intermodule
  dependencies
  - This error wasn't reported here because expect/actual diagnostics in
  common module used to be reported by PlatformExpectedAnnotator, which
  had a bit flawed logic for deremining common-modules: it checked for
  presence of implementing modules. In those tests, common module has no
  implementing modules, so Annotator was returning silently
  Note that such configurations (common module without implementing
  modules) are almost impossible in real-life projects
  - After removal of PlatformExpectedAnnotator, we use
  ExpectedActualDeclarationChecker in common modules, which launches all
  checks properly
- some QuickFixMultuModuleTests now contain proper reports about
ACTUAL_MISSING. This change is also connected with
PlatformExpectedAnnotator, but now for different reason:
  - QuickFixMultiModuleTest used to check for errors in file by running
  'analyzeWithAllCompilerChecks' and inspecting returned BindingTrace.
  For common modules, there were no diagnostics about expect/actuals in
  that trace, because there were no ExpectedActualDeclarationChecker
  (and PlatformExpectedAnnotator was reporting diagnostics in ad hoc
  trace).
  - Again, now we inject EADC in common modules properly, so we see
  those errors in trace and report them in test
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
174ef56991 [Expect/Actual] Remove PlatformExpectedAnnotator 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
29beed9b21 [Expect/Actual] Support matching of expect/actual in hierarchical MPP 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
4e12701145 [Expect/Actual] Introduce ModuleStructureOracle 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
0915f0c78a [Expect/Actual] Let DI instantiate ExpectedActualDeclarationChecker
Inject it instead of calling constructor manually and passing instance
directly into the container. This allows to accept some components in
constructor of ExpectedActualDeclarationChecker
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
44cbdd142b [Expect/Actual] Collect expectedBy modules correctly in case of HMPP 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
de2944ff43 [Misc] Fix errors checking in QuickFixMultiModuleTest
This test was checking errors *before* applying action, rather than
*after*, like all other QuickFix-tests do. This commit moves
errors-check after performing quick-fix action, and changes testdata:

- for most tests errors are simply gone (as quickfix usually fixes that
error)
- also, for implementMembersInActualClassNoExpectMember we add
'DISABLE-ERROR', similarly to
implementMembersInImplClassNonImplInheritor. This is needed because
'Implement Members'-fix created 'TODO'-calls, which are not resolved in
those tests due to the lack of stdlib. Previously, there were no errors
in this test exactly because file was checked *before* applying quickfix
(i.e. when there were no 'TODO()' in file)
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
d458821565 [Misc] Get rid of IdePlatformKind.IDE_KINDS_BY_COMPILER_PLATFORM
It works incorrectly for cases of non-trivial common platforms (works
fine for 'JVM/JS/Native', but doesn't work for 'JVM/JS')
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
fbbd1a268b [Misc] Minor: generalize TypeUtils.closure 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
935c9fce17 [Misc] Extract method in ExpectedActualDeclarationChecker for clarity 2019-06-10 13:34:27 +03:00
Mikhail Glukhikh
309708f433 Do not visit FirBlock type twice 2019-06-10 11:03:10 +03:00
Simon Ogorodnik
df9479b607 Cache declared member scope 2019-06-10 11:03:09 +03:00
Simon Ogorodnik
3aadf58354 Fix leak of BodyResolveTransformer due to inference components capture 2019-06-10 11:03:09 +03:00
Simon Ogorodnik
146a53f18c Change lookup tags from interfaces to abstract classes 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
a10deb5f69 Remove classId from FirClassSymbol equals / hashCode 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
792c26decc FirClassDeclaredMemberScope: do not create nested one for constructors 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
73a6714ad1 FirClassDeclaredMemberScope: rewrite index calculation imperatively
This should save some performance at this point
2019-06-10 11:03:09 +03:00
Simon Ogorodnik
8ae77da250 Transform only block children, to avoid unresolved type in-between 2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
4ad3e429aa FirClassDeclaredMemberScope: use just Name instead of ClassId/CallableId
This should decrease amount of created garbage a little bit
2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
e403195684 Cleanup: FirTopLevelDeclaredMemberScope 2019-06-10 11:03:08 +03:00
Denis Zharkov
373283dcae FIR: Cache ConeClassifierSymbol in ConeClassLikeLookupTagImpl 2019-06-10 11:03:08 +03:00
Denis Zharkov
91d8f1fc88 FIR: Optimize access to FirSymbolProvider via session 2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
5e42f0c31d Use sink.yield in FIR resolve check receivers 2019-06-10 11:03:08 +03:00
Sergey Rostov
e37c86b85f IDE, wizards, .kts, Kotlin/JS for Node.js: fix DSL
#KT-31895 Fixed
2019-06-10 08:20:48 +03:00
Sergey Rostov
92be12f27b IDE, wizards, kotlin jvm server / js client: fix jvmJar configuration
There should be `from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))`
instead of `from(jsBrowserWebpack.outputPath)in jvmJar task configuration`.

`jsBrowserWebpack.outputPath` may be (and will) inside the same dir as
jvmJar. So jvmJar build hangs.
2019-06-09 14:33:23 +03:00
Sergey Rostov
41347abf56 IDE, wizards: update Kotlin/JS support in jvm server / js client
Configure js browser sub target to use new test and application runners.
Rework js linking and packaging:
- get rid of required.js
- use builtin jsBrowserWebpack task, embed js bundle into jvm jar, remove gradle boilerplate
- ktor server: serve js bundle resource, remove boilerplate

#KT-31695 Fixed
#KT-31099 Fixed
2019-06-08 20:36:09 +03:00
Sergey Rostov
ac044a8c33 IDE, wizards: update Kotlin/JS support in mpp lib wizard
Configure js sub targets to use new test and application runners.

#KT-31695
#KT-31099
2019-06-08 20:36:09 +03:00
Sergey Rostov
f49907092b IDE, wizards: update Gradle Kotlin/JS support
Split Kotlin/JS configuration for browser and nodejs.
Add corresponding Kotlin/JS sub targets DSL calling.
2019-06-08 20:36:09 +03:00
Sergey Rostov
560f34bde5 Gradle, JS, webpack: add dependency to compile classpath 2019-06-08 20:36:09 +03:00
Sergey Rostov
354bf1f308 Gradle, JS, run: don't add dependency from project run task
As js webpack-dev-server will not finish
2019-06-08 20:36:09 +03:00
Sergey Rostov
45d4a9d67c Gradle, js: rename objects to avoid clashing with moowork nodejs plugin
#KT-31834 Fixed
2019-06-08 20:36:09 +03:00
Sergey Rostov
b5515a31eb Gradle, js, karma: useConfigDirectory DSL
#KT-31686 Fixed
2019-06-08 20:36:08 +03:00
Vyacheslav Gerasimov
5bde9720b7 Build: Fix dependencies on :kotlin-compiler project
Dependencies on :kotlin-compiler should never be used in configurations
which are imported transitively because ide fails to import it as
project dependency. When :kotlin-compiler dependency is imported as
kotlin-compiler.jar dependency ide re-indexes it on every change. This
behaviour is super annoying.

 #KT-31120 Fixed
2019-06-08 19:36:28 +03:00
Ilya Chernikov
c39896165e Fix script compiler options processing 2019-06-07 23:19:16 +02:00
Alexey Tsvetkov
38a692abcf Add experimental support for bytecode instrumentation with JPS
#KT-13563 Fixed
2019-06-07 21:06:25 +03:00
Igor Yakovlev
545fdb5a37 Add UL-inline class overrided interface methods 2019-06-07 20:33:07 +03:00
Igor Yakovlev
7d542eda00 Fix UL classes test for inline classes support 2019-06-07 20:33:07 +03:00
Igor Yakovlev
44f19e1225 Add UL support for classes 2019-06-07 20:33:07 +03:00
Mikhail Zarechenskiy
b7849da19e [NI] Introduce flag to change constraint system for overload resolution
This commit doesn't change behaviour of any inference algorithm, it
 introduces opportunity to switch constraint system that is used for
 overload resolution and fix problematic cases by changing one enum
 entry.

 Due to fundamental changes, there are cases where a new inference
 algorithm reports overload resolution ambiguity errors (#KT-31670,
 #KT-31758), which is correct from its point of view. However, this is
 a breaking change and to really make it, we should be very confident
 and have enough motivation for it, therefore, we don't change behavior
 now in order to collect more examples (if there are any). And if we
 find a lot of erroneous examples, we'll be able to change the behavior
 quite simply
2019-06-07 18:38:00 +03:00
Mikhail Zarechenskiy
e7064f5b77 [NI] Move creation of constraint system under callbacks
This will be needed in the next commit to have access to constraint
 system that is used for old inference
2019-06-07 18:37:18 +03:00
Igor Yakovlev
ada41fb23f Add copy method to KtUltraLightSuspendContinuationParameter 2019-06-07 17:54:03 +03:00
Igor Yakovlev
2a1293e3ef Fix test data for UL suspend declatations
(remove should-load-cls flag)
2019-06-07 17:54:03 +03:00
Igor Yakovlev
63d7e479c6 Fix invalid nullability annotation for suspend functions in LightClasses 2019-06-07 17:54:03 +03:00
Igor Yakovlev
d005dc685f Add nullability support to KtUltraLightSuspendContinuationParameter 2019-06-07 17:54:03 +03:00
Igor Yakovlev
0d51a2ec43 Optimize for void return type for functions with no return type
+ small refacroring
2019-06-07 17:54:03 +03:00
Igor Yakovlev
9e904598fb Add coroutines as parameters 2019-06-07 17:54:03 +03:00
Igor Yakovlev
fc30e564ba Add support ultra light suspend functions declarations 2019-06-07 17:54:03 +03:00
Vyacheslav Gerasimov
16b9c15133 Build: Don't run checkBuild tasks on check, add checkBuild to buildSrc 2019-06-07 17:38:16 +03:00
Vyacheslav Gerasimov
2769dc8359 Build: Improve sourcesJar helper
- Add sources from embedded projects
 - Add artifact to sources configuration
 - Use register instead of create

 #KT-30237 Fixed
2019-06-07 17:37:46 +03:00
Vyacheslav Gerasimov
547b10ee29 Build: Write ivy.xml without usage of internal gradle apis 2019-06-07 17:37:39 +03:00
Alexander Udalov
bbbd47ead3 Minor, rename codegen test 2019-06-07 15:01:44 +02:00
Alexander Podkhalyuzin
ea86ebf995 Do not expect that KDoc reference contains importable fqName
#KT-31768 Fixed
2019-06-07 15:25:15 +03:00
Mads Ager
71604851fe JVM_IR: Allow delegated companion objects.
This currently leads to a compilation error due to metadata
generation.
2019-06-07 13:26:20 +02:00
Mikhail Zarechenskiy
4ddd9f081b [NI] Consider explicitly specified type argument as an input type
#KT-31860 Fixed
2019-06-07 12:31:42 +03:00
Mikhail Zarechenskiy
787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitry Gridin
f48640f91c Fix test for UnsafeCastFromDynamicInspection 2019-06-07 12:23:55 +07:00
Dmitry Gridin
8eb11d9d3d Fix some tests 2019-06-07 12:23:54 +07:00
Dmitry Gridin
4f8c0653c5 Change API in AbstractApplicabilityBasedInspection
Replace all inspectionTarget with inspectionHighlightRangeInElement & change type of element in applyTo from PsiElement to TElement
2019-06-07 12:23:54 +07:00
Dmitry Gridin
1ad7a50087 IfThenToElvis & FoldInitializerAndIfToElvis should add new line for long expression
Relates to #KT-19643 #KT-16067
2019-06-07 12:23:54 +07:00
Dmitry Gridin
9c1ff75efc Minor: change highlight range for '...ToElvis' & '...ToSafeAccess' inspections
New range: from `if` keyword to right parenthesis
Relates to #KT-19643 #KT-16067
2019-06-07 12:23:54 +07:00
Dmitry Gridin
984c781588 FoldInitializerAndIfToElvisInspection: decrease severity level to INFORMATION for is
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
b3fe830b6e Fix false positive "Foldable if-then" with Result type
#KT-27074 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
f2accb7b9e Convert IfThenToElvisIntention to inspection & decrease severity to INFO
#KT-16067 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
d8f32b1a0c Cleanup J2KPostProcessingRegistrarImpl 2019-06-07 12:23:54 +07:00
Dmitry Gridin
b4949a1683 Cleanup branchedTransformations & update copyright 2019-06-07 12:23:54 +07:00
Dmitry Gridin
74c177fd26 Convert FoldInitializerAndIfToElvisIntention to inspection and decrease severity to INFO
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
8b0b135112 Add new line after modifier list if last child is comment
#KT-30804 Fixed
2019-06-07 12:23:06 +07:00
Alexander Udalov
fec9ee6408 Minor, add kdoc for typeOf 2019-06-07 00:29:35 +02:00
Mikhail Zarechenskiy
42b7552d17 Fix exception on attempt to map inner non-fixed type variable
#KT-31842 Fixed
2019-06-07 01:18:47 +03:00
Ilya Chernikov
e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
Ilya Chernikov
e5054f9648 Refactoring scripting infrastructure:
- add a helper for new constructing Compilation Configuration only when necessary
- add more converters for legacy diagnostics
- add helpers for simpler creating of failure results
2019-06-06 17:21:00 +02:00
Ilya Chernikov
b7fd898bb8 Add explicit return types to helpers
also workarounds a problem (KT-30297) with new inference
2019-06-06 17:21:00 +02:00
Ilya Chernikov
4fb2f81134 Refactor scripting - prepare utilities for refactoring of the script definitions handling 2019-06-06 17:20:59 +02:00
Andrey Uskov
5efd55f530 Fix memory leak on project reimport
#KT-31843 Fixed
2019-06-06 17:11:07 +03:00
Ting-Yuan Huang
a447c748bc JVM_IR: support @JvmDefaults in compatibility mode. 2019-06-06 14:10:28 +02:00
Toshiaki Kameyama
1c32941949 Use property access syntax: don't report when setter argument is lambda
#KT-30627 Fixed
2019-06-06 18:53:15 +07:00
Sergey Rostov
a3f8987255 JPS Build: fix importing artifacts
For some reason, gradle.projectsEvaluated callback evaluates after IDEA
import script gathers all project models. So, all jps related project
settings (including artifacts configurations) won't be imported.

We need only :prepare:idea-plugin evaluated. So replacing
gradle.projectsEvaluated to root Project.afterEvaluate and
 forcing evaluation of :prepare:idea-plugin fixes the problem.
2019-06-06 11:00:58 +03:00
Sergey Rostov
8995d89599 Gradle, js, karma: don't run karma if no browsers configured
#KT-31662 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov
97fc3fe989 Gradle, js, karma: use ^4.0.0-rc.6 to use webpack 3, require webpack
#KT-31564 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov
eab577001b Gradle, js, npm simple linker: fix creating junction on windows 2019-06-06 09:15:40 +03:00
Sergey Rostov
96fc06c7fb Gradle, js, tests: use compilation runtime classpath as input
#KT-31814 Fixed
2019-06-06 09:15:39 +03:00
Ilya Matveev
f32d48c66d Gradle, tests: Fix native interop test for Win x86 2019-06-06 12:53:02 +07:00
Ilya Matveev
dd941ffa93 Project wizard tests: Bump Gradle plugin version to use test binaries 2019-06-06 12:53:01 +07:00
Ilya Matveev
e8e2a5654e IDEA plugin: Use new test binary getter in project templates
Issue #KT-31724 fixed
2019-06-06 12:53:01 +07:00
Ilya Matveev
2ab0760e35 Gradle, native: Fix creating test binaries for non-host platforms
Issue #KT-31725 fixed
2019-06-06 12:53:01 +07:00
Dmitry Gridin
afa9a80b3a Fix multi module tests for AddOperatorModifierInspection 2019-06-06 12:09:28 +07:00
Ilya Kirillov
201bf328ca New J2K: print new line before init section because of bad formatting 2019-06-05 23:41:49 +03:00
Ilya Kirillov
ca23eb44a1 New J2K: add type star projections for converted classes raw references
#KT-31818 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
845cde2d23 New J2K: do not add star projection type for raw class literal expression
#KT-15791 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
f75a7cbfc9 New J2K: fix test data for java8MapForEachWithFullJdk test 2019-06-05 23:33:12 +03:00
Ilya Kirillov
a56155ca73 New J2K: correctly handle vararg annotation parameter of external Java class
#KT-31726 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
58611ec417 New J2K: add test data for #KT-16662, #KT-15991, #KT-12050 2019-06-05 23:33:12 +03:00
Ilya Kirillov
c1e24d818b New J2K: fix NPEs in nullability analysis
#KT-31817 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov
1a9deed5d8 New J2K: add conversion progress bar
Relates to #KT-31812
2019-06-05 23:33:11 +03:00
Ilya Kirillov
f51e28ea68 New J2K: commit file after each post-processing
#KT-31809 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov
0623fa4349 New J2K: reformat JavaToKotlinAction.kt 2019-06-05 23:33:11 +03:00
Ilya Kirillov
aaab1fe134 New J2K: suggest user to configure Kotlin in a project before nj2k conversion 2019-06-05 23:33:11 +03:00
Leonid Startsev
3792c44378 Make short path for non-serializable classes and other improvements:
Adjust some error messages
Add 'fallbackElement' to report on when property is implicitly typed
Split findTypeSerializerOrContext into checked and unchecked versions
2019-06-05 19:13:03 +03:00
Leonid Startsev
dc79b99dd2 Implement inspection about no-arg constructor in non-serializable supertype 2019-06-05 19:11:18 +03:00
Leonid Startsev
8f77b55ada Retrieve serializable properties from binding context in most of the places
Remove unused record 'SERIALIZER_FOR_PROPERTY'
2019-06-05 19:11:18 +03:00
Leonid Startsev
fe1f36bc02 Report an error on @Serializable inline classes and missing @Transient initializers 2019-06-05 19:12:34 +03:00
Leonid Startsev
e6d96f1de9 Implement diagnostic about nullable serializer for non-nullable type 2019-06-05 19:12:00 +03:00
Leonid Startsev
6895184b84 Implement basics diagnostics reporting from the serialization plugin similarly to noArg and allOpen plugins 2019-06-05 19:11:20 +03:00
Leonid Startsev
d3a596e3c2 Correctly copy init blocks code to deserialization constructor
Fixes https://github.com/JetBrains/kotlin-native/issues/3019

Workaround problem with proguard and inline reified functions
2019-06-05 17:44:34 +03:00
Leonid Startsev
6370f0b3be Correctly reference deserialization constructor added by plugin
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/472
2019-06-05 17:43:46 +03:00
Alexander Udalov
43cb17cdd5 Check expected type of annotation parameter correctly in AnnotationDeserializer
The main idea of this refactoring is to separate two usages of
`AnnotationDeserializer.resolveValue`: the one where we load annotation
argument values, and the one where we load constant values of properties
for JS/Native/Common
(`AnnotationAndConstantLoaderImpl.loadPropertyConstant`).

In the latter case, `expectedType` is the type of the property and it
can be a supertype of the actual value (e.g. see `arrayConst` in
compiler/testData/serialization/builtinsSerializer/compileTimeConstants.kt).
But in the former case, we need to check that the value conforms to the
expected type and disregard it if it's not the case, which is possible
if the annotation was recompiled separately.

 #KT-28927
2019-06-05 14:44:15 +02:00
Alexander Udalov
c666b60ca3 Support arrays of class literals in AnnotationDeserializer
#KT-28927 Fixed
2019-06-05 14:44:14 +02:00
Dmitry Gridin
52ec9e0fa8 Extract resolve from write action & cleanup AddOperatorModifierInspection
Relates to #KT-31533
2019-06-05 19:27:52 +07:00
Toshiaki Kameyama
4c62788c3e Make "Add operator modifier" an inspection instead of intention
#KT-31533 Fixed
2019-06-05 19:27:52 +07:00
Mikhael Bogdanov
5123e1f078 Add project property for workers count 2019-06-05 14:24:26 +02:00
Ivan Gavrilovic
7a2332fe36 KT-31714: Close files after analysis in incremental KAPT
Artifact transform used to analyze classpath was not closing files, which
caused java.nio.file.FileSystemException. This commit fixes that, and all
input streams are closed after use.

Fixes: KT-31714
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
695f202e46 KT-31127: add only generated Java sources to JavaCompile inputs
This commit changes how generated sources are added to the Gradle JavaCompile
task. Previously, directory was added to sources which caused issues with
annotation processors that only generate Kotlin sources. I.e. JavaCompile task
was executed but no java sources existed.

Now, only generated Java sources are added to the JavaCompile task. This
means that if only Kotlin sources are generated JavaCompile task will be
skipped.

Fixes: KT-31127
Test: Kapt3IT.testKotlinProcessorUsingFiler
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
55ba985cd2 KAPT: do not discover incremental APs only if cache is not set
KaptFlag.INCREMENTAL_APT is used to indicate that KAPT run
should try to be incremental because changes to input files and
classpath have been detected. However, first run of the Gradle
task will set this flag to false, which means that all APs will be
detected as non-incremental in the first run. Further on, this means
that the dependency caches will be invalid, and all subsequent runs
will be non-incremental as well.

This commit uses existence of dependency cache to determine if incremental
APs should be discovered. The regression was introduced in
72fdc648ff.

Test: ./gradlew :kotlin-gradle-plugin-integration-tests:testAdvanceGradleVersion --tests *KaptIncrementalWith*\
 && ./gradlew :kotlin-gradle-plugin-integration-tests:test --tests *KaptIncrementalWith*
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
1fa990b063 Support isolating APs that report multiple originating elements from the same file
It is possible for isolating annotation processor to report two or more
originating elements from the same source file when generating
sources/classes/resources. This commit makes sure the source file are
de-duped, so assertion that there is a single source file does not fail.

Test: IsolatingIncrementalProcessorsTest.testIsolatingWithMultipleOriginatingElements

This is improvement to https://youtrack.jetbrains.com/issue/KT-23880
2019-06-05 18:19:49 +09:00
Ivan Gavrilovic
76f62da6ae Improve constants analysis in KAPT
When analyzing source files in KAPT for incremental annotation processing,
avoid creating TreePath instances for initializers that are literals. E.g.
if it is just a boolean/int literal, we do not need to visit the tree nor
create expensive TreePath instance.

For classes that contain only constants (such as R.java for Android projects)
this is a significant improvement. Class that contains 16000 constants took
more than 10 seconds to analyze, now it is 70ms.
2019-06-05 18:19:49 +09:00
Yan Zhulanow
84c048ca81 Do not run task verification in NMPP tests on 183 platform as well 2019-06-05 18:17:45 +09:00
Ting-Yuan Huang
1b4d26e490 psi2ir: keep the type of when when possible
Ideally, the type of `IrWhen` should be provided by type inference for
a consistent behavior. `USED_AS_EXPRESSION` from CFG isn't always
consistent with type inference, unfortunately.

The behavior is now aligned with `if`. The type of `when` is kept when
it *can* be an expression, instead of whether it is used or not.
2019-06-05 10:23:44 +02:00
Svyatoslav Kuzmich
cd651be461 [JS IR BE] Migrate JS BE to common klib utils 2019-06-05 11:15:45 +03:00
Mads Ager
0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Dmitry Gridin
bf9dde5c32 Fix assert from createExpression in RemoveRedundantQualifierNameInspection 2019-06-05 13:17:12 +07:00
Yan Zhulanow
09ff9a65a5 Fix 182 bunch tests, do not perform task tests on older platform versions 2019-06-05 13:27:38 +09:00
Yan Zhulanow
a575c7e5b5 Minor: Fix NPE in BinaryModuleInfo, handle empty scopes 2019-06-05 13:27:38 +09:00
Mikhail Glukhikh
71590b6735 Introduce Kotlin language substitutor to fix exceptions in velocity files
Related to KT-31470 (should fix the problem or at least soften it)
May be related also to KT-30977
#KT-30886 Fixed
2019-06-04 23:30:02 +03:00
Abduqodiri Qurbonzoda
37dfbb3eba Workaround unpaired surrogates replacement with ? (KT-31614) 2019-06-04 21:25:41 +03:00
Sergey Rostov
1c0519b0a2 Gradle, js, npm: fix resolving transitive npm dependencies using yarn.lock
- already visited transitive npm dependencies should be stored in parent dependencies
- child NpmDependency should search resolved project data in parent NpmDependencies
2019-06-04 19:32:10 +03:00
Sergey Rostov
465a47a194 Gradle, js, npm: fix idea gradle sync for multiproject builds
npm resolver ProjectData stored per project (not in root project)
2019-06-04 19:32:10 +03:00
Sergey Rostov
b5080bda75 Gradle, js, npm: fix reading package.json files
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
Sergey Rostov
32a0bb9f0e Gradle, js, npm: fix npm aggregated configuration attributes
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
ilgonmic
16200181cc KT-31645 Fix yarn downloading on Windows 2019-06-04 17:38:24 +03:00
Vyacheslav Gerasimov
7d38977f5e 192: Update since & until versions for 192 plugin 2019-06-04 16:34:33 +03:00
Mikhael Bogdanov
79074a7650 Specify JVM target for inline tests 2019-06-04 14:56:14 +02:00
Mikhael Bogdanov
81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Mikhael Bogdanov
3c093f321d Support unbound callable function references in inliner 2019-06-04 14:56:12 +02:00
Sergey Igushkin
0b59d0b416 Fix testAndroidMppProductionDependenciesInTests Gradle version too low
The required Gradle version for AGP 3.3 is 4.10.1+. Use 5.0.
2019-06-04 15:36:22 +03:00
Dmitriy Dolovov
ef680cf332 KLIB reader: Add missed JARs to IDEA plugin 2019-06-04 12:40:56 +03:00
Yan Zhulanow
bc6f01805e Fix JVM test running in MPP projects (KT-30814) 2019-06-04 17:56:05 +09:00
Mikhail Zarechenskiy
6d3a7102d5 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 11:07:50 +03:00
Sergey Rostov
8dabf24b41 Gradle: provide descriptions for JS tasks
#KT-31560 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
fbefa17337 Gradle, NPM, windows: creating symlink without administrator privilege
#KT-31694 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
85adee9804 Gradle, js, npm: resolve and warn about clashes in packages_imported
#KT-31697 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
46a1ec28bf Gradle, npm: implement semver comparision 2019-06-04 10:00:58 +03:00
Sergey Rostov
619ee8717b Gradle, npm: extract semver utils to separate file 2019-06-04 10:00:58 +03:00
Sergey Rostov
42bcb81c08 Gradle, npm, imported packages: import multiple version to different dirs 2019-06-04 10:00:58 +03:00
Sergey Rostov
e557a3c3f2 Gradle, ProcessedFilesCache: delete everything on version change 2019-06-04 10:00:57 +03:00
Sergey Rostov
5b6c467e22 Gradle, ProcessedFilesCache: report target values clash 2019-06-04 10:00:57 +03:00
Sergey Rostov
5b21c935a4 Gradle, JS, NpmResolver: save imported packages cache state before calling npm 2019-06-04 10:00:56 +03:00
Sergey Rostov
fdbee7a99a Gradle, js, NPM: select one version between tools and all of compile configurations
#KT-31696 Fixed
2019-06-04 10:00:56 +03:00
Sergey Rostov
a37b38e891 Gradle, minor: remove unused import 2019-06-04 10:00:56 +03:00
Mikhael Bogdanov
bce774eda5 Jvm Ir. IrIntrinsicMethods.kt optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:46 +02:00
Mikhael Bogdanov
30ab11575d Jvm Ir. Optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:45 +02:00
Dmitriy Dolovov
171e226d58 Move 'cidrPluginsEnabled' Gradle flag to local.properties 2019-06-04 08:42:47 +03:00
Dmitriy Dolovov
bbdb5e5f0f Reworked joint build (kotlin + kotlin-ultimate)
- Root buildscript classpath no more depends on buildSrc.jar from kotlin-ultimate. This allows to have stable joint builds - w/o occasional "Unresolved reference" errors in buildscripts.
- kotlin-ultimate modules are now included into Kotlin project when two conditions are met: 1) Gradle parameter 'cidrPluginsEnabled' is turned on; 2) kotlin-ultimate Git repo is checked out right to the Kotlin project root (assuming there is 'kotlin-ultimate' directory inside the project root).
2019-06-04 08:42:22 +03:00
Igor Yakovlev
db4ba238eb Avoid to call delegate from isInheritorDeep in UL-class
(plus small refacrotoring)
2019-06-03 17:23:41 +03:00
Igor Yakovlev
eaa36d4d27 Fix kotlin.Deprecated annotation for UL-classes 2019-06-03 17:23:41 +03:00
Igor Yakovlev
2a729082a0 Add UltraLightFacadeClassTest 2019-06-03 17:23:41 +03:00
Igor Yakovlev
8707edfaa3 Disable to mangling facade functions + refactoring 2019-06-03 17:23:40 +03:00
Igor Yakovlev
ac85849721 Avoid access to delegate from KtUltraLightClass 2019-06-03 17:23:40 +03:00
Igor Yakovlev
3889b70f1e Avoid clsDelegate access from (UL-)KtLightClassForFacade 2019-06-03 17:23:40 +03:00
Igor Yakovlev
fa6b21357b Add cache to KLightClassForFacade 2019-06-03 17:23:40 +03:00
Igor Yakovlev
24253e21d0 Add ultraKtLightClassForFacade multifile support 2019-06-03 17:23:40 +03:00
Igor Yakovlev
86e9018f49 Add text functions to KtLightClassForFacade 2019-06-03 17:23:39 +03:00
Igor Yakovlev
852a4bc0ca Add support UL for FileFacade 2019-06-03 17:23:39 +03:00
Anton Bannykh
e996705b45 JS: simplify package metadata cache invalidation 2019-06-03 15:53:00 +03:00
Anton Bannykh
8ab9ef2afa JS: don't visit all descriptors on metadata serialization 2019-06-03 15:53:00 +03:00
Ilya Chernikov
0a6ade88cc Fix classpath detection from classloader resources 2019-06-03 13:57:20 +02:00
Sergey Igushkin
27aa3a573e Fix MPP source set dependencies missing in Android tests (KT-29343)
Add Kotlin source set dependencies to the Android source sets, and also
add aggregated Kotlin compilation dependencies to the dedicated
Android source sets of the Android variants.

Issue #KT-29343 Fixed
2019-06-03 14:53:38 +03:00
Sergey Igushkin
988df517dd Gradle HMPP support fixes after review
* Add version to project structure metadata
* Use a data class for module dependencies in project structure
* Use task registering API for new tasks
* Simplify code
* Extract compatibility wrappers
* Fix multi-file dependencies that transformations silently ignored
2019-06-03 14:47:09 +03:00
Sergey Igushkin
5d7bd6c01a Add API for IDE import of metadata dependency transformations 2019-06-03 14:47:08 +03:00
Sergey Igushkin
3c3a338770 Setup versions consistently only among published source sets
The common source sets that are not published (like commonTest) should
not affect dependency resolution for other source sets.

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-06-03 14:47:07 +03:00
Sergey Igushkin
0c9d962f9f MPP granular source set metadata support 2019-06-03 14:47:07 +03:00
Sergey Igushkin
fcb006b42a (minor) Rewrite CompilationSourceSetUtil
Add the API to access compilations by source set, which will be widely
needed for further MPP logic.
2019-06-03 14:46:51 +03:00
Alexander Gorshenev
10a54c2581 Moved the common klib writer from Kotlin/Native to util-klib 2019-06-03 14:38:48 +03:00
Alexander Gorshenev
7ddbd8ca80 Moved the common klib reader functionality from Kotlin/Native to util-klib 2019-06-03 14:38:48 +03:00
Alexander Gorshenev
d1390365de Moved basic classes from konan/utils to util-io 2019-06-03 14:38:48 +03:00
Igor Yakovlev
f5190f195d Add correct UL-method hasTypeParameters realization (#KT-30970 Fixed)
Incorrect realization is breaking-down of IDEA generic-type inference algorithm that leads to SOE.
2019-06-03 14:11:06 +03:00
Ilya Kirillov
f660faed97 New J2K: Wrap single annotation parameter to arrayOf if array type is required
#KT-31726 fixed
2019-06-03 13:02:48 +03:00
Dmitry Gridin
7bc2fcd657 Convert RemoveCurlyBracesFromTemplateIntention to inspection
Relates to #KT-31717
2019-06-03 16:37:37 +07:00
Dmitry Gridin
7f4d2891e8 Cleanup ReplacementPerformer 2019-06-03 16:36:50 +07:00
Dmitry Gridin
f5e83d7b47 Explicit package prefix should override implicit
#KT-29716 Fixed
2019-06-03 16:35:58 +07:00
Dmitry Gridin
20114a0868 Minor: cleanup packageUtils 2019-06-03 16:35:58 +07:00
Dmitry Gridin
f6a61e8034 Minor: cleanup ChangePackageIntention 2019-06-03 16:35:58 +07:00
Dmitry Gridin
4fa83a2fd7 Decrease severity of PackageDirectoryMismatchInspection to INFO
#KT-31716 Fixed
2019-06-03 16:35:58 +07:00
Dmitriy Novozhilov
ef91960fe9 [NI] Fix testdata after enabling NI in IDE tests 2019-06-03 12:13:31 +03:00
Dmitry Savvinov
dca23f871c Allow to force-require syntetic SAM-adapters even in NI
This is needed for some IDE clients, particularly, completion: even
though presenting only non-converted member (e.g., 'foo(Consumer<Int>')
is nominally OK, as resolution with NI is smart enough to accept 'foo { }'
for such a call, it is inconvenient for users (for example, hitting
enter would insert round brackets instead of a figure brackets)

This commit adds very-very narrow API (borderline hacky) in
JavaSyntheticScopes, to allow clients explicitly ask for a scopes with
force-enabled synthetic conversions. It fixes several tests, which had
started to fail after corresponding commit about NI and SAM-adapters
(fe5976d7f4), e.g.:
- Java8BasicCompletionTestGenerated.testCollectionMethods
- Java8BasicCompletionTestGenerated.testStreamMethods
- JvmBasicCompletionTestGenerated$Common$StaticMembers.testJavaStaticMethods
- JvmBasicCompletionTestGenerated$Java.testSAMAdaptersStatic
- JvmWithLibBasicCompletionTestGenerated.testSamAdapter
- JvmWithLibBasicCompletionTestGenerated.testSamAdapterAndGenerics

Note that changes are made in ReferenceVariantsHelper, which is used by
several other clients in IDE. Presumably, those changes are needed for
them too.
2019-06-03 10:46:53 +03:00
Dmitry Savvinov
eda975d317 Minor: reformat ReferenceVariantsHelper.kt 2019-06-03 10:46:53 +03:00
Sergey Rostov
00f8f09274 Gradle, js, npm: don't setup package manager without npm dependencies
#KT-31729 Fixed
2019-06-03 10:00:27 +03:00
Dmitry Savvinov
8caafa874e Advance Kotlin versions in some Gradle Tests
Those versions have been resolved from -dev repository, which got
cleared and those tests started to fail.

In long term, it would be nice to not use fixed Kotlin versions in
tests, but for now we just advance it to prevent tests from failing.
2019-06-03 08:17:25 +03:00
Mikhail Zarechenskiy
e15cb67e29 Fix exception from UAST on attempt to map non-fixed type variable
#KT-31723 Fixed
 #EA-126269 Fixed
 #EA-143705 Fixed
 #EA-143703 Fixed
 #EA-143694 Fixed
2019-06-03 02:04:56 +03:00
Mikhail Zarechenskiy
91bd11a6db Fix UAST tests for new-inference: adapt SAM-converted descriptors 2019-06-03 02:04:55 +03:00
Mikhail Zarechenskiy
010ac50243 Enable new type inference for UAST tests as for IDE tests 2019-06-03 02:04:53 +03:00
Roman
0163019295 [JVM IR] Unmute fixed test 2019-05-31 18:49:54 +03:00
Mikhail Zarechenskiy
268dddcb3d Remove restriction about JS_IR backend for test 2019-05-31 17:23:58 +03:00
Vyacheslav Gerasimov
cb7cdff2e0 192: Fix ultimate tests compilation for 192 platform 2019-05-31 16:32:11 +03:00
Vyacheslav Gerasimov
cf3a98123f 192: Fix uast tests compilation for 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
15c46aa9cc 192: Fix compiler.pro for 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
91bff66f29 192: Remove accessors for module introduces in 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
b7be99ffde 192: Fix variance related problems for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
637f7a8cab 192: Fix InlayHintTypeTestUtil for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
fac959ba1e 192: Fix FormatSettingsUtil for 192, can't access getProject any more 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
d5b7b520e0 192: Fix completion KotlinConfidenceTest for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
d58df2c107 192: Fix AbstractJavaToKotlinConverterForWebDemoTest for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
f935cfeda2 192: Remove override createAddPropertyActions, no more in JvmElementActionsFactory 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
979df225a7 192: Fix uast-kotlin for 192 platform 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
c2522535d9 192: Fix KotlinMPPGradleProjectTaskRunnerUtil usages of deprecated api 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
cd18d9d534 192: Add property accessor for myModule which is removed in 192 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
cf1e1e3a0c 192: Fix accessors to module & project in tests 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
05a2f5bda5 192: Fix nullability related problems for 192 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
57943768bf Build: Remove bunches for kotlin-compiler build script 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
593e67d47d 192: Add 192 platform IdeCompatibilityDsl 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
2d74560523 192: Build against Idea 192.4205.45 2019-05-31 16:32:08 +03:00
Vyacheslav Gerasimov
d740455e9f Build: Update list of redirected repositories 2019-05-31 16:32:08 +03:00
Ilya Chernikov
f986856d03 Improve classpath extraction from classloader:
- implement opt-in unpacking/caching of the jar collection archives,
  such as spring boot fat jars and WARs, to the temp dir, and creating
  a valid classpath from extracted archive
- turning it on for the new default jsr223 engine
- fallback to extracting classpath from resource URLs if the classloader
  is not known url-based one
- refactor and optimize extraction
- cache the last retrieved classpath in the default JSR-223 script engine
  factory
2019-05-31 14:06:25 +02:00
Ilya Chernikov
e95569a273 Report definition-related error diagnostic on the whole script file
#KT-31452 fixed
2019-05-31 13:34:17 +02:00
Dmitry Gridin
21c10af1a7 Fix tests in quickfix 2019-05-31 18:00:56 +07:00
Dmitry Gridin
605ee041a9 Remove CreateTypeAliasFromUsageFix
Relates to #KT-31519
2019-05-31 18:00:56 +07:00
Alexander Udalov
4c9e9b1f3a Fix KotlinReflectionInternalError on encountering 'clone' in a class
`RuntimeTypeMapper.mapSignature` threw exception because the descriptor
for `clone` was created manually in CloneableClassScope and therefore it
didn't have a JVM signature as in deserialized descriptors, and wasn't
recognized as a Java method either.

 #KT-22923 Fixed
2019-05-31 12:29:20 +02:00
Dmitriy Dolovov
2857c62dba Don't use plugin classloader to get Kotlin plugin info
Issue #KT-31598 Fixed
2019-05-31 13:26:39 +03:00
Roman Artemev
c2d118cb75 [JS IR BE] Improve error reporting 2019-05-31 13:14:43 +03:00
Roman Artemev
beb1ce55f8 [IR BE] Fix capturing of var-locals inside class/field initializers 2019-05-31 13:14:43 +03:00
Roman Artemev
5686de7e09 [JS IR BE] Make kotlinx.io compile
- Fix expect/actual default arguments
 - Fix dynamic type in inliner
 - Fix external varargs
2019-05-31 13:14:43 +03:00
Denis Zharkov
753a9a1c36 Fix performance regression caused by contracts
Do not obtain all children from KtBlockExpression when you only need
the first one.
It might be crucial for a huge blocks of code
2019-05-31 11:21:15 +03:00
Dmitriy Dolovov
16d05b6129 Get IDE plugin path from KotlinPluginUtil 2019-05-31 10:02:02 +03:00
Dmitriy Dolovov
fdf7b0c9fb Convert KotlinPluginUtil to Kotlin 2019-05-31 10:01:54 +03:00
Mikhael Bogdanov
79d855f7a4 Minor. Revert deleted by mistake test directive 2019-05-31 07:09:28 +02:00
Ilya Kirillov
72bedb63fa New J2K: add more string operations conversions 2019-05-31 00:25:53 +03:00
Ilya Kirillov
f03965995d New J2K: generate nj2k tests 2019-05-31 00:25:53 +03:00
Ilya Kirillov
c136e81427 New J2K: optimize imports in post-processings 2019-05-31 00:25:52 +03:00
Ilya Kirillov
269ca20950 New J2K: add number types conversions to post-processing 2019-05-31 00:25:52 +03:00
Ilya Kirillov
3944a976df New J2K: handle static imports from Java correctly & do not ignore imports in tests 2019-05-31 00:25:52 +03:00
Ilya Kirillov
879abdafc2 Preserve comments in shorten references processor for qualified expressions 2019-05-31 00:25:52 +03:00
Ilya Kirillov
39dfa631bf New J2K: do not ignore long expressions in LiftReturnOrAssignmentInspection in post-processing 2019-05-31 00:25:52 +03:00
Ilya Kirillov
8fa9b9923f Allow removing trivial property accessor body when the accessor can not be fully deleted in redundant getter/setter inspections 2019-05-31 00:25:52 +03:00
Ilya Kirillov
95a6f59c62 New J2K: preserve declarations order & place init sections to the end 2019-05-31 00:25:52 +03:00
Ilya Kirillov
ab26061b5e New J2K: fix testData 2019-05-31 00:25:52 +03:00
Ilya Kirillov
3a98b49556 New J2K: fix type in ast conversion name 2019-05-31 00:25:51 +03:00
Ilya Kirillov
621ae80f1d New J2K: rewrite getters and setters conversion in post-processing
KT-31700 fixed
2019-05-31 00:25:51 +03:00
Ilya Kirillov
63434fc46c New J2K: separate inspection like processings from others & remove boilerplate code in processings 2019-05-31 00:25:51 +03:00
Ilya Kirillov
d6e07ca693 New J2K: calculate type correctly for vararg parameter in nullability analysis 2019-05-31 00:25:51 +03:00
Ilya Kirillov
419f6c80de New J2K: filter out noinspection comments in resulted code 2019-05-31 00:25:51 +03:00
Ilya Kirillov
e04c984e48 New J2K: move all literal conversion stuff to LiteralConversion & add octal literals conversion 2019-05-31 00:25:51 +03:00
Ilya Kirillov
60b2b81e9c New J2K: preserve comments in DefaultArgumentsConversion 2019-05-31 00:25:51 +03:00
Ilya Kirillov
eed55a11ca New J2K: preserve comments in BuiltinMembersConversion 2019-05-31 00:25:51 +03:00
Alexander Udalov
ceecbfdcea Minor, fix kapt test data on comments
ClassFileToSourceStubConverter relies on JvmDeclarationOrigin which is
used in the codegen, and that origin has slightly changed for the
synthetic '$annotations' method (see
`MemberCodegen.generateSyntheticAnnotationsMethod`) in e9b50157
2019-05-30 19:30:46 +02:00
Ting-Yuan Huang
74e8c7c1c5 JVM_IR: generate default constructor
Quoted from https://kotlinlang.org/docs/reference/classes.html

"On the JVM, if all of the parameters of the primary constructor have
 default values, the compiler will generate an additional parameterless
 constructor which will use the default values. This makes it easier to
 use Kotlin with libraries such as Jackson or JPA that create class
 instances through parameterless constructors."
2019-05-30 18:53:27 +02:00
Georgy Bronnikov
440f327e74 JVM_IR: fix a typo in EnumWhenLowering 2019-05-30 19:04:31 +03:00
Georgy Bronnikov
d7dacef9af JVM_IR: correct RetentionPolicy annotation generation 2019-05-30 19:04:31 +03:00
Dmitry Savvinov
4f6d0ca1d1 Update missed tesdata
Was missed after 7daf12fa6d
2019-05-30 18:58:12 +03:00
Mikhail Zarechenskiy
0bc4022242 Revert "Temporary remove failing test for new inference about SAM conversions"
This reverts commit 5bcd974944.

 Fixed in 7c4101e2

 #KT-29561 Obsolete
2019-05-30 16:45:31 +03:00
Nikolay Krasko
465d21e6c5 Don't process invalid files in ReturnHintLinePainter (EA-141914) 2019-05-30 16:37:16 +03:00
Nikolay Krasko
7d00106813 Allow resolve on collecting reference data in copy-paste 2019-05-30 16:37:16 +03:00
Nikolay Krasko
a9329c5284 Minor refactoring in ModuleData tracker 2019-05-30 16:37:16 +03:00
Alexander Udalov
e72388895b JVM IR: invoke codegen after lowering all files in the module
Inspired by discussion in #2316
2019-05-30 13:28:31 +02:00
Igor Chevdar
b060acf01d KotlinMangler: added IrType.isInlined
Added possibility to specify when IrType corresponds to an inline class
2019-05-30 14:12:03 +03:00
Dmitry Savvinov
8e579855f2 [Testing] Support test roots in dependencies.txt 2019-05-30 12:32:39 +03:00
Dmitry Savvinov
f011c21c94 [Testing] Introduce ProjectResolveModel and parsing it from txt 2019-05-30 12:32:39 +03:00
Dmitry Savvinov
a59daafbb4 [Testing] Add more flexiblity to AbstractMultiModuleTest
- Preserve root names
- Provide an ability to transform copied file
- Allow passing several implemented modules in AbstractMultiModuleTest
2019-05-30 12:32:39 +03:00
Dmitry Savvinov
7daf12fa6d [Testing] Remove duplicate logic, clean-up CheckerTestUtil 2019-05-30 12:32:39 +03:00
Dmitriy Novozhilov
bcbbf4aba3 [NI] Fix replacing original in PropertyDescriptor 2019-05-30 11:01:10 +03:00
Simon Ogorodnik
88a9349f32 Use intersection of star projection type-param bounds instead of type 2019-05-30 09:52:02 +03:00
Yan Zhulanow
b48e0a89c5 Debugger: Hide synthetic '$completion' variable in Kotlin variables mode 2019-05-30 15:27:11 +09:00
Yan Zhulanow
bfb1d53ddf Debugger: Run control flow on code fragments (KT-30120) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
35c63db9bc Debugger: Support coroutineContext for suspend functions without suspend calls (KT-24829) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
b5f5149fc0 Add tooltip for Kotlin variables mode button (KT-30730) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
c17c15db42 Debugger: Fix memory leak in conditional breakpoints (KT-31195) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
999d5ce3bb Debugger: Fix VariableAsFunctionResolvedCall evaluation 2019-05-30 15:27:10 +09:00
Yan Zhulanow
4a90e9d0ab Debugger: Handle exceptions in async stack trace handler more gracefully (EA-141924) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
0a6a811c57 Debugger: Fix lvalue evaluation (KT-11663, KT-19980) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
bb0bc8a38a Debugger: Fix toTypedArray() evaluation (KT-8579) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
9ae8a8abf1 Debugger: Fix method evaluation on arrays (KT-11706) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
38dba20e24 Debugger: Allow super calls (KT-20560) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
cbbb3c35da Debugger: Fix evaluation for local extension functions (KT-13188) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
8b3c22cea6 Debugger: Support hypothetical synchronized methods in the main class 2019-05-30 15:27:08 +09:00
Yan Zhulanow
ee0daae2ab Debugger: Support synchronized blocks and functions in evaluator (KT-11888) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
55bbcc4601 Generate line numbers for closing '}' in 'init {}' blocks (KT-12787) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
a385b4d9d0 Debugger: Fix evaluation on value parameter name position (KT-30976) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
577b3e096f Debugger: Fix test (lines were changed because of the updated copyright) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
ae7550c5af Move out JVM debugger functionality 2019-05-30 15:27:07 +09:00
Dmitriy Novozhilov
5843336d42 Fix compiler errors in nj2k detected after changes in NI 2019-05-29 16:55:07 +03:00
Mads Ager
dc5f4ab240 Add annotation to static methods on DefaultImpls. 2019-05-29 15:37:09 +02:00
Vyacheslav Gerasimov
2fc2c8fa4c Minor: Cleanup android-sdk, remove obsolete comment & unused configuration 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
1152286ee3 Build: Add kotlin-dependencies to cache-redirector list 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
6b3f341ab5 Build: Publish jcabi-aether-1.0-SNAPSHOT to kotlin-dependencies as 1.0-dev-3
This allows to remove dependency on snapshot repository
https://oss.sonatype.org/content/repositories/snapshots
2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
9a9acd0fc1 Minor: Cleanup kotlin.buildSrc.prepare-deps/build.gradle.kts 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
0e1d15df5a Build: Drop android-dx from buildSrc 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
6a38cb050f Build: Add property for internal kotlin repo 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
2ce961a662 Build: Add kotlin-dependencies repo & update dx coordinates 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
aa79c1bcf6 Build: Extract publication for dependencies to publishing.gradle.kts 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
f5825a45f7 Build: Add bintray publication for dependencies/android-dx 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
10779ea397 Build: Extract android-dx to separate project with publishing 2019-05-29 15:08:04 +03:00
Vyacheslav Gerasimov
d0db006614 Build: Determine versions.properties location by buildscript.sourceURI 2019-05-29 15:08:04 +03:00
Alexander Udalov
2292a1a10e Ignore new daemon tests instead of muting them on buildserver 2019-05-29 13:18:27 +02:00
Mads Ager
5be0bd4a56 JVM_IR: Enable loadJava tests 2019-05-29 13:10:47 +02:00
Toshiaki Kameyama
65f06454be Add "Control flow with empty body" inspection
#KT-30970 Fixed
2019-05-29 18:04:24 +07:00
Alexander Udalov
d2fcb8cc6a Get rid of copy-pasted code from JavaSdkUtil
#KT-30973 Fixed
2019-05-29 10:50:37 +02:00
Dmitry Gridin
1c4fb9b00b ConstantConditionIfInspection.replaceWithBranch shouldn't remove subjectVariable with side effects
Relates to #KT-30975
2019-05-29 15:40:10 +07:00
Dmitry Gridin
e2d5e9a184 Only when keyword should be highlighted in WhenWithOnlyElseInspection
#KT-31673 Fixed
2019-05-29 15:40:10 +07:00
Toshiaki Kameyama
e955dcfc14 WhenWithOnlyElse: don't remove when subject variable if needed
#KT-30975 Fixed
2019-05-29 15:40:10 +07:00
Alexey Tsvetkov
7f1d30058a Fix IC test for multifile part with property
Our JPS and Gradle plugins handle
recompilation of multifile classes differently.

JPS plugin delegates handling to the JPS itself,
which tracks dependencies via bytecode,
and marks classes as dirty when they are affected.
So in JPS other parts of multifile classes are recompiled only
when a part's signature is changed.

In Gradle plugin we handle recompilation ourselves in
simpler way: any change in any part leads to a recompilation
of all parts of the same multifile class.

In future we should improve our Gradle plugin, but for now
I'm changing the test so that both JPS and Gradle tests
recompile all parts.

Also the dummy function is added to make sure that we
don't blindly recompile everything when a part is changed.
2019-05-29 10:23:19 +02:00
Alexander Udalov
c13bec0e41 Minor, simplify code in PropertyCodegen 2019-05-29 10:23:19 +02:00
Alexander Udalov
967a6bd80d Remove NotNull PSI element parameter from PropertyCodegen.generateBackingField
#KT-31131 Fixed
2019-05-29 10:23:19 +02:00
Alexander Udalov
e9b50157da Try loading PSI from descriptor in OtherOrigin constructor
To simplify several call sites
2019-05-29 10:23:19 +02:00
Alexey Tsvetkov
56d5846ef1 Add test for KT-31131 2019-05-29 10:23:18 +02:00
Dmitriy Novozhilov
bd87332b0c Fix compiler errors in compiler detected after enabling @OnlyInputTypes in NI 2019-05-29 10:57:08 +03:00
Dmitriy Novozhilov
e574106799 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed 2019-05-29 10:54:41 +03:00
Dmitriy Novozhilov
0f7e91ff6d [NI] Update testdata for stdlib diagnostic tests 2019-05-29 10:53:34 +03:00
Dmitriy Novozhilov
139497bafb [NI] Add checking @NotNull parameters for candidates 2019-05-29 10:53:07 +03:00
Dmitriy Novozhilov
7c4101e21c [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 10:35:46 +03:00
Anton Bannykh
dad334ffcd JS IR: ignore the new suspend callable reference test 2019-05-29 10:17:15 +03:00
Dmitry Gridin
f5796a303d Fix tests
Relates to #KT-30622
2019-05-29 11:00:28 +07:00
Dmitry Gridin
8988b4b344 Convert ReplaceSubstringIntention to ReplaceSubstringInspection
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
2310826ec9 Remove MergeWhenIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
41daf99346 Remove IfThenToDoubleBangIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
afcb2f3436 Remove ConvertIfWithThrowToAssertIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
d3339cae46 Merge ReplaceMathMaxWithCoerceAtLeastIntention & ReplaceMathMinWithCoerceAtMostIntention with ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
26478b1374 Remove ConvertTrimMarginToTrimIndentIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
0b9b49d7bc Remove ConvertTrimIndentToTrimMarginIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
91e9ed25f7 Remove ConvertNegatedBooleanSequenceIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
dd03a81309 Remove ConvertClassToSealedClassIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
1adc2ae4c8 Remove ConvertAssertToIfWithThrowIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Ilya Gorbunov
fe9bd9ee20 Fix method reference ambiguity in test after introducing 'capitalize' overload 2019-05-29 06:49:05 +03:00
George Gastaldi
d0d4d00379 build: add kotlin-compiler-embeddable to BOM 2019-05-29 05:21:49 +03:00
Ilya Gorbunov
8badfca459 Fix titlecase lowering in decapitalize
Replace isUpperCase() with !isLowerCase check to lower both
upper- and titlecased first chars.
2019-05-29 03:54:46 +03:00
Ilya Gorbunov
a921bd04e0 capitalize/decapitalize: improve docs, add one test 2019-05-29 03:54:46 +03:00
Jake Wharton
af31794f60 Add Locale-accepting overloads for (de)capitalize in JDK stdlib
#KT-28933 fixed
2019-05-29 03:35:33 +03:00
Mikhail Zarechenskiy
f702417655 [NI] Relax rules for call completion: require at least one constraint
It's enough to have at least one good constraint.

 Note that the whole algorithm can be a bit more general:
 we could check also Out<T>, In<T> and verify that T has good only
 lower constraint or upper constraint, but there are questions for
 types like Inv<Out<T>>, where T should have lower and upper constraints

 #KT-31514 Fixed
2019-05-29 02:14:00 +03:00
Mikhail Zarechenskiy
848640253a Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit f20ec3e0a6.
2019-05-29 01:31:28 +03:00
Mikhail Zarechenskiy
86a95e1a7b Revert "[NI] Add checking @NotNull parameters for candidates"
This reverts commit 910177ab17.
2019-05-29 01:31:27 +03:00
Sergey Igushkin
25371734e8 Make withJava() safe to call repeatedlt on same target 2019-05-29 01:06:27 +03:00
Andrey Uskov
9a4596eaba Fix compilation of of KotlinMPPGradleTaskRunner 2019-05-29 00:05:18 +03:00
Anton Bannykh
c3170d1908 JS: cache metadata, grouped by package FQN 2019-05-28 23:33:17 +03:00
Anton Bannykh
c1f69ca8d6 JS: prepare to cache package metadata 2019-05-28 23:33:17 +03:00
Anton Bannykh
fc7fea4863 JS: make .meta.js the same as before 2019-05-28 23:33:17 +03:00
Anton Bannykh
145ca7b6a9 JS: merge proto parts as bytes 2019-05-28 23:33:17 +03:00
Anton Bannykh
fbd59ba68a JS: lazy load special functions and source maps 2019-05-28 23:33:17 +03:00
Anton Bannykh
a3aca662c1 JS: improve json parsestring 2019-05-28 23:33:17 +03:00
Anton Bannykh
56915d1c07 JS: optimize JSON parser 2019-05-28 23:33:17 +03:00
Dmitry Savvinov
675f930566 Fix compilation in bunches
Change in bunches was forgotten in aeb7f8400a
2019-05-28 21:25:32 +03:00
Ilya Matveev
78ce34f223 Gradle, native: Remove K/N repo from Gradle integration tests 2019-05-28 20:26:29 +03:00
Ilya Matveev
5b64410259 Gradle, native: Remove kotlin native repo in DSL codegen 2019-05-28 20:26:29 +03:00
Ilya Matveev
5e66399284 Move some classes used by Gradle plugin from K/N shared 2019-05-28 20:26:29 +03:00
Ilya Matveev
b002d572fb Gradle, native: Correct path to LLVM in K/N tool runner
Currently we have the same directory as llvmHome and targetToolchain
but strictly speaking we need to use llvmHome.
2019-05-28 20:26:29 +03:00
Ilya Matveev
cfb8e75829 Revert "Use kotlin-native-shared in the Gradle plugin"
This reverts commit c9ed648303.
2019-05-28 20:26:29 +03:00
Ilya Matveev
9a5c9a2180 Revert "Store kotlin-native-shared version in the jar of the Gradle plugin"
This reverts commit 24588263ed.
2019-05-28 20:26:28 +03:00
Ilya Matveev
49bcbf00fe Revert "Fix IDEA import after including kotlin-native-shared in Gradle plugin"
This reverts commit 774dbcd6c0.
2019-05-28 20:26:28 +03:00
Ilya Matveev
02ffc4bb22 Split shared: Create KonanVersion from string 2019-05-28 20:26:28 +03:00
Anton Bannykh
052ddd60ce JS: support callable references on suspend functions (KT-30987 fixed) 2019-05-28 19:13:08 +03:00
Dmitry Gridin
aff8a3f97f Fix KNPE in OptimizedImportsBuilder
#KT-31637 Fixed
2019-05-28 21:46:48 +07:00
Alexander Udalov
f9d61f2dc7 Make inline+reified functions synthetic instead of private in bytecode
#KT-18563 Fixed
2019-05-28 16:17:49 +02:00
Alexander Udalov
a645b36688 Minor, restructure InlineOnly-related utilities 2019-05-28 15:56:15 +02:00
Alexander Udalov
b42adcd73d Restructure bytecode listing tests on InlineOnly/inline+reified 2019-05-28 15:56:15 +02:00
Sergey Rostov
1c6ce208a6 Gradle, JS: support exotic versions while converting to semver
#KT-31563
2019-05-28 16:40:41 +03:00
Ilmir Usmanov
5631306165 Wrap result method node with max stack calculator in inliner
#KT-31347 Fixed
2019-05-28 16:37:45 +03:00
Mads Ager
3f6492ab2a JVM_IR: Restore lost top-level declaration check in annotation gen.
When moving away from descriptors, this top-level declaration check
was lost. That leads to many useless annotation elements in
inner classes attributes for annotations that are not inner classes.
2019-05-28 16:12:49 +03:00
Ilya Matveev
7929a05ee3 Build: Add K/N repo into Gradle integration tests to fix JPS build 2019-05-28 16:08:27 +03:00
Natalia Selezneva
b5dbdc53d1 Pass environment variables resolving script dependencies
There is no option in UI to enable/disable passing those variables,
but during Gradle Sync environment variables are passed by default
Also Gradle expect that gradleOptions are passed but there is also no option in UI
(during Gradle Sync IDEA add some options but they shouldn't affect dependencies resolution process)
see GradleExeSettings.resolverExtension.getExtraCommandLineArgs

gradleWithConnection was removed because it isn't used by gradle because they need to manage the TAPI project directory

projectRoot was fixed to externalProjectPath because it can be overrided in settings.gradle

^KT-30974 Fixed
2019-05-28 16:05:46 +03:00
Dmitry Savvinov
893ac735bc Convert property initializer to getter in
JvmPlatforms.unspecifiedJvmPlatform

This unties static initialization loop which lead to NCDFE and other
issues.
2019-05-28 16:03:05 +03:00
Dmitry Savvinov
aeb7f8400a Rename platform to targetPlatform in KotlinFacetSettings to avoid ambiguity in Java 2019-05-28 16:03:05 +03:00
Andrey Uskov
6ff5dc179c Fix exception during mpp run task creation due to usage of deprecated api
#KT-31482 Fixed
2019-05-28 15:17:32 +03:00
Andrey Uskov
ec1d313ecb Fix ClassCastException during search of overriders
#EA-115095 Fixed
2019-05-28 15:16:33 +03:00
Andrey Uskov
08d1220728 Do not show UI dialog from a write action during work of intention
#EA-100676 Fixed
2019-05-28 15:15:58 +03:00
Mikhail Zarechenskiy
e366bac713 Fix debugger tests for new-inference
There is new child of `VariableAsFunctionResolvedCall` in
 new-inference: `NewVariableAsFunctionResolvedCallImpl`. So, in order to
 support both versions, just use parent class
2019-05-28 14:46:38 +03:00
Dmitry Savvinov
dd85dfbfde Extract common logic for parsing platform from test module name 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
8997fa52df Introduce unspecifiedJvmPlatform for clients without jvmTarget
Previously, a lot of clients used JvmPlatform as platform-marker,
without thinking about jvmTarget.

For the sake of migration, this commits introduced so-called
UnspecifiedJvmPlatform, which can be used for a time being, but
generally, all usages should be removed in  future.
2019-05-28 13:08:09 +03:00
Dmitry Savvinov
ef39e2a68f [Compatibility] Restore KotlinFacetSettings.getTargetPlatform() 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
716e55d171 [Compatibility] Restore KotlinProjectConfugirator.getTargetPlatform() 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
dfe0493f9a [Compatiblity] Restore IdePlatform as well as some related methods 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
1a11eaa4c6 Overload equals for JdkPlatform 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
9d0f518d62 Rename PlatformDependentCompilerServices -> PlatformDependentAnalyzerServices 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
3332cdfce8 [Compatibility] Restore ModuleSourceInfo.getPlatform() for compatibility 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
2caa1c3dd6 [Compatibility] Restore old TargetPlatform and subtypes for compatibility 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
bbe7a9790e Imitate old comparison behaviour when collecting dependencies
This is needed, because previously such code were not distinguishing
between different flavours of JVM or Common. Now we do, and, for
example, JdkPlatform(1.6) != JdkPlatform(1.8), which causes such
dependencies to be erroneously dropped
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
4116815a8d [Misc] Provide meaningful debugName for StorageManager everywhere 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
602f642018 [Injection] Make component containers composition more granular and flexible
Previously, containers set-up was performed by calls to static functions
like 'createContainerForLazyResolve', which would set-up whole container
from scratch.

This has several issues:
- complicates code re-use and encourages copy-paste of one and the same
set-up logic
- complicates composition of multiplatform containers (because each
set-up method relies on the fact that it should take an empty
container and compose it completely)

The idea of this commit is to split set-up methods into smaller ones,
with finer areas of responsibility, which allows to re-use them
in various scenarios (and, in particularly motivating composition
of multiplatform container)
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
72e28d37fc [Injection] Introduce PlatformSpecificExtensions and PlatformExtensionsClashResolver
This commit introduces the ability to register a PlatformExtensionClashResolver
in a container. Each PlatformExtensionClashResolver has a corresponding
PlatformSpecificExtensions.

If, during container composition, several instances of
PlatformSpecificExtensions were registred, instead of throwing
InvalidCardinalityException, corresponding PlatformExtensionClashResolver
will be asked to resolve clash.

This allows to make injection more composable and less coupled across
different contributors of service, providing a basis for such motivating
cases as composing containers with both JS and JVM services (for analysis
of multiplatform modules).
Previously, that would be impossible:
a) JS would inject default instances for some services which would clash
with non-default JVM services (like SyntheticScopes)
b) Also, there are a very few services for which *both* platforms provide
non-default implementations, so they should be merged manually on
case-by-case basis (e.g., IdentifierChecker)
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
b631e89ea7 [Injection] Annotate default services with @DefaultImplementation 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
d80eba31be [Injection] Discriminate default instances during clashes resolution
The idea is to try to resolve the dependency without considering default
instances first.

This makes containers more composable, e.g., it is now possible to put
several containers together as long as all except one provide default
implemenetation for some particular service (non-default implementation
will be automatically chosen, and all defaults will be discarded).
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
398d715fc6 [Injection] Minor: remove explicit injection of ExpressionTypingServices
They will be injected automatically anyways
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
c97138c0eb [Injection] Pull languageVersionSettings injection to 'configureModule' 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
89603327c5 [Injection] Minor: inline createLazyResolveSession 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
eb155dcf3b [Injection] Minor: inline configureModule overload without trace 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
b81b388b33 [Injection] Minor: inline createContainerForTopDownAnalyzerForJvm
Essentially, this function was used solely for setting
'useBuiltInsProvider' to 'true'; otherwise it were just delegating to
createContainerForLazyResolveWithJava, which were just increasing the
noise.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
70be224f0f [Injection] Minor: inline configureJavaTopDownAnalysis
It was used called only once, and hasn't provided any useful
abstraction.

Actually, this "cosmetic" refactoring makes similarities with other
platform-specific container set-ups cleare, which allows to make further
generalizations and simplifications.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
b54982a29a [Injection] Minor: reformat injection.kt 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
1606b3bf23 [Platform API] Make 'ModuleInfo.platform' non-nullable 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
2d528c6396 [Platform API] Remove IdePlatform, use TargetPlatform instead 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
2ebdd7d2b9 Add platform suffix to the name of created module in tests
This is needed because platform of the module is determined by the
suffix after last '-' in 'createModule', and for string 'test-module'
that would be 'module', which obviously doesn't make any sense.

Howwever, due to how MultiTargetPlatform was implemented, it was
possible to create platform with such name, and everything was fine
as long as no one actually tried to switch on such a malformed
"platform".

After switching to more strict TargetPlatform representation, some tests
that had been trying to create platforms with such names started failing.

Seems that it was purely a mistake introduced in the
af1264a46d, so this commit fixes it by
specifying proper module name
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
d5fbe59a3e [Platform API] Introduce fundamental abstraction of Platform
This is a large commit, which introduces general API for working with
abstraction of Platform.

- Add new abstraction to 'core' - SimplePlatform - which represents
exactly one platform
  - Clients are strongly prohibited to create instances of SimplePlatform
  by hand, instead, corresponding *Platforms abstraction should be used
  (e.g. JvmPlatforms, JsPlatforms, KonanPlatforms)

- Move TargetPlatform to 'core', it represents now a collection of
SimplePlatforms
  - Clients are strongly encouraged to use TargetPlatform
    (not SimplePlatform) in API, to enforce checks for multiplatform

- Provide a helper-extensions to work with TargetPlatform
(in particular, for getting a specific component platform)

- Remove MultiTargetPlatform in favour of TargetPlatform
  - Notably, this commit leaves another widely used duplicated abstraction,
    namely, IdePlatform. For the sake sanity, removal of IdePlatform is
    extracted in the separate commit.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
451d14e504 [Platform API] Minor: move some classes to separate files 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
bf51a402b9 Remove deprecated method 2019-05-28 13:08:06 +03:00
Dmitry Savvinov
f2a0a809f1 [Platform API] Split TargetPlatform into lightweight TargetPlatform and CompilerServices
This decouples simple data (TargetPlatform) from other subsystem-specific
logic (like default imports, built-ins, etc.).

Aside from purely aesthetic improvements, it also makes it easier
to move 'TargetPlatform' into core (see next commits)
2019-05-28 13:08:06 +03:00
Dmitry Savvinov
83914614b9 [Platform API] Clean-up some usages of Platform
Mostly unused imports. Also, in some places,
TargetPlatform/MultiTargetPlatform were just passed around without
actually using (e.g. in deserialization)
2019-05-28 13:08:06 +03:00
Dmitry Savvinov
7e1afdcd28 Remove internal API method which was deprecated in 1.3.0 2019-05-28 13:08:06 +03:00
Dmitry Savvinov
520e871280 Rename *AnalyzerFacade to *ResolverForModuleFactory to prevent confusion with other similar names 2019-05-28 13:08:06 +03:00
Alexander Udalov
082c337faa Support fake Java property overrides in function equality in bridges
A synthetic property descriptor created for `B.value` (see the added
test) should not be equal to the normal descriptor created by the fake
override construction algorithm. Otherwise we can't reach this synthetic
non-abstract descriptor when building bridges in `C`, which results in
exception.

 #KT-31367 Fixed
2019-05-28 11:50:13 +02:00
Alexander Udalov
d05e72dda8 Update bootstrap to 1.3.50-dev-526 2019-05-28 11:33:34 +02:00
Dmitriy Novozhilov
910177ab17 [NI] Add checking @NotNull parameters for candidates 2019-05-28 11:18:33 +03:00
Dmitriy Novozhilov
f20ec3e0a6 [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
There is added a new service named `SubstitutingScopeProvider`, that
  provides factory that creates captured types and approximator for them.
  In OI they are the same as before commit, for NI they are empty, because
  that approximation interferes with NI algorithm

That service is injected into function descriptors and property descriptors
  and used for creating `SubstitutingScope` with correct services

Also there is changed time when we approximate captured types in NI
  (after all call checkers)

#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Ilya Matveev
f47aafc471 Gradle, native: Rename test binary class: Test -> TestExecutable 2019-05-28 10:46:23 +03:00
Ilya Matveev
954fedc6f9 Gradle, native: Don't treat test output as stacktrace
Currently native test runner reports stacktraces using TC
service messages.
2019-05-28 10:46:23 +03:00
Ilya Matveev
48b1f71cef Gradle, native: Introduce separate binary type for tests
Earlier native tests were represented by the same binary type as product
executables. We also used to create test tasks in the same manner as run
tasks for product executables. Such tasks could be obtained used a property
of an executable binary with type Exec.

But now we have a separate class for test tasks. Also we probably will want
to create several tasks for the same test. So we cannot use the same run task
property for both test and product executables. Also representing test and
product executables by the same binary type leads to the fact that assemble
task execution causes building not only product binaries but also the test
ones.

This patch solves the issues described above by introducing a separate binary
type for tests. Such a test binary can be created in the same manner as other
binaries:

    kotlin.macosX64 {
        binaries {
            test("integration") { ... }
        }
    }

One test binary and a task executing it is created by the plugin out of the box.
This test binary replaces a test executable used to be created earlier.

Issue #KT-31609 Fixed
2019-05-28 10:46:23 +03:00
Mikhail Glukhikh
2db8409d85 FIR: introduce & resolve spread named arguments #KT-31575 Fixed 2019-05-28 10:20:42 +03:00
Mikhail Glukhikh
806d2d628c FIR Java: correctly handle overridden Kotlin properties in use-site scope 2019-05-28 10:20:41 +03:00
Mikhail Glukhikh
56435fa283 FIR Java: add default constructors 2019-05-28 10:20:40 +03:00
Mikhail Glukhikh
d0404b2c2a FIR resolve: check number of parameters when handling Java accessors 2019-05-28 10:20:38 +03:00
Mikhail Glukhikh
eaf7e46da3 FIR resolve bench: count implicit built-in type refs as resolved 2019-05-28 10:20:37 +03:00
Mikhail Glukhikh
459dcb4f57 FIR resolve: set implicit Unit type for block without result expression
This fixes most of "implicit error types"
2019-05-28 10:20:36 +03:00
Mikhail Glukhikh
d2bdbd8978 FIR resolve: record & check implicit extension receiver type properly 2019-05-28 10:20:35 +03:00
Mikhail Glukhikh
d9d582b226 FIR tower resolve: add level with implicit extension receiver 2019-05-28 10:20:33 +03:00
Mikhail Glukhikh
45b0f5a0ca Add FIR resolve test (call extension from extension) 2019-05-28 10:20:32 +03:00
Mikhail Glukhikh
bc336650ff More top-level FIR resolve tests (map, with) 2019-05-28 10:20:31 +03:00
Simon Ogorodnik
94dca1d467 Suspend resolution sequence on first inapplicability report 2019-05-28 10:20:29 +03:00
Mikhail Glukhikh
cb76ea5d14 FIR resolve: do not launch overload conflict resolve for erroneous 2019-05-28 10:20:28 +03:00
Mikhail Glukhikh
4d145db9f7 FIR resolve (by semoro): support correct type inference for generic args
This commit includes additional test and fixes e.g.
resolve of listOf() + listOf()
2019-05-28 10:19:12 +03:00
Mikhail Glukhikh
3cede7e827 Make FIR cone flexible type data class to improve constraint comparison 2019-05-28 10:19:08 +03:00
Mikhail Glukhikh
0d35c68f88 Use abstract 'createErrorType' in TypeApproximator to fix FIR assertion
NB: each type system should use its own error types
2019-05-28 10:18:36 +03:00
Simon Ogorodnik
36ab325394 Abstract FIR modularized tests 2019-05-28 10:18:35 +03:00
Simon Ogorodnik
60a73ca13f Report percents in FirResolveBench 2019-05-28 10:18:34 +03:00
Simon Ogorodnik
d3f00280e9 Disable data class copy function body in raw FIR
After this commit we require 'copy' body generation in FIR2IR converter
2019-05-28 10:18:00 +03:00
Simon Ogorodnik
a849cc7da4 Store type for already resolved FIR references properly 2019-05-28 10:17:59 +03:00
Simon Ogorodnik
58873b2d7b FIR resolve: set setter value-parameter type properly 2019-05-28 10:17:57 +03:00
Simon Ogorodnik
38d3438101 [FIR] Support withNullability for captured type 2019-05-28 10:17:56 +03:00
Mikhail Glukhikh
05e4539019 Set resolved type for lambdas properly during FIR resolve
Partially done by semoro
2019-05-28 10:17:31 +03:00
Mikhail Glukhikh
963ed44ce1 FIR: fix exception in ConeKotlinType.returnType 2019-05-28 10:17:25 +03:00
Mikhail Glukhikh
5c96fa0844 Raw FIR: set enum entry types to kotlin.Enum to avoid their resolve 2019-05-28 10:17:23 +03:00
Mikhail Glukhikh
6589fbbfbb Raw FIR: set val setter to null instead of default one 2019-05-28 10:17:22 +03:00
Mikhail Glukhikh
0aaf8c7689 Fix FIR Java enhancement of java.util.Map & similar supertypes 2019-05-28 10:17:21 +03:00
Simon Ogorodnik
cef108a5ae FIR: implement qualifier resolver 2019-05-28 10:17:05 +03:00
Jiaxiang Chen
d3cc0e6ce9 JVM_IR: Optimize disjunction condition with intrinsic function call. 2019-05-28 08:48:43 +02:00
pyos
6d19eb1853 JVM_IR: sidestep defective getMethodAsmFlags when inlining lambdas
It uses isStaticMethod to determine whether to set ACC_STATIC, which is
not correct (see PR #2341). This results in using incorrectly typed
opcodes (as all arguments are shifted by 1) when modifying the inlined
lambda's bytecode. For example, in the test added by this commit, these
opcodes are inserted to spill the stack into locals before calling
another inline function.

Because getMethodAsmFlags is used by the non-IR backend (see PR #2341
again for why changing stuff might not be a good idea), the proposed
solution is to ditch it completely and override generateLambdaBody in
IrExpressionLambdaImpl to use FunctionCodegen's IR-based flag
computation logic.
2019-05-28 08:38:16 +02:00
Steven Schäfer
82e4985aa0 Fix dispatch receiver in JvmStaticAnnotationLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
0d31106738 Fix return type in ToArrayLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
64120e8220 Fix return type in SyntheticAccessorLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
e6f65d4260 Fix return types in EnumClassLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
2da0315d2e Fix IR types in JVM_IR BridgeLowering
Properly implement the java erasure rules on IrTypes and fix the types
for dispatch and extension receivers.
2019-05-28 08:10:45 +02:00
Eduard Wolf
c885cadde4 KT-31639: Fix Iterables.drop integer overflow 2019-05-27 23:07:14 +03:00
Leonid Startsev
e5565b817b Create marker for Gradle Plugin Portal for kotlinx-serialization compiler plugin
#KT-27612 fixed
2019-05-27 19:59:13 +03:00
Sergey Igushkin
a4069c031e Fix Android 3.3 Gradle integration tests running with low Gradle version 2019-05-27 18:12:17 +03:00
Mikhail Zarechenskiy
9f62920556 Fix compilation against bootstrap compiler 2019-05-27 17:32:25 +03:00
Mikhail Zarechenskiy
c30e045b1b [NI] Don't consider Any!-constraint from upper bounds as more specific
#KT-31624 Fixed
2019-05-27 17:32:25 +03:00
Mikhail Zarechenskiy
8bef345f0f Duplicate test for NI and OI to avoid mismatch of diagnostics
There is a problem with different order of diagnostics for NI and OI,
 so, in order to fix this test, it was duplicated
2019-05-27 17:32:24 +03:00
Mikhail Zarechenskiy
95710f4087 [NI] Avoid forcing resolve for array access expression
#KT-31606 Fixed
 #EA-126523 Fixed
2019-05-27 17:32:24 +03:00
Mikhail Zarechenskiy
fe5976d7f4 [NI] Don't apply SAM-conversion for type that is subtype of function
Plus, don't get synthetic candidates as all candidates are creating
 by conversion

 #KT-31503 Fixed
2019-05-27 17:32:23 +03:00
Svyatoslav Kuzmich
ceaa64dfb1 [IR BE] Make lateinit fields and variables nullable 2019-05-27 16:24:22 +03:00
Kirill Shmakov
362e056b18 Expand acronym for K/N definitions file 2019-05-27 15:58:04 +03:00
Simon Ogorodnik
50a7d3f037 Adjust performanceTest jvm args 2019-05-27 15:00:46 +03:00
Alexander Udalov
a3d8fdf30a Fix compilation of kotlin-maven-plugin
Also remove the remaining usage (in a comment) of
JvmAbi.DEFAULT_MODULE_NAME
2019-05-27 13:21:31 +02:00
Alexey Tsvetkov
ad7de948f6 Update bootstrap
The new version fixes NSME from CoreJarFileSystem (KT-31574)
Also see 6addb24e4b
2019-05-27 13:08:34 +03:00
Mikhail Zarechenskiy
af15e9b93f [NI] Fix assertion: KotlinTypeMarker -> KotlinType 2019-05-27 01:01:09 +03:00
Mikhail Zarechenskiy
a0234241f5 [NI] Approximate components of raw types separately
This is needed as components can have different type arguments
2019-05-26 21:41:53 +03:00
Mikhail Zarechenskiy
8910859fd1 [NI] Implement various optimizations for incorporation algorithm
Mostly, these optimisations are picked from the old inference.
 Also, remove exponential complexity for flexible types in approximation,
 note that more correct fix for this would be to introduce new types
 that corresponds just to platform types to avoid nullability problems,
 but due to complexity it will be done later

 #KT-31415 Fixed
2019-05-26 21:32:46 +03:00
Mikhail Zarechenskiy
bbec3bf001 Fix exception on star import from typealias
#KT-30983 Fixed
2019-05-26 21:32:07 +03:00
Mikhail Zarechenskiy
b84b890250 Add tests to preserve current behavior for upcoming changes
##KT-30983 In Progress
2019-05-26 21:32:03 +03:00
Mikhail Zarechenskiy
5173d5e359 [NI] More accurate handle of capture types from subtyping
#KT-31520 Fixed
2019-05-26 21:31:59 +03:00
Mikhail Zarechenskiy
cc29ca02f8 [NI] Don't loose inference session during property resolve
#KT-31620 Fixed
2019-05-26 21:31:54 +03:00
Ilya Chernikov
e7c99cd494 Fix scripting-compiler tests, add them to the global scriptingTest task 2019-05-25 10:10:34 +02:00
Ilya Chernikov
deb74acc88 [minor] fixes after review 2019-05-25 10:10:34 +02:00
Ilya Chernikov
b97813f2b0 Implement test run on embeddable jars for jsr223 and scripting host tests...
also:
- add missing tests to the global scriptingTests task
- extract jsr223 tests into separate project
- fix dependency in jsr223 embeddable jar
2019-05-25 10:10:33 +02:00
Ilya Chernikov
a3d1fe312e Refactor default JSR-223 engine implementation:
- rename classes for clarity
- sort out dependencies
- move common pars to jvm-host jar
- switch to configurations only customization
2019-05-25 10:10:33 +02:00
Ilya Chernikov
8cd5b11da5 Add evaluation context passing to the evaluation config refiners 2019-05-25 10:10:33 +02:00
Ilya Chernikov
5d8c2ae429 Fix dependencies to compiler in scripting modules 2019-05-25 10:10:32 +02:00
Ilya Chernikov
37d859c122 Move scripting jvm host tests to a separate project...
to solve problems with testing with direct dependency on proguarded compiler
2019-05-25 10:10:32 +02:00
Ilya Chernikov
1527ef7640 Drop dependencies to script-util from new scripting infrastructure 2019-05-25 10:10:32 +02:00
Ilya Chernikov
59dc546a54 Convert JvmGetScriptingClass to object to simplify (de)serialization 2019-05-25 10:10:31 +02:00
Ilya Chernikov
7ae2054cba Add a link to hostConfiguration from compilation and evaluation ones
also add possibility to supply functional defaults for keys in PropertiesCollection
2019-05-25 10:10:31 +02:00
Ilya Chernikov
30c6147223 Get rid of UsefulTestCase to avoid dependencies, parallelize tests 2019-05-25 10:10:30 +02:00
Ilya Chernikov
8c7460451e [minor] fix some warnings 2019-05-25 10:10:30 +02:00
Ilya Chernikov
1dd197f201 Add missing scripting tests to the global task, make them parallel 2019-05-25 10:10:30 +02:00
Ilya Chernikov
29ba650c77 Fix main-kts script classpath calculation 2019-05-25 10:10:29 +02:00
Ilya Chernikov
ea068e483c Implement JSR-223 functionality on top of the "new" REPL 2019-05-25 10:10:29 +02:00
Ilya Chernikov
46915df56f Implement "legacy" REPL wrappers on top of the "new" scripting infrastructure 2019-05-25 10:10:29 +02:00
Ilya Chernikov
010ae5326d Create core environment in test mode properly 2019-05-25 10:10:28 +02:00
Ilya Chernikov
89006f16cd Prepare scripting infrastructure for REPL:
- refactor script compiler to simplify extending it for repl
- add repl snippet compilation functions to the new scripting compiler
- extract util functions into appropriate files
- extract repl part into separate class
- extract bridge definition and related definitions into separate file
2019-05-25 10:10:28 +02:00
Ilya Chernikov
a4c049d26e Replace message collector with reporting lambda
to simplify usages and slightly reduce dependencies
2019-05-25 10:10:28 +02:00
Ilya Chernikov
61c1312f1a Add another method for fetching classpath from classloader, refactor 2019-05-25 10:10:27 +02:00
Alexander Udalov
55f4c067e2 Fix compilation of uast-kotlin-idea for 182
Caused by 4e15b95d17
2019-05-24 18:06:57 +02:00
Alexander Udalov
0fb33b82ff Fix compilation of uast-kotlin for 182
Caused by 4e15b95d17
2019-05-24 17:02:28 +02:00
Alexander Udalov
5812d28b80 Update ReadMe of kotilnx-metadata-jvm
- remove the requirement to use Bintray repo; kotlinx-metadata-jvm is
  published to Maven Central now
- remove the note about kotlin.Metadata being internal; it's public
  since 1.3
2019-05-24 14:42:26 +02:00
Alexander Udalov
15bfbf59a7 Minor, unmute MetadataSmokeTest.lambdaVersionRequirement 2019-05-24 14:42:26 +02:00
Alexander Udalov
3564f4ae40 Make KmExtensionType.klass private, add KmExtensionVisitor.type
Since the only use case of KmExtensionType in user code is checking if
it equals some other KmExtensionType instance, we'd like to hide as much
of its implementation details as possible, in case we want to change it
in the future
2019-05-24 14:42:26 +02:00
Alexander Udalov
fd00999771 Render contracts in kotlinp, fix minor bug in kotlinx-metadata-jvm 2019-05-24 14:42:25 +02:00
Alexander Udalov
2a3786e3f8 Retain "is moved from interface companion" property flag in kotlinx-metadata-jvm
#KT-31338 Fixed
2019-05-24 14:42:25 +02:00
Alexander Udalov
cfa3509860 Add loadJava/compiledKotlinWithStdlib tests to KotlinpCompilerTestDataTest 2019-05-24 14:42:25 +02:00
Alexander Udalov
fe52f5fc7c Rename "desc" parameters in kotlinx-metadata-jvm to "signature" 2019-05-24 14:42:25 +02:00
Alexander Udalov
4e15b95d17 Minor, inline JvmAbi.DEFAULT_MODULE_NAME 2019-05-24 14:42:25 +02:00
Alexander Udalov
9e2733915b Add module name JVM extensions to class/package in kotlinx-metadata-jvm
#KT-31308 Fixed
2019-05-24 14:42:25 +02:00
Alexander Udalov
8ec466c2cc Fix compilation error in FlattenStringConcatenationLowering
See cf13293363 and 8dc34ae7b9, which were merged independently
2019-05-24 14:38:08 +02:00
Alexander Udalov
8dc34ae7b9 IR: rename {name,fqName}Safe -> {name,fqName}ForIrSerialization
These properties have a very specific detail in their behavior, in that
the constructor's name is set to be "<init>". While this is OK for the
IR serialization, this may not always be expected in other cases, and
their rather common names (`name`, `fqNameSafe`) suggested that these
properties could be used in generic contexts.

Change all usages outside IR serialization to use
`IrDeclarationWithName.name` and nullable
`IrDeclarationWithName.fqNameWhenAvailable` instead
2019-05-24 14:09:09 +02:00
Alexander Udalov
4e1effd065 Restore behavior in mapDefaultMethod for non-IR backend
Although the intention of the change 9894c216c1 (#2341) was sensible, it
unfortunately caused the type mapper to map a default method incorrectly
under certain _undiscovered_ circumstances, which leads to incorrect
bytecode being generated. Specifically, this led to an exception:

java.lang.NoSuchMethodError : org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches$Companion.compileCodeFragmentCacheAware$default(Lorg/jetbrains/kotlin/psi/KtCodeFragment;Lcom/intellij/debugger/SourcePosition;Lkotlin/jvm/functions/Function0;ZILjava/lang/Object;)Lkotlin/Pair;

in a developer branch where this class was refactored and moved to
another module. I was not able to determine the exact reason of this
error, so I'm workarounding it by limiting this change to the IR backend
only (where it's needed), and postponing the investigation of the
failure above for now.
2019-05-24 11:40:58 +02:00
Sergey Bogolepov
cc26fd143e Shiny new shared version. 2019-05-24 12:39:55 +03:00
pyos
4cd4ea126b JVM_IR: generate more accessors for use in inline functions 2019-05-24 11:27:19 +02:00
pyos
cf74b5e87b Mark callable reference classes as synthetic 2019-05-24 11:27:19 +02:00
pyos
e7dd41743f Prefix captured variables' names with $ 2019-05-24 11:27:19 +02:00
Dmitry Gridin
ba390202c8 Remove resolve from isEffectivelyActual && isExpectDeclaration
Relates to #KT-29731
2019-05-24 15:55:01 +07:00
Dmitry Gridin
61a740457d Suggest dialog if all members without actual modifier
Relates to #KT-31476
2019-05-24 15:55:01 +07:00
Dmitry Gridin
8dd1389979 Minor: remove redundant condition 2019-05-24 15:55:01 +07:00
Dmitry Gridin
9c4318a39c Minor: cleanup OverrideMemberChooserObject 2019-05-24 15:55:01 +07:00
Dmitry Gridin
76c2c2a5e9 Allow "Add val/var to primary constructor parameter" for inline & annotation classes
Relates to #KT-29731
2019-05-24 15:55:01 +07:00
Dmitry Gridin
f2bd58c030 Expand "Create expected..." also to a members if an expect class doesn't exist
#KT-31272 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
47e3a26749 Fix "Create expect function" for primary constructor
#KT-31518 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
b575ed390a Add a dialog to select members for export in expect class
#KT-31476 Fixed
#KT-31446 Fixed
#KT-31033 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
9a910ef144 Fix modifiers for ACTUAL_RENDERER 2019-05-24 15:55:01 +07:00
Dmitry Gridin
a9ed042199 Minor: refactoring 2019-05-24 15:55:01 +07:00
Dmitry Gridin
1097bc76af Don't suggest Add val/var to parameter at expect class constructor
#KT-29731 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
af9d9eacb1 Minor: refactoring AddValVarToConstructorParameterAction 2019-05-24 15:55:00 +07:00
Dmitry Gridin
379152303c Minor: refactoring 'refactoring' package 2019-05-24 15:55:00 +07:00
Dmitry Gridin
98a4c4588e Don't suggest might be const on actual member declaration
#KT-27822 Fixed
2019-05-24 15:55:00 +07:00
Svyatoslav Kuzmich
142c9e2a8b [JS RUNTIME] Workaround invalid IR in ArraySorting 2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
a3677d6fc0 [JS IR RUNTIME] Fix types in kotlin.js.captureStack 2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
7aed8d2f75 [JS IR BE] Fix lowering types nullability 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
ec34cdaae9 [JS STDLIB] Fix: Object.keys() returns list of strings 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
cd55e6b1e5 [JS IR BE] Use static fields instead of variables in enum lowering 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
30ada0ccbb [JS] Fix type in vararg test 2019-05-24 11:50:46 +03:00
Ting-Yuan Huang
bdcd6f73b1 Move tailrecPhase before defaultArgumentStubPhase
So that default values can be copied to the recursive call sites.
2019-05-24 09:51:07 +02:00
Vadim Brilyantov
6addb24e4b #KT-31574 : Keep CoreJarFileSystem in compiler jar to save clearHandlersCache 2019-05-23 21:39:05 +03:00
Vyacheslav Gerasimov
af63ef2405 Build: Actualize repository list in cacheRedirector.gradle.kts 2019-05-23 18:11:30 +03:00
Vyacheslav Gerasimov
4e229437f3 Build: Remove unnecessary repositories from idl2k 2019-05-23 18:11:29 +03:00
Vyacheslav Gerasimov
b88d9d62b8 Build: Extract cache redirector to script & add verification task 2019-05-23 18:11:29 +03:00
Vyacheslav Gerasimov
2bbf92a6c3 Build: Remove unused ktor repo from buildscript block 2019-05-23 18:11:28 +03:00
Vyacheslav Gerasimov
bda676ed26 Build: Redirect all urls starting with mirrored urls 2019-05-23 18:11:28 +03:00
Vyacheslav Gerasimov
7e61183ee1 Build: Move kotlinNativeRepo to :kotlin-gradle-plugin
the only one project using it
2019-05-23 18:11:28 +03:00
Dmitriy Novozhilov
ffc0276215 Fix compiler testdata broken in 95544b0 2019-05-23 17:46:16 +03:00
Nikolay Krasko
e38ad3a513 Temporary allow resolve in write action for insert handler 2019-05-23 16:25:09 +03:00
Nikolay Krasko
78569c62c0 Additional test for multiple comments in copyright updater 2019-05-23 16:25:09 +03:00
Nikolay Krasko
136cbd195b Fix copyright updater in scripts (KT-30133)
#KT-30133 Fixed
2019-05-23 16:25:09 +03:00
Nikolay Krasko
aa01328d13 Add tests for copyright updater 2019-05-23 16:25:08 +03:00
Nikolay Krasko
d32d715cd1 Move copyright extension out of jvm to common idea module 2019-05-23 16:25:08 +03:00
Nikolay Krasko
314b29f223 Fix background for uneditable text panes in Kotlin update (KT-29667)
#KT-29667 Fixed
2019-05-23 16:25:08 +03:00
Sergey Rostov
00ed49df68 JPS Build: rename packedJars property to embedded, get rid of ShadowJar
Configuration should have name "embedded" for IDEA import.
ShadowJar doesn't required anymore as it is already embedded in
 default jar task.
2019-05-23 16:12:03 +03:00
Natalia Selezneva
710c2cd0a4 JPS Build: rename packedJars property to embedded 2019-05-23 15:14:30 +03:00
Toshiaki Kameyama
3bca1a50e3 Move variable declaration into when: fix comment place
#KT-31362 Fixed
2019-05-23 19:01:24 +07:00
Leonid Startsev
b5c4f3ecc8 Coerce property value from correct type after retrieving it
#KT-25497 fixed
 Fixes https://github.com/Kotlin/kotlinx.serialization/issues/434
2019-05-23 14:21:09 +03:00
Leonid Startsev
9ce1f843e3 Remove non-type annotations from type serializer analysis
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/450
2019-05-23 14:21:09 +03:00
Mikhail Glukhikh
728459a504 Add IR for-in-range test 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
139557e641 FIR2IR: support super-types & type parameters for external class 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
a973a21ec6 FIR2IR: support assignments of local variables 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
68da1a97d1 Add fib test to FIR resolve tests 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
f3960c9482 Preliminary implementation of parts & facade in FIR-based compiler 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
2bf80ff64e FIR: support copy functions in data classes 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
d9261acdfc Raw FIR builder: extract 'generateComponentFunctions' for data class 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
672c172c99 [FIR] Make result type after safe-call nullable (for nullable receiver) 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
f7b6fec70c [FIR] Transform explicit receiver of QAE properly 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
27a1ec3817 [FIR] Allow nullable receiver type in case of safe-calls 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
b28207deca FIR2IR: support fields in Java FIR 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
6c313895df [FIR] Do not enhance java fields to firProperty 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
397aaa189e [FIR] Allow type-variables in general subtyping with cone context 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
20ba15a429 [FIR] Typing for annotation calls 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
c168c22fba Render property accessors in html fir dump 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
9266a2cdba Add equals/hashCode to some FIR cone types 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
aa96837758 [FIR] Introduce unchecked not-null cast as internal operation for !!, ?: 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
b469eb293b [FIR] Typing for try-catch 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
30e097a1e0 Fix modifiers order and repeating in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
58fd62fd49 Fix try catch rendering in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
9398addb9d Fix cycle avoidance in FIR implicit type resolve
This commit fixes the following case:
transformer visiting it twice before reporting cycle
fun foo() = foo()
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
26974788e9 FIR2IR converter: handle receivers and parents more correctly 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
90009f002c Add FIR test for 'Exception' constructor resolve ambiguity (type alias) 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
b72f3aa206 Remove code duplication in KotlinToJvmCompiler (old FE vs FE IR)
Related to KT-31265
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
05154d24d4 Select stub or real symbol for java.lang.Class in IR dependent on mode
This commit fixes some black-box IR tests broken by stub introduction
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
f4fdc66a34 Introduce experimental FIR compiler #KT-31265 Fixed
This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
2019-05-23 14:02:06 +03:00
Mikhail Glukhikh
892419c08a Generate stub java.lang.Class in IR JvmSymbols instead of scope reading
Before this commit, java.lang.Class was read via JvmBackendContext,
its module descriptor and its package member scope.
However, this works only for old FE with descriptors and
descriptor-based scopes available.
2019-05-23 14:02:06 +03:00
Ting-Yuan Huang
0aee2d0568 Fix signature generation for calls to enum and inner class constructors
The synthesized arguments caused the size of default value mask off by
one when it is close to the boundary of Int.SIZE, which in turn
resulted in wrong signature at call sites.
2019-05-23 12:29:57 +02:00
Ivan Gavrilovic
72fdc648ff If incremental KAPT is disabled, do not analyze classpath
When incremental apt mode in KAPT is disabled, do not analyze
classpath to determine the type of the annotation processors. Instead,
just mark them all as non-incremental.
2019-05-23 19:09:28 +09:00
Peter Xu
a639607821 Revert obsolete code introduced in KT-12402
The classes being filtered have been renamed months ago. The change
committed in KT-12402 is no longer relevant as the underlying issue has
been fixed.
2019-05-23 19:09:28 +09:00
Ivan Gavrilovic
b609fe529c Handle return result of dir creation/deletion in kapt
#KT-31322
2019-05-23 19:09:27 +09:00
Ivan Gavrilovic
f60bfc34c0 Remove generated sources and classes for full KAPT build
When running incremental annotation processing in KAPT,
even if incremental flag is enabled, and full rebuild should
be performed (e.g. in presence of dynamic non-incremental APs),
make sure generated sources and classes are removed.

 #KT-31322 fixed
2019-05-23 19:09:27 +09:00
Vladimir Krivosheev
757b4b3910 Do not use constructor injection for app level extension KotlinClassWithDelegatedPropertyRenderer (KT-31266) 2019-05-23 19:09:27 +09:00
Yan Zhulanow
a0778ad703 Revert "Kapt: Always use raw types for annotation parameter types (KT-30346)"
This reverts commit 66754e62
2019-05-23 19:09:27 +09:00
Yan Zhulanow
9a5bbcb00b Pill: Recognize 'embedded' configuration as 'compile' in JPS 2019-05-23 19:09:27 +09:00
Dmitriy Novozhilov
95544b0970 Add wrappers on KotlinType in EffectSystem
Also that commit removes usages of builtins inside
  effect system and starts refactoring of functor
  composition via composition instead of inheritance.

There are some changes in testdata related to inference of recursive
  functions with implicit return types.

After this commit they all are marked as unresolved. It happens because
  those functions have DeferredType as return type, and computing this
  type produces recursive exception, which provides “typechecker
  recursive problem” diagnostic.

Before this commit, function call was completed successfully, because
  call completer didn’t computed that type, and computation of DeferredType
  were triggered only in `DataFlowAnalyzer.checkType`.
Now, effect system tries to compute that type while wrapping KotlinTypes
  into ESTypes, and effect system itself is triggered in in call completer,
  so, call completion doesn’t finish and function call is marked as unresolved.

#KT-31364
2019-05-23 12:23:22 +03:00
Dmitriy Novozhilov
fb77e1f0bd [NI] Fix recursion in contract declaration analysis.
#KT-30410 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
8d5c61f3ab [NI] Return error type for unsupported descriptors in callable reference inference 2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b4c8c79931 [NI] Add check for non-null argument type in arguments check
#KT-31461 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b323298b0e [NI] Remove deep types in commosn super type for recursive types
#KT-30411 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
f54653eb2b [NI] Fix error type approximation in ILTApproximatorConfiguration
#KT-31441 Fixed
2019-05-23 12:22:42 +03:00
Sergey Rostov
6f9ef0d4b6 Gradle, js: fix js test frameworks DSL for groovy
#KT-31566 Fixed
2019-05-23 10:09:14 +03:00
Sergey Rostov
ebe3ccee8b Gradle, test reports: NewMultiplatformIT.testJavaSupportInJvmTargets
"check" task, now creates aggregate report for all gradle versions,
so this test is affected too
2019-05-23 10:09:13 +03:00
Sergey Rostov
348e29f24b Gradle, tests: introduce kotlin.tests.individualTaskReports
This property required for getting individual junit.xml files that is
currently used in test run assertions.
2019-05-23 10:09:13 +03:00
Sergey Rostov
22bc99f527 Gradle, js, single platform projects: create single test aggregator
Extract KotlinTestsRegistry service for customizing aggregated test tasks
naming.
2019-05-23 10:09:13 +03:00
Sergey Rostov
a5664207d5 Gradle, js, tests: always create a jsTest task for compatibility
This requires runnable aggregate test task even if there are not tests in it.
That, in turn, requires support aggregate test tasks hierarchy.
Also TestReport integrated in aggregate for all gradle versions (was for 5 only).

#KT-31527 Fixed
2019-05-23 10:09:13 +03:00
Sergey Rostov
78fe2fde33 Gradle, libWithTests test: check js tests running, add test results assertion 2019-05-23 10:09:13 +03:00
Sergey Rostov
709afdfa45 Gradle, testing test execution: support asserting reports from multiple tasks at once 2019-05-23 10:09:13 +03:00
Sergey Rostov
a13f1a5e67 Gradle, js, webpack: fix compatibility with older gradle version 2019-05-23 10:09:12 +03:00
Sergey Rostov
603fb8a53d Gradle, js, npm: try fixing project version to semver
JS package managers requires it.

#KT-31563 Fixed
2019-05-23 10:09:12 +03:00
Ilmir Usmanov
e7c78d8d7e Update bootstrap
Update reference public API. Before 266976ac1e
suspend inline functions with crossinline parameters were effectively
inline-only. Fixing it exposed suspendCoroutine as public API.
Update jps artifacts after bootstrap.
2019-05-23 09:28:31 +03:00
Ilya Kirillov
ff774f6249 New J2K: Run nj2k tests by default 2019-05-22 22:20:18 +03:00
Ilya Kirillov
9ccedc5bc4 New J2K: Fix wrong line separators on windows
It causes some inspections in post-processing to work not properly
2019-05-22 22:20:18 +03:00
Ilya Kirillov
f0012de6ea New J2K: add string method conversions 2019-05-22 22:20:18 +03:00
Ilya Kirillov
54432448e3 New J2K: correctly remove redundant property type in a case of nullable initializer 2019-05-22 22:20:17 +03:00
Ilya Kirillov
8f5c690cdd New J2K: do not convert var to val if super property is var 2019-05-22 22:20:17 +03:00
Ilya Kirillov
fa8a067c85 Fix losing flexible type enhancement in type substituting
It breaks `org.jetbrains.kotlin.nj2k.NewJavaToKotlinConverterSingleFileTestGenerated.ToArray#testToArray` test due to losing external nullability annotations
2019-05-22 22:20:17 +03:00
Ilya Kirillov
0a974cd419 New J2K: remove unused dependency from nj2k-services 2019-05-22 22:20:16 +03:00
Ilya Kirillov
c9decd5dc9 New J2K: correctly retrieve all type variables in printing 2019-05-22 22:20:16 +03:00
Ilya Kirillov
7db4958a17 New J2K: fix tests due to changes in inspections behaviour 2019-05-22 22:20:16 +03:00
Ilya Kirillov
37f8d72756 New J2K: make inner private constructors public when accessed 2019-05-22 22:20:16 +03:00
Ilya Kirillov
78fd56bdf0 New J2K: Fix running some post processings in incorrect thread
#KT-31234 fixed
2019-05-22 22:20:15 +03:00
Ilya Kirillov
90ab39f50f New J2K: Fix CCE in post processing
#KT-31217 fixed
2019-05-22 22:15:28 +03:00
Sergey Igushkin
8b150d2b07 Fix Android 3.3 Gradle integration tests running with low Gradle version 2019-05-22 18:11:18 +03:00
victor.petukhov
d4515031de Report warning about implicitly inferred nothing only for return position
^KT-31535 Fixed
2019-05-22 15:45:59 +03:00
Roman Artemev
72f7287ad2 [IR BE] Fix array constructor loop. Use index parameter as immutable value 2019-05-22 15:18:13 +03:00
Roman Artemev
dfa38f4a4d [JS IR BE] Fix state machine generation in case of composition of loops, inline functions and finally blocks
* lower finally blocks in any cases
 * do not optimize exit blocks for if-statements
2019-05-22 15:18:13 +03:00
Roman Artemev
9c7d47789c [JS IR BE] Implement type check for SuspendFunctionN 2019-05-22 15:18:13 +03:00
Steven Schäfer
9894c216c1 Fix test for static default methods in KotlinTypeMapper 2019-05-22 13:33:08 +02:00
Steven Schäfer
cf13293363 Use FQ names for string plus intrinsic in FlattenStringConcatenationLowering 2019-05-22 12:14:43 +02:00
Alexander Udalov
43bf962d79 Fix CLI test data on -XXLanguage arguments
We should use '\:' instead of ':' because the latter is replaced to the
path separator in AbstractCliTest.readArg which is ';' on Windows.
2019-05-22 08:48:37 +02:00
Alexander Udalov
d340f6dc62 Minor, simplify code in parseCommandLineArguments 2019-05-22 08:48:37 +02:00
Ilmir Usmanov
effbcdaf70 Do not generate $$forInline suffix for enclosing method
in OUTERCLASS field.

The inliner generates two versions of suspend functions/lambdas in
inline functions: with state-machine and without. The former is used
to call the function from Java or via reflection and have ordinary
name, while the latter is used by inliner and have $$forInline suffix.
The inliner throws the state-machine version away, duplicates
$$forInline version and then call state-machine generator.

If these suspend functions/lambdas are not going to be inlined,
$$forInline version is not generated. However, all objects, which are
used in these suspend functions/lambdas, have $$forInline version
written to OUTERCLASS field. This leads to errors by proguard.
Since they are used in both state-machine version and for-inline ones,
we can simply remove $$forInline suffix from OUTERCLASS field and this
fixes the issue.

 #KT-31242 Fixed
2019-05-21 21:09:36 +03:00
Svyatoslav Kuzmich
dd6bc100ed [JS IR BE] Don't detach assignment operator from receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
5495da5241 [JS IR BE] Allow empty call arguments only for external functions 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
e9ceee388e [JS IR BE] Don't transform toString with extension receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
3153a7dd7e [JS IR BE] Fix boolean and/or generation 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
b8bbcb3f93 [JS IR BE] Copy type metadata for Boolean, Char and Long varargs 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
59617c97b4 [JS IR BE] Fix VarargLowering
- Enable empty vararg transformation for all IrFunctionAccessExpression
- Fix empty vararg boxing
- Refactor inline class boxing logic
- Fix types of generated expressions
2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
f80b6ff947 [JS IR BE] Put file names into JsDoc 2019-05-21 19:19:31 +03:00
Sergey Igushkin
71bd88bdb3 Fix the AGP deprecation warning on usage of getPackageLibrary, KT-30784
Use the new API that returns the task provider, if available.

Issue #KT-30784 Fixed
2019-05-21 19:08:29 +03:00
Ilya Gorbunov
0a3ebb5780 Unmute tests for JVM_IR that pass after making assertFailsWith inline 2019-05-21 18:53:53 +03:00
Ilya Gorbunov
6632cf5b1d Add hidden methods to keep binary compatibility in kotlin-test for JVM 2019-05-21 18:53:52 +03:00
Ilya Gorbunov
22694fa6b0 Make assertFails(With) inline-only functions
So that the lambda passed to these functions can capture suspend
function calls.

#KT-31194 Fixed
2019-05-21 18:53:52 +03:00
pyos
6b2d874ccc JVM_IR: generate non-null assertions for arguments 2019-05-21 18:30:27 +03:00
Ilmir Usmanov
266976ac1e Fix Java interop of inline suspend functions with suspend parameters
In 1.3.31 I fixed Java interop for inline function with coroutines
(TL;DR: when we need a state machine, generate two methods: one with
normal name, and the other one with $$forInline suffix, for the inliner
to use, just like inline suspend functions), however, I forgot a case
with inline suspend function with inline suspend function parameter.
In this case, the compiler a generated two functions, as needed, but,
neither of them had a state-machine. This change adds the state-machine
for the method with normal name. Note, that suspend inline functions
with crossinline parameter, which are also supported by the change,
did not cause incorrect behaviour, since until now they were generated
as synthetic.

 #KT-31354 Fixed
2019-05-21 17:50:25 +03:00
Georgy Bronnikov
2b9e05e30f JVM_IR: copy-paste parameter name generation from descriptor-based code 2019-05-21 17:24:53 +03:00
Jiaxiang Chen
afcbd76c9e Implement stub methods generation for Kotlin Immutable Collection classes.
This change is to fill the gap between Kotlin Collection
classes(immutable) and Java Collection classes(mutable), to avoid
calling an unsupported operation like remove() on an immutable class in
jvm.
2019-05-21 17:20:20 +03:00
Elena Lepilkina
8c3cef97bd New shared version 2019-05-21 16:56:39 +03:00
Mikhail Glukhikh
0cf318918c Clean & fix tests in "replace manual range with indices / iteration"
Related to KT-14344
2019-05-21 13:34:29 +03:00
Natalia Selezneva
7c46338181 Drop ScriptBinariesScopeCache from plugin.xml because it was moved to ScriptDependenciesCache
^KT-31521 Fixed
2019-05-21 12:07:11 +03:00
Mikhael Bogdanov
007af75e1e Properly calculate call site file in JVM IR inliner 2019-05-21 07:42:16 +02:00
Mikhael Bogdanov
6ef3e9ea42 Minor. Code clean 2019-05-21 07:42:15 +02:00
Mikhael Bogdanov
c630df3e49 Simplify code 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
de62f0123b Minor. Apply minor TODOs 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
b8b2607a02 Minor. Clean up code 2019-05-21 07:42:13 +02:00
Igor Yakovlev
f044d654f0 Fix KotlinLintTest.parcel test
Added plugin classpath of android compiler extensions to module facet
2019-05-20 19:54:46 +03:00
Benjamin Orsini
3e39f26379 Add map() documentation sample
* docs: add map() sample
* docs: add samples for Map and CharSequence
* docs: add another sample for Maps.map()
2019-05-20 19:20:09 +03:00
pyos
08ea982688 Remove imports of javafx from Gradle build files 2019-05-20 17:31:28 +02:00
Vyacheslav Gerasimov
c2a2d80d4c Build: Minor cleanup & format root build.gradle.kts 2019-05-20 15:16:22 +03:00
Vyacheslav Gerasimov
40e9f48bd0 Build: Fix cache redirector configuration for all projects
Since we forcing project evaluation in root build script cache redirector
should be configured before we do so, otherwise `afterEvaluate` is not called
2019-05-20 15:16:22 +03:00
Vadim Brilyantov
d5be5bd96e Fix obsolete compiler classpath in SourceSectionsTest 2019-05-20 14:23:34 +03:00
Igor Yakovlev
611b6f36ce Remove redundant import from QuickFixMultiFileTestGenerated 2019-05-20 12:50:09 +03:00
Mikhail Glukhikh
b68e536e2a Add note about inspection highlighting range 2019-05-20 12:31:58 +03:00
KilianCallebaut
3451c60f93 Suggest to replace manual range with explicit indices or iterable
#KT-14344 Fixed
2019-05-20 12:24:52 +03:00
Alexander Udalov
8cda5cb849 Regenerate tests 2019-05-20 11:18:54 +02:00
Toshiaki Kameyama
2c424afefa Elvis -> if intention: don't produce boilerplate code for return/break/continue/throw in RHS
#KT-14369 Fixed
2019-05-20 11:15:41 +03:00
Natalia Selezneva
160de2dbe2 Do not load script dependencies if all script templates aren't loaded 2019-05-20 10:41:15 +03:00
Natalia Selezneva
58eca451c4 Sdk passed in script dependencies should be used during script resolve
PsiElementFinder doesn't find classes from sdks that aren't Project SDK, so when Script Sdk differs from it we need to additionally search classes in script sdk using KotlinScriptDependenciesClassFinder (as we do for classes from ScriptDependencies.classpath)

^KT-31152 Fixed
2019-05-20 10:41:15 +03:00
Natalia Selezneva
5bc7b61497 Refactoring: move ScriptBinariesScopeCache to ScriptDependenciesCache 2019-05-20 10:41:14 +03:00
Natalia Selezneva
c2717b3006 Filter out all non JavaSdk from script sdks 2019-05-20 10:41:14 +03:00
Natalia Selezneva
144ff8ae91 Refactoring: move method that find sdk for script to ScriptDependenciesManager 2019-05-20 10:41:14 +03:00
Natalia Selezneva
2f5deefd0a Scripts refactoring: move all scripts caches to ScriptDependenciesCache
Introduce base class for caches based on SLRUMap (with write lock) to avoid exceptions with concurrent map modifications
2019-05-20 10:41:13 +03:00
Natalia Selezneva
1ef4d987d1 Add debug log for script dependencies loading process 2019-05-20 10:41:13 +03:00
Sergey Rostov
6388cdc3b7 Gradle, js, npm: skip KotlinProjectExtensions from different class loaders 2019-05-20 09:55:37 +03:00
Sergey Rostov
9a90627b32 Gradle, js: fix supporting sub targets DSL in build.gradle.kts 2019-05-20 09:55:36 +03:00
Sergey Rostov
3a9f3525f1 Gradle, js, npm: skip old Kotlin2JsPlugin compilations 2019-05-20 09:55:36 +03:00
Sergey Rostov
7589d89a59 Gradle, js: create run task only when project evaluated
As it may be created after js target configuration by java application plugin
2019-05-20 09:55:36 +03:00
Sergey Rostov
15e0d6af92 Gradle, js, npm: fix case when resolver visits dependents projects first 2019-05-20 09:55:36 +03:00
Sergey Rostov
52f01ef43f Gradle, js: implement NpmSimpleLinker for cases when there are no npm dependencies 2019-05-20 09:55:36 +03:00
Sergey Rostov
75708dad87 Gradle, js: fix task input annotations 2019-05-20 09:55:36 +03:00
Sergey Rostov
48fd3b6b87 Gradle, tests: don't use gradle testing internals by default 2019-05-20 09:55:35 +03:00
Ting-Yuan Huang
75646f97a4 MoveCompanionObjectFields: copy constants into interfaces
Fields having const attribute in companion objects are observable in
Java and should be copied to outer interfaces.
2019-05-20 08:43:00 +02:00
Toshiaki Kameyama
6ff776ba65 Convert property to function: fix incorrectly conversion when property has explicit generic type
#KT-29192 Fixed
2019-05-19 14:57:25 +07:00
Toshiaki Kameyama
354f8f0bf1 Redundant 'suspend' modifier inspection: don't report when function has suspend operator invoke
#KT-25465 Fixed
2019-05-18 11:54:57 +03:00
Sergey Rostov
cf5577dfa6 Gradle, tests: fix cleanAllTests task name 2019-05-18 08:15:43 +03:00
Sergey Rostov
cec2e8c61a Gradle, js: update npm packages versions 2019-05-18 08:15:42 +03:00
Sergey Rostov
775ed2f9e5 Gradle: introduce "target" DSL function for single platform plugins 2019-05-18 08:15:42 +03:00
Sergey Rostov
b8fd4f56bb Gradle, js: introduce commonJs() dsl function 2019-05-18 08:15:42 +03:00
Sergey Rostov
83042afd5c Gradle, js, webpack: report progress
#KT-31013
2019-05-18 08:15:41 +03:00
Sergey Rostov
77dd806742 Gradle, js, yarn: split into workspaces and simple implementations
#KT-31018
	#KT-31017
2019-05-18 08:15:41 +03:00
Sergey Rostov
fab879bf33 Gradle, js, npm: store imported packages as yarn workspaces
#KT-30530
2019-05-18 08:15:41 +03:00
Sergey Rostov
64f997daa4 Gradle, tests: fix type in "prepend" 2019-05-18 08:15:40 +03:00
Sergey Rostov
68cb28d76f Gradle, js, karma: source maps support
#KT-31478
	#KT-31011
	#KT-30573
2019-05-18 08:15:40 +03:00
Sergey Rostov
9a6a2e14a5 Gradle, js, tests: don't add prefix if platform and/or sub target name is null 2019-05-18 08:15:39 +03:00
Sergey Rostov
5d8f2acf5f Gradle, js: create npm packages per compilation
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
b195d18d2d Gradle, js: resolve npm dependencies without task only during IDEA import
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
09e81ddd21 Gradle, js: create one npmResolve per build (share between subprojects)
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
8166cfb054 Gradle, js, npm: remove hoisted gradle node modules. Split results collection from shared cache.
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
eb3c701040 Gradle, js, npm: resolver between projects
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
5cfe117fd7 Gradle, js: use project.whenEvaluated instead of project.afterEvaluate 2019-05-18 08:15:37 +03:00
Sergey Rostov
2d51e2bca5 Gradle, js, dsl: use ConfigureUtil.configure for Groovy compatibility 2019-05-18 08:15:37 +03:00
Sergey Rostov
04a5b5a367 Gradle, js, krama: use web pack config directory
#KT-31011
2019-05-18 08:15:37 +03:00
Sergey Rostov
c2a6654194 Gradle, js: don't use any subtarget by default 2019-05-18 08:15:36 +03:00
Sergey Rostov
2a2f59ae1c Gradle, js, run: fix run dependencies on browserRun and nodeRun 2019-05-18 08:15:36 +03:00
Sergey Rostov
156d50646d Gradle, js, test: add basic @Input for test frameworks settings 2019-05-18 08:15:36 +03:00
Sergey Rostov
e435b9352a Gradle, js: aggregate jsTest task should work the same way as all tests aggregator
E.g: individual test tasks should not fail build, aggregate reports should be created.
Also this task should not be included in check (as all tests should be already executed
from the all tests aggregated task).
2019-05-18 08:15:35 +03:00
Sergey Rostov
26c2afd8d5 Gradle, js, karma: show output as progress 2019-05-18 08:15:35 +03:00
Sergey Rostov
c7d52331f7 Gradle, js, yarn: remove outdated warning about yarn workspaces
#KT-31018
	#KT-31017
2019-05-18 08:15:35 +03:00
Sergey Rostov
3ede15b2b2 Gradle, js: fixes for groovy dsl 2019-05-18 08:15:34 +03:00
Sergey Rostov
7e4eaa8210 Gradle, js, browser: best effort for parsing karma suite names
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
236dfa98b6 Gradle, js, browser: fix karma.conf.js writer
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
14d399e9ab Gradle, js, browser: fix run 2019-05-18 08:15:33 +03:00
Sergey Rostov
422ad763e4 Gradle, js: fix resolving required dependencies
#KT-31011
2019-05-18 08:15:33 +03:00
Sergey Rostov
9610c60b17 Gradle, nodeJs: fix tests 2019-05-18 08:15:33 +03:00
Sergey Rostov
a13a86a543 Gradle, js: revert to storing compile output inside node_modules
#KT-30530
Currently kotlin JS compiler generated `require('a.js')` for test -> main
dependencies. This is not worked in layout with compile output at project
work dir (will work if compiler will generate `require('a_test.js')`).
2019-05-18 08:15:32 +03:00
Sergey Rostov
b9f69ffe79 Gradle, js: extract NpmProjectModules to separate file
#KT-30530
2019-05-18 08:15:32 +03:00
Sergey Rostov
e2aafd5512 Gradle, js, node: fix source map support configuration
#KT-30573 Fixed
2019-05-18 08:15:31 +03:00
Sergey Rostov
1c3bb8529a Gradle, js: fix nodejs run target 2019-05-18 08:15:31 +03:00
Sergey Rostov
c8e8224005 Gradle, js: restore umd by default 2019-05-18 08:15:31 +03:00
Sergey Rostov
6229b8682e Gradle, js: fix karma.conf.js by wrapping config in function
#KT-31011
2019-05-18 08:15:30 +03:00
Sergey Rostov
8e2075ebcc Gradle, js: implement resolving node modules according to https://nodejs.org/api/modules.html
#KT-30530
2019-05-18 08:15:30 +03:00
Sergey Rostov
d08402a00c Gradle, js: fix requiredDependencies resolve 2019-05-18 08:15:30 +03:00
Sergey Rostov
1fe84c71e4 Gradle, js: fix NodeJsExec 2019-05-18 08:15:29 +03:00
Sergey Rostov
77959cc0af Gradle, js: use js compilation only after target configuration 2019-05-18 08:15:29 +03:00
Sergey Rostov
baf9ecd641 Gradle, JS: make KotlinWebpack.configDirectory optional
#KT-31013
2019-05-18 08:15:29 +03:00
Sergey Rostov
c0deea33bb Gradle, JS: resolve NPM dependencies inside task when possible
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
a69881850b Gradle, JS: introduce RequiresNpmDependencies
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
5ec501dce0 Gradle, JS: extract npm package constants
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
3797ec9255 Gradle, JS: introduce inner browser and nodejs inner targets
#KT-30747 Fixed
2019-05-18 08:15:27 +03:00
Sergey Rostov
066efc3732 Gradle, JS: nodejs target 2019-05-18 08:15:27 +03:00
Sergey Rostov
a609476245 Gradle, JS, webpack: source maps support
#KT-31013
2019-05-18 08:15:27 +03:00
Sergey Rostov
f28ff64e9f Gradle, JS: new nodejs project layout
#KT-30530
2019-05-18 08:15:26 +03:00
Sergey Rostov
eb7d09a562 Gradle, JS: webpack support
#KT-31013
2019-05-18 08:15:26 +03:00
Sergey Rostov
32ddc2318a Gradle, tests: clean should depend on cleanAllTests 2019-05-18 08:15:26 +03:00
Sergey Rostov
101c3588b3 Gradle, testsL fix ijListenTestTask 2019-05-18 08:15:25 +03:00
Sergey Rostov
312830ac4b Gradle, npm: resolve node_modules at parents, return local NodeJsExtension at NodeJsPlugin.apply 2019-05-18 08:15:25 +03:00
Sergey Rostov
4f4fc74b16 Gradle, yarn: get recursively resolved dependencies
#KT-31018 Fixed
	#KT-31016 Fixed
	#KT-31017 Fixed
2019-05-18 08:15:25 +03:00
Sergey Rostov
b96f26cc77 Gradle: improve tasks registration API, fix test tasks registration
Previously test tasks may be created inside other registration task
lambda which may be called lazily. This is illegal in Gradle.

Also let introduce Project.createOrRegisterTask on Project receiver
and reified type parameter.
2019-05-18 08:15:25 +03:00
Sergey Rostov
39ce257e64 Gradle: webpack
#KT-31013 Fixed
	#KT-31014 Fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
5372fcef69 Gradle, tests: remove "Task" suffix from KotlinTest tasks (as for jvm) 2019-05-18 08:15:24 +03:00
Sergey Rostov
3dae2739a4 Gradle, js: karma
#KT-31011 fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
92910ec3e9 Gradle, js: mocha
#KT-31010 Fixed
2019-05-18 08:15:23 +03:00
Sergey Rostov
4c2c8a1788 Gradle, npm: disable manageNodeModules by default
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
d82725718a Gradle, js: run tests using the new project-wide node_modules
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
a8799f5a8d Gradle: npm integration using yarn
#KT-31018 Fixed
2019-05-18 08:15:22 +03:00
Sergey Rostov
69f9e30e5a Gradle, Tests runner: update tests, fix tests on Windows 2019-05-18 08:15:22 +03:00
Sergey Rostov
9938b7fcd0 Gradle, Native: don't capture output if treatOutputAsStracktrace enabled
#KT-30529
2019-05-18 08:15:22 +03:00
Sergey Rostov
7830d204aa Gradle, tests: cleanAllTests task
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
8b16f182f6 Gradle, tests: show test results in IDE
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
125dc65178 Gradle: Kotlin/Native stack trace parser
#KT-30526
	#KT-30529
2019-05-18 08:15:21 +03:00
Sergey Rostov
0304f090e8 Gradle: JS stack trace parser
#KT-30526
2019-05-18 08:15:20 +03:00
Sergey Rostov
e013645d87 Gradle, test: allTests task, same class and method names for jvm, js and native
#KT-30691 Fixed
	#KT-31448 Fixed
2019-05-18 08:15:20 +03:00
Ilya Gorbunov
a83d301b50 Pack stdlib tests into a separate archive
So that kotlin-native could download stdlib tests and compiler test data
from different builds.
2019-05-18 04:41:29 +03:00
Nikolay Krasko
ef70e9db19 Don't use light classes for navigation element (KT-10215)
Place KotlinNavBarModelExtension before Java extension because it
substitutes non-java elements to files.

 #KT-10215 Fixed
2019-05-17 21:43:58 +03:00
Toshiaki Kameyama
0a4d21c51f Sort by class name in navigation bar (KT-10215)
#KT-10215 Fixed
2019-05-17 18:15:58 +03:00
Vadim Brilyantov
9052c5e529 Fix typo in new-daemon ignored tests that was leading to compile errors 2019-05-17 18:13:46 +03:00
Vadim Brilyantov
caaf847052 Mute all new-daemon tests 2019-05-17 15:51:53 +03:00
Vadim Brilyantov
01a05a5495 Move daemon jar from compiler 2019-05-17 15:51:52 +03:00
Vadim Brilyantov
ced973b707 Introduce new Kotlin Daemon without RMI abstraction 2019-05-17 15:51:51 +03:00
Igor Yakovlev
a3f718733d Fix of ConvertJavaInterfaceToClass test
Platform is trying to modify the class inheritance list during intension (see the test name above) action process but it cause a cross-language changes via PSI.
To make this possible LightClasses are supports this behaviour with a little support of it (inheritance list Add and inheritance list element Delete are supported).
It need's to be done for UL-classes in same way.
2019-05-17 14:48:47 +03:00
Toshiaki Kameyama
04638eea6b Remove braces intention: fix caret position
#KT-31443 Fixed
2019-05-17 11:18:44 +07:00
Steven Schäfer
90c3269502 Fix type parameters in WrappedClassConstructorDescriptor
IrConstructorCall gets type parameters from the class in addition to the
constructor declaration. This behavior is already implemented for
ClassConstructorDescriptorImpl, but was not implemented for
WrappedClassConstructorDescriptor, leading to missing type arguments for calls
to constructors generated in a lowering pass.
2019-05-16 20:26:18 +02:00
Roman Artemev
77c0e591af Set correct target backend 2019-05-16 19:27:41 +03:00
Roman Artemev
c352117eab [JS IR BE] Set correct runtime for JS IR BE tests 2019-05-16 19:27:41 +03:00
Roman Artemev
fabd306437 [JS IR BE] Fix varargs for inline arrays 2019-05-16 19:27:41 +03:00
Roman Artemev
600ad7e088 [JS IR BE] Fix KProperty access in case of both receivers 2019-05-16 19:27:41 +03:00
Roman Artemev
cd3fd60dd7 [JS BE] Extract backend specific code from shared stdlib sources 2019-05-16 19:27:41 +03:00
Roman Artemev
02d84bf061 [IR BE] Delegate coroutine naming strategy to platform part 2019-05-16 19:18:54 +03:00
Alexander Udalov
21d0beb94b Do not render stack traces and bytecode on muted failed tests locally
This was already disabled on buildserver with a35f368ce0, but makes
sense locally too because otherwise IntelliJ renders a lot of output
which takes lots of memory and slows down the test runner
2019-05-16 17:30:21 +02:00
Mads Ager
34cf5a19df JVM_IR: Support @JvmSynthetic annotations. 2019-05-16 17:07:22 +03:00
victor.petukhov
8bdc5f981e Actualize spec tests 2019-05-16 12:24:18 +03:00
Dmitriy Novozhilov
96a3831feb [NI] Add capturing receiver type for callable references
#KT-30292 Fixed
2019-05-16 10:50:30 +03:00
Steven Schäfer
f5a78213b2 Fix type of super 2019-05-16 07:58:45 +02:00
Alexey Tsvetkov
209a5d8464 Do not expose paths with placeholders in JS IC caches
#KT-31310 Fixed
2019-05-16 04:01:26 +03:00
Mads Ager
d2c372a4f7 JVM_IR: No EnclosingMethod attribute for member classes.
The comment in the code is correct that EnclosingMethod
attributes should only be generated for local and
anonymous classes. We were generating them for member
classes as well which leads to invalid class files.

With this change I had to mute one more tests. That is
because we lose the parent method and therefore we
see a class as a member class instead of a local class.
With the old descriptor based check that test still
passes.
2019-05-15 19:22:38 +02:00
Igor Yakovlev
79aa954682 Fix render of classpath log message for UL-classes 2019-05-15 18:48:53 +03:00
Elena Lepilkina
1c4ad193b3 Update kotlin-native-shared version 2019-05-15 16:07:54 +03:00
Mikhael Bogdanov
fe5a9f16a1 Minor. Remove obsolete workaround 2019-05-15 14:21:11 +02:00
Mikhael Bogdanov
812b766894 Remove hack with targets. Add target for most recent jdk 2019-05-15 14:21:11 +02:00
Alexander Udalov
a53fa0dfbf Minor, optimize newly added tests on unsigned intrinsics
Remove "JVM_TARGET: 1.6" directive from box tests and remove tests with
JVM target 1.8. By default, box tests are run with JVM target 1.6, and
there's an additional configuration `codegenTarget8Jvm8Test` that runs
all box tests with JVM target 1.8.

Also, remove box tests with JVM target 1.6. They aren't needed because
even if we manage to generate incorrect bytecode with target 1.6, the
corresponding box tests will catch that
2019-05-15 13:30:16 +02:00
pyos
f392b027fa JVM_IR: support references to Java fields 2019-05-15 13:29:48 +02:00
Alexander Udalov
e191eef10a Minor, refactor system properties in CodegenTestCase 2019-05-15 13:25:47 +02:00
Alexander Udalov
b602c08773 Remove javaFilesDir parameter of CodegenTestCase.doMultiFileTest
Create TestFile instances for .java sources similarly to .kt sources,
and write them to a temporary directory via writeJavaFiles in each test
where this is needed
2019-05-15 13:25:14 +02:00
Alexander Udalov
7fdb9c990e Reformat and cleanup most JVM codegen test classes 2019-05-15 13:25:14 +02:00
Svyatoslav Kuzmich
23a214710b [JS IR BE] Add Unit return type to function signature 2019-05-15 14:09:02 +03:00
Svyatoslav Kuzmich
e8933738ac [JS IR BE] Remove conservative unit materialization
Remove UnitMaterializationLowering
Remove Unit insertion in BridgeConstruction
Fix codegen for when expressions without else branch
2019-05-15 14:09:02 +03:00
Mikhael Bogdanov
c448def95f Add custom JDK tests on recent JDK avaliable in project 2019-05-15 12:55:14 +02:00
Mikhael Bogdanov
2f7f05c3bc Update proguard version 2019-05-15 12:55:13 +02:00
Dmitriy Novozhilov
07394bd6d3 [NI] Add test for KT-30300 with complex constraint system problem 2019-05-15 13:42:36 +03:00
Igor Yakovlev
e3ec501419 Fix realization of LightClass methods by KtLightClassForSourceDeclaration
#KT-31022 Fixed
2019-05-15 13:18:24 +03:00
Steven Schäfer
076f5e2ef9 Move jvm specific phases to JvmLower 2019-05-15 12:32:42 +03:00
Ilya Matveev
049269ba4f Gradle plugin: remove old native binary APIs
This patch removes APIs for native binary configuring
introduced in 1.3.0 and deprecated in 1.3.30.

Issue #KT-31229 Fixed
2019-05-15 13:12:01 +07:00
Ilya Gorbunov
18f9b20610 Remove internal visibility suppressions in kotlin.test
Internal visibility works fine in MPP, so they are no longer required.
2019-05-15 06:18:27 +03:00
Toshiaki Kameyama
fef0cc5d2b "Introduce 'when' subject" intention: suggest for "this" expression
#KT-12567 Fixed
2019-05-14 23:25:10 +03:00
Jake Wharton
aaf533df16 IR lowering for computing trimIndent/trimMargin on constants 2019-05-14 20:19:43 +02:00
Vyacheslav Gerasimov
d765bebcfc Build: Import embedded configuration as runtime in JPS build
This makes Idea import all embedded modules as transitive dependencies

 #KT-29548
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
5782267d26 Build: Fix import of kotlin-reflect in JPS build
#KT-29548 Fixed
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
b9fe6875e3 Build: Minor cleanup kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
c672300da1 Build: Use embedded configuration in kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
a6e3a0f5c3 Build: Use embedded configuration in kotlin-main-kts project 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
9a4cf2d835 Build: Add accessor for embedded configuration 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
0babddfc00 Build: update idea-ext to v0.5 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
68f776ebb1 Build: add kotlinManifest.properties to kotlin-plugin.jar 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
346478a5d3 Build: configure jps artifacts in gradle.projectsEvaluated 2019-05-14 18:07:16 +03:00
Dmitry Gridin
eee8d0263d Fix "Unused import" for 'provideDelegate'
#KT-31319 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
3914530fa8 Don't delete import from stdlib if alias exists and used
#KT-31414 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
32298522dd Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-14 21:01:20 +07:00
Dmitry Gridin
23e51268ad Minor: refactoring AbstractImportsTest 2019-05-14 21:01:20 +07:00
Mikhael Bogdanov
8050e94c0d Minor. Remove obsolete code for emulator shutdown 2019-05-14 15:46:23 +02:00
Mikhael Bogdanov
53856daaa4 Add system property to filter android test execution 2019-05-14 15:46:22 +02:00
Mikhael Bogdanov
d3c0937c67 Run android test locally with X86 emulator 2019-05-14 15:46:21 +02:00
Svyatoslav Kuzmich
28406b6bc4 [JS IR BE] Enable unconditional validation 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
b07690fccf Phaser: Implement dumper and verifier as general actions 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
0702b88bf3 [IR BE] Update parents in ArrayConstructorLowering 2019-05-14 16:23:42 +03:00
Mikhail Glukhikh
2d5f41cfe3 Fix .inspection file for ConvertNaNEquality tests 2019-05-14 16:23:08 +03:00
Mads Ager
b1e8a7cfce JVM: Generate LVT entry for this in @JvmOverload methods.
This change also makes sure that no line numbers are generated
in the wrappers in the JVM_IR backend.

Change-Id: If6c37f8a20894455abddb526039df059e02015a3
2019-05-14 15:14:07 +02:00
Ilmir Usmanov
360e30c133 Remove redundant continuation classes and INNERCLASS nodes
#KT-31339 Fixed
2019-05-14 16:00:39 +03:00
Martin Petrov
ccf2941f4a Use spaces instead of tabs to indent -Xlist-phases.
In Terminal.app and xterm the output columns get misaligned when using tabs.
Tabbed output only renders correctly when `tabstop=1`.
2019-05-14 15:54:01 +03:00
Svyatoslav Kuzmich
91d16ee947 [CLI] Extract :compiler:cli-js from :compiler:cli 2019-05-14 15:49:50 +03:00
Mark Punzalan
7efc29df7e Split up generation of test data for codegen/box/ranges into signed and
unsigned ranges/progressions.

The tests pass in JVM_IR for signed, but fail for unsigned due to
inlining being broken. We can disable the JVM_IR tests for unsigned,
while keeping them enabled for signed, to get better test coverage in
the interim until inlining is fixed.
2019-05-14 14:26:15 +02:00
Yan Zhulanow
331891b0d7 Pill: Fix getSerializedCompilerArguments()
There is an other method that starts with 'getSerializedCompilerArguments' – serializedCompilerArgumentsIgnoreClasspathIssues().
Fix the clash by exact matching: the getSerializedCompilerArguments() is not internal anyway.
2019-05-14 12:25:54 +09:00
Igor Yakovlev
bf8cbfc6b5 Temporary ignore ConvertJavaInterfaceToClass test 2019-05-14 00:10:28 +03:00
Igor Yakovlev
d44f37d3d5 Fix misspelling of KtUltraLightMethodForSourceDeclaration 2019-05-13 19:56:04 +03:00
pyos
40696f65c3 JVM_IR: generate WhenMappings for enum ordinal subjects 2019-05-13 19:09:07 +03:00
pyos
fb194e982e Copy EnumWhenLowering from Kotlin/Native 2019-05-13 19:09:07 +03:00
Andrey Uskov
52315106e8 Create source sets for generated by kapt sources during import
#KT-30739 Fixed
2019-05-13 18:43:11 +03:00
Steven Schäfer
1e08b3c7da Simplify findLocalIndex in ExpressionCodegen 2019-05-13 18:34:00 +03:00
Steven Schäfer
b04dc69157 Access this through the dispatch parameter when available 2019-05-13 18:34:00 +03:00
Steven Schäfer
9b9236efcb Fix parameter indices in SyntheticAccessorLowering 2019-05-13 18:34:00 +03:00
Sergey Igushkin
be05095df5 Introduce Java support in JVM MPP targets (KT-26256)
Deprecate the `jvmWithJava` preset, add warning.

Add a function `withJava()` to JVM MPP targets which applies the 'java'
plugin and sets up the Kotlin & Java interoperation.

Issue #KT-26256 Fixed

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-05-13 16:25:09 +03:00
Igor Yakovlev
4625002efe Fix invalid test data for CommonIntentionActionsTest 2019-05-13 16:10:52 +03:00
Matthew Runo
39f576d75c Migrate RetentionPolicy arguments in deprecated Java quick-fix
#KT-29666 Fixed
2019-05-13 15:35:46 +03:00
Roman Artemev
db5396c1c2 [JS IR BE] Fix main function detector
- Do not consider extension functions as main candidate
2019-05-13 15:26:09 +03:00
Mikhael Bogdanov
c8564e9ade Update jpsBuild dependencies 2019-05-13 14:18:33 +02:00
Svyatoslav Kuzmich
bd3953c09f [JS IR BE] Turn on strict mode in generated code.
Fix multiple import of the same javascript module.
2019-05-13 13:41:11 +03:00
Svyatoslav Kuzmich
0f90aa5f80 [JS IR BE] BridgeConstruction: Fix init order of receivers and type parameters 2019-05-13 13:40:30 +03:00
Toshiaki Kameyama
14259ca9e0 Implicit Nothing? type: don't report when declaration overrides nullable nothing type
#KT-30481 Fixed
2019-05-13 13:00:50 +03:00
Toshiaki Kameyama
cf4471ba53 "Redundant 'requireNotNull' or 'checkNotNull' call": don't remove first argument if function is used as expression
#KT-31404 Fixed
2019-05-13 16:59:01 +07:00
Dereck Bridie
574178882a KT-26629 Inspection to replace equality check with NaN with isNaN call 2019-05-13 12:55:53 +03:00
Dmitry Gridin
07e908f15f Fix incorrect quickfix "Replace with Kotlin analog" for conversion to an extension
where the first argument is an expression with an operation
 #KT-31341 Fixed
2019-05-13 16:38:08 +07:00
Mikhail Glukhikh
b4a63794e5 Add name to argument: support old-style comment deletion 2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
b0d294b50c Use candidate descriptor to determine parameter name stability in IDEA
#KT-31349 Fixed
2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
d517276a06 Apply "unnamed boolean literal" to idea & J2K + other style fixes 2019-05-13 12:33:46 +03:00
Mikhail Glukhikh
955bfd6e7b Introduce "add parameter names to following arguments"
This commit also refactors relevant intentions & inspections,
like "add name to argument", "add names to call arguments",
"unnamed boolean literal argument"

#KT-30622 Fixed
2019-05-13 12:33:39 +03:00
LepilkinaElena
f26a4e06bd Test for compilerOpts in cinterop part of MPP plugin (#2300) 2019-05-13 12:05:33 +03:00
Igor Yakovlev
bb071263b0 Fix JVMStatic annotation for UL-properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
5da6d9d438 Update license agreement 2019-05-13 11:21:12 +03:00
Igor Yakovlev
0d31df7fb7 Fix invalid test data for static import quick fix 2019-05-13 11:21:12 +03:00
Igor Yakovlev
9870585eb8 Fix KotlinShortNamesCacheTest to not use clsDelegate 2019-05-13 11:21:12 +03:00
Igor Yakovlev
ab852750cc Fix testdata for find usages of properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
7608b11691 Fix testdata for abstract method implementing intention 2019-05-13 11:21:12 +03:00
Igor Yakovlev
48136d64cf KtUltraLightMethod now use null for MemberIndex 2019-05-13 11:21:12 +03:00
Igor Yakovlev
b485819a30 Move refactorings, fix annotations and fix cls-delegate tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
8e103b6559 Fix origin for TypeParameter + refactoring 2019-05-13 11:21:11 +03:00
Igor Yakovlev
f20ba9ddc2 Fix rename refactoring for UltraLightParameters 2019-05-13 11:21:11 +03:00
Igor Yakovlev
33126b273c Update StubTracker test data for completion tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
ab9e8c2d3a Add @get/@set JvmName support for properties 2019-05-13 11:21:11 +03:00
Denis Zharkov
1b5f72bd59 Enable ultra-light classes by default
^KT-29267 Fixed
2019-05-13 11:21:11 +03:00
Mads Ager
e8fbd42f7c JVM_IR: Support access flag jvm annotations on fields and methods. 2019-05-13 08:34:52 +02:00
Jiaxiang Chen
0020e953e1 Change order of line number geneartion for function call, and also force
line number generation after visiting inline functions.
2019-05-11 13:38:24 +02:00
max-kammerer
eeb1c0a0fc Merge pull request #2321 from neetopia/irLineNumberTestFix
Fix compareCustom function in IrLineNumberTest class, to exclude comment
2019-05-10 11:40:19 +02:00
Mikhael Bogdanov
021e94dced Fix maven test on parallel execution: don't miss to create dir 2019-05-10 11:37:18 +02:00
Steven Schäfer
570ee38256 Implement special cases for the hashCode intrinsic in JVM_IR 2019-05-10 09:40:57 +02:00
Ting-Yuan Huang
1c3b895fc0 Generate accessors for super calls if necessary
Current implementation of calls with super qualifier relies on
invokespecial, which has some more constraints than regular virtual
invocations. When those constraints aren't met, accessors are needed.
2019-05-10 08:57:37 +02:00
Mikhael Bogdanov
c90e6c1f18 Delete test temp root folders after test execution
Don't waste space on TeamCity
2019-05-10 08:12:03 +02:00
Mads Ager
99e7ae6b3f Fix typo in expectation files for command line tests.
The expectations contained ';' instead of ':' which makes two
CLI tests fail.
2019-05-09 16:57:29 +02:00
Mikhael Bogdanov
054febe57f Update bootstrap 2019-05-09 11:56:09 +02:00
pyos
4d9661890a Test reification of type parameters into Array(size, init)
(cherry picked from commit 6daa61ef5f)
2019-05-09 11:54:43 +02:00
pyos
3171129c3c JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.

(cherry picked from commit a74fae246b)
2019-05-09 11:54:35 +02:00
pyos
08da078842 JVM_IR: implement IrReturnableBlock codegen
(cherry picked from commit 530ad368fe)
2019-05-09 11:54:26 +02:00
pyos
683f8417d3 Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.

(cherry picked from commit 4a29e3cfcf)
2019-05-09 11:54:18 +02:00
max-kammerer
e74e0ea013 Revert "Add a common JVM/JS lowering for Array(size, function)"
This reverts commit 4a29e3cfcf.
2019-05-09 11:49:34 +02:00
max-kammerer
856a1649c6 Revert "JVM_IR: implement IrReturnableBlock codegen"
This reverts commit 530ad368fe.
2019-05-09 11:49:34 +02:00
max-kammerer
05d352769b Revert "JS_IR: remove traces of @kotlin.native.internal.InlineConstructor"
This reverts commit a74fae246b.
2019-05-09 11:49:34 +02:00
max-kammerer
8560459dc6 Revert "Test reification of type parameters into Array(size, init)"
This reverts commit 6daa61ef5f.
2019-05-09 11:49:34 +02:00
pyos
6daa61ef5f Test reification of type parameters into Array(size, init) 2019-05-09 08:03:18 +02:00
pyos
a74fae246b JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.
2019-05-09 08:03:18 +02:00
pyos
530ad368fe JVM_IR: implement IrReturnableBlock codegen 2019-05-09 08:03:18 +02:00
pyos
4a29e3cfcf Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.
2019-05-09 08:03:18 +02:00
Svyatoslav Kuzmich
f4bb1354c9 [JS IR BE] Support friend modules 2019-05-08 23:34:00 +03:00
Jiaxiang Chen
2c5ebf3ab2 Fix compareCustom function in IrLineNumberTest class, to exclude comment
lines that are not related for line number verification.

Unmute a test case should have been unmuted but shadowed by this bug.
2019-05-08 12:53:45 -07:00
Nikolay Krasko
ad02700200 Update to bootstrap 1.3.50-dev-2
Fix Compiler and all IDE plugins configuration struggling to build
stdlib because of circular dependency.

See 1.3.50-dev-2 build in https://teamcity.jetbrains.com/app/buildConfiguration/Kotlin_dev_CompilerAllPlugins?branch=%3Cdefault%3E&buildTypeTab=builds
2019-05-08 20:01:01 +03:00
Dmitriy Dolovov
ca9bff010b Fix: Make "cidrPluginsEnabled" Gradle parameter checks consistent
Also add logging.
2019-05-08 17:16:40 +03:00
Natalia Selezneva
e158875a14 Fix NPE in SLRUMap in ScriptDefinitionsManager
EA-138364 - NPE: LinkedHashMap$Entry.access$
2019-05-08 15:17:13 +03:00
Natalia Selezneva
2a2fe6b428 Do not provide 'add dependency' quick fix for unresolved references for non-project files
EA-126105 - NPE: JavaFileManagerImpl$LibSrcExcludingScope.<init> (KotlinAddOrderEntryActionFactory)
2019-05-08 15:17:12 +03:00
Natalia Selezneva
ba7d66eb4b Fix 'Invalid file' Exception during script definition search (EA-125840)
EA-125840 - assert: FileManagerImpl.findFile
2019-05-08 15:17:12 +03:00
Natalia Selezneva
836006b3f3 Do not use canonical paths in OutsidersPsiFileSupportUtils (EA-135551)
EA-135551 - IOE: OutsidersPsiFileSupportUtils$getOutsiderFileOrigin$.invoke
2019-05-08 15:17:11 +03:00
Natalia Selezneva
98235952ad Fix notification about highlighting for diff view in build.gradle.kts (KT-30638)
^KT-30638 Fixed
2019-05-08 15:17:11 +03:00
Natalia Selezneva
495d98f997 Fix highlighting for scripts in diff view (KT-30690)
^KT-30690 Fixed
2019-05-08 15:17:10 +03:00
Natalia Selezneva
88c6ecbbdf Minor: extract common parts 2019-05-08 15:17:09 +03:00
Natalia Selezneva
89bf7f991a Run indexes update after typing in script if needed 2019-05-08 15:17:09 +03:00
Natalia Selezneva
9e51f82248 Refactoring: add isApplicable method to ScriptDependenciesLoader 2019-05-08 15:17:08 +03:00
Natalia Selezneva
e990c61b55 Do not start script dependencies update if dependencies are already cached 2019-05-08 15:17:07 +03:00
Mikhail Zarechenskiy
516fccbe7b [NI] Complete call if return type contains only "good" type variables 2019-05-08 12:19:52 +03:00
Mikhail Zarechenskiy
61bd3a8d03 [NI] Complete call if return type has proper lower or equal constraints
There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
2019-05-08 12:19:50 +03:00
Mikhail Zarechenskiy
6c9394f0b2 [NI] Use original implicit receiver for DSL violation check
There is an inconsistency between old and new inference for storing
 receivers of resolved calls. In new inference, for captured types,
 receiver will be changed and to preserve behavior of the old inference,
 we use original one during important checks.
 This is more a workaround than a solution and should be revisited.

 #KT-31356 Fixed
 #KT-29948 Fixed
 #KT-31360 Fixed
2019-05-08 12:19:48 +03:00
Mikhail Zarechenskiy
c283e15425 [NI] Preserve annotations during type substitution
#KT-31346 Fixed
2019-05-08 11:26:20 +03:00
Ilya Gorbunov
2c26dc3af6 Add simplified overloads of String<->ByteArray/CharArray conversions
These overloads cover the most common cases of conversion of the entire
String or Byte/CharArray, avoiding extra index check and branching.

#KT-24810, KT-29265
2019-05-08 02:58:57 +03:00
Svyatoslav Kuzmich
f9c12db3b5 [JS IR] Unmute tests 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
e3bcabeae3 [JS IR] stdlib: Fix bugs in Long.toString(radix) 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
bc29a5b15c [JS IR] stdlib: port methods that use bit representation of numbers
- Port part of 'misc.js' from current backend to 'bitUtils.kt' in IR backend
- Enable toBits, toRawBits, fromBits extension function on Double and Float
- Enable Double.withSign
- Refactor getNumberHashCode using new utils
2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
362fbc8770 [JS IR] stdlib: Use comparator in CharArray.sort
CharArray is represented as a regular JS Array. Its default sort order is based
on string representation of elements.
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
179acf0789 [JS IR] stdlib: generate type-safe contentToString for primitive arrays
Avoid casting 'primitive' arrays to Array<*> because they fail on runtime
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
7687985442 [JS IR] Stdlib: use total-order comparasion for content equals 2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
3a506a372b [JS IR] stdlib: Use Nothing in return type of THROW helpers
Backend generated calls to those helpers inside expression which
resuleted in invalid type casts in IR (in dead code).
2019-05-07 21:48:50 +03:00
Nikolay Krasko
8c83beb086 Refactoring: drop unused AbstractKotlinReferenceContributor.kt 2019-05-07 16:12:25 +03:00
Nikolay Krasko
9b9bfe7ba3 Don't produce references for Kotlin block 2019-05-07 16:12:24 +03:00
Nikolay Krasko
78200dd38e Get Kotlin references through Kotlin contributors only (KT-31129)
Speed up getting references and protect Kotlin from slow
references contributors.

 #KT-31129 Fixed
2019-05-07 16:12:24 +03:00
Nikolay Krasko
b5918f4b5d Minor: move KotlinDefaultAnnotationMethodImplicitReferenceContributor.kt
Need this move to reference contributor from reference provider service.
2019-05-07 16:12:24 +03:00
Mikhail Zarechenskiy
3506c2047a Fix lint test: take into account diagnostic that is specific for NI 2019-05-07 15:56:15 +03:00
Mikhail Glukhikh
54411bd248 Simplifiable call: support case w/out receiver, add minor enhancements
Related to KT-30501
2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
8328af5694 Apply "library call could be simplified" to idea + other style fixes 2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
e934eba6e4 Simplifiable call inspection: add filter -> filterIsInstance replacement
#KT-30501 Fixed
2019-05-07 14:28:18 +03:00
Mikhail Glukhikh
7f1643cfad Minor: simplify isCalling 2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
8913755e11 Simplifiable call inspection: add filter -> filterNotNull replacement
Related to KT-30501
2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
4a5cbe0443 Replace "flatMap -> flatten" inspection with abstract "simplifiable call"
Related to KT-30501
2019-05-07 14:28:16 +03:00
Nicolay Mitropolsky
6101b5e6ba KotlinAnnotatedElementsSearcher made support Kotlin objects (KT-31332) 2019-05-07 09:26:00 +03:00
Svyatoslav Kuzmich
824c51e7f0 [JS IR] Add stdlib regression tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0de1242f68 [JS IR BE] Unmute passed tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
331625a9bb [JS IR BE] Lower kotlin.js.Json external interface methods 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6c9375196 [JS IR BE] Preserve package fqName when moving external declarations out
Create separate package fragment for each fqName of external declaration package
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
2741ecaaad [JS IR BE] Materialize Unit object during upcasts in AutoBoxingTransformer 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
58bed0f932 [JS IR BE] Fix types of in secondary ctor lowering
Type of IrDelegatingConstructorCall is 'kotlin.Unit'
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6761d323c [JS IR BE] Fix return targets inside state machine 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
feeb6e9862 [JS IR BE] Fix type for lowered cast expression
Safe cast result type is different from its type operand.
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
fc0a0f41d2 [JS IR BE] Fix: patch parents problems
* Patch parents for state machine builder
* Patch parents for declarations inside default value of actual parameter
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
130d2d00c3 [JS IR BE] Fix unboxing empty inline class varargs 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0aae760469 [JS IR BE] Fix block decomposition lowering for dynamic expressions 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
17178628fb [JS IR BE] Support bridges for special methods
Mostly reused from JVM IR lowering.
Shared logic moved to common backend module.
2019-05-06 19:34:25 +03:00
Mikhael Bogdanov
ec6904afd1 Minor. Fix test data 2019-05-06 17:34:02 +02:00
Mikhail Zarechenskiy
c1c464eeb5 Enable new type inference algorithm for IDE analysis
Note that this change doesn't affect compilation: if a project used
 old inference, then it'll continue to use it.

 To use old inference one can uncheck "Enable new type inference..."
 option in "Kotlin Compiler" tab
2019-05-06 18:19:25 +03:00
Mikhail Zarechenskiy
1fecd15355 [NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
2019-05-06 18:05:02 +03:00
pyos
90f11211d3 JVM_IR: wrap performInline in enterIntoInlining/exitFromInliningOf 2019-05-06 16:23:28 +02:00
Mikhail Zarechenskiy
931bbd8cec [NI] Support ad-hoc implicit integer coercion for Kotlin/Native 2019-05-06 16:59:30 +03:00
Abduqodiri Qurbonzoda
c8a4fa58cd Implement String to/from ByteArray conversion (KT-24810) 2019-05-06 15:54:28 +03:00
Abduqodiri Qurbonzoda
81d2d3cb6a Implement String to/from CharArray conversion (KT-29265) 2019-05-06 15:54:28 +03:00
Mikhail Zarechenskiy
a3247b1b92 Add option to enable new inference only for IDE analysis
#KT-30453 Fixed
2019-05-06 14:36:05 +03:00
Dmitry Gridin
e857425b35 Fix 'optimizeImports' tests 2019-05-06 18:12:39 +07:00
Dmitry Gridin
75fb74b262 Fix runtime instance for AbstractJvmOptimizeImportsTest 2019-05-06 18:12:39 +07:00
Dmitry Gridin
ff26acacf9 Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-06 18:12:39 +07:00
Dmitry Gridin
87b559562f Run 'Optimize Import' on idea/tests and idea/src 2019-05-06 18:12:39 +07:00
Dmitry Gridin
96ed33e357 Optimize Imports should remove unused import alias
#KT-17375 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
7fe0503337 Unused import: support also imports as alias
#KT-12392 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
9062a2fe72 Fix false positive "Unused import directive" for imports under several alias
#KT-30949 Fixed
2019-05-06 18:10:51 +07:00
Dmitry Gridin
c52abfda16 Minor: refactoring KotlinImportOptimizer, KotlinUnusedImportInspection, OptimizedmportsBuilder and AbstractOptimizeImportsTest 2019-05-06 18:10:51 +07:00
Mikhail Zarechenskiy
2f835ed66f Specify type arguments to fix compilation against bootstrap compiler 2019-05-06 14:00:19 +03:00
Mikhail Zarechenskiy
8446ea8a6b [NI] Avoid substituting type variables inside captured types
This fixes exception in CreateAnnotation#testAnnotationType test
2019-05-06 14:00:17 +03:00
Mikhail Zarechenskiy
e8e8f6f336 Don't forget to rollback configured compiler options in IDE tests 2019-05-06 13:59:33 +03:00
Mikhail Zarechenskiy
4ed5c5363f [NI] Update testdata after 03e5e55f 2019-05-06 13:59:32 +03:00
Mikhail Zarechenskiy
97a6b3436c Add diagnostics from NI for SAM with receiver tests 2019-05-06 13:59:30 +03:00
Mikhail Zarechenskiy
c95eddbbbe [IDE-NI-MIGRATE] Migrate few tests for new inference 2019-05-06 13:59:28 +03:00
Mikhail Zarechenskiy
c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Mikhail Zarechenskiy
d4d1648e1d [IDE-NI-MIGRATE] Migrate QuickFix tests for new inference 2019-05-06 13:59:24 +03:00
Mikhail Zarechenskiy
871925ba31 Fix compilation after rebase 2019-05-06 11:36:32 +03:00
Dmitriy Novozhilov
a79030aa0f [IDE-NI-MIGRATE] [BAD] Migrate testdata of MultiModuleSafeDelete tests
Bad tests in `MultiModuleSafeDeleteTestGenerated`:
- testByActualClassSecondaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassSecondaryConstructorParameter
- testByExpectClassSecondaryConstructorParameter_ExpectsAndActualsByExpectClassSecondaryConstructorParameter
- testByActualClassPrimaryConstructorPropertyLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorProperty
- testByActualClassPrimaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorParameter
- testByExpectClassPrimaryConstructorParameter_ExpectsAndActualsByExpectClassPrimaryConstructorParameter
2019-05-06 11:36:30 +03:00
Dmitriy Novozhilov
b66bbdf7a6 [IDE-NI-MIGRATE] [BAD] Migrate testdata of Extraction tests
Bad tests:
- IntroduceTypeParameter.testDuplicates
- IntroduceTypeParameter.testNullableType
- IntroduceTypeParameter.testUserType
- IntroduceTypeParameter.testFunctionType
- IntroduceTypeParameter.testInClass
- ExtractFunction.TypeParameters.testNoVarianceInFun
- ExtractFunction.Parameters.CandidateTypes.testNonNullableTypes
- ExtractFunction.Parameters.CandidateTypes.testMultipleTypes
- ExtractFunction.ControlFlow.OutputValues.testGenericPair
- IntroduceVariable.ExplicateTypeArguments.testDeeperNestedCall
2019-05-06 11:36:28 +03:00
Dmitriy Novozhilov
656c8a4fa7 [IDE] Add configuring compiler arguments in Extension tests 2019-05-06 11:36:27 +03:00
Dmitriy Novozhilov
03c34691af [NI] Expand TYPE_INFERENCE_ERRORS with diagnostics from NI 2019-05-06 11:36:25 +03:00
Dmitriy Novozhilov
3d5593c70c [IDE-NI-MIGRATE] [BAD] Migrate testdata of Intention tests
Issues:
- #KT-31263

Bad tests:
- SamConversionToAnonymousObject.testSimple3
- ConvertReferenceToLambda.testIf1
- ConvertReferenceToLambda.testIf2
- ConvertReferenceToLambda.testIf3
- ConvertReferenceToLambda.testIf4
- ConvertReferenceToLambda.testWhen1
- ConvertReferenceToLambda.testWhen2
- ConvertReferenceToLambda.testWhen3
- ConvertReferenceToLambda.testWhen4
- ConvertLambdaToReference.testVarargFunction2
2019-05-06 11:36:23 +03:00
Dmitriy Novozhilov
1a085516b0 [IDE-NI] Fix detecting error types in InsertExplicitTypeArgumentsIntention 2019-05-06 11:36:21 +03:00
Dmitriy Novozhilov
e46f552a8d [NI] Update testdata in diagnostic tests 2019-05-06 11:36:20 +03:00
Dmitriy Novozhilov
ad1b8a6fb1 [NI] Add substitution of lambda return type in diagnostics 2019-05-06 11:36:18 +03:00
Dmitriy Novozhilov
b4dbf0f9a4 [NI] Fix inference for constraints with captured in projection 2019-05-06 11:36:16 +03:00
Dmitriy Novozhilov
8f22d43d01 Typo: fix function name in kotlinToResolvedCallTransformer 2019-05-06 11:36:15 +03:00
Dmitriy Novozhilov
d18c55a412 [NI] Fix reporting type mismatch on lambda parameters 2019-05-06 11:36:13 +03:00
Dmitriy Novozhilov
f7091dd1e9 [NI] Uncapture captured types in diagnostics 2019-05-06 11:36:11 +03:00
Dmitriy Novozhilov
e6deaf3315 [NI] Fix reporting UNSAFE_IMPLICIT_INVOKE_CALL diagnostic 2019-05-06 11:36:09 +03:00
Dmitriy Novozhilov
251a02f71d [NI] Fix recording type of lambda in trace 2019-05-06 11:36:08 +03:00
Dmitriy Novozhilov
233dd3ffba [IDEA] Approximate IntegerLiteralType on IDEA side 2019-05-06 11:36:06 +03:00
Dmitriy Novozhilov
f2bbae6a63 [NI] Fix resolving callable references with typealias in ths
#KT-31199 Fixed
2019-05-06 11:36:04 +03:00
Dmitriy Novozhilov
65380f4eb4 [NI] Remove captured type approximation in type arguments of resolved call 2019-05-06 11:36:02 +03:00
Dmitriy Novozhilov
421fda6e92 [NI] Fix reporting smartcasts on arguments of binary expression 2019-05-06 11:36:01 +03:00
Dmitriy Novozhilov
5715c32216 [IDE-NI-MIGRATE] [OK] Enable only OI on some IDEA tests that unrelevant in NI 2019-05-06 11:35:59 +03:00
Dmitriy Novozhilov
48e450684b [TEST] Add configuration of language features in AbstractDiagnosticMessageTest 2019-05-06 11:35:57 +03:00
Dmitriy Novozhilov
05aa36a858 [IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests 2019-05-06 11:35:55 +03:00
Dmitriy Novozhilov
17df843bf1 [NI] Fix getting source psi in UnusedLambdaExpressionBodyInspection 2019-05-06 11:35:54 +03:00
Dmitriy Novozhilov
6f51415b4d [NI] Fix determining return type of lambda in IDEA
UselessCallOnCollection tests fixed
2019-05-06 11:35:50 +03:00
Sergey Rostov
956f27cc2d Gradle, JS Test: temporary disable js tests configuration
Test configuration will be reworked with new DSL for browser and nodejs
configuration.
2019-05-05 22:32:23 +03:00
Mikhael Bogdanov
5698d923eb Update dependencies for Android box tests 2019-05-03 15:36:48 +02:00
Mikhael Bogdanov
6dbbf0bb72 Move server process creation to JDK 6 suite
It's allow to avoid problem with wrong inherited output
 (gradle instead of test process)
2019-05-02 13:46:27 +02:00
Georgy Bronnikov
bfe148efd5 IR: mostly remove descriptors from codegen 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
9923d956aa JVM_IR: rework IrIntrinsicMethods 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
98d309d03b IR: declaration builders for receiver parameters 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
ad70a68671 JVM_IR: correct some type parameter bugs 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
3e6171aefc JVM_IR: redirect super calls to DefaultImpls where necessary 2019-05-01 11:47:44 +03:00
ilya-g
66fb47e715 Fix relative link in contributing guide 2019-05-01 07:59:15 +03:00
Ilya Gorbunov
5f2762ed20 Follow up: fix typos in coroutine docs 2019-05-01 05:40:35 +03:00
Svyatoslav Kuzmich
87415cb769 [JS IR] Help IDEA: Copy stdlib sources instead of sharing 2019-05-01 00:28:36 +03:00
Svyatoslav Kuzmich
54e6ee82ad Exclude :kotlin-stdlib-js-ir from coreLibProjects for local builds 2019-05-01 00:28:36 +03:00
Simon Ogorodnik
8a2b41c8cb Fix proguard 2019-04-30 19:28:17 +03:00
Mikhail Glukhikh
5262f0a53f Fir2Ir: apply major text data update after a bunch of resolve changes 2019-04-30 18:45:57 +03:00
Simon Ogorodnik
3e51cbc9dc FIR: move test to stdlib group thus fixing it 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
5b929b88e1 [FIR] Allow nullability mismatch in resolve 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
2111e56d2e FIR: introduce workaround to avoid type-aliases in ConeClassType 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
c06d521e78 FIR: support star projection in CreateFreshTypeVariableSubstitutorStage
This commit fixes a small pack of tests failing at this point
2019-04-30 18:45:56 +03:00
Simon Ogorodnik
4bcba000fd FIR: pass name resolver to annotation deserializer separately 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
1bb4b32c91 Fir2Ir converter: fix exception on FirUnitExpression 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
f2ff103ed7 Fir2Ir converter: fix KNPE during use-site scope building for local 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
8cb16cc06a FIR provider: support getClassUseSiteMemberScope for type aliases 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
f457cb099f FIR deserializer: handle context in more correct way 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
1e653226ef FIR deserializer: don't create symbol in advance for class literals 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
a4b4db5589 FIR resolve: process situation with both implicit receivers properly 2019-04-30 18:45:55 +03:00
victor.petukhov
3636046e2d [FIR] Add test with potential recursive call in compiler FE on when with sealed class inside it (KT-18583) 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
d1d6b8b77a FIR Java: handle primitive arrays in annotations correctly 2019-04-30 18:45:54 +03:00
Mikhail Glukhikh
be18134270 FIR multi-module: minor test data fixes after resolve enhancements 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
77817cb750 Raw FIR: copy class type-parameters into constructors properly 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
9cef9e4056 Remove isMarkedNullable from FirResolvedTypeRef 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
458080ca8b Raw FIR: create resolved references for desugared temporary variables 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
99994e6c41 FIR: provide super-type as the self-type for anonymous objects
This commit is a temporary approximation useful before we have
symbols for local classes & objects
2019-04-30 18:45:54 +03:00
Simon Ogorodnik
2f7ced2a8e FIR Java: bind overrides properly 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
d19a250cbe FIR: support proper overriding of generic functions 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
7b9f5293da FIR: resolve primary constructor parameters in initializers context 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
fa4ba82350 FIR: provide classifiers via class use-site scope 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
f99f06831c FIR resolve: support typing for get class 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
00ccea220e Raw FIR: allow implicit type of value parameter (helpful for lambda) 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
9169071d60 FIR resolve: introduce draft version of the visibility checker 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
adf845b2fd FIR: provide resolved super-type as the type of enum entry reference 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
8e200d8113 Filter out self output directory from classpath in FIR modularized test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e521e66c74 FIR deserializer: provide proper type for enum entries 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
ca350e64c2 FIR deserializer: add proper container class id to nested class members 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
daf9f927d4 FIR: add property case to companion test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e41a79fbe9 Unify building references to symbols in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
0c0f45791b Anchors instead of refs on declaration site in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
d28bb5bc70 Render value-parameter modifiers in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
efbf096879 Support ::class in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb19a586f4 Fold nullability flexible types in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
3e69838f48 FIR Java: map classes to make java type-parameters have correct bounds
Really, this commit implements early J2K mapping for all Java types.
It's questionable and probably wrong at least for super-types,
because, for example, we cannot resolve spliterator() in classes
derived from java.lang.Iterable
2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb91c6b977 Add abbreviated types rendering to html fir dump 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
6a0e3371ae FIR: resolve conflicts on multiple inheritance of fun with same signature 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
84fbf4ec25 Partially cache scopes in FIR body resolve transformer 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
861ea6a30f Provide hashCode and equals for lookup tag based types 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ce0b482413 FIR resolve: add work-around to support enum entries 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
d22eab680e FIR: provide nested classes and objects via declared member scope 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ee73d21d32 Expand type-aliases in cone (FIR) type context 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
6f9f9fc087 FIR types: relax requirements around flexible types 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
0ae2f992fa Raw FIR: provide receiver to ++, -- operators 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
dc4ccf8d23 FIR resolve: make receiver completion run independent from outer call 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
adb135d036 Provide title to symbol references in html fir dump 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
c1a9fee7e1 Implement break, continue, init in html fir 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
26119f0403 FIR: implement isDenotable on type constructor more accurately 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
21d002ab6f FIR: add function for copying type-parameters 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
cec10dac85 FIR deserializer: remove cycle in annotations loading 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
e3e7eea3fe FIR: support (partially) type annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
48cd9e3251 FIR: support class annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
a9db64989b FIR deserializer: support enum entries and their annotation usages 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
b839e50ee2 FIR: deserialize annotations (built-ins only, no enums & arrays yet)
Problems: enums aren't deserialized correctly; array aren't done at all;
Target annotation has no arguments in built-in for some reason.
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
092d10b1a8 FIR Java: fix creation & handling of type parameter symbols
Before this commit, we created type parameter symbols each time
when type parameter was referenced or created.
In this commit, we introduced class-bound Java type parameter stack
and use it to find referenced type parameter symbol.
So now they are created only when Java type parameter is created
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
f8bb1d161a Fir Java: add type parameters to constructors and their return types 2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
5bf489327d Minor fix of around flexible and not-null FIR types (by semoro) 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
c487c1443f FIR deserializer: provide type parameters for type-aliases 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
9d7d358836 FIR deserializer: support properties 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
b02b090bdf FIR inference: implement simple constraint system properly 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
ddb08777d9 Link type parameters in html fir dump 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
4469fec57b Enable local functions in fir html dump 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
f9feeac5e1 Raw FIR: generate data-class component1, component2, ... functions 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
bb7dcd9945 FIR: protect importing scopes from empty names 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
8324ee7272 FIR deserializer: support type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6ab38a583 FIR: resolve constructors via type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
aa077b42e9 FIR deserializer: provide type-parameters for constructors 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
1512a6ba9a Support FirAnonymousObject in html fir dump 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6b9c41f3a FIR resolve: use proper argument mapping in FlatSignature for constructor 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
d89913dc8d FIR: use type of last expression as type of branch, not type of block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fd279860f7 FIR resolve: provide unconditional typing for block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
aa5f0fded5 FIR resolve: provide proper type for super reference 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
9dcf8f836a FIR: support varargs in resolve 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fa135bbab0 FIR resolve: properly count used arguments in overload conflict resolver 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
b4019b0cc1 FIR inference: use generic version of error type in type approximator 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
7d793f6750 FIR resolve: add handling of companions as objects 2019-04-30 18:45:43 +03:00
Mikhail Glukhikh
ab258767f8 FIR resolve: add extra test & comments to multiple receiver resolve 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
d1b8ca31c0 FIR resolve: add test for firstOrNull 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
a3806a6e2e Cone (FIR) context: provide proper types instead of todo's 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
dae5822986 FIR: fix nullability loss on substitution 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
572c9e7115 FIR resolve: add test for map and apply 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
206afde9cc FIR inference: add constraint system from receiver 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
fda777ecae FIR: detect extension function types by reference annotation
Later it should be replaced by cone type annotation analysis
2019-04-30 18:45:42 +03:00
Simon Ogorodnik
3d73c28d1e FIR: fix receiver not being substituted 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
77efe8b857 FIR resolve: reorder call resolution sequence 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
d82e790405 Cone (FIR) type context: implement supertype substitution properly 2019-04-30 18:45:42 +03:00
Mikhail Glukhikh
f47258c6b1 FIR: make substitution wrapper for class-based type scope 2019-04-30 18:45:41 +03:00
Mikhail Glukhikh
93496f1dee FIR resolve: add correct receiver tower scopes + check receivers 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
4b5172cda3 FIR (WIP): Initial support for proper lambda analysis 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
8c67ec8c89 FIR resolve: abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0de50307a Raw FIR: generate more trivial tree for lambdas (no explicit return) 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
aaf4645cef FIR: add return type to functional type's arguments 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0176fbde5 Support labels in fir html dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
541e1addf9 FIR modularized test: fix date format in report name 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
82fbe4d83d Support String concatenation and Unit expression in html fir dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
a6b2e119f7 FIR resolve: support trivial when typing 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
55467909da FIR deserializer: optimize KotlinDeserializedJvmSymbolsProvider 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
3a50d2e666 FIR: provide constructors from importing scopes 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
e7ea75fd81 FIR: fix search scope to include kotlin libraries package parts 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
4cb8faf666 FIR: uniquify scopes to avoid ambiguity on diamond inheritance 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
8d4cbd84e3 FIR resolve: support synthetics discrimination 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
49883d1d87 Add root index to fir dump 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
9c04751572 FIR modularized test: use qualified module names 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
3cabf490dd Use fir to html in modularized test 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
61b410e276 Implement fir to html dump 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
32e941cb53 FIR: keep names for error references 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
5bf41594ec FIR resolve: add receiver consistency checking
NB: looks like checker itself may be not needed, but it's important
to check extension receiver presence during candidate collection
2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
2e7d655b20 FIR resolve: support nested class constructors 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
8b718c6822 FIR body resolve: support subject type calculation 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
e05dfb6541 FIR resolve: introduce argument mapper 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
c98b820968 Extract FIR modularized tests to separate module 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
6e3f173567 Implement old FE perf test similar to FIR modularized 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
3c4f5be8fd Implement FIR modularized tests 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
fe3afccfc2 FIR resolve: provide synthetic properties scope
At the moment get* and is* functions are supported
2019-04-30 18:45:37 +03:00
Simon Ogorodnik
5763b82cdd Improve FIR benchmark util, add progress and multi-run info collection 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
45f92c490c FIR: make call resolver stop on first successful candidate 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
95011b1076 Return "FIR resolve: support variable assignments" with full completion 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
c6aff9380b FIR: support resolving to objects 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
b38f3a1272 Replace ConeFunctionType with ConeClassType 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
93cb23a498 Raw FIR: support type placeholders 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
0e0c188e05 Rebuild fir-provider indexes on changes 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
5f0fe4785d Implement FirProvider consistency checker 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
1dae135840 Expand ConeTypeContext, implement FIR type inference & related checkers 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
f1eb66819b Revert "FIR body resolve: support variable assignments"
Performed to make long branch rebasing easier
This reverts commit af8c3788
2019-04-30 18:45:35 +03:00
Simon Ogorodnik
935c21f906 FIR scopes: use use-site member scopes for imports 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
3533541702 Provide class use-site scopes from FirSymbolProviders 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
1cd25da7af FIR scope processors: add function to check is stop on ProcessorAction 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
082e9d1cd7 FIR Java: implement knownClassNamesInPackage optimization 2019-04-30 18:45:34 +03:00
Yanis Batura
a51b7fb8d0 Fix typos 2019-04-30 18:42:07 +03:00
Leonid Startsev
0ecf20bd62 Revert back visibility in deserialization ctor to public so inheritors can access it from other modules.
Fix instantiating of polymorphic serializer with generics.
Move context creation below as asked.
2019-04-30 17:53:40 +03:00
Dmitriy Dolovov
3610c99163 Move IDE-related CIDR modules into 'ide' directory 2019-04-30 21:32:21 +07:00
Svyatoslav Kuzmich
379cb08226 [JS] Reduce usage of 'js' function in stdlib
Function 'kotlin.js.js' is to be redesigned in JS IR backend,
partially because it is a hard feature to support.

Current implementation is unstable and can cause problems around
 inlining and name generator. Luckily most of its use-cases
can be covered by simpler features like dynamic expressions and
external declarations.

Thus we are reducing it's usage in stdlib to make IR backend more
stable in current state. JavaScript features that can't be covered by dynamic expression are
implemented in 'jsOperators.kt' file respectively for each backend:

 - 'internal inline' function which calls 'js' function inside for current
   pre-IR backend

 - 'internal' function with '_hack' parameters for JS IR backend which will be
   later intinsicified in a compiler
2019-04-30 15:27:19 +03:00
Alexander Udalov
e22594acde JVM IR: slightly change field renaming convention implementation
Prefer to rename fields from the class, not from the companion, to be
more in line with the old backend's behavior. This has no effect on the
behavior of current tests but removes differences in metadata (since
metadata has information about every property->field mapping) in some of
them
2019-04-30 13:15:29 +02:00
Alexander Udalov
6cc293a0c5 JVM IR: record FIELD_FOR_PROPERTY for property delegates
Delegated properties now have their $delegate fields recorded in the
metadata (in `ClassCodegen.generateField`). This part of metadata is
used by `KPropertyN.getDelegate` functions, so almost all tests on
getDelegate are now unmuted
2019-04-30 13:15:29 +02:00
Alexander Udalov
5aae832c5f Minor, update doc on -Xsanitize-parentheses
The ASM issue with parentheses was fixed in
02f00c4a82

 #KT-29475
2019-04-30 13:15:29 +02:00
Alexander Udalov
bd6e90f302 FIR: remove dependency of :compiler:fir:resolve on :compiler:cli 2019-04-30 12:01:23 +02:00
pyos
c77e8a8c2d JVM_IR: remove another redundant lowering 2019-04-30 08:20:37 +02:00
Dmitriy Dolovov
c017ef9bc8 Properly detect Kotlin/Native libraries
Issue #KT-30598 fixed
2019-04-30 13:05:22 +07:00
Dmitriy Dolovov
20d77afcce Refactor Kotlin/Native path constants
Use java.io.File instead of java.nio.Path to have more uniform API
2019-04-30 13:05:14 +07:00
Dmitriy Dolovov
2ef7cde34b Add tests for "lite" API for Kotlin/Native libraries 2019-04-30 13:05:06 +07:00
Dmitriy Dolovov
07f6059f44 Refactor "lite" API for Kotlin/Native libraries 2019-04-30 13:04:56 +07:00
Andrey Uskov
6039d86388 Importing projects with granular metadata is partially supported
(except k-lib data format of metadata libraries and multiple target
platforms per source set)
2019-04-29 19:49:18 +03:00
Andrey Uskov
998a24414a Improved parsing of internal compiler arguments with boolean state in
case when the argument is listed twice in the list of command line
arguments. The last value will be used.
#KT-27181 Fixed
2019-04-29 19:48:01 +03:00
Andrey Uskov
affe8baf74 Fix import with jps enabled. kotlin-js-ir and kotlin-test-js-ir were
removed from jps build
2019-04-29 19:45:01 +03:00
Mikhael Bogdanov
0482f7e9c5 Restrict general compare intrinsic optimization to CompareTo intrinsic 2019-04-29 16:27:35 +02:00
Simon Ogorodnik
51f5042315 Fix FIR compilation 2019-04-29 16:51:39 +03:00
Mikhail Glukhikh
b8e6291265 Inference: use generic version of error type in type approximator 2019-04-29 16:51:39 +03:00
Simon Ogorodnik
db8bd8c197 Fix check isCapturedTypeFromSubtyping to support KotlinTypeMarkers 2019-04-29 16:51:38 +03:00
Simon Ogorodnik
aabc9fa10f Abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
58029830f0 Skip star-projection to avoid failures 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
2ea7fb8801 Cleanup ConstraintStorage.buildResultingSubstitutor 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
57a3b1a773 Abstract TypeApproximator from NewCapturedType 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
9306f3840f Abstract buildResultingSubstitutor & ResultTypeResolver from KotlinType 2019-04-29 16:51:35 +03:00
Simon Ogorodnik
fe2e5b7301 Abstract FlatSignature from kotlin types 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
8e595f015e Initial OverloadingConflictResolver abstraction from KotlinTypes 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
9a1678728d Implement inference context and simple components 2019-04-29 16:51:33 +03:00
Simon Ogorodnik
04324b6723 Provide overloads with explicit resolutionFacade for resolutionApi
To ensure stable results of subsequent resolution api method calls,
it is require to provide same resolution facade, as
getResolutionFacade function doesn't guarantee to have same result in
subsequent calls due to soft caching
2019-04-29 16:51:32 +03:00
Roman Elizarov
1e5d973bb1 Fix CoroutineContext documentation with respect to equality
KT-26398 had updated behavior from reference comparison to regular
equality, but the documentation for CoroutineContext was left out.
The whole "by reference" needs to be removed, because it now
follows default behavior of all Kotlin collections and need no
further clarification.
2019-04-29 16:33:22 +03:00
Vyacheslav Gerasimov
389490ad79 Build: resolve :idea project resources lazily in ultimate plugin
to avoid using `evaluationDependsOn`
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
c218385ba8 Build: Collect sources for compiler lazily to avoid evaluationDependsOn 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
8851029baa Build: Use embedded configuration for compiler plugins 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
50e145f239 Build: remove various evaluationDependsOn calls across the build
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
0ec1df89fa Build: use configuration for dependency on android-extensions-runtime
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
b3720a55d2 Build: Make root ideaPlugin task depend on :prepare:idea-plugin
Since it's only one left in the project
2019-04-29 16:23:16 +03:00
Mikhail Glukhikh
3f6be95801 Include FIR modules into compiler #KT-30243 Fixed
(cherry picked from commit 053aa8ca1e)
2019-04-29 16:23:16 +03:00
Nicolay Mitropolsky
bd16c4629a KotlinElementActionsFactory.createChangeModifierActions modernisation
to allow IDEA relatively safely remove `createChangeModifierActions(target: JvmModifiersOwner, request: MemberRequest.Modifier)` in 192
2019-04-29 16:18:14 +03:00
Jiaxiang Chen
4b99d85322 Optimize JVM byte code generation for conditional conjunction
Implement an intrinsic method for boolean.and operation, and replace
ANDAND condition with a call to such intrinsic method.
2019-04-29 13:28:18 +02:00
Vasily Levchenko
53493657ff [kotlin-native-shared][version]bump 2019-04-29 14:08:16 +03:00
Nikolay Krasko
07ea0ffe16 Reformat and clean up idea.actions.internal 2019-04-29 12:13:18 +03:00
Nikolay Krasko
f9012cf637 Add options for disabling Kotlin line markers (KT-27332)
#KT-27332 Fixed
2019-04-29 12:13:14 +03:00
Nikolay Krasko
c72a375063 Better localization for dsl style icon change 2019-04-29 11:56:07 +03:00
Nikolay Krasko
ea8575c5a3 Remove check for Kotlin misconfiguration for the whole project (KT-30644)
Consider an existing project to be previously configured.

There's still "Configure Kotlin" action, check for configuration
triggered by adding a new Kotlin file, and notification in Kotlin files.

 #KT-30644 Fixed
2019-04-29 11:56:07 +03:00
Nikolay Krasko
01c0c3c924 Addition note about intention and quick-fixes execution in UI thread 2019-04-29 11:56:07 +03:00
Alexander Gorshenev
bd78e7e0aa Move property serialization to symbols
Make sure private field's wrapped descriptor is bound
2019-04-29 04:10:00 +03:00
Alexander Gorshenev
2c026114ae Made IrStatementOrigin serialization field optional for all statements 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
85f85fb3e8 IrStatementOrigin support in newly introduced IrDelegatedPropertyReference 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
19bd01cc8a Introduced proper IrStatementOrigin serialization. 2019-04-29 04:04:16 +03:00
Nicolay Mitropolsky
0794ab9432 Uast: cleaunp warnings (but some still remains) 2019-04-28 16:36:43 +03:00
Svyatoslav Kuzmich
13b332e99e Build scripts for JS IR versions of stdlib and kotlin.tests 2019-04-26 20:14:12 +03:00
Svyatoslav Kuzmich
5da83889d9 Stdlib tests: Supporess NoInfer access instead of redeclaration
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests
so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.)
could access it.

IR deserializer does not support declaration duplicates (at least yet
for JS IR backend). Thus this commit removes this redeclaration and
suppresses errors on its usages instead.
2019-04-26 20:14:03 +03:00
Sergey Igushkin
4848911e6d Fix testNativeTests, add missing system-out to expected test outputs 2019-04-26 18:51:25 +03:00
Sergey Igushkin
9d7c5213df Fix testNewKotlinJsPlugin on Windows (slashes) 2019-04-26 18:32:43 +03:00
Dmitry Petrov
865e0cc080 IR: IrConstructorCall: fixes after rebase 2019-04-26 17:43:26 +03:00
Igor Chevdar
7f423bd841 [IR] Fixes in inliner 2019-04-26 17:43:26 +03:00
Mikhael Bogdanov
be0b2e064b Fix JVM IR inliner 2019-04-26 17:43:26 +03:00
Roman Artemev
c545481db9 Fix JS_IR IrConstructorCall support 2019-04-26 17:43:26 +03:00
Roman Artemev
2a3ce8e9f1 Serialize IrConstructorCall 2019-04-26 17:43:26 +03:00
Dmitry Petrov
b78d1bb2b9 IrConstructorCall support in JVM_IR, JS_IR, and FIR2IR 2019-04-26 17:43:25 +03:00
Dmitry Petrov
82128800c5 IR: assertion in IrCallImpl init
NB it uses descriptor to determine if we try to call constructor using
IrCall.
2019-04-26 17:43:24 +03:00
Dmitry Petrov
11eea6e86a psi2ir: generate IrConstructorCall elements in IR builder helpers 2019-04-26 17:43:24 +03:00
Dmitry Petrov
e3fd74a580 IR: annotations are represented as IrConstructorCall elements
Also, they are rendered somewhat nicer
2019-04-26 17:43:24 +03:00
Dmitry Petrov
db7bcb6464 IR proto: IrConstructorCall in protobuf format 2019-04-26 17:43:24 +03:00
Dmitry Petrov
198ccbc114 JVM_IR: support IrConstructorCall in ExpressionCodegen 2019-04-26 17:43:24 +03:00
Dmitry Petrov
37b1c175ce IR: introduce IrConstructorCall / IrConstructorCallImpl 2019-04-26 17:43:24 +03:00
Roman Artemev
023306b1b3 [JS IR BE] Add tests for main function 2019-04-26 17:04:28 +03:00
Roman Artemev
5bd3bcd237 [JS IR BE] Support main function
* Implement IR-based main function detector
2019-04-26 17:04:28 +03:00
Roman Artemev
6729603ac7 [JS IR BE] Fix warnings 2019-04-26 17:04:28 +03:00
Mikhael Bogdanov
867e39f73c Parallelize idea-gradle tests 2019-04-26 14:42:20 +02:00
Leonid Startsev
90bf36ea7a Fix reference to IrField when serializing superclass' properties 2019-04-26 15:06:54 +03:00
Leonid Startsev
6bec6e6905 Add synthetic constructors to class member scope, so they won't fly 'in the air' in the backends
This is required mainly for Native compiler since it wont't work correctly on descriptors that are not present in the class.
2019-04-26 15:04:53 +03:00
Leonid Startsev
406896eaf0 Implement equals/hashcode for IrDeclarationOrigin so deserialized unknown origins would be compared correctly 2019-04-26 14:59:51 +03:00
LepilkinaElena
02331fbd7e Unify compiler and cinterop flags names (#2294) 2019-04-26 13:34:14 +03:00
nikita.movshin
7b017cb76f Add changelog for 1.3.30 and 1.3.31 2019-04-26 13:06:12 +03:00
Mikhael Bogdanov
c53682f397 Fix AS33 compilation
Commented unnecessary code that uses unavailable API
2019-04-26 11:29:42 +02:00
Mikhael Bogdanov
ceec35bf38 Up merge changes from UsefulTestCase into KtUsefulTestCase 2019-04-26 11:29:41 +02:00
Mikhael Bogdanov
1bc03e705a Minor. Remove old parallelize approach 2019-04-26 11:29:41 +02:00
Sergey Rostov
911a5bdd0e Specify missing type arguments to fix compilation 2019-04-26 12:00:43 +03:00
Mikhail Zarechenskiy
5b33e54f77 [NI] Provide diagnostics for candidates in "allCandidates" mode
This helps for completion as it use diagnostics to clip extra
 candidates
2019-04-26 11:40:17 +03:00
Mikhail Zarechenskiy
450bfed375 Specify missing type arguments to fix compilation in FE module 2019-04-26 11:32:19 +03:00
Mikhail Zarechenskiy
57ad0aa8fb Missing fix for project compilation against bootstrap compiler 2019-04-26 06:28:13 +03:00
Anton Yalyshev
657281a60d added tracking of chosen Kotlin framework in Java-based wizards 2019-04-25 19:06:20 +03:00
Anton Yalyshev
1d3f75adfd created FUS Group for New Project Wizards and Frameworks 2019-04-25 19:06:20 +03:00
Anton Yalyshev
01f34a0ba7 switched to new FUS adapter API 2019-04-25 19:06:19 +03:00
Anton Yalyshev
63ffff175b now we send FUS for ModuleBuilders and FrameworkSupportProviders 2019-04-25 19:06:19 +03:00
Svyatoslav Kuzmich
5baa520232 Advance bootstrap to 1.3.40-dev-2251
Required for JS IR CLI and Gradle plugin
2019-04-25 19:04:59 +03:00
Ilya Matveev
774dbcd6c0 Fix IDEA import after including kotlin-native-shared in Gradle plugin 2019-04-25 21:32:03 +07:00
Mikhail Zarechenskiy
f00c946ff7 Fix projection compilation against bootstrap compiler
This is needed after 5d95a1ac
2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
ac0a1d984f [NI] Don't return resulting call if return type has uninferred types 2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
db4ca059bd [NI] Fix IDE-refactorings when there are uninferred parameters 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
ff0993153c [NI] Improvements for "not enough information" diagnostic
#KT-30590 Fixed
2019-04-25 16:19:36 +03:00
Mikhail Zarechenskiy
09cc2ae27f [NI] Initial support of "not enough information" diagnostic
#KT-30590 In Progress
2019-04-25 16:19:36 +03:00
Dmitriy Novozhilov
c1b586f921 [NI] Complex test for "not enough" information diagnostic 2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
d40313a8d7 [NI] Allow capturing type projections with type variables
#KT-25302 Fixed
2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
abd1c3df26 [NI] Fix diagnostic reporting and unveil problem wrt captured types 2019-04-25 16:19:32 +03:00
Dmitry Gridin
6826d2f193 Replace provideByFqNameMulti with provideByFqName 2019-04-25 19:47:39 +07:00
Dmitry Gridin
3e74e875e8 Add a colon check in LanguageSettingsParser 2019-04-25 19:47:39 +07:00
Dmitry Gridin
b78ec32c02 Change CodegenFactory signature from Collection<KtFile?> to Collection<KtFile> 2019-04-25 19:47:39 +07:00
Dmitry Gridin
37c856290f Fix minor compile warnings 2019-04-25 19:47:39 +07:00
Dmitry Gridin
79793a4bda Replace deprecated classes with parent 2019-04-25 19:47:38 +07:00
Dmitry Gridin
2a85bece80 Replace CodeStyleSettingsManager.getSettings with CodeStyle.getSettings 2019-04-25 19:47:38 +07:00
Dmitry Gridin
bdb97ed46a Replace deprecated icons with actual 2019-04-25 19:47:38 +07:00
Dmitry Gridin
c41b98f5b9 Replace SystemInfo.isJavaVersionAtLeast("1.7") with SystemInfo.isJavaVersionAtLeast(1, 7, 0) 2019-04-25 19:47:38 +07:00
Dmitry Gridin
d7d9771b3c Replace UastEmptyExpression with UastEmptyExpression(null) 2019-04-25 19:47:38 +07:00
Alexander Udalov
648ed92ba3 Minor, deduplicate code in CodegenTestCase.doTest 2019-04-25 14:43:56 +02:00
Alexander Udalov
1c1ff3e2b2 Minor, move android-extensions-compiler tests to package org.jetbrains.kotlin
To fix the package name mismatch inspection
2019-04-25 14:43:47 +02:00
Alexander Udalov
74dd99a8da JS: use new DefaultBuiltIns instance instead of anonymous 2019-04-25 14:42:44 +02:00
Alexander Udalov
cb6fb78bc3 JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and
"simpleWithStdlib[...]" -> "simple[...]"
2019-04-25 14:42:43 +02:00
Alexander Udalov
0659d0cba9 JS: do not use getBuiltInsModule to compute module name
The intention of this code was to use the name "kotlin" for the builtins
module, in case we're using builtins loaded from the compiler class
loader (whose module is created in
`KotlinBuiltIns.createBuiltInsModule`). However,
`getBuiltIns().getBuiltInsModule()` may refer not necessarily to the
builtins module, but also to any valid module where the builtins are
visible from, therefore its name would be computed incorrectly. Use the
module name instead to determine if it's a synthetic builtins module
created in `createBuiltInsModule`
2019-04-25 14:42:43 +02:00
Alexander Udalov
d5fd160fd3 JS: minor, do not use '==' on descriptors from built-ins
Use KotlinBuiltIns.isString instead of equality with
KotlinBuiltIns.string, which is more portable across different module
configurations. Also use isSubtypeOf instead of
DescriptorUtils.isSubclass and thus get rid of an extra error on an
unresolved class in nativeAnnotationCheckers.kt
2019-04-25 14:42:42 +02:00
pyos
31670622c0 Remove a redundant JVM-specific lowering 2019-04-25 14:30:41 +02:00
Jake Wharton
373424f430 Add ULong.compareTo and UInt.div/rem/compareTo intrinsics for Java 8 2019-04-25 13:21:25 +02:00
Georgy Bronnikov
e6362661d1 Merge pull request #2298 from pyos/linear-toarray-lowering
JVM_IR: make ToArrayLowering linear in complexity
2019-04-25 13:28:49 +03:00
Mikhail Glukhikh
69ea0a3597 Fir broken FIR2IR test 2019-04-25 12:37:13 +03:00
Ilya Matveev
24588263ed Store kotlin-native-shared version in the jar of the Gradle plugin 2019-04-25 16:19:11 +07:00
Ilya Matveev
c9ed648303 Use kotlin-native-shared in the Gradle plugin
The kotlin-native-shared artifact includes API allowing
us to work with K/N platforms, hosts, distribution etc.
This patch replaces a dependency on kotlin-native-utils
containing copies of such classes with a dependency on
published kotlin-native-shared in the Gradle plugin and
bundles kotlin-native-shared into the Gradle plugin jar.
2019-04-25 16:19:11 +07:00
pyos
4b0b9e1f80 JVM_IR: make ToArrayLowering linear in complexity
by not running DFS from every node visited during another DFS.
2019-04-25 11:07:34 +02:00
Nicolay Mitropolsky
f118b007f0 Uast: more cases for KotlinUSimpleReferenceExpression resolve (KT-30957, KT-27385) 2019-04-25 10:07:09 +03:00
Simon Ogorodnik
9352d52e7e FIR: load default value from meta-data 2019-04-25 09:47:38 +03:00
Simon Ogorodnik
879563233a FIR: optimize caching in JVM deserializer 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f453e7df27 Improve error reporting in fir benchmark function 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
a5ca8ffe69 Refactor FirSelfImportingScope 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f22cca5087 FIR top-level member scope: lookup constructors via classes 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
9cf91738ea Use local callables index in FirClassDeclaredMemberScope 2019-04-25 09:47:37 +03:00
Mikhael Bogdanov
11e0035254 Support test parallelization in uast tests 2019-04-25 08:09:27 +02:00
Mikhael Bogdanov
d1b5c76f09 Reuse KtUsefulTest case temporary files infrastructure 2019-04-25 08:09:26 +02:00
Svyatoslav Kuzmich
e30bdb8dc9 Fix hanling module names that require escaping 2019-04-25 03:54:17 +03:00
Ilya Chernikov
c3a439a829 Fix and refactor scripting subplugin application logic
so warning is not shown when discovery configuration is not populated
fix #KT-31124
refactor code for clarity on the way
also apply scripting subplugin after main plugin to ensure that
configurations are created before scripting is initialized
2019-04-24 17:27:47 +02:00
Ilya Chernikov
917fc56f36 Fix main-kts dependencies after extracting scripting 2019-04-24 17:27:03 +02:00
Ilya Chernikov
4b8d9c8fdd Fix classloaders order on script evaluation
the dependencies one should be a parent for the modules one, to avoid
incompatibility problems. Also fixes main-kts tests
2019-04-24 17:27:03 +02:00
Anton Yalyshev
6ffc3a8679 bunch files update after master switched to 191 2019-04-24 17:23:47 +03:00
Anton Yalyshev
2329954e02 added capability to send a custom event's context 2019-04-24 17:23:22 +03:00
Anton Yalyshev
0255d66144 shortened class and function names and make them closer to actual FUS naming 2019-04-24 17:23:21 +03:00
Dmitry Gridin
9bd32eb3cb Replace GradleBaseInspection with BaseInspection
#KT-31103 Fixed
2019-04-24 20:23:15 +07:00
Dmitry Gridin
0198df4935 PackageDirectoryMismatchInspection should report when a package statement is missing
#KT-13549 Fixed
2019-04-24 20:16:54 +07:00
Dmitry Gridin
2ae30de980 MoveVariableDeclarationIntoWhenInspection shouldn't report a multi-line variable
#KT-30457 Fixed
2019-04-24 20:12:44 +07:00
Sergey Igushkin
d456ae58b6 Remove usages of com.intellij.* utils from kotlin-build-common, KT-31106
As Gradle may under certain conditions reorder the buildscript
classpath artifacts, we need to ensure that the `kotlin-build-common`
module, which duplicates some of the classes that are shaded and packed
into `kotlin-compiler-embeddable`, does not call `com.intellij.*`
classes.

Replace the `com.intellij.*` utils that were called on the execution
path with our own implementations.

Issue #KT-31106 Fixed
2019-04-24 15:51:13 +03:00
Svyatoslav Kuzmich
09d7f4015b Move test.kt stubs to smallRuntime
We already use kotlin.test with fullRuntime klib.
2019-04-24 13:06:59 +03:00
Svyatoslav Kuzmich
b0bd5802bb Remove optionalExpectation hacks
Add common sources to Generate IR Runtime
2019-04-24 13:06:58 +03:00
Svyatoslav Kuzmich
1a6e6588fc Fix: Use Vars instead of plain assignments for declaration imports 2019-04-24 13:06:58 +03:00
Ilmir Usmanov
c2884f3ca8 Optimize variable liveness analysis
During coroutines transformation, we analyse liveness of local variables
in order to decide whether we need to spill them or not.
This analysis contains hot method `useVar`, in which we previously
iterated over all variables in LVT. This is done, since these variables
are seen by debugger and we assume they are alice.
However, this variables can be generated by inliner. In this case, the
LVT's size in huge. I.e. we have loop in hot method.

By hoisting the liveness analysis of the LVT and combining its result
with result of usual liveness analysis, we achieve speed-up from 2m30s
down to 5s.
 #KT-30603 Fixed
2019-04-24 13:04:40 +03:00
Steven Schäfer
f2392a6a28 Remove Concat and StringPlus intrinsics in favor of IrStringConcatenation. 2019-04-24 12:04:12 +02:00
Natalia Selezneva
26c9d69252 Check KotlinOutOfCodeBlockTracker in OutOfBlockModificationTest
General PsiModificationTracker.outOfCodeBlockModificationTracker was removed in IDEA 192
2019-04-24 11:45:03 +03:00
Natalia Selezneva
512a297e0a Process property setter parameter in UAST 2019-04-24 11:39:17 +03:00
Natalia Selezneva
d45644cea4 Fix path to TestNG library in tests for 191 2019-04-24 11:39:17 +03:00
Nicolay Mitropolsky
1db7754298 A workaround for the IDEA-211491 in IDEA 191 to make Kotlin tests pass
for instance `InspectionTestGenerated$Inspections.testOverridingDeprecatedMember_inspectionData_Inspections_test`
2019-04-24 11:21:30 +03:00
Dmitriy Dolovov
d90b63d928 Improve logging in NativeCompilerDownloader
Issue #KT-31158 fixed
2019-04-24 14:17:16 +07:00
Dmitriy Dolovov
63f58b4a4a Add applicability condition to KotlinNativeGradleConfigurator 2019-04-24 14:17:11 +07:00
Dmitriy Dolovov
e188c313e6 Fix: Add Native KLIBs as project-level libraries
Issue #KT-30966 Fixed
2019-04-24 14:17:03 +07:00
Sergey Rostov
cfa635b36a JPS Build: update artifacts for scripting-compiler-impl and js ir backend 2019-04-24 09:45:23 +03:00
Sergey Rostov
aac564872c Scripting, main-kts: temporary workaround to avoid IDE exceptions on Kotlin project
Exclude script definition from resources classpath to avoid IDE exceptions
on kotlin project. This is done by moving MainKtsScript to new `jar-resources`
 folder which is not resource root.

#EA-127827
#KT-31176
2019-04-24 09:14:34 +03:00
Svyatoslav Kuzmich
bb3b9a935f Command line interface 2019-04-23 23:19:12 +03:00
Roman Artemev
89500d776d [IR BE] Don't use symbol table in SuspendFunctionLowering 2019-04-23 22:30:00 +03:00
Alexey Tsvetkov
bec5879e3a Fix ABI plugin
It seems that I forgot to update compiler.pro.191,
so when we switched to IJ 191, ABI plugin has broken
2019-04-23 21:56:05 +03:00
nikita.movshin
deb416484c Update copyright. Fix 2 lines comments after rebase
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:15:03 +03:00
nikita.movshin
a6230c1e2a Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 1 line comment with dates from 2000 till 2017
2019-04-23 20:09:27 +03:00
nikita.movshin
86672df107 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update TestGenerator.kt
2019-04-23 20:09:27 +03:00
nikita.movshin
abb7d3ab46 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 2 lines comment
2019-04-23 20:09:27 +03:00
nikita.movshin
a636e3d57d Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:09:23 +03:00
nikita.movshin
2e59fdc157 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update apache.xml
2019-04-23 20:09:23 +03:00
nikita.movshin
65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Vyacheslav Gerasimov
9f3495138f Build: Use embedded configuration in kapt embeddable project
#KT-31047
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
82f9757138 Build: Fix dependency leak on :kotlin-compiler in kotlin-native-library-reader
Introduce mavenCompileScope to manage compile records in pom.xml
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
57cb59bfc7 Remove 181 related warnings from inspection profile 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
210ee681a4 Cleanup bunch workarounds made for 181 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
2bc11cbd58 Remove as32 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
952d2b6287 Remove 181 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
e261e46e52 Remove 181 & as32 from .bunch 2019-04-23 17:28:40 +03:00
pyos
5b595b58b2 JVM_IR: fold constant string concatenations 2019-04-23 16:20:43 +02:00
Alexey Tsvetkov
1bc4a2eff9 Replace AbstractIncrementalJpsTest->AbstractIncrementalJvmJpsTest
It was accidentally replaced back when switching to IJ 191
2019-04-23 16:14:39 +03:00
Ilmir Usmanov
f94092e952 Add single 192 file for bunch not to fail 2019-04-23 15:57:51 +03:00
Jorge Antonio Díaz-Benito Soriano
3064601e5e Fix a typo
#KT-31138 Fixed
2019-04-23 13:38:19 +02:00
Steven Schäfer
8c06f7daae Fix IR declaration parents.
- Reparent declarations in FileClassLowering, InterfaceLowering,
  StaticDefaultFunctionsLowering, EnumClassLowering, and
  RenameFieldsLowering
- Set correspondingPropertySymbol in MoveCompanionObjectFieldsLowering
- Reparent field initializers in MoveCompanionObjectFieldsLowering and
  EnumClassLowering
- Ensure that parents are unique in PropertiesLowering
- Set declaration parent in SharedVariableManager
- Set field declaration parents in CallableReferenceLowering
- Set declaration parents in FunctionNVarargInvokeLowering
- Set declaration parents for external declaration fields
2019-04-23 12:51:27 +02:00
Yan Zhulanow
f39908b411 Minor: Fix configuration test, lower requirement on Kotlin plugin 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b35ed2602c Pill: Fix test dependencies handling 2019-04-23 12:38:28 +03:00
Yan Zhulanow
038c320594 Pill: Filter duplicating entries for SelfResolvingDependencies 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b8aaf017ea Pill: Update module names in tasks
Pill now uses module names based on Gradle project paths.
Run configurations should be aware of the new names.
2019-04-23 12:38:28 +03:00
Mikhail Glukhikh
4a5b900d28 FIR: get rid of library type parameter symbol 2019-04-23 11:51:36 +03:00
Simon Ogorodnik
649c2f6bcc FIR deserializer: load type-parameters correctly 2019-04-23 11:51:05 +03:00
Simon Ogorodnik
853167a24d FIR deserializer: handle class type parameters properly 2019-04-23 11:41:07 +03:00
Mikhail Glukhikh
2476c0299f FIR Java: fix constructor enhancements
Before this commit,
we generated regular member functions as constructor enhancement.
Now, we generate constructors as constructor enhancement.
2019-04-23 11:41:05 +03:00
Simon Ogorodnik
2e966a7ded FIR deserializer: load type-parameters for kotlin function properly 2019-04-23 11:41:03 +03:00
Simon Ogorodnik
9bbf5bebd2 Raw FIR: support typing for delegated constructor call 2019-04-23 11:41:01 +03:00
Simon Ogorodnik
73b1676a03 Raw FIR: fix unary operators (now convention calls use receivers) 2019-04-23 11:40:32 +03:00
Mikhail Glukhikh
77e83dd8cf Raw FIR: introduce string concatenation call
This removes some 'plus' calls to be resolved
2019-04-23 11:35:41 +03:00
Simon Ogorodnik
8d2acd790d FIR Java: use safer cases in use-site scope to allow constructors 2019-04-23 11:21:46 +03:00
Mikhail Glukhikh
618295f505 FIR: implement trivial typing for break & continue 2019-04-23 11:18:24 +03:00
Mikhail Glukhikh
b9f09afc6f Raw FIR: introduce lambda argument expressions
Without it we cannot distinguish lambda argument from just last argument
2019-04-23 11:15:26 +03:00
Mikhail Glukhikh
cf72b13d84 Add accessor symbols & test for property overriding in Java 2019-04-23 11:15:24 +03:00
Simon Ogorodnik
9abf4062b1 FIR tree: implement trivial expressions typing 2019-04-23 11:14:55 +03:00
Simon Ogorodnik
c3632487d0 FIR Java: improve symbol provider laziness 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
98f4fa1f6c FIR Java: fix too strict cast in use-site scope 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
539fcf82ef Fix deprecation in FIR super type resolver 2019-04-23 09:49:29 +03:00
Mikhail Glukhikh
47f61b2917 Revert "Include FIR modules into compiler #KT-30243 Fixed"
This reverts commit 053aa8ca. It causes
"IllegalArgumentException: org.gradle.*.DefaultClassLoaderScope@13fca663
must be locked before it can be used to compute a classpath!"
in Gradle integration tests
2019-04-23 09:47:18 +03:00
Ilya Kirillov
d2a3d00548 New J2K: fix existing test data 2019-04-22 22:54:48 +03:00
Ilya Kirillov
101ae75b8c New J2K: fix lost JavaMapForEachInspection in post-processing 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c4d07bd7e7 New J2K: reduce boilerplate code in post-processings for registerDiagnosticBasedProcessing's 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c0ec36b3e9 New J2K: fix wrong JKTypeCastExpression children initialisation 2019-04-22 22:54:48 +03:00
Ilya Kirillov
bb81ad7b5f New J2K: do not convert Java string type to a Kotlin one because of wrong constructor calls 2019-04-22 22:54:48 +03:00
Ilya Kirillov
7e7e8f7631 New J2K: add support of lambda expressions in nullabilityAnalysis 2019-04-22 22:54:48 +03:00
Ilya Kirillov
1ffe07bb6c New J2K: fix wrong psi modification in ConvertDataClass 2019-04-22 22:54:47 +03:00
Ilya Kirillov
f11311a20b New J2K: add support of method reference conversion 2019-04-22 22:54:47 +03:00
Ilya Kirillov
8f4f80256a New J2K: do not add extra !! in ImplicitCastsConversion because it would be added later in post-processing 2019-04-22 22:54:47 +03:00
Ilya Kirillov
67770eb86b Fix "New J2K: external annotations support for nullability analysis" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
c39a54d40c Fix "New J2K: pass converter context to postprocessing" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
9e1a858bed New J2K: fix exception in ConvertGettersAndSetters if function is called set 2019-04-22 22:54:47 +03:00
Ilya Kirillov
2ce7dc9d19 New J2K: external annotations support for nullability analysis 2019-04-22 22:54:47 +03:00
Ilya Kirillov
0a88276f68 Make mustNotBeNull function from JavaNullabilityChecker available for J2K 2019-04-22 22:54:47 +03:00
Ilya Kirillov
98651f3484 New J2K: add element info storage, pass info about types & functions via it 2019-04-22 22:54:47 +03:00
Ilya Kirillov
39b09b39ff New J2K: pass converter context to postprocessing 2019-04-22 22:54:46 +03:00
Ilya Kirillov
c4a238cca4 KT-26550: do not show "Convert Java File to Kotlin File" action for external libraries
#KT-26550 fixed
2019-04-22 22:54:46 +03:00
Vyacheslav Gerasimov
8723ad4f46 Switch to 191 platform 2019-04-22 21:52:19 +03:00
Sergey Rostov
21232d202e JPS Build, 191: update artifacts 2019-04-22 21:52:02 +03:00
Vyacheslav Gerasimov
1551f39daa Update asm version to 7.0.1 everywhere 2019-04-22 21:52:01 +03:00
Vyacheslav Gerasimov
aff9da72a8 Update 191 platform to 191.6707.61 2019-04-22 21:52:00 +03:00
Vyacheslav Gerasimov
67a194fa8c Remove broken 192 bunch files 2019-04-22 21:46:57 +03:00
Vyacheslav Gerasimov
6059725c76 Add 192 to .bunch 2019-04-22 21:00:10 +03:00
Svyatoslav Kuzmich
b1d303b027 Reorganize stdlib-js sources specific to the current JS backend
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
9dd9efd4aa [JS IR BE] Fix isQUnit for JS IR BE 2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
d7be91e8a4 [JS IR BE] Add SIZE_BYTES and SIZE_BITS to Long and Char 2019-04-22 20:30:57 +03:00
Alexander Gorshenev
3ae64061c1 Minimal tweaks in IR Validation code just to be able to turn it on in Native. 2019-04-22 19:42:33 +03:00
Mikhail Glukhikh
053aa8ca1e Include FIR modules into compiler #KT-30243 Fixed 2019-04-22 15:48:46 +03:00
Alexey Tsvetkov
77d74a261d Rename SourceFileToPathConverter->FileToPathConverter 2019-04-22 15:27:58 +03:00
Alexey Tsvetkov
f66d95545d Test JPS Kotlin caches don't change when project root is different 2019-04-22 15:27:57 +03:00
Alexey Tsvetkov
a7df7e2f9f Sort files when performing GC in lookup storage 2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
ea4fc0fb6b Disable scripting plugin in JPS tests
JVM compiler loads scripting plugin by default,
which in turn performs script template discovery
in compile classpath.

Classloading and template discovery takes noticeable
amount of time in JPS tests, because of
relatively big number of short compilations.

Disabling scripting plugin in most JPS+JVM tests
speeds up JPS tests by ~8% compared to the result before all
optimizations.
2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
175dd5679c Keep application environment alive between JPS tests
This speeds up JPS tests by ~16% compared to the result before all
optimizations. The speedup comes mostly from avoiding re-reading jar
files (like kotlin-stdlib.jar).
2019-04-22 15:27:55 +03:00
Alexey Tsvetkov
80c99eceff Rebuild once after each JPS test
After each test we rebuild everything,
then we compare incremental caches and output
with caches and output after rebuild.

For some reason we did rebuild and comparison
twice per test. This seems excessive.

Removing the second rebuild speeds up JPS tests by ~15%
compared to the result before all optimizations
2019-04-22 15:27:54 +03:00
Alexey Tsvetkov
61fbe43a3f Store relative paths in JPS caches if possible
So caches can be relocated from one machine to another
2019-04-22 15:27:53 +03:00
Alexey Tsvetkov
00de7b6c44 Allow customizing source file path conversion in lookup storage 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
79337a6b96 Allow customizing source file path conversion in local IC caches 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
146eebdc7e Print lookup storage as is in tests
This way it is easier to debug when
cache's content is different after rebuild
2019-04-22 15:26:34 +03:00
Nikolay Krasko
de548d6b8b Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen 2019-04-22 15:11:10 +03:00
Nikolay Krasko
b83d07ae9a Assert new quick fixes don't use resolve 2019-04-22 15:11:10 +03:00
Nikolay Krasko
682183a150 Allow resolve in write action for injection for now 2019-04-22 15:11:09 +03:00
Svyatoslav Kuzmich
889b4d721d [JS IR BE] Use constructor parameter to determine underlying type for inline classes
Inline classes from lazy IR may not have files.
2019-04-22 13:18:01 +03:00
Svyatoslav Kuzmich
3fd55673a8 [JS IR BE] Workaround for println
IR backend has a bug in decomposition of dynamic calls.
Workaround: don't use inline function call inside dynamic call argument.
2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
03ba0eae5a [JS IR BE] Minor: better internal error message in Namer 2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
7c2ee41491 [JS IR BE] Fix boolean companion object 2019-04-22 13:18:00 +03:00
Toshiaki Kameyama
864f99782e Use property access syntax: fix problem text and highlight range
#KT-30910 Fixed
2019-04-22 16:19:37 +07:00
Toshiaki Kameyama
bf5b559923 Add function supertype: make abstract function in sealed class
#KT-30769 Fixed
2019-04-22 16:11:59 +07:00
Toshiaki Kameyama
f2c7b6b8c4 Convert to anonymous object: don't remove type arguments
#KT-30208 Fixed
2019-04-22 16:09:53 +07:00
Toshiaki Kameyama
075620daad Invert if condition intention: don't remove line breaks
#KT-30900 Fixed
2019-04-22 15:59:49 +07:00
Nikolay Krasko
a66aebdc2c Consider range marker with bad interval to be invalid (EA-141900, EA-135531) 2019-04-22 11:34:34 +03:00
Dmitry Gridin
3838976083 Fix false positive 'Remove redundant qualifier name' for property
#KT-31112 Fixed
2019-04-22 11:58:43 +07:00
Mikhail Zarechenskiy
673b54554c [NI] Also complete arguments for ambiguity calls
This is needed for IDE-tests and cases when integer literals are used
 in such ambiguity calls
2019-04-22 00:23:15 +03:00
Nikolay Krasko
088da3e807 Postpone no kotlin files in selection to CheckComponentsUsageSearch execution (KT-31092)
#KT-31092 Fixed
2019-04-19 17:12:12 +03:00
Nikolay Krasko
be471b29c4 Use bunch-specific version of gson in kotlin-gradle-plugin
While kotlin-gradle-plugin is not built for different bunches, bad
version still fails Gradle synchronize action in IDE.
2019-04-19 17:12:12 +03:00
Nikolay Krasko
04eeabcd98 Detect platform only for stdlib and use only roots for detection (KT-30442)
#KT-30442 Fixed
2019-04-19 17:12:12 +03:00
Dmitriy Novozhilov
bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
f9cc3d9be3 [NI] Fix determining type equality in replacing of extension receiver 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
0739d13038 [NI] Record scope in trace for calls with enabled NI 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
c86b8da982 [NI] Don't report overload ambiguity for error candidates 2019-04-19 14:46:22 +03:00
Kirill Rakhman
00c76593f2 fix typo in test data 2019-04-19 18:31:17 +07:00
Ilya Matveev
c0eba201a5 CocoaPods: Show error if a build is started not from Xcode
Issue #KT-31062 Fixed
2019-04-19 17:55:57 +07:00
Ilya Matveev
a1e20f8d2a Add tests for CocoaPods integration 2019-04-19 17:55:57 +07:00
Alexander Udalov
822b210e85 Minor, update argfile usage description 2019-04-19 12:55:23 +03:00
victor.petukhov
a567aa620b Fix headers in box and parsing spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
f6d67251fb Print info about all failed test cases in spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
86bb5d689d Add various tests for DFA testing 2019-04-19 11:55:30 +03:00
Sergey Rostov
15e3482eec JPS Build: add type-system to kotlin-reflect.jar 2019-04-19 11:51:34 +03:00
Dmitriy Novozhilov
f7b4b553b7 Minor: remove redundant import 2019-04-19 11:08:43 +03:00
Dmitriy Novozhilov
ad50bcaf09 Add extracting original value parameters and original source in IDEA Slicer
#KT-31113 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
94c4a68344 [NI] Fix determination of ArgumentMatchStatus
#KT-31081 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
642f8ecaf8 [NI] remove redundant replacing receiver in lambda function descriptor
#KT-30927 Fixed
#KT-31057 Fixed
2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy
2fe900d915 [NI] Resolve lambda against input types from expected type
This is needed to report more precise diagnostics and fix IDE-tests

 #KT-31059 Fixed
2019-04-19 09:08:31 +03:00
Mikhail Zarechenskiy
8f8e33f251 [NI] Strip only Exact-annotation preserving others during inference 2019-04-19 09:08:31 +03:00
Abduqodiri Qurbonzoda
3f08753f87 Move string-related files to text directory 2019-04-19 03:51:20 +03:00
Mikhael Bogdanov
dd005d3c02 Introduce IrLazyField 2019-04-18 19:56:19 +02:00
Sergey Igushkin
13120d23ce Fix Gradle task validation failure due to missing property annotation 2019-04-18 20:41:43 +03:00
Vyacheslav Gerasimov
f9d2601d92 Build: Remove kotlin-scripting-compiler-impl from kotlin-plugin.jar
It already copied to plugin lib as separate library
2019-04-18 20:05:09 +03:00
Ilmir Usmanov
eb5ea62da4 Use anonymous objects instead of lambdas as callbacks in java interop tests 2019-04-18 18:38:16 +03:00
Georgy Bronnikov
328b8f9725 Redirect EnumConstructorCall to IrFunctionAccess in IrElementTransformerVoid 2019-04-18 14:50:55 +03:00
Mikhael Bogdanov
dde28ddc52 Parallelize compiler tests 2019-04-18 13:24:58 +02:00
Mikhael Bogdanov
73836928ef Minor. Update folder suffix
Debug purpose
2019-04-18 13:24:57 +02:00
Ilya Chernikov
9900ac2462 Fix runtime compatibility with the obsolete script jvm eval config options...
also switch mainKtsTest to the mew option
2019-04-18 13:01:50 +02:00
Andrey Uskov
00c3550191 Add method 'addModuleDependencyIfNeeded' in order to keep
compatibility with AndroidStudio
#KT-31090 Fixed
2019-04-18 13:32:48 +03:00
Dmitry Gridin
9d3ebf4562 Minor: refactoring ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:33:48 +07:00
Dmitry Gridin
3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
Dmitry Gridin
d738a12b86 Fix false positive ReplaceJavaStaticMethodWithKotlinAnalog for java.io.PrintStream 2019-04-18 15:28:52 +07:00
Dmitry Gridin
fd47dc9b88 Replace popup with several quick-fixes in ReplaceJavaStaticMethodWithKotlinAnalog 2019-04-18 15:28:52 +07:00
Dmitry Gridin
ee304e92b5 Add Java Arrays.asList, Set.of, List.of to ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-27782 #KT-21641
2019-04-18 15:28:52 +07:00
Dmitry Gridin
b5b5723ec3 Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:28:52 +07:00
Dmitry Gridin
23003c5d1a Add Java compare to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
7f3c4a21d5 Add Java toString to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
6afc0367c0 Merge ReplaceJavaIntegerToStringWithMemberInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-12721
2019-04-18 15:28:51 +07:00
Dmitry Gridin
6b7f4dda31 Merge ReplaceArraysCopyOfWithCopyOfInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-23023
2019-04-18 15:28:51 +07:00
Dmitry Gridin
50b89dd587 Add more cases for ReplaceJavaStaticMethodWithTopLevelFunction from java.lang.Math 2019-04-18 15:28:51 +07:00
Sergey Rostov
69120c0614 JPS build: note about updating artifacts configuration when updating bootstrap version 2019-04-18 10:36:22 +03:00
Sergey Rostov
30d1cc51bf JPS Build: update artifacts 2019-04-18 10:36:22 +03:00
pyos
b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Mikhael Bogdanov
14485c0e33 Switch default for parallel execution 2019-04-18 08:33:02 +02:00
Ilmir Usmanov
dc821a720b Fix test data 2019-04-18 01:13:01 +03:00
Ilmir Usmanov
a793055ec2 Check variables, captured by outer object when searching for suspend crossinline parameters 2019-04-18 01:12:58 +03:00
Ilmir Usmanov
7c14f4c6ae Do not duplicate $$forInline counterpart of inline capturing function 2019-04-18 01:12:56 +03:00
Ilmir Usmanov
20b9d8b2f3 Generate state-machine even if the object is going to be transformed
This fixes Java interop of inline functions, which use coroutines.
However, we cannot transform the state-machine. Thus, we generate
a $$forInline counterpart for suspend functions (similar to inline
suspend functions) and invokeSuspend$$forInline for lambdas if these
coroutines are going to transformed (i.e. are declared inside inline
functions).
During transformation we just skip method with state-machine and
transform the $$forInline counterpart. Of course, if inline site is
inline itself, we generate both state-machine version (which will be
dropped during the next transformation) and $$forInline version.
Consequently, the final version of the coroutines will not have
$$forInline counterpart.
Unfortunately, since CompileKotlinAgainstInlineKotlin tests do not allow
java sources, the tests for the interop are usual box tests.

 #KT-30707 Fixed
2019-04-18 01:12:52 +03:00
Mikhail Zarechenskiy
fe8bf98bce Fix project compilation against bootstrap compiler
Follow-up of 705a8a22, there were several usages of SAM conversions
 for Kotlin functions
2019-04-17 23:11:05 +03:00
Ilya Chernikov
ada3edb222 Fix after rebase - adapting to the new idea plugin handling scheme 2019-04-17 22:03:59 +02:00
Ilya Chernikov
4b4186ecb2 Switch to coroutines 1.1.1 2019-04-17 22:03:59 +02:00
Ilya Chernikov
7c4efb2772 Disable ScriptingGradleSubplugin if applied in the gradle prior to 5.0
Allows to avoid limiting scripting infrastructure to languageVersion 1.2,
since kotlin compiler 1.3+ is bundled with gradle only starting from 5.0
2019-04-17 22:03:59 +02:00
Ilya Chernikov
72736d78e4 Drop blocking transitive dependencies following for gradle subplugins
fixes scripting subplugin usage, since it requires some dependencies now
2019-04-17 22:03:59 +02:00
Ilya Chernikov
f688bc5140 Add diagnostics for plugin classpath problems 2019-04-17 22:03:59 +02:00
Ilya Chernikov
8a8de052a3 Fix JSR-223 and scripting samples dependencies 2019-04-17 22:03:59 +02:00
Ilya Chernikov
60b3fa3b07 Fix embeddable host test 2019-04-17 22:03:58 +02:00
Ilya Chernikov
090dadce3e Fix testdata - script extension hint is not generated anymore...
due to changes in the scripting initialization logic
2019-04-17 22:03:58 +02:00
Ilya Chernikov
64c3bcd9ab Drop refactored-out frontend.script module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
8df829a7cd Move scripting-compiler-impl definition to another package...
to continue merging with the refactoring with further scripting improvements
2019-04-17 22:03:58 +02:00
Ilya Chernikov
f71cc4e480 Drop long deprecated legacy script annotations and resolvers support 2019-04-17 22:03:58 +02:00
Ilya Chernikov
4f135a5fe5 Move REPL implementations to the scripting compiler impl module 2019-04-17 22:03:57 +02:00
Ilya Chernikov
199b32cad7 Merge scripting-impl to scripting-compiler-impl module...
to continue merging with the branch with further scripting refactorings
2019-04-17 22:03:57 +02:00
Ilya Chernikov
a82b386d81 Add a new module for scripting compilation infrastructure...
add embeddable variant as well
2019-04-17 22:03:57 +02:00
Ilya Chernikov
4625468de7 Expose project environment from core env, to allow usages of plugins...
before core env construction. Refactor script evaluation extension to
this scheme.
Plus some refactorings of the logic of script/repl evaluation in K2JVMCompiler
2019-04-17 22:03:57 +02:00
Igor Yakovlev
1178e94f50 Fixed intentions that used not valid PSI
Fixed ConvertToMemberIntention and ObjectLiteralToLambdaIntention that are used PSI after lazy block reparse.
2019-04-17 20:26:23 +03:00
Igor Yakovlev
1f29b42cd3 KtBlockExpression as lazy reparseable node (KT-13841)
Changed KtBlockExpression to support LazyReparseable behaviour
Added LazyKtBlockExpressionTest
Added new BlockWrapper delegations
2019-04-17 20:26:15 +03:00
Kirill Shmakov
e774f3fe77 Update iOS template for XCode 10.2
Info.plist generated by default does not provide required bundle id key.
Added separated Info.plist and its usage is explicitly specified.

See KOTLIN-CR-2913.
2019-04-17 18:54:45 +03:00
Mikhael Bogdanov
b70ff30dc3 Don't generate bridge flag for defaults in JVM IR backend 2019-04-17 14:53:30 +02:00
pyos
115b1c6b6e JVM_IR: force materialization of non-transparent block results 2019-04-17 14:14:21 +02:00
pyos
b1bba70e40 JVM_IR: elide static field initialization to default values 2019-04-17 14:14:21 +02:00
Mikhail Zarechenskiy
bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Mikhael Bogdanov
5dea14f4ce Reuse already created temp folder from UsefulTestCase 2019-04-17 11:22:19 +02:00
Mikhael Bogdanov
0d3f03a15a Support parallelization in another IDE tests 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
18f76c31ca Get rid of redundant UsefulTestCase 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
854b73b03c Specify test runners for IDE tests 2019-04-17 11:22:17 +02:00
Mikhael Bogdanov
aaf0fbdbd6 Fix debugger tests 2019-04-17 11:22:16 +02:00
Mikhael Bogdanov
51bc979edb Move parallelization utils to separate file, set test root for each process 2019-04-17 11:22:16 +02:00
Anton Bannykh
c6d177b467 JS: don't remove imports only used for fake overrides (KT-31007 fixed) 2019-04-17 11:41:47 +03:00
Anton Yalyshev
6113e66e7a removed forgotten and unnecessary code 2019-04-17 10:56:08 +03:00
Anton Yalyshev
f79517ee5d use new js gradle plugin and correct name of mpp plugin 2019-04-17 10:56:06 +03:00
Mikhael Bogdanov
3f1f335c47 Minor. Fix compilation 2019-04-17 09:50:49 +02:00
Mikhael Bogdanov
01dc66b53a Temporary workaround: use teamcity.build.tempDir instead of java.io.tmpdir
teamcity.build.tempDir is cleaned up between build executions,
 should be fixed soon on Teamcity side
2019-04-17 09:33:58 +02:00
Mikhail Zarechenskiy
e6e0b83184 [NI] Fix IDE-tests where integer types were used in unresolved calls
For example, test like CallExpression#testCallWithJavaClassReceiver

 #KT-31060 Fixed
2019-04-17 01:40:56 +03:00
Mikhail Zarechenskiy
705a8a2234 [NI] Disable SAM-conversions for Kotlin functions by default
#KT-30661 Fixed
2019-04-17 01:40:54 +03:00
Andrey Uskov
c6f29cbf38 Disable GradleInspectionTests in AndroidStudio 2019-04-17 00:17:41 +03:00
Andrey Uskov
364274ef90 Fix setting production-on-test flags in MPP projects
#KT-29854 Fixed
2019-04-17 00:17:21 +03:00
Leonid Startsev
1a0b7902c2 Create separate type arguments for writeSelf function, since it is static now.
Fixes kapt issue https://github.com/Kotlin/kotlinx.serialization/issues/429
2019-04-16 19:37:31 +03:00
Sergey Igushkin
bd1f95da04 Disable automatic JVM target 1.8 detection in Android projects, KT-31027
This is a soft revert of the fix for KT-21030 (commit ffbd0e8a).
The logic introduced for KT-21030 should now only run when a property
flag is provided, kotlin.setJvmTargetFromAndroidCompileOptions.

We can't set the JVM target to 1.8 automatically until an Android Gradle
plugin version appears that can correctly desugar the bytecode produced
by the Kotlin compiler.

So we disable the logic introduced in the fix for KT-26432
with the plan to enable it back and apply it conditionally once there is
an Android Gradle plugin version that processes the calls correctly.

Issue #KT-31027 Fixed
2019-04-16 19:02:44 +03:00
Mikhael Bogdanov
bec80dd27f Use Teamcity tmpdir to cleanUp it between executions 2019-04-16 15:37:07 +02:00
gcx11
164933a31e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
gcx11
b49c5bf74e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
Ilya Chernikov
d98b1dfa7e Fix testdata after adding main function to scripts 2019-04-16 11:55:24 +02:00
Ilya Chernikov
67ad3773de Implement main method generation in scripts and runnable jar saving
refactor necessary parts on the way
2019-04-16 11:55:23 +02:00
Ilya Chernikov
c896b4873b Rearrange scripting host classes, so the runner part is independent from the compiler 2019-04-16 11:55:23 +02:00
Ilya Chernikov
a6f0bd6677 Refactor jvm evaluation to make module operations cleaner and more robust
in addition:
- hide internal configuration keys
- add keys for flags controlling evaluation
- add initial module implementation for using scripts from a classpath
2019-04-16 11:55:22 +02:00
Ilya Chernikov
90444502a6 Extend evaluation API for easier passing of evaluation configuration
refactor helpers accordingly
2019-04-16 11:55:22 +02:00
Ilya Chernikov
fa58b41e43 Implement script evaluation configuration refinement 2019-04-16 11:55:21 +02:00
Ilya Chernikov
c51d4a4405 Implement simple "saving evaluators" to classes and to a jar 2019-04-16 11:55:20 +02:00
Mads Ager
a65f50bb00 JVM_IR: Generate java 8 parameter names when -java-parameters is passed.
The type mapper does not map enum parameters and outer this parameters
to the right parameter signature kinds so around half the tests
are still failing. Since a new type mapper is being worked
on I will not investigate that further right now.
2019-04-16 09:32:57 +02:00
Mikhail Zarechenskiy
e27f71c6f3 [NI] Add test for obsolete issue
#KT-30858 Obsolete
2019-04-16 10:32:12 +03:00
Mark Punzalan
9f4db04839 Change visibility of ForLoopsLowering from internal to public. 2019-04-16 09:31:40 +02:00
Vyacheslav Gerasimov
152d5a98e8 Build: Remove duplicate sam-with-receiver-compiler-plugin in libraries 2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
f052f31c83 Build: Put gradle tooling model in kotlin plugin as separate jars
Those jars are loaded by gradle during import process
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
d6e2b5066b Build: Use sync task for copying idea plugin to the output
It will prevent files from previous builds remain in the target directory
Now we can remove `cleanArtifacts` kostyl from teamcity build
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
478208b070 Build: remove ideaPlugin helper
Plugin distribution building logic is now handled solely by idea-plugin project
2019-04-15 22:04:17 +03:00
Yan Zhulanow
7710942ec5 Kapt: Call next resolver in populateModuleExtraModels() (KT-30995) 2019-04-15 20:11:29 +03:00
Nikolay Krasko
27fd64ed42 Enable registration of CIDR bundle to prevent test failure in AS 3.5 (KT-26337) 2019-04-15 14:46:40 +03:00
Nikolay Krasko
1da51c118e Minor: fix too long strings 2019-04-15 14:46:40 +03:00
Nikolay Krasko
4691f6fed5 Don't read attributes in invalid files (EA-141259) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
a3bd46858a Additional diagnostic added for bad class assert 2019-04-15 14:46:39 +03:00
Nikolay Krasko
28aa404356 Don't create intention for some bad psi (EA-141235) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
bc258fa856 Fix RemoveUselessIsCheckFixForWhen - don't assert psi state in quick fixes (EA-141206) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
55b2a7d051 Fix NPE in surround (EA-141193) 2019-04-15 14:46:39 +03:00
Ryan
916f871fd1 Wrong File name 'KotlinNativeTaretConfigurator.kt' 2019-04-15 17:40:15 +07:00
Nikolay Kasyanov
7d2041ed82 Fix fat dSYM Info.plist copying
Issue #KT-31008 Fixed
2019-04-15 17:34:32 +07:00
Yan Zhulanow
5825da8433 Fix binary compatibility with Android plugin (KT-30978) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
0dfe122a40 Pill: Mark more projects as 'jps-compatible' in FULL variant 2019-04-15 05:17:03 +03:00
Yan Zhulanow
ae747196c2 Pill: Add kotlinVersion to the default JUnit configuration (for Gradle integration tests) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
d5fa4f983e Pill: Resolve dependencies using ResolvedArtifact data 2019-04-15 05:17:03 +03:00
Svyatoslav Kuzmich
977d3ef840 [JS IR BE] New name generator 2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich
a16ca5e66c [JS IR BE] Static members lowering pass 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
38fc4b0c59 [JS IR BE] Hack irRuntime js function usage to compensate for implementation shortcomings 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
5c5d65bdb9 [JS IR BE] Lower dataClass hashCode and toString 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
e52ae38cf5 [JS IR BE] Minor: Use proper trow in js compiler test runtime 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
ce1ae417c2 [JS IR BE] Minor: don't use descriptors 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
7a6e245dba [JS] Minor: Use file path to V8 runner to show better error messages 2019-04-13 14:17:58 +03:00
Mikhail Zarechenskiy
1bc078769b Regenerate tests 2019-04-12 18:17:48 +03:00
Dmitriy Novozhilov
18f9272f56 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-12 17:36:59 +03:00
Dmitriy Novozhilov
ece3a0fe90 Minor: fix smartcast on var in IrUtils.kt 2019-04-12 17:36:59 +03:00
Roman Artemev
01878fe4b5 [JS IR BE] Remove unused lowering
* its functionality is merged into `FunctionInliner`
2019-04-12 15:23:28 +03:00
Roman Artemev
ece33f00a2 [IR] SuspendFunctionLowering refactoring
* distinguish common part which generates successor of `CoroutineImpl`
   into separate common lowering
 * merge it with K/N
2019-04-12 15:23:28 +03:00
Roman Artemev
bcc8f3e073 [IR] Move Ir utils from Kotlin/Native 2019-04-12 15:23:28 +03:00
Roman Artemev
cf9cce8a9b [JS IR BE] Fix type arguments stuff in Secondary Constructor lowering 2019-04-12 15:23:28 +03:00
Roman Artemev
e3699fbc31 [IR] CommonBackendContext and Symbols refactoring
* add [suspend]functionN factory factions
 * add `getContinuation` property
 * add `internalPackageName` property
 * fix lowerings
2019-04-12 15:23:28 +03:00
Mikhail Zarechenskiy
bdab7a88f6 [NI] Add test for obsolete issue
#KT-28658 Obsolete
2019-04-12 15:22:39 +03:00
Mikhael Bogdanov
d5cd49b2bf Don't delete Idea temporary folder on JVM shutdown
Before parallelization we don't delete Idea folders after test execution.
  Now there is problem with failing test on Teamcity.
  So try to keep folder undeleted (maybe there is some working daemon)
2019-04-12 14:13:53 +02:00
Ivan Gavrilovic
33e7a23208 Fix style in classpath snapshot class
Use filterTo instead of filter followed by forEach.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c28ad116d0 Convert Windows-style path when calculating class internal name 2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
955a27ec77 Use MD5 when caching class ABI structure
This avoids Kotlin Gradle plugin dependency
on Guava, and it is a good hash function for this
use-case.

Also fix some formatting.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
e171199bf5 Do not track defined constants in source files
There is no need to track definitions of constants in sources for now.
References to constants are tracked in order to capture dependencies between types.
This ensures that any change to a type defining a constant (either from the
classpath or sources), will trigger reprocessing of the type that uses the
constant.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
929fca03fd Fixes to KAPT classpath change detection
1) Fix tests to use canonical path for comparison because Mac was failing
2) Update current classpath snapshot only with the missing entries from the previous one
3) Clean-up code and style
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
7c78644eb9 Incremental KAPT - analyze classpath changes
Use artifact transforms to capture structure and
dependencies of classpath entries. In the KAPT task
this information is used to compare previous classpath
structure with the current one. Once changed classes are
detected, all classes that transitively depend on those
are identified, and that set is passed to KAPT invocation.

In order to avoid unrelated classpath changes, we record an
ABI snapshot of the classpath entry. This snapshot ignores
all private members, and @Metadata annotation.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c85e21d43b Incremental KAPT - pass changed classpath entries
Pass computed list of changed classpath names to KAPT instead
of relying on the history files to be computed by stub generation.
Also, stop generating classpath history changes during the stub generation.

This commit does not compute the actual changed classpath entries,
and that will be done in the following commits.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
0c09f56118 Incremental KAPT - track constants usage
This commit adds support for tracking of used constants in
source files. For every constant used in a source file, class
that defines the constant and the constant name are tracked.

Value of the constant can be obtained using
annotation processing APIs, so if the constant value changes, a source file
using it has to be reprocessed.

 #KT-23880
2019-04-12 15:01:47 +03:00
pyos
57dca2ada5 JVM_IR: generate exception specifications 2019-04-12 13:00:54 +02:00
Ilya Matveev
f43579e9fc Update Kotlin/Native: 1.3-dev-9457 2019-04-12 17:53:34 +07:00
pyos
c7d7d903cd Add the IR version of CompileJavaAgainstKotlin tests
Only the WithoutJavac version for now, because the other one ignores
javac errors.
2019-04-12 12:43:37 +02:00
Dmitry Petrov
8a95da4a95 Minor: reformat DeepCopyIrTreeWithDescriptors.kt 2019-04-12 12:13:21 +03:00
Dmitry Petrov
bf2ab99b61 IR: IrSimpleTypeBuilder 2019-04-12 12:13:21 +03:00
Natalia Selezneva
2844d48f9f Refactoring: remove unused class 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0da6d48d5e Minor: fix toString in KotlinSourceFilterScope 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0c2e9f4d9a Scratch: prohobit closing scratch output content (KT-29642)
^KT-29642 Fixed
2019-04-12 11:42:56 +03:00
Natalia Selezneva
3eda40394a Impossible to run applications with long command lines on windows
^KT-29352 Fixed
2019-04-12 11:42:50 +03:00
Natalia Selezneva
dfa5f1f090 Refactoring: extract common parts for create command line for repl and scratch 2019-04-12 11:33:32 +03:00
Ting-Yuan Huang
0dd09ea7de JVM_IR: Lower IrGetEnumValue to this whenever possible.
The reference can be lowered to `this` if it is captured in the lexical
scope of the corresponding enum entry, and not used by the enum entry's
super constructor. Otherwise, it is lowered to
`GETFIELD SomeEnum.SomeEntry`.
2019-04-12 08:58:43 +02:00
Toshiaki Kameyama
faa6eacb25 Add "Replace Java static method with Kotlin top-level function" inspection
#KT-27411 Fixed
2019-04-12 11:35:46 +07:00
Rene Groeschke
6bef27e1e8 Forward stdout and stderr logger of out of process compiler through gradle logging
Issue #KT-30596 Fixed
2019-04-11 20:36:53 +03:00
Dereck Bridie
d86ffd3f34 Add inspection "Map replaceable with EnumMap" #KT-25439 Fixed 2019-04-11 19:01:02 +03:00
Toshiaki Kameyama
607325c6e5 Add "Round using roundToInt/roundToLong" quick fix
#KT-30389 Fixed
2019-04-11 18:58:05 +03:00
Burak Eregar
1455451601 Fix "Replace !! with if-then" inspection in receiver position
#KT-5412 Fixed
2019-04-11 18:58:05 +03:00
Jan Gerling
162de77b71 Add inspection to detect boxes *Range.start & endInclusive
These properties can be replaced with equivalent collections first & last.
#KT-15537 Fixed
2019-04-11 18:58:04 +03:00
Toshiaki Kameyama
401d8c2d70 Add braces: don't move EOL comment when if statement is single statement
#KT-28619 Fixed
2019-04-11 18:58:04 +03:00
Dmitriy Novozhilov
a92cf19641 Revert "[NI] Fix reporting smartcast diagnostics for intersection types"
This reverts commit 033d7262

That commit breaks bootstraping
2019-04-11 18:49:02 +03:00
Toshiaki Kameyama
849d18669b Replace assert boolean with assert equality: do not report when arguments type are not subtype
#KT-30761 Fixed
2019-04-11 18:36:50 +03:00
Toshiaki Kameyama
93d854362b Convert to anonymous function: do not name argument when lambda is Java method
#KT-30613 Fixed
2019-04-11 18:34:24 +03:00
Dmitriy Novozhilov
033d7262a2 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-11 18:10:59 +03:00
Toshiaki Kameyama
47b1ea7fa4 SimplifiableCallChainInspection: replace .sorted().first() with .min()
#KT-30725 Fixed
2019-04-11 18:07:06 +03:00
Toshiaki Kameyama
e4b10a156e SimplifiableCallChainInspection: fix tests 2019-04-11 18:07:06 +03:00
Alexander Gorshenev
ce6cda631d IrDelegatedProperty and IrDelegatedPropertyReference were missing from the serialization 2019-04-11 17:50:53 +03:00
Yan Zhulanow
e07821ca75 Debugger: Assume a class name from the coroutine metadata may be invalid (KT-30934) 2019-04-11 17:46:21 +03:00
Georgios Andrianakis
f11c5a335a KT-30343 Add new Quarkus preset to all-open compiler plugin 2019-04-11 17:46:21 +03:00
Yan Zhulanow
7ecd88aae3 AllOpen: Allow to specify presets in the Gradle plugin 2019-04-11 17:46:20 +03:00
Ting-Yuan Huang
4f64a52d33 Kapt: Fix NPE on JDK 10-11 (KT-26203)
Gradle worker throws NPE when the parameter to the runnable is null.
This patch works that around by passing URL spec as String instead of
File?
2019-04-11 17:46:19 +03:00
Yan Zhulanow
2314ca7a94 Debugger: Fix evaluation of lambda arguments (KT-10636) 2019-04-11 17:46:19 +03:00
Yan Zhulanow
fa5705cc68 Debugger: Fix missing read action in error reporting 2019-04-11 17:46:18 +03:00
Yan Zhulanow
4f6c8d2323 Fix type renderers for Kotlin (KT-18263, KT-18247) 2019-04-11 17:46:18 +03:00
Yan Zhulanow
15db1c8a8f Debugger: Do not validate line breakpoints for irrelevant classes (KT-30714) 2019-04-11 17:46:17 +03:00
Yan Zhulanow
2c5e8dab23 Debugger: Do not require a SourcePosition to exist 2019-04-11 17:46:16 +03:00
Yan Zhulanow
81a7f73db5 Refactoring: Inline getInvokePolicy() 2019-04-11 17:46:16 +03:00
Yan Zhulanow
b26f746514 Minor: Rename KotlinEvaluatorBuilder to match the superclass name 2019-04-11 17:46:15 +03:00
Yan Zhulanow
e31f195716 Minor: Remove unnecessary '!!' 2019-04-11 17:46:15 +03:00
Yan Zhulanow
fb3efd2d78 Debugger: Fix completion for synthetic '_field' extension properties (KT-23586) 2019-04-11 17:46:14 +03:00
Yan Zhulanow
0d04dc6f99 Debugger: Allow to touch experimental stuff from evaluator (KT-30216) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
b7ea4ccc7e Debugger: Hide call-site 'this' in inline functions in Kotlin variables mode (KT-30610) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
6dcaa64793 Pill: Fix platform source file location 2019-04-11 17:46:12 +03:00
Yan Zhulanow
9e99bca322 Pill: Fix artifact generation 2019-04-11 17:46:12 +03:00
Mikhael Bogdanov
5b49043939 Delete KotlinTestUtils.java.as32 and KtParsingTestCase.java.as32 2019-04-11 13:26:06 +02:00
Caleb Brinkman
c84c33cbd6 KT-30816 BasicJvmScriptEvaluator incorrect arg order
https://youtrack.jetbrains.com/issue/KT-30816

Change BasicJvmScriptEvaluator to pass constructor parameters in the
correct order, include tests for scripts w/ provided properties, and
implicit receiver, and both.
2019-04-11 10:17:55 +00:00
Dmitry Gridin
31ce6e1800 Minor: remove redundant qualifier names in QuickFixRegistrar 2019-04-11 15:13:17 +07:00
Dmitry Gridin
86a3daa302 Fix "Remove redundant qualifier name" for KtUserType with type parameter
#KT-30916 Fixed
2019-04-11 15:13:17 +07:00
Dmitry Gridin
f3faae7bb4 Fix 'Redundant qualifier name' warnings & refactoring in idea 2019-04-11 15:13:17 +07:00
Dmitry Gridin
646f325f57 Fix false positive "Redundant qualifier name" for functions with a receiver
#KT-30879 Fixed
2019-04-11 15:13:17 +07:00
Mark Punzalan
1b703448d3 Handle reversed() in ForLoopsLowering.
We get the info for the underlying progression and invert it. For
progressions whose last bound was open (e.g., `until` loop), the
reversed version will have an open first bound and so the induction
variable must be incremented first.

Also unified the way of extracting HeaderInfo out of changed calls
(e.g., `indices.reversed()`), and fixed declaration parents in
ForLoopsLowering.
2019-04-11 08:54:55 +02:00
Mikhael Bogdanov
3d1b6fb83c Minor. Fix AS32 compilation 2019-04-10 21:16:42 +02:00
pyos
b24690b35b Remove a redundant field 2019-04-10 20:51:46 +02:00
pyos
73bd683af1 Store InstructionAdapter, not ExpressionCodegen, in PromisedValue 2019-04-10 20:51:46 +02:00
pyos
96e2eb6fa1 Move PromisedValue to a separate file 2019-04-10 20:51:46 +02:00
pyos
e249c3c594 Return a stripped version of StackValue from ExpressionCodegen 2019-04-10 20:51:46 +02:00
pyos
c5f6be4282 Remove import of StackValue.* to better see use sites 2019-04-10 20:51:46 +02:00
pyos
a9bece9baa Allow intrinsics to be partial
Also, add an overridable invoke() method that skips the Callable step.
2019-04-10 20:51:46 +02:00
pyos
6e44b22340 Remove an unused non-IR IntrinsicMethod.toCallable 2019-04-10 20:51:46 +02:00
pyos
31eb542476 Return an immaterial value from Boolean.not 2019-04-10 20:51:46 +02:00
pyos
31c7183781 Return immaterial values from comparison intrinsics 2019-04-10 20:51:46 +02:00
pyos
9aff1cefb4 Make materialization of StackValues explicit 2019-04-10 20:51:46 +02:00
pyos
2356f72fd4 Make ExpressionCodegen a bit shorter in general 2019-04-10 20:51:46 +02:00
pyos
89cb31c387 Refactor try-catch covering computation 2019-04-10 20:51:46 +02:00
Mads Ager
a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
Ilya Kirillov
8a94c66ce7 KT-29568, KT-26550: show "Convert Java File to Kotlin File" only for Java files
#KT-29568 fixed
#KT-26550 fixed
2019-04-10 21:29:18 +03:00
Ilya Kirillov
c7e08f9e5d New J2K: Fix existing test data 2019-04-10 21:29:18 +03:00
Ilya Kirillov
ae3920d535 New J2K: Finish DefaultArgumentsConversion 2019-04-10 21:29:18 +03:00
Ilya Kirillov
008e7a5add New J2K: do not use some keyword removing processings due to incorrect formatting after it 2019-04-10 21:29:18 +03:00
Ilya Kirillov
54d6fc846b New J2K: Add file range support for nullability analysis 2019-04-10 21:29:18 +03:00
Ilya Kirillov
33a42733f5 New J2K: make function parameters which is used as spread value argument to be not null 2019-04-10 21:29:18 +03:00
Ilya Kirillov
4844df2c6a New J2K: calculate for loop variable nullability 2019-04-10 21:29:18 +03:00
Ilya Kirillov
bd53772f5c New J2K: Fix explicit NPE cases in conversions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
4c58016fa4 New J2K: remove SuppressWarnings annotation 2019-04-10 21:29:17 +03:00
Ilya Kirillov
ecf1ab7f04 New J2K: convert internal visibility to public one for annotation class members 2019-04-10 21:29:17 +03:00
Ilya Kirillov
f0b7f1e30b New J2K: Fix type parameters for array creation expressions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
cb1b597b51 New J2K: save comments in data classed conversion 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d4f6558e8a New J2K: Split convert file method in converters 2019-04-10 21:29:17 +03:00
Ilya Kirillov
af17db5f45 New J2K: handle more types of nullability annotations 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d20e4bac1d New J2K: always print fully qualified names in printer to avoid name conflicts 2019-04-10 21:29:16 +03:00
Ilya Kirillov
aa53489e0b New J2K: Handle forced nullability correctly in nullability analysis 2019-04-10 21:29:16 +03:00
Ilya Kirillov
7d5793184f New J2K: Do not throw away incorrect code in switch statements 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a98382a3cb New J2K: Fix wrong fqName for jvm annotations 2019-04-10 21:29:16 +03:00
Ilya Kirillov
e181c7f097 New J2K: save comments for annotation parameters 2019-04-10 21:29:16 +03:00
Ilya Kirillov
b430cfa953 New J2K: fix priority in PolyadicExpressionConversion 2019-04-10 21:29:16 +03:00
Ilya Kirillov
99d4accf2c New J2K: fix IDEA exceptions in post-processings 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a5d64bf0b1 New J2K: Resolve symbols in correctly 2019-04-10 21:29:15 +03:00
Mikhael Bogdanov
d806320383 Rename tmpDirForReusableLibrary -> tmpDirForReusableFolder 2019-04-10 20:03:09 +02:00
Mikhael Bogdanov
8287e448d1 Support parallel execution of IDEA tests 2019-04-10 20:03:08 +02:00
pyos
8ae9e7a106 JVM_IR: unwrap fake overrides when computing property signatures 2019-04-10 19:21:37 +02:00
Vyacheslav Gerasimov
1b68b1d599 Build: embed jps artifact kotlin-plugin.jar into ideaPlugin 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
f71c2bf25e Build: Drop unused fromEmbeddedComponents helper 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
b741d393ed Build: make fatJar in JPS recursively using embedded configuration 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
adb896d74c Build: Introduce embedded configuration used for fatJars 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
a0adc97768 Build: Embed nj2k into kotlin-plugin.jar 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
da7a4a6d58 Build: Exclude trove4j from plugin since Idea already has it 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
c492c0c9f9 Build: Generate JPS artifacts for idea plugin from gradle configurations 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
92248d609f Build: Centralize build logic for kotlin-plugin in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
384f407af6 Minor: rename sideJars -> libraries 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
01aaaae5d0 Build: Pack markdown with dependencies (if any) to the ide plugin
Right now it doesn't have any dependencies
2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
909c6eef57 Build: Remove unnecessary stdlib dependencies in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
b68aee5ff8 Build: Fix missing coroutines-common in ide plugin
We shouldn't omit library dependencies while copying libraries to plugin
2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
f4472fd68a Build: Depend on :prepare:idea-plugin via configuration in ultimate 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
d554b5aafa Build: Embed projects not published to maven into kotlin-plugin.jar 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
4ff1506161 Build: Use project dependency via configuration to build kotlin-plugin
Using configuration allows us to embed fat jars
Removed unnecessary shadowJar task, unnecessary unless relocation is required
2019-04-10 17:54:05 +03:00
victor.petukhov
3ba48f219c Remove debug code in the test for CheckerTestUtil class 2019-04-10 17:10:56 +03:00
Alexander Udalov
121f30d9cc Use IrType instead of KotlinType in SingleAbstractMethodLowering 2019-04-10 14:42:40 +03:00
Alexander Udalov
d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Alexander Udalov
2f003ef545 Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here
before were the fact that we didn't sort sealed classes and its
subclasses which led to NoSuchMethodError (KT-27097), and the fact that
we didn't skip expect classes which led to incorrect duplicate JVM class
name diagnostic (KT-30843)

 #KT-27097 Fixed
 #KT-30843 Fixed
2019-04-10 14:39:16 +03:00
Alexey Tsvetkov
c8c630cecb Filter significant elements before creating ListRange
EA-134385
  EA-138187
2019-04-10 14:38:11 +03:00
Mikhail Glukhikh
568e831651 FIR: make rendering of type parameters similar to original Kotlin 2019-04-10 13:31:02 +03:00
Mikhail Glukhikh
0c334163ab FIR: add class type parameters to constructors & change their rendering 2019-04-10 13:31:01 +03:00
Toshiaki Kameyama
55a5ccac5c SimplifyAssertNotNullInspection: change level to INFORMATION
#KT-30876 Fixed
2019-04-10 16:06:37 +07:00
Georgy Bronnikov
43e87a1635 Merge pull request #2256 from pyos/flatten-phases
Flatten phase compositions
2019-04-10 10:43:14 +03:00
Dmitriy Dolovov
7beb49271f Fix: Navigation to inheritor class in non-JVM library source leads to opening stub
Issue #KT-30821 Fixed
2019-04-10 11:17:27 +07:00
Juan Chen
f489a47025 Fix SAM_WITH_RECEIVER_PLUGIN_NAME.
SAM_WITH_RECEIVER_PLUGIN_NAME in PathUtil was accidentally broken by
4c751cdd52 (diff-819dacd07c45ba85ba5459d8a09418daR34)
2019-04-09 15:19:00 +00:00
Ilmir Usmanov
00e952ab15 Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers.
The check for tail call optimization is based on coroutine stack traces
bug (feature?): when tail call optimization hits, the continuation
object is not generated. Thus, there is no debug metadata for this
suspend function. Consequently, the coroutines stack trace does not
contain stack trace element for that function.
This check is performed by TailCallOptimizationChecker.

Since this is runtime check, unlike bytecode tests, it does not require
test data adjustments on each codegen or inliner change.

Since the check is based on debug metadata, which is JVM specific, there
is not support for other backends yet.
2019-04-09 18:01:21 +03:00
Mikhail Glukhikh
40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
485035952a IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)
Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
61ae365cfd IR text tests: remove some may-be-unnecessary dumps 2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
02bdc826d5 IR text tests: throw an error when test fails to build an external dump 2019-04-09 15:36:16 +03:00
Vyacheslav Gerasimov
2937cb7237 Build: Fix Android Studio 3.5 unpacking, now published as tar.gz 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
83764c113f as35: Upgrade to AS 3.5 C10 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
8c9e1006f2 as35: Derive as35 bunch from 191 2019-04-09 15:06:22 +03:00
Steven Schäfer
26aeddf6d9 Remove broken KotlinType.toIrType function
The KotlinType.toIrType function sometimes produces unbound symbols
and was only used in IrIntrinsicFunction and SharedVariablesManager.

This change removes the broken function and changes SharedVariableManager
to use IrType consistently and IrIntrinsicFunction to use KotlinType
consistently.
2019-04-09 13:46:02 +02:00
pyos
048fd9fa25 Create a single instance of IrIntrinsicMethods per context.
This improves JVM_IR compilation times by 2%.
2019-04-09 11:56:58 +02:00
Dmitry Gridin
fceb5ee245 Fix AutoImport for import with alias
#KT-30663 Fixed
2019-04-09 16:34:26 +07:00
Andrey Uskov
a6ae1f2ba6 Fix import of compiler arguments in IDEA if source set dependencies
could not be resolved (e.g. due to misspelling in artifact name).
Fix works only in case when both new IDEA and gradle plugins are
used
#KT-28627 Fixed
2019-04-09 12:04:59 +03:00
Andrey Uskov
ed0dfaec36 Migrate GradleFacetImportingTest to testdata 2019-04-09 12:04:32 +03:00
Andrey Uskov
0f60daec25 Fix locking multiple threads during KotlinConfiguration check
#KT-29892 Fixed
2019-04-09 12:04:14 +03:00
Andrey Uskov
ff488bb871 Create android source root test added 2019-04-09 12:03:57 +03:00
Simon Ogorodnik
dc84e8fce5 Reformat PluginDeclarationProviderFactory 2019-04-09 11:53:54 +03:00
Simon Ogorodnik
f3268c99df EA-115037: Rebuild PerModulePackageCache on miss 2019-04-09 11:53:52 +03:00
Simon Ogorodnik
dd3dfedf81 KT-30688: Fix memory leak on module in disposer after onTooComplexChange
Remove explicit cache entry removal, use weak map instead

 #KT-30688 fixed
2019-04-09 11:53:22 +03:00
Nikolay Krasko
bfda9cc57b Fix inspection Integer.toString() -> int.toString() reports 2019-04-09 11:47:30 +03:00
Nikolay Krasko
a9beb04cb7 Fix RemoveExpressionTargetFix and don't remove the whole annotation (KT-25574) 2019-04-09 11:47:29 +03:00
Nikolay Krasko
ecda8cd889 Remove resolve in ChangeRetentionToSourceFix and RemoveExpressionTargetFix (KT-25574) 2019-04-09 11:47:29 +03:00
Toshiaki Kameyama
58b6360388 Add quick fixes for RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION (KT-25574) 2019-04-09 11:47:29 +03:00
pyos
f37d171a52 Flatten phase compositions.
This makes stack traces and flame graphs significantly more readable.
2019-04-09 10:15:45 +02:00
pyos
fb0261bfc1 Remove JvmDescriptorWithExtraFlags and fix syntheticness
(of fields and classes, it is already correct for methods).
2019-04-09 08:18:14 +02:00
pyos
3fdcf8376f Add IR equivalent of the WriteFlags test 2019-04-09 08:11:29 +02:00
Dmitriy Dolovov
f2d513a39c Fix: Unstable IDE navigation to expect/actual symbols in stdlib
Issue #KT-30790 Fixed
2019-04-09 10:24:58 +07:00
Anton Bannykh
9b5c8bbac9 JS: switch off inlined local declaration deduplication (KT-30877 fixed)
(cherry picked from commit 681e8dd968)
2019-04-08 21:22:43 +03:00
Ilmir Usmanov
2dee506022 Generate suspend markers for inline and crossinline parameters
if they are not inlined, but directly called.
Previously, all inline and crossinline lambda calls were treated by
codegen as if they are always going to be inlined. However, this is not
always the case.

Note, that we cannot generate these markers during codegen, since we
can inline code with no suspension points, but the whole inlined code
will become one giant suspension point. This, of course, breaks
tail-call optimization and, hence, slows down cold streams.

Because of that, we generate these markers, when we are sure, that they
are not going to be inlined. The only place, in which we know that, is
the inliner. During inlining of the inline function, we check, whether
the parameter is inline or crossinline and whether it is not an inline
lambda. If these checks pass, we generate the markers. Noinline
parameters are already covered by the codegen.
 #KT-30706 Fixed
 #KT-26925 Fixed
 #KT-26418 Fixed
2019-04-08 17:28:37 +03:00
Mikhael Bogdanov
eb1bfac83f Minor. Fix test data 2019-04-08 16:23:00 +02:00
Dereck Bridie
7da52b2df5 Fix KT-13962 with kotlin.collections constructors 2019-04-08 14:53:27 +03:00
Mikhael Bogdanov
10e3dfa980 Support anonymous function as inline parameters 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
2a3a9bb5fc Support properties reificaton 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
944c200a5d Initial support of try as expression in JVM IR 2019-04-08 13:10:24 +02:00
Mikhael Bogdanov
30aeb8dc0a Support finally blocks in non-local returns 2019-04-08 13:10:23 +02:00
Mikhael Bogdanov
4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
02cb1d7dcc Change return target in $default function on transformation 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
694a7c329d Initial support of non-local return in IR 2019-04-08 13:10:21 +02:00
Mikhael Bogdanov
3f9154a4a1 Remove declaration that would be inlined 2019-04-08 13:10:20 +02:00
Alexander Udalov
dd2c7aff6e Implement IrType.equals/hashCode via isEqualTo/toHashCode 2019-04-08 13:06:01 +03:00
Alexander Udalov
8cce5dc8de Fix missing return for checkViaDescriptors in FqNameEqualityChecker 2019-04-08 13:06:01 +03:00
Alexander Udalov
bdfe82cfff Fix incorrect condition in CheckIrElementVisitor.ensureTypeIs
Apparently it has no effect on behavior of tests because no backend uses
the checkTypes mode of IR validation
2019-04-08 13:06:01 +03:00
Sergey Rostov
26a9b2b251 JPS Build: fix kotlin-main-kts-test dependency to kotlin-main-kts 2019-04-08 12:47:25 +03:00
Alexander Udalov
5bafd4008f Use correct class loader to load .kotlin_builtins in reflection
#KT-30749 Fixed
2019-04-08 12:43:53 +03:00
Toshiaki Kameyama
3de723b8d0 SimplifiableCallChainInspection: replace .sorted().firstOrNull() with .min()
#KT-30725 Fixed
2019-04-08 11:07:24 +03:00
Sergey Rostov
bdac47369c Gradle, Native: run tests with proper Test task, process test results
#KT-30529 Fixed
2019-04-08 09:38:33 +03:00
Sergey Rostov
d5e434e95b Gradle: move JS and Android platform specific files to targets package: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
9129c08fac Gradle: move JS and Android platform specific files to targets package 2019-04-08 09:38:33 +03:00
Sergey Rostov
09611a612a Gradle, Native: move all Native-related files to targets.native directory: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
1d1a560e32 Gradle, Native: move all Native-related files to targets.native directory 2019-04-08 09:38:33 +03:00
Dmitry Gridin
b45aeda711 Fix caret after "Introduce import alias" if invoke in import directive
#KT-30833 Fixed
2019-04-08 11:25:32 +07:00
Nikolay Krasko
814aca9c8b Single indent for declarations on adding new line (KT-26954)
#KT-26954 Fixed
2019-04-06 20:44:06 +03:00
Nikolay Krasko
e4cc94e0a8 Check bad root presence before checking platform (KT-30442)
Detect platform based on libraries content is a long operation and should
not be called from `isConversionNeeded`. Do other checks before it.
2019-04-06 20:44:05 +03:00
Nikolay Krasko
03c6e23448 Remove platform comparisons based on string dictionary order (KT-30356)
Comparison was changed in 641a9a7153 (diff-0895a6eaf69b9fd4d43f83db9889d103R109)

 #KT-30356 Fixed
2019-04-06 20:44:05 +03:00
Nikolay Krasko
53ab1e7c99 Minor: clean warnings in folding tests 2019-04-06 20:44:05 +03:00
Nikolay Krasko
aea33a3214 Move resolve during import optimizing to background thread (KT-27106, KT-30018)
#KT-27106 Fixed
2019-04-06 20:44:05 +03:00
Vyacheslav Gerasimov
25636c9c39 Build: Compile ultimate with kotlin-stdlib-jdk8 2019-04-05 20:37:19 +03:00
Igor Yakovlev
da4d8a8c90 Parser invalid error advancing for postfix type parameters list #KT-30835 Fixed 2019-04-05 19:50:42 +03:00
Austaon
0e716fd528 KT 13962: Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf()) 2019-04-05 18:19:26 +03:00
Dmitry Petrov
bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00
Mikhail Glukhikh
e1915ec99e FIR2IR: add bunch file for 181 to avoid compilation problems 2019-04-05 16:18:59 +03:00
Mikhail Glukhikh
ee28467a47 Raw FIR: add work-around for deeply nested String interpolations
Controversial (but prevents total kotlin test failing)
Related to KT-29222
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
92adfd8946 Add stub implementation of compileTimeInitializer in wrapped descriptors 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
d736a7da6b Raw FIR: get rid of array gets, use array sets only for modifications
(a[b] += c etc. cannot be replaced with get/set calls easily)
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
a0c4e2f05f Raw FIR: convert in to contains and !in to contains.not 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
4482a8f794 Remove FirOperation.RANGE which was effectively unused
Associated KtTokens.RANGE is included into convention call table
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
007edcb4a4 Raw FIR: generate convention / infix binary expressions with receiver 2019-04-05 16:18:57 +03:00
Dmitry Gridin
4f8e29ad23 Fix import quickfix if import has import alias
#KT-30669 Fixed
 #KT-7380 Fixed
 #KT-30663 Fixed
2019-04-05 20:01:11 +07:00
Dmitry Gridin
6caf6858fa Minor: refactoring KotlinAddImportAction 2019-04-05 20:01:11 +07:00
Dmitriy Novozhilov
d8cbeb8d15 Add regression test for SPREAD_OF_NULLABLE diagnostic
#KT-30808 Fixed
2019-04-05 14:17:34 +03:00
Mikhail Zarechenskiy
ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00
Mikhail Zarechenskiy
c3bc6ef2fa [NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
2019-04-05 13:16:54 +03:00
Mikhail Zarechenskiy
20a7f387bf [NI] Resolve callable reference eagerly if there is only one candidate
#KT-30737 Fixed
2019-04-05 13:15:57 +03:00
Dmitriy Novozhilov
aa96a05469 [NI] Fix initial data flow info for analyzing lambdas
#KT-30734 Fixed
2019-04-05 12:52:29 +03:00
Anton Bannykh
b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Anton Bannykh
b0ed688986 Fix argument passing for smartJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
d04a0246db make smartJavaExec composable with NoDebugJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
8174d6c035 JS IR: eliminate quickIrTest 2019-04-05 12:30:21 +03:00
Anton Bannykh
ad4c2144a7 JS IR: moved klib creation to the serialization_test module 2019-04-05 12:30:20 +03:00
Anton Bannykh
0f183ed662 JS IR: split compilation and deserialization 2019-04-05 12:30:20 +03:00
Anton Bannykh
08785b7cea JS IR: split serialization into a separate module 2019-04-05 12:30:20 +03:00
Anton Bannykh
42f576f033 IR: move serialization to serialization.common 2019-04-05 12:30:20 +03:00
Steven Schäfer
59c5d8bdb8 Add an implicit cast to Unit in returns from a constructor. 2019-04-05 12:05:53 +03:00
Vasily Levchenko
826f55ecb4 Merge pull request #2240 from JetBrains/rr/minamoto/ir-IrFunctionInlineBodyImpl
[IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
2019-04-05 11:49:08 +03:00
Vasily Levchenko
1ebf7faedc [IR][refactoring] g/c IrReturnableBlock[Impl]
- drop calculatable from 'inlineFunctionSymbol' fields: 'sourceFileSymbol' and 'sourceFileName' and
replace then with extension values

- drop unused constructors.
2019-04-05 11:47:45 +03:00
pyos
05e09df683 Throw a clearer error on unexpected IR nodes in expressions 2019-04-04 21:39:49 +02:00
pyos
c3a74ded0e Make isDefaultValueForType shorter 2019-04-04 21:39:47 +02:00
pyos
fb55e34b8f Merge generateBreakOrContinueExpression and doFinallyOnReturn 2019-04-04 21:39:46 +02:00
pyos
c0af91b6d1 Inline markFunctionLineNumber 2019-04-04 21:11:39 +02:00
pyos
9f28b2042a Move common declarations up 2019-04-04 21:11:37 +02:00
pyos
a7dbd08f45 Inline genFinallyBlockOrGoto 2019-04-04 21:11:35 +02:00
pyos
6690e50dd2 Remove direct block stack manipulation 2019-04-04 21:11:33 +02:00
pyos
57450912fb Remove a couple unused classes, inline a short method 2019-04-04 21:11:31 +02:00
Toshiaki Kameyama
bcfab83d1c Add "Constructor has non-null self reference parameter" inspection (KT-29799)
#KT-29799 Fixed
2019-04-04 17:25:37 +03:00
Zalim Bashorov
6634d7ab15 [psi2ir] Minor: dynamicWithImplicitCast.kt -> dynamicWithSmartCast.kt 2019-04-04 17:14:04 +03:00
Zalim Bashorov
57a6b53780 [psi2ir] Add tests for implicit casts "to" and "from" dynamic type 2019-04-04 17:14:03 +03:00
Toshiaki Kameyama
dffcfdc02f Add inspection to replace not-null assertion with elvis return
#KT-30381 Fixed
2019-04-04 20:29:17 +07:00
Vasily Levchenko
6f9feacf6e [IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
This change let backend calculate and bind right function to the code block on generation debug information
e.g. for Kotlin/Native backend this let codegnerator to produce DILocation(..., inlinedAt:..) with correct value
for inlinedAt parameter, thus signifiacntly improve behaviour of debugger.
2019-04-04 16:14:34 +03:00
Dmitry Petrov
1c0c01725b Preserve original for constructors of LazySubstitutingClassDescriptor
We would like DeclarationDescriptor.getOriginal() to always point to a
(preferably unique) unsubstituted descriptors for the given possibly
substituted descriptor. In case of LazySubstitutingClassDescriptor
(which can be observed for nested generic Java classes), this invariant
was broken, because 'getOriginal()' for constructors of substituted
class returned a copy created for this particular substituted class.
2019-04-04 14:42:23 +03:00
Ilya Kirillov
966daf8341 Regenerate NullabilityAnalysisTestGenerated 2019-04-04 14:05:05 +03:00
Alexander Podkhalyuzin
1fbbd71085 Fixed DSL Marker icon
#KT-30470 Fixed
2019-04-04 13:59:49 +03:00
Dmitriy Dolovov
ea3f4ad47f Attach K/N stdlib sources on MPP project import
Issue #KT-30635:fixed
2019-04-04 17:34:42 +07:00
Dmitriy Dolovov
f9d9d7f737 Keep K/N stdlib upper than platform libraries in IDEA UI 2019-04-04 17:34:24 +07:00
Natalia Selezneva
97531c8ec2 Do not include buildSrc module dependencies into script dependencies (KT-30295)
^KT-30295 Fixed
2019-04-04 11:06:14 +03:00
Natalia Selezneva
aa99d8fcbe Rename extension point for additional dependencies of scripts 2019-04-04 11:06:14 +03:00
pyos
4c01614136 Avoid leaking SamConstructorDescriptors from psi2ir 2019-04-04 09:45:00 +02:00
pyos
23d742237f Add tests for merging SAM wrappers and references 2019-04-04 09:45:00 +02:00
pyos
e05c151a73 Remove explicit mention of an internal name from a test 2019-04-04 09:45:00 +02:00
pyos
ee59530f71 Fix casts of the null constant to SAM types 2019-04-04 09:45:00 +02:00
pyos
f47d9d54c0 psi2ir: add test for SAM-conversion of operator arguments 2019-04-04 09:45:00 +02:00
pyos
39c8939241 JVM_IR: optimize SAM conversion of lambda literals
Instead of materializing an invokable object and storing it in an
instance of the implementation, create a specialized class that calls
the lambda directly, resulting in one less nesting layer and one less
class.
2019-04-04 09:45:00 +02:00
pyos
b74586f84e JVM_IR: implement single-abstract-method conversions 2019-04-04 09:45:00 +02:00
Mikhail Glukhikh
141e8d553e FIR body resolve: support variable assignments 2019-04-04 10:31:15 +03:00
Mikhail Glukhikh
c56b471b71 FIR body resolve: handle constant types more precisely 2019-04-04 10:31:13 +03:00
Mikhail Glukhikh
cc2a5cfc06 FIR body resolve: calculate type even for resolved references 2019-04-04 10:31:12 +03:00
Mikhail Glukhikh
d7f0392f90 FIR body resolve: fix value parameter expected type 2019-04-04 10:31:11 +03:00
Mikhail Glukhikh
8a6c9a6aec FIR deserializer: read nullability & add constructors 2019-04-04 10:31:09 +03:00
Mikhail Glukhikh
6e9d78d431 FIR structure: make implicit built-in types resolved 2019-04-04 10:31:08 +03:00
Mikhail Glukhikh
bf0190d96c FIR structure: reuse StandardClassIds in implicit built-in typeRef 2019-04-04 10:31:07 +03:00
Mikhail Glukhikh
b3cf3c6579 FIR structure: include calleeReference into FirDelegatedConstructorCall 2019-04-04 10:31:05 +03:00
Mikhail Glukhikh
63d3100122 FIR structure: FirClassLikeDeclaration is now FirStatement
Done to support (in theory) local type aliases
2019-04-04 10:31:04 +03:00
Mikhail Glukhikh
4213a4c7e2 FIR Java: reuse StandardClassIds 2019-04-04 10:31:02 +03:00
Mikhail Glukhikh
a0fa9e6b48 Raw FIR: make component call a function call, its argument -> receiver 2019-04-04 10:31:01 +03:00
Mikhail Glukhikh
30697787a0 Raw FIR: set "implicit boolean" result type for some operator calls 2019-04-04 10:31:00 +03:00
Mikhail Glukhikh
eb1aaad41b Raw FIR: generate Unit at the end of empty lambda 2019-04-04 10:30:52 +03:00
Mikhail Glukhikh
eb86c9e540 FIR: get rid of ANDAND / OROR by replacing with when 2019-04-04 10:30:49 +03:00
Mikhail Glukhikh
395651a21e Raw FIR: swap branches in when for elvis and bang-bang 2019-04-04 10:30:48 +03:00
Mikhail Glukhikh
f77ba2dd3e Raw FIR: make object/sealed/enum constructor visibility private 2019-04-04 10:30:47 +03:00
Mikhail Glukhikh
057156f323 Raw FIR builder: cleanup code 2019-04-04 10:30:45 +03:00
Mikhail Glukhikh
33729aaf9b Raw FIR: add Any/Enum/Annotation to supertypes iff no supertypes exists 2019-04-04 10:30:44 +03:00
Mikhail Glukhikh
7dd89a48f0 Raw FIR: introduce FirConstructor.isPrimary 2019-04-04 10:30:43 +03:00
Mikhail Glukhikh
61c2e4e590 Raw FIR: handle local visibility for functions & classes 2019-04-04 10:30:41 +03:00
Mikhail Glukhikh
4187ea1f86 Raw FIR: add initializers to primary constructor properties 2019-04-04 10:30:40 +03:00
Ilya Matveev
1f2d31dffb Update Kotlin/Native: 1.3-dev-9301 2019-04-04 14:24:09 +07:00
Mark Punzalan
a0940b1342 Use stricter assertions in for-loop bytecode text tests. 2019-04-04 09:07:19 +02:00
Mark Punzalan
dd65e0876f Simplify loop building by encoding open/closed bound information in the
HeaderInfo object, and modifying the operator in the loop condition.

The "additional emptiness condition" is no longer necessary with this.
The open/closed property was removed from HeaderInfo in an earlier
commit, but bringing it back in to simplify the loop building makes
more sense.

Also expanded tests for evaluation order of range bounds.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7680e7fd56 Use while loop for progressions that cannot overflow (instead of
do-while with enclosing "not empty" check).

Also do not add additional "not empty" condition for `until` loops when
the given bound is a constant != MIN_VALUE.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ba0e016c4e Add bytecode tests for array for-loop iteration. 2019-04-04 09:07:19 +02:00
Mark Punzalan
7afe121238 Eliminated the redundant ForLoopHeader.needsEmptinessCheck property, cast "bound" to progression type if necessary, fixed variable declaration order. 2019-04-04 09:07:19 +02:00
Mark Punzalan
6b83c04472 Cast step expression to the correct Number type, if necessary. 2019-04-04 09:07:19 +02:00
Mark Punzalan
f6e74079bb Cleanup ForLoopsLowering: Add more comments, remove descriptor usages,
make code style consistent.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ea9572ad28 Add DefaultProgressionHandler that handles for-loops over
non-specialized progressions, including "step" progressions.

DefaultProgressionHandler uses the "first/last/step" properties of
the progression when building the loop header.
2019-04-04 09:07:19 +02:00
Mark Punzalan
301ac90770 Remove "bound" and "closed" properties from HeaderInfo and
ForLoopHeader, instead assuming that all ranges are closed and that the
"last" property is already property calculated.

This means the HeaderInfo.last for arrays, "indices" and "until"
progressions are decremented from the bound. This simplifies the loop
construction and moves the work to the handlers. This will also simplify
the handling of "reversed()" in the future since we don't need to
consider the case where the lower bound is open.
2019-04-04 09:07:19 +02:00
Mark Punzalan
93deff5e57 Rename "lowerBound/upperBound" to "first/last" and move loopVariable to
ForLoopHeader base class.

These terms are less loaded and less confusing, especially with "downTo"
progressions, and once we start handling "reversed()".
2019-04-04 09:07:19 +02:00
Mark Punzalan
8e1be5424f Handle for (i in a until Int.MIN_VALUE) corner case by adding
an additional "not empty" condition produced by the UntilHandler.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7b153b2b68 Move building of "not empty" condition (used to check if loop is empty)
from ForLoopsLowering into ForLoopHeader, reducing the building logic in
ForLoopsLowering.
2019-04-04 09:07:19 +02:00
Mark Punzalan
a2e3d3635e Replace HeaderInfo.increasing property with a "direction" enum property,
which is computed based on the value of "step" (if possible).
2019-04-04 09:07:19 +02:00
Mark Punzalan
ed9ede8936 Make HeaderInfo.step not nullable and have handlers explicitly provide
the step expression.

The semantics of "step" are now clearer: It will no longer be negated
based on the "increasing" property; if the progression is decreasing
(i.e., for "downTo" progressions), then it must be negative. The
"increasing" property is still used when building the emptiness
condition.
2019-04-04 09:07:19 +02:00
Mark Punzalan
40dbf8a3fd Move elementType() and getProgressionType() extension methods into
ProgressionType.
2019-04-04 09:07:19 +02:00
Mark Punzalan
409d99a52a Add ForLoopsLowering to JVM phases.
Also deleted StepHandler. Since the HeaderInfo.needLastCalculation is
only set to true for handling step progressions, deleted that property
and all associated logic around it.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7276b7e66a Fix compilation errors after rebasing. 2019-04-04 09:07:19 +02:00
Mark Punzalan
656f6855bb Minimal porting of ForLoopsLowering from kotlin-native.
Diffs resulting from the port:
https://github.com/punzki/kotlin-native/compare/master...punzki:for-loop-diff

When ForLoopsLowering is added to the JVM lowering phases, this causes some of the forLoop bytecode tests to pass, and many still fail due to differences in behavior compared to non-IR backend:
- Generated conditions for lowered loop
- Generated temporary variables
- Supported iterables (e.g., withIndex(), CharSequences)
- Means of incrementing induction variable

The phase will be added once more TODOs are resolved and it is more functionally complete, to prevent breaking for loops.
2019-04-04 09:07:19 +02:00
Toshiaki Kameyama
f861b10798 Add "Add getter/setter" quick fix for uninitialized property
#KT-30078 Fixed
2019-04-04 11:10:39 +07:00
Austaon
efcc6f0967 Add inspection for Integer.toString(i) to i.toString() (KT-12721) 2019-04-03 19:12:54 +03:00
Ilya Gorbunov
dde2b30601 Clarify wording in Random.nextUInt docs: missed extra 'not' 2019-04-03 16:31:03 +03:00
Yan Zhulanow
69353ee9bf Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611) 2019-04-03 15:46:33 +03:00
Yan Zhulanow
ef06009669 191: Fix test running for common modules in MPP/Gradle (KT-29908) 2019-04-03 15:46:32 +03:00
Yan Zhulanow
ee42c1211a 191: Update target IntelliJ SDK version to 191.6183 2019-04-03 15:46:32 +03:00
Ilya Kirillov
b7e6dc4f8b Fix as32 test generation 2019-04-03 14:48:54 +03:00
Sergey Igushkin
e23b74792d Fix Java sources inspected too early in Android variants (KT-30735)
The Android Gradle plugin can set Java sources after a variant is
created, similar to AP options. We need to inspect the Java sources
only from at `afterEvaluate` time.

Issue #KT-30735 Fixed
2019-04-03 14:45:52 +03:00
Ilya Matveev
5ab9723ee1 Configure CocoaPods plugin to be published at the plugin portal 2019-04-03 18:07:49 +07:00
Alexander Podkhalyuzin
a7b43a6bb7 Import only classes when setting add unambiguous on the fly is enabled
#KT-30514 Fixed
2019-04-03 13:51:21 +03:00
Mikhael Bogdanov
4450641321 Merge inlineCodegenUtils2.kt into inlineCodegenUtils.kt 2019-04-03 11:43:46 +02:00
Mikhael Bogdanov
be954c6e62 Rename LabelOwner into ReturnLabelOwner 2019-04-03 11:43:45 +02:00
Mikhael Bogdanov
20adce165f Convert CapturedParamDesc.java into Kotlin 2019-04-03 11:39:59 +02:00
Mikhael Bogdanov
a19cc8efa6 Rename .java to .kt 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
c6fb8ba08e Convert CapturedParamInfo.java into Kotlin 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
79c97ba21d Rename .java to .kt 2019-04-03 11:39:57 +02:00
Mikhael Bogdanov
d8336bd0a1 Convert ParameterInfo.java into Kotlin 2019-04-03 11:39:56 +02:00
Mikhael Bogdanov
53dd1dd76d Rename .java to .kt 2019-04-03 11:39:55 +02:00
Ilya Kirillov
243fd2f4f1 New J2K: Move nullability analysis tests to nullabilityAnalysis dir 2019-04-03 11:24:30 +03:00
Ilya Kirillov
854fc6a7d7 New J2K: Handle correctly modifiers of class members when there is no parent class in the AST 2019-04-03 11:24:29 +03:00
Ilya Kirillov
c05a01e12b New J2K: Fix NPE if no constructor was found in ImplicitInitializerConversion 2019-04-03 11:24:28 +03:00
Ilya Kirillov
6182edadfd New J2K: Move imports into JKImportList 2019-04-03 11:24:27 +03:00
Ilya Kirillov
86fa54fae9 New J2K: Convert Java method to Kotlin function independently of containing class 2019-04-03 11:24:26 +03:00
Ilya Kirillov
f28f340840 New J2K: Wrap ast to a JKTreeRoot 2019-04-03 11:24:26 +03:00
Ilya Kirillov
ddee0deeca New J2K: Move println conversion functionality to BuiltinMembersConversion 2019-04-03 11:24:25 +03:00
Ilya Kirillov
ce666295f7 New J2K: Fix npe when converting java member without parent 2019-04-03 11:24:24 +03:00
Ilya Kirillov
088241313a New J2K: Remove unused JKJavaDefaultNewExpressionImpl 2019-04-03 11:24:23 +03:00
Ilya Kirillov
50a4b9b2b5 New J2K: Remove debug println 2019-04-03 11:24:22 +03:00
Ilya Kirillov
31aea1e5e9 New J2K: Fix converting on copy-past 2019-04-03 11:24:22 +03:00
Ilya Kirillov
5ab9d6bba8 New J2K: Fix collected import inserting in J2K 2019-04-03 11:24:21 +03:00
Ilya Kirillov
1dd0a42298 New J2K: Escape name of declaration in convert data class 2019-04-03 11:24:20 +03:00
Ilya Kirillov
b411e8e18e New J2K: Split old j2k and new j2k tests 2019-04-03 11:24:19 +03:00
Ilya Kirillov
02a206bf7c New J2K: Fix converters spliting 2019-04-03 11:24:18 +03:00
Ilya Kirillov
db2ad96f00 New J2K: Fix ParameterModificationInMethodCallsConversion in a case of varargs parameter 2019-04-03 11:24:18 +03:00
Ilya Kirillov
8cec43fda3 New J2K: Assume KtConstructor as function for symbol provider 2019-04-03 11:24:17 +03:00
Ilya Kirillov
6d621a86d2 New J2K: Convert java.util.Objects.equals call to equals binary operator expression 2019-04-03 11:24:16 +03:00
Ilya Kirillov
a973f9b670 New J2K: Add support of package qualifiers for expressions 2019-04-03 11:24:16 +03:00
Ilya Kirillov
9fb6cfc26e New J2K: Collect imports to ImportStorage, not to JKFle 2019-04-03 11:24:15 +03:00
Ilya Kirillov
9d9c9f40db New J2K: Wrap adding imports to CommandProcessor.executeCommand 2019-04-03 11:24:14 +03:00
Ilya Kirillov
02c8e4cede New J2K: Do not remove semicolon after if expression when then branch is empty in RedundantSemicolonInspection 2019-04-03 11:24:14 +03:00
Ilya Kirillov
b13f7431f2 New J2K: Fix existing test data 2019-04-03 11:24:13 +03:00
Ilya Kirillov
76b73542d9 New J2K: Add type arguments to multi-dimension array initializers 2019-04-03 11:24:12 +03:00
Ilya Kirillov
99f3af9e85 New J2K: Move comments from primary constructor to init section 2019-04-03 11:24:11 +03:00
Ilya Kirillov
481b2feda3 New J2K: Collect annotations for parameters 2019-04-03 11:24:10 +03:00
Ilya Kirillov
b3af05e3ad New J2K: Fix comments order 2019-04-03 11:24:10 +03:00
Ilya Kirillov
1e73748ab4 New J2K: Fix gradle build for nj2k-services 2019-04-03 11:24:09 +03:00
Ilya Kirillov
7f9250c914 New J2K: Fix symbol provider compile error 2019-04-03 11:24:08 +03:00
Ilya Kirillov
32e69629f3 New J2K: Add imports of used kotlin functions 2019-04-03 11:24:08 +03:00
Ilya Kirillov
939b379694 New J2K: Fix old j2k build 2019-04-03 11:24:07 +03:00
Ilya Kirillov
dff4ab2437 New J2K: Fix nullability preserving in AST conversions 2019-04-03 11:24:06 +03:00
Ilya Kirillov
bdd773f806 New J2K: Add nullability analyser tests 2019-04-03 11:24:05 +03:00
Ilya Kirillov
f3b6c880d4 New J2K: Remove unused nj2k test & fix test generation 2019-04-03 11:24:04 +03:00
Ilya Kirillov
e3ee0dac6c New J2K: Add annotations to the import collector 2019-04-03 11:24:03 +03:00
Ilya Kirillov
0610583b80 New J2K: Fix RemoveRedundantExpressionQualifierProcessing 2019-04-03 11:24:02 +03:00
Ilya Kirillov
6f7f516a4f New J2K: Temporary ignore imports & error comments 2019-04-03 11:24:01 +03:00
Ilya Kirillov
bcee73ff01 New J2K: Fix debug tree printer 2019-04-03 11:24:01 +03:00
Ilya Kirillov
b81696947c New J2K: Do not call useless cast on null expression on post processing 2019-04-03 11:24:00 +03:00
Ilya Kirillov
54bd077994 New J2K: Fix type calculating 2019-04-03 11:23:59 +03:00
Ilya Kirillov
658f763887 New J2K: Save unused imports 2019-04-03 11:23:58 +03:00
Ilya Kirillov
a7d2238af4 New J2K: Add IDEA integration of J2k 2019-04-03 11:23:57 +03:00
Ilya Kirillov
a4e3e7abcc New J2K: Add !! when nullability mismatch on post processing 2019-04-03 11:23:56 +03:00
Ilya Kirillov
deb4129a16 New J2K: Add support of diagnostic based inspections on arbitrary PsiElements 2019-04-03 11:23:55 +03:00
Ilya Kirillov
47e722854c New J2K: Remove redundant modifiers in post processing 2019-04-03 11:23:55 +03:00
Ilya Kirillov
7adba40ea2 New J2K: Fix existing test data 2019-04-03 11:23:54 +03:00
Ilya Kirillov
8bd49c147c New J2K: Fix convert getters and setters 2019-04-03 11:23:53 +03:00
Ilya Kirillov
0340c218b9 New J2K: Do not show unknown comment for some kind of type types 2019-04-03 11:23:52 +03:00
Ilya Kirillov
c1ed2e020c New J2K: Fix formatting saving 2019-04-03 11:23:52 +03:00
Ilya Kirillov
13a9a56e85 New J2K: Remove redundant nullability AST conversions due to having them in nullability analyser 2019-04-03 11:23:51 +03:00
Ilya Kirillov
b24ce99097 New J2K: Process fields in modality conversion 2019-04-03 11:23:50 +03:00
Ilya Kirillov
b6625c536d New J2K: Add nullability analysis to post processing 2019-04-03 11:23:50 +03:00
Ilya Kirillov
63d3f90373 New J2K: Fix labeled statement conversion 2019-04-03 11:23:49 +03:00
Ilya Kirillov
0b92b3160f New J2K: Add parenthesis to binary expression in a case of line break before operator 2019-04-03 11:23:48 +03:00
Ilya Kirillov
c20e537b81 New J2K: Preserve comments and line breaks 2019-04-03 11:23:48 +03:00
Ilya Kirillov
b9f8ff9079 New J2K: Rearrange conversions 2019-04-03 11:23:47 +03:00
Ilya Kirillov
4aacb15872 New J2K: Add support of lambda expressions in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:23:46 +03:00
Ilya Kirillov
197fda30e2 New J2K: Implement unimplemented symbol functions 2019-04-03 11:23:46 +03:00
Ilya Kirillov
779dc5c1e2 New J2K: Add RETURN_TYPE_MISMATCH_ON_OVERRIDE to postprocessing 2019-04-03 11:23:45 +03:00
Ilya Kirillov
a1e8d0a6be New J2K: Add Spread operator support 2019-04-03 11:23:44 +03:00
Ilya Kirillov
bf8acc57e3 New J2K: Make all types data classes 2019-04-03 11:23:44 +03:00
Ilya Kirillov
fb6560c1f1 New J2K: Assume parameters when prebuilding symbol provider symbols fro converting declarations 2019-04-03 11:23:43 +03:00
Ilya Kirillov
67a8f445b0 New J2K: Fix provideDirectSymbol in symbol provider fro decompiled declaratiosns 2019-04-03 11:23:42 +03:00
Ilya Kirillov
0456c6a897 New J2K: Make method open only if parent class is open 2019-04-03 11:23:42 +03:00
Ilya Kirillov
269d3f42c6 New J2K: Transfer java method to kotlin function symbol 2019-04-03 11:23:41 +03:00
Ilya Kirillov
cc3564395c New J2K: Promete class to object when init declaration present 2019-04-03 11:23:40 +03:00
Ilya Kirillov
b94ff8af36 New J2K: Clear nullability for methods 2019-04-03 11:23:40 +03:00
Ilya Kirillov
5ae1a819bc New J2K: Add support of Java static init declarations 2019-04-03 11:23:39 +03:00
Ilya Kirillov
ef89a249f2 New J2K: Add FunctionAsAnonymousObjectToLambdaConversion & ReturnStatementInLambdaExpressionConversion conversions 2019-04-03 11:23:38 +03:00
Ilya Kirillov
a659fcd6af New J2K: Move annotations from getters to properties 2019-04-03 11:23:38 +03:00
Ilya Kirillov
1fa0ddcbe8 New J2K: Add qualifiers for static methods, fields & enum consts 2019-04-03 11:23:37 +03:00
Ilya Kirillov
b355572aab New J2K: Add annotation list for JKVariable 2019-04-03 11:23:37 +03:00
Ilya Kirillov
40f5ebb77e New J2K: Fix incorrect imports collecting 2019-04-03 11:23:36 +03:00
Ilya Kirillov
8caf45820c New J2K: Add support of more operations on string conversion 2019-04-03 11:23:35 +03:00
Ilya Kirillov
e39fc53f25 New J2K: Correctly detect varargs argument in annotations & do not throw away named arguments in annotations 2019-04-03 11:23:35 +03:00
Ilya Kirillov
90c12736da New J2K: Convert to data class iff constructor parameter type equals property type 2019-04-03 11:23:34 +03:00
Ilya Kirillov
bcb8742120 New J2K: Add support of named parameters 2019-04-03 11:23:33 +03:00
Ilya Kirillov
ea2081c2f0 New J2K: Fix existing test data 2019-04-03 11:23:33 +03:00
Ilya Kirillov
9c71d5ca25 New J2K: Add repeatable post processing groups 2019-04-03 11:23:32 +03:00
Ilya Kirillov
c827247272 New J2K: Separate new j2k from old j2k 2019-04-03 11:23:31 +03:00
Ilya Kirillov
e6f0a242fd New J2K: Parenthesize qualifier for extension methods in BuiltinMembersConversion 2019-04-03 11:23:31 +03:00
Ilya Kirillov
c111f1c52f New J2K: Cache resolving by fqNames 2019-04-03 11:23:30 +03:00
Ilya Kirillov
ea6cb716e5 New J2K: Move optimize imports invocation out of processings 2019-04-03 11:23:29 +03:00
Ilya Kirillov
f8b8d07621 New J2K: Fix existing test data 2019-04-03 11:23:29 +03:00
Ilya Kirillov
7e30b9e7f5 New J2K: Add support of binary expressions conversion to ImplicitCastsConversion 2019-04-03 11:23:28 +03:00
Ilya Kirillov
208c33a51d New J2K: Add support of prefix expression in ImplicitCastsConversion 2019-04-03 11:23:27 +03:00
Ilya Kirillov
461ef071f4 New J2K: Add AssignmentStatementSplitAlsoConversion 2019-04-03 11:23:26 +03:00
Ilya Kirillov
58fbe7913e New J2K: Use type instead of typeElement to create JKType
because first one can fail on array type
2019-04-03 11:23:25 +03:00
Ilya Kirillov
71780ef442 New J2K: Fix creating expression instead of statement 2019-04-03 11:23:25 +03:00
Ilya Kirillov
4a9ba3c756 New J2K: Do not convert array types to specialized ones in a case of boxed inner type 2019-04-03 11:23:24 +03:00
Ilya Kirillov
7494488edb New J2K: Fix type parameters of JKUnresolvedClassSymbol for new expression 2019-04-03 11:23:23 +03:00
Ilya Kirillov
18e5c1b5f2 New J2K: Fix modality conversion 2019-04-03 11:23:23 +03:00
Ilya Kirillov
936c43d2bc New J2K: Assume specifyLocalVariableTypeByDefault in for loops initializers 2019-04-03 11:23:22 +03:00
Ilya Kirillov
1e7b1f8716 New J2K: Use converter settings values in post processing 2019-04-03 11:23:21 +03:00
Ilya Kirillov
f9a08ad770 New J2K: Add BoxedTypeOperationsConversion 2019-04-03 11:23:21 +03:00
Ilya Kirillov
8b12a9f723 New J2K: Fix support of kotlin method calls 2019-04-03 11:23:20 +03:00
Ilya Kirillov
9a8f8fbfe0 New J2K: Fix KotlinType to JKType conversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
7889756d1a New J2K: Convert type arguments in TypeMappingConversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
d2a4ff172d New J2K: Add Collection.remove conversion 2019-04-03 11:23:18 +03:00
Ilya Kirillov
9fcdb7dde7 New J2K: Fix statement conversion in a case of inner blocks 2019-04-03 11:23:17 +03:00
Ilya Kirillov
d7962afd05 New J2K: Add support of annotation classes 2019-04-03 11:23:17 +03:00
Ilya Kirillov
11f4df8173 New J2K: Add RemoveRedundantCallsOfConversionMethodsIntention post processing 2019-04-03 11:23:16 +03:00
Ilya Kirillov
e4c15c3fb9 New J2K: Fix adding JvmOverloads annotation in DefaultArgumentsConversion 2019-04-03 11:23:15 +03:00
Ilya Kirillov
962b971f07 New J2K: Add conflicts handling in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
e43eb4da03 New J2K: Fix indicesByCollectionSize in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
6c696f6c60 New J2K: Convert tiled prefix operation to inv invocation 2019-04-03 11:23:13 +03:00
Ilya Kirillov
d09e72656a New J2K: Add InterfaceWithFieldConversion 2019-04-03 11:23:12 +03:00
Ilya Kirillov
1d846085de New J2K: Add support of synchronized statement 2019-04-03 11:23:12 +03:00
Ilya Kirillov
0674e6462c New J2K: Fix conversions order 2019-04-03 11:23:11 +03:00
Ilya Kirillov
3c5bb0b259 New J2K: Fix symbols fqNames 2019-04-03 11:23:10 +03:00
Ilya Kirillov
34ca1e1c23 New J2K: Do not print debug trees 2019-04-03 11:23:09 +03:00
Ilya Kirillov
50278058ae New J2K: Fix nullability calculation 2019-04-03 11:23:08 +03:00
Ilya Kirillov
8aa28c0d50 New J2K: Use returnType instead of methodSymbol in operator expressions 2019-04-03 11:23:07 +03:00
Ilya Kirillov
a92c5ebe61 New J2K: Add builtIn operators conversion 2019-04-03 11:23:07 +03:00
Ilya Kirillov
fbcf2e1bcd New J2K: Move equals operator conversion from post processing to AST conversion 2019-04-03 11:23:06 +03:00
Ilya Kirillov
70c700f07a New J2K: Add post processings for removing redundant qualifiers 2019-04-03 11:23:05 +03:00
Ilya Kirillov
d0ba5e7fdf New J2K: Add missing override keyword insertion post processing 2019-04-03 11:23:04 +03:00
Ilya Kirillov
9eaa961a2a New J2K: Add support of deprecated annotation && fix annotations 2019-04-03 11:23:04 +03:00
Ilya Kirillov
3990e1d223 New J2K: Replace conversionContext to symbolProvider in JKExpression.type function 2019-04-03 11:23:03 +03:00
Ilya Kirillov
8df99e54f8 New J2K: Use JKBooleanLiteral for boolean literals 2019-04-03 11:23:02 +03:00
Ilya Kirillov
d3a6b4f12b New J2K: Fix labeled while conversion 2019-04-03 11:23:02 +03:00
Ilya Kirillov
b396ee0cca New J2K: Fix also expression && lambda parameter types 2019-04-03 11:23:01 +03:00
Ilya Kirillov
d56a52fce6 New J2K: Use protected visibility resolution from old j2k 2019-04-03 11:23:00 +03:00
Ilya Kirillov
4c880499fb New J2K: Adapt internal class conversion to old j2k 2019-04-03 11:22:59 +03:00
Ilya Kirillov
d1c1aeed0b New J2K: Fix supertypes constructor calls 2019-04-03 11:22:58 +03:00
Ilya Kirillov
5cdc01621d New J2K: Use parameter initializers as scope for nullability check in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:22:57 +03:00
Ilya Kirillov
53fcf31f23 New J2K: Take parameter in data class iff constructor parameter type is subtype of property type in data class conversion 2019-04-03 11:22:56 +03:00
Ilya Kirillov
fc504c6fdc New J2K: Add ReplacePrimitiveCastWithNumberConversionFix post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
23a42b36b4 New J2K: Add RemoveEmptyPrimaryConstructorIntention post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
d5a3b5644c New J2K: Fix java classes mapped to kotlin ones in post processings 2019-04-03 11:22:54 +03:00
Ilya Kirillov
f603932284 New J2K: Do not merge function definitions whet it is not possible 2019-04-03 11:22:53 +03:00
Ilya Kirillov
46c7cd4b40 New J2K: Fix raw types in new expression 2019-04-03 11:22:52 +03:00
Ilya Kirillov
9b73db4308 New J2K: Add TypeParametersNullabilityConversion 2019-04-03 11:22:52 +03:00
Ilya Kirillov
6dae9da7e2 New J2K: Do not filter default imports 2019-04-03 11:22:51 +03:00
Ilya Kirillov
6e1adf9b6f New J2K: Add JvmOverloads annotation when merging methods 2019-04-03 11:22:50 +03:00
Ilya Kirillov
e232d70b52 New J2K: Add NullableQualifierConversion 2019-04-03 11:22:49 +03:00
Ilya Kirillov
95efc5eecf New J2K: Make annotation's type parameters not null 2019-04-03 11:22:48 +03:00
Ilya Kirillov
211405c034 New J2K: Cleanup code builder 2019-04-03 11:22:47 +03:00
Ilya Kirillov
2d256717ff New J2K: Make JKMethodCallExpression's arguments nullable 2019-04-03 11:22:46 +03:00
Ilya Kirillov
acd8985518 New J2K: Add JetbrainsNullableAnnotationsConverter 2019-04-03 11:22:46 +03:00
Ilya Kirillov
295a160f60 New J2K: Add DefaultNullabilityToNullableConversion 2019-04-03 11:22:45 +03:00
Ilya Kirillov
3d62734cc6 New J2K: Add types to JKExpression.type 2019-04-03 11:22:44 +03:00
Ilya Kirillov
2e353ccf86 New J2K: Use default nullability by default 2019-04-03 11:22:44 +03:00
Ilya Kirillov
f3cb76ff56 New J2K: Fix TypeMappingConversion 2019-04-03 11:22:43 +03:00
Ilya Kirillov
6b889bdf57 New J2K: Add ImplicitCastsConversion 2019-04-03 11:22:42 +03:00
Ilya Kirillov
2d37a2b28e New J2K: Fix type arguments for new expression 2019-04-03 11:22:41 +03:00
Ilya Kirillov
de26e2cfe7 New J2K: Add escaping of class symbol names in code builder 2019-04-03 11:22:40 +03:00
Ilya Kirillov
11da99a1d0 New J2K: Use binaryExpression instead of operatorExpression 2019-04-03 11:22:40 +03:00
Ilya Kirillov
84ad58b50b New J2K: Move literal conversion internals to expression.kt 2019-04-03 11:22:39 +03:00
Ilya Kirillov
60d498cedc New J2K: Add !! postfix expression support 2019-04-03 11:22:38 +03:00
Ilya Kirillov
a529dcce4c New J2K: Add charAt conversion to StringMethodsConversion 2019-04-03 11:22:37 +03:00
Ilya Kirillov
7dbe16d305 New J2K: Make polyadic expression converter to resolve real operator type 2019-04-03 11:22:36 +03:00
Ilya Kirillov
841cd9c749 New J2K: Do not remove redundant nullability in post precessing for variable if initializer is nullable 2019-04-03 11:22:36 +03:00
Ilya Kirillov
bbbadb0431 New J2K: Add support of vararg parameters in method declaration 2019-04-03 11:22:35 +03:00
Ilya Kirillov
6fbc180f92 New J2K: Do not create new line after each local declaration 2019-04-03 11:22:34 +03:00
Ilya Kirillov
51ee64a757 New J2K: Add java void type to JKClassLiteralExpression & make all inner types of JKClassLiteralExpression's classType to be notNull 2019-04-03 11:22:34 +03:00
Ilya Kirillov
5e6e5bcf8c New J2K: Fix modifiers of local class 2019-04-03 11:22:33 +03:00
Ilya Kirillov
ec1bc35df7 New J2K: Use real method symbols in ArrayInitializerConversion 2019-04-03 11:22:32 +03:00
Ilya Kirillov
71b194d0d6 New J2K: Get rid of JKUnresolvedClassType and use JKClassType(JKUnresolvedClassSymbol) instead 2019-04-03 11:22:31 +03:00
Ilya Kirillov
325eec2454 New J2K: Replace java instanceof with kotlin is expression 2019-04-03 11:22:31 +03:00
Ilya Kirillov
eda99a588d New J2K: Fix declarations creation 2019-04-03 11:22:30 +03:00
Ilya Kirillov
0feaad2205 New J2K: Fix enum constant symbol 2019-04-03 11:22:29 +03:00
Ilya Kirillov
1c4e811717 New J2K: Fix symbol's fqName 2019-04-03 11:22:29 +03:00
Ilya Kirillov
7c04590d82 New J2K: Fix method call expression printing 2019-04-03 11:22:28 +03:00
Ilya Kirillov
5fc9ca8fc7 New J2K: Add resolving for kotlin properties and object members calls 2019-04-03 11:22:27 +03:00
Ilya Kirillov
db8beab499 New J2K: Fix NPE in a case of unresolved symbols 2019-04-03 11:22:27 +03:00
Ilya Kirillov
410000f94c New J2K: Fix types for kotlin properties 2019-04-03 11:22:26 +03:00
Ilya Kirillov
667ead10a3 New J2K: Add finalize & clone to JavaStandartMethodsConversion 2019-04-03 11:22:25 +03:00
Ilya Kirillov
12fe096b82 New J2K: Fix class inheritance info 2019-04-03 11:22:25 +03:00
Ilya Kirillov
ad58772453 New J2K: Use IDEA analyzers on kotlin properties & functions 2019-04-03 11:22:24 +03:00
Ilya Kirillov
cc2f27f9cd New J2K: Add string.length conversion 2019-04-03 11:22:23 +03:00
Ilya Kirillov
9704a7aa7f New J2K: Add ReplaceCallWithBinaryOperatorInspection & MayBeConstantInspection to postProcessing 2019-04-03 11:22:22 +03:00
Ilya Kirillov
b7d6a905f3 New J2K: Fix extra spaces in StructuralPsiCompare 2019-04-03 11:22:22 +03:00
Ilya Kirillov
2c8483aef4 New J2K: Rearrange conversions & add new ones 2019-04-03 11:22:21 +03:00
Ilya Kirillov
7dd60a04ec New J2K: Add EnumClassConversion 2019-04-03 11:22:20 +03:00
Ilya Kirillov
17b96b8240 New J2K: Fix printing no semicolon in enum class 2019-04-03 11:22:19 +03:00
Ilya Kirillov
dcf7895314 New J2K: Make JKKtAssignmentStatementImpl field to be a child of JKBranchElement 2019-04-03 11:22:18 +03:00
Ilya Kirillov
56aa6f83af New J2K: Assume enum class in PrimaryConstructorDetectConversion 2019-04-03 11:22:18 +03:00
Ilya Kirillov
d02be5ae94 New J2K: Create init declaration from primary constructor in PrimaryConstructorDetectConversion 2019-04-03 11:22:17 +03:00
Ilya Kirillov
8ceca44b10 New J2K: Remove useless FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:22:16 +03:00
Ilya Kirillov
757675c4ca New J2K: Make JKType.updateNullability return the same type 2019-04-03 11:22:15 +03:00
Ilya Kirillov
104cf2eef5 New J2K: Add NATIVE to EXTERNAL modifiers conversion 2019-04-03 11:22:15 +03:00
Ilya Kirillov
5cb4abf95d New J2K: Add JavaStandardMethodsConversion 2019-04-03 11:22:14 +03:00
Ilya Kirillov
cd6bcb7878 New J2K: Assume that is expression type is always not null 2019-04-03 11:22:13 +03:00
Ilya Kirillov
1615b1c6b3 New J2K: Add support of Anonymous class initializers 2019-04-03 11:22:13 +03:00
Ilya Kirillov
be90db7fca New J2K: Add ParameterModificationInMethodCallsConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
aa173783aa New J2K: Add check that field is not initialized in constructor in ImplicitInitializerConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
730c8ca495 New J2K: Fix java assignment to also conversion 2019-04-03 11:22:11 +03:00
Ilya Kirillov
4194ace762 New J2K: Add super expression qualifier 2019-04-03 11:22:10 +03:00
Ilya Kirillov
d75549f443 New J2K: Fix grouping post processing 2019-04-03 11:22:09 +03:00
Ilya Kirillov
763ea3480d New J2K: Add support of enum consts initializingClass 2019-04-03 11:22:09 +03:00
Ilya Kirillov
49a8a8f116 New J2K: Add support of grouped postProcessings & introduce VarToVal inspection 2019-04-03 11:22:08 +03:00
Ilya Kirillov
c7df104b36 New J2K: Add ConvertDataClass PostProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
5c8035b339 New J2K: Add ConvertGettersAndSetters postProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
daf1f6154e New J2K: Add more types to JKExpression.type 2019-04-03 11:22:06 +03:00
Ilya Kirillov
d47543820a New J2K: Add collection classes mapping to TypeMappingConversion 2019-04-03 11:22:05 +03:00
Ilya Kirillov
df5c2f90c1 New J2K: Add basic import list mapping 2019-04-03 11:22:04 +03:00
Ilya Kirillov
213aa9a86d New J2K: Add annotations for JKField 2019-04-03 11:22:03 +03:00
Ilya Kirillov
2633834741 New J2K: Add conversion of some java modifiers to kotlin annotations 2019-04-03 11:22:03 +03:00
Ilya Kirillov
0e6e0e6df1 New J2K: Stop printing multiline lambdas in a case of single statement inside 2019-04-03 11:22:02 +03:00
Ilya Kirillov
0712db8bd3 New J2K: Add filtering local imports in ImportStatementConversion 2019-04-03 11:22:02 +03:00
Ilya Kirillov
d4077a1622 New J2K: Add boxed types support to PrimitiveTypesInitializersConversion 2019-04-03 11:22:01 +03:00
Ilya Kirillov
f14aa2292f New J2K: Implement primitive type case for ImplicitInitializerConversion 2019-04-03 11:22:00 +03:00
Ilya Kirillov
fb3c7e87a1 New J2K: Fix binaryExpressionMethodSymbol in a case of not JKMultiverseKtClassSymbol 2019-04-03 11:21:59 +03:00
Ilya Kirillov
2c7e44f41e New J2K: Add checking for receiver type in for conversion's indicesByCollectionSize 2019-04-03 11:21:59 +03:00
Ilya Kirillov
ffbdafbe69 New J2K: Add LowerNullabilityInFunctionParametersConversion 2019-04-03 11:21:58 +03:00
Ilya Kirillov
a15f51950b New J2K: Add collection operations conversion 2019-04-03 11:21:57 +03:00
Ilya Kirillov
254d2f8b67 New J2K: Fix JKType.toKtType function 2019-04-03 11:21:57 +03:00
Ilya Kirillov
77eb9b1b37 New J2K: Fix if statement printing with empty then body 2019-04-03 11:21:55 +03:00
Ilya Kirillov
b21c52aecd New J2K: Fix JKClassSymbol's name printing in a case of nested class 2019-04-03 11:21:54 +03:00
Ilya Kirillov
599aa9435f New J2K: Move postProcessingRegistrar to a NewJ2KPostProcessingRegistrarImpl and revert old one 2019-04-03 11:21:54 +03:00
Ilya Kirillov
a80a30e0af New J2K: Fix that RemoveExplicitPropertyType does not work on local variables 2019-04-03 11:21:53 +03:00
Ilya Kirillov
a5b7831773 New J2K: Add array operation conversion 2019-04-03 11:21:52 +03:00
Ilya Kirillov
1faaada01f New J2K: Add import statement conversion 2019-04-03 11:21:51 +03:00
Ilya Kirillov
a19ae4bcc2 New J2K: Fix accessing to non-existing psi in TypeMappingConversion 2019-04-03 11:21:50 +03:00
Ilya Kirillov
17f86d69a7 New J2K: Calculate function return type nullability in JavaMethodToKotlinFunctionConversion 2019-04-03 11:21:49 +03:00
Ilya Kirillov
b076e7e881 New J2K: Fix for conversion due to changing modifier types 2019-04-03 11:21:48 +03:00
Ilya Kirillov
70225ac3d0 New J2K: Fix class access expression fq name when it starts with b "java.lang." 2019-04-03 11:21:47 +03:00
Ilya Kirillov
4a16f4cc9f New J2K: Fix multiple update expressions in psi for statements 2019-04-03 11:21:46 +03:00
Ilya Kirillov
f6f619ea27 New J2K: Add blockStatementWithoutBrackets to for statement conversion 2019-04-03 11:21:46 +03:00
Ilya Kirillov
03131dc138 New J2K: Add JKBlockStatementWithoutBrackets 2019-04-03 11:21:45 +03:00
Ilya Kirillov
4b0840beb1 New J2K: Add multiple updaters to Java for loop 2019-04-03 11:21:43 +03:00
Ilya Kirillov
9532dec452 New J2K: Make JKExpression.type nullable 2019-04-03 11:21:42 +03:00
Ilya Kirillov
28aeaa040e New J2K: Split conversions to Java --> Kotlin conversions and Kotlin --> Kotlin conversions 2019-04-03 11:21:41 +03:00
Ilya Kirillov
67c6192425 New J2K: Remove unused symbolByName 2019-04-03 11:21:40 +03:00
Ilya Kirillov
2c3e8a3909 New J2K: Add print conversion to PrintlnConversion 2019-04-03 11:21:40 +03:00
Ilya Kirillov
71fcbcb60a New J2K: Change type of JKType.classSymbol to JKClassSymbol 2019-04-03 11:21:39 +03:00
Ilya Kirillov
2292e0b792 New J2K: Fix enum constant constructing 2019-04-03 11:21:38 +03:00
Ilya Kirillov
b3dc0d4aff New J2K: Add package & imports declarations to JKFile, simplify JKFile constructing 2019-04-03 11:21:37 +03:00
Ilya Kirillov
3ea4ee9110 New J2K: Add throws list for java method & add JKClassLiteralExpression 2019-04-03 11:21:36 +03:00
Ilya Kirillov
69633e7a0f New J2K: Split ModifiersList to visibilityModifier, modalityModifier, mutabilityModifier and extraModifiers & introduce JKVariable which may have any subset of modifiers 2019-04-03 11:21:35 +03:00
Ilya Kirillov
5c6092c98c New J2K: Add mangling of name identifiers 2019-04-03 11:21:34 +03:00
Ilya Kirillov
0e9abf8ca3 New J2K: Add assert statement conversion 2019-04-03 11:21:33 +03:00
Ilya Kirillov
633c29a2de New J2K: Fix when final fields become vars 2019-04-03 11:21:33 +03:00
Ilya Kirillov
8ba8a2f197 New J2K: Fix binary expression's method symbol search 2019-04-03 11:21:32 +03:00
Ilya Kirillov
bb2c32a402 New J2K: Fix package statement position 2019-04-03 11:21:31 +03:00
Ilya Kirillov
e1108e1764 New J2K: Add anonymous object creation support JKNewExpression 2019-04-03 11:21:30 +03:00
Ilya Kirillov
f58d791a05 New J2K: Introduce type arguments 2019-04-03 11:21:29 +03:00
Ilya Kirillov
40c5b56c10 New J2K: Refactor brackets in new expression printing 2019-04-03 11:21:28 +03:00
Ilya Kirillov
a30311da45 New J2K: Add dummy field to property conversion 2019-04-03 11:21:27 +03:00
Ilya Kirillov
e0ac21c4ad New J2K: Collect and print imports 2019-04-03 11:21:27 +03:00
Ilya Kirillov
c6006927ac New J2K: Add optimize import to post processing 2019-04-03 11:21:26 +03:00
Ilya Kirillov
8f960f2f47 New J2K: Fix do while loop spaces 2019-04-03 11:21:25 +03:00
Ilya Kirillov
b24d683ebe New J2K: Make JKJavaNewArrayImpl a PsiOwner 2019-04-03 11:21:24 +03:00
Ilya Kirillov
a1600bd83a New J2K: Add ForIn statement conversion 2019-04-03 11:21:23 +03:00
Ilya Kirillov
a0ab7492a8 New J2K: Add JavaTokenType.EXCL token to JKJavaOperatorToken.toKtToken() 2019-04-03 11:21:23 +03:00
Ilya Kirillov
bcaea3182e New J2K: Fix JKStatement.isEmpty method by not considering empty block statement as empty statement 2019-04-03 11:21:22 +03:00
Ilya Kirillov
f223a6ebd1 New J2K: Use default psiContext in AssignmentAsExpressionToAlsoConversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
28ef4c5dfa New J2K: Main function conversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
2f1a8831b2 New J2K: Add basic annotations support 2019-04-03 11:21:20 +03:00
Ilya Kirillov
f752796408 New J2K: Fix existing test data 2019-04-03 11:21:19 +03:00
Ilya Kirillov
5236858c20 New J2K: Add JKThrowStatement and JKContinueStatement to SwitchStatementConversion's falls fallsThrough() 2019-04-03 11:21:19 +03:00
Ilya Kirillov
42dc96d9a8 New J2K: Fix switch statement cases printing 2019-04-03 11:21:17 +03:00
Ilya Kirillov
3ea1a937c0 New J2K: Place else case in the end in switch statement conversion 2019-04-03 11:21:16 +03:00
Ilya Kirillov
115fe2cb88 New J2K: Fix statements in lambda expression 2019-04-03 11:21:15 +03:00
Ilya Kirillov
136a254da5 New J2K: Fix showing ":" in type parameter type 2019-04-03 11:21:14 +03:00
Ilya Kirillov
4080804391 New J2K: Add JKPackageDeclaration 2019-04-03 11:21:14 +03:00
Ilya Kirillov
2b6ac84dda New J2K: Add qualified label to JKThisExpression 2019-04-03 11:21:13 +03:00
Ilya Kirillov
71408c0b14 New J2K: Fix class modifiers conversion 2019-04-03 11:21:12 +03:00
Ilya Kirillov
eb0182c5a9 New J2K: Remove extra JKKtModifier.INTERNAL because there is already JKVisibilityModifier.INTERNAL 2019-04-03 11:21:11 +03:00
Ilya Kirillov
4f30283744 New J2K: Add printing of JKClassAccessExpression 2019-04-03 11:21:11 +03:00
Ilya Kirillov
2d9a9613f6 New J2K: Fix conversion of inner classed methods 2019-04-03 11:21:10 +03:00
Ilya Kirillov
f76a3504cc New J2K: Inherit JKBinaryExpression & JKUnaryExpression from JKOperatorExpression 2019-04-03 11:21:09 +03:00
Ilya Kirillov
9374816823 New J2K: Add conversion of prefix and postfix expressions 2019-04-03 11:21:08 +03:00
Ilya Kirillov
3d418d8904 New J2K: Add == to JKJavaOperatorToken.toKtToken 2019-04-03 11:21:07 +03:00
Ilya Kirillov
4310575de9 New J2K: Add ';' in a case of For loop and While loop empty body 2019-04-03 11:21:07 +03:00
Ilya Kirillov
3ddc05fdd9 New J2K: Add forEach statement generation 2019-04-03 11:21:06 +03:00
Ilya Kirillov
7b5ffce7aa New J2K: Separate statements in block 2019-04-03 11:21:05 +03:00
Ilya Kirillov
9a1e5582b6 New J2K: Render list separator as function 2019-04-03 11:21:04 +03:00
Ilya Kirillov
7af03c2859 New J2K: Set exception types as non nullable in try statement conversion 2019-04-03 11:21:04 +03:00
Ilya Kirillov
3771ccedb7 New J2K: Add JKType.updateNullability function 2019-04-03 11:21:03 +03:00
Ilya Kirillov
2e0c7e9128 New J2K: Fix spaces in structural tests 2019-04-03 11:21:02 +03:00
Ilya Kirillov
61d6709cb7 New J2K: Add temporary sorting of class declarations 2019-04-03 11:21:01 +03:00
Ilya Kirillov
03df0f1164 New J2K: Add default mutability to property in FieldToPropertyConversion 2019-04-03 11:21:01 +03:00
Ilya Kirillov
0873045718 New J2K: Print & filter primary constructor modifiers 2019-04-03 11:20:59 +03:00
Ilya Kirillov
7e7d865054 New J2K: Add enum constants 2019-04-03 11:20:59 +03:00
Ilya Kirillov
ff700b5399 New J2K: Add TypeElement.present() function 2019-04-03 11:20:58 +03:00
Ilya Kirillov
77713c1877 New J2K: Add NoType for ktProperty 2019-04-03 11:20:57 +03:00
Ilya Kirillov
a55d2b6597 New J2K: Add missing modifier priorities 2019-04-03 11:20:57 +03:00
Ilya Kirillov
55c304827a New J2K: Do not convert class to object in ClassToObjectPromotionConversion when it has inheritors 2019-04-03 11:20:56 +03:00
Ilya Kirillov
70def791c0 New J2K: Fix ClassToObjectPromotionConversion when empty constructor 2019-04-03 11:20:56 +03:00
Ilya Kirillov
44185c1246 New J2K: Fix adding init section with empty body 2019-04-03 11:20:55 +03:00
Ilya Kirillov
6a8f3a7a84 New J2K: Fix println's in printer 2019-04-03 11:20:55 +03:00
Ilya Kirillov
0bc1e96f0d New J2K: Add type parameter type 2019-04-03 11:20:54 +03:00
Ilya Kirillov
524b07f6ac New J2K: Add variance type parameters 2019-04-03 11:20:53 +03:00
Ilya Kirillov
14f5d866ee New J2K: Add type parameters to methods declaration 2019-04-03 11:20:53 +03:00
Ilya Kirillov
4097ebe583 New J2K: Add typeParameter's upper bounds 2019-04-03 11:20:52 +03:00
Ilya Kirillov
33b66ec17e New J2K: Add typeParameters to JKClass 2019-04-03 11:20:51 +03:00
Ilya Kirillov
1f59f91aeb New J2K: Add typeParameter & typeParameterList 2019-04-03 11:20:50 +03:00
Ilya Kirillov
b9d432bfac New J2K: Call RemoveEmptyClassBodyIntention 2019-04-03 11:20:49 +03:00
Ilya Kirillov
ba08f233b6 New J2K: Try with resource conversion 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d602b9e47 New J2K: Add "use" expression generator 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d45bce06a New J2K: Add try statement 2019-04-03 11:20:47 +03:00
Ilya Kirillov
594d0ba7e9 New J2K: Add throw statement 2019-04-03 11:20:46 +03:00
Ilya Kirillov
66f12d9fea New J2K: Do not print extra mutability modifier in ktProperty 2019-04-03 11:20:45 +03:00
Ilya Kirillov
5ba3d6bc67 New J2K: Fix parameters modifiers 2019-04-03 11:20:45 +03:00
Ilya Kirillov
9e98e36ac7 New J2K: Use RecursiveApplicableConversionBase in FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:20:44 +03:00
Ilya Kirillov
78c5b4acd5 New J2K: Add JKEmptyStatement 2019-04-03 11:20:43 +03:00
Ilya Kirillov
e10a81a942 New J2K: Use JKDeclaration instead of ValIdentifier in ForLoop 2019-04-03 11:20:43 +03:00
Ilya Kirillov
d228d6110c New J2K: Move expression creation functions to separated file 2019-04-03 11:20:42 +03:00
Ilya Kirillov
fad9c52853 New J2K: Add type calculating for equals operator 2019-04-03 11:20:41 +03:00
Ilya Kirillov
a1ac0c2e4b New J2K: Fix for conversion due to using operator tokens 2019-04-03 11:20:41 +03:00
Ilya Kirillov
1851239e7e New J2K: Add JKElement.detached function 2019-04-03 11:20:40 +03:00
Ilya Kirillov
753070b6c7 New J2K: Refactor code 2019-04-03 11:20:39 +03:00
Ilya Kirillov
3030a03584 New J2K: Replace backAnnotator with PsiOwner 2019-04-03 11:20:38 +03:00
Ilya Kirillov
c948e2d086 New J2K: Fix operatorName in JKKtSingleValueOperatorToken 2019-04-03 11:20:37 +03:00
Ilya Kirillov
6051b455bf New J2K: Add type for unresolved symbols 2019-04-03 11:20:36 +03:00
Ilya Kirillov
41640e1a15 New J2K: Add dependency to idea-core in j2k 2019-04-03 11:20:36 +03:00
Ilya Kirillov
29c536579f New J2K: Add converting type functions from kotlin one to j2k one 2019-04-03 11:20:35 +03:00
Ilya Kirillov
dbdd39c6ab New J2K: Add type calculating for more kinds of JKExpressions 2019-04-03 11:20:34 +03:00
Ilya Kirillov
71b3fe33a3 New J2K: Add operator tokens 2019-04-03 11:20:33 +03:00
Ilya Kirillov
cd2a17ae56 New J2K: Add calculating type for binary expressions & building binary expression with correct return type 2019-04-03 11:20:32 +03:00
Ilya Kirillov
5e4b39f10f New J2K: Add calculating type for JKExpression 2019-04-03 11:20:32 +03:00
Ilya Kirillov
27526cf866 New J2K: Add labeled statement 2019-04-03 11:20:31 +03:00
Ilya Kirillov
0a08467b45 New J2K: Add continue statement 2019-04-03 11:20:30 +03:00
Ilya Kirillov
ed61aac4fd New J2K: Add Java for loop to Kotlin while or for in loop conversion 2019-04-03 11:20:29 +03:00
Ilya Kirillov
07f99fe0d2 New J2K: Don't move initilizer to constructor if types are not the same 2019-04-03 11:20:29 +03:00
Ilya Kirillov
baa9b714d1 New J2K: Add init block 2019-04-03 11:20:28 +03:00
Ilya Kirillov
b6239a9130 New J2K: Fix InsertDefaultPrimaryConstructorConversion acceptability determining 2019-04-03 11:20:27 +03:00
Ilya Kirillov
d688b6c6da New J2K: Add filter & sort modifiers conversion 2019-04-03 11:20:26 +03:00
Ilya Kirillov
a7e0f18a57 New J2K: Add primary constructor initializers conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
2aafeda33b New J2K: Add detect primary constructors conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
44d2a6f432 New J2K: Add printing of Java new expression 2019-04-03 11:20:24 +03:00
Ilya Kirillov
6d283b0ac1 New J2K: Add operation's text for some java operators 2019-04-03 11:20:23 +03:00
Ilya Kirillov
451a462b07 New J2K: Add printing of do-while statement 2019-04-03 11:20:22 +03:00
Ilya Kirillov
19c569e8e2 New J2K: Add conversion of Java instanceof expression to Kotlin is expression 2019-04-03 11:20:21 +03:00
Ilya Kirillov
c3ffaa34f8 New J2K: Do not ignore unused vals in CanBeVal inspection in postprocessing 2019-04-03 11:20:20 +03:00
Ilya Kirillov
4d1b2a8d5b New J2K: Add Java switch statement to Kotlin when expression conversion 2019-04-03 11:20:20 +03:00
Ilya Kirillov
6e079e38fe New J2K: Add AST copy tree function 2019-04-03 11:20:19 +03:00
Ilya Kirillov
18164b116b New J2K: Add support of break statements 2019-04-03 11:20:18 +03:00
Simon Ogorodnik
7e2d0695fe New J2K: Use context type for lambda in block to run call conversion 2019-04-03 11:20:18 +03:00
Dimach
2f1c621b5f New J2K: Improve type system and nullability computation in type mapper 2019-04-03 11:20:17 +03:00
Dimach
abc4104ba7 New J2K: Implement Array init conversions 2019-04-03 11:20:17 +03:00
Dimach
f3ffb2acfd New J2K: Implement assignment simplify conversion 2019-04-03 11:20:16 +03:00
Simon Ogorodnik
77819be8f3 New J2K: Add function to lookup symbols by fqName 2019-04-03 11:20:15 +03:00
Dimach
c43bfcb185 New J2K: Introduce context type 2019-04-03 11:20:14 +03:00
Simon Ogorodnik
986b38102e New J2K: Add insert default constructor conversion 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
aef8a7a8f1 New J2K: Clearer return type for recurse 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
6fd2cc73cf New J2K: Remove incorrect ClassKind 2019-04-03 11:20:12 +03:00
Simon Ogorodnik
815070013f New J2K: Split conversions into sequential and batch 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
d793769e92 New J2K: Add block statement to run conversion 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
f496a472f4 New J2K: Even better test diff UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
15981fed17 New J2K: Improve UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
3dbdb2b64d New J2K: Support 'override' modality 2019-04-03 11:20:09 +03:00
Simon Ogorodnik
dcffb60dc9 New J2K: Create UI for tracking test changes 2019-04-03 11:20:08 +03:00
Simon Ogorodnik
e0d3ff7507 New J2K: WIP: Field to property conversion 2019-04-03 11:20:07 +03:00
Simon Ogorodnik
dbf4ba536f New J2K: Implement removing of explicit types in post-processing 2019-04-03 11:20:06 +03:00
Simon Ogorodnik
1c1804f22d New J2K: Fix after merge 2019-04-03 11:20:05 +03:00
Simon Ogorodnik
2844f8d5d9 New J2K: Add conversion to promote classes with only companions into objects 2019-04-03 11:20:04 +03:00
Simon Ogorodnik
fba5ac4c1a New J2K: Post-processing to remove redundant opens in objects 2019-04-03 11:20:03 +03:00
Simon Ogorodnik
ae1f27e327 New J2K: Add conversion that moves statics to companion object 2019-04-03 11:20:02 +03:00
Simon Ogorodnik
38760a8b7c New J2K: Support this qualifier in default arguments converter 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
b868214992 New J2K: Improve debug tree printer, now it capable of printing universe symbols 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
53ebdb4a02 New J2K: Add missing accept for NameIdentifier 2019-04-03 11:20:00 +03:00
Simon Ogorodnik
4eb070a2dc New J2K: Support QuickFixActionBase for inspections in J2K Post-processing 2019-04-03 11:19:59 +03:00
Simon Ogorodnik
bc5ff67aff New J2K: Correctly support variables mutability 2019-04-03 11:19:58 +03:00
Simon Ogorodnik
f147907799 New J2K: Fix incorrect testData (due to nullability bug in old j2k) 2019-04-03 11:19:57 +03:00
Simon Ogorodnik
b530a30882 New J2K: Support different testData for new converter
Sometimes old testData is incorrect
2019-04-03 11:19:56 +03:00
Simon Ogorodnik
800b09b183 New J2K: Add temporary conversion for println calls 2019-04-03 11:19:56 +03:00
Simon Ogorodnik
911f234ba4 New J2K: Implement basic default argument converter 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
34b535c8ab New J2K: Add missing accept for null literal 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
4637903e00 New J2K: Add conversion which will initialize java implicit initialized fields 2019-04-03 11:19:54 +03:00
Simon Ogorodnik
61fd76a89a New J2K: Support relaxed visibility for members of package-local classes 2019-04-03 11:19:53 +03:00
Simon Ogorodnik
1b7c980c83 New J2K: Put braces on same line, if block is empty 2019-04-03 11:19:52 +03:00
Simon Ogorodnik
63fd2439bf New J2K: Hack around type nullability calculation 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
65e0694ba1 New J2K: Primary constructor conversion 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
6793c1d08f New J2K: Constructor conversion 2019-04-03 11:19:50 +03:00
Simon Ogorodnik
e83844e941 New J2K: Inner class conversion 2019-04-03 11:19:49 +03:00
Simon Ogorodnik
c87cd20a9d New J2K: Add rendering for type-parameters 2019-04-03 11:19:48 +03:00
Simon Ogorodnik
b12a91c111 New J2K: Add test with structural compare and cleanup duplicated code in tests 2019-04-03 11:19:47 +03:00
Simon Ogorodnik
ac20e9ba83 New J2K: Render list of implemented correctly 2019-04-03 11:19:46 +03:00
Simon Ogorodnik
b8bbd85bc7 New J2K: Preserve text for unresolved types, and render it in code builder 2019-04-03 11:19:45 +03:00
Simon Ogorodnik
7e2be15fcc New J2K: Clean-up parenthesizing and block rendering in code builder 2019-04-03 11:19:44 +03:00
Simon Ogorodnik
07a33ceebd New J2K: Remove unnecessary modifiers in post-processing 2019-04-03 11:19:43 +03:00
Simon Ogorodnik
13a63e421b New J2K: Print function modifiers and relax method visibility in test 2019-04-03 11:19:43 +03:00
Dimach
fe180138f3 New J2K: Assignment conversion second part. 2019-04-03 11:19:42 +03:00
Dimach
3a2b2d9e97 New J2K: Assignment expression conversion improvements 2019-04-03 11:19:41 +03:00
Simon Ogorodnik
b702e207c0 New J2K: Add inheritance and support while & type-casts in code builder 2019-04-03 11:19:40 +03:00
Simon Ogorodnik
928647462e New J2K: Support general inspections with intention wrapper as quickFix 2019-04-03 11:19:39 +03:00
Simon Ogorodnik
c41be3274e New J2K: Cleanup code generation 2019-04-03 11:19:38 +03:00
Simon Ogorodnik
2e7940149f New J2K: Break line after class def 2019-04-03 11:19:37 +03:00
Simon Ogorodnik
049bb4a8af New J2K: Don't add abstract if not class 2019-04-03 11:19:37 +03:00
Dimach
d73b006b18 New J2K: Lambda expressions. 2019-04-03 11:19:36 +03:00
Dimach
795bfa4b2f New J2K: Fix array assignment. 2019-04-03 11:19:35 +03:00
Dimach
4a0df846de New J2K: Some changes to assignment expression. 2019-04-03 11:19:34 +03:00
Dimach
0078a5a61b New J2K: Symbol provider refactor. 2019-04-03 11:19:33 +03:00
Dimach
e1f47823d4 New J2K: Array access expression. 2019-04-03 11:19:32 +03:00
Dimach
81c0dae139 New J2K: Polyadic expression conversion. 2019-04-03 11:19:31 +03:00
Dimach
15ad2af268 New J2K: More binary expressions support and boolean literals. 2019-04-03 11:19:30 +03:00
Dimach
d183285a75 New J2K: Added unresolved field references. 2019-04-03 11:19:29 +03:00
Simon Ogorodnik
f6a5ac9d97 New J2K: Standardize modality and visibility 2019-04-03 11:19:28 +03:00
Simon Ogorodnik
0ec2fb3d17 New J2K: Introduce JKFile 2019-04-03 11:19:27 +03:00
Simon Ogorodnik
e4fc4b8218 New J2K: Create services for new j2k 2019-04-03 11:19:26 +03:00
Simon Ogorodnik
9d3805defe New J2K: Apply post-processing to nj2k results 2019-04-03 11:19:25 +03:00
Simon Ogorodnik
b216574298 New J2K: Support general inspections in j2k post-processing 2019-04-03 11:19:24 +03:00
Simon Ogorodnik
ccb941ab1c New J2K: Fix type mapper 2019-04-03 11:19:23 +03:00
Simon Ogorodnik
279c835d04 New J2K: Fix nullability for converted primitive types 2019-04-03 11:19:22 +03:00
Dimach
72c88c9003 New J2K: Reference resolve for parameters. 2019-04-03 11:19:22 +03:00
Dimach
6f84750af4 New J2K: Fixed resolve of class reference. 2019-04-03 11:19:21 +03:00
Dimach
97e38615f1 New J2K: Correct resolve of local variables. 2019-04-03 11:19:20 +03:00
Dimach
485f5c7e37 New J2K: Binary expression conversion 2019-04-03 11:19:19 +03:00
Dimach
674b3ce02e New J2K: Fixed modifiers conversion, expression test now can pass. 2019-04-03 11:19:18 +03:00
Dimach
b33f5ec58f New J2K: Fixed wrong whitespace 2019-04-03 11:19:18 +03:00
Dimach
8430ada13b New J2K: Fixed few bugs in conversions and symbols improvements. 2019-04-03 11:19:17 +03:00
Dimach
39cf373286 New J2K: Operators translation. 2019-04-03 11:19:16 +03:00
Dimach
21ae28025c New J2K: Declaration statement and local variables. 2019-04-03 11:19:16 +03:00
Dimach
14dd4fc92f New J2K: Added modifiers conversion and correct resolve of void type. 2019-04-03 11:19:15 +03:00
Dimach
ab723b1d39 New J2K: Added more cases to code builder. 2019-04-03 11:19:14 +03:00
Dimach
b06f0fe848 New J2K: Code builder now VoidVisitor 2019-04-03 11:19:14 +03:00
Dimach
8ce3673aaf New J2K: Fixed array initializer 2019-04-03 11:19:13 +03:00
Dimach
6096b1fd56 New J2K: Java polyadic expression 2019-04-03 11:19:13 +03:00
Dimach
4fe9b6a7c6 New J2K: If expression improvements.
Fixed field resolve.
2019-04-03 11:19:12 +03:00
Simon Ogorodnik
986cb5be27 New J2K: Add more elements to code builder 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
a9ff38f1fa New J2K: Rename parameters to match supertype 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
7fcdcb20d6 New J2K: Some code-builder basic stuff 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
ad0721aae7 New J2K: Extract fqName resolution 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
00c52df519 New J2K: Add missing accept's 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
235dacfd88 New J2K: Copy return type 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
caa4af07c1 New J2K: Fix crash in fqName resolution 2019-04-03 11:19:08 +03:00
Simon Ogorodnik
2c2bd9ab5a New J2K: Support all java operators 2019-04-03 11:19:07 +03:00
Dimach
6dc8933a93 New J2K: While, switch, conditional expression, moved if. 2019-04-03 11:19:07 +03:00
Simon Ogorodnik
d718fae6d9 New J2K: Deal with unresolved class types 2019-04-03 11:19:06 +03:00
Simon Ogorodnik
c53f56629e New J2K: Correctly resolve references to default constructor 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
0e2dac0899 New J2K: Add nullability to all types 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
58de0ae6bc New J2K: Always use text for literals 2019-04-03 11:19:04 +03:00
Dimach
7fbff168dd New J2K: Symbol provider improvements. 2019-04-03 11:19:03 +03:00
Dimach
45eecf2c90 New J2K: Added this and super expressions. 2019-04-03 11:19:02 +03:00
Dimach
a1d37034c4 New J2K: If, for, instanceof, code block statement. 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
607d9820e7 New J2K: Add body stub for abstract methods & set return type to void for <init> 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
cb4474b9a4 New J2K: Add literal conversion 2019-04-03 11:19:00 +03:00
Simon Ogorodnik
c84ecb162e New J2K: Extract common conversions logic to base class 2019-04-03 11:18:59 +03:00
Dimach
003cee8cc1 New J2K: Added assertion statement and more operators. 2019-04-03 11:18:59 +03:00
Dimach
3bbef363e6 New J2K: Added declaration statements, local variables and stub expression. 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
26c011b44a New J2K: Add todo about missing lambda expression element 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
a5f0097dc7 New J2K: Add conversion for assignment as expression to also call 2019-04-03 11:18:57 +03:00
Simon Ogorodnik
fd69efa4c2 New J2K: Add missing literals and cleanup literal handling in tree builder 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
b7fd8e32cb New J2K: Introduce invalidate to mark element for removal, freeing it's children 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
7c5e9cd669 New J2K: Add all primitive types 2019-04-03 11:18:55 +03:00
Simon Ogorodnik
77b6eca76e New J2K: Cleanup element impls to reference nested elements via delegates 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
9f7146d8b9 New J2K: Prohibit to override acceptChildren for BranchElementBase 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
855d713368 New J2K: Use require & check instead of assert in tree consistency check 2019-04-03 11:18:53 +03:00
Simon Ogorodnik
7c278bfbab New J2K: Extract base from concrete implementations 2019-04-03 11:18:52 +03:00
Dimach
bfb0f4a369 New J2K: Type system refactored, parents from types removed, added JKTypeElement 2019-04-03 11:18:52 +03:00
Simon Ogorodnik
bc645a12b5 New J2K: More info in TODO 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
278cf82346 New J2K: Use proper tree structure in kt elements 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
13475cde01 New J2K: Add accept 2019-04-03 11:18:50 +03:00
Simon Ogorodnik
4892784f70 New J2K: Improve debug tree printer for types 2019-04-03 11:18:49 +03:00
Dimach
aea0511486 New J2K: Resolve symbols properly 2019-04-03 11:18:49 +03:00
Dimach
f912639999 New J2K: Done symbols 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
1e4737b4b2 New J2K: Fix reference resolution in type mapper conversion 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
7cccb99982 New J2K: WIP: Type mapper 2019-04-03 11:18:47 +03:00
Dimach
f64c32fd71 New J2K: Changed references to symbols. 2019-04-03 11:18:46 +03:00
Simon Ogorodnik
985e94fbf3 New J2K: Add from argument to detach
Support detach/attach/multilist in applyRecursive

Clarify attach/detach/onElementChanged order
2019-04-03 11:18:46 +03:00
Simon Ogorodnik
9b205c2825 New J2K: Remove multiverse 2019-04-03 11:18:45 +03:00
Dimach
83f9054a7e New J2K: Added list child into JKBranchElement. Added attach and detach method to JKElement 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
f691fb457e New J2K: WIP: Type mapping conversion 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
a55591011a New J2K: WIP: New field to property conversion 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
edd23c7a83 New J2K: WIP: Introduce symbols instead of references 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
4b3fdbcb0b New J2K: Enable effect-system and new inference 2019-04-03 11:18:42 +03:00
Simon Ogorodnik
9ca6829bda New J2K: Cleanup 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
254179321c New J2K: Rename visitable JKElement to JKTreeElement 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
3aeffe25ee New J2K: Try another approach to tree structure 2019-04-03 11:18:40 +03:00
Simon Ogorodnik
4551d3921b New J2K: Fix after merge 2019-04-03 11:18:39 +03:00
Dimach
6806ef8cf6 New J2K: Separated multiverse and universe declarations 2019-04-03 11:18:39 +03:00
Dimach
c398940679 New J2K: Tree refactor.
Added parents, transformers removed.
2019-04-03 11:18:38 +03:00
Dimach
2ee7e3c0e8 New J2K: Fixed errors 2019-04-03 11:18:38 +03:00
Dimach
aeae668f3d New J2K: Addded kt expressions and changed literals logic. 2019-04-03 11:18:37 +03:00
Dimach
fb32783168 New J2K: ArrayType and PrimitiveType 2019-04-03 11:18:36 +03:00
Dimach
09d52d13b8 New J2K: Type system. 2019-04-03 11:18:36 +03:00
Dimach
dfd745d55b New J2K: Fixed errors. 2019-04-03 11:18:35 +03:00
Dimach
10ff8d500b New J2K: References base done. 2019-04-03 11:18:34 +03:00
knize
c8c9c19a91 New J2K: References base 2019-04-03 11:18:34 +03:00
Kirill Knize
70c291f222 New J2K: Add kotlin declarations to IR (#9) 2019-04-03 11:18:33 +03:00
Kirill Knize
c662813b09 New J2K: Implement transformChildren here and there
PR (#6)
2019-04-03 11:18:33 +03:00
Simon Ogorodnik
2f38edb55f New J2K: Display element type when hit visitElement 2019-04-03 11:18:32 +03:00
Simon Ogorodnik
a4630af109 New J2K: Simple code builder 2019-04-03 11:18:31 +03:00
Simon Ogorodnik
dc73d415ad New J2K: Fix declarations to JK conversion 2019-04-03 11:18:31 +03:00
Dimach
dd499d7a13 New J2K: Rebase to latest changes. 2019-04-03 11:18:30 +03:00
Dimach
a94957aa0f New J2K: Added java -> jk converter for new array, type cast, array access and parenthesized expression. 2019-04-03 11:18:30 +03:00
Dimach
4ecbd13e06 New J2K: Added java -> jk converter for new expression. 2019-04-03 11:18:29 +03:00
Dimach
5bf806b85c New J2K: Added java -> jk converter for field access. 2019-04-03 11:18:28 +03:00
Dimach
98d01d600a New J2K: Added java -> jk converter for method call. 2019-04-03 11:18:28 +03:00
Dimach
9bfd8e4453 New J2K: Added basic expression converter. 2019-04-03 11:18:27 +03:00
Knize
d17548ba73 New J2K: Nj2k modifiers hierarchy (#3) 2019-04-03 11:18:26 +03:00
Knize
24803e31fd New J2K: Add class mapper 2019-04-03 11:18:26 +03:00
knize
e3097d8c1f New J2K: class tree mapper 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
e33df530cd New J2K: First conversion 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
8ac5eadadc New J2K: Update transformers to new style 2019-04-03 11:18:24 +03:00
Simon Ogorodnik
517dd9a260 New J2K: Fix debug tree printer after switching to single visitor 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
8ff78611ba New J2K: Make generics in transformers accept least common interface 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
c1f50d3594 New J2K: Drop separated visitors 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
68c03a6236 New J2K: Add transformers 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
4f7c46741e New J2K: Add debug tree visitor and some tree elements 2019-04-03 11:18:21 +03:00
Simon Ogorodnik
3ff0287c9f New J2K: Stub for JavaField initializer 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
e77fe74284 New J2K: Add Block primitive 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
7ce3c57896 New J2K: Add some primitive tests for new converter 2019-04-03 11:18:19 +03:00
Simon Ogorodnik
66d6ac745f New J2K: Implement basic output generation 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
5fd3a78dbe New J2K: Add basic tree structure and visitor generation script 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
9d9dbb4c25 New J2K: Add stub for JKTree builder 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
f50254d555 New J2K: Move TODO to NewJavaToKotlinConverter 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
ff0b09f77b New J2K: Replicate J2K Single File test for New J2K 2019-04-03 11:18:16 +03:00
Simon Ogorodnik
b151e9c48c New J2K: Add New J2K entry-point stub 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
fb49267819 New J2K: Cleanup J2K single file test and make it extensible 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
f2595e58e5 New J2K: Add newSrc source root for J2K 2019-04-03 11:18:14 +03:00
Simon Ogorodnik
1fd5738a60 Add kapt3-idea to J2K classpath to avoid spam in logs 2019-04-03 11:18:14 +03:00
Vyacheslav Gerasimov
394031a183 Build: Fix upload_plugins.gradle broken after migration to gradle 5.0
`<< {` syntax is removed since gradle 5.0
2019-04-02 23:14:23 +03:00
Ilya Gorbunov
04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Ilya Gorbunov
d77f76bdb0 Clarify wording in Random.nextInt/Long/UInt/ULong docs
#KT-30704 Fixed
2019-04-02 21:28:32 +03:00
Andrey Uskov
792fae4afc Optimize memory usage during import of MPP projects
#KT-30767 Fixed
2019-04-02 21:23:07 +03:00
Dmitry Gridin
3ca1c7b55d "Convert property to function" intention should warn about the property overloads at child class constructor
#KT-29764 Fixed
2019-04-02 22:53:56 +07:00
Dmitry Gridin
c8ea62a0d9 Change function signature should change type parameters
#KT-22896 Fixed
2019-04-02 22:53:13 +07:00
Dmitry Gridin
5e613554ee Minor: refactoring ChangeMemberFunctionSignatureFix 2019-04-02 22:53:13 +07:00
Dmitry Gridin
c48c274e59 Minor: refactoring ChangeFunctionSignature quickfix 2019-04-02 22:53:13 +07:00
Ilya Matveev
cb38f13399 Gradle plugin: Enable missing mingw_x86 target for K/N 2019-04-02 20:59:12 +07:00
Alexander Gorshenev
4332ce9884 Grab constructor call type parameters from its class, not from the contructor 2019-04-02 16:55:58 +03:00
Toshiaki Kameyama
e082522cdf Strip trailing spaces on Save: do not strip trailing spaces inside raw String
#KT-13048 Fixed
2019-04-02 15:27:08 +03:00
Ting-Yuan Huang
9fc869397d IrBuiltins: refactoring for equality checks
Previously,
* Equals performs IEEE 754 equality check for floating points and
  byte-to-byte checks for other types, including references.
* Ieee754Equals performs IEEE 754 for primitive types
* TotalOrderEquals performs total order equals to all types, including
  floating points.

Now it is simplified,
* Equals performs total order checks for all types.
* Ieee754Equals performs IEEE 754 for primitive types.
* (TotalOrderEquals is removed.)
2019-04-02 13:16:31 +02:00
Ilya Chernikov
9ddb64288c Avoid warning about scripting subplugin for MPP project
Temporary solution, the subplugin should be adapted to the new MPP
#KT-30742 fixed
2019-04-02 12:28:06 +02:00
Mikhail Zarechenskiy
63bdabcfae [NI] Clean up after merge with 3998e842 2019-04-02 12:21:15 +03:00
Mikhail Zarechenskiy
c458393e2f [NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of
 function `equals`, the compiler thought that there is no proper
 constraints (upper bounds do not matter here) and marked resolved
 call as a failed one, then diagnostic about missing equals was added

 Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like
 constraints

 #KT-30724 Fixed
2019-04-02 12:21:14 +03:00
Mikhail Zarechenskiy
5fa518fd55 Revert "Temporary fix for NI to compile against bootstrap compiler"
This reverts commit 791ab05e08.

 Problem was fixed in 4a1b9dcc & 1ac35420
2019-04-02 12:21:14 +03:00
Nikolay Krasko
5723bfdcaf Add a point about invalidated state between inspection checks and quick-fix run 2019-04-02 11:48:47 +03:00
Burak Eregar
9ab54d0e44 Fix: String templates suggest removing curly braces for backtick escaped identifiers 2019-04-02 11:48:47 +03:00
Toshiaki Kameyama
17a4506575 Keyword completion: complete data class with parentheses
#KT-30511 Fixed
2019-04-02 11:48:47 +03:00
Nikolay Krasko
f1a31652b3 Add action for collection basic information about Kotlin project (KT-11242)
#KT-11242 Fixed
2019-04-02 11:48:47 +03:00
Sergey Rostov
3465a30201 JPS Build: exclude intellij-core that comes from android tools
#KT-30247 Fixed
2019-04-02 09:27:26 +03:00
Toshiaki Kameyama
61f3e776a7 Add 'Covariant equals' inspection
#KT-29798 Fixed
2019-04-02 13:19:05 +07:00
Simon Ogorodnik
3998e842f1 Abstract NewInference & related from KotlinType
Cleanup TypeConstructors & KotlinTypes in VariableFixationFinder
Cleanup TypeConstructors & KotlinTypes in TypeVariableDirectionCalculator
Cleanup KotlinTypes in TypeCheckerContext for ConstraintSystem
Cleanup KotlinTypes in NewCommonSuperTypeCalculator
Cleanup KotlinTypes in TypeApproximator
Cleanup type substitution
Cleanup NewTypeVariable
Cleanup StubType
Cleanup TypeCheckerContext creation, extract common supertype context
Provide TypeSystemInferenceExtensionContext via dependency injection
2019-04-01 22:08:04 +03:00
Leonid Startsev
0ffded5bac Insert correct dispatch receivers and type arguments for expression inside generated by plugin IR functions 2019-04-01 18:54:16 +03:00
Ilya Chernikov
075a902ceb Revert createClassLikeInfo method signature change, depreceate it ...
instead and make alternative method for refactored usages.
Should fix compatibility with the Spek framework plugin.
2019-04-01 17:37:33 +02:00
Ilmir Usmanov
070fb7c250 Fix test data 2019-04-01 18:19:34 +03:00
Ilmir Usmanov
d2a80e7938 Add $result to suspend functions' LVT
#KT-28535
2019-04-01 18:19:32 +03:00
Ilmir Usmanov
05937a28ee Rename result to $result
this way it does not interfere with user-defined variables.
 #KT-28535 Fixed
2019-04-01 18:19:31 +03:00
Alexander Podkhalyuzin
742ffb98ad Use indexes instead of slow directory search for script dependencies
#KT-30018 Comment
2019-04-01 17:54:28 +03:00
Natalia Selezneva
0de0321fa9 Do not call FileEditorManager.getSelectedEditor outside UI thread (KT-30130)
^KT-30130 Fixed
2019-04-01 14:28:17 +03:00
Sergey Rostov
0e0c78317d Gradle, Kotlin/JS: enable source maps by default, get it working on tests.
Publish kotlin-test-nodejs-runner separately from kotlin-gradle-plugin.
2019-04-01 08:42:10 +03:00
Mikhail Zarechenskiy
a4cbec64b7 [NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
 with new inference, but implementation was incorrect and had other
 bugs, which were fixed in 1ac25259.
 Support of suspend-conversions will be addressed later with a different
 implementation (#KT-30703)
2019-04-01 01:36:15 +03:00
Toshiaki Kameyama
4a3e4f099d KT-30451 Redundant call of selector in maxBy&minBy
Refactor maxBy & minBy: do not call selector when collection has single item
2019-03-31 05:11:05 +03:00
Ilmir Usmanov
8c8ad48152 Enable test 2019-03-30 04:18:55 +03:00
Ilmir Usmanov
ea1e72e7b4 Generate $this$<label> as receiver name instead of $receiver 2019-03-30 04:18:53 +03:00
Ilmir Usmanov
6f14dcfacb Put suspend lambda's parameters to LVT
#KT-26412 Fixed
 #KT-28534 Fixed
2019-03-30 04:18:50 +03:00
LepilkinaElena
21fe5ac415 Fix parser for linkerOpts/compilerOpts (KT-29970) (#2219) 2019-03-29 20:13:23 +03:00
Dmitry Gridin
09b58403b9 Improve "ReplaceWith" for class with generic parameter
#KT-27089 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
88b0db6dd7 ReplaceWith intention could save generic type arguments
#KT-21195 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
b0f7ddd693 Minor: refactoring replaceWith package 2019-03-29 22:35:03 +07:00
Dmitry Gridin
c343876f7c Minor: refactoring codeInliner package 2019-03-29 22:35:03 +07:00
Ilya Chernikov
16ae313b22 Apply scripting subplugin in gradle mpp plugin, so scripts could be added to mpp sources
#KT-30679 fixed
2019-03-29 15:48:45 +01:00
Ilya Chernikov
3a3ba5bd8d Fix scripts discovery in IDEA after adding optional marker extension 2019-03-29 15:47:39 +01:00
romanart
4f1ee649b0 [IR] Fix type mismatch in LocalDeclarationLowering
Note: fix is required to enable @OnlyInputTypes annotation in NI
2019-03-29 17:40:44 +03:00
Dmitriy Novozhilov
f5ca69c324 [NI] Add codegen test for IntegerLiteralType for js backend 2019-03-29 17:38:55 +03:00
Ilmir Usmanov
3e5bc674d6 Update test data 2019-03-29 17:02:44 +03:00
Ilmir Usmanov
3bfee39995 Generate debug metadata for lambdas which capture crossinline lambdas
After cold stream related fixes, we do not generate state machine until
the very last transformation of the lambda. Thus, it is safe to
generate debug metadata for that lambda.
 #KT-30694 Fixed
2019-03-29 17:02:42 +03:00
Ilmir Usmanov
f09457c569 Minor. Remove sourceFile from CoroutineTransformerMethodVisitor's parameters 2019-03-29 17:02:40 +03:00
Dmitry Petrov
2c9ed73ba8 IR: create stubs for constructor type parameters
Java constructors can have type parameters of their own:
  public class J<X extends Number> {
    public <Y extends CharSequence> J() {}
  }

When such constructors are called from Kotlin, type parameters for
constructor follow type parameters for class:
  fun test() = J<Int, String>() // <X=Int, Y=String>

Descriptor-based representation uses the same type parameters ordering.

Also, use 'withScope' in IrLazyFunction type parameters creation.
2019-03-29 16:00:56 +03:00
Dmitry Petrov
8be7f7f1f7 IR: Make sure that symbols refer to original descriptors only
If a descriptor is a WrappedDeclarationDescriptor, it SHOULD NOT be
substituted.
2019-03-29 16:00:56 +03:00
Alexander Udalov
cd6c88fa2c Do not use .kotlin_module files in reflection
Previously, we used a pretty roundabout way to load a MemberScope from a
single file facade represented by KPackageImpl, which involved going
through ModuleDescriptor, PackageFragmentProvider, PackagePartProvider
etc. The only advantage of this approach was that it sort of works
similarly as in the compiler, however mutable state in
RuntimePackagePartProvider and the fact that .kotlin_module files were
required for this to work diminished this advantage.

In this change, we load MemberScope from a KPackageImpl pretty much
directly, by using the existing method
`DeserializedDescriptorResolver.createKotlinPackagePartScope` and
caching the result in the new component PackagePartScopeCache.

 #KT-30344 Fixed
2019-03-29 13:44:23 +01:00
Alexander Udalov
7aa75ab89b Minor, update reflection tests on stdlib
Since functionFromStdlibSingleFileFacade.kt was introduced, lazyOf was
also moved to a multifile class, so we're using another function to test
that reflection on a single file package facade from stdlib works
2019-03-29 13:44:23 +01:00
Dmitriy Novozhilov
719e25c3dd [NI] Fix testdata of codegen test for IntegerLiteralType 2019-03-29 15:20:53 +03:00
Alexander Udalov
36efbc8920 JVM IR: rename JvmBackendContext.getClass and return symbol instead of descriptor 2019-03-29 12:07:11 +01:00
Alexander Udalov
b32241c967 JVM IR: build all needed stdlib symbols in JvmSymbols manually
This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
2019-03-29 12:07:11 +01:00
Roman Artemev
6b7eba485b [JS] Run all js tests in v8 2019-03-29 13:38:08 +03:00
Igor Chevdar
3838a2f648 [IR] Copied functions from IrGenerator to IrBuilder
With that the number of UNDEFINED_OFFSET should be greater reduced
2019-03-29 12:47:34 +03:00
Mikhail Zarechenskiy
1ac25259e8 [NI] Support callable references to suspend functions
#KT-30658 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
017f9aea35 [NI] Builder-inference: fix unresolved reference for variable calls 2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
d6db1a1b35 [NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
b10d19dc78 [NI] Align builder inference with the old inference
#KT-29184 Fixed
2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
1eb70ea19e [NI] Update test data related to builder-inference 2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
b033b9180b [NI] Avoid builder-inference algorithm if types specified explicitly
#KT-30620 Fixed
2019-03-29 12:31:59 +03:00
Dmitriy Novozhilov
1ac3542036 [NI] Decrease priority of Integer Literal Types in type checking
#KT-30446
2019-03-29 11:55:30 +03:00
Dmitriy Novozhilov
4a1b9dcc3c [NI] fix approximation of not denotable types in lambda's function descriptors 2019-03-29 11:54:37 +03:00
Alexander Udalov
a9de157fd4 Exclude .kotlin_builtins files when proguarding kotlin-reflect.jar
Even though kotlin-annotations-jvm.jar itself doesn't contain those
files, ProGuard pulls them from the project dependency of
:kotlin-annotations-jvm on :core:builtins. They are already present in
kotlin-stdlib.jar and are thus not needed in kotlin-reflect.jar
2019-03-29 09:45:44 +01:00
Nicolay Mitropolsky
81e84fb62e LightElementsEqualsTest: removing quotes from test name
because of KT-19019
2019-03-29 11:29:22 +03:00
Ilya Gorbunov
91c7233ed8 Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member
is called with reflection when it's available.
kotlin-stdlib-jdk7 extension still overrides that and calls
addSuppressed member statically as before.

#KT-30560 Fixed
2019-03-28 22:42:20 +03:00
Ilya Gorbunov
e6e00483d4 Put kotlin-stdlib-jdk7/8 output in test classpath when running jdk6 tests
These tests ensure how compiled jdk6 binaries work in newer JDK7/8 environment,
and most likely the stdlib-jdk7/8 artifacts will be in that environment.

This reverts test classpath change (accidentally?) made in the commit 99f2cc3d.
2019-03-28 22:42:20 +03:00
Ilmir Usmanov
3724e05b63 Fix test data 2019-03-28 22:21:25 +03:00
Denis Zharkov
66293f4024 FIR: Add @Ignore for FirResolveTestTotalKotlin
Otherwise, it leads to OOM while running on teamcity
Of course, FIR parts might be optimized there but we'll do it later
2019-03-28 17:37:36 +03:00
Mikhael Bogdanov
1a4acb1694 Fix Android test compilation: remove license from generate file 2019-03-28 15:34:46 +01:00
Denis Zharkov
3164197b88 FIR: Fix compilation for bunch file AbstractFirTypeEnhancementTest.kt.181 2019-03-28 17:32:12 +03:00
Alexander Udalov
cb7727d51a Add explicit WITH_RUNTIME to boxAgainstJava tests which need stdlib 2019-03-28 14:26:10 +01:00
Alexander Udalov
15928c5b46 Minor, take String instead of Name in IrFunction.addValueParameter
All call sites of this method construct parameters with the given string
literal name (and more such call sites are coming in subsequent commits)
and it feels like a boilerplate to wrap it into Name each time manually
2019-03-28 14:26:09 +01:00
Alexander Udalov
4cb5a4fb6d Fix misc typos in IR backends 2019-03-28 14:26:09 +01:00
Alexander Udalov
6bd4d72b81 Use more correct KProperty type in PropertyReferenceLowering
Default type is `KProperty<R>` where R is KProperty's type parameter.
This type doesn't make much sense outside the KProperty's own class
declaration. A more correct type here is `KProperty<*>`, which is the
type used in property delegates in Kotlin
2019-03-28 14:26:09 +01:00
Alexander Udalov
73383d0c20 Extract JvmSymbols to separate file, pass lazyWrapper as SymbolTable 2019-03-28 14:26:09 +01:00
Alexander Udalov
1ee4313803 Minor, introduce IrType.classOrNull 2019-03-28 14:26:09 +01:00
Alexander Udalov
dada35d785 Remove obsolete and unused descriptors and utils 2019-03-28 14:26:09 +01:00
Alexander Udalov
72ca05f86a Add kotlin-stdlib explicitly to Gradle integration test data
This is required since ed86757817, otherwise an error "Cannot access
built-in declaration ..." is reported
2019-03-28 14:25:37 +01:00
Alexander Udalov
6223c4481f Minor, disable package mismatch inspection for Groovy
This should be fine because we don't have any production Groovy code in
the project. Otherwise any build.gradle file in
kotlin-gradle-plugin-integration-tests is highlighted as yellow.

Also update inspection profile to the latest version suggested by
IntelliJ
2019-03-28 14:25:37 +01:00
Mikhael Bogdanov
9c21c71c63 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:51:28 +01:00
Sergey Rostov
4df31b2360 JPS Build: support building and running IDEA Ultimate 2019-03-28 15:48:35 +03:00
Sergey Rostov
283ad04f7c JPS Build: fix artifacts after moving dependencies repo 2019-03-28 15:48:35 +03:00
Mikhael Bogdanov
f34a2923b5 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:17:38 +01:00
Mikhael Bogdanov
0c60ff0e80 Revert "Revert "Allow tests to be run in parallel.""
This reverts commit bdad3cac
2019-03-28 13:17:37 +01:00
Nicolay Mitropolsky
944bc31f69 Making Kotlin light elements isEquivalentTo to it's origins (KT-30583) 2019-03-28 13:19:42 +03:00
Ting-Yuan Huang
1bf0354e35 TotalOrderEquals: Handle nulls 2019-03-28 11:36:22 +03:00
Denis Zharkov
b1474b11f2 FIR: Fix FirSupertypeResolverTransformer for case of redeclarations
When transforming a specific class look for the exact match
Otherwise the last redeclaration will be overwritten by the first one
2019-03-28 11:19:52 +03:00
Simon Ogorodnik
a23e4bfdf1 Fix superType resolver 2019-03-28 11:19:52 +03:00
Simon Ogorodnik
49a0b29129 Store containers per symbol, not per callable id 2019-03-28 11:19:52 +03:00
Denis Zharkov
48f0790785 FIR: Fix bunch files for 181 2019-03-28 11:14:55 +03:00
Ilmir Usmanov
59398536d7 Generate inline site's file name in metadata
Otherwise, stacktraces will have invalid file name (declaration site).
 #KT-30508 Fixed
2019-03-28 11:14:17 +03:00
Sergey Rostov
23edafcaaf JPS Build: fix kotlin-main-kts-test 2019-03-28 10:06:36 +03:00
Sergey Rostov
7b89b0abbb JPS Build: exclude :core:builtins, use prebuilt bootstrap version 2019-03-28 10:06:35 +03:00
Sergey Rostov
fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Dmitry Gridin
5802928e52 False positive "unused constructor" for local class
#KT-30637 Fixed
2019-03-28 10:52:23 +07:00
Yan Zhulanow
0b94aa4be2 Pill: Disable a couple of scripting modules
Seems like these modules use the embeddable verson of the scripting host dependency that is not built in the Pill build.
2019-03-27 22:15:26 +03:00
Ilmir Usmanov
95f4115a10 Replace global mutable object with global variable 2019-03-27 21:40:13 +03:00
Ilya Kirillov
9813b748eb Fix android linting tests due to added external annotations support 2019-03-27 20:10:46 +03:00
Ilya Kirillov
f1f6740ec9 Show warnings for Java methods with external annotations when they called from Kotlin code 2019-03-27 20:10:46 +03:00
Mikhail Glukhikh
ba9b3397d0 Make Groovy-based inspections alive again
After commit 9b5b0447, declaration of Groovy-based inspections moved
into gradle-groovy.xml. However, this makes transitive-optional
dependency between plugin.xml, gradle-java.xml & gradle-groovy.xml
which doesn't work (see IDEA-209769) and inspections aren't loaded.

This commit breaks this transitivity by declaring dependency
to gradle-groovy.xml directly in plugin.xml.
This also fixes most tests from GradleInspectionTest group.
2019-03-27 18:06:24 +03:00
Ilmir Usmanov
0fec3470dd Regenerate anonymous object if call site of non-inlineable
functional argument is suspend
Split LambdaInfo into inlineable and non-inlineable
 #KT-26925
2019-03-27 17:44:37 +03:00
Ilmir Usmanov
1c2b8e6fad Fix wrong state-machine generation if inner object is retransformed
during inlining.
 #KT-29492 Fixed
2019-03-27 17:44:35 +03:00
Denis Zharkov
7b97c2a42a FIR: Weaken requirements for all symbols to have correct FIR
Currently, some cases like library type parameters are not supported properly
2019-03-27 17:17:59 +03:00
Denis Zharkov
825218b479 Replace FirSymbolProvider::getCallableSymbols with two methods
Requesting content of classes seems to be reasonable and at the same time
more easy to implement in Composite providers: they should find
just the first class' result instead of flatmapping all of them
2019-03-27 17:17:59 +03:00
Denis Zharkov
1426341e9f FIR: Support loading deserialized declarations from JVM class files 2019-03-27 17:17:59 +03:00
Denis Zharkov
0f9d54c4dc FIR: Support deserialization of nested classes 2019-03-27 17:17:59 +03:00
Denis Zharkov
82c6b51fab Simplify initialization process for JavaClassFinderImpl
After this change, it's not required to call "initialize" with
binding trace and KotlinCodeAnalyzer that is rather useful for FIR
2019-03-27 17:17:59 +03:00
Denis Zharkov
bb1acdbe95 Minor. Extract classes deserialization from BuiltInsPackageFragment 2019-03-27 17:17:59 +03:00
Denis Zharkov
b3e5e059bb Minor. Extract FirDeserializationContext factories 2019-03-27 17:17:59 +03:00
Denis Zharkov
aec5ec89e7 FIR: Support deserialization for built-in classes content 2019-03-27 17:17:59 +03:00
Denis Zharkov
f03c5e0583 FIR: Support loading built-in top-level functions 2019-03-27 17:17:59 +03:00
Denis Zharkov
705f97cbae FIR: Support type parameters in FirTypeDeserializer 2019-03-27 17:17:59 +03:00
Denis Zharkov
1d16008eab Do not request FirProvider for built-in synthesized classes
Because currently they don't have FIR and it might fail with an exception
2019-03-27 17:17:59 +03:00
Denis Zharkov
6daf414098 Add common supertype for FirFunction and FirProperty symbols 2019-03-27 17:17:59 +03:00
Denis Zharkov
466296bca0 Remove FirLibrarySymbolProviderImpl from FirJavaModuleBasedSession
It's anyway already being created within dependencies
2019-03-27 17:17:59 +03:00
Denis Zharkov
7a19e269fd FIR: Support import-references to callables 2019-03-27 17:17:59 +03:00
Leonid Startsev
ccca813792 Allow '@Serializable' on a type usage (for kotlinx.serialization/367) 2019-03-27 12:59:53 +03:00
Leonid Startsev
a2465910a3 Instantiating of Polymorphic in Companion.serializer() for JS and Native 2019-03-27 12:59:52 +03:00
Leonid Startsev
b108dbe568 Auto-applying @Polymorphic for interfaces and serializable abstract
classes
2019-03-27 12:59:51 +03:00
Leonid Startsev
859c95c3c4 Do not enable PolymorphicSerializer without special annotation 2019-03-27 12:59:49 +03:00
Leonid Startsev
9d707cb1d9 New instantiating type for polymorphic serializer 2019-03-27 12:59:48 +03:00
Sergey Rostov
30108d4cb9 CodeConformanceTest: revert formatting committed by mistake 2019-03-27 11:23:54 +03:00
Sergey Rostov
6bf82c1053 Gradle, Kotlin/JS: fix failing tests on Windows 2019-03-27 11:23:53 +03:00
Dmitry Gridin
0237dc3f4b Fix inspections test 'Unused symbol' for enum entry 2019-03-27 12:27:48 +07:00
Dmitry Gridin
d64702d87e Remove check "unused secondary enum class constructor"
#KT-14040 Fixed
2019-03-27 11:46:31 +07:00
Dmitry Gridin
dbe0b4aa71 Unused symbol inspection should detect enum entry
#KT-30612 Fixed
2019-03-27 11:46:30 +07:00
Dmitry Gridin
ce1ec49625 Add case for private nested class/object in KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Dmitry Gridin
4495c653cb Minor: move property from UnusedSymbolInspection to ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
3e0269a95a Minor: refactoring & fix warnings in ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
26575c9389 Minor: refactoring KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Sergey Igushkin
7aed9fd592 Fix Android AP in Kapt (KT-30632), run Android Kapt IT with AGP 3.3.2
Fixes a bug introduced by the commit 6fa610156e, which led to Kapt
options being imported from Android AP options too early (immediately at
creation time for each Android variant, while the Android plugin added
the options only afterwards).

Move Android subplugin options configuration to the time & scope where
it was prior to 6fa610156e.
2019-03-27 01:08:04 +03:00
Natalia Selezneva
ca49e17157 Run indexing for new script dependencies if they are updated from notification 2019-03-27 00:00:11 +03:00
Natalia Selezneva
776a89086f Fix NoSuchElementException editing script file
^KT-30440 Fixed
2019-03-26 23:58:59 +03:00
Natalia Selezneva
224f37ca00 Fix warning in scripts that dependencies are not available
^KT-30441 Fixed
2019-03-26 23:57:20 +03:00
Mikhail Zarechenskiy
791ab05e08 Temporary fix for NI to compile against bootstrap compiler 2019-03-26 22:51:20 +03:00
Mikhail Zarechenskiy
a50cc99b01 [NI] Discriminate integer literal types as they are less specific
Plus simplify code in `ResultTypeResolver` a bit
2019-03-26 22:32:14 +03:00
Mikhael Bogdanov
e01cac4c3d Fix test data 2019-03-26 17:17:54 +01:00
Anton Bannykh
b3f1908026 JS_IR: remove stub generator from IrBuiltins 2019-03-26 17:38:44 +03:00
Anton Bannykh
ed440fc060 JS IR: remove obsolete hack from SymbolTable 2019-03-26 17:38:43 +03:00
Anton Bannykh
530804d072 JS_IR: eager IrBuiltins 2019-03-26 17:38:43 +03:00
Anton Bannykh
45f5342911 JS IR: remove obsolete hacks 2019-03-26 17:38:43 +03:00
Anton Bannykh
bba4399910 JS IR: enable IR validation 2019-03-26 17:38:43 +03:00
pyos
ef5e02da84 JVM_IR: handle Nothing and Unit more consistently.
* In blocks, discard the result of any statement that has a return
   type other than void. This was previously done by wrapping each
   statement into an "implicit Unit conversion" that was actually
   compiled down to a stack pop instead. If an expression happened to
   already have type Unit, however, such a conversion was not inserted,
   resulting in a stray reference on the stack. These conversions are
   now redundant and should probably be removed.

 * In assignments and non-exhaustive conditionals, materialize a Unit
   on the stack to avoid depth mismatches that trip up the bytecode
   validator. Because such expressions are generally used at block level
   (and, indeed, the frontend will reject a non-exhaustive conditional
   used as an expression), combined with the above change this results
   in no additional GETSTATIC opcodes, as they are immediately removed
   by the peephole optimizer.
2019-03-26 13:32:02 +01:00
Zalim Bashorov
bdad3cace9 Revert "Allow tests to be run in parallel."
This reverts commit 21d81f35
2019-03-26 15:22:40 +03:00
Alexander Podkhalyuzin
37de9a0a26 Do not call find editor outside UI thread
#KT-30117 Fixed
2019-03-26 15:18:03 +03:00
Alexander Podkhalyuzin
c9581176d7 git longpaths info for Windows users 2019-03-26 15:17:21 +03:00
Alexander Podkhalyuzin
19f6290686 Fixed selection in case of empty class body
#KT-30597 Fixed
2019-03-26 15:13:54 +03:00
Steven Schäfer
29b7da7c49 Implement support for KClass fields in annotation classes. 2019-03-26 11:54:16 +01:00
Ting-Yuan Huang
4ff2825de0 Fix an assertion for type parameters 2019-03-26 10:44:06 +03:00
Ilya Matveev
acf8a0454f Store Kotlin/Native version in properties
Previously the Kotlin/Native version was hardcoded in sources of the
Gradle plugin. Such an approach is inconvenient when we want to
build Kotlin with a custom K/N version but without changes in sources
(e.g. during CI daily runs).

This patch adds a project property `versions.kotlin-native` which can
be set during build to override Kotlin/Native version. Also this
patch gets rid of hardcoding this version in sources and stores it in
a properties file packed with the Gradle plugin in a jar.
2019-03-26 12:50:53 +07:00
Andrey Uskov
a0b8140278 Fix creation of Android source roots
#KT-30464 Fixed
2019-03-26 08:28:23 +03:00
Andrey Uskov
01a100e2ef Fix KNE in intentions
EA-124846 Fixed
2019-03-26 08:27:24 +03:00
Dmitriy Dolovov
e33ea24dc7 Fix: Native libraries are not automatically unloaded from an IDE project
Issue #KT-30490 fixed
2019-03-26 09:43:06 +07:00
Toshiaki Kameyama
3b569737ad Redundant getter/setter: reduce hightlight range to header
#KT-30559 Fixed
2019-03-25 23:27:44 +03:00
Toshiaki Kameyama
0cf641398c Suspicious 'var' property: do not report when property has default getter
#KT-30565 Fixed
2019-03-25 23:26:24 +03:00
Dmitriy Novozhilov
a26df4b4c6 [NI] Update test data for spec tests 2019-03-25 23:04:50 +03:00
Victor Petukhov
568506e5c1 Exclude warning "Remove final upper bound" for functions with override modifier
^KT-25105 Fixed
2019-03-25 22:14:26 +03:00
Steven Schäfer
9cd005fbae Create temporary library directories for J2V8.
Workaround for https://github.com/eclipsesource/J2V8/issues/39
2019-03-25 19:50:37 +01:00
Steven Schäfer
21d81f353c Allow tests to be run in parallel. 2019-03-25 19:50:37 +01:00
Dmitriy Novozhilov
ca0e66bafc [NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take
  integer literal with given value. It has two supertypes
  (`Number` and `Comparable<IntegerLiteralType>`) and have
  special rules for subtyping, `intersect` and `commonSuperType`
  functions with primitive number:

Example (assuming that ILT holds Int type):
* ILT <: Int
* Int :> ILT
* ILT intersect Int = Int
* commonSuperType(ILT, Int) = Int

#KT-30293 Fixed
#KT-30446 Fixed
2019-03-25 18:55:36 +03:00
Anton Bannykh
9c3e452396 IR: (update test data) NOT(Boolean) -> Boolean.not 2019-03-25 17:49:15 +03:00
Alexander Udalov
fff22d9372 Remove hack from JvmBuiltinOptimizationLowering related to booleanNotSymbol 2019-03-25 17:49:15 +03:00
Anton Bannykh
a382956c19 IR: use the correct descriptor for the booleanNotSymbol creation
NOTE corresponding function now has a dispatch receiver instead of a
single argument
2019-03-25 17:49:15 +03:00
Mikhail Glukhikh
0546548ff3 Raw FIR: add kotlin.Any super class if no super classes are visible 2019-03-25 17:17:14 +03:00
Alexey Tsvetkov
db6a7779b8 Check friend jars paths for exact match
Fixes CompileKotlinAgainstCustomBinariesTest.testInternalFromForeignModule
after unifying non-build-file mode and build-file mode.

Previously when the compiler was run without -Xbuild-file argument,
it was not using modules internally, so we were not checking if internal
descriptors were contained in destination dir of current module
(without -Xbuild-file we were returning false at `if (modules.isEmpty())
return false` in `ModuleVisibilityHelperImpl#isInFriendModule`).

After switching to using modules for CLI compilation,
any jar file contained in destination dir was considered friend,
because only a prefix was checked.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
0687b8eac3 Add argument to allow running compiler without sources
`-Xbuild-file` argument allows the compiler to run without
passing any Kotlin source file in arguments.
We have been using this property in
Kotlin Gradle plugin for a few important cases:
1. incremental compilation (to update caches when there are only removed files);
2. for KAPT (Kotlin sources don't make sense in context
of running APs).

We want to stop using `-Xbuild-file` in Kotlin Gradle plugin,
and avoid breaking the Gradle plugin or IC in other build-systems.

This change adds an argument to explicitly run
the compiler without specifying any Kotlin source file.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
97d3d38374 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5b7cee6221 Unify JVM compilation with and without -Xbuild-file 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
4154e97aa3 Fixes after code review 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
ada880fbad Fix non-incremental compilation 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
337ca7021d Add test for IC of non-kts scripts in Gradle 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5f54f67f70 Stop using -Xbuild-file in Gradle Plugin
#KT-27640 fixed
    #KT-27778 fixed
    #KT-27638 fixed
2019-03-25 16:39:47 +03:00
Nikita Skvortsov
9b5b0447fa only load inspections when groovy plugin is present KT-30579
otherwise, a user who disables Groovy support gets NoClassDefFound errors
2019-03-25 16:06:55 +03:00
Svyatoslav Kuzmich
0504635254 Remove -ProperIeee754Comparisons test directive duplicate 2019-03-25 15:55:06 +03:00
Svyatoslav Kuzmich
70ef0e9431 Add '-ProperIeee754Comparisons' to some tests and disable them in JS_IR 2019-03-25 12:57:26 +03:00
Dmitriy Novozhilov
d3e98bc434 [NI] Update test data for diagnostic tests 2019-03-25 12:38:37 +03:00
Dmitry Gridin
74cd53963d Fix false positive "Unused symbol" for type alias & private nested class/object
#KT-21526 Fixed
 #KT-30527 Fixed
2019-03-25 16:32:28 +07:00
Dmitry Gridin
4441b1579f Minor: refactoring UnusedSymbolInspection 2019-03-25 16:32:28 +07:00
Mikhail Zarechenskiy
3eda7c462b [NI] Add Nothing constraint if it was inferred from a call 2019-03-25 12:17:28 +03:00
Mikhail Zarechenskiy
ca894a6a71 [NI] Don't complete nested call if there's no constraints at all 2019-03-25 12:17:28 +03:00
Dmitriy Novozhilov
9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Dmitry N. Petrov
c2a0e73a79 Merge pull request #2207 from ting-yuan/ieee754improper
Label improper IEEE 754 tests.
2019-03-25 12:10:59 +03:00
Mikhail Glukhikh
73ed52a511 Get rid of binding context in FirBodyResolveTransformer 2019-03-25 12:04:28 +03:00
Dmitry Petrov
8664fc3b28 psi2ir: add test for implicit cast on values of intersection type 2019-03-25 11:50:14 +03:00
Dmitry Petrov
d4525e19dd IR: get rid of descriptors in local delegated properties rendering 2019-03-25 11:50:14 +03:00
Dmitry Petrov
12e9943f8f IR: IrCallableReference now implements IrDeclarationReference 2019-03-25 11:50:14 +03:00
Dmitry Petrov
6ca61cf347 IR: symbol for IrLocalDelegatedProperty 2019-03-25 11:50:14 +03:00
Mikhail Glukhikh
aa6ba1cd4a Introduce typeRef for FirExpression
This helps both body resolve & conversion to IR
2019-03-25 10:38:45 +03:00
Ilya Gorbunov
adeeeeee48 Fix embedded version of kotlin-stdlib in buildSrc
To avoid bringing stdlib:1.2.30, which is a transitive dependency of
com.jakewharton.dex:dex-method-list:3.0.0, into compile classpath of
the project build scripts.
2019-03-25 03:28:06 +03:00
Georgy Bronnikov
7f8cbf5434 JVM_IR: handle new JVM targets in AdditionalClassAnnotationsLowering 2019-03-25 02:18:57 +03:00
Georgy Bronnikov
0a2450bcd5 Remove duplicate definitions 2019-03-23 19:04:36 +03:00
Georgy Bronnikov
451cda79de Rewrite AnnotationCodegen for IR, removing descriptors 2019-03-23 19:04:36 +03:00
Nikolay Krasko
8bd6e1b8e4 Rename action for throwing exception from Kotlin plugin
Make the name similar to other internal actions for throwing exceptions.
2019-03-23 11:54:57 +03:00
Nikolay Krasko
0c2bdc68f1 Additional checks for listed and approve in fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
27397f4131 Use xmlId for fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fb2e5f970d Add intention/inspections/quickfix contribution quick notes 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fdf2482600 Clean up findUsages package 2019-03-23 11:53:29 +03:00
Nikolay Krasko
046a35bcda Hide concrete classes for Kotlin nodes to avoid more compatibility problems 2019-03-23 11:53:28 +03:00
Nikolay Krasko
8ab10ebda3 Minor: remove warnings in CommonIntentionActionsTest.kt 2019-03-23 11:53:28 +03:00
Ilya Chernikov
99a5885aa7 Fix ScriptingCompilerPluginTest after creating a separate jar with shared plugin code 2019-03-23 09:52:02 +01:00
Abduqodiri Qurbonzoda
636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
960797b926 Replace mistaken "bit sign" with "sign bit" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
f36a8db8eb More detailed Primitive.toChar conversion documentation 2019-03-22 21:18:27 +03:00
Ting-Yuan Huang
caccb79324 Label improper IEEE 754 tests.
Those tests don't expect ProperIeee754Comparisons.
See KT-22723 for details.
2019-03-22 11:07:35 -07:00
Alexander Udalov
87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov
c32d7ef116 Do not create additional module for built-ins in reflection 2019-03-22 14:59:03 +01:00
Alexander Udalov
ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov
8ce7742e7c Inject DeserializationConfiguration into JvmBuiltInsPackageFragmentProvider 2019-03-22 14:59:03 +01:00
Alexander Udalov
05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Alexander Gorshenev
a3b1d3ff62 Allow forward declarations bring additional IR dependencies
for modules present in metadata.
2019-03-22 16:47:08 +03:00
Alexander Gorshenev
674580fdef File annotation deserialization is triggered by the first file use 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
215da10687 A little refactoring of deserializer in preparation for the next commit. 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
3bc4616a17 Eliminated global state in IR deserializer. 2019-03-22 16:47:08 +03:00
Ilya Matveev
8f9189d61e Update Kotlin/Native: 1.2-eap-8879 2019-03-22 20:27:18 +07:00
Simon Ogorodnik
b617c40051 FIR: Update testData for fir multi-module test (rendering+body resolve) 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
85a096029c FIR: Do not fail on not calculated type 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
70e324277e FIR: Stub for super references 2019-03-22 16:25:23 +03:00
Mikhail Glukhikh
9b4fe2f991 FIR: Fix part of problems with smoke tests 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
3e7e9269ab FIR: Fix 2^n transform complexity in blocks/whens 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
6799eeb084 FIR: Add CallKind 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
a562f3db3c FIR: Re-implement call resolver with proper architecture 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
33b44870d6 FIR: Add test for constructor 2019-03-22 16:25:20 +03:00
Simon Ogorodnik
5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
2341692296 FIR: Change transform order in calls/variables to more appropriate 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
071f324738 FIR: Prevent failing on implicit typed local declarations 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
46e432df54 FIR: Prevent failing on constructor substitution 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
cd7a96e91b FIR: Proper self-type for constructor return type 2019-03-22 16:25:17 +03:00
Simon Ogorodnik
6c7be3c547 FIR: Improve diagnostic in fir unsafe 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
fedde668b3 FIR: Support captureFromArguments for ConeTypes 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
6efb22cd45 FIR: Support typing of type operators 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
79018abee2 FIR: Optimize name gathering in call resolver 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
b574693916 FIR: Introduce function to render fir element with it's type 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
24041828a9 FIR: Improve rendering for type operators 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
27687602f8 FIR: Add functions to change nullability/arguments of ConeTypes 2019-03-22 16:25:13 +03:00
Simon Ogorodnik
2118f6008a Extract TypeArgumentListMarker.all 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
d9c40c24ed FIR: Allow rendering ConeTypes 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
818701b8df FIR: Implement cycle avoidance in implicit type resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
334c42e8ab FIR: Implement deep implicit types resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
70be1c1024 FIR: Update testData, now it resolves due to call resolver 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
498fb94c37 FIR: Make FIR rendering more kotlin-styled 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
9cc6e44158 FIR: Fix value-parameters redeclare in destructuring 2019-03-22 16:25:09 +03:00
Simon Ogorodnik
9a642ef2e5 FIR: Add test for three receivers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
43315fd61d FIR: Preparation for resolve to classifiers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
307b8a1d4c FIR: Support top-level constructors 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
d817f719a4 FIR: Cleanup failures in body resolve 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
3867b255f2 FIR: Support this resolve 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
9dc6d93070 FIR: Resolve local callables 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
61eb19fbbf FIR: Make possible to return variable symbols from scope 2019-03-22 16:25:05 +03:00
Simon Ogorodnik
02079bbeb5 FIR: Update fir hierarchy, decouple member declaration from callable 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
7b6f4d8ba4 FIR: Implement implicit invoke desugaring in call resolver 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
3be1d0f946 FIR: Add tests for invoke 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
c58c1a6c4e FIR: Add operator test 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
3ac495a45d FIR: Implement basic function call resolve 2019-03-22 16:25:02 +03:00
Simon Ogorodnik
099f98f817 FIR: Expression typing and simple call resolver 2019-03-22 16:25:02 +03:00
Alexey Tsvetkov
28873e61d4 Remove unused IncrementalCompilationServicesFacade 2019-03-22 16:13:45 +03:00
Ivan Gavrilovic
493a2006f1 Remove unused SimpleDirtyData from incremental compilation
This is not used any more and all information about
the changed symbols and fqNames is passed alongside artifacts.
2019-03-22 16:13:45 +03:00
Yan Zhulanow
49d94f72d2 Revert "Kapt: Generate constant value initializers for mutable properties (KT-30164)"
This reverts commit cce2b472
2019-03-22 15:17:12 +03:00
Yan Zhulanow
9aa6a10aff Revert "Kapt: Move out the 'final' fallback for initial field values"
This reverts commit 10e53a2e
2019-03-22 15:17:12 +03:00
Yan Zhulanow
4c794b1302 Revert "Kapt: Support default constant values for constructor parameters"
This reverts commit e4d758b6
2019-03-22 15:17:12 +03:00
Ilya Chernikov
215d24e12c Fix jps build after adding new scripting jar 2019-03-22 12:26:02 +01:00
Svyatoslav Kuzmich
8429734a67 [JS IR BE] Disable -ProperIeee754Comparisons tests 2019-03-22 13:49:37 +03:00
Sergey Rostov
d210255623 Gradle: Kotlin NodeJS tests runner for single target
#KT-30528
2019-03-22 09:57:21 +03:00
Sergey Rostov
04d8568fdc Build: fix DistModelBuilder for copy tasks without destination dir 2019-03-22 09:49:34 +03:00
Sergey Rostov
d467e4209a Gradle: Basic Kotlin NodeJS tests runner
#KT-30531 Fixed
#KT-30528 Fixed
2019-03-22 09:49:32 +03:00
Sergey Rostov
b6e675f934 Gradle: move buildCompilationProcessor from target preset to target configurator 2019-03-22 09:34:11 +03:00
Sergey Rostov
46c32f2aa6 Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-22 09:34:11 +03:00
Georgy Bronnikov
e627f08614 Make wrong phase name an error 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
40079f7cae Use default argument values in PhaseConfig constructor 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
469fd20902 Warn about mistyped phase names in CLI 2019-03-21 23:32:25 +03:00
Alexander Udalov
0fb444a5d1 Move createPhaseConfig to module cli
To use things like MessageCollector to report errors/warnings related to
incorrect phase configuration flags
2019-03-21 23:32:25 +03:00
Alexander Udalov
2995be8bd2 Move usages of createPhaseConfig up to cli & test modules 2019-03-21 23:32:25 +03:00
Alexander Udalov
ddad3034da Extract createPhaseConfig from PhaseConfig
To remove dependency of PhaseConfig on CLI-dependent concepts such as
CompilerConfiguration
2019-03-21 23:32:25 +03:00
Nicolay Mitropolsky
ce40bfb259 191: Uast: making KotlinUObjectLiteralExpression provide a proper referenceNameElement (KT-30534) 2019-03-21 19:56:47 +03:00
Vyacheslav Gerasimov
e3a012cd19 Fix CodeConformanceTest after merging android-dx to prepare-deps 2019-03-21 18:15:55 +03:00
Nikolay Krasko
a5f96d6470 Minor: cleanup and remove outdated TODOs 2019-03-21 18:03:15 +03:00
Nikolay Krasko
04ecc913ef Show expression type for argument names (KT-30057)
#KT-30057 Fixed
2019-03-21 18:03:15 +03:00
Nikolay Krasko
ce2f738d9f Minor: fix Nullness deprecation warnings 2019-03-21 18:03:15 +03:00
Nikolay Krasko
77f1167773 Minor: remove bunch for KotlinSliceProvider.kt 2019-03-21 18:03:15 +03:00
Nikolay Krasko
026fc998c1 Allow resolve write action check for all plugins when enabled in registry 2019-03-21 18:03:15 +03:00
Ilya Matveev
7f08ecee39 CocoaPods: Use FQ name for the sync task during an Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
0a27699591 CocoaPods: Generate wrapper if the corresponding property enabled 2019-03-21 21:09:47 +07:00
Ilya Matveev
07c3ed5bd1 Fat frameworks: Use absolute path to lipo 2019-03-21 21:09:47 +07:00
Ilya Matveev
1f94224b52 Fat frameworks: Don't fail if plist has no device capabilities
The PlistBuddy fails when deleting an entry from a file which
has no such entry. This patch workarounds this by ignoring
PlistBuddy's exit code.
2019-03-21 21:09:47 +07:00
Ilya Matveev
300acafc63 CocoaPods: Don't generate a fat framework for a single device target 2019-03-21 21:09:47 +07:00
Ilya Matveev
c079543e7d Fat frameworks: Improve header merging
1. If header contents are identical, don't write all of them
   in the resulting header. Just write content of one of the
   headers without #ifdef-s.
2. Use #elif to separate declarations for different platforms.
2019-03-21 21:09:47 +07:00
Ilya Matveev
8b8028e10d Fat frameworks: Run PlistBuddy only once for all commands
Previously we executed the PlistBuddy utility for each command
separately. This patch gathers all commands and run PlistBuddy
for all of them at once.
2019-03-21 21:09:47 +07:00
Ilya Matveev
3f04bf119e Fat frameworks: Improve error messaging 2019-03-21 21:09:47 +07:00
Ilya Matveev
1c7866e81f CocoaPods: Require Gradle wrapper for Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
2e60b18570 CocoaPods: Rename: simple framework -> regular framework 2019-03-21 21:09:47 +07:00
Ilya Matveev
fd825e0601 CocoaPods: Detect the real path to Gradle wrapper.
Previously the CocoaPods plugin assumed that Gradle wrapper
is located in the project directory. But the project may be
a part of multiproject build and wrapper may be located in
the root directory of such a build. Also the build may not
have the wrapper at all.

This patch looks for the wrapper in the root directory of the
build and runs the local Gradle if there is no wrapper.
2019-03-21 21:09:47 +07:00
Ilya Matveev
4985b24b07 CocoaPods: Don't use realpath utility in script phase
The realpath utility may not be found on the user's machine
so we get rid of using it.
2019-03-21 21:09:47 +07:00
Ilya Matveev
5b4d83e770 CocoaPods: Build fat arm32/arm64 frameworks
Building for old iOS devices requires us to provide fat
arm32/arm64 frameworks. This patch uses the fat framework
task to build such a framework and provides it to Xcode
if a build for a device is executed. In other cases
(building for iOS simulator or macOS) simple frameworks
are still used.
2019-03-21 21:09:47 +07:00
Ilya Matveev
6621414d72 Provide a task for building a fat framework
This patch adds a task taking several iOS frameworks and
building one fat framework on their basis.

Issue #KT-24184 Fixed
2019-03-21 21:09:47 +07:00
Roman Artemev
538512fa2a [JS IR BE] Fix unbound symbols after deserialization
* restore broken psi2ir invariant
2019-03-21 16:26:51 +03:00
Dmitriy Novozhilov
58189c79ca Add regression test for PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic
#KT-20507
2019-03-21 16:09:46 +03:00
Alexey Tsvetkov
42aa708f16 Minor: remove JVM-specific assertion from common test code 2019-03-21 15:23:48 +03:00
Ilya Chernikov
c56382a62b Move common idea and compiler parts of the scripting plugin to the new jar 2019-03-21 12:02:29 +01:00
Nicolay Mitropolsky
af63fcb3be KotlinElementActionsFactory: adding empty annotations without parenthesises 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
1669b6aa9f 192: KotlinElementActionsFactory: changing parameters could add annotations 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
6b91b7cce5 192: KotlinElementActionsFactory: support for keeping existing parameters on signature change 2019-03-21 12:47:26 +03:00
Nicolay Mitropolsky
713f73e414 Uast: getMaybeLightElement returns class for annotation primary constructor 2019-03-21 12:46:28 +03:00
Nicolay Mitropolsky
7b590055f8 Uast: resolveCallToDeclaration cleanup 2019-03-21 12:46:27 +03:00
Nicolay Mitropolsky
90894176f9 Uast: stop resolve parts of fqn to the full-name target 2019-03-21 12:46:27 +03:00
Dmitry Gridin
403801b0b3 Fix exception when add import
#KT-30524 Fixed
2019-03-21 16:35:43 +07:00
Dmitry Gridin
3ce002dd6e Improve: optimize ConvertMemberToExtension 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e8eb9c3d58 Minor: refactoring ConvertMemberToExtensionIntention 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e11072b8c2 Improve: add more cases for MoveVariableDeclarationIntoWhen
#KT-30499 Fixed
2019-03-21 16:32:41 +07:00
Dmitry Gridin
c84ff1d8b1 Inspection "MoveVariableDeclarationIntoWhen" should inline variable declaration 2019-03-21 16:31:29 +07:00
Dmitry Petrov
f9119c001e JVM_IR: generate file class without members if it has metadata 2019-03-21 11:23:51 +03:00
Dmitry Petrov
a5c95275f0 IR: get rid of descriptors in DumpIrTree 2019-03-21 11:23:51 +03:00
Dmitry Petrov
9a82f926a1 IR: descriptor-less rendering of IR elements (work in progress) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
cd138bc022 IR: IrSymbolVisitor 2019-03-21 11:23:51 +03:00
Dmitry Petrov
110a15d395 IR: drop IrFile.fileAnnotations (it already has annotations anyway) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
b42aa39033 IR: drop IrTypeAlias 2019-03-21 11:23:51 +03:00
Dmitry Petrov
e49eae528c IR: don't use descriptors in rendering (work in progress)
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Toshiaki Kameyama
bd3d5a9dbb Use withIndex intention: fix false positive for destructuring declaration
#KT-30341 Fixed
2019-03-21 10:59:01 +03:00
Toshiaki Kameyama
cbdc79fcda Add when branches: remove unnecessary blank line
#KT-30426 Fixed
2019-03-21 10:58:11 +03:00
Mikhail Glukhikh
c1984d92ff Introduce FirFile.fileSession, get rid of most FirElement.session usages 2019-03-21 10:29:58 +03:00
Roman Artemev
698594b14d [IR] Fix classifier equality for Local classes 2019-03-20 23:45:03 +03:00
Vyacheslav Gerasimov
4cd95256b6 Build: Add tasks to clean repo directory and legacy repo directories 2019-03-20 23:38:36 +03:00
Ilya Chernikov
43e4dbb0b1 Fix tests after unblocking exceptions on loading script definitions
should be temporary, proper solution needed in the future
2019-03-20 21:19:25 +01:00
Ilya Chernikov
ffd1633e3e Write tests for dynamic versions with ivy and maven resolvers
and refactor tests
#KT-27051 fixed
this commit is just a confirmation of the fix: either it worked
from the beginning, or was fixed by some unrelated change
2019-03-20 21:19:24 +01:00
Ilya Chernikov
f2bddce4fd Refactor script definition loading error handling
reenable logging of failures
suppress loading from failed contributors
2019-03-20 21:19:24 +01:00
Ilya Chernikov
dd3ac74bd2 Refactor ivy resolver
add support for artifacts with type an classifier
use ibiblio resolver by default - it is designed for working with maven central
add test, but disable it - see comments for the reason and todos
2019-03-20 21:19:24 +01:00
Ilya Chernikov
fc9a6dec7e Add optional suffix to the script template markers
add suffix to the markers in the repo
#KT-28593 fixed
2019-03-20 21:19:24 +01:00
Ting-Yuan Huang
79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
7e4d33be24 ConstantExpressionEvaluator: make evaluate*naryAndCheck public 2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
f352a4dcd4 IrBuiltIns: factoring out operator names
so that they can be used in other contexts.
2019-03-20 21:02:55 +01:00
Ilya Gorbunov
8021f9c4af Clarify toSortedMap and sortedMapOf docs (KT-30100)
Remove the note about iteration order so that toSortedMap is not misused
for sorting map entires with the comparator inconsistent with key equality.
2019-03-20 22:08:03 +03:00
Vyacheslav Gerasimov
c650206f54 Build: Fix hardcoded paths in artifacts for JPS build 2019-03-20 21:29:25 +03:00
Vyacheslav Gerasimov
d9b149fd2f Build: Rename kotlinBuildRepo -> kotlinBuildLocalRepo 2019-03-20 21:29:24 +03:00
Vyacheslav Gerasimov
a1a30ad041 Build: Rename nodeJS -> nodeJSPlugin 2019-03-20 21:29:22 +03:00
Vyacheslav Gerasimov
128b70e2c4 Build: Add property to enable dependency task output verification
Enabled on teamcity by default, disabled locally by default,
kotlin.build.dependency.output.verification may be used to specify explicitly
2019-03-20 21:29:21 +03:00
Vyacheslav Gerasimov
a543dee39a Build: Get jps-build-test directly from maven 2019-03-20 21:29:19 +03:00
Vyacheslav Gerasimov
d9d6e9b10a Build: Merge AndroidSdkDependencies.kt & intellijDependencies.kt 2019-03-20 21:29:18 +03:00
Vyacheslav Gerasimov
98a7c5264c Build: Move intellij-sdk contents to prepare-deps 2019-03-20 21:29:16 +03:00
Vyacheslav Gerasimov
139286bf44 Build: Merge prepare-deps/android-dx to intellij-sdk 2019-03-20 21:29:14 +03:00
Vyacheslav Gerasimov
fc8be48fa8 Build: Improve intellij-sdk repo up-to-date check time & layout
Up-to-date check is very heavy for intellij repo due to artifact size.
If module directory in repo is written only by one task we can assume
that task if up-to-date if target directory exists.
2019-03-20 21:29:13 +03:00
Vyacheslav Gerasimov
f890cab145 Build: Rename custom-dependencies -> dependencies 2019-03-20 21:29:11 +03:00
Vyacheslav Gerasimov
07b0129a6a Build: Build android-dx and intellij-sdk repo to dependencies/repo
From KOTLIN-CR-2801 reasons to move:
 - I've changed repo layout and build process in incompatible way and decided to change location
 - It was difficult to find and annoying to locate, it was very deep and long path
 - I think dependencies/repo path is very easy to remember and find
 - It was called dependencies some time ago
2019-03-20 21:29:09 +03:00
Vyacheslav Gerasimov
ef159a4fc9 Minor: Fix typo in build error message 2019-03-20 21:17:27 +03:00
Vyacheslav Gerasimov
9f64e0fa69 Build: Remove intellijEnforceCommunitySdk flag, use currentIde instead
Setup ultimate repositories only when currentIde is Intellij
2019-03-20 21:17:27 +03:00
Yan Zhulanow
683c2b0434 Don't use experimental features of Android Extensions in 'testAndroidDaggerIC()'
AndroidDaggerProject uses the @Parcelize functionality that was experimental until 1.3.30. Now it is not.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
44f752d1c5 Always attach kotlin-android-extensions-runtime library
@Parcelize is now enabled by default, and it requires the runtime library.
Enabling it for all clients is a temporary solution.
In future, the runtime library will be split to two separate artifacts.
2019-03-20 20:52:23 +03:00
Jake Wharton
8e23555660 Make parcelize a non-experimental feature
It was already being added to the feature list by default, but was only enabled when isExperimental was true.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
c40cc76ad3 Minor: Fix error message, add missing article 2019-03-20 20:52:23 +03:00
Yan Zhulanow
c7678a27e5 Kapt: Fix star indentation in stub Javadoc (KT-30163) 2019-03-20 20:52:23 +03:00
Yan Zhulanow
e4d758b614 Kapt: Support default constant values for constructor parameters 2019-03-20 20:52:23 +03:00
Yan Zhulanow
10e53a2e73 Kapt: Move out the 'final' fallback for initial field values 2019-03-20 20:52:22 +03:00
Yan Zhulanow
cce2b472bf Kapt: Generate constant value initializers for mutable properties (KT-30164) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
ce13982cfc Kapt: Use constant value references where possible in property initializers 2019-03-20 20:52:22 +03:00
Yan Zhulanow
66754e62da Kapt: Always use raw types for annotation parameter types (KT-30346) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
90e84aa15d Remove isAtBreakpoint checks as it's not valid in all cases
For example, when we stopped at a breakpoint and then did a 'step over' action, we aren't at that breakpoint any more.
However, we still can evaluate things.
2019-03-20 20:52:22 +03:00
Yan Zhulanow
bbdeb3efac Avoid using 'loadClass()' as it doesn't cache the results 2019-03-20 20:52:22 +03:00
Yan Zhulanow
e79ee1ba8e Use caching 'findClass()' instead of raw 'Class.forName()' call in async stack trace provider (KT-30268) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
b2a47027fb Move eval4j to idea 2019-03-20 20:52:22 +03:00
Yan Zhulanow
65da7ba971 Add the whole content of the Apache 2.0 license to the Kotlin repo 2019-03-20 20:52:21 +03:00
Yan Zhulanow
6d90e850ff Refactoring: Incapsulate method calls into ExecutionContext 2019-03-20 20:52:21 +03:00
Yan Zhulanow
5d156c2edb Debugger: Fix indentation in code fragments 2019-03-20 20:52:21 +03:00
Yan Zhulanow
a1e5ce2c8b Don't activate Kotlin async stack trace provider in Java sources (KT-30318) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
754a7bc554 Code fragment analysis: analyze parents if there's no sensible scope for the default element (KT-29179) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
97f94700b9 Don't file an exception if we failed to calculate the anonymous class name 2019-03-20 20:52:21 +03:00
Yan Zhulanow
fd3fab5bcc Minor: Fix formatting in DebuggerClassNameProvider 2019-03-20 20:52:21 +03:00
Yan Zhulanow
d0a61fa7e2 Fix breakpoint handling in Kotlin scripts (KT-29234) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
4870b2e6ba Fix asmTypeForAnonymousClassOrNull(): it should not throw an exception if a class name isn't found 2019-03-20 20:52:20 +03:00
Yan Zhulanow
3f92451fde Explicitly check for the callable class availability
'@NotNull' annotation generates a not-null assertion that caused exceptions to throw from 'asmTypeForAnonymousClassOrNull()'.
2019-03-20 20:52:20 +03:00
Yan Zhulanow
77c2a5c87c Debugger: Fix missing NOP in empty 'when' header (KT-29189) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
ba0989801a Debugger: Show captured outer this in lambdas (Variables view) (KT-30220) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
723f8df23e Hide '$delegate' variables in Kotlin variables mode 2019-03-20 20:52:20 +03:00
Yan Zhulanow
570421b831 Fix lambda evaluation on JDK 9-11 (KT-29423) 2019-03-20 20:52:20 +03:00
Sergey Igushkin
af7c35b5c7 Revert profile_settings.xml accidentally deleted in ffdd43b8 2019-03-20 19:56:50 +03:00
Jake Wharton
6ee987fa2e Add intrinsics for compile-time computing trimMargin/trimIndent
These only apply when the receiver can be resolved to a constant and the margin prefix, if specified, is also a constant.
2019-03-20 17:25:29 +01:00
Alexey Tsvetkov
2ec6ab92b5 Clear outputs before compiling with in-process/out-of-process execution mode
Issue #KT-30492 Fixed
2019-03-20 17:11:37 +03:00
Ivan Gavrilovic
b2ad82b7d2 Incremental KAPT - invalidate obsolete types
Once set of dirty symbols is computed, filter these types
when they are requested from the JavaFileManager. This is accomplished
by tracking all declared types in the sources and generated sources.
It is not necessary track types in generated class files, as these will
be removed before the APs are incrementally run.

Motivation: APs (e.g. Dagger) may use Elements.getTypeElement(String)
to determine if type is already present, and if it is, they will not
generate it. Therefore, whenever generated sources is invalidated, types
it defines need to be filtered in the JavaFileManager.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:13 +03:00
Ivan Gavrilovic
2f3d234516 Incremental KAPT - handle inherited annotations
Handle annotations with @Inherited. This is important for
the aggregating APs, as the current implementation passes all sources
annotated with claimed aggregating annotations.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:10 +03:00
Ivan Gavrilovic
9f14daa682 Incremental annotation processing with KAPT
Add support for incremental annotation processors in KAPT. These
processors conform to https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing
specification.

Support is provided by using javac compiler APIs and
recording the source file structure. At runtime, processors
are instrumented with custom Filer that is used to keep track of generated
files. In order to support classpath changes, stub generation task is
used to generated a list of changed FQCNs, and this is simply used by KAPT.
Both worker and non-worker mode are supported.

 #KT-23880
2019-03-20 16:43:02 +03:00
Dmitry Gridin
600a955a51 Fix false positive "Unused import" for type alias
#KT-29977 Fixed
2019-03-20 20:28:22 +07:00
Dmitry Gridin
7e4b3ceede Minor: refactoring KotlinUnusedImportInspection 2019-03-20 20:28:22 +07:00
Toshiaki Kameyama
4e3d13fcee Change to star projection: do not suggest in arguments or receiver
#KT-23259 Fixed
2019-03-20 20:12:06 +07:00
Nikolay Krasko
73396b5018 Log connection problems during fetching release date 2019-03-20 14:23:43 +03:00
Nikolay Krasko
9a5b902766 Use special request for fetching plugin release date in exception reporter 2019-03-20 14:23:43 +03:00
Nikolay Krasko
a0d015dd4d Minor: document shortening and smart enter use resolve in write action 2019-03-20 14:23:42 +03:00
Nikolay Krasko
1060a24221 Don't allow to resolve anything within write action 2019-03-20 14:23:42 +03:00
Dmitry Petrov
7e4688da93 psi2ir: add test for reference to var with non-accessible setter 2019-03-20 11:57:57 +03:00
Dmitry Petrov
21dbe2e7e7 IR: symbolName mangling for IrTypeParameter
(original author: Alexander Gorshenev)
2019-03-20 11:57:57 +03:00
Roman Artemev
206e5d30d9 Regenerate protobuf 2019-03-20 11:57:57 +03:00
Dmitry Petrov
c86ef5da53 psi2ir: update testData for property references 2019-03-20 11:57:57 +03:00
romanart
5b5f3a7468 [IR] Fix classes TypeParameter [de]serialization 2019-03-20 11:57:57 +03:00
Dmitry Petrov
9f48695dde psi2ir: no unbound field symbols in delegated property references
#KT-30323 Fixed
2019-03-20 11:57:57 +03:00
Dmitry Petrov
15918fc475 IR: deprecations 2019-03-20 11:57:57 +03:00
Dmitry Petrov
bd9c5645cd IR: fix property reference symbol binding for generic properties 2019-03-20 11:57:57 +03:00
Dmitry Petrov
8b4dab7c25 JS_IR: fix property name generation 2019-03-20 11:57:57 +03:00
Dmitry Petrov
04fad012a0 IR: IrPropertySymbol introduced, some code cleaned up
#KT-30304
2019-03-20 11:57:57 +03:00
Anton Yalyshev
1bc35b1b0c updated TipsOfTheDay pics, as New Project Wizards got new names 2019-03-20 11:23:18 +03:00
Ting-Yuan Huang
f6cf434650 when: emit switch for String if possible
Effectively, the following when structure:

  when (s) {
    s1, s2 -> e1,
    s3 -> e2,
    s4 -> e3,
    ...
    else -> e
  }

is implemented as:

  when (s.hashCode()) {
    h1 -> {
      if (s == s1)
        e1
      else if (s == s2)
        e1
      else if (s == s3)
        e2
      else
        e
    }
    h2 -> if (s == s3) e2 else e,
    ...
    else -> e
  }

where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
      s4.hashCode() == h2.

A tableswitch or lookupswitch is used for the hash code lookup.

Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
Dmitriy Dolovov
1a9ed88be4 Don't publish CLion/AppCode plugins to IDEA channel at plugins.jetbrains.com 2019-03-20 12:19:30 +07:00
Sergey Igushkin
914f7c8719 KT-27675: Following the Gradle Java plugin, enable Kapt cache by default
As the Gradle Java plugin considers Java annotation processing cacheable
with any annotation processors, we can enable build cache by default
for Kapt tasks, leaving the opt-out flag just in case.

Issue #KT-27675 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
ffbd0e8af1 Automatically detect Android Java 1.8 source+target (KT-21030)
When Android Java 8 desugaring is set as follows (or above):

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

set the Kotlin JVM target to 1.8

Issue #KT-21030 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
70db646576 Fix wrong commits picked for master: restore changes from KOTLIN-CR-2817 2019-03-19 21:22:35 +03:00
Sergey Igushkin
ec3e5c6959 Revert "Use KotlinTarget.disambiguationClassifier for task & configuration names" 2019-03-19 21:10:26 +03:00
Roman Artemev
2ed29d8869 [IR BE] Use pure IrType instead of KotlinType
* clean up code
2019-03-19 20:09:07 +03:00
Ilya Chernikov
1823ba1c48 Fix deserialization of the compiled script
#KT-29741 fixed
2019-03-19 17:11:52 +01:00
Ilya Chernikov
b395cb120a Implement import test witch caching
reproduced KT-29741
plus some tests refactoring
2019-03-19 17:11:52 +01:00
Ilya Chernikov
931b1c66d8 Fix equality and serializability of scripting data, fix relevant caching behaviour 2019-03-19 17:11:52 +01:00
Ilya Chernikov
7a4d369c9f Extend script cache tests, revealing that cache doesn't work in fact 2019-03-19 17:11:52 +01:00
Ilya Chernikov
6e55116519 Relocate packages that could be possibly used in the scripts themselves
#KT-30210 fixed
2019-03-19 17:11:52 +01:00
Sergey Igushkin
91ce7ef5ca Introduce new Gradle plugin org.jetbrains.kotlin.js
This is the Gradle plugin that does not rely on the
Java model and uses the same Kotlin model
(target – compilation – source set) as MPP does.

Also add JS DCE support for this plugin.

Issue #KT-5756 Fixed
Issue #KT-13256 Fixed
Issue #KT-16355 Fixed
Issue #KT-20156 Fixed
Issue #KT-29284 Fixed
2019-03-19 16:32:11 +03:00
Sergey Igushkin
03b74343c8 Refactor & minor fix in software component logic of AbstractKotlinTarget
* Create the sources JAR for both Gradle 4.7+ and versions below 4.7
* Set `componentName` in all branches of `createKotlinVariant`
2019-03-19 16:24:37 +03:00
Sergey Igushkin
5b5316214f Apply user-defined attributes in single-platform plugins
The attributes applied by the user to the target and its compilations
were ignored in single-platform plugins while the target was not a part
of the API.

Since the user will be able to access and configure the target, we need
to apply the attributes to the relevant configurations in the same way
as in MPP.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
8fa1630695 Add the single-platform target's 'components' to 'project.components' 2019-03-19 16:24:37 +03:00
Sergey Igushkin
a19e8fe03e Use KotlinTarget.disambiguationClassifier for task & configuration names
In MPP, the disambiguation classifier is always the same as the target
name. In single-platform projects, the task name suffix should be empty
for the JVM targets. Using the `disambiguationClassifier` for this
purpose is more consistent with other usages of
`disambiguationClassifier`.

The target name for all existing single-platform plugins will be just
'kotlin'.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
4e711f9a0c Introduce single-project extensions with static types for Kotlin target 2019-03-19 16:24:37 +03:00
Sergey Igushkin
b3eef05e6e Fix user-specified attributes in Android targets (KT-27714)
Ensure that custom target and compilation attributes are copied to
relevant configurations of Android targets as well, which did not happen
because of Android variants (and missing simple apiElements,
runtimeElements) and Android compilations being created late in the
project configuration.

Issue #KT-27714 Fixed
2019-03-19 16:24:36 +03:00
Sergey Igushkin
6fa610156e Create and configure Android compilations earlier (KT-29964)
As Android variants are created after the project is evaluated,
the build script and plugins might have added some item handlers to the
domain object containers which are yet to be filled.

To ensure that those handlers see properly configured compilations and
their tasks, we need to add a compilations to the container only after
it has been properly configured.

Also, the `forEachVariant` handler is already executed in
`afterEvaluate`, and there seems to be no need to wrap our
code working with variants in `afterEvaluate`.

Issue #KT-29964 Fixed
2019-03-19 16:24:36 +03:00
Toshiaki Kameyama
e06514c945 Smart completing anonymous object: follow code style settings (KT-29572)
#KT-29572 Fixed
2019-03-19 16:09:07 +03:00
kenji tomita
e1f26ffc74 Remove spaces between accessor and its parameter list in formatter (KT-30393)
#KT-30393 Fixed
2019-03-19 16:09:07 +03:00
Toshiaki Kameyama
0acecb4936 Minor: fix caret behaviour in arg template test
#KT-29398 Fixed
2019-03-19 16:09:07 +03:00
Alexander Udalov
29d32b213e Cleanup modules descriptors.jvm, descriptors.runtime
Fix warnings and inspections
2019-03-19 13:01:03 +01:00
Alexander Udalov
b89d7029b2 Reformat modules descriptors.jvm, descriptors.runtime
Also remove several unused files (BuiltinOverridabilityCondition.kt,
PackageMappingProvider.kt)
2019-03-19 13:01:02 +01:00
pyos
39adfcced1 Add more comments to PropertyReferenceLowering 2019-03-19 12:00:29 +01:00
pyos
ed298c48b7 Unmute a test fixed by a combination of PR #2151 and #2184 2019-03-19 12:00:29 +01:00
pyos
6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00
pyos
8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
pyos
330c4648cb Implement property references in JVM_IR 2019-03-19 12:00:29 +01:00
Dmitry Gridin
43be01bbc8 Fix false positive 'Introduce import alias' on this/super 2019-03-19 16:42:41 +07:00
Dmitry Gridin
1626bc4751 Optimize "Introduce import alias"
Relates to #KT-30462
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ccb1ae13ea Fix local conflicts in 'Introduce import alias' 2019-03-19 16:42:41 +07:00
Dmitry Gridin
9659453351 Improve: intention "Introduce Import Alias" should suggest new names for the new alias
#KT-30456 Fixed
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ff34788eb3 Minor: refactoring KotlinNameSuggester 2019-03-19 16:42:41 +07:00
Nicolay Mitropolsky
0d2426b081 191: Uast: isJvmElement check added to the newly added conversion methods (EA-125791) 2019-03-19 12:24:44 +03:00
Mikhail Glukhikh
a07502374e Rename (style): russian "С" to english "C" 2019-03-19 12:23:47 +03:00
pyos
82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
pyos
7e8db4cc4a Refactor InnerClassesLowering 2019-03-19 09:20:41 +01:00
Toshiaki Kameyama
a2adfd0cc0 Nested lambda has shadowed implicit parameter: do not report when lambda is in scope function
#KT-30173 Fixed
2019-03-19 10:37:47 +03:00
Dmitry Gridin
daf8df9e4b Fix flaky test AddReturnToUnusedLastExpressionInFunction/Nothing 2019-03-19 11:29:53 +07:00
Ilya Matveev
fd9ac54d81 Improve deprecation warning about usage of old binary DSL
Previously we showed list of all deprecated APIs even if a user uses
only one of them. This patch changes the behaviour and shows only
APIs really used by the user. An approach similar to the one used by
SingleWarningPerBuild in applied here.

Issue #KT-29998 Fixed
2019-03-19 11:19:49 +07:00
Ilya Matveev
bfb0d738b1 Disable C2 compiler for HotSpot VM when running K/N tools 2019-03-19 11:19:48 +07:00
Ilya Gorbunov
b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov
b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Ilya Gorbunov
bc444df20c Clarify behavior of MutableSet.add (KT-29373) 2019-03-19 03:12:04 +03:00
Alexander Gorshenev
e9ad9273b1 Proper KotlinIr protobuf location. 2019-03-18 23:29:44 +03:00
Dmitriy Novozhilov
d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Ilya Gorbunov
25b3f62767 Clarify yield/yieldAll function suspending the caller behavior 2019-03-18 18:01:39 +03:00
Mikhail Glukhikh
16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh
741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Mikhail Glukhikh
a334ca6224 Move FIR total kotlin resolve in IDE test into performance group 2019-03-18 14:48:50 +03:00
Anton Yalyshev
71eb540eaf improved english in wizard's descriptions. also now user knows about project's build system from its name 2019-03-18 14:15:35 +03:00
Svyatoslav Kuzmich
1d6cd90043 [JS IR BE] Clean up compiler driver api
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself
2019-03-18 14:13:28 +03:00
Svyatoslav Kuzmich
e302f63d9a [JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup.
Now we use proper close world module with runtime+stdlib module
as pre-serialized klib.
2019-03-18 14:13:28 +03:00
Ilmir Usmanov
d154cf9a59 Fix test data 2019-03-18 14:04:04 +03:00
Ilmir Usmanov
c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov
7956ef18b2 Generate RETURN instead of ARETURN if (cross)inline suspend lambda returns Unit
#KT-30073 Fixed
2019-03-18 14:04:02 +03:00
Ilmir Usmanov
cc9a0041e0 Check number of suspensions in crossinline tests 2019-03-18 14:04:01 +03:00
Ilmir Usmanov
df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Maxim Shafirov
ca35c9e2ff Update copyright dates 2019-03-18 12:52:27 +03:00
Nikolay Krasko
b0156bc5db Minor: cleanup KotlinTypeCheckerTest.java 2019-03-18 11:56:20 +03:00
Burak Eregar
db4144426a Fix SimplifiableCallChain inspection quick fix removes comments for intermediate operations 2019-03-18 11:35:32 +03:00
Toshiaki Kameyama
8728bc0820 Convert to scope function: also convert binary expression
#KT-30228 Fixed
2019-03-18 11:18:23 +03:00
Toshiaki Kameyama
e340af51df Add "Rename class to containing file name" intention
#KT-25262 Fixed
2019-03-18 11:09:09 +03:00
Toshiaki Kameyama
39016594b1 Replace return with 'if'/'when': don't drop return label
#KT-30414 Fixed
2019-03-18 09:46:10 +03:00
victor.petukhov
9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov
29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +03:00
Alexander Gorshenev
51e862e793 Fix file descriptor unlimited growth. 2019-03-16 13:45:45 +03:00
victor.petukhov
5fc0d85b3c Regenerate FIR tests (include tests for implicit nothing as type parameter) 2019-03-16 00:41:58 +03:00
Alexander Udalov
2539873492 Remove CommonBackendContext.getClass
This function is unused in backend.common (and actually throws exception
in Native), therefore it makes sense to move it down to subtypes
2019-03-15 19:27:48 +01:00
Alexander Udalov
e13b8eb039 Remove CommonBackendContext.getInternalFunctions
Similarly to getInternalClass, move to subclasses
2019-03-15 19:27:48 +01:00
Alexander Udalov
bd694105e9 Remove CommonBackendContext.getInternalClass
Move to subclasses: getJvmInternalClass, getJsInternalClass and
getKonanInternalClass (in Kotlin/Native). The advantage of this is that
this API need not be shared between backends any longer, which makes
sense because implementation details differ across platforms
2019-03-15 19:27:48 +01:00
Alexander Udalov
4ab1916ebf Cleanup Symbols and JvmIr.JvmSymbols 2019-03-15 19:27:47 +01:00
Alexander Udalov
e9c2bc81aa Remove lateinitIsInitializedPropertyGetter, introduce static check function
This will be helpful in JVM IR tests without stdlib where it's not
necessary to have 'isInitialized' in dependencies
2019-03-15 19:27:47 +01:00
Alexander Udalov
c730de13df Minor, add missing copyright to compiler modules 2019-03-15 19:27:46 +01:00
Alexander Udalov
9ca7719d1f Minor, inline obsolete and deprecated createFunctionSymbol
Also undeprecate 'createSymbolForScopeOwner' and make it private
2019-03-15 19:07:16 +01:00
Alexander Udalov
0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
victor.petukhov
70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Roman Artemev
1f98eaa27b [JS IR BE] Fix Callable reference with vararg
* Update tests
2019-03-15 19:21:38 +03:00
Roman Artemev
a2d65e8a60 [IR] Code clean up 2019-03-15 19:21:38 +03:00
Roman Artemev
95821313e3 [IR BE] Get rid of usages of descriptor-based IrType utils 2019-03-15 19:21:38 +03:00
Roman Artemev
238f1b2b06 [IR] * Implement isSubtypeOfClass and commonSuperclass based on pure Ir
* Implement type strict equality check
     * Move type checkers into Ir
     * Implement strict Fqn-based classifier equality checker
2019-03-15 19:21:38 +03:00
Simon Ogorodnik
e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Mikhail Glukhikh
0d976a4870 FIR: forbid supertype resolve in local classes 2019-03-15 18:31:49 +03:00
Abduqodiri Qurbonzoda
35c6f09886 Implement coerce extension functions for unsigned types 2019-03-15 17:46:48 +03:00
Abduqodiri Qurbonzoda
a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda
814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Anton Bannykh
a4c693ec29 [JS IR BE] updated inliner to the most recent version
FunctionInlining.kt commit 364b7ae72a :
364b7ae72a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt
2019-03-15 14:56:33 +03:00
Anton Bannykh
0249e33f3e IR: add skipExternalProperties flag to PropertiesLowering
Same problem as in deafult argument lowering: JVM and JS semantics differ.
Same solution: skip in common lowerings, process if needed in platform ones.
2019-03-15 14:56:31 +03:00
Anton Bannykh
9a56b0e6d6 [JS IR BE] Reorder phases in order to extract a common prefix 2019-03-15 14:56:31 +03:00
Anton Bannykh
017cd3a0f6 IR: more verbose unsatisfied phase requirement reporting 2019-03-15 14:55:10 +03:00
Anton Bannykh
9dd9ef1cf0 IR: Make Phaser complain about duplicate phase names
(instead of silently throwing away all but the last phase
with the same name)
2019-03-15 14:55:10 +03:00
Anton Bannykh
bb1660c688 JS: better error reporting for V8 runner
In case of stack overflow both the code and the memory release
caused an exception. Only the latter was shown, and it did
not contain much useful information.
2019-03-15 14:55:10 +03:00
Anton Bannykh
b61a520da9 [JS IR BE] unmute tests 2019-03-15 14:07:53 +03:00
Svyatoslav Kuzmich
41a45d98e7 [JS IR BE] Regenerate & unmute tests 2019-03-15 13:53:23 +03:00
Svyatoslav Kuzmich
0f07209490 [JS IR BE] Remove unnecesary println from tests 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
d203e062bb [JS IR BE] Remove package from operators.kt 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
7b3416c99f [JS IR BE] Disable @library test for JS IR
@library is an internal annotation used in legacy stdlib to expose
declarations written in JS.

IR BE based stdlib will not include JS code thus annotation will not
be supported.
2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
41bbd4d2d6 [JS IR BE] Support property accessors with @JsName 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
c7f1238a07 [JS IR BE] Add @JsName to inheritanceInNativeClass.kt test to avoid relying on mangling 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
9230b70294 [JS IR BE] Minor dynamic refactoring 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
94dc6ff24a [JS IR BE] Disable legacy test 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
4005b5ce10 [JS IR BE] Fix fqNames in moveBodilessDeclarationsToSeparatePlace 2019-03-15 13:53:20 +03:00
Dmitry Gridin
d333a0ad4e Allow "Create class" action in return statement
#KT-22137 Fixed
2019-03-15 17:33:14 +07:00
Dmitry Gridin
41cfb4e2ed Minor: refactoring createClassUtils.kt 2019-03-15 17:33:14 +07:00
Dmitry Gridin
220cb95b85 Move caret to class name after creating it from "CreateFromUsage" action
Relates to #KT-24631
2019-03-15 17:27:06 +07:00
Alexander Gorshenev
0c8f0a433d Copying kotlin-native fix
* commit 575cbf48c3
    | Author: SvyatoslavScherbina <Svyatoslav.Scherbina@jetbrains.com>
    | Date:   Thu Mar 14 14:25:10 2019 +0300
    |
    |     Optimize DescriptorReferenceDeserializer again (#2755)

to common ir deserializer.
2019-03-15 12:48:48 +03:00
Anton Bannykh
826b9d935d JS/JS IR: split testing tasks for the two backends
Run jsTest for current backend, and jsIrTest for the JS-IR backend tests
2019-03-15 12:19:33 +03:00
Dmitriy Novozhilov
b07aed7a00 [NI] Fix determination of completion mode. #KT-30406 Fixed 2019-03-15 10:39:50 +03:00
Dmitriy Novozhilov
1c92c22dee [NI] Add support ExpectedTypeFromCast to new inference. #KT-30405 Fixed 2019-03-15 10:39:29 +03:00
Dmitriy Novozhilov
9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Dmitriy Novozhilov
0ba163d70b [NI] Fix testdata of inference lambdas with SAM conversions
Tetdata was broken in 3e147af3c0
#KT-27565 related
2019-03-15 10:39:11 +03:00
Mark Punzalan
3585792b3b Break out bytecodeText/conditions tests into smaller tests for if/while/do-while. 2019-03-15 08:32:22 +01:00
Mark Punzalan
9eb11ff3e9 Generate conditional jumps with optimizations for loops, if possible. 2019-03-15 08:32:22 +01:00
Mikhail Glukhikh
2aaf13e734 FIR: fix test compilation for 181 patchset 2019-03-15 10:24:15 +03:00
Ilya Gorbunov
7a038f1330 Refactor sanitizeStackTrace function to spare allocations
Use Arrays.copyOfRange instead of List.subList.toArray.
2019-03-15 06:26:59 +03:00
Alexander Gorshenev
ee7660065b Changes after code review 2019-03-15 03:03:08 +03:00
Alexander Gorshenev
f8be378a65 Port of native fix to common deserializer
* commit 347e2dadc6
    | Author: Igor Chevdar <igor.chevdar@jetbrains.com>
    | Date:   Wed Mar 6 12:51:40 2019 +0300
    |
    |     [Serializer] More graceful fix of parents
2019-03-15 03:03:08 +03:00
Alexander Gorshenev
cc93239397 Commonized native and js IR serialization infrastructure 2019-03-15 03:03:08 +03:00
Mikhail Glukhikh
909a5fd32d FIR: implement named arguments #KT-24081 Fixed 2019-03-14 18:30:13 +03:00
Mikhail Glukhikh
d65b30dd82 Fix corner-cases in ConeTypeContext / FIR builder / FIR enhancements
This fixes a pack of FIR smoke diagnostic tests, now all of them pass
Related to KT-29962
2019-03-14 18:30:12 +03:00
Mikhail Glukhikh
8ea347653b Remove some FirElement.session usages in FIR resolve 2019-03-14 18:23:25 +03:00
Mikhail Glukhikh
63cb8bb1a7 Remove FirElement.session usages from RawFirBuilder & around
Related to KT-30187
2019-03-14 18:23:11 +03:00
Mikhail Glukhikh
e6bb920a1d FIR Java: support Kotlin extension overriding: at last, #KT-29937 Fixed 2019-03-14 18:18:40 +03:00
Mikhail Glukhikh
d00d078b4f FIR Java: implement "appendErasedType" thus adding predefined signatures
Related to KT-29937
2019-03-14 18:18:20 +03:00
Mikhail Glukhikh
43d06f85e3 Add raw type comparison for Java (J2K mapping is taken into account)
NB: Java enhancement scope does not perform substitution, so we could
have some duplicates inside "type enhancement" testData

Related to KT-29937
2019-03-14 18:17:58 +03:00
Mikhail Glukhikh
f5e2cd2ac4 No override check in FirClassUseSiteScope, fix nasty substitution bug
This fixes MPP override test
(see mppFakeOverride in FirMultiModuleResolveTestGenerated)
2019-03-14 18:17:44 +03:00
Mikhail Glukhikh
de14dd1b9f FIR type enhancements: more accurate * handling 2019-03-14 18:17:31 +03:00
Mikhail Glukhikh
c708171add FIR type enhancements: support annotations for default parameter values
Related to KT-29937
2019-03-14 18:17:17 +03:00
Mikhail Glukhikh
5f3a01c25a Get rid of FirElement.session usages inside fir:java 2019-03-14 18:16:58 +03:00
Mikhail Glukhikh
6c12fabf74 FIR: make JavaClassEnhancementScope use-site, get rid of scope providers
Related to KT-29937
2019-03-14 18:09:41 +03:00
Mikhail Glukhikh
e0348b56a1 FIR type enhancement: extract indexed Java type qualifiers 2019-03-14 18:08:16 +03:00
Mikhail Glukhikh
be412baf9f FIR type enhancement: fold flexible types when it's possible
Related to KT-29937
2019-03-14 18:08:01 +03:00
Mikhail Glukhikh
3d29b31177 FIR type enhancements: handle class qualifiers, add new JSR 305 tests
Related to KT-29937
2019-03-14 18:07:46 +03:00
Mikhail Glukhikh
6c8aba8039 FIR: support callable symbols in dependencies provider
This breaks mppFakeOverrides test because of bug in FIR fake overrides
2019-03-14 18:07:32 +03:00
Mikhail Glukhikh
33fb3d154b FIR Java model: support static members & enum entries
Related to KT-29218
2019-03-14 18:07:17 +03:00
Mikhail Glukhikh
0434a55ea2 FIR: add initial JSR 305 tests for Java type enhancements 2019-03-14 17:57:28 +03:00
Mikhail Glukhikh
14fb495ab6 Support Java constructors in FIR (related to KT-29218) 2019-03-14 17:57:13 +03:00
Mikhail Glukhikh
484e67727f JavaClassifierTypeImpl: convert to Kotlin & cleanup 2019-03-14 17:56:57 +03:00
Mikhail Glukhikh
21d19f4144 JavaClassifierTypeImpl.java -> kt 2019-03-14 17:56:41 +03:00
Mikhail Glukhikh
fb788dc4c0 Fix null Java type argument problem & add relevant test 2019-03-14 17:56:23 +03:00
Mikhail Glukhikh
7563a98999 FIR type enhancement: make J2K mapping and changed handling more exact
Related to KT-29937
2019-03-14 17:56:05 +03:00
Mikhail Glukhikh
9bb2278fd4 Simplify JavaClassEnhancementScope: callback -> TypeInSignature 2019-03-14 17:55:47 +03:00
Mikhail Glukhikh
226cf8e42c FIR Java types: handle wildcard types correctly
Related to KT-29937, KT-29218
2019-03-14 17:55:25 +03:00
Mikhail Glukhikh
6c79b184c0 FIR Java types: add Kotlin/Java mapping & mutability enhancements
Related to KT-29937
2019-03-14 17:55:10 +03:00
Mikhail Glukhikh
e7ac88d326 FIR: implement Java fields (in provider, type enhancement, scopes)
Related to KT-29218
2019-03-14 17:54:53 +03:00
Mikhail Glukhikh
4255c9f774 Add FIR enhancement tests, fix some exceptions / problems around them
Test data and tests themselves are based on
compiler/testData/loadJava/compiledJava
2019-03-14 17:52:33 +03:00
Mikhail Glukhikh
f31faafd72 Introduce initial version of FIR Java type enhancement
Java type enhancement is performed by a special scope kind
Java FIR dump was added for multiplatform tests to look at enhancements
Overrides, J2K mapping, special cases does not work yet

Related to KT-29937
2019-03-14 17:51:00 +03:00
Mikhail Glukhikh
060bd1b464 Add separate FirJava elements (class, method, parameter, type reference)
Related to KT-29218
2019-03-14 17:40:04 +03:00
Mikhail Glukhikh
109f1938f6 FIR: make simplification around class substitution scope 2019-03-14 17:39:49 +03:00
Mikhail Glukhikh
8ac34e1a0f Reformat: context (Java resolve) 2019-03-14 17:39:25 +03:00
Denis Zharkov
6740cdabac Get rid of ConeAbbreviatedType::directExpansion
It becomes necessary after extracting supertypes resolution into a
separate phase.
But also it looks reasonable because direct expansion actually depends
on the module we are looking from.
2019-03-14 17:06:45 +03:00
Denis Zharkov
92defc2ae3 Extract supertypes resolution into a separate FIR phase 2019-03-14 17:06:45 +03:00
Steven Schäfer
3f4c5c8d53 Resolve type aliases when looking for default arguments to actual methods.
Change-Id: I059093c1af32fcd7a2de36c25160c352d6f03a3c
2019-03-14 14:59:34 +01:00
Toshiaki Kameyama
dfd3947856 Keyword completion: add 'fun' after 'suspend' (KT-29038)
#KT-29038 Fixed
2019-03-14 15:35:45 +03:00
Toshiaki Kameyama
fd262bcd8d Smart completion: fix anonymous object code style (KT-29572)
#KT-29572 Fixed
2019-03-14 15:35:44 +03:00
Toshiaki Kameyama
6acf3ad629 Add "arg" postfix template (KT-29398)
#KT-29398 Fixed
2019-03-14 15:35:44 +03:00
Ilmir Usmanov
0c0f035241 Set default value of releaseCoroutines in TypeSignatureMapping to true 2019-03-14 15:06:07 +03:00
Dmitriy Dolovov
5af2cbeacd Fix MPP wizard tests
Issue #KT-30003 fixed
2019-03-14 18:11:25 +07:00
Nicolay Mitropolsky
69ea0175a2 KotlinElementActionsFactory.createAddAnnotationActions: adding @field annotation target for targetless annotations (KT-18459) 2019-03-14 10:59:00 +03:00
Dmitry Gridin
3bf0fb8957 Intention “Introduce import alias” shouldn't modify other files
#KT-30412 Fixed
2019-03-14 12:09:41 +07:00
Dmitry Gridin
179dfce3a8 Fix false positive for type error in intentions AddReturnTo...
Relates to #KT-25272
2019-03-14 10:52:59 +07:00
Georgy Bronnikov
d7ce24410d Remove descriptors from SharedVariablesManager 2019-03-13 23:13:41 +03:00
Ilya Gorbunov
edc766af56 Document exception thrown for negative n in take/takeLast/drop/dropLast
#KT-29151
2019-03-13 17:58:19 +03:00
Ilya Gorbunov
6bc7c06038 Add samples for is(|Not|NullOr)Empty and is(|Not|NullOr)Blank functions 2019-03-13 17:58:05 +03:00
Ilya Gorbunov
ed878be1f7 Docs: reword summaries for a couple of experimental annotations 2019-03-13 17:53:37 +03:00
Ilya Gorbunov
ffe8b4419c Docs: use consistent kotlinlang.org url in references 2019-03-13 17:53:37 +03:00
Dmitry Gridin
479e812bbc Fix false positive "Redundant lambda arrow" inspection
#KT-29590 Fixed
 #KT-19462 Fixed
 #KT-29124 Fixed
2019-03-13 20:57:30 +07:00
Sergey Igushkin
49ee197578 Ignore deprecated configurations in a test with Gradle 5.3+ (KT-30378) 2019-03-13 16:39:56 +03:00
Sergey Igushkin
0830977d16 Exclude the configurations of source sets from dependency resolution
The `*Api`, `*Implementation`, `*CompileOnly`, and `*RuntimeOnly`
configurations of a `KotlinSourceSet` must not be resolved directly, as
they lack attributes needed to choose a Kotlin MPP variant, and they
must not be candidates in variant-aware resolution of a project
dependency either.

With Gradle 5.3, these configurations failed to resolve anyway, as they
had no proper `org.gradle.usage` attribute, and the disambiguation
rules of the 'java-base' plugin conflicted with the Kotlin rules.
2019-03-13 16:39:55 +03:00
Sergey Igushkin
7c139e059a Fix publishing with Gradle 5.3 (KT-30379)
In Gradle 5.3, there was a change to the internal logic of publishing
`SoftwareComponent`s with the 'maven-publish' plugin, and,
simultaneously, a new public API was introduced for user-defined
software components, see https://github.com/gradle/gradle/pull/8399

Earlier, the 'maven-publish' plugin used the Gradle `Usage` attribute
values to arrange the dependencies of a software component's
`UsageContext`s into the Maven scopes. Now that mechanism doesn't work
and a `SoftwareComponent` must provide an explicit mapping of the
variants to POMs by using the `SoftwareComponentFactory.adhoc` API.

However, the new API lacks some features we need to properly publish an
MPP, such as adding a component to another one as a variant, so we still
create old-style software components under the hood and
then wrap them into the new API (and then wrap the adhoc components once
again).

We also continue to use the old-style components for Kotlin-specific
logic like finding a target in another project that a dependency
resolved to, as the components produced by the new API lack crucial
information that is used in the logic, like references to
`KotlinCompilation`s.

Issue #KT-30379 Fixed
2019-03-13 16:39:55 +03:00
Sergey Igushkin
eedb8b0ae1 Run tests against Gradle 5.3 RC2 2019-03-13 16:39:55 +03:00
Sergey Igushkin
17df1ce096 Support a Gradle Usage value 'java-api-jars'
The support on our side involves:

* using the new value for Maven publishing, as the 'maven-publish'
plugin now expects 'java-api-jars' for dependency scopes ordering where
it used to expect 'java-api'

* accepting the new value in KotlinUsages compatibility and
disambiguation rules
2019-03-13 16:39:55 +03:00
Nikolay Krasko
491fb40dd3 Fix INRE from find usages activated with Ctrl + Click (EA-137655)
Only Ctrl + Click is affected as find usages from Alt + F7 is a different
action (`GotoDeclarationAction` is `DumbAware`, but `ShowUsagesAction` is not).
2019-03-13 15:30:06 +03:00
Dmitriy Dolovov
40474bee3f Update Kotlin/Native project templates
Use modern "binaries" DSL
2019-03-13 18:53:47 +07:00
Dereck Bridie
a02ad76b16 KT-25272: Unused expression as last expression of normal function should have quickfix to add "return" Fixed 2019-03-13 17:53:48 +07:00
Burak Eregar
e02877d1dc Disable WhenWithOnlyElse by default. 2019-03-13 13:25:00 +03:00
Abduqodiri Qurbonzoda
a0e2ca669b Write docs for primitive types conversions 2019-03-13 13:14:37 +03:00
Nikolay Krasko
76d4a2fd17 Minor: cleanup org.jetbrains.kotlin.idea package 2019-03-13 12:55:02 +03:00
Nikolay Krasko
08b93b0ba0 Make internal mode controlled from execution arguments 2019-03-13 12:55:00 +03:00
Nikolay Krasko
8e7145d6ff Allow to pass addition system properties to runIde task 2019-03-13 12:54:58 +03:00
Toshiaki Kameyama
bee7736baf Find Java usage of @JvmField declared in primary constructor (KT-18322)
#KT-18322 Fixed
2019-03-13 12:54:55 +03:00
Mads Ager
8b566fda76 JVM_IR: Perform asm type conversion for string concat arguments.
This ensures that the Unit instance is loaded when string
concatenation contains a sub part that is a call of a Unit
return-type method.
2019-03-13 10:01:21 +01:00
Ting-Yuan Huang
013ad4b8e4 JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from
JvmBuiltinOptimizationLowering into codegen so that appropriate debug
info (and a NOP) can be inserted.

Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
2019-03-13 08:48:20 +01:00
Ting-Yuan Huang
6bbb0269b1 IR: Set when.origin for IrIfElseImpl
Change-Id: I38510b59e3dc936baadbfe3ef2702990493815e5
2019-03-13 08:48:20 +01:00
Ilya Chernikov
18198987a3 Restore jvmTarget 1.6 for scripting libraries that could be used externally
#KT-29319 fixed
2019-03-13 08:47:17 +01:00
Mikhael Bogdanov
1e3277d0e6 Set proper origin for cascaded if expression 2019-03-13 08:27:07 +01:00
Max Medvedev
1040665471 add missing && 2019-03-13 09:09:19 +03:00
Dmitry Gridin
8f9c536a82 Change priority of the quick fixes
#KT-30233 Fixed
2019-03-13 11:07:05 +07:00
Dmitry Gridin
3d66147685 Minor: fix warnings & refactoring 2019-03-13 11:07:05 +07:00
Abduqodiri Qurbonzoda
ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Alexander Udalov
584137121b Do not write version requirements in metadata for lambdas
#KT-29790 Fixed
2019-03-12 18:53:08 +01:00
Alexander Udalov
e942bff4a2 Reformat module 'serialization', fix inspections 2019-03-12 18:53:08 +01:00
Alexander Udalov
a269e9bc00 JVM IR: fix typo in condition in KCallableNamePropertyLowering
This however makes testLocalFunctionName fail because currently
isSubclassOf (incorrectly) returns false and therefore an anonymous
class is generated and the name is taken from there. The name there is
"box$OK" which is incorrect. The isSubclassOf issue is KT-28198 and will
be fixed separately; the incorrect name issue will be investigated later
2019-03-12 18:49:41 +01:00
Mikhael Bogdanov
dd59deb977 Mute failed test 2019-03-12 13:33:35 +01:00
Mikhail Zarechenskiy
f95fdb3cf1 Advance bootstrap to include fix in NI about Nothing-expressions
See 1594c1fc for details. Also, remove fix from f07fed9a.
2019-03-12 15:27:12 +03:00
Alexey Tsvetkov
efe93176ab Fix inter-project IC for kaptGenerateStubs task with AGP
In Android projects we need to detect modules by inspecting jar files
in order to find build history files.
However `useModuleDetection` property was not set up correctly for
KaptGenerateStubsTask.

    #KT-29761 Fixed
2019-03-12 15:10:49 +03:00
Nikolay Krasko
1bfd6705cc Minor: fix junit.framework.Assert deprecation warnings 2019-03-12 14:28:31 +03:00
Nikolay Krasko
213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Harry Billinis
6ba134b1be Better names suggestion for constant like reference expressions (KT-28485)
Code was simplified after @igorwojda suggestions

 #KT-28485 Fixed
2019-03-12 14:28:31 +03:00
Nikolay Krasko
7886095327 Prevent constant reporting from released plugin versions in EA (KT-30388)
Apply a compromise strategy between "no report" and "always report".
Report only for several days after release and don't bother users afterwards.

 #KT-30388 Fixed

All exceptions still can be found in Idea Log.
2019-03-12 12:13:24 +03:00
Nikolay Krasko
7f07782095 Allow to throw plugin exception when plugin version is patched 2019-03-12 12:05:21 +03:00
Nikolay Krasko
ddc9d0eba1 Allow to override plugin version with system property
Need this during testing and development.
2019-03-12 12:05:21 +03:00
Steven Schäfer
9ea39d2b7c Fix return types for while loops. 2019-03-12 09:33:00 +01:00
Steven Schäfer
4c8425caeb Run ExpectDeclarationsRemoving in the JVM_IR backend. 2019-03-12 09:29:00 +01:00
Abduqodiri Qurbonzoda
82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Alexander Udalov
d12e5ddafc Generate bytecode for array intrinsics manually
#KT-28285 Fixed
2019-03-11 18:36:10 +01:00
Alexander Udalov
dd0b087b92 Add StackValue.put(InstructionAdapter) for convenience 2019-03-11 18:36:09 +01:00
Alexander Udalov
f9be21c935 Report warning on @Synchronized on inline methods
Until KT-27310 is supported, we warn users that this has no effect.

 #KT-29884 Fixed
2019-03-11 18:32:44 +01:00
Alexander Udalov
76aff56b04 Remove unneded parameter of ResolverForProjectImpl 2019-03-11 18:31:59 +01:00
Alexander Udalov
0ccf7345e3 Move JsAnalyzerFacade from ide-common to js.frontend
To be used in diagnostic tests now, and as a replacement for
TopDownAnalyzerFacadeForJS in the future
2019-03-11 18:31:59 +01:00
Dmitry Gridin
6b8547f57b Fix "Specify type explicitly" intention with generic type
#KT-27641 Fixed
 #KT-30252 Fixed
2019-03-11 23:38:19 +07:00
Dmitry Gridin
57040f6f9d Minor: refactoring & fix warnings 2019-03-11 23:38:19 +07:00
Toshiaki Kameyama
f1e66d0654 Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
2019-03-11 19:33:17 +03:00
Ilya Gorbunov
42120b93b8 KT-29151 Provide specialized string samples for all drop/take functions
These include:
- take, takeLast, takeWhile, takeLastWhile,
- drop, dropLast, dropWhile, dropLastWhile
2019-03-11 19:30:59 +03:00
Burak Eregar
991e739693 KT-29151 Fix the problematic pages - CharSequence.take() & String.take() 2019-03-11 19:30:58 +03:00
Toshiaki Kameyama
0f45e3d238 Fix false positive for HasPlatformType with member extension on 'dynamic'
#KT-29812 Fixed
2019-03-11 19:28:08 +03:00
Mikhail Zarechenskiy
1594c1fc6b [NI] Don't consider Nothing-constraint as proper to complete call
Follow-up of 9b3e17f0. There we decided to complete call if a type
 variable from a return type has proper lower constraints, now we refine
 this rule wrt `Nothing`-like constraints to avoid inferring type variables
 to Nothing, which is quite useless

 #KT-30370 Fixed
2019-03-11 19:14:29 +03:00
Dmitriy Dolovov
77ab15ec65 Add a hint to the message about not found Kotlin Gradle plugin version
Issue #KT-19788
2019-03-11 18:15:05 +07:00
Dmitry Gridin
6ba0a182bb Fix false positive "Insert explicit type arguments" intention
#KT-16139 Fixed
2019-03-09 14:01:04 +07:00
Dmitry Gridin
212e573c26 Minor: refactoring InsertExplicitTypeArgumentIntention 2019-03-09 14:01:04 +07:00
Ilya Gorbunov
6ae5e91930 Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility
instead of removed multipart facade class. It contains only non-inline
functions of the latter.
2019-03-08 23:35:40 +03:00
Ilya Gorbunov
db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Ilya Gorbunov
f07fed9afa Temporary fix to avoid runtime exception due to incorrect inferred type
Caused by: java.lang.ClassCastException:
kotlin.collections.EmptySet cannot be cast to java.lang.Void
  at org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitorKt.findSafelyReachableReturns(CoroutineTransformerMethodVisitor.kt:984)

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2019-03-08 23:35:32 +03:00
Ilya Gorbunov
1f83a48839 Advance bootstrap to 1.3.40-dev-310 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
be6c2d8c7d Implement min max minOf maxOf functions for unsigned types (KT-30035) 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
bf83f0e070 Implement contains extension functions for URanges (KT-26378) 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
cb587893c0 Implement sorting extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
c42dbb34ca Implement drop, take & filter extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
abb275775e Implement map, flatMap, zip & groupBy extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
503264b996 Implement folding extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
7695b5e575 Implement sum extension function for UArrays (KT-28779) 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
690e35f11a Implement reduce, forEach, min & max extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
114736c09b Implement reversing extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
92cd84682c Implement first, last & single extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
299fac8e2d Implement conversion from typed array and collection to UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
bbaabb90e4 Implement any, all, none, count & sumBy functions for UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
512d986006 Implement index-requesting extension functions for UArrays
Contains implementations of `indexOf`, `lastIndexOf`, `indexOfFirst`,
`indexOfLast`, `lastIndex` and `indices` extension functions.
2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
876dff6d22 Implement fill extension function for UArrays (KT-28339) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6b92190726 Implement component(N) functions for destructuring UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
550c74bb6b Implement binarySearch method for UArrays (KT-27262) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6cd9858147 Specialize plus operator for UArrays (KT-28397) 2019-03-08 23:34:32 +03:00
Nikolay Krasko
8977d0e26d Setup Missing API inspection 2019-03-08 19:13:07 +03:00
Alexander Udalov
d8b364ea40 Mark KAnnotatedElement.hasAnnotation as experimental
#KT-29041 Fixed
2019-03-08 14:57:01 +01:00
Kerooker
a342f844b8 Implements KAnnotatedElement.hasAnnotation()
This commit fixes KT-29041, by adding a convenience method to verify if a certain `KAnnotatedElement` has an annotation or not
2019-03-08 14:53:51 +01:00
Ilya Matveev
3a33f68fc9 Fix compilation after refactoring MPP extension access 2019-03-07 20:04:59 +03:00
Kirill Shmakov
fe9236f91e Add key 'module' into interop definitions file 2019-03-07 19:42:32 +03:00
Ilya Matveev
607288b089 Update Kotlin/Native: 1.2-eap-8365 2019-03-07 18:36:56 +03:00
Ilya Matveev
45c2489a53 CocoaPods: Replace '-' with '_' in podspec name 2019-03-07 18:08:50 +03:00
Ilya Matveev
230f11df42 CocoaPods: Refactor framework name mangling 2019-03-07 18:08:50 +03:00
Ilya Matveev
226da18e3a CocoaPods: Rename user-visible: Cocoapods -> CocoaPods 2019-03-07 18:08:50 +03:00
Ilya Matveev
7ac7ea58f8 CocoaPods: Rename podspec task: generatePodspec -> podspec 2019-03-07 18:08:50 +03:00
Ilya Matveev
2f45206268 CocoaPods: Replace dynamic dummy framework with a static one 2019-03-07 18:08:50 +03:00
Ilya Matveev
1f2f0244a1 Refactor kotlin multiplatform extension access 2019-03-07 18:08:50 +03:00
Ilya Matveev
52c9c74f52 CocoaPods: Use regex to split quoted compiler args 2019-03-07 18:08:50 +03:00
Ilya Matveev
3b80ffe1d6 CocoaPods: Add 'native' in the plugin ID
kotlin-cocoapods -> kotlin-native-cocoapods
org.jetbrains.kotlin.cocoapods ->
org.jetbrains.kotlin.native.cocoapods
2019-03-07 18:08:50 +03:00
Ilya Matveev
3cd20fab75 Support -Xstatic-framework in DSL
In Kotlin/Native 1.3.30 EAP1 an ability to build
a static ObjC framework has been added. This patch
adds support for this feature in the kotlin-multiplatform
plugin.
2019-03-07 18:08:50 +03:00
Ilya Matveev
60026c8aa1 Update Kotlin/Native: 1.3.30-eap-8089 2019-03-07 18:08:50 +03:00
Ilya Matveev
21a69b0e5b CocoaPods: Basic support
This patch adds a separate Gradle plugin allowing
a user to import Kotlin/Native modules in Cocoapods
projects and use Cocoapods dependencies in Kotlin
code via cinterop.

The plugin when applied does the following things:

1. Add a framework binary for each supported (iOS
   or macOS) platform in the project.

2. Add a Cocoapods extension allowing one to configure
   Cocoapods dependencies of the project.

3. Create cinterop tasks for each dependency from the
   previous point. The tasks are added for main
   compilations of each supported platform.

4. Add a task to generate a podspec-file which includes
   the framework from the point 1, script to
   build it and dependencies from the point 2.

So the Cocoapods import procedure is the following:

1. A user runs `./gradlew generatePodspec`. The plugin
   creates a podspec-file with all dependencies.

2. The user adds a dependency on this podspec in his Podfile
   and runs `pod install`. Cocoapods downloads dependencies
   and configures user's XCode project.

3. The user runs XCode build. XCode builds dependencies and then
   runs Gradle build. Gradle performs interop processing and
   builds the Kotlin framework. Compiler options and header
   search paths are passed in the Gradle from XCode environment
   variables. After that the final application is built by XCode.

Issue #KT-30269 Fixed
2019-03-07 18:08:50 +03:00
Ilya Matveev
2999cdd3e0 Avoid resolution ambiguity for cinterop DSL
Earlier we used to have two methods: cinterops(Container.() -> Unit) and
cinterops(Action<Container>). It's OK for Groovy DSL but causes resolution
ambiguity in Kotlin DSL. This patch removes the first overload to avoid
this situation. The second overload still can be called in Kotlin DSL
as `cinterops { ... }`.
2019-03-07 18:05:54 +03:00
Ilya Matveev
8a012c83e5 Deprecate old DSL method for binary configuration
In 1.3.20 a new binaries DSL was introduced. This
patch deprecates old DSL methods used for binary
configuration in 1.3.0 and 1.3.1x.

Issue #KT-29998 Fixed
2019-03-07 18:05:54 +03:00
Ilya Matveev
b971a91a8c Add main interop libraries in test interop dependencies
Earlier we added interop libraries built for a main compilation
in dependencies of a corresponding test compilation. But we didn't
add them in dependencies of interop libraries built for the test
compilation. It caused cinterop failures when the test compilation
has interop libraries. This patch fixes it by adding main interop
libraries in dependencies of test ones.

Also earlier interop libraries of test compilations were
unintentionally added in apiElements and publication. This patch
fixes this issue too.

Issue #KT-30290 Fixed
2019-03-07 18:05:54 +03:00
Dmitriy Novozhilov
b681e4bda3 NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773) 2019-03-07 17:50:30 +03:00
Roman Elizarov
4f532a7c05 Invoke probeCoroutineResumed on each unroll of the frame from heap
Fixes KT-29997
2019-03-07 17:04:11 +03:00
Dmitriy Novozhilov
9b50d31169 NI. Fix StackOverFlow in type approximation. #KT-30021 Fixed 2019-03-07 16:24:53 +03:00
Dmitriy Novozhilov
cbf1d773f7 NI. Coerce return type of lambda function descriptor to Unit. #KT-30242 Fixed 2019-03-07 14:36:09 +03:00
Dmitriy Novozhilov
77c98bef4d Fix recursion in contract declaration analysis. KT-26386 Fixed
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov
d0462859bf Minor. Fix reporting diagnostic in contract with callable reference 2019-03-07 14:35:13 +03:00
Alexander Udalov
518b03125c Support JVM target versions up to 12
#KT-26240 Fixed
2019-03-07 11:42:31 +01:00
Alexander Udalov
9f75fd0d62 Minor, remove confusing logic from GenericReplChecker 2019-03-07 11:42:31 +01:00
Alexander Udalov
c7c377e1b1 Use JvmTarget.DEFAULT instead of JVM_1_6 where applicable 2019-03-07 11:42:31 +01:00
Pavel Nikitin
a6b7aa3257 KT-30322 Memory leak in CompilationSourceSetUtil (#2158)
Issue #KT-30322 Fixed
2019-03-07 12:57:48 +03:00
Anton Yalyshev
b3cbd7d5bd update names for Kotlin Gradle DSL wizards as well 2019-03-07 10:44:58 +03:00
Dmitriy Dolovov
dbc66bd0ae Native: Support 2- and 3-digit Kotlin/Native versions 2019-03-07 12:59:27 +07:00
Nikolay Krasko
ec0084ef61 Minor: remove outdated ant mentioning 2019-03-06 18:16:30 +03:00
Nikolay Krasko
878e56f2ab Minor: clean deprecated warnings in KotlinTestFinder.kt 2019-03-06 18:16:29 +03:00
Nikolay Krasko
606a7766af Make colours for lambda return hints similar to other hints (KT-30203)
Works for IntlliJ and Darcula themes but doesn't work with High Contrast
2019-03-06 18:16:29 +03:00
Nikolay Krasko
0e990ae01b Update inserting algorithm to preserve order for tags with the same offset 2019-03-06 18:16:29 +03:00
Nikolay Krasko
06dbe1ec09 Avoid adding DYNAMIC_PROPERTY_CALL highlighting twice
Tested in idea/testData/highlighter/Dynamic.kt
2019-03-06 18:16:29 +03:00
Nikolay Krasko
1cc59f4b18 Mute false positive duplicate warnings in highlighting in 191 2019-03-06 18:16:28 +03:00
Mikhael Bogdanov
6a893ba196 Regenerate test data 2019-03-06 16:12:43 +01:00
Steven Schäfer
eec25dbea2 Avoid true condition generation for do while loop, since it confuses the Java verifier.
Change-Id: I96eca6623a91a8365090768f42c6e865b612e1cc
2019-03-06 16:04:23 +01:00
Alexander Udalov
59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov
ea21cda4df Reformat MultifileClassCodegen, fix inspections 2019-03-06 15:33:45 +01:00
Alexander Udalov
670b06ae97 Minor, ignore tests on typeOf without reflection on Android
Currently all Android tests are run with kotlin-reflect in the
classpath, so these tests can't succeed
2019-03-06 15:25:21 +01:00
Sergey Igushkin
7d9405a9cb Warning for Kotlin plugins loaded multiple times (KT-30276)
Print a warning with an instruction on how to fix this. Don't warn about
different versions and duplicate plugins in composite build.

Issue #KT-30276 Fixed
2019-03-06 16:05:02 +03:00
Sergey Igushkin
42a7c87e2e Setup conf2ScopeMappings for 'api' configuration with 'maven' plugin
The 'java' plugin doesn't expect the 'api' configuration to exist (it
is only introduced by the 'java-library' plugin) and doesn't map it
to the compile scope when publishing with the legacy 'maven' plugin.

This commit adds the missing conf2ScopeMapping for 'api' -> 'compile'
2019-03-06 16:04:08 +03:00
Sergey Igushkin
803af3e040 Fix ConcurrentModificationException iterating over tasks (KT-29971)
Issue #KT-29971 Fixed
2019-03-06 16:04:08 +03:00
Sergey Igushkin
4aaa1a8067 Rewrite MPP dependencies in POMs of single-platform projects (KT-27059)
This is needed to ensure that POMs of single-platform Kotlin projects
depending on MPP libraries contain dependencies (Maven coordinates)
of the platform-specific modules of the libraries.

The mechanism and rationale are the same as in KT-28482

Issue #KT-27059 Fixed
2019-03-06 16:04:07 +03:00
Sergey Igushkin
51279a8195 Add a switch that disables dependencies rewriting in POMs
This covers the cases when a user knows what they do and doesn't want
anything to do any changes to the POMs, e.g. they want to manually
replace all of the dependencies, so they need the original dependencies.
2019-03-06 16:04:07 +03:00
Sergey Igushkin
2f8baf6715 Refactor: move all tools for MPP dependencies rewriting to a utils file 2019-03-06 16:04:07 +03:00
Natalia Selezneva
f98429c509 Preprocess script dependencies before running UnusedSymbolInspection
^KT-29474
2019-03-06 15:42:50 +03:00
Natalia Selezneva
47a4500eaa Show notification that script dependencies are not ready yet 2019-03-06 15:42:49 +03:00
Natalia Selezneva
1d56f44093 Show progress for loading script dependencies even show notification is true when there are more than 3 scripts in queue
We are trying to update script dependencies silently when 'Reload script dependencies on file change' is off,
but in case when the queue for update is too long we need to make process visible to user and make it cancelable.
2019-03-06 15:42:49 +03:00
Natalia Selezneva
8331d9789e Fire one 'roots changed' event after all scripts dependencies loaded
^KT-29474
2019-03-06 15:42:49 +03:00
Natalia Selezneva
6bc6dea916 Check project.isDisposed before attaching script reports 2019-03-06 15:42:48 +03:00
Natalia Selezneva
c2dd365158 Do not search for text occurrences if this option is switched off 2019-03-06 15:40:59 +03:00
Natalia Selezneva
4a0574dc5f Scratch can be modified during execution (KT-30200)
^KT-30200 Fixed
2019-03-06 15:40:46 +03:00
Natalia Selezneva
0dbbd8e08c Introduce ScratchPanelListener to set module in the created panel (KT-30049)
^KT-30049 Fixed
2019-03-06 15:40:30 +03:00
Ting-Yuan Huang
c1d721a15f when: emit lookupswitch/tableswitch if possible
A lookupswitch or tableswitch can be used if all conditions are equality
checks to constants. To be more specific, it can be done if:
  1. All conditions are CALL 'EQEQ(Any?, Any?)': Boolean
  2. All types of variables involved in comparison are in the same group
     of Char/Byte/Short/Int, String or enum.
  3. All arg0 refer to the same value.
  4. All arg1 are IrConst<*>.

Change-Id: Ifd7cb618395f6c5cc64601018b446f0bb7f5891c
2019-03-06 13:33:55 +01:00
Sergey Rostov
f5d0a38629 JPS Build: update artifacts 2019-03-06 14:42:49 +03:00
Simon Ogorodnik
3950dec4db Implement TypeSystemContext for FIR #KT-29968 Fixed
Use this context in FirClassUseSiteScope for type comparison
2019-03-06 13:36:00 +03:00
Simon Ogorodnik
85cd4f3cdf Extract common code (TypeSystemContext) 2019-03-06 13:33:29 +03:00
Igor Chevdar
2c7b05a67b Wrapped descriptors: supported complex annotations 2019-03-06 13:25:06 +03:00
Toshiaki Kameyama
6b35c06d50 Add intention to replace '!isNotEmpty()' to 'isEmpty()'
#KT-30123 Fixed
2019-03-06 11:06:40 +03:00
Mikhail Zarechenskiy
88ee0bf6af Swap arguments for diagnostic message about incompatible enums
This commit is restoring previous behavior changed in c4b69b65 and
 fixing `DiagnosticMessageTestGenerated.testIncompatibleEnums` test
2019-03-06 10:44:45 +03:00
Yan Zhulanow
3315c1c35b Debugger: Call invokeMethod() safely, through the execution context (KT-30268, EA-131589) 2019-03-06 03:30:56 +03:00
Yan Zhulanow
9d176917e6 Fix EA-138393: Calculate async stack traces only on breakpoints 2019-03-06 03:30:55 +03:00
Yan Zhulanow
eb1543c71a Minor: Fix a few compilation warnings in compiler and compiler tests, fix formatting 2019-03-06 03:30:55 +03:00
Yan Zhulanow
5564760ebf Pill: Recognize non-default test source roots 2019-03-06 03:30:55 +03:00
Yan Zhulanow
bab1c63126 Fix EA-135863: Access allLineLocations() safely 2019-03-06 03:30:54 +03:00
Yan Zhulanow
b54f9a0c05 Fix EA-105847, use 'location()' safely 2019-03-06 03:30:54 +03:00
Roman Artemev
e3e3fcded1 Fix windows j2v8 artifact 2019-03-05 22:56:48 +03:00
Alexander Udalov
2bec72d46a Additional cleanup of KotlinTypeMapper after J2K 2019-03-05 20:34:32 +01:00
Mikhael Bogdanov
20da778046 Add default values to KotlinTypeMapper constructor, remove them from call sites
~
2019-03-05 20:34:25 +01:00
Mikhael Bogdanov
cc0c3b1592 Specify default value for irBackend 2019-03-05 20:33:35 +01:00
Mikhael Bogdanov
a3c3282362 Minor. Clean up code after convertion 2019-03-05 20:33:34 +01:00
Mikhael Bogdanov
315df81397 Convert KotlinTypeMapper to Kotlin 2019-03-05 20:33:33 +01:00
Mikhael Bogdanov
61a95b440f Rename .java to .kt 2019-03-05 20:33:32 +01:00
Mikhael Bogdanov
b43622b87f Minor. Code clean 2019-03-05 20:33:31 +01:00
Alexander Udalov
d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Alexander Udalov
5d297c40fd Minor, move ReifiedTypeParameterSubstitutionChecker to PlatformConfiguratorBase 2019-03-05 17:58:10 +01:00
Alexander Udalov
c61fe16202 Minor, fix inspections, remove unused in codegenUtil.kt 2019-03-05 17:58:10 +01:00
Alexander Udalov
e3779b1883 Minor, relax parameter type of AsmUtil.putJavaLangClassInstance 2019-03-05 17:58:10 +01:00
Alexander Udalov
afe3bed7e1 Minor, remove unused functions from inlineCodegenUtils.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
214ef0c3c2 Move generation of inline intrinsics to inlineIntrinsics.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
69eae035f6 JVM IR: do not add kotlin-reflect in tests unconditionally 2019-03-05 17:58:09 +01:00
Alexander Udalov
4d817aa6cf Minor, simplify/optimize FunctionTypeConstructor.computeSupertypes 2019-03-05 16:28:53 +01:00
Alexander Udalov
b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Alexander Udalov
74b14f14bd Minor, refactor parseLanguageVersionSettings
Get rid of code duplication, use a more type-safe approach to
enumerating analysis flags
2019-03-05 16:28:53 +01:00
Alexander Udalov
4136fd1dbb Minor, remove unused parameter of LazyImportResolver.collectFromImports 2019-03-05 16:28:53 +01:00
Alexander Udalov
c069371591 Inline LazyImportScope.selectSingleFromImports 2019-03-05 16:28:52 +01:00
Alexander Udalov
b6e745fe52 Minor, rename InlineExposed -> PublishedApi in readme 2019-03-05 16:28:52 +01:00
Alexander Udalov
9d94a54f03 Simplify ExternalDependenciesGenerator
Remove unused parameters, inline inner class
2019-03-05 16:28:34 +01:00
Alexander Udalov
4b712bd14b Remove dependency of backend-common on descriptors.jvm 2019-03-05 16:28:34 +01:00
Alexander Udalov
d7fd4987ae Remove dependency of ir.tree on frontend.java 2019-03-05 16:28:34 +01:00
Alexander Udalov
45e8d2e1df Do not use JVM-specific code for SAM conversions in psi2ir
Extract all JVM-specific code into GeneratorExtensions.SamConversion.
This is needed in order to remove dependency of ir.tree on frontend.java
2019-03-05 16:28:33 +01:00
Alexander Udalov
aaa2bad719 Do not use IR_EXTERNAL_JAVA_DECLARATION_STUB in DeclarationStubGenerator
This code is common across backends and it should not depend on
JVM-specific behavior. Introduce GeneratorExtensions to reverse the
dependency here
2019-03-05 16:28:33 +01:00
Alexander Udalov
f29012a78f Remove unreachable code in psi2ir tests, delete unused tests 2019-03-05 16:28:33 +01:00
Mikhail Glukhikh
8e29ee53a4 Deprecate session in FirElement (related to KT-30275) 2019-03-05 18:23:17 +03:00
Denis Zharkov
2dbe96c853 Extract ConeClassifierLookupTag (aka SearchSymbol)
So, for classifiers there are both Symbols and LookupTags
The difference between them is that the former are assumed to have
a reference to the actual FirDeclaration while LookupTags
effectively contain only classId and
something informative may only be obtained by FirSession

#KT-24075 Fixed
2019-03-05 18:23:17 +03:00
Toshiaki Kameyama
6b5ba272a0 Import members from: suggest on type reference
#KT-29927 Fixed
2019-03-05 18:19:33 +03:00
Abduqodiri Qurbonzoda
3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00
Nicolay Mitropolsky
f664499708 Uast: getMaybeLightElement cleanup 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
ec1badf60d Uast: testing resolve for method called on variables of parametrized types 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
5268cd4663 Uast: type-parameter references resolves to type-parameters 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
ec26ea4e36 Uast: TypeReferences log test added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
adb13b2f9e Uast: ResolveEverythingTest tests for generics added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
337f16194a Uast: resolving references to local function declarations 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
72860fb695 Uast: making KotlinUSimpleReferenceExpression able to resolve to types 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
e1e1e53e4a Uast: setup for KotlinUastResolveEverythingTest 2019-03-05 14:30:07 +03:00
Mikhail Zarechenskiy
c4b69b65bc Gradually prohibit comparison of incompatible enums
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
82c8289666 Refactoring: move getRepresentativeUpperBound method to core
Plus prettify it a bit
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
7c357c0ec0 [NI] Complete calls during one inference session only once
The problem is that delegated properties resolve two calls together:
 `getValue`/`setValue` with a common receiver, which can contain
 callable references. For each completion new anonymous descriptor
 was created and caused "rewrite at slice" exceptions later.
 Now there is a little hack to check that during one inference session
 we don't complete one call more than one time.

 More correct fix would be to explicitly specify common receiver for
 inference session but it requires quite big refactoring, which will
 be done later with a whole refactoring of the common solver

 #KT-30250 Fixed
2019-03-05 13:33:22 +03:00
Stanislav Erokhin
14c93c7c0e Remove obsolete ant build file: build-docs.xml 2019-03-05 12:54:02 +03:00
Anton Yalyshev
52f297c644 renewed pictures of our wizards in TipOfTheDay #KT-28941 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
8a3659008e unified naming of Kotlin projects #KT-17829 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
415793be1c better look for wizards names and descriptions: removed word dups and specified build system #KT-27183 Fixed 2019-03-05 11:40:19 +03:00
Simon Ogorodnik
dc56fd873a Add missing type-system dependency to ultimate 2019-03-05 01:52:03 +03:00
Roman Artemev
88d365328a [JS IR BE] Run JS IR tests in V8 engine 2019-03-04 23:24:18 +03:00
Roman Artemev
2ccd093099 Update test data 2019-03-04 23:24:18 +03:00
Roman Artemev
80a2be50c3 Regenerate tests 2019-03-04 23:24:18 +03:00
romanart
8e02964112 Make test be language version agnostic 2019-03-04 23:24:17 +03:00
romanart
2d6b291998 Rename test 2019-03-04 23:24:17 +03:00
romanart
5d6f42e4e6 Fix rebase 2019-03-04 23:24:17 +03:00
Roman Artemev
3770d310f1 Deserialization code clean up 2019-03-04 23:24:17 +03:00
Roman Artemev
d085e66aa3 [JS IR BE] Optimize test performance
* temporary disable verification
 * restore default/full runtime source set scheme
2019-03-04 23:24:16 +03:00
Roman Artemev
5033d99380 [JS IR BE] Update test data 2019-03-04 23:24:16 +03:00
Roman Artemev
a19bdd0c18 [JS IR BE] Refactored klibs proto files 2019-03-04 23:24:16 +03:00
Roman Artemev
52baf90518 Drop DebugJsAstProtoBuf 2019-03-04 23:24:15 +03:00
Roman Artemev
cae800b24e [JS IR BE] Fix deserialization performance 2019-03-04 23:24:15 +03:00
Roman Artemev
079f2534c7 [JS IR BE] Support compilation and tests against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
b99377fd69 [JS IR BE] Fix backend to be able compile test against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
0ec75f1534 [JS IR BE] Temporary fix K/JS stdlib 2019-03-04 23:24:14 +03:00
Roman Artemev
b0b6b359b1 [JS IR BE] Do not produce KotlinType creating IrType 2019-03-04 23:24:14 +03:00
Roman Artemev
6863f9e4f3 [JS IR BE] Make backend be able work with unbound symbols
* Fix array type deserialization
 * Prepare to compilation against klibs
2019-03-04 23:24:14 +03:00
Roman Artemev
2334ea2742 [JS IR BE] Support IrDynamicExpression in proto and deserializer 2019-03-04 23:24:13 +03:00
Roman Artemev
44010cc6ef [JS IR BE] Refactored compiler interface 2019-03-04 23:24:13 +03:00
Roman Artemev
67f0d49ea1 [JS IR BE] Fix rebase 2019-03-04 23:24:13 +03:00
Roman Artemev
4ede02f5b2 [JS IR BE] Update test data 2019-03-04 23:24:12 +03:00
Roman Artemev
b2cfef4902 [JS IR BE] Lazy initialize lowering properties 2019-03-04 23:24:12 +03:00
Roman Artemev
c95d99dbe0 [JS IR BE] Use symbol instead of declaration 2019-03-04 23:24:12 +03:00
Roman Artemev
862ccd05df [JS IR BE] Merge native fixes into Ir Serializer 2019-03-04 23:24:12 +03:00
Roman Artemev
813fef6f26 [JS IR BE] Get rid of usages of KotlinType 2019-03-04 23:24:11 +03:00
Roman Artemev
d034ce106e [JS IR BE] Implement isPrimitiveArray with pure Ir 2019-03-04 23:24:11 +03:00
Roman Artemev
3a444cd0f3 [JS IR BE] Move IrSerializer from native to JS
* Fix issues
2019-03-04 23:24:10 +03:00
Roman Artemev
5384f23f30 [JS IR BE] Extract metadata deserializer to keep binary compatibility
* add UniqId extension to metadata protobuf
2019-03-04 23:24:10 +03:00
Roman Artemev
3718edb6bc [JS IR BE] Some preparation for IrSerialization 2019-03-04 23:24:09 +03:00
Ilya Gorbunov
d4b97d33ef Introduce kotlin.ExperimentalStdlibApi annotation for prerelease API
#KT-30174
2019-03-04 20:47:49 +03:00
Kirill Shmakov
05be09c839 Explicitly order projects for cidr plugin build
With additional module included, evaluation of :prepare:idea-plugin
is requested prior to :prepare evaluation. See KOTLIN-CR-2775.
2019-03-04 20:21:52 +03:00
Mikhail Glukhikh
14a6f684dc Reformat "make constructor parameter a property" quick-fix 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
9e2ee6183c Fix "make constructor parameter a property" for vararg case
Same should work for annotated parameters
#KT-29312 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
c714e599ea Don't report "Unsafe call with ? extension receiver" with smart-cast
#KT-29499 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
4d19120d84 Don't report "main parameter not necessary" in objects #KT-29414 Fixed 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
022c625d2d MPP web builder: upgrade Ktor version to 1.1.3 #KT-29918 Fixed 2019-03-04 17:57:52 +03:00
Simon Ogorodnik
4882627712 Make type-system KotlinType-independent
- Port NewKotlinTypeChecker.equalTypes
- Decouple new-type transform from isSubtypeOf
- Port isSubtypeForSameConstructor
- Port checkSubtypeForSpecialCases
- Port isSubTypeOf without internals
- Port anySupertype
- Port isSubtypeForSameConstructor, findCorrespondingSupertypes
- Port isSubtypeOfForSingleClassifierType
- Port NullabilityChecker
- Reorder checks for performance
2019-03-04 17:27:45 +03:00
Simon Ogorodnik
d210e8bad0 Introduce optional optimization parameters for type system context 2019-03-04 17:10:47 +03:00
Simon Ogorodnik
8992537180 Place instance markers in KotlinType hierarchy 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
be79aeafa7 Create first draft of AbstractStrictEqualityTypeChecker 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
f7702d3e43 Create new core module: type-system 2019-03-04 17:10:45 +03:00
Natalia Selezneva
fe278ea0a0 Add test for build.gradle.kts highlighting 2019-03-04 16:13:23 +03:00
Mikhael Bogdanov
6d9c49e55e Add IrCompileKotlinAgainstKotlinTest tests 2019-03-04 13:59:58 +01:00
Toshiaki Kameyama
1b7627e039 Surround with null check: suggested for an assignment
#KT-30215 Fixed
2019-03-04 15:11:57 +03:00
Toshiaki Kameyama
2314a38342 Reformat SurroundWithNullCheckFix 2019-03-04 15:11:57 +03:00
Sergey Rostov
f467d892ca Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-04 13:12:34 +03:00
Sergey Rostov
88c04f75f1 Gradle: Move files from org.jetbrains.kotlin.gradle.plugin.mpp to org.jetbrains.kotlin.gradle.targets 2019-03-04 13:12:22 +03:00
Sergey Igushkin
51234d10b9 Actual change for splitting files preserving Git history
Remove resulting redeclarations and finish the split in files below:

  - from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:12:10 +03:00
Sergey Igushkin
b096057bdc (step 8/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the temporary files back to their original paths.
2019-03-04 13:11:42 +03:00
Sergey Igushkin
0473bd2c4c Merge commit 'ffdd43b8083c4fd7795799e351f23d997534a43e'; commit 'af3bf257ba1584fd2f3d690fe76c48778699e29b'; commit '83d22a3744df1b79545070fbb9ea13ee1182a614'; commit 'b7cf915e884caea8cabc2db5f611fa5d5a7536e8'; commit '522a5b8c3ffd84c11cb70efead9c152e8d62cd37'; commit '37a117574f314263360350964e80ce182c093e31' into move-packages-on-master 2019-03-04 13:11:35 +03:00
Sergey Igushkin
bb90cf7831 (step 7/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the original files to
temporary files suffixed with '.git_split_tmp'
2019-03-04 13:11:35 +03:00
Sergey Igushkin
37a117574f (step 6/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinMetadataTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinWithJavaCompilation.kt
2019-03-04 13:11:32 +03:00
Sergey Igushkin
522a5b8c3f (step 5/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmWithJavaTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinNativeCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinWithJavaCompilationFactory.kt
2019-03-04 13:11:31 +03:00
Sergey Igushkin
b7cf915e88 (step 4/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJsCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinNativeCompilationFactory.kt
2019-03-04 13:11:28 +03:00
Sergey Igushkin
83d22a3744 (step 3/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinWithJavaTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinJsTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmAndroidCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmAndroidCompilationFactory.kt
2019-03-04 13:11:26 +03:00
Sergey Igushkin
af3bf257ba (step 2/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinNativeTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinNativeTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmCompilationFactory.kt
2019-03-04 13:11:24 +03:00
Sergey Igushkin
ffdd43b808 (step 1/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  KotlinTargetConfigurator.kt -> KotlinNativeTaretConfigurator.kt
  mpp\kotlinTargets.kt -> mpp\KotlinAndroidTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinAndroidTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinCommonCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJsCompilationFactory.kt
  mpp\kotlinCompilationOutputs.kt -> mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:11:22 +03:00
Dmitry Gridin
dce2139eb0 Fix KNPE from "Create" quick fix
#KT-27289 Fixed
2019-03-04 13:01:18 +03:00
Dmitry Gridin
78bee70946 Refactoring 2019-03-04 13:01:18 +03:00
Nikolay Krasko
b458e187af Extract ITNReporter.submit() compatibility problem to separate file 2019-03-04 12:14:23 +03:00
Nikolay Krasko
a5434d7d9e Add internal action for reporting exceptions from Kotlin plugin 2019-03-04 12:14:23 +03:00
Nikolay Krasko
6504cb285b Add internal action for continuous enabling and disable dumb mode 2019-03-04 12:14:22 +03:00
Nikolay Krasko
27ba9b5481 Fix Goto tests by invoking action directly instead of using handler
Problem introduced in
1f7f3d9fdc

Implementation CodeInsightActionHandler was returned for GotoDeclarationAction later.
2019-03-04 12:14:22 +03:00
Mikhail Zarechenskiy
93e79afab4 [NI] Preserve nullability of resulting type from CST if it's possible
Consider common supertype of `S` and `Nothing`, where `S` has nullable
 upper bound or it's flexible. Before the fix, result was `S?`, which
 is correct but too conservative. Now, we'll preserve nullability of
 resulting type if it's already nullable.

 This happened because we were failing to find path of not-nullable
 types from `Nothing` to `S`, which should obviously exists by
 semantics of Nothing
2019-03-04 11:29:39 +03:00
Mikhail Zarechenskiy
9b3e17f0d7 [NI] Avoid building controversial systems by clipping extra constraints
#KT-23854 Fixed
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
92b40ea9d5 [NI] Refactor adding expected type constraint
Add comments, make computation needed for expected type more clear
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
43cf6623f9 [NI] Added test for controversial common system
See KT-23854
2019-03-04 11:29:38 +03:00
Dmitry Gridin
5927032143 Fix "Introduce import alias" on extensions
#KT-30214 Fixed
2019-03-04 10:15:52 +03:00
Pavel V. Talanov
853e9a2aa0 Prevent calls to onFirstRun default implementation for gradle rc
This is temporary until we get compatible API from IDEA
    to support gradle run configurations for MPP projects in IDEA 191+
2019-03-04 02:52:41 +01:00
Andrey Uskov
25dc81c2bd Fix memory leak in gradle import
#KT-30076 Fixed
2019-03-03 20:28:04 +03:00
Andrey Uskov
3919898d19 Minor. Reformat code in multiplatform project importer 2019-03-03 20:27:12 +03:00
Ilya Chernikov
db3eb5707b Drop redundant usages of the ScriptDefinitionProvider 2019-03-02 08:10:17 +01:00
Ilya Chernikov
e99715cf82 Extract extra imports provision into an extension, implement one ...
for script in the plugin, drop direct dependency on scripts from
FileScopeFactory
2019-03-02 08:10:17 +01:00
Ilya Chernikov
57ac149f5b Extract script cli evaluation to the plugin 2019-03-02 08:10:17 +01:00
Ilya Chernikov
7c3bdde102 Fix sequence of the script definitions search - explicit ones should be tried first 2019-03-02 08:10:16 +01:00
Ilya Chernikov
196e274929 Move calculating dependencies from script sources to plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
336f43dbf2 Reorganize files and folders in the scripting plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
adb4d264ec Move script definition extraction functions to the plugin
plus finish refactoring of these functions
2019-03-02 08:10:16 +01:00
Nicolay Mitropolsky
815fcd062d Uast: caching isJvmElement if all modules are Jvm (KT-28564) 2019-03-01 20:14:57 +03:00
Alexander Udalov
8ef7f73164 Fix incorrect enum comparison in kotlinx-metadata
Previously, we compared instances of different enums and thus the
conditions were always true. This did not affect visible behavior of the
program except the fact that we've been writing default field values
(kind and level) for version requirements to protobuf where they
could've been omitted
2019-03-01 17:09:03 +01:00
Shagen Ogandzhanian
ed4e93cc98 Fix for npm publishing configuration
This reverts commit 0188cd5330.
Turns out it's not a url after all
2019-03-01 15:46:28 +01:00
Dmitry Gridin
2a940f5b0a Fix KT-26965 2019-03-01 17:43:56 +03:00
Shagen Ogandzhanian
7162dd9807 Prepare JsTestChecker (but not introduce so far) for J2V8 adoption 2019-03-01 15:29:35 +01:00
Wil
d3ac50f694 Minor: typo fix in Writer.buffered docs 2019-03-01 17:09:27 +03:00
Dereck Bridie
4156a76129 #KT-26965 Add inspection + quickfix for replacing Collection<T>.count() with .size 2019-03-01 16:58:36 +03:00
Toshiaki Kameyama
240ff08069 Specify type: escape with backticks if need
#KT-29677 Fixed
2019-03-01 16:43:02 +03:00
Toshiaki Kameyama
1a818970c3 Add inspection to replace Java Map.forEach with Kotlin's forEach
#KT-17278 Fixed
2019-03-01 16:15:23 +03:00
Nicolay Mitropolsky
9c674cb7c3 Uast: support for KtDelegatedSuperTypeEntry (KT-30033) 2019-03-01 15:00:31 +03:00
Dmitriy Novozhilov
2f5843f764 Move detecting of illegal call of contract function into call checker
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
54e5cce9be Prohibit declaring multiple callsInPlace contract on same lambda.
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
4a7420d77d Allow declaring contracts on suspend functions. KT-27468 Fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
84da8b6279 Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
KT-27090
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
b484e03fa8 Allow use contract function by FQN. #KT-29772 fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
7072b9d179 Fix order of fixing type variables for callable references. KT-25433 Fixed 2019-03-01 14:50:33 +03:00
Andrey Uskov
735f86a50e Fix creation of KotlinSDK. GradleFacetImportTest fixed 2019-03-01 13:12:43 +03:00
Andrey Uskov
325ed8eb32 Change class hierarchy of KotlinSourceRootType. Deadlock during concurrent classloading fixed
#KT-30137 Fixed
2019-03-01 13:12:16 +03:00
Toshiaki Kameyama
87dc1a035b Convert property initializer to getter: suggest on property name
#KT-29344 Fixed
2019-03-01 11:37:42 +03:00
Toshiaki Kameyama
20aa8ebdb0 Add "Throwable not thrown" Inspection
#KT-11629 Fixed
2019-03-01 11:35:12 +03:00
Toshiaki Kameyama
e0aeb8f7ec Remove redundant let: rename invoke call
#KT-29556 Fixed
2019-03-01 11:31:07 +03:00
Toshiaki Kameyama
df3953f03a Redundant Unit: fix false positive when return type is nullable Unit
#KT-30038 Fixed
2019-03-01 11:12:25 +03:00
Toshiaki Kameyama
d67c793a9b map.get() with not-null assertion: add quick-fixes
#KT-30010 Fixed
2019-03-01 11:11:05 +03:00
Mikhail Glukhikh
84a3239cdf FIR: extract "toTypeProjection" 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
f8497bc339 FIR: extract "constructType" from type resolver 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
1cefcc1438 Add "firCompilerTest" configuration & include it into compiler tests 2019-03-01 10:36:19 +03:00
Natalia Selezneva
bc1e836f01 Fix saving Kotlin Scripting Setting to xml
^KT-30146 Fixed
2019-03-01 09:42:43 +03:00
Ilya Gorbunov
640699e076 Do not expose internal copyOfUninitializedElements and copyOfNulls 2019-02-28 23:44:00 +03:00
Ilya Gorbunov
2e9497f8f8 Rewrite copyOfUninitializedElements with templates without using copyRangeTo 2019-02-28 22:57:45 +03:00
Ilya Gorbunov
c1a51d44a4 Rewrite copyInto without using copyRangeTo
Rename array copying implementation to arrayCopy
2019-02-28 22:57:45 +03:00
Ilya Gorbunov
b8d9e896c2 Move sorting implementations for Native to kotlin.collections
- Move Array.sortWith to generated code
2019-02-28 22:57:45 +03:00
Svyatoslav Kuzmich
e11fda1c49 [JS IR BE] Skip external methods in js default arguments stub generators 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
8da076c1ed [JS IR BE] Fix basic reflection for primitive types 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
a01407eec9 [JS IR BE] Don't mangle Any::equals method 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
27005d7c2e [JS IR BE] Basic support for external varargs 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
0d9218b017 [JS IR BE] Refactor namer 2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
e9cdad1143 [JS IR BE] Remove support for dynamic symbols and descriptors
Dynamic expressions in IR are now represented as IrDynamicOperatorExpression

We don't have dynamic functions, dynamic dispatch receivers anymore
2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
d323dce2b6 [JS IR BE] Fix codegen for nested external objects 2019-02-28 20:13:55 +03:00
Dmitry Gridin
41f3316981 Fix caret position in "Convert function to property" intention
#KT-19944 Fixed
2019-02-28 15:59:50 +03:00
Dmitry Gridin
29a63ae58c Refactoring & fix warnings 2019-02-28 15:59:50 +03:00
Vadim Brilyantov
bd2e51ded5 Fix for bug introduced in moveConflictUtils (never show warnings when moving to the same scope) 2019-02-28 15:52:28 +03:00
victor.petukhov
bd03ecf4a0 Rename helper file with typealias samples for spec tests 2019-02-28 14:55:41 +03:00
victor.petukhov
b7a5d73bf0 Add type inference tests by specification to remote run tests 2019-02-28 11:55:16 +03:00
Georgy Bronnikov
c618ef9304 Correct phase argument names and cli test outputs 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
5ff1337ec8 Add some phase checkers 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
da13d3288e Check pre- and postconditions on phases 2019-02-28 11:53:02 +03:00
Natalia Selezneva
48433110a4 Do not threat modifications inside lambdas in KtScriptInitializer block as out of code block 2019-02-28 10:59:15 +03:00
Natalia Selezneva
49277bb5e4 Optimize MemberVisibilityCanBePrivateInspection: check that descriptor is in class before resolving it 2019-02-28 10:59:14 +03:00
Natalia Selezneva
560acd631c KtScriptInitializer doesn't has a descriptor 2019-02-28 10:59:13 +03:00
Natalia Selezneva
3b4d1dd7bf Optimize ChangeVisibilityModifierIntention: do not analyze element if declaration isn't local 2019-02-28 10:59:12 +03:00
Natalia Selezneva
869fb46c0b Optimize KotlinUFunctionCallExpression.isAnnotationArgumentArrayExpression 2019-02-28 10:59:12 +03:00
Toshiaki Kameyama
6ca22fbf34 Remove redundant let: do not report for function stored in variable call
#KT-30082 Fixed
2019-02-28 10:44:05 +03:00
Dmitry Gridin
304007f602 Fix false positive "Redundant companion reference"
#KT-30166 Fixed
2019-02-28 10:42:22 +03:00
Sergey Rostov
50263ed7cd JPS Build: update artifacts configuration (bootstrap) 2019-02-28 09:16:10 +03:00
Yan Zhulanow
7c0233dfeb 191: 191: Fix test compilation, remove deleted test 2019-02-27 21:41:09 +03:00
Kirill Shmakov
262b3fde3d Fix Gradle MPP integration tests
#KT-30056 Fixed
2019-02-27 20:51:04 +03:00
Dmitry Gridin
3756b6f54d Add inspection to remove redundant qualifier name
#KT-12134 Fixed
2019-02-27 20:43:35 +03:00
Dmitry Gridin
d0c3a28996 Move canBePossibleToDropReceiver to Companion object & fix warnings 2019-02-27 20:43:35 +03:00
Ilya Gorbunov
19bd326810 Swap mismatched docs for Result.onSuccess/onFailure KT-30109 2019-02-27 17:53:11 +03:00
Ilya Gorbunov
908009bf42 Improve double-to-ulong conversion tests
#KT-27108
2019-02-27 17:49:41 +03:00
Mikhail Zarechenskiy
892fb9f39e Increment metadata version and improve message for error type
Follow-up of 617bed1b
2019-02-27 14:03:22 +03:00
Vyacheslav Gerasimov
f7428e7161 Build: Add diagnostic for publish() helper 2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
a42f607ecf Build: Fix artifacts signing for maven central
With gradle > 5.0 `publish()` helper call should be done before
`noDefaultJar()` or any other artifact hacks, otherwise singing plugin doesn't sign any jars
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
df3aa48c9b Build: Apply java plugin in kotlin-annotation-processing-embeddable
Otherwise artifact signature works incorrectly for this project
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
f4c157a9bc Build: properly remove artifact from archives in runtimeJar helper 2019-02-27 13:21:17 +03:00
Alexander Podkhalyuzin
6098e97ae5 Do not go to the same type twice during contains search
This fixes exponent in algorithm for scala.FunctionN.curried, where N can be up to 22.

#KT-29435 Fixed
2019-02-27 12:36:43 +03:00
Nicolay Mitropolsky
c151be5547 Uast multiresolve key description fix 2019-02-27 12:15:32 +03:00
Mark Punzalan
fc5eac26cd Extracted complex string concatenation bytecode test case into separate test data file. 2019-02-27 08:36:35 +01:00
Mark Punzalan
d4d5a6011c Flatten nested string concatenation expressions into a single IrStringConcatenation, in a separate lowering phase.
Consolidating these into IrStringConcatenations allows the backend to produce efficient code for string concatenations (e.g., using StringBuilder for JVM).
2019-02-27 08:36:35 +01:00
Natalia Selezneva
ae22bdee15 Add scripting resolver extension to plugin-kotlin-extensions.xml 2019-02-27 09:37:07 +03:00
Sergey Rostov
63dca7b3b5 Build: exclude annotations.jar from Intellij 2019-02-27 09:11:42 +03:00
Sergey Rostov
17c0422d8f Build: got rid of @TestOnly annotations on fields and classes 2019-02-27 09:08:34 +03:00
Dmitry Gridin
c89d1af9fa Improve Create property from Usage
Place generated property next to other properties
 #KT-14886 Fixed
2019-02-27 00:07:55 +03:00
Dmitry Gridin
5d599ee2ff Refactoring 2019-02-27 00:07:55 +03:00
Alexander Udalov
76e133014b Minor, explain why we don't store array type arguments in ::class in proto 2019-02-26 19:09:42 +01:00
Alexander Udalov
736ac12374 Prohibit type parameters in class literals in annotation arguments
#KT-27799 Fixed
2019-02-26 19:09:42 +01:00
Vadim Brilyantov
c633f7568f #KT-25674: Fix unexpected reference renames in literals when moving referenced files. 2019-02-26 15:37:48 +03:00
Vadim Brilyantov
c7acd89fad #KT-19799: Add initialDirectory to KotlinAwareMoveFilesOrDirectoriesDialog 2019-02-26 15:37:47 +03:00
Vadim Brilyantov
0c1e7e1d63 #KT-23099: Fix name clashes when moving top-level objects with same signature 2019-02-26 15:37:45 +03:00
Vadim Brilyantov
f7c4760cb9 #KT-17825: Filter PackageLookupObjects as available for completion 2019-02-26 15:37:42 +03:00
Vadim Brilyantov
c5d1190d15 #KT-26611: Change mnemonic for "search references" checkbox to Alt+R 2019-02-26 15:37:40 +03:00
Vadim Brilyantov
01200252f5 #KT-22721: Fix move refactoring to make it check previous PsiElement before a whitespace 2019-02-26 15:37:39 +03:00
Vadim Brilyantov
e413395cbf #KT-19661: Create missing directories when moving to a user-defined path 2019-02-26 15:37:34 +03:00
Vadim Brilyantov
dc2c8140a9 Add optimize imports with timeout for move refactoring 2019-02-26 15:35:17 +03:00
Vadim Brilyantov
0ec3d15218 #KT-19924: Fix usability issue with extract declaration from file intention
Fix ExtractDeclaration intention name in tests

Fix ExtractDeclaration intention folder and description to avoid "not found Dir URL" exception
2019-02-26 15:35:15 +03:00
Alexander Gorshenev
888641e7f1 Use file symbol instead of a file name string in IrReturnableBlockImpl 2019-02-26 13:54:04 +03:00
Alexander Udalov
e2106d4d08 Do not assert that function is inline in MemberDescriptor.isInlineOnly
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov
b8bc79e17c Support non-trivial default argument values in expected functions on JVM
#KT-22818 Fixed
2019-02-26 11:02:30 +01:00
Ting-Yuan Huang
b2cc661783 Set target backend of BytecodeTextTestGenerated to JVM
as BytecodeTextTestGenerated is only available to JVM.

Change-Id: I0bb15b35ab3b8418434875971a572f3e49a516a5
2019-02-26 09:22:43 +01:00
Alexander Udalov
cfcd0d7b4a Minor, fix localClassLiteral.kt on JDK 9 2019-02-25 23:37:43 +01:00
Abduqodiri Qurbonzoda
ae47130c8e Implement UArray.contains(element) workaround for JS 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
c1b523ddef Fix UArray.containsAll(Collection<Any?>) 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
60e83383ad Add containsAll(Any?) check to CollectionBehaviors 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
1b6b44c805 Implement conversion between floating point numbers and unsigned integers
KT-27108
2019-02-25 21:58:03 +03:00
Yan Zhulanow
a970de51ab Debugger: Fix 182 bunch, add missing scratch extensions 2019-02-25 21:35:00 +03:00
Yan Zhulanow
55db2abd89 Debugger: Fix 191 bunch file, add new debugger extensions 2019-02-25 21:35:00 +03:00
Alexander Udalov
3f1533c35b Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead

 #KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Alexander Udalov
f733bda912 Fix compilation error introduced in d374723e3c 2019-02-25 19:22:09 +01:00
Pavel Punegov
86ac5e97e4 Update Kotlin/Native to 1.2-rc2-7869 2019-02-25 20:42:02 +03:00
Ilya Chernikov
d374723e3c Restore default jvmTarget for scripts that was lost after refactoring 2019-02-25 18:22:27 +01:00
Nicolay Mitropolsky
e0e5009f3f 191: Uast: StringTemplateComplexForUInjectionHost testdata fix 2019-02-25 19:24:51 +03:00
Leonid Startsev
472d91e0de Do not return whole list of generated property descriptors for type
arguments' serializers when only one name is needed.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/383
2019-02-25 19:21:29 +03:00
Nicolay Mitropolsky
f9813af3ff 191: Uast: KotlinUSimpleReferenceExpression bunch fix 2019-02-25 18:13:18 +03:00
Nikolay Krasko
6813402abf Fix INRE from KotlinQuickDocumentationProvider (KT-30058, EA-137533)
Show a warning like CtrlMouseHandler does.

Fixed in 191 branch in CtrlMouseHandler.updateOnPsiChanges().
b116dcaf99

 #KT-30058 Fixed
2019-02-25 17:43:57 +03:00
Alexey Tsvetkov
f38ad0fe8a Fix inter-project IC with new MPP for JS/JVM targets
#KT-26275 Fixed
   #KT-29966 Fixed
2019-02-25 17:12:14 +03:00
Nicolay Mitropolsky
5786ab5140 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression also handle deserialized descriptors 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
25e00c9079 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression resolve to class in case of SAM (KT-28272) 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
d7584df01b Uast: making ULambdaExpression.functionalInterfaceType return non-null values for explicitly typed SAM-s with Java interfaces (KT-28272) 2019-02-25 16:35:46 +03:00
Anton Yalyshev
a326ba60a3 metadata contains Common target, so we need to track it as well 2019-02-25 16:26:12 +03:00
Max Medvedev
526e49d68a fix test icons for methods
#KT-25956
2019-02-25 16:02:42 +03:00
Sergey Igushkin
03e36334cf Push Gradle version for kotlin-gradle-plugin-integration-tests to 5.2 2019-02-25 15:43:40 +03:00
Sergey Igushkin
43de81e4c8 Fix MPP publishing with metadata on Gradle 5.2 (KT-29758)
In publishing, use attribute containers of detached configuration
instead of HierarchyAttributeContainer, which is rejected by Gradle for
not being an AttributeContainerInternal.

Using attributes of a detached configuration is a small and
conservative fix; we may need to either not filter the attributes,
which will lead to [ProjectLocalConfigurations.ATTRIBUTE] being
published in the Gradle module metadata, which will potentially
complicate our attributes schema migration, or create proper,
non-detached configurations for publishing that are separated from the
configurations used for project-to-project dependencies.

Issue #KT-29758 Fixed
2019-02-25 15:43:40 +03:00
Svyatoslav Kuzmich
beb5f73a2b Remove duplicate tests from JS compiler test set. Merge chages to common compiler tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
a736756ceb [JS IR BE] Fix and refactor interop tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
569187a751 [JS IR BE] Use Char boxing rules of current backend 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
de020ed58a [JS IR BE] Generate and export JS properties 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
fc5636b7c1 [JS IR BE] Fix: Don't generate built-in "Function" interface 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
326cbcc218 [JS IR BE] Unmute tests 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
1184c158e4 [JS IR BE] Support @JsName in bridges 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
e09a6f0007 [JS IR BE] Fix codegen for external companion objects 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
c4ffe36a21 [JS IR BE] Add CharSequence type check 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
3be4248791 [JS IR BE] Disable deprecated jsName tests 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
74c8f54fc8 [JS IR BE] Support cast to native interface 2019-02-25 15:09:25 +03:00
Kirill.Shmakov
4a3476a87c Merge rr/kishmakov/KT-30056 into master 2019-02-25 11:45:55 +00:00
Yan Zhulanow
e43fd713ef Fix new compiler tests (new receiver name mangling – $this$label) 2019-02-25 14:44:00 +03:00
Yan Zhulanow
133f021b26 Async stack traces: Fix compilation on IDEA 182 and older AS versions 2019-02-25 14:44:00 +03:00
Yan Zhulanow
cadb70f64a Evaluator: Allow to evaluate expression on synthetic lines in .kt files 2019-02-25 14:44:00 +03:00
Yan Zhulanow
16266259f5 Evaluator: Handle function context gracefully. Use file scope as a fallback instead of error scope 2019-02-25 14:44:00 +03:00
Yan Zhulanow
5035de24ac Code fragments: Use file scope as a fallback when a more specific one is not available 2019-02-25 14:44:00 +03:00
Yan Zhulanow
316dcccc30 Minor: Capitalize word "Kotlin" in error messages 2019-02-25 14:43:59 +03:00
Yan Zhulanow
28e4356e6e Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
1edacbbb5e Evaluator: Don't rely on moduleDescriptor presence in DebugLabel descriptor generation
The containing moduleDescriptor may not exist for the Java context.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
a21802ee51 Pill: Fix new annotations-13.0 configuration 2019-02-25 14:43:59 +03:00
Yan Zhulanow
632b9ac38c Evaluator: Support 'field' variable evaluation for top-level properties 2019-02-25 14:43:59 +03:00
Yan Zhulanow
81f4e2fb3b Evaluator: Support delegated local variables 2019-02-25 14:43:59 +03:00
Yan Zhulanow
77bec27c99 Evaluate parameter value instead of backing field in primary constructor 2019-02-25 14:43:59 +03:00
Yan Zhulanow
592083bc5b Debugger: Support DebugLabel descriptors in completion 2019-02-25 14:43:58 +03:00
Yan Zhulanow
bff3f28a72 Pill: Fix IdeaPlugin artifact configuration 2019-02-25 14:43:58 +03:00
Yan Zhulanow
b9f76683dd Simplify 'suppressDiagnosticsInDebugMode'
In the new evaluator, suppressDiagnosticsInDebugMode is never set, and effectively the only check is that if a particular file is a KtCodeFragment.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
6cb2146d31 Remove 'allowSpecialClassNames' extraction option 2019-02-25 14:43:58 +03:00
Yan Zhulanow
11dfbd5d3d Allow '$this$label$<somethingElse>' for extension receivers
Our mangling works poorly with nested inline function calls (saying, `apply()` inside an another `apply()`). In that case, the generated local variable name for both cases will be `$this$apply`. As the debugger sees only the last (the closest) variable with the same name, we loose the ability to get the first one.
This means we might want to add some additional information to the mangling (e.g. add the trailing indices `$this$apply$1`). This commit supports this case.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
34b03c45d7 Add a test for escaped names supported in the new evaluator (KT-29661) 2019-02-25 14:43:58 +03:00
Yan Zhulanow
51b26325c6 Coroutine stack trace provider: check thread state before invokeMethod() 2019-02-25 14:43:58 +03:00
Yan Zhulanow
24cdd3f857 Remove 'debugTypeInfo' key
The key became obsolete as the new evaluator doesn't use it anymore.
2019-02-25 14:43:57 +03:00
Yan Zhulanow
6a81c2e1e4 Minor: Extract 'this' local variable name in DefaultImpls 2019-02-25 14:43:57 +03:00
Yan Zhulanow
65b6098242 Further refinements in variable displaying (Kotlin mode)
- Remove synthetic outer this for lambdas
- Recognize captured this for interface default methods
2019-02-25 14:43:57 +03:00
Yan Zhulanow
300c102c3f Remove BeforeExtractFunctionInsertionTest, the new evaluator doesn't depend on the 'extract function' refactoring 2019-02-25 14:43:57 +03:00
Yan Zhulanow
0657a3d399 New evaluator that doesn't depend on the 'extract function' refactoring (KT-28192, KT-25220, KT-25222, KT-21650) 2019-02-25 14:43:57 +03:00
Yan Zhulanow
3e849294f0 Extract the common part from bunched KtCodeFragment 2019-02-25 14:43:57 +03:00
Yan Zhulanow
b4002accfb Extract label name calculation from 'recordCallLabelForLambdaArgument()' 2019-02-25 14:43:56 +03:00
Yan Zhulanow
34c5954d75 Minor: Reformat evaluator code 2019-02-25 14:43:56 +03:00
Yan Zhulanow
eaed6855ac Minor: Add proper nullability check in generateExtensionReceiver() 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d039e3b1c0 Hide synthetic variables for local functions and destructured lambda parameters (Kotlin variables) 2019-02-25 14:43:56 +03:00
Yan Zhulanow
ed88020a84 Minor: Reformat extraction engine files 2019-02-25 14:43:56 +03:00
Yan Zhulanow
488418d960 Change mangling for local functions 2019-02-25 14:43:56 +03:00
Yan Zhulanow
aca3be12e9 Change illegal local variable mangling rules 2019-02-25 14:43:56 +03:00
Yan Zhulanow
47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d2c2a6c99f Debugger: Support inline functions in Variables view 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7fb8357b28 Allow '// PRINT_FRAME' option for multi-breakpoint stepping tests 2019-02-25 14:43:55 +03:00
Yan Zhulanow
16b94feea6 Minor: Remove an obsolete TODO comment 2019-02-25 14:43:55 +03:00
Yan Zhulanow
6cd980765c Do not issue exceptions for non-captured local variables
This partly fixes KT-28192.
2019-02-25 14:43:55 +03:00
Yan Zhulanow
4ae01badff Extract function: avoid same parameter names 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7de5ddaac9 Fix receiver evaluation for primitive receiver types 2019-02-25 14:43:55 +03:00
Yan Zhulanow
f6cc686095 Minor: Extract a const for continuation variable name 2019-02-25 14:43:55 +03:00
Yan Zhulanow
cf9461847b Hide unrelated this entries in Kotlin Watches mode 2019-02-25 14:43:54 +03:00
Yan Zhulanow
e5b0d2e34f Refactoring: Extract list field search 2019-02-25 14:43:54 +03:00
Yan Zhulanow
c5061e7997 Replace 'visibleVariablesByName()' calls with a safe implementation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
757fc421f7 Refactoring: Extract wrapping 'try' expressions 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f5a3a46e76 Watches: Hide 'this' if it's a continuation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
227a7e5609 Provide access to 'coroutineContext' inside suspend functions/lambdas (KT-24829) 2019-02-25 14:43:54 +03:00
Yan Zhulanow
cf925fc2ad Activate Kotlin stack frame even if there is no Kotlin strata 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f6b2e673f7 Debugger: Display async stack trace elements for suspend callers (KT-28728) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
e8c066605b Do not drop analysis results for the code fragment context, allow to re-use it
Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
2019-02-25 14:43:53 +03:00
Yan Zhulanow
4c681c787d Watches: Add Kotlin/JVM views to watches window (KT-28134, KT-28087, KT-22250)
Kotlin mode: show only Kotlin variables and captured values. The variable names are Kotlin-friendly.
JVM mode: show all variables available in the current stack position, including synthetic ones.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
5c419fc629 Evaluator: New implementation for variable finder
Support both old and new receiver variable conventions in variable finder.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
df7bbf707b Refactoring: Rename a function to 'getArgumentsForEvaluation()' 2019-02-25 14:43:53 +03:00
Yan Zhulanow
ea462091c4 Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
b5f9149702 Minor: Get rid of some magic constants 2019-02-25 14:43:53 +03:00
Kirill Shmakov
2a3473f275 Better string builder. 2019-02-25 14:43:32 +03:00
Kirill Shmakov
c43024a9c7 Version is backed. 2019-02-25 14:34:47 +03:00
Kirill Shmakov
02c9afcb6f Last test 2019-02-25 14:15:30 +03:00
Ilya Chernikov
b1ab2ead61 Restore find script definition behaviour (mostly) and relevant comments broken with refactoring 2019-02-25 11:57:13 +01:00
Kirill Shmakov
fb14128cbd All but one 2019-02-25 13:46:34 +03:00
Nicolay Mitropolsky
6b792c36f0 KotlinUastApiTest: using kfail alias 2019-02-25 12:26:22 +03:00
Nicolay Mitropolsky
712c897472 Uast: fix for UVariables missing typeReferences 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
98740138f3 Uast: yet another check for invalid context before resolve (EA-137191, EA-137193) 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
bd0c6736ce Uast: implementing specific javaPsi for UVariables 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
7dc818d42b 191: KotlinUastApiTest.kt missed bunch aligning fix 2019-02-25 12:26:21 +03:00
Andrey Uskov
63a1bba6d9 Fix importing compiler arguments if worker api is used #KT-29564 Fixed 2019-02-25 12:20:27 +03:00
Natalia Selezneva
8453c1ff4d Scratch: hide 'make module' checkbox when no module is selected
^KT-23985
2019-02-25 11:20:49 +03:00
Natalia Selezneva
e2b5134048 Allow to run scratch without module selected
^KT-23985 Fixed
2019-02-25 11:20:49 +03:00
Natalia Selezneva
8d4ca4d1c5 Scratch: Fix "Read access is allowed from event dispatch thread or inside read-action only"
^KT-28958 Fixed
2019-02-25 11:19:36 +03:00
Dmitry Savvinov
ba36fafb84 Create JsAnalyzerFacade with allowSliceRewrite=true
Other facades (JVM, Common, Native) are already created with such flag.
This should stop some known 'rewrite at slice'-exceptions from being
thrown (KT-21405, KT-29705).

For a more thorough investivation and details, refer to KT-30031.

Also, see KT-30030: even though it was fixed by the different commit,
the same scenario probably can be used to investigate other rewrites
(even though they will reproduce much less frequently than original
issue)

^KT-21405 Fixed
^KT-29705 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
705ec503cf Minor optimization: don't put 'null' for ContractProvider in user data 2019-02-25 11:10:16 +03:00
Dmitry Savvinov
2359944fa7 Minor: add debugName to JS-slices 2019-02-25 11:10:16 +03:00
Mikhail Glukhikh
c084eefb65 Fix a bunch of IDE quick-fix tests (related to "convert to run/...")
These actions became available more often some days ago
2019-02-25 10:37:46 +03:00
Dmitriy Dolovov
4ef12b1ed7 CIDR: New way of building CLion and AppCode plugins v2 2019-02-25 14:06:51 +07:00
Mikhail Glukhikh
de93aad8aa FIR total resolve in IDE test: fix accidentally wrong project path :( 2019-02-25 09:53:21 +03:00
Mikhail Zarechenskiy
617bed1bf1 Fix nested typealiases expansion and as a result fix serialization
Consider the following situation:
 ```
 class Inv<T>
 typealias A<K> = Inv<K>
 typealias B<V> = Inv<A<K>>

 fun <U> materialize(): B<U> = TODO()
 ```

 Type `B<U>` is expanding to `Inv<Inv<U>>` and for this type `B<U>` and
 `Inv<A<U>>` are abbreviated types, but due to a bug we forgot to make
 substitution for `Inv<A<U>>` and were getting abbreviated type
 `Inv<A<K>>` where `K` is a type parameter from the typealias declaration.

 This bug didn't affect subtyping anyhow but the incorrect type was
 serialized and caused problems during deserialization as there wasn't
 `K` in deserialization context.

 #KT-24964 Fixed
 #KT-20780 Fixed
 #KT-20065 Fixed
 #KT-28236 Fixed
 #KT-21775 Fixed
2019-02-25 00:28:45 +03:00
Stanislav Erokhin
f1d5912f05 Update Kotlin/Native: 1.2-rc1-7773 2019-02-23 11:39:10 +03:00
Georgy Bronnikov
67656a447a Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
3531f47bfb Remove descriptors from ToArrayLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c3652a47c6 Remove descriptors from JvmStaticAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
28bab6510e Remove descriptors from JvmOverloadsAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
f61072873f remove descriptors from createInnerClassConstructorWithOuterThisParameter 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
72ea4cc3d7 Remove descriptors from BridgeLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c9b8f58a10 Restore overriddenSymbols consistency in InterfaceDelegationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
68f9f4b3b5 Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
cb757f1cbc Remove descriptors from SyntheticAccessorLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
9078cb87e8 Remove descriptors from InitializersLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5d7a736cb1 Remove desriptors from ObjectClassLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5f4b8dd0aa Remove descriptors from EnumClassLowering 2019-02-23 00:42:16 +03:00
Ilya Gorbunov
8f6d73fd32 Use JS stdlib merger from bootstrap compiler 2019-02-22 21:22:19 +03:00
Ilya Gorbunov
0a0f81486f Advance bootstrap to 1.3.30-dev-1945 2019-02-22 21:22:07 +03:00
Dmitry Petrov
b792f3f12f KT-30020 expressions without resolved calls in augmented assignment LHS
Augmented assignment operator (e.g., '+=') can be resolved to simple
function call ('plusAssign'). In that case, augmented assignment LHS
can be an arbitrary expression, and may have no associated ResolvedCall.

For example:
    (a as MutableList<Int>) += 42

Note that it can happen only in case of augmented assignment operator
convention resolution, because all other forms of assignment-like
operator desugaring require some kind of 'store' operation
(property setter, 'set' operator for array element expression, etc),
and should resolve to some combination of calls.

In that case we simply generate LHS on 'load', and throw assertion on
'store'.
2019-02-22 17:45:27 +03:00
Ilmir Usmanov
1777849ff3 Generate correct linenumber for the debugger to see the return value
of suspend function.

 #KT-20322 Fixed
2019-02-22 17:37:32 +03:00
Nicolay Mitropolsky
9bf55d81ca Making kts-compiler able to dig out the ClassPath from the intellij PluginClassLoader 2019-02-22 13:51:47 +03:00
Ilmir Usmanov
ec7315e6da Add $completion entry to suspend functions' LVT
#KT-28810 Fixed
2019-02-22 13:50:35 +03:00
Dmitriy Novozhilov
677987c85f Add diagnostics on annotations on super types. KT-23992 fixed 2019-02-22 10:28:21 +03:00
Dmitriy Novozhilov
1fc6f30c50 Add test for KT-23992 2019-02-22 10:22:19 +03:00
Dmitriy Novozhilov
92bd907983 Fix checking repeatablilty of use-site target annotations. KT-26638 fixed 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
cfda468f13 Add test for KT-26638 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
3e147af3c0 KT-27565 fix 2019-02-22 10:15:16 +03:00
Dmitriy Novozhilov
cd2b8839b4 Add test for KT-27565 2019-02-22 10:15:16 +03:00
Ilya Gorbunov
eca1af4091 Temporary restore kotlin-stdlib-js-merger for bootstrapping 2019-02-22 02:37:31 +03:00
Ilya Gorbunov
98c6c925fc Move JS stdlib merger into cli compiler module
Refactor: use stdlib function to relativize paths.
2019-02-22 02:37:24 +03:00
Dmitry Gridin
b58bfff843 Fix paramTypeLambdaMismatch test 2019-02-21 19:08:02 +03:00
Kirill Shmakov
b695f20526 Candidate 2019-02-21 19:00:37 +03:00
Nikolay Krasko
e495bfc570 Stop failing when there's no CIDR classes during running tests 2019-02-21 18:01:57 +03:00
Ilya Chernikov
d1a1594f26 Remove redundant direct usages of the ScriptDefinition in compiler
plus some refactoring around definition extraction
2019-02-21 15:59:48 +01:00
Ilya Chernikov
5bc262fcb4 Add scripting resolver extension to the IDEA plugin as well 2019-02-21 15:59:48 +01:00
Ilya Chernikov
cc4aedb807 Move the rest of script descriptor implementation details to plugin, cleanup 2019-02-21 15:59:48 +01:00
Ilya Chernikov
29fa0f5dff Replace unnecessary direct usages of the LazyScriptDescriptor with ScriptDescriptor interface
lift result property to the interface to implement it
2019-02-21 15:59:48 +01:00
Ilya Chernikov
e28017039d Split scripts and class/object declarations in DeclarationsProvider
simplifies code in most places, avoids filtering in places where they
should be processed independently
2019-02-21 15:59:48 +01:00
Ilya Chernikov
a218455193 Extract script descriptor creation to scripting plugin 2019-02-21 15:59:48 +01:00
Ilya Chernikov
4359919e10 Add package-level class descriptors generation to the SyntheticResolveExtension
required for extracting script descriptors generation to an extension
2019-02-21 15:59:48 +01:00
Ilya Chernikov
0839b44ebb Replace explicit ScriptDescriptor in resolver with appropriate superclass 2019-02-21 15:59:47 +01:00
Ilmir Usmanov
6e120b2173 Do not generate state-machines for suspend lambdas, which capture any
crossinline lambda, not only suspend.
 #KT-29912 Fixed
2019-02-21 17:44:41 +03:00
Alexander Podkhalyuzin
931e1aa213 Removed 2x svg files from Android Studio 3.3 as it renders it anyway
#KT-29533 Fixed
2019-02-21 16:52:45 +03:00
20083 changed files with 660851 additions and 927716 deletions

14
.bunch
View File

@@ -1,8 +1,8 @@
183
182
181_182
as32_181_182
as33_182
as34
as35_as34
191
192
183
182_183
as33_182_183
as34_183
as35
as36_192

22
.gitignore vendored
View File

@@ -2,7 +2,7 @@
.idea/shelf
/android.tests.dependencies
/confluence/target
/dependencies
/dependencies/repo
/dist
/local
/gh-pages
@@ -15,10 +15,6 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
.gradle/
@@ -30,6 +26,7 @@ build/
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts/PILL_*.xml
.idea/artifacts/KotlinPlugin.xml
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
@@ -40,4 +37,19 @@ build/
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
.idea/artifacts/dist.xml
.idea/artifacts/ideaPlugin.xml
.idea/artifacts/kotlinc.xml
.idea/artifacts/kotlin_compiler_jar.xml
.idea/artifacts/kotlin_plugin_jar.xml
.idea/artifacts/kotlin_jps_plugin_jar.xml
.idea/artifacts/kotlin_daemon_client_jar.xml
.idea/artifacts/kotlin_imports_dumper_compiler_plugin_jar.xml
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
local.properties

8
.idea/ant.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/libraries/build-docs.xml">
<maximumHeapSize value="1024" />
</buildFile>
</component>
</project>

View File

@@ -1,27 +0,0 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="directory" name="artifacts">
<element id="directory" name="ideaPlugin">
<element id="artifact" artifact-name="ideaPlugin" />
</element>
</element>
<element id="file-copy" path="$PROJECT_DIR$/build/build.txt" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-minimal-for-test/1.3.30-dev-1419/3fc425e5a7e1979aad08d0f420f07c19c9c36d63/kotlin-stdlib-minimal-for-test-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-minimal-for-test.jar" />
<element id="directory" name="common">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/1edc4fbedf02e815e3d277c47640c9c79b5df72e/kotlin-stdlib-common-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-common.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/f83bc827e5ac23a35f2700edd716971ae9e50100/kotlin-stdlib-common-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-common-sources.jar" />
</element>
<element id="directory" name="js">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/4dd9f2176adacefa49984a277b71d7a1645ceda2/kotlin-stdlib-js-1.3.30-dev-1419.jar" path-in-jar="/" />
</element>
<element id="directory" name="maven">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/561605d51586e253a15097d3f1d386fb6758fdd4/kotlin-stdlib-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />
</element>
</root>
</artifact>
</component>

8
.idea/artifacts/dist_root.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist_root">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="artifact" artifact-name="dist" />
</root>
</artifact>
</component>

View File

@@ -1,215 +0,0 @@
<component name="ArtifactManager">
<artifact name="ideaPlugin">
<output-path>$PROJECT_DIR$/out/artifacts/ideaPlugin</output-path>
<root id="root">
<element id="directory" name="Kotlin">
<element id="directory" name="lib">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang/2.0.6/415b0d40db4890849270c2a5cb50050fc6ee7636/javaslang-2.0.6.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-jdk8/1.0.1/ee52dcd51dbdd3f94271cab32c76ce820adfe024/kotlinx-coroutines-jdk8-1.0.1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/markdown/0.1.25/f22b57c632b83433112102c9da9a0f8edf946091/markdown-0.1.25.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang-match/2.0.6/d57a666939103b659813de52102d3ff0baa8ad5f/javaslang-match-2.0.6.jar" />
<element id="archive" name="allopen-ide-plugin.jar">
<element id="module-output" name="kotlin.allopen-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-lint.jar">
<element id="module-output" name="kotlin.plugins.lint.main" />
<element id="module-output" name="kotlin.plugins.uast-kotlin.main" />
<element id="module-output" name="kotlin.plugins.uast-kotlin-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/android-lint/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-ide.jar">
<element id="module-output" name="kotlin.idea.idea-android.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-android/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-output-parser-ide.jar">
<element id="module-output" name="kotlin.idea.idea-android-output-parser.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="idea-git.jar">
<element id="module-output" name="kotlin.idea.idea-git.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-git/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="jps-common-ide.jar">
<element id="module-output" name="kotlin.idea.idea-jps-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-jps-common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="jvm-ide.jar">
<element id="module-output" name="kotlin.idea.idea-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="maven-ide.jar">
<element id="module-output" name="kotlin.idea.idea-maven.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-maven/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-gradle-tooling.jar">
<element id="module-output" name="kotlin.idea.kotlin-gradle-tooling.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/kotlin-gradle-tooling/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="j2k.jar">
<element id="module-output" name="kotlin.j2k.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/j2k/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-allopen-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-allopen-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-noarg-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-noarg-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-sam-with-receiver-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-util.jar">
<element id="module-output" name="kotlin.kotlin-script-util.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-script-util/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common.jar">
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/scripting/common/src" />
<element id="directory" name="main">
<element id="directory" name="kotlin" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-idea.jar">
<element id="module-output" name="kotlin.kotlin-scripting-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-intellij.jar">
<element id="module-output" name="kotlin.kotlin-scripting-intellij.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/intellij/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm.jar">
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/src" />
<element id="directory" name="main">
<element id="directory" name="kotlin" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-ide-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="noarg-ide-plugin.jar">
<element id="module-output" name="kotlin.noarg-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-compiler.main" />
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-ide.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-ide.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kapt3-idea.jar">
<element id="module-output" name="kotlin.plugins.kapt3-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime.jar">
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="sam-with-receiver-ide-plugin.jar">
<element id="module-output" name="kotlin.sam-with-receiver-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="directory" name="jps">
<element id="artifact" artifact-name="kotlin-jps-plugin.jar" />
</element>
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/285fde038cb28087a51aee95919d428a2511b443/kotlin-stdlib-jdk8-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk8.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/72c0c2470715b0aa18d5624c4fa9db0345b6c09f/kotlin-stdlib-jdk7-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk7.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/c4bca00118a72c8d59fbe3d2c6621e0d79f12095/kotlin-stdlib-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib.jar" />
<element id="artifact" artifact-name="kotlin-reflect.jar" />
<element id="artifact" artifact-name="kotlin-compiler-client-embeddable.jar" />
<element id="artifact" artifact-name="kotlin-plugin.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/1edc4fbedf02e815e3d277c47640c9c79b5df72e/kotlin-stdlib-common-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-common.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<element id="artifact" artifact-name="kotlin-daemon-client.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />
</element>
</element>
</root>
</artifact>
</component>

View File

@@ -1,29 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler-client-embeddable.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_client_embeddable_jar</output-path>
<root id="archive" name="kotlin-compiler-client-embeddable.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler-client-embeddable/build/tmp/shadowJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-client-embeddable.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
</root>
</artifact>
</component>

View File

@@ -1,72 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_jar</output-path>
<root id="archive" name="kotlin-compiler.jar">
<element id="directory" name="META-INF">
<element id="directory" name="extensions">
<element id="file-copy" path="$PROJECT_DIR$/idea/resources/META-INF/extensions/compiler.xml" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler/build/tmp/packCompiler/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/builtins/1.3.30-dev-1419/d204f62db9ed29f42e939e0e62c4ee933863e05b/builtins-1.3.30-dev-1419.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/asm-all-7.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/guava-25.1-jre.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij-core/intellij-core.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.16/b1aaf0028852164ab6b4057192ccd0ba7dedd3a5/jansi-1.16.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij-core/java-compatibility-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang/2.0.6/415b0d40db4890849270c2a5cb50050fc6ee7636/javaslang-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang-match/2.0.6/d57a666939103b659813de52102d3ff0baa8ad5f/javaslang-match-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jdom.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.3.1/d8a30137fe4ee2246b71b3915baac767d348c5bb/jline-3.3.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jna-platform.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jna.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/jps-standalone/jps-model.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/1.3.9/40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf/jsr305-1.3.9.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/log4j.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/lz4-1.3.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/oro-2.0.8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/picocontainer-1.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-relocated/2.6.1/9a9536949348fae596f4878243dffd0ed351993d/protobuf-relocated-2.6.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/streamex-0.6.7.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.backend-common.main" />
<element id="module-output" name="kotlin.compiler.backend.js.main" />
<element id="module-output" name="kotlin.compiler.backend.jvm.main" />
<element id="module-output" name="kotlin.compiler.backend.main" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.cli.main" />
<element id="module-output" name="kotlin.compiler.main" />
<element id="module-output" name="kotlin.compiler.container.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.compiler.daemon.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.compiler.frontend.java.main" />
<element id="module-output" name="kotlin.compiler.frontend.script.main" />
<element id="module-output" name="kotlin.compiler.frontend.main" />
<element id="module-output" name="kotlin.compiler.incremental-compilation-impl.main" />
<element id="module-output" name="kotlin.compiler.ir.backend.common.main" />
<element id="module-output" name="kotlin.compiler.ir.psi2ir.main" />
<element id="module-output" name="kotlin.compiler.ir.tree.main" />
<element id="module-output" name="kotlin.js.js.ast.main" />
<element id="module-output" name="kotlin.js.js.dce.main" />
<element id="module-output" name="kotlin.js.js.frontend.main" />
<element id="module-output" name="kotlin.js.js.parser.main" />
<element id="module-output" name="kotlin.js.js.serializer.main" />
<element id="module-output" name="kotlin.js.js.translator.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.compiler.light-classes.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.compiler.plugin-api.main" />
<element id="module-output" name="kotlin.compiler.psi.main" />
<element id="module-output" name="kotlin.compiler.resolution.main" />
<element id="module-output" name="kotlin.compiler.serialization.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="module-output" name="kotlin.compiler.frontend.common.main" />
</root>
</artifact>
</component>

View File

@@ -1,27 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-daemon-client.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_daemon_client_jar</output-path>
<root id="archive" name="kotlin-daemon-client.jar">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/daemon/daemon-client/build/tmp/shadowJar/MANIFEST.MF" />
</element>
</root>
</artifact>
</component>

View File

@@ -1,12 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-imports-dumper-compiler-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_imports_dumper_compiler_plugin_jar</output-path>
<root id="archive" name="kotlin-imports-dumper-compiler-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/imports-dumper/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-runtime/0.4.2/e343c68c9fa77a190225484c1e03b1485fbb5f1f/kotlinx-serialization-runtime-0.4.2.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-imports-dumper-compiler-plugin.main" />
</root>
</artifact>
</component>

View File

@@ -1,38 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-jps-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_jps_plugin_jar</output-path>
<root id="archive" name="kotlin-jps-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/jps-plugin/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.idea.idea-jps-common.main" />
<element id="module-output" name="kotlin.jps-plugin.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-runner.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
</root>
</artifact>
</component>

View File

@@ -1,17 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-main-kts.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_main_kts_jar</output-path>
<root id="archive" name="kotlin-main-kts.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-main-kts/build/tmp/packJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ivy/ivy/2.4.0/5abe4c24bbe992a9ac07ca563d5bd3e8d569e9ed/ivy-2.4.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-main-kts.main" />
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="module-output" name="kotlin.kotlin-script-util.main" />
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
</root>
</artifact>
</component>

View File

@@ -1,57 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_plugin_jar</output-path>
<root id="archive" name="kotlin-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/idea-plugin/build/tmp/shadowJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/builtins/1.3.30-dev-1419/d204f62db9ed29f42e939e0e62c4ee933863e05b/builtins-1.3.30-dev-1419.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-relocated/2.6.1/9a9536949348fae596f4878243dffd0ed351993d/protobuf-relocated-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.plugins.annotation-based-compiler-plugins-ide-support.main" />
<element id="module-output" name="kotlin.compiler.backend-common.main" />
<element id="module-output" name="kotlin.compiler.backend.main" />
<element id="module-output" name="kotlin.compiler.backend.jvm.main" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.container.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.eval4j.main" />
<element id="module-output" name="kotlin.idea.fir-view.main" />
<element id="module-output" name="kotlin.compiler.frontend.java.main" />
<element id="module-output" name="kotlin.compiler.frontend.script.main" />
<element id="module-output" name="kotlin.compiler.frontend.main" />
<element id="module-output" name="kotlin.idea.ide-common.main" />
<element id="module-output" name="kotlin.idea.idea-core.main" />
<element id="module-output" name="kotlin.idea.formatter.main" />
<element id="module-output" name="kotlin.idea.idea-gradle-native.main" />
<element id="module-output" name="kotlin.idea.idea-gradle.main" />
<element id="module-output" name="kotlin.idea.idea-native.main" />
<element id="module-output" name="kotlin.idea.main" />
<element id="module-output" name="kotlin.compiler.ir.backend.common.main" />
<element id="module-output" name="kotlin.compiler.ir.psi2ir.main" />
<element id="module-output" name="kotlin.compiler.ir.tree.main" />
<element id="module-output" name="kotlin.js.js.ast.main" />
<element id="module-output" name="kotlin.js.js.frontend.main" />
<element id="module-output" name="kotlin.js.js.parser.main" />
<element id="module-output" name="kotlin.js.js.serializer.main" />
<element id="module-output" name="kotlin.js.js.translator.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.kotlin-native.kotlin-native-library-reader.main" />
<element id="module-output" name="kotlin.kotlin-native.kotlin-native-utils.main" />
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="module-output" name="kotlin.compiler.light-classes.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.compiler.plugin-api.main" />
<element id="module-output" name="kotlin.compiler.psi.main" />
<element id="module-output" name="kotlin.compiler.resolution.main" />
<element id="module-output" name="kotlin.compiler.serialization.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="kotlin.compiler.frontend.common.main" />
</root>
</artifact>
</component>

View File

@@ -1,21 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-reflect.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_reflect_jar</output-path>
<root id="archive" name="kotlin-reflect.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/result/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-lite/2.6.1/9af39e6d6cbd4404d06ae2ae63505b6247e6760b/protobuf-lite-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.runtime.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.kotlin-reflect-api.main" />
<element id="module-output" name="kotlin.kotlin-reflect.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
</root>
</artifact>
</component>

View File

@@ -1,252 +0,0 @@
<component name="ArtifactManager">
<artifact name="kotlinc">
<output-path>$PROJECT_DIR$/out/artifacts/kotlinc</output-path>
<root id="root">
<element id="directory" name="bin">
<element id="dir-copy" path="$PROJECT_DIR$/compiler/cli/bin" />
</element>
<element id="directory" name="lib">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<element id="file-copy" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/trove4j.jar" />
<element id="archive" name="allopen-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-allopen-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-runtime.jar">
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-base.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-cli.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-runtime.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-android.jar">
<element id="module-output" name="kotlin.kotlin-annotations-android.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-android/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm.jar">
<element id="module-output" name="kotlin.kotlin-annotations-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/src" />
<element id="directory" name="main">
<element id="directory" name="resources" />
<element id="directory" name="kotlin" />
<element id="directory" name="java" />
</element>
<element id="directory" name="test">
<element id="directory" name="resources" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-ant.jar">
<element id="module-output" name="kotlin.kotlin-ant.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/ant/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="noarg-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-noarg-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-preloader.jar">
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/preloader/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-reflect-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.jvm/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/deserialization/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/util.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/reflection.jvm/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-runner.jar">
<element id="module-output" name="kotlin.kotlin-runner.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/cli/cli-runner/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-sam-with-receiver-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime.jar">
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/script.runtime/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common.jar">
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm.jar">
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-source-sections-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-source-sections-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-js.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit5.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-testng.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="mutability-annotations-compat.jar">
<element id="module-output" name="kotlin.libraries.tools.mutability-annotations-compat.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/mutability-annotations-compat/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-compiler.main" />
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/285fde038cb28087a51aee95919d428a2511b443/kotlin-stdlib-jdk8-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk8.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/72c0c2470715b0aa18d5624c4fa9db0345b6c09f/kotlin-stdlib-jdk7-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk7.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/c4bca00118a72c8d59fbe3d2c6621e0d79f12095/kotlin-stdlib-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/e2746fab1a3723c30250a10362be8c12e3d2bdd/kotlin-stdlib-jdk7-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-jdk7-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/40b256e6fd67b3217ac2aefcb70c4bf2f5d76f4f/kotlin-stdlib-jdk8-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-jdk8-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/cc7460047507b64f44b9e156dbcaa3079fc43594/kotlin-stdlib-js-1.3.30-dev-1419-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/4dd9f2176adacefa49984a277b71d7a1645ceda2/kotlin-stdlib-js-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-js.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/561605d51586e253a15097d3f1d386fb6758fdd4/kotlin-stdlib-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
<element id="artifact" artifact-name="kotlin-compiler.jar" />
<element id="artifact" artifact-name="kotlin-reflect.jar" />
<element id="artifact" artifact-name="kotlin-daemon-client.jar" />
<element id="artifact" artifact-name="kotlin-main-kts.jar" />
<element id="artifact" artifact-name="kotlin-imports-dumper-compiler-plugin.jar" />
<element id="archive" name="jvm-abi-gen.jar">
<element id="module-output" name="kotlin.plugins.jvm-abi-gen.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/jvm-abi-gen/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
</element>
<element id="directory" name="license">
<element id="dir-copy" path="$PROJECT_DIR$/license" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/bootstrap/build.txt" />
</root>
</artifact>
</component>

View File

@@ -1,7 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="allowReplaceRegexp" value="JetBrains" />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license &#10;that can be found in the license/LICENSE.txt file." />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. and Kotlin Programming Language contributors.&#10;Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file." />
<option name="myName" value="apache" />
</copyright>
</component>

View File

@@ -4,8 +4,11 @@
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>jdks</w>
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
<w>unpresent</w>
</words>
</dictionary>
</component>

View File

@@ -19,12 +19,15 @@
<w>preloader</w>
<w>preloading</w>
<w>preprocess</w>
<w>proximities</w>
<w>redeclarations</w>
<w>reparsed</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>
<w>tailrec</w>
<w>typealias</w>
</words>
</dictionary>
</component>

View File

@@ -3,12 +3,15 @@
<words>
<w>debuggee</w>
<w>deserializes</w>
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>kapt</w>
<w>kotlinc</w>
<w>parceler</w>
<w>repl</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>
<w>unmute</w>
</words>

View File

@@ -21,7 +21,6 @@
</inspection_tool>
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastConflictsWithInstanceof" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEquality" enabled="false" level="WARNING" enabled_by_default="true" />
@@ -76,6 +75,7 @@
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="ForLoopThatDoesntUseLoopVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
@@ -98,29 +98,22 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<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.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<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="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<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." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList()" reason="Absent in 182 and before." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions()" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#hasAnyExtensions" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getPoint" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#findExtensionOrFail" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.ui.popup.PopupChooserBuilder#PopupChooserBuilder(javax.swing.JList)" reason="Generified in 182. Use PopupChooserBuilderWrapper instead." />
<Problem reference="com.intellij.openapi.editor.event.EditorFactoryListener" reason="Default implementations were added in 183. Use EditorFactoryListenerWrapper for inheritance instead." />
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<Problem reference="com.intellij.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper#getInstance" reason="Absent in 181. Use psiSearchHelperInstance() instead." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper.SERVICE" reason="Deprecated since 182. Use psiSearchHelperInstance() instead." />
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.codeInspection.dataFlow.Nullness" reason="Deprecated since 182. Use org.jetbrains.kotlin.idea.util.compat.Nullability instead." />
</list>
</option>
</inspection_tool>
@@ -273,6 +266,10 @@
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
<option name="sinceBuildString" value="182.0" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -304,16 +301,6 @@
<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">
@@ -329,16 +316,11 @@
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
<searchConfiguration name="SwingUtilities.invokeLater" text="SwingUtilities.invokeLater($runnable$)" recursive="false" caseInsensitive="false" type="JAVA">
<constraint name="Instance" regexp="SwingUtilities" minCount="0" target="true" within="" contains="" />
<constraint name="MethodCall" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
<constraint name="runnable" within="" contains="" />
</searchConfiguration>
<replaceConfiguration name="DirectCallOfDispose" text="$Instance$.dispose()" recursive="false" caseInsensitive="false" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="Disposer.dispose($Instance$)">
<constraint name="Instance" regexp="super" nameOfExprType="Disposable" withinHierarchy="true" exprTypeWithinHierarchy="true" minCount="0" negateName="true" within="" contains="" />
<constraint name="MethodCall" target="true" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
</replaceConfiguration>
<replaceConfiguration name="new Object[0]" text="new Object[0]" recursive="false" caseInsensitive="true" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="com.intellij.util.ArrayUtil.EMPTY_OBJECT_ARRAY" />
@@ -402,6 +384,7 @@
</inspection_tool>
<inspection_tool class="StringEquality" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StringOperationCanBeSimplifiedMerged" />
<inspection_tool class="SwitchStatementWithConfusingDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true">

View File

@@ -1,7 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="idea.default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

6
.idea/kotlinScripting.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinScriptingSettings">
<option name="isAutoReloadEnabled" value="true" />
</component>
</project>

15
.idea/misc.xml generated
View File

@@ -39,14 +39,9 @@
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/libraries/pom.xml" />
</list>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="9">
@@ -84,6 +79,9 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">
<option name="splitDividerLocation" value="35" />
</component>
<component name="SuppressABINotification">
<option name="modulesWithSuppressedNotConfigured">
<set>
@@ -100,4 +98,7 @@
<option name="autoscroll" value="false" />
<option name="showOnlyWarnings" value="false" />
</component>
<component name="intellij-api-watcher-check-current-project">
<option name="shouldCheckCurrentProject" value="true" />
</component>
</project>

View File

@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-Pidea.is.internal=false" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
</configuration>
</component>

View File

@@ -1,5 +1,925 @@
# CHANGELOG
## 1.3.41
### Compiler
- [`KT-31981`](https://youtrack.jetbrains.com/issue/KT-31981) New type inference asks to use ?. on non-null local variable
- [`KT-32029`](https://youtrack.jetbrains.com/issue/KT-32029) Exception when callable reference is resolved against unresolved type
- [`KT-32037`](https://youtrack.jetbrains.com/issue/KT-32037) No coercion to Unit for last expression with lambda in code block
- [`KT-32038`](https://youtrack.jetbrains.com/issue/KT-32038) Unsubstituted stub type cause type mismatch later for builder inference
- [`KT-32051`](https://youtrack.jetbrains.com/issue/KT-32051) NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
- [`KT-32081`](https://youtrack.jetbrains.com/issue/KT-32081) New type inference fails involving Either and Nothing
- [`KT-32089`](https://youtrack.jetbrains.com/issue/KT-32089) False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
- [`KT-32094`](https://youtrack.jetbrains.com/issue/KT-32094) NI: member from star import has higher resolution priority than member imported by FQN
- [`KT-32116`](https://youtrack.jetbrains.com/issue/KT-32116) Type inference for HashMap<*,*> fails but compiles
- [`KT-32123`](https://youtrack.jetbrains.com/issue/KT-32123) Wrong unused import for extension method
- [`KT-32133`](https://youtrack.jetbrains.com/issue/KT-32133) Regression in Kotlin 1.3.40 new inference engine
- [`KT-32134`](https://youtrack.jetbrains.com/issue/KT-32134) `java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call` for incomplete try-construction
- [`KT-32143`](https://youtrack.jetbrains.com/issue/KT-32143) 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
- [`KT-32154`](https://youtrack.jetbrains.com/issue/KT-32154) setOf(Map.Entry<*, *>::key) gives error on IDE
- [`KT-32157`](https://youtrack.jetbrains.com/issue/KT-32157) Issue with new type inference in unbounded generics
- [`KT-32175`](https://youtrack.jetbrains.com/issue/KT-32175) New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
- [`KT-32184`](https://youtrack.jetbrains.com/issue/KT-32184) NI: Argument for @NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
- [`KT-32187`](https://youtrack.jetbrains.com/issue/KT-32187) Exception when using callable reference with an unresolved LHS
- [`KT-32218`](https://youtrack.jetbrains.com/issue/KT-32218) Cannot call get on a Map<out Any,Any> with new type system
- [`KT-32230`](https://youtrack.jetbrains.com/issue/KT-32230) New inference not working with RxJava combineLatest
- [`KT-32235`](https://youtrack.jetbrains.com/issue/KT-32235) New type inference failure with `in` check
### JavaScript
- [`KT-32215`](https://youtrack.jetbrains.com/issue/KT-32215) Reified generic doesn't work with `ByteArray` on js
### Tools. CLI
- [`KT-32272`](https://youtrack.jetbrains.com/issue/KT-32272) kotlinc - no main manifest attribute, in hello.jar
### Tools. REPL
- [`KT-32085`](https://youtrack.jetbrains.com/issue/KT-32085) Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"
### Tools. Scripts
- [`KT-32169`](https://youtrack.jetbrains.com/issue/KT-32169) Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs.<init>"
- [`KT-32206`](https://youtrack.jetbrains.com/issue/KT-32206) Custom script definitions not loaded in the cli compiler
## 1.3.40
### Android
#### Fixes
- [`KT-12402`](https://youtrack.jetbrains.com/issue/KT-12402) Android DataBinding work correctly but the IDE show it as error
- [`KT-31432`](https://youtrack.jetbrains.com/issue/KT-31432) Remove obsolete code introduced in KT-12402
### Compiler
#### New Features
- [`KT-29915`](https://youtrack.jetbrains.com/issue/KT-29915) Implement `typeOf` on JVM
- [`KT-30467`](https://youtrack.jetbrains.com/issue/KT-30467) Provide a way to to save compiled script(s) as a jar
#### Performance Improvements
- [`KT-17755`](https://youtrack.jetbrains.com/issue/KT-17755) Optimize trimIndent and trimMargin on constant strings
- [`KT-30603`](https://youtrack.jetbrains.com/issue/KT-30603) Compiler performance issue: VariableLivenessKt.useVar performance
#### Fixes
- [`KT-19227`](https://youtrack.jetbrains.com/issue/KT-19227) Load built-ins from dependencies by default in the compiler, support erroneous "fallback" built-ins
- [`KT-23426`](https://youtrack.jetbrains.com/issue/KT-23426) Actual typealias to Java enum does not match expected enum because of modality
- [`KT-23854`](https://youtrack.jetbrains.com/issue/KT-23854) Inference for common type of two captured types
- [`KT-25105`](https://youtrack.jetbrains.com/issue/KT-25105) False-positive warning "Remove final upper bound" on generic override
- [`KT-25302`](https://youtrack.jetbrains.com/issue/KT-25302) New inference: "Type mismatch" between star projection and `Any?` type argument in specific case
- [`KT-25433`](https://youtrack.jetbrains.com/issue/KT-25433) Wrong order of fixing type variables for callable references
- [`KT-26386`](https://youtrack.jetbrains.com/issue/KT-26386) Front-end recursion problem while analyzing contract function with call expression of self in implies
- [`KT-26412`](https://youtrack.jetbrains.com/issue/KT-26412) Wrong LVT generated if decomposed parameter of suspend lambda is not the first parameter.
- [`KT-27097`](https://youtrack.jetbrains.com/issue/KT-27097) JvmMultifileClass + JvmName causes NoSuchMethodError on sealed class hierarchy for top-level members
- [`KT-28534`](https://youtrack.jetbrains.com/issue/KT-28534) Local variable entries are missing in LVT for suspend lambda parameters
- [`KT-28535`](https://youtrack.jetbrains.com/issue/KT-28535) Rename `result` to `$result` in coroutines' LVT
- [`KT-29184`](https://youtrack.jetbrains.com/issue/KT-29184) Implement inference for coroutines according to the @BuilderInference contract in NI
- [`KT-29772`](https://youtrack.jetbrains.com/issue/KT-29772) Contracts don't work if `contract` function is fully qualified (FQN)
- [`KT-29790`](https://youtrack.jetbrains.com/issue/KT-29790) Incorrect version requirement in metadata of anonymous class for suspend lambda
- [`KT-29948`](https://youtrack.jetbrains.com/issue/KT-29948) NI: incorrect DSLMarker behaviour with generic star projection
- [`KT-30021`](https://youtrack.jetbrains.com/issue/KT-30021) +NewInference on Kotlin Native :: java.lang.StackOverflowError
- [`KT-30242`](https://youtrack.jetbrains.com/issue/KT-30242) Statements are not coerced to Unit in last expressions of lambda
- [`KT-30243`](https://youtrack.jetbrains.com/issue/KT-30243) Include FIR modules into compiler
- [`KT-30250`](https://youtrack.jetbrains.com/issue/KT-30250) Rewrite at slice exception for callable reference argument inside delegated expression
- [`KT-30292`](https://youtrack.jetbrains.com/issue/KT-30292) Reference to function is unresolved when LHS is a star-projected type
- [`KT-30293`](https://youtrack.jetbrains.com/issue/KT-30293) Wrong intersection type for common supertype from String and integer type
- [`KT-30370`](https://youtrack.jetbrains.com/issue/KT-30370) Call is completed too early when there is "Nothing" constraint
- [`KT-30405`](https://youtrack.jetbrains.com/issue/KT-30405) Support expected type from cast in new inference
- [`KT-30406`](https://youtrack.jetbrains.com/issue/KT-30406) Fix testIfOrWhenSpecialCall test for new inference
- [`KT-30590`](https://youtrack.jetbrains.com/issue/KT-30590) Report diagnostic about not enough information for inference in NI
- [`KT-30620`](https://youtrack.jetbrains.com/issue/KT-30620) Exception from the compiler when coroutine-inference is involved even with the explicitly specified types
- [`KT-30656`](https://youtrack.jetbrains.com/issue/KT-30656) Exception is occurred when functions with implicit return-stub types are involved in builder-inference
- [`KT-30658`](https://youtrack.jetbrains.com/issue/KT-30658) Exception from the compiler when getting callable reference to a suspend function
- [`KT-30661`](https://youtrack.jetbrains.com/issue/KT-30661) Disable SAM conversions to Kotlin functions in new-inference by default
- [`KT-30676`](https://youtrack.jetbrains.com/issue/KT-30676) Overload resolution ambiguity when there is a callable reference argument and candidates with different functional return types
- [`KT-30694`](https://youtrack.jetbrains.com/issue/KT-30694) No debug metadata is generated for suspend lambdas which capture crossinline
- [`KT-30724`](https://youtrack.jetbrains.com/issue/KT-30724) False positive error about missing equals when one of the operands is incorrectly inferred to Nothing
- [`KT-30734`](https://youtrack.jetbrains.com/issue/KT-30734) No smartcast inside lambda literal in then/else "if" branch
- [`KT-30737`](https://youtrack.jetbrains.com/issue/KT-30737) Try analysing callable reference preemptively
- [`KT-30780`](https://youtrack.jetbrains.com/issue/KT-30780) Compiler crashes on 'private inline' function accessing private constant in 'inline class' (regression)
- [`KT-30808`](https://youtrack.jetbrains.com/issue/KT-30808) NI: False negative SPREAD_OF_NULLABLE with USELESS_ELVIS_RIGHT_IS_NULL
- [`KT-30816`](https://youtrack.jetbrains.com/issue/KT-30816) BasicJvmScriptEvaluator passes constructor parameters in incorrect order
- [`KT-30826`](https://youtrack.jetbrains.com/issue/KT-30826) There isn't report about unsafe call in the new inference (by invalidating smartcast), NPE
- [`KT-30843`](https://youtrack.jetbrains.com/issue/KT-30843) Duplicate JVM class name for expect/actual classes in JvmMultifileClass-annotated file
- [`KT-30853`](https://youtrack.jetbrains.com/issue/KT-30853) Compiler crashes with NewInference and Kotlinx.Coroutines Flow
- [`KT-30927`](https://youtrack.jetbrains.com/issue/KT-30927) Data flow info isn't used for 'this' which is returned from lambda using labeled return
- [`KT-31081`](https://youtrack.jetbrains.com/issue/KT-31081) Implement ArgumentMatch abstraction in new inference
- [`KT-31113`](https://youtrack.jetbrains.com/issue/KT-31113) Fix failing tests from SlicerTestGenerated
- [`KT-31199`](https://youtrack.jetbrains.com/issue/KT-31199) Unresolved callable references with typealias
- [`KT-31339`](https://youtrack.jetbrains.com/issue/KT-31339) Inliner does not remove redundant continuation classes, leading to CNFE in JMH bytecode processing
- [`KT-31346`](https://youtrack.jetbrains.com/issue/KT-31346) Fix diagnostic DSL_SCOPE_VIOLATION for new inference
- [`KT-31356`](https://youtrack.jetbrains.com/issue/KT-31356) False-positive error about violating dsl scope for new-inference
- [`KT-31360`](https://youtrack.jetbrains.com/issue/KT-31360) NI: inconsistently prohibits member usage without explicit receiver specification with star projection and DSL marker
- [`KT-18563`](https://youtrack.jetbrains.com/issue/KT-18563) Do not generate inline reified functions as private in bytecode
- [`KT-20849`](https://youtrack.jetbrains.com/issue/KT-20849) Inference results in Nothing type argument in case of passing 'out T' to 'in T1'
- [`KT-25290`](https://youtrack.jetbrains.com/issue/KT-25290) New inference: KNPE at ResolutionPartsKt.getExpectedTypeWithSAMConversion() on out projection of Java class
- [`KT-26418`](https://youtrack.jetbrains.com/issue/KT-26418) Back-end (JVM) Internal error when compiling decorated suspend inline functions
- [`KT-26925`](https://youtrack.jetbrains.com/issue/KT-26925) Decorated suspend inline function continuation resumes in wrong spot
- [`KT-28999`](https://youtrack.jetbrains.com/issue/KT-28999) Prohibit type parameters for anonymous objects
- [`KT-29307`](https://youtrack.jetbrains.com/issue/KT-29307) New inference: false negative CONSTANT_EXPECTED_TYPE_MISMATCH with a Map
- [`KT-29475`](https://youtrack.jetbrains.com/issue/KT-29475) IllegalArgumentException at getAbstractTypeFromDescriptor with deeply nested expression inside function named with a right parenthesis
- [`KT-29996`](https://youtrack.jetbrains.com/issue/KT-29996) Properly report errors on attempt to inline bytecode from class files compiled to 1.8 to one compiling to 1.6
- [`KT-30289`](https://youtrack.jetbrains.com/issue/KT-30289) Don't generate annotations on synthetic methods for methods with default values for parameters
- [`KT-30410`](https://youtrack.jetbrains.com/issue/KT-30410) [NI] Front-end recursion problem while analyzing contract function with call expression of self in implies
- [`KT-30411`](https://youtrack.jetbrains.com/issue/KT-30411) Fold recursive types to star-projected ones when inferring type variables
- [`KT-30706`](https://youtrack.jetbrains.com/issue/KT-30706) Passing noinline lambda as (cross)inline parameter result in wrong state-machine
- [`KT-30707`](https://youtrack.jetbrains.com/issue/KT-30707) Java interop of coroutines inside inline functions is broken
- [`KT-30983`](https://youtrack.jetbrains.com/issue/KT-30983) ClassCastException: DeserializedTypeAliasDescriptor cannot be cast to PackageViewDescriptor on star-import of expect enum class actualized with typealias
- [`KT-31242`](https://youtrack.jetbrains.com/issue/KT-31242) "Can't find enclosing method" proguard compilation exception with inline and crossinline
- [`KT-31347`](https://youtrack.jetbrains.com/issue/KT-31347) "IndexOutOfBoundsException: Insufficient maximum stack size" with crossinline and suspend
- [`KT-31354`](https://youtrack.jetbrains.com/issue/KT-31354) Suspend inline functions with crossinline parameters are inaccessible from java
- [`KT-31367`](https://youtrack.jetbrains.com/issue/KT-31367) IllegalStateException: Concrete fake override public open fun (...) defined in TheIssue[PropertyGetterDescriptorImpl@1a03c376] should have exactly one concrete super-declaration: []
- [`KT-31461`](https://youtrack.jetbrains.com/issue/KT-31461) NI: NONE_APPLICABLE instead of TYPE_MISMATCH when invoking convention plus operator
- [`KT-31503`](https://youtrack.jetbrains.com/issue/KT-31503) Type mismatch with recursive types and SAM conversions
- [`KT-31507`](https://youtrack.jetbrains.com/issue/KT-31507) Enable new type inference algorithm for IDE analysis
- [`KT-31514`](https://youtrack.jetbrains.com/issue/KT-31514) New inference generates multiple errors on generic inline expression with elvis operator
- [`KT-31520`](https://youtrack.jetbrains.com/issue/KT-31520) False positive "not enough information" for constraint with star projection and covariant type
- [`KT-31606`](https://youtrack.jetbrains.com/issue/KT-31606) Rewrite at slice on using callable reference with array access operator
- [`KT-31620`](https://youtrack.jetbrains.com/issue/KT-31620) False-positive "not enough information" for coroutine-inference when target method is assigned to a variable
- [`KT-31624`](https://youtrack.jetbrains.com/issue/KT-31624) Type from declared upper bound in Java is considered more specific than Nothing producing type mismatch later
- [`KT-31860`](https://youtrack.jetbrains.com/issue/KT-31860) Explicit type argument isn't considered as input type causing errors about "only input types"
- [`KT-31866`](https://youtrack.jetbrains.com/issue/KT-31866) Problems with using star-projections on LHS of callable reference
- [`KT-31868`](https://youtrack.jetbrains.com/issue/KT-31868) No type mismatch error when using NoInfer annotation
- [`KT-31941`](https://youtrack.jetbrains.com/issue/KT-31941) Good code red in IDE with smart cast on parameter of a generic type after null check
### IDE
#### New Features
- [`KT-11242`](https://youtrack.jetbrains.com/issue/KT-11242) Action to copy project diagnostic information to clipboard
- [`KT-24292`](https://youtrack.jetbrains.com/issue/KT-24292) Support external nullability annotations
- [`KT-30453`](https://youtrack.jetbrains.com/issue/KT-30453) Add plugin option (registry?) to enable new inference only in IDE
#### Performance Improvements
- [`KT-13841`](https://youtrack.jetbrains.com/issue/KT-13841) Classes and functions should be lazy-parseable
- [`KT-27106`](https://youtrack.jetbrains.com/issue/KT-27106) Performance issue with optimize imports
- [`KT-30442`](https://youtrack.jetbrains.com/issue/KT-30442) Several second lag on project open in KotlinNonJvmSourceRootConverterProvider
- [`KT-30644`](https://youtrack.jetbrains.com/issue/KT-30644) ConfigureKotlinInProjectUtilsKt freezes UI
#### Fixes
- [`KT-7380`](https://youtrack.jetbrains.com/issue/KT-7380) Imports insertion on paste does not work correctly when there were alias imports in the source file
- [`KT-10512`](https://youtrack.jetbrains.com/issue/KT-10512) Do not delete imports with unresolved parts when optimizing
- [`KT-13048`](https://youtrack.jetbrains.com/issue/KT-13048) "Strip trailing spaces on Save" should not strip trailing spaces inside multiline strings in Kotlin
- [`KT-17375`](https://youtrack.jetbrains.com/issue/KT-17375) Optimize Imports does not remove unused import alias
- [`KT-27385`](https://youtrack.jetbrains.com/issue/KT-27385) Uast: property references should resolve to getters/setters
- [`KT-28627`](https://youtrack.jetbrains.com/issue/KT-28627) Invalid detection of Kotlin jvmTarget inside Idea/gradle build
- [`KT-29267`](https://youtrack.jetbrains.com/issue/KT-29267) Enable ultra-light classes by default
- [`KT-29892`](https://youtrack.jetbrains.com/issue/KT-29892) A lot of threads are waiting in KotlinConfigurationCheckerComponent
- [`KT-30356`](https://youtrack.jetbrains.com/issue/KT-30356) Kotlin facet: all JVM 9+ target platforms are shown as "Target Platform = JVM 9" in Project Structure dialog
- [`KT-30514`](https://youtrack.jetbrains.com/issue/KT-30514) Auto-import with "Add unambiguous imports on the fly" imports enum members from another package
- [`KT-30583`](https://youtrack.jetbrains.com/issue/KT-30583) Kotlin light elements should be `isEquivalentTo` to it's origins
- [`KT-30688`](https://youtrack.jetbrains.com/issue/KT-30688) Memory leak in the PerModulePackageCacheService.onTooComplexChange method
- [`KT-30949`](https://youtrack.jetbrains.com/issue/KT-30949) Optimize Imports removes used import alias
- [`KT-30957`](https://youtrack.jetbrains.com/issue/KT-30957) Kotlin UAST: USimpleNameReferenceExpression in "imports" for class' member resolves incorrectly to class, not to the member
- [`KT-31090`](https://youtrack.jetbrains.com/issue/KT-31090) java.lang.NoSuchMethodError: org.jetbrains.kotlin.idea.UtilsKt.addModuleDependencyIfNeeded on import of a multiplatform project with Android target (191 IDEA + master)
- [`KT-31092`](https://youtrack.jetbrains.com/issue/KT-31092) Don't check all selected files in CheckComponentsUsageSearchAction.update()
- [`KT-31319`](https://youtrack.jetbrains.com/issue/KT-31319) False positive "Unused import" for `provideDelegate` extension
- [`KT-31332`](https://youtrack.jetbrains.com/issue/KT-31332) Kotlin AnnotatedElementsSearch does't support Kotlin `object`
- [`KT-31129`](https://youtrack.jetbrains.com/issue/KT-31129) Call only Kotlin-specific reference contributors for getting Kotlin references from PSI
- [`KT-31693`](https://youtrack.jetbrains.com/issue/KT-31693) Project with no Kotlin: JPS rebuild fails with NCDFE for GradleSettingsService at KotlinMPPGradleProjectTaskRunner.canRun()
- [`KT-31466`](https://youtrack.jetbrains.com/issue/KT-31466) SOE in Java highlighting when a Kotlin ultra-light method is invoked
- [`KT-31723`](https://youtrack.jetbrains.com/issue/KT-31723) Exception from UAST for attempt to infer types inside unresolved call
- [`KT-31842`](https://youtrack.jetbrains.com/issue/KT-31842) UOE: no descriptor for type constructor of TypeVariable(T)
- [`KT-31992`](https://youtrack.jetbrains.com/issue/KT-31992) Fix ColorsIcon.scale(float) compatibility issue between IU-192.5118.30 and 1.3.40-eap-105
### IDE. Completion
- [`KT-29038`](https://youtrack.jetbrains.com/issue/KT-29038) Autocomplete "suspend" into "suspend fun" at top level and class level (except in kts top level)
- [`KT-29398`](https://youtrack.jetbrains.com/issue/KT-29398) Add "arg" postfix template
- [`KT-30511`](https://youtrack.jetbrains.com/issue/KT-30511) Replace extra space after autocompleting data class with file name by parentheses
### IDE. Debugger
- [`KT-10636`](https://youtrack.jetbrains.com/issue/KT-10636) Debugger: can't evaluate call of function type parameter inside inline function
- [`KT-18247`](https://youtrack.jetbrains.com/issue/KT-18247) Debugger: class level watches fail to evaluate outside of class instance context
- [`KT-18263`](https://youtrack.jetbrains.com/issue/KT-18263) Settings / Debugger / Java Type Renderers: unqualified Kotlin class members in Java expressions are shown as errors
- [`KT-23586`](https://youtrack.jetbrains.com/issue/KT-23586) Non-trivial properties autocompletion in evaluation window
- [`KT-30216`](https://youtrack.jetbrains.com/issue/KT-30216) Evaluate expression: declarations annotated with Experimental (LEVEL.ERROR) fail due to compilation error
- [`KT-30610`](https://youtrack.jetbrains.com/issue/KT-30610) Debugger: Variables view shows second `this` instance for inline function even from the same class as caller function
- [`KT-30714`](https://youtrack.jetbrains.com/issue/KT-30714) Breakpoints are shown as invalid for classes that are not loaded yet
- [`KT-30934`](https://youtrack.jetbrains.com/issue/KT-30934) "InvocationException: Exception occurred in target VM" on debugger breakpoint hit (with kotlintest)
- [`KT-31266`](https://youtrack.jetbrains.com/issue/KT-31266) Kotlin debugger incompatibility with latest 192 nightly: KotlinClassWithDelegatedPropertyRenderer
- [`KT-31785`](https://youtrack.jetbrains.com/issue/KT-31785) Exception on attempt to evaluate local function
### IDE. Gradle
- [`KT-29854`](https://youtrack.jetbrains.com/issue/KT-29854) File collection dependency does not work with NMPP+JPS
- [`KT-30531`](https://youtrack.jetbrains.com/issue/KT-30531) Gradle: NodeJS downloading
- [`KT-30767`](https://youtrack.jetbrains.com/issue/KT-30767) Kotlin import uses too much memory when working with big projects
- [`KT-29564`](https://youtrack.jetbrains.com/issue/KT-29564) kotlin.parallel.tasks.in.project=true causes idea to create kotlin modules with target JVM 1.6
- [`KT-31014`](https://youtrack.jetbrains.com/issue/KT-31014) Gradle, JS: Webpack watch mode
- [`KT-31843`](https://youtrack.jetbrains.com/issue/KT-31843) Memory leak caused by KOTLIN_TARGET_DATA_NODE on project reimport
- [`KT-31952`](https://youtrack.jetbrains.com/issue/KT-31952) Fix compatibility issues with IDEA after fixing IDEA-187832
### IDE. Gradle. Script
- [`KT-30638`](https://youtrack.jetbrains.com/issue/KT-30638) "Highlighting in scripts is not available until all Script Dependencies are loaded" in Diff viewer
- [`KT-31124`](https://youtrack.jetbrains.com/issue/KT-31124) “compileKotlin - configuration not found: kotlinScriptDef, the plugin is probably applied by a mistake” after creating new project with IJ and Kotlin from master
- [`KT-30974`](https://youtrack.jetbrains.com/issue/KT-30974) Script dependencies resolution failed error while trying to use Kotlin for Gradle
### IDE. Hints
- [`KT-30057`](https://youtrack.jetbrains.com/issue/KT-30057) "View->Type info" shows "Type is unknown" for named argument syntax
### IDE. Inspections and Intentions
#### New Features
- [`KT-11629`](https://youtrack.jetbrains.com/issue/KT-11629) Inspection: creating Throwable without throwing it
- [`KT-12392`](https://youtrack.jetbrains.com/issue/KT-12392) Unused import with alias should be highlighted and removed with Optimize Imports
- [`KT-12721`](https://youtrack.jetbrains.com/issue/KT-12721) inspection should be made for converting Integer.toString(int) to int.toString()
- [`KT-13962`](https://youtrack.jetbrains.com/issue/KT-13962) Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf())
- [`KT-15537`](https://youtrack.jetbrains.com/issue/KT-15537) Add inspection + intention to replace IntRange.start/endInclusive with first/last
- [`KT-21195`](https://youtrack.jetbrains.com/issue/KT-21195) ReplaceWith intention could save generic type arguments
- [`KT-25262`](https://youtrack.jetbrains.com/issue/KT-25262) Intention: Rename class to containing file name
- [`KT-25439`](https://youtrack.jetbrains.com/issue/KT-25439) Inspection "Map replaceable with EnumMap"
- [`KT-26269`](https://youtrack.jetbrains.com/issue/KT-26269) Inspection to replace associate with associateWith or associateBy
- [`KT-26629`](https://youtrack.jetbrains.com/issue/KT-26629) Inspection to replace `==` operator on Double.NaN with `equals` call
- [`KT-27411`](https://youtrack.jetbrains.com/issue/KT-27411) Inspection and Quickfix to replace System.exit() with exitProcess()
- [`KT-29344`](https://youtrack.jetbrains.com/issue/KT-29344) Convert property initializer to getter: suggest on property name
- [`KT-29666`](https://youtrack.jetbrains.com/issue/KT-29666) Quickfix for "DEPRECATED_JAVA_ANNOTATION": migrate arguments
- [`KT-29798`](https://youtrack.jetbrains.com/issue/KT-29798) Add 'Covariant equals' inspection
- [`KT-29799`](https://youtrack.jetbrains.com/issue/KT-29799) Inspection: class with non-null self-reference as a parameter in its primary constructor
- [`KT-30078`](https://youtrack.jetbrains.com/issue/KT-30078) Add "Add getter/setter" quick fix for uninitialized property
- [`KT-30381`](https://youtrack.jetbrains.com/issue/KT-30381) Inspection + quickfix to replace non-null assertion with return
- [`KT-30389`](https://youtrack.jetbrains.com/issue/KT-30389) Fix to convert argument to Int: suggest roundToInt()
- [`KT-30501`](https://youtrack.jetbrains.com/issue/KT-30501) Add inspection to replace filter { it is Foo } with filterIsInstance<Foo> and filter { it != null } with filterNotNull
- [`KT-30612`](https://youtrack.jetbrains.com/issue/KT-30612) Unused symbol inspection should detect enum entry
- [`KT-30663`](https://youtrack.jetbrains.com/issue/KT-30663) Fully qualified name is added on quick fix for original class name if import alias exists
- [`KT-30725`](https://youtrack.jetbrains.com/issue/KT-30725) Inspection which replaces `.sorted().first()` with `.min()`
#### Fixes
- [`KT-5412`](https://youtrack.jetbrains.com/issue/KT-5412) "Replace non-null assertion with `if` expression" should replace parent expression
- [`KT-13549`](https://youtrack.jetbrains.com/issue/KT-13549) "Package directive doesn't match file location" for root package
- [`KT-14040`](https://youtrack.jetbrains.com/issue/KT-14040) Secondary enum class constructor is marked as "unused" by IDE
- [`KT-18459`](https://youtrack.jetbrains.com/issue/KT-18459) Spring: "Autowiring for Bean Class (Kotlin)" inspection adds not working `@Named` annotation to property
- [`KT-21526`](https://youtrack.jetbrains.com/issue/KT-21526) used class is marked as "never used"
- [`KT-22896`](https://youtrack.jetbrains.com/issue/KT-22896) "Change function signature" quickfix on "x overrides nothing" doesn't rename type arguments
- [`KT-27089`](https://youtrack.jetbrains.com/issue/KT-27089) ReplaceWith quickfix doesn't take into account generic parameter
- [`KT-27821`](https://youtrack.jetbrains.com/issue/KT-27821) SimplifiableCallChain inspection quick fix removes comments for intermediate operations
- [`KT-28485`](https://youtrack.jetbrains.com/issue/KT-28485) Incorrect parameter name after running "Add parameter to function" intention when argument variable is upper case const
- [`KT-28619`](https://youtrack.jetbrains.com/issue/KT-28619) "Add braces to 'if' statement" moves end-of-line comment inside an `if` branch if statement inside `if` is block
- [`KT-29556`](https://youtrack.jetbrains.com/issue/KT-29556) "Remove redundant 'let' call" doesn't rename parameter with convention `invoke` call
- [`KT-29677`](https://youtrack.jetbrains.com/issue/KT-29677) "Specify type explicitly" intention produces invalid output for type escaped with backticks
- [`KT-29764`](https://youtrack.jetbrains.com/issue/KT-29764) "Convert property to function" intention doesn't warn about the property overloads at child class constructor
- [`KT-29812`](https://youtrack.jetbrains.com/issue/KT-29812) False positive for HasPlatformType with member extension on 'dynamic'
- [`KT-29869`](https://youtrack.jetbrains.com/issue/KT-29869) 'WhenWithOnlyElse': possibly useless inspection with false grey warning highlighting during editing the code
- [`KT-30038`](https://youtrack.jetbrains.com/issue/KT-30038) 'Remove redundant Unit" false positive when return type is nullable Unit
- [`KT-30082`](https://youtrack.jetbrains.com/issue/KT-30082) False positive "redundant `.let` call" for lambda functions stored in nullable references
- [`KT-30173`](https://youtrack.jetbrains.com/issue/KT-30173) "Nested lambda has shadowed implicit parameter" is suggested when both parameters are logically the same
- [`KT-30208`](https://youtrack.jetbrains.com/issue/KT-30208) Convert to anonymous object: lambda generic type argument is lost
- [`KT-30215`](https://youtrack.jetbrains.com/issue/KT-30215) No "surround with null" check is suggested for an assignment
- [`KT-30228`](https://youtrack.jetbrains.com/issue/KT-30228) 'Convert to also/apply/run/with' intention behaves differently depending on the position of infix function call
- [`KT-30457`](https://youtrack.jetbrains.com/issue/KT-30457) MoveVariableDeclarationIntoWhen: do not report gray warning on variable declarations taking multiple lines / containing preemptive returns
- [`KT-30481`](https://youtrack.jetbrains.com/issue/KT-30481) Do not report ImplicitNullableNothingType on a function/property that overrides a function/property of type 'Nothing?'
- [`KT-30527`](https://youtrack.jetbrains.com/issue/KT-30527) False positive "Type alias is never used" with import of enum member
- [`KT-30559`](https://youtrack.jetbrains.com/issue/KT-30559) Redundant Getter, Redundant Setter: reduce range to getter/setter header
- [`KT-30565`](https://youtrack.jetbrains.com/issue/KT-30565) False positive "Suspicious 'var' property" inspection with annotated default property getter
- [`KT-30579`](https://youtrack.jetbrains.com/issue/KT-30579) Kotlin-gradle groovy inspections should depend on Groovy plugin
- [`KT-30613`](https://youtrack.jetbrains.com/issue/KT-30613) "Convert to anonymous function" should not insert named argument when interoping with Java functions
- [`KT-30614`](https://youtrack.jetbrains.com/issue/KT-30614) String templates suggest removing curly braces for backtick escaped identifiers
- [`KT-30622`](https://youtrack.jetbrains.com/issue/KT-30622) Add names to call arguments starting from given argument
- [`KT-30637`](https://youtrack.jetbrains.com/issue/KT-30637) False positive "unused constructor" for local class
- [`KT-30669`](https://youtrack.jetbrains.com/issue/KT-30669) Import quick fix does not work for property/function with original name if import alias for them exist
- [`KT-30761`](https://youtrack.jetbrains.com/issue/KT-30761) Replace assert boolean with assert equality produces uncompilable code when compared arguments type are different
- [`KT-30769`](https://youtrack.jetbrains.com/issue/KT-30769) Override quickfix creates "sealed fun"
- [`KT-30833`](https://youtrack.jetbrains.com/issue/KT-30833) Exception after "Introduce Import Alias" if invoke in import
- [`KT-30876`](https://youtrack.jetbrains.com/issue/KT-30876) SimplifyNotNullAssert inspection changes semantics
- [`KT-30900`](https://youtrack.jetbrains.com/issue/KT-30900) Invert 'if' condition respects neither code formatting nor inline comments
- [`KT-30910`](https://youtrack.jetbrains.com/issue/KT-30910) "Use property access syntax" is not suitable as text for inspection problem text
- [`KT-30916`](https://youtrack.jetbrains.com/issue/KT-30916) Quickfix "Remove redundant qualifier name" can't work with user type with generic parameter
- [`KT-31103`](https://youtrack.jetbrains.com/issue/KT-31103) Don't invoke Gradle related inspections when Gradle plugin is disabled
- [`KT-31349`](https://youtrack.jetbrains.com/issue/KT-31349) Add name to argument should not be suggested for Java library classes
- [`KT-31404`](https://youtrack.jetbrains.com/issue/KT-31404) Redundant 'requireNotNull' or 'checkNotNull' inspection: don't remove first argument
- [`KT-25465`](https://youtrack.jetbrains.com/issue/KT-25465) "Redundant 'suspend' modifier" with suspend operator invoke
- [`KT-26337`](https://youtrack.jetbrains.com/issue/KT-26337) Exception (resource not found) in quick-fix tests in AS32
- [`KT-30879`](https://youtrack.jetbrains.com/issue/KT-30879) False positive "Redundant qualifier name"
- [`KT-31415`](https://youtrack.jetbrains.com/issue/KT-31415) UI hangs due to long computations for "Use property access syntax" intention with new inference
- [`KT-31441`](https://youtrack.jetbrains.com/issue/KT-31441) False positive "Remove explicit type arguments" inspection for projection type
- [`KT-30970`](https://youtrack.jetbrains.com/issue/KT-30970) No warning for empty `if` operator and `also`method
- [`KT-31855`](https://youtrack.jetbrains.com/issue/KT-31855) IDE + new inference: Java SAM conversion is not suggested by IDE services
### IDE. JS
- [`KT-31895`](https://youtrack.jetbrains.com/issue/KT-31895) New Project wizard: Kotlin Gradle + Kotlin/JS for Node.js: incorrect DSL is inserted
### IDE. Libraries
- [`KT-30790`](https://youtrack.jetbrains.com/issue/KT-30790) Unstable IDE navigation behavior to `expect`/`actual` symbols in stdlib
- [`KT-30821`](https://youtrack.jetbrains.com/issue/KT-30821) K/N: Navigation downwards the hierarchy in stdlib source code opens to stubs
### IDE. Misc
- [`KT-31364`](https://youtrack.jetbrains.com/issue/KT-31364) IntelliJ routinely hangs and spikes CPU / Memory usage when editing kotlin files
### IDE. Navigation
- [`KT-18322`](https://youtrack.jetbrains.com/issue/KT-18322) Find Usages not finding Java usage of @JvmField declared in primary constructor
- [`KT-27332`](https://youtrack.jetbrains.com/issue/KT-27332) Gutter icons are still shown even if disabled
### IDE. Refactorings
- [`KT-30471`](https://youtrack.jetbrains.com/issue/KT-30471) Make `KotlinElementActionsFactory.createChangeParametersActions` able to just add parameters
### IDE. Run Configurations
- [`KT-29352`](https://youtrack.jetbrains.com/issue/KT-29352) Kotlin + Java 11 + Windows : impossible to run applications with long command lines, even with dynamic.classpath=true
### IDE. Scratch
- [`KT-29642`](https://youtrack.jetbrains.com/issue/KT-29642) Once hidden, `Scratch Output` window wouldn't show the results unless the project is reopened
### IDE. Script
- [`KT-30295`](https://youtrack.jetbrains.com/issue/KT-30295) Resolver for 'completion/highlighting in ScriptDependenciesSourceInfo...' does not know how to resolve [] or [Library(null)]
- [`KT-30690`](https://youtrack.jetbrains.com/issue/KT-30690) Highlighting for scripts in diff view doesn't work for left part
- [`KT-31452`](https://youtrack.jetbrains.com/issue/KT-31452) IDE editor: MISSING_SCRIPT_STANDARD_TEMPLATE is reported inconsistently with the single line in script
### IDE. Tests Support
- [`KT-30995`](https://youtrack.jetbrains.com/issue/KT-30995) Gradle test runner: "No tasks available" for a test class in non-MPP project
### IDE. Ultimate
- [`KT-30886`](https://youtrack.jetbrains.com/issue/KT-30886) KotlinIdeaResolutionException in Velocity template (.ft) with Kotlin code
### IDE. Wizards
- [`KT-30645`](https://youtrack.jetbrains.com/issue/KT-30645) Update New Project Wizard templates related to Kotlin/JS
- [`KT-31099`](https://youtrack.jetbrains.com/issue/KT-31099) Remove Gradle configuration boilerplate for JS from multiplatform New Project Wizard templates related to Kotlin/JS
- [`KT-31695`](https://youtrack.jetbrains.com/issue/KT-31695) Gradle, JS: update wizard templates
### JS. Tools
- [`KT-31563`](https://youtrack.jetbrains.com/issue/KT-31563) Gradle/JS: npmResolve fails with "Invalid version" when user project's version does not match npm rules
- [`KT-31566`](https://youtrack.jetbrains.com/issue/KT-31566) Gradle/JS: with explicit call to `nodejs { testTask { useNodeJs() } }` configuration fails : "Could not find which method to invoke"
- [`KT-31560`](https://youtrack.jetbrains.com/issue/KT-31560) Gradle: provide descriptions for JS tasks
- [`KT-31564`](https://youtrack.jetbrains.com/issue/KT-31564) Gradle/JS: npmResolve reports warning "karma-webpack@3.0.5 has unmet peer dependency"
- [`KT-31662`](https://youtrack.jetbrains.com/issue/KT-31662) Gradle/JS: with empty `useKarma {}` lambda the execution of `jsBrowserTest` never stops
- [`KT-31686`](https://youtrack.jetbrains.com/issue/KT-31686) Gradle/JS: useKarma { useConfigDirectory() } fails to configure
- [`KT-31694`](https://youtrack.jetbrains.com/issue/KT-31694) Gradle, NPM, windows: creating symlink requires administrator privilege
- [`KT-31931`](https://youtrack.jetbrains.com/issue/KT-31931) Gradle JS or Native: test processing fails in some cases
### JavaScript
- [`KT-31007`](https://youtrack.jetbrains.com/issue/KT-31007) Kotlin/JS 1.3.30 - private method in an interface in the external library causes ReferenceError
### Libraries
- [`KT-30174`](https://youtrack.jetbrains.com/issue/KT-30174) Annotation for experimental stdlib API
- [`KT-30451`](https://youtrack.jetbrains.com/issue/KT-30451) Redundant call of selector in maxBy&minBy
- [`KT-30560`](https://youtrack.jetbrains.com/issue/KT-30560) Fix Throwable::addSuppressed from stdlib to make it work without stdlib-jdk7 in runtime
- [`KT-24810`](https://youtrack.jetbrains.com/issue/KT-24810) Support common string<->ByteArray UTF-8 conversion
- [`KT-29265`](https://youtrack.jetbrains.com/issue/KT-29265) String.toCharArray() is not available in common stdlib
- [`KT-31194`](https://youtrack.jetbrains.com/issue/KT-31194) assertFails and assertFailsWith don't work with suspend functions
- [`KT-31639`](https://youtrack.jetbrains.com/issue/KT-31639) 'Iterbale.drop' drops too much because of overflow
- [`KT-28933`](https://youtrack.jetbrains.com/issue/KT-28933) capitalize() with Locale argument in the JDK stdlib
### Reflection
- [`KT-29041`](https://youtrack.jetbrains.com/issue/KT-29041) KAnnotatedElement should have an extension function to verify if certain annotation is present
- [`KT-30344`](https://youtrack.jetbrains.com/issue/KT-30344) Avoid using .kotlin_module in kotlin-reflect
### Tools. Android Extensions
- [`KT-30993`](https://youtrack.jetbrains.com/issue/KT-30993) Android Extensions: Make @Parcelize functionality non-experimental
### Tools. CLI
- [`KT-27638`](https://youtrack.jetbrains.com/issue/KT-27638) Add -Xjava-sources compiler argument to specify directories with .java source files which can be referenced from the compiled Kotlin sources
- [`KT-27778`](https://youtrack.jetbrains.com/issue/KT-27778) Add -Xpackage-prefix compiler argument to specify package prefix for Java sources resolution
- [`KT-30973`](https://youtrack.jetbrains.com/issue/KT-30973) Compilation on IBM J9 (build 2.9, JRE 1.8.0 AIX ppc64-64-Bit) fails unless -Xuse-javac is specified
### Tools. Compiler Plugins
- [`KT-30343`](https://youtrack.jetbrains.com/issue/KT-30343) Add new Quarkus preset to all-open compiler plugin
### Tools. Gradle
#### New Features
- [`KT-20156`](https://youtrack.jetbrains.com/issue/KT-20156) Publish the Kotlin Javascript Gradle plugin to the Gradle Plugins Portal
- [`KT-26256`](https://youtrack.jetbrains.com/issue/KT-26256) In new MPP, support Java compilation in JVM targets
- [`KT-27273`](https://youtrack.jetbrains.com/issue/KT-27273) Support the Gradle 'application' plugin in new MPP or provide an alternative
- [`KT-30528`](https://youtrack.jetbrains.com/issue/KT-30528) Gradle, JS tests: support basic builtin test runner
- [`KT-31015`](https://youtrack.jetbrains.com/issue/KT-31015) Gradle, JS: Change default for new kotlin-js and experimental kotlin-multiplatform plugins
- [`KT-30573`](https://youtrack.jetbrains.com/issue/KT-30573) Gradle, JS: enable source maps by default, change paths relative to node_modules directory
- [`KT-30747`](https://youtrack.jetbrains.com/issue/KT-30747) Gradle, JS tests: provide option to disable test configuration per target
- [`KT-31010`](https://youtrack.jetbrains.com/issue/KT-31010) Gradle, JS tests: Mocha
- [`KT-31011`](https://youtrack.jetbrains.com/issue/KT-31011) Gradle, JS tests: Karma
- [`KT-31013`](https://youtrack.jetbrains.com/issue/KT-31013) Gradle, JS: Webpack
- [`KT-31016`](https://youtrack.jetbrains.com/issue/KT-31016) Gradle: yarn downloading
- [`KT-31017`](https://youtrack.jetbrains.com/issue/KT-31017) Gradle, yarn: support workspaces
#### Fixes
- [`KT-13256`](https://youtrack.jetbrains.com/issue/KT-13256) CompileJava tasks in Kotlin2Js Gradle plugin
- [`KT-16355`](https://youtrack.jetbrains.com/issue/KT-16355) Rename "compileKotlin2Js" Gradle task to "compileKotlinJs"
- [`KT-26255`](https://youtrack.jetbrains.com/issue/KT-26255) Using the jvmWithJava preset in new MPP leads to counter-intuitive source set names and directory structure
- [`KT-27640`](https://youtrack.jetbrains.com/issue/KT-27640) Do not use `-Xbuild-file` when invoking the Kotlin compiler in Gradle plugins
- [`KT-29284`](https://youtrack.jetbrains.com/issue/KT-29284) kotlin2js plugin applies java plugin
- [`KT-30132`](https://youtrack.jetbrains.com/issue/KT-30132) Could not initialize class org.jetbrains.kotlin.com.intellij.openapi.util.io.FileUtil on build by gradle
- [`KT-30596`](https://youtrack.jetbrains.com/issue/KT-30596) Kotlin Gradle Plugin: Forward stdout and stderr logger of out of process though gradle logger
- [`KT-31106`](https://youtrack.jetbrains.com/issue/KT-31106) Kotlin compilation fails with locked build script dependencies and Gradle 5
- [`KT-28985`](https://youtrack.jetbrains.com/issue/KT-28985) Java tests not executed in a module created with presets.jvmWithJava
- [`KT-30340`](https://youtrack.jetbrains.com/issue/KT-30340) kotlin("multiplatform") plugin is not working properly with Spring Boot
- [`KT-30784`](https://youtrack.jetbrains.com/issue/KT-30784) Deprecation warning "API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'" for a multiplatform library with Android target
- [`KT-31027`](https://youtrack.jetbrains.com/issue/KT-31027) java.lang.NoSuchMethodError: No static method hashCode(Z)I in class Ljava/lang/Boolean; or its super classes (declaration of 'java.lang.Boolean' appears in /system/framework/core-libart.jar)
- [`KT-31696`](https://youtrack.jetbrains.com/issue/KT-31696) Gradle, NPM: select one version between tools and all of compile configurations
- [`KT-31697`](https://youtrack.jetbrains.com/issue/KT-31697) Gradle, NPM: report about clashes in packages_imported
- [`KT-31891`](https://youtrack.jetbrains.com/issue/KT-31891) Gradle: JS or Native tests execution: `build --scan` fails with ISE "Expected attachment of type ... but did not find it"
- [`KT-31023`](https://youtrack.jetbrains.com/issue/KT-31023) Update Gradle module metadata warning in MPP publishing
### Tools. Incremental Compile
- [`KT-31131`](https://youtrack.jetbrains.com/issue/KT-31131) Regression: incremental compilation of multi-file part throws exception
### Tools. J2K
- [`KT-23023`](https://youtrack.jetbrains.com/issue/KT-23023) J2K: Inspection to convert Arrays.copyOf(a, size) to a.copyOf(size)
- [`KT-26550`](https://youtrack.jetbrains.com/issue/KT-26550) J2K: Check context/applicability of conversion, don't suggest for libraries, jars, etc.
- [`KT-29568`](https://youtrack.jetbrains.com/issue/KT-29568) Disabled "Convert Java File to Kotlin File" action is shown in project view context menu for XML files
### Tools. JPS
- [`KT-13563`](https://youtrack.jetbrains.com/issue/KT-13563) Kotlin jps-plugin should allow to instrument bytecode from Intellij IDEA.
### Tools. REPL
- [`KT-21443`](https://youtrack.jetbrains.com/issue/KT-21443) Kotlin's JSR223 script engine does not work when used by a fat jar
### Tools. Scripts
- [`KT-30986`](https://youtrack.jetbrains.com/issue/KT-30986) Missing dependencies when JSR-223 script engines are used from `kotlin-script-util`
### Tools. kapt
- [`KT-26203`](https://youtrack.jetbrains.com/issue/KT-26203) `kapt.use.worker.api=true` throws a NullPointerException on Java 10/11
- [`KT-30739`](https://youtrack.jetbrains.com/issue/KT-30739) Kapt generated sources are not visible from the IDE when "Create separate module per source set" is disabled
- [`KT-31064`](https://youtrack.jetbrains.com/issue/KT-31064) Periodically build crash when using incremental kapt
- [`KT-23880`](https://youtrack.jetbrains.com/issue/KT-23880) Kapt: Support incremental annotation processors
- [`KT-31322`](https://youtrack.jetbrains.com/issue/KT-31322) Kapt does not run annotation processing when sources change.
- [`KT-30979`](https://youtrack.jetbrains.com/issue/KT-30979) Issue with Dagger2 providers MissingBinding with 1.3.30
- [`KT-31127`](https://youtrack.jetbrains.com/issue/KT-31127) Kotlin-generating processor which uses Filer API breaks JavaCompile task
- [`KT-31714`](https://youtrack.jetbrains.com/issue/KT-31714) incremental kapt: FileSystemException: Too many open files
## 1.3.31
### Compiler
#### Fixes
- [`KT-26418`](https://youtrack.jetbrains.com/issue/KT-26418) Back-end (JVM) Internal error when compiling decorated suspend inline functions
- [`KT-26925`](https://youtrack.jetbrains.com/issue/KT-26925) Decorated suspend inline function continuation resumes in wrong spot
- [`KT-30706`](https://youtrack.jetbrains.com/issue/KT-30706) Passing noinline lambda as (cross)inline parameter result in wrong state-machine
- [`KT-30707`](https://youtrack.jetbrains.com/issue/KT-30707) Java interop of coroutines inside inline functions is broken
- [`KT-30997`](https://youtrack.jetbrains.com/issue/KT-30997) Crash with suspend crossinline
### IDE. Inspections and Intentions
- [`KT-30879`](https://youtrack.jetbrains.com/issue/KT-30879) False positive "Redundant qualifier name"
- [`KT-31112`](https://youtrack.jetbrains.com/issue/KT-31112) "Remove redundant qualifier name" inspection false positive for property with irrelevant import
### JavaScript
- [`KT-31007`](https://youtrack.jetbrains.com/issue/KT-31007) Kotlin/JS 1.3.30 - private method in an interface in the external library causes ReferenceError
### Tools. Gradle
- [`KT-31027`](https://youtrack.jetbrains.com/issue/KT-31027) java.lang.NoSuchMethodError: No static method hashCode(Z)I in class Ljava/lang/Boolean; or its super classes (declaration of 'java.lang.Boolean' appears in /system/framework/core-libart.jar)
### Tools. kapt
- [`KT-30979`](https://youtrack.jetbrains.com/issue/KT-30979) Issue with Dagger2 providers MissingBinding with 1.3.30
## 1.3.30
### Compiler
#### New Features
- [`KT-19664`](https://youtrack.jetbrains.com/issue/KT-19664) Allow more permissive visibility for non-virtual actual declarations
- [`KT-29586`](https://youtrack.jetbrains.com/issue/KT-29586) Add support for Android platform annotations
- [`KT-29604`](https://youtrack.jetbrains.com/issue/KT-29604) Do not implicitly propagate deprecations originated in Java
#### Performance Improvements
- [`KT-24876`](https://youtrack.jetbrains.com/issue/KT-24876) Emit calls to java.lang.Long.divideUnsigned for unsigned types when target version is 1.8
- [`KT-25974`](https://youtrack.jetbrains.com/issue/KT-25974) 'when' by unsigned integers is not translated to tableswitch/lookupswitch
- [`KT-28015`](https://youtrack.jetbrains.com/issue/KT-28015) Coroutine state-machine shall use Result.throwOnFailure
- [`KT-29229`](https://youtrack.jetbrains.com/issue/KT-29229) Intrinsify 'in' operator for unsigned integer ranges
- [`KT-29230`](https://youtrack.jetbrains.com/issue/KT-29230) Specialize 'next' method call for unsigned integer range and progression iterators
#### Fixes
- [`KT-7185`](https://youtrack.jetbrains.com/issue/KT-7185) Parse import directives in the middle of the file, report a diagnostic instead
- [`KT-7237`](https://youtrack.jetbrains.com/issue/KT-7237) Parser recovery (angle bracket mismatch)
- [`KT-11656`](https://youtrack.jetbrains.com/issue/KT-11656) Could not generate LightClass because of ISE from bridge generation on invalid code
- [`KT-13497`](https://youtrack.jetbrains.com/issue/KT-13497) Better recovery in comma-separated lists in case of missing comma
- [`KT-13703`](https://youtrack.jetbrains.com/issue/KT-13703) Restore parser better when `class` is missing from `enum` declaration
- [`KT-13731`](https://youtrack.jetbrains.com/issue/KT-13731) Recover parser on value parameter without a type
- [`KT-14227`](https://youtrack.jetbrains.com/issue/KT-14227) Incorrect code is generated when using MutableMap.set with plusAssign operator
- [`KT-19389`](https://youtrack.jetbrains.com/issue/KT-19389) Couldn't inline method call 'with'
- [`KT-20065`](https://youtrack.jetbrains.com/issue/KT-20065) "Cannot serialize error type: [ERROR : Unknown type parameter 0]" with generic typealias
- [`KT-20322`](https://youtrack.jetbrains.com/issue/KT-20322) Debug: member value returned from suspending function is not updated immediately
- [`KT-20780`](https://youtrack.jetbrains.com/issue/KT-20780) "Cannot serialize error type: [ERROR : Unknown type parameter 0]" with parameterized inner type alias
- [`KT-21405`](https://youtrack.jetbrains.com/issue/KT-21405) Throwable “Rewrite at slice LEXICAL_SCOPE key: VALUE_PARAMETER_LIST” on editing string literal in kotlin-js module
- [`KT-21775`](https://youtrack.jetbrains.com/issue/KT-21775) "Cannot serialize error type: [ERROR : Unknown type parameter 0]" with typealias used from a different module
- [`KT-22818`](https://youtrack.jetbrains.com/issue/KT-22818) "UnsupportedOperationException: Don't know how to generate outer expression" on using non-trivial expression in default argument of `expect` function
- [`KT-23117`](https://youtrack.jetbrains.com/issue/KT-23117) Local delegate + local object = NoSuchMethodError
- [`KT-23701`](https://youtrack.jetbrains.com/issue/KT-23701) Report error when -Xmultifile-parts-inherit is used and relevant JvmMultifileClass parts have any state
- [`KT-23992`](https://youtrack.jetbrains.com/issue/KT-23992) Target prefixes for annotations on supertype list elements are not checked
- [`KT-24490`](https://youtrack.jetbrains.com/issue/KT-24490) Wrong type is inferred when last expression in lambda has functional type
- [`KT-24871`](https://youtrack.jetbrains.com/issue/KT-24871) Optimize iteration and contains for UIntRange/ULongRange
- [`KT-24964`](https://youtrack.jetbrains.com/issue/KT-24964) "Cannot serialize error type: [ERROR : Unknown type parameter 0]" with `Validated` typealias from Arrow
- [`KT-25383`](https://youtrack.jetbrains.com/issue/KT-25383) Named function as last statement in lambda doesn't coerce to Unit
- [`KT-25431`](https://youtrack.jetbrains.com/issue/KT-25431) Type mismatch when trying to bind mutable property with complex common system
- [`KT-25435`](https://youtrack.jetbrains.com/issue/KT-25435) Try/catch as the last expression of lambda cause type mismatch
- [`KT-25437`](https://youtrack.jetbrains.com/issue/KT-25437) Type variable fixation of postponed arguments and type variables with Nothing constraint
- [`KT-25446`](https://youtrack.jetbrains.com/issue/KT-25446) Empty labeled return doesn't force coercion to Unit
- [`KT-26069`](https://youtrack.jetbrains.com/issue/KT-26069) NoSuchMethodError on calling remove/getOrDefault on a Kotlin subclass of Java subclass of Map
- [`KT-26638`](https://youtrack.jetbrains.com/issue/KT-26638) Check for repeatablilty of annotations doesn't take into account annotations with use-site target
- [`KT-26816`](https://youtrack.jetbrains.com/issue/KT-26816) Lambdas to Nothing is inferred if multilevel collections is used (listOf, mapOf, etc)
- [`KT-27190`](https://youtrack.jetbrains.com/issue/KT-27190) State machine elimination after inlining stopped working (regression)
- [`KT-27241`](https://youtrack.jetbrains.com/issue/KT-27241) Contracts: smartcasts don't work correctly if type checking for contract function is used
- [`KT-27565`](https://youtrack.jetbrains.com/issue/KT-27565) Lack of fallback resolution for SAM conversions for Kotlin functions in new inference
- [`KT-27799`](https://youtrack.jetbrains.com/issue/KT-27799) Prohibit references to reified type parameters in annotation arguments in local classes / anonymous objects
- [`KT-28182`](https://youtrack.jetbrains.com/issue/KT-28182) Kotlin Bytecode tool window shows incorrect output on annotated property with backing field
- [`KT-28236`](https://youtrack.jetbrains.com/issue/KT-28236) "Cannot serialize error type: [ERROR : Unknown type parameter 2]" with inferred type arguments in generic extension function from Arrow
- [`KT-28309`](https://youtrack.jetbrains.com/issue/KT-28309) Do not generate LVT entries with different types pointing to the same slot, but have different types
- [`KT-28317`](https://youtrack.jetbrains.com/issue/KT-28317) Strange behavior in testJvmAssertInlineFunctionAssertionsEnabled on Jdk 6 and exception on JDK 8
- [`KT-28453`](https://youtrack.jetbrains.com/issue/KT-28453) Mark anonymous classes for callable references as synthetic
- [`KT-28598`](https://youtrack.jetbrains.com/issue/KT-28598) Type is inferred incorrectly to Any on a deep generic type with out projection
- [`KT-28654`](https://youtrack.jetbrains.com/issue/KT-28654) No report about type mismatch inside a lambda in generic functions with a type parameter as a return type
- [`KT-28670`](https://youtrack.jetbrains.com/issue/KT-28670) Not null smartcasts on an intersection of nullable types don't work
- [`KT-28718`](https://youtrack.jetbrains.com/issue/KT-28718) progressive mode plus new inference result in different floating-point number comparisons
- [`KT-28810`](https://youtrack.jetbrains.com/issue/KT-28810) Suspend function's continuation parameter is missing from LVT
- [`KT-28855`](https://youtrack.jetbrains.com/issue/KT-28855) NoSuchMethodError with vararg of unsigned Int in generic class constructor
- [`KT-28984`](https://youtrack.jetbrains.com/issue/KT-28984) Exception when subtype of kotlin.Function is used as an expected one for lambda or callable reference
- [`KT-28993`](https://youtrack.jetbrains.com/issue/KT-28993) Incorrect behavior when two lambdas are passed outside a parenthesized argument list
- [`KT-29144`](https://youtrack.jetbrains.com/issue/KT-29144) Interface with companion object generates invalid bytecode in progressive mode
- [`KT-29228`](https://youtrack.jetbrains.com/issue/KT-29228) Intrinsify 'for' loop for unsigned integer ranges and progressions
- [`KT-29324`](https://youtrack.jetbrains.com/issue/KT-29324) Warnings indexing jdk 11 classes
- [`KT-29367`](https://youtrack.jetbrains.com/issue/KT-29367) New inference doesn't wrap annotated type from java to TypeWithEnhancement
- [`KT-29507`](https://youtrack.jetbrains.com/issue/KT-29507) @field-targeted annotation on property with both getter and setter is absent from bytecode
- [`KT-29705`](https://youtrack.jetbrains.com/issue/KT-29705) 'Rewrite at slice CONSTRUCTOR` of JS class while editing another JVM-class
- [`KT-29792`](https://youtrack.jetbrains.com/issue/KT-29792) UnsupportedOperationException: Unsupported annotation argument type when using Java annotation with infinity or NaN as a default value
- [`KT-29891`](https://youtrack.jetbrains.com/issue/KT-29891) Kotlin doesn't allow to use local class literals as annotation arguments
- [`KT-29912`](https://youtrack.jetbrains.com/issue/KT-29912) Crossinline nonsuspend lambda leads to KNPE during inlining
- [`KT-29965`](https://youtrack.jetbrains.com/issue/KT-29965) Don't generate annotation on $default method
- [`KT-30030`](https://youtrack.jetbrains.com/issue/KT-30030) Extensive 'Rewrite at slice'-exception with contracts in JS module of multiplatform project
- [`KT-22043`](https://youtrack.jetbrains.com/issue/KT-22043) Report an error when comparing enum (==/!=/when) to any other incompatible type since 1.4
- [`KT-26150`](https://youtrack.jetbrains.com/issue/KT-26150) KotlinFrontendException is thrown when callsInPlace called twice with different InvocationKind in functions with contracts
- [`KT-26153`](https://youtrack.jetbrains.com/issue/KT-26153) Contract is allowed when it's at the beginning in control flow terms, but not in tokens order terms (contract doesn't work)
- [`KT-26191`](https://youtrack.jetbrains.com/issue/KT-26191) Contract may not be the first statement if it's part of the expression
- [`KT-29178`](https://youtrack.jetbrains.com/issue/KT-29178) Prohibit arrays of reified type parameters in annotation arguments in local classes / anonymous objects
- [`KT-20507`](https://youtrack.jetbrains.com/issue/KT-20507) PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL not reported for generic base class constructor call, IAE at run-time
- [`KT-20849`](https://youtrack.jetbrains.com/issue/KT-20849) Inference results in Nothing type argument in case of passing 'out T' to 'in T1'
- [`KT-28285`](https://youtrack.jetbrains.com/issue/KT-28285) NullPointerException on calling Array constructor compiled via Excelsior JET
- [`KT-29376`](https://youtrack.jetbrains.com/issue/KT-29376) Report a deprecation warning when comparing enum to any other incompatible type
- [`KT-29884`](https://youtrack.jetbrains.com/issue/KT-29884) Report warning on @Synchronized on inline method
- [`KT-30073`](https://youtrack.jetbrains.com/issue/KT-30073) ClassCastException on coroutine start with crossinline lambda
- [`KT-30597`](https://youtrack.jetbrains.com/issue/KT-30597) "Extend selection" throws exception in empty class body case
- [`KT-29492`](https://youtrack.jetbrains.com/issue/KT-29492) Double cross-inline of suspending functions produces incorrect code
- [`KT-30508`](https://youtrack.jetbrains.com/issue/KT-30508) Wrong file name in metadata of suspend function capturing crossinline lambda
- [`KT-30679`](https://youtrack.jetbrains.com/issue/KT-30679) "KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration" exception during a compilation of a multiplatform project containing Kotlin Script File
### IDE
#### New Features
- [`KT-26950`](https://youtrack.jetbrains.com/issue/KT-26950) Support Multiline TODO comments
- [`KT-29034`](https://youtrack.jetbrains.com/issue/KT-29034) Make JvmDeclarationSearch find private fields in kotlin classes
#### Performance Improvements
- [`KT-29457`](https://youtrack.jetbrains.com/issue/KT-29457) FindImplicitNothingAction#update freezes UI for 30 secs
- [`KT-29551`](https://youtrack.jetbrains.com/issue/KT-29551) CreateKotlinSdkActivity runs on UI thread
#### Fixes
- [`KT-11143`](https://youtrack.jetbrains.com/issue/KT-11143) Do not insert closing brace for string template between open brace and identifier
- [`KT-18503`](https://youtrack.jetbrains.com/issue/KT-18503) Optimize imports produces red code
- [`KT-27283`](https://youtrack.jetbrains.com/issue/KT-27283) KotlinULiteralExpression and PsiLanguageInjectionHost mismatch
- [`KT-27794`](https://youtrack.jetbrains.com/issue/KT-27794) KotlinAnnotatedElementsSearcher doesn't process method parameters
- [`KT-28272`](https://youtrack.jetbrains.com/issue/KT-28272) UAST: Need to be able to identify SAM conversions
- [`KT-28360`](https://youtrack.jetbrains.com/issue/KT-28360) Getting tons of "There are 2 classes with same fqName" logs in IntelliJ
- [`KT-28739`](https://youtrack.jetbrains.com/issue/KT-28739) Bad caret position after `Insert curly braces around variable` inspection
- [`KT-29013`](https://youtrack.jetbrains.com/issue/KT-29013) Injection with interpolation loses suffix
- [`KT-29025`](https://youtrack.jetbrains.com/issue/KT-29025) Implement `UReferenceExpression.referenceNameElement` for Kotlin
- [`KT-29287`](https://youtrack.jetbrains.com/issue/KT-29287) Exception in ultra-light classes on method annotated with @Throws
- [`KT-29381`](https://youtrack.jetbrains.com/issue/KT-29381) Highlight return lambda expressions when cursor is one the call with lambda argument
- [`KT-29434`](https://youtrack.jetbrains.com/issue/KT-29434) Can not detect injection host in string passed as argument into arrayOf() function
- [`KT-29464`](https://youtrack.jetbrains.com/issue/KT-29464) Project reopening does not create missing Kotlin SDK for Native modules (like it does for other non-JVM ones)
- [`KT-29467`](https://youtrack.jetbrains.com/issue/KT-29467) Maven/Gradle re-import does not add missing Kotlin SDK for kotlin2js modules (non-MPP JavaScript)
- [`KT-29804`](https://youtrack.jetbrains.com/issue/KT-29804) Probable error in the "Kotlin (Mobile Android/iOS)" new project template in IntelliJ
- [`KT-30033`](https://youtrack.jetbrains.com/issue/KT-30033) UAST: Delegation expression missing from parse tree
- [`KT-30388`](https://youtrack.jetbrains.com/issue/KT-30388) Disable constant exception reporting from release versions
- [`KT-30524`](https://youtrack.jetbrains.com/issue/KT-30524) "java.lang.IllegalStateException: This method shouldn't be invoked for LOCAL visibility" on add import
- [`KT-30534`](https://youtrack.jetbrains.com/issue/KT-30534) KotlinUObjectLiteralExpression returns classReference whose referenceNameElement is null
- [`KT-30546`](https://youtrack.jetbrains.com/issue/KT-30546) Kotlin UImportStatement's children references always resolve to null
- [`KT-5435`](https://youtrack.jetbrains.com/issue/KT-5435) Surround with try/catch should generate more Kotlin-style code
### IDE. Android
- [`KT-29847`](https://youtrack.jetbrains.com/issue/KT-29847) Many IDEA plugins are not loaded in presence of Kotlin plugin: "Plugins should not have cyclic dependencies"
### IDE. Code Style, Formatting
- [`KT-23295`](https://youtrack.jetbrains.com/issue/KT-23295) One-line comment indentation in functions with expression body
- [`KT-28905`](https://youtrack.jetbrains.com/issue/KT-28905) When is "... if long" hitting?
- [`KT-29304`](https://youtrack.jetbrains.com/issue/KT-29304) Settings / Code Style / Kotlin mentions "methods" instead of functions
- [`KT-26954`](https://youtrack.jetbrains.com/issue/KT-26954) Bad indentation for single function with expression body in new code style
### IDE. Completion
- [`KT-18663`](https://youtrack.jetbrains.com/issue/KT-18663) Support "smart enter/complete statement" completion for method calls
- [`KT-28394`](https://youtrack.jetbrains.com/issue/KT-28394) Improve code completion for top level class/interface to incorporate filename
- [`KT-29435`](https://youtrack.jetbrains.com/issue/KT-29435) org.jetbrains.kotlin.types.TypeUtils.contains hanging forever and freezing IntelliJ
- [`KT-27915`](https://youtrack.jetbrains.com/issue/KT-27915) Stop auto-completing braces for companion objects
### IDE. Debugger
- [`KT-22250`](https://youtrack.jetbrains.com/issue/KT-22250) Evaluate: 'this' shows different values when evaluated as a variable/watch
- [`KT-24829`](https://youtrack.jetbrains.com/issue/KT-24829) Access to coroutineContext in 'Evaluate expression'
- [`KT-25220`](https://youtrack.jetbrains.com/issue/KT-25220) Evaluator: a instance of Pair returned instead of String ("Extract function" failed)
- [`KT-25222`](https://youtrack.jetbrains.com/issue/KT-25222) Evaluate: ClassCastException: ObjectValue cannot be cast to IntValue ("Extract function" failed)
- [`KT-26913`](https://youtrack.jetbrains.com/issue/KT-26913) Change local variable name mangling ($receiver -> this_<label>)
- [`KT-28087`](https://youtrack.jetbrains.com/issue/KT-28087) [Kotlin/JVM view] Inconsistent debugging data inside forEachIndexed
- [`KT-28134`](https://youtrack.jetbrains.com/issue/KT-28134) Separate JVM/Kotlin views in "Variables" tool window
- [`KT-28192`](https://youtrack.jetbrains.com/issue/KT-28192) Exception from KotlinEvaluator: cannot find local variable
- [`KT-28680`](https://youtrack.jetbrains.com/issue/KT-28680) Missing `this` word completion in "Evaluate expression" window
- [`KT-28728`](https://youtrack.jetbrains.com/issue/KT-28728) Async stack trace support for Kotlin coroutines
- [`KT-21650`](https://youtrack.jetbrains.com/issue/KT-21650) Debugger: Can't evaluate value, resolution error
- [`KT-23828`](https://youtrack.jetbrains.com/issue/KT-23828) Debugger: "Smart cast is impossible" when evaluating expression
- [`KT-29661`](https://youtrack.jetbrains.com/issue/KT-29661) Evaluate expression: "Cannot find local variable" for variable name escaped with backticks
- [`KT-29814`](https://youtrack.jetbrains.com/issue/KT-29814) Can't evaluate a property on star-projected type
- [`KT-29871`](https://youtrack.jetbrains.com/issue/KT-29871) Debugger in IDE does not handle correctly extensions.
- [`KT-30182`](https://youtrack.jetbrains.com/issue/KT-30182) Incorrect KT elvis expression debugger evaluation
- [`KT-29189`](https://youtrack.jetbrains.com/issue/KT-29189) [BE] 'Step Over' falls through 'return when' (and 'return if') instead of executing individual branches
- [`KT-29234`](https://youtrack.jetbrains.com/issue/KT-29234) ISE “@NotNull method org/jetbrains/kotlin/codegen/binding/CodegenBinding.anonymousClassForCallable must not return null” on debugging with breakpoints in Kotlin script file
- [`KT-29423`](https://youtrack.jetbrains.com/issue/KT-29423) Unable to evaluate lambdas on jdk 9-11
- [`KT-30220`](https://youtrack.jetbrains.com/issue/KT-30220) Empty variables view when breakpoint inside an lambda inside class
- [`KT-30318`](https://youtrack.jetbrains.com/issue/KT-30318) KotlinCoroutinesAsyncStackTraceProvider slows down java debugging
- [`KT-17811`](https://youtrack.jetbrains.com/issue/KT-17811) Couldn't inline method error for inline method with anonymous object initialization and reified type parameter
- [`KT-30611`](https://youtrack.jetbrains.com/issue/KT-30611) Debugger: in projects with stdlib of 1.2.n version Frames view can't complete loading, EvaluateException: "Method threw 'java.lang.ClassNotFoundException' exception." at EvaluateExceptionUtil.createEvaluateException()
### IDE. Decompiler
- [`KT-9618`](https://youtrack.jetbrains.com/issue/KT-9618) Exception in ClassClsStubBuilder.createNestedClassStub() while opening recent project
- [`KT-29427`](https://youtrack.jetbrains.com/issue/KT-29427) Exception in ClassClsStubBuilder.createNestedClassStub() for obfuscated library
### IDE. Gradle
- [`KT-26865`](https://youtrack.jetbrains.com/issue/KT-26865) Gradle build in IDE: error messages in Native sources are not hyperlinks
- [`KT-28515`](https://youtrack.jetbrains.com/issue/KT-28515) Failed to import Kotlin project with gradle 5.0
- [`KT-29564`](https://youtrack.jetbrains.com/issue/KT-29564) kotlin.parallel.tasks.in.project=true causes idea to create kotlin modules with target JVM 1.6
- [`KT-30076`](https://youtrack.jetbrains.com/issue/KT-30076) Memory leaks in Kotlin import
- [`KT-30379`](https://youtrack.jetbrains.com/issue/KT-30379) Gradle 5.3 publishes an MPP with broken Maven scope mapping
### IDE. Gradle. Script
- [`KT-27684`](https://youtrack.jetbrains.com/issue/KT-27684) Gradle Kotlin DSL: the `rootProject` field is unresolved in IDEA for a common module
- [`KT-29465`](https://youtrack.jetbrains.com/issue/KT-29465) IndexNotReadyException on context menu invocation for build.gradle.kts file
- [`KT-29707`](https://youtrack.jetbrains.com/issue/KT-29707) "Navigate declaration" navigates to compiled class in gradle cache folder instead of classes defined in gradle buildSrc folder
- [`KT-29832`](https://youtrack.jetbrains.com/issue/KT-29832) Multiple Script Definitions for settings.gradle.kts
- [`KT-30623`](https://youtrack.jetbrains.com/issue/KT-30623) Errors in build.gradle.kts after applying new script dependencies
- [`KT-29474`](https://youtrack.jetbrains.com/issue/KT-29474) Regression in 1.3.20: Kotlin IDE plugin parses all *.gradle.kts files when any class in buildSrc is opened
- [`KT-30130`](https://youtrack.jetbrains.com/issue/KT-30130) “Access is allowed from event dispatch thread only.” from ScriptNewDependenciesNotificationKt.removeScriptDependenciesNotificationPanel() on creating foo.gradle.kts files in IJ from master
### IDE. Hints
- [`KT-29196`](https://youtrack.jetbrains.com/issue/KT-29196) Variable type hints are redundant for constructor calls of nested classes
- [`KT-30058`](https://youtrack.jetbrains.com/issue/KT-30058) IndexNotReadyException from quick documentation when popup is active
### IDE. Hints. Inlay
- [`KT-19558`](https://youtrack.jetbrains.com/issue/KT-19558) Wrong position of type hint while renaming Kotlin variable
- [`KT-27438`](https://youtrack.jetbrains.com/issue/KT-27438) "Show lambda return expression hints" breaks code indentation
- [`KT-28870`](https://youtrack.jetbrains.com/issue/KT-28870) Rework "Lambda return expression" hint as between_lines_hint of disable it by default
### IDE. Hints. Parameter Info
- [`KT-29574`](https://youtrack.jetbrains.com/issue/KT-29574) Incorrect parameter info popup for lambda nested in object
### IDE. Inspections and Intentions
#### New Features
- [`KT-16118`](https://youtrack.jetbrains.com/issue/KT-16118) "Introduce import alias" intention
- [`KT-17119`](https://youtrack.jetbrains.com/issue/KT-17119) Inspection for (Scala-like) `= { ... }` syntax without expected type in function definition
- [`KT-26128`](https://youtrack.jetbrains.com/issue/KT-26128) Inspection for suspension inside synchronized and withLock functions
- [`KT-27556`](https://youtrack.jetbrains.com/issue/KT-27556) Add intention for collections, !collection.isEmpty() -> collection.isNotEmpty()
- [`KT-27670`](https://youtrack.jetbrains.com/issue/KT-27670) Add quick fix: wrap expression in a lambda if compatible functional type is required
- [`KT-28803`](https://youtrack.jetbrains.com/issue/KT-28803) Inspection: result of enum entries comparison is always false / true
- [`KT-28953`](https://youtrack.jetbrains.com/issue/KT-28953) Add intention to add underscores to decimal numerical literal
- [`KT-29001`](https://youtrack.jetbrains.com/issue/KT-29001) Add intention to move variable declaration before when-expression into when's subject
- [`KT-29113`](https://youtrack.jetbrains.com/issue/KT-29113) Warn about redundant requireNotNull and checkNotNull usages
- [`KT-29321`](https://youtrack.jetbrains.com/issue/KT-29321) "Remove empty primary constructor": apply for enum entries
- [`KT-12134`](https://youtrack.jetbrains.com/issue/KT-12134) Suggest to remove qualifier in FQN name
- [`KT-17278`](https://youtrack.jetbrains.com/issue/KT-17278) Inspection to replace Java 8 Map.forEach with Kotlin's forEach
- [`KT-26965`](https://youtrack.jetbrains.com/issue/KT-26965) Add inspection + quickfix for replacing Collection<T>.count() with .size
- [`KT-30123`](https://youtrack.jetbrains.com/issue/KT-30123) Add intention to replace isEmpty/isNotEmpty method negation
- [`KT-25272`](https://youtrack.jetbrains.com/issue/KT-25272) Unused expression as last expression of normal function should have quickfix to add "return"
- [`KT-30456`](https://youtrack.jetbrains.com/issue/KT-30456) Improve: intention "Introduce Import Alias" should suggest new names for the new alias.
#### Fixes
- [`KT-7593`](https://youtrack.jetbrains.com/issue/KT-7593) On splitting property declaration for functional expression additional bracket added
- [`KT-12273`](https://youtrack.jetbrains.com/issue/KT-12273) "Replace with operator" intention is suggested for some non-operator functions and produces invalid code
- [`KT-18715`](https://youtrack.jetbrains.com/issue/KT-18715) Replace if with elvis swallows comments
- [`KT-19254`](https://youtrack.jetbrains.com/issue/KT-19254) Intention to convert object literal to class always creates a class named "O"
- [`KT-25501`](https://youtrack.jetbrains.com/issue/KT-25501) "Replace overloaded operator with function call" changes semantics of increment and decrement operators
- [`KT-26979`](https://youtrack.jetbrains.com/issue/KT-26979) "Lambda argument inside parentheses" inspection is not reported, if function type is actual type argument, but not formal parameter type
- [`KT-27143`](https://youtrack.jetbrains.com/issue/KT-27143) Intention "Replace camel-case name with spaces" is suggested for snake_case names in test functions and renames them incorrectly
- [`KT-28081`](https://youtrack.jetbrains.com/issue/KT-28081) "Convert to lambda" changes expression type for interface with multiple supertypes
- [`KT-28131`](https://youtrack.jetbrains.com/issue/KT-28131) False positive "Redundant lambda arrow" with a functional type argument
- [`KT-28224`](https://youtrack.jetbrains.com/issue/KT-28224) "Add braces to 'else' statement" moves comment outside braces when 'if-else' is inside 'if / when' branch
- [`KT-28592`](https://youtrack.jetbrains.com/issue/KT-28592) False positive "Remove redundant backticks" for underscore variable name
- [`KT-28596`](https://youtrack.jetbrains.com/issue/KT-28596) "Can be replaced with binary operator" shouldn't be suggested when receiver or argument is floating point type
- [`KT-28641`](https://youtrack.jetbrains.com/issue/KT-28641) "Remove useless cast" produces a dangling lambda ("Too many arguments" error)
- [`KT-28698`](https://youtrack.jetbrains.com/issue/KT-28698) "Convert to apply" intention: include function calls with `this` passed as an argument
- [`KT-28773`](https://youtrack.jetbrains.com/issue/KT-28773) Kotlin/JS: Wrong inspection to replace .equals() with == on dynamic values
- [`KT-28851`](https://youtrack.jetbrains.com/issue/KT-28851) 'Convert parameter to receiver' adds `Array<out T>` wrapper to `vararg` parameter and drops `override` modifier in implementations
- [`KT-28969`](https://youtrack.jetbrains.com/issue/KT-28969) TYPE_MISMATCH in array vs non-array case: two quick fixes exist for annotation and none of them adds array literal
- [`KT-28995`](https://youtrack.jetbrains.com/issue/KT-28995) "Add parameter to constructor" quickfix for first enum member changes arguments for all members
- [`KT-29051`](https://youtrack.jetbrains.com/issue/KT-29051) "Add parameter to constructor" quickfix for not-first enum member: "PsiInvalidElementAccessException: Element: class org.jetbrains.kotlin.psi.KtStringTemplateExpression #kotlin because: different providers"
- [`KT-29052`](https://youtrack.jetbrains.com/issue/KT-29052) "Add parameter to constructor" quickfix for not-first enum member inserts FQN type for parameter
- [`KT-29056`](https://youtrack.jetbrains.com/issue/KT-29056) KNPE in ConvertPrimaryConstructorToSecondary with missing property identifier
- [`KT-29085`](https://youtrack.jetbrains.com/issue/KT-29085) False positive "Class member can have 'private' visibility" for a `const val` used in a public inline function
- [`KT-29093`](https://youtrack.jetbrains.com/issue/KT-29093) False positive inspection "Redundant lambda arrow" with nested lambdas
- [`KT-29099`](https://youtrack.jetbrains.com/issue/KT-29099) "Convert to apply" intention is not available for a single function call
- [`KT-29128`](https://youtrack.jetbrains.com/issue/KT-29128) False positive 'Explicitly given type is redundant here' when typealias is used
- [`KT-29153`](https://youtrack.jetbrains.com/issue/KT-29153) False negative "'rangeTo' or the '..' call should be replaced with 'until'" with bracketed expressions
- [`KT-29193`](https://youtrack.jetbrains.com/issue/KT-29193) Quick fix "Create extension function" `List<Int>.set` should not be suggested for read-only collections
- [`KT-29238`](https://youtrack.jetbrains.com/issue/KT-29238) Non-canonical modifiers order inspection incorrectly includes annotations into range
- [`KT-29248`](https://youtrack.jetbrains.com/issue/KT-29248) "Convert member to extension" doesn't preserve visibility
- [`KT-29416`](https://youtrack.jetbrains.com/issue/KT-29416) False positive "Redundant property getter" for `external` getter
- [`KT-29469`](https://youtrack.jetbrains.com/issue/KT-29469) False positive in "Boolean literal argument without parameter name" inspection for varargs parameters
- [`KT-29549`](https://youtrack.jetbrains.com/issue/KT-29549) Make package name convention inspection global
- [`KT-29567`](https://youtrack.jetbrains.com/issue/KT-29567) "Remove empty class body" is a poor name for inspection text
- [`KT-29606`](https://youtrack.jetbrains.com/issue/KT-29606) Do not propose to remove unused parameter of property setter
- [`KT-29763`](https://youtrack.jetbrains.com/issue/KT-29763) False negative "Object literal can be converted to lambda" for block body function with explicit return
- [`KT-30007`](https://youtrack.jetbrains.com/issue/KT-30007) False negative "Add import for '...'" in UserType
- [`KT-19944`](https://youtrack.jetbrains.com/issue/KT-19944) multiplatform: Convert expect/actual function to property should keep the caret on the converted function
- [`KT-27289`](https://youtrack.jetbrains.com/issue/KT-27289) "Create" quick fix on FQN does nothing with KNPE at KotlinRefactoringUtilKt$chooseContainerElement$1.renderText()
- [`KT-29312`](https://youtrack.jetbrains.com/issue/KT-29312) "Make constructor parameter a property" produces wrong modifier order + exception "Invalid range specified"
- [`KT-29414`](https://youtrack.jetbrains.com/issue/KT-29414) "Main parameter is not necessary" inspection reports parameter of `main()` in object
- [`KT-29499`](https://youtrack.jetbrains.com/issue/KT-29499) "Unsafe call of inline function with nullable extension receiver" inspection ignores inferred nullability
- [`KT-29927`](https://youtrack.jetbrains.com/issue/KT-29927) Missing "Import members from" intention with type check operator in `when` branch
- [`KT-30010`](https://youtrack.jetbrains.com/issue/KT-30010) Introduce alternative quick-fixes for `map[key]!!`
- [`KT-30166`](https://youtrack.jetbrains.com/issue/KT-30166) False positive "Redundant companion reference" on companion with the outer class name
- [`KT-14886`](https://youtrack.jetbrains.com/issue/KT-14886) Create Property from Usage should place generated property next to other properties
- [`KT-16139`](https://youtrack.jetbrains.com/issue/KT-16139) Adding explicit type argument leads to type mismatch
- [`KT-19462`](https://youtrack.jetbrains.com/issue/KT-19462) False positive inspection "Redundant lambda arrow" for overloaded functions
- [`KT-22137`](https://youtrack.jetbrains.com/issue/KT-22137) Create class quickfix is not suggested in return statement
- [`KT-23259`](https://youtrack.jetbrains.com/issue/KT-23259) False positive unchecked cast warning/quickfix result in good code turning red
- [`KT-27641`](https://youtrack.jetbrains.com/issue/KT-27641) "Specify type explicitly" suggests too general type even when type hint shows specific generic type
- [`KT-29124`](https://youtrack.jetbrains.com/issue/KT-29124) False positive inspection 'Redundant lambda arrow' with generic function/constructor with lambda argument
- [`KT-29590`](https://youtrack.jetbrains.com/issue/KT-29590) False positive inspection "Redundant lambda arrow" with vararg lambda arguments passed via spread operator
- [`KT-29977`](https://youtrack.jetbrains.com/issue/KT-29977) False positive "Unused import directive" for typealias of an enum imported as static
- [`KT-30233`](https://youtrack.jetbrains.com/issue/KT-30233) Change order of the quick fixes when method does not accept nullable types
- [`KT-30341`](https://youtrack.jetbrains.com/issue/KT-30341) False positive 'Use withIndex() instead of manual index increment' inspection with destructive declaration in 'for' loop
- [`KT-30414`](https://youtrack.jetbrains.com/issue/KT-30414) "Replace return with 'if' expression" drops return label
- [`KT-30426`](https://youtrack.jetbrains.com/issue/KT-30426) Don't preserve extra line when adding remaining branches for when
- [`KT-30433`](https://youtrack.jetbrains.com/issue/KT-30433) "Convert member to extension" doesn't update external Kotlin calls
- [`KT-30117`](https://youtrack.jetbrains.com/issue/KT-30117) Kotlin unused import analysis accesses file editor manager model outside UI thread
- [`KT-29143`](https://youtrack.jetbrains.com/issue/KT-29143) Unnecessary primary `constructor` keyword inspection
- [`KT-29444`](https://youtrack.jetbrains.com/issue/KT-29444) "Make public" intention does not remove additional white-space to conform to proper style
- [`KT-30337`](https://youtrack.jetbrains.com/issue/KT-30337) Do not propose to move variable declaration into "when" if it's not used inside the when-expression
### IDE. Multiplatform
- [`KT-29918`](https://youtrack.jetbrains.com/issue/KT-29918) Outdated Ktor version in Kotlin (JS Client/JVM Server) multiplatform project generated via New Project Wizard
### IDE. Navigation
- [`KT-26924`](https://youtrack.jetbrains.com/issue/KT-26924) Overriding Methods list has more values than it should be in case of inline class
- [`KT-28661`](https://youtrack.jetbrains.com/issue/KT-28661) "Is implemented in" gutter icon shows duplicate function implementations in inline classes
- [`KT-28838`](https://youtrack.jetbrains.com/issue/KT-28838) Group by file structure doesn't work for text search in Kotlin
### IDE. Refactorings
- [`KT-27602`](https://youtrack.jetbrains.com/issue/KT-27602) Kotlin property renaming change target name several times during rename making it hard to process it by reference handlers
- [`KT-29062`](https://youtrack.jetbrains.com/issue/KT-29062) Extract Superclass refactoring throws Exception if sourceRoots.size() <= 1
- [`KT-29796`](https://youtrack.jetbrains.com/issue/KT-29796) Label rename refactoring does not work on label usage
### IDE. Scratch
- [`KT-23985`](https://youtrack.jetbrains.com/issue/KT-23985) Allow to run Kotlin Worksheet without module classpath
- [`KT-27955`](https://youtrack.jetbrains.com/issue/KT-27955) Interactive mode for Kotlin Scratch files
- [`KT-28958`](https://youtrack.jetbrains.com/issue/KT-28958) Exception "Read access is allowed from event dispatch thread or inside read-action only" when running a scratch file with "Use REPL" and "Make before Run" enabled
- [`KT-30200`](https://youtrack.jetbrains.com/issue/KT-30200) "java.lang.Throwable: Couldn't find expression with start line ..." on edition of a scratch file during its execution with interactive mode enabled
### IDE. Script
- [`KT-29770`](https://youtrack.jetbrains.com/issue/KT-29770) IntelliJ IDEA makes too many requests for the classpath of a Gradle Kotlin build script
- [`KT-29893`](https://youtrack.jetbrains.com/issue/KT-29893) IDE is frozen during project configuration because of `ScriptTemplatesFromDependenciesProvider`
- [`KT-30146`](https://youtrack.jetbrains.com/issue/KT-30146) Preferences from Kotlin scripting section reset to default after project reopening
### IDE. Tests Support
- [`KT-25956`](https://youtrack.jetbrains.com/issue/KT-25956) With failed test function class gutter icon is "failure", but function icon is "success"
### IDE. Wizards
- [`KT-17829`](https://youtrack.jetbrains.com/issue/KT-17829) Please unify naming of Kotlin projects and frameworks for JVM
- [`KT-28941`](https://youtrack.jetbrains.com/issue/KT-28941) Tip of the day: obsolete project types from "New project wizard"
### Libraries
- [`KT-27108`](https://youtrack.jetbrains.com/issue/KT-27108) `.toDouble()` and `.toFloat()` conversions for unsigned types
- [`KT-29520`](https://youtrack.jetbrains.com/issue/KT-29520) Random.Default cannot be used asJavaRandom
- [`KT-30109`](https://youtrack.jetbrains.com/issue/KT-30109) Documentation for Result.onSuccess and Result.onFailure are flipped around
- [`KT-26378`](https://youtrack.jetbrains.com/issue/KT-26378) 'contains' overloads for unsigned integer ranges with other unsigned integer types
- [`KT-26410`](https://youtrack.jetbrains.com/issue/KT-26410) High-order function overloads for unsigned arrays
- [`KT-27262`](https://youtrack.jetbrains.com/issue/KT-27262) Binary search for specialized arrays of unsigned integers
- [`KT-28339`](https://youtrack.jetbrains.com/issue/KT-28339) Add `fill` extension function for unsigned primitive arrays
- [`KT-28397`](https://youtrack.jetbrains.com/issue/KT-28397) UByteArray plus UByteArray = List<UByte>
- [`KT-28779`](https://youtrack.jetbrains.com/issue/KT-28779) Implement method sum() for arrays of unsigned primitives
- [`KT-29151`](https://youtrack.jetbrains.com/issue/KT-29151) Documentation for CharSequence.take() & String.take() shows examples of Iterable<T>.take()
- [`KT-30035`](https://youtrack.jetbrains.com/issue/KT-30035) add max/maxOf/min/minOf for unsigned types
- [`KT-30051`](https://youtrack.jetbrains.com/issue/KT-30051) elementAt extension function of Array/PrimitiveAray/UnsignedArray does not throw IndexOutOfBoundException on incorrect index (JS only)
- [`KT-30141`](https://youtrack.jetbrains.com/issue/KT-30141) JS: document Array.get behavior
- [`KT-30704`](https://youtrack.jetbrains.com/issue/KT-30704) Documentation of Random function not quite correct
### Tools. CLI
- [`KT-26240`](https://youtrack.jetbrains.com/issue/KT-26240) Support JVM bytecode targets 9, 10, 11, 12
### Tools. Gradle
- [`KT-12295`](https://youtrack.jetbrains.com/issue/KT-12295) Gradle IC: Compile error leads to non-incremental build
- [`KT-12700`](https://youtrack.jetbrains.com/issue/KT-12700) Add a way to diagnose IC problems
- [`KT-26275`](https://youtrack.jetbrains.com/issue/KT-26275) Check new MPP IC
- [`KT-27885`](https://youtrack.jetbrains.com/issue/KT-27885) Drop support for Gradle 3.x and earlier
- [`KT-27886`](https://youtrack.jetbrains.com/issue/KT-27886) Drop support for Android Gradle plugin 2.x
- [`KT-28552`](https://youtrack.jetbrains.com/issue/KT-28552) Gradle 4.7 import fails on Kotlin/mpp projects with Java11
- [`KT-29275`](https://youtrack.jetbrains.com/issue/KT-29275) Drop support for Gradle 4.0
- [`KT-29758`](https://youtrack.jetbrains.com/issue/KT-29758) Gradle build failed with exception on publication of a multiplatform library with Gradle metadata enabled: org.jetbrains.kotlin.gradle.plugin.mpp.HierarchyAttributeContainer cannot be cast to org.gradle.api.internal.attributes.AttributeContainerInternal
- [`KT-29966`](https://youtrack.jetbrains.com/issue/KT-29966) Fix inter-project IC with new MPP for JS/JVM targets
- [`KT-27059`](https://youtrack.jetbrains.com/issue/KT-27059) Ensure a dependency on the multiplatform project in the POM when publishing a single-platform module with the `maven` plugin
- [`KT-29971`](https://youtrack.jetbrains.com/issue/KT-29971) ConcurrentModificationException in Kotlin Gradle plugin (GradleCompilerRunner.buildModulesInfo)
- [`KT-21030`](https://youtrack.jetbrains.com/issue/KT-21030) Automatically detect java 1.8 sources in kotlin-android gradle plugin
- [`KT-27675`](https://youtrack.jetbrains.com/issue/KT-27675) Enable Kapt build cache by default
- [`KT-27714`](https://youtrack.jetbrains.com/issue/KT-27714) Kotlin MPP Android targets don't have their attributes copied to the configurations of the compilations
- [`KT-29761`](https://youtrack.jetbrains.com/issue/KT-29761) Inter-project IC does not work for kaptGenerateStubs* tasks on Android
- [`KT-29823`](https://youtrack.jetbrains.com/issue/KT-29823) Update 'org.gradle.usage' attribute rules to support the 'JAVA_API_JARS' value
- [`KT-29964`](https://youtrack.jetbrains.com/issue/KT-29964) A universal Gradle DSL way of configuring all compilations of all targets doesn't work for Android target of a multiplatform project
- [`KT-30276`](https://youtrack.jetbrains.com/issue/KT-30276) Warn if the Kotlin Gradle plugin is loaded multiple times
- [`KT-30322`](https://youtrack.jetbrains.com/issue/KT-30322) Memory leak in CompilationSourceSetUtil
- [`KT-30492`](https://youtrack.jetbrains.com/issue/KT-30492) Classes not removed for out/in process compilation
### Tools. J2K
- [`KT-29713`](https://youtrack.jetbrains.com/issue/KT-29713) java.lang.IllegalStateException at converting @RestController java file to Kotlin file
### Tools. JPS
- [`KT-30137`](https://youtrack.jetbrains.com/issue/KT-30137) Deadlock during concurrent classloading
### Tools. Maven
- [`KT-29251`](https://youtrack.jetbrains.com/issue/KT-29251) NSME: MavenProjectsManager.scheduleArtifactsDownloading() at KotlinMavenImporter.scheduleDownloadStdlibSources()
### Tools. REPL
- [`KT-19276`](https://youtrack.jetbrains.com/issue/KT-19276) Console spam when opening idea-community project in debug IDEA
### Tools. Scripts
- [`KT-29296`](https://youtrack.jetbrains.com/issue/KT-29296) Script evaluation - impossible to set base classloader to null
- [`KT-27051`](https://youtrack.jetbrains.com/issue/KT-27051) Support dynamic versions in @file:DependsOn
- [`KT-27815`](https://youtrack.jetbrains.com/issue/KT-27815) Compiler options in the scripting compilation configuration are ignored on compilation/evaluation
- [`KT-28593`](https://youtrack.jetbrains.com/issue/KT-28593) Idea tries to associate file type with the script definition discovery file
- [`KT-29319`](https://youtrack.jetbrains.com/issue/KT-29319) scripts default jvmTarget causes inlining problems - default should be 1.8
- [`KT-29741`](https://youtrack.jetbrains.com/issue/KT-29741) KJvmCompiledScript can not be deserialized KJvmCompiledModule if it's null
- [`KT-30210`](https://youtrack.jetbrains.com/issue/KT-30210) Coroutines in main.kts crash with NoSuchMethodError because kotlin-main-kts.jar has embedded coroutines
### Tools. kapt
- [`KT-26977`](https://youtrack.jetbrains.com/issue/KT-26977) kapt plugin applied in platform.jvm module preventing visibility of common code
- [`KT-27506`](https://youtrack.jetbrains.com/issue/KT-27506) Kapt error "no interface expected here" in class implementing interface with secondary constructor
- [`KT-28220`](https://youtrack.jetbrains.com/issue/KT-28220) kapt can generate invalid stub files for imports of enum constants
- [`KT-28306`](https://youtrack.jetbrains.com/issue/KT-28306) Cannot extend an generic interface with function body while using kapt and correctErrorTypes in Kotlin 1.3
- [`KT-23880`](https://youtrack.jetbrains.com/issue/KT-23880) Kapt: Support incremental annotation processors
- [`KT-29302`](https://youtrack.jetbrains.com/issue/KT-29302) Java classes doesn't resolve Kotlin classes when kapt.use.worker.api = true
- [`KT-30163`](https://youtrack.jetbrains.com/issue/KT-30163) Kapt: Javadoc in Java source model mangled (leading asterisks are preserved)
### Docs & Examples
- [`KT-30091`](https://youtrack.jetbrains.com/issue/KT-30091) KClass documentation incorrectly shows all members available on all platforms
- [`KT-30100`](https://youtrack.jetbrains.com/issue/KT-30100) Clarify Map.toSortedMap docs
- [`KT-30418`](https://youtrack.jetbrains.com/issue/KT-30418) Documentation for floor() and ceil() functions is misleading
- [`KT-29373`](https://youtrack.jetbrains.com/issue/KT-29373) MutableSet.add documentation is confusing
## 1.3.21
### Compiler

View File

@@ -41,7 +41,11 @@ For local development, if you're not working on bytecode generation or the stand
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
On Windows you might need to add long paths setting to the repo:
git config core.longpaths true
## Building
@@ -131,6 +135,9 @@ includeBuild('/path/to/kotlin') {
}
```
# License
Kotlin is distributed under the terms of the Apache License (Version 2.0). See [license folder](license/README.md) for details.
# Contributing
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.

View File

@@ -17,8 +17,5 @@ sourceSets {
}
runtimeJar {
manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar")
manifest.attributes["Class-Path"] = "$compilerManifestClassPath kotlin-preloader.jar"
}
dist()

View File

@@ -129,7 +129,7 @@ class KotlinCompilerAdapter : Javac13() {
}
companion object {
private val KOTLIN_EXTENSIONS = Arrays.asList("kt", "kts")
private val KOTLIN_EXTENSIONS = listOf("kt", "kts")
private fun filterOutKotlinSources(files: Array<File>): Array<File> {
return files.filterNot {

View File

@@ -0,0 +1,71 @@
import kotlinx.benchmark.gradle.*
val benchmarks_version = "0.2.0-dev-4"
buildscript {
val benchmarks_version = "0.2.0-dev-4"
repositories {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
dependencies {
classpath("org.jetbrains.kotlinx:kotlinx.benchmark.gradle:$benchmarks_version")
}
}
apply(plugin = "kotlinx.benchmark")
plugins {
java
kotlin("jvm")
id("jps-compatible")
}
repositories {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
dependencies {
compile(kotlinStdlib())
compile(project(":compiler:frontend"))
compile(project(":compiler:cli"))
compile(intellijCoreDep()) { includeJars("intellij-core") }
compile(jpsStandalone()) { includeJars("jps-model") }
Platform[192].orHigher {
compile(intellijPluginDep("java"))
}
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compile("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:$benchmarks_version")
}
sourceSets {
"main" { projectDefault() }
}
benchmark {
configurations {
named("main") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("size", 1000)
}
register("fir") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("isIR", true)
param("size", 1000)
include("CommonCallsBenchmark")
//include("InferenceBaselineCallsBenchmark")
}
}
targets {
register("main")
}
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.Param
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.State
@State(Scope.Benchmark)
abstract class AbstractInferenceBenchmark : AbstractSimpleFileBenchmark() {
@Param("true", "false")
private var useNI: Boolean = false
override val useNewInference: Boolean
get() = useNI
}

View File

@@ -0,0 +1,209 @@
package org.jetbrains.kotlin.benchmarks
import com.intellij.openapi.Disposable
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl.PsiFileFactoryImpl
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.kotlin.analyzer.ModuleInfo
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.*
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.context.SimpleGlobalContext
import org.jetbrains.kotlin.context.withModule
import org.jetbrains.kotlin.context.withProject
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
import org.jetbrains.kotlin.fir.java.FirJavaModuleBasedSession
import org.jetbrains.kotlin.fir.java.FirLibrarySession
import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider
import org.jetbrains.kotlin.fir.resolve.FirProvider
import org.jetbrains.kotlin.fir.resolve.impl.FirProviderImpl
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveTransformer
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
import org.jetbrains.kotlin.storage.ExceptionTracker
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.io.File
private fun createFile(shortName: String, text: String, project: Project): KtFile {
val virtualFile = object : LightVirtualFile(shortName, KotlinLanguage.INSTANCE, text) {
override fun getPath(): String {
//TODO: patch LightVirtualFile
return "/" + name
}
}
virtualFile.charset = CharsetToolkit.UTF8_CHARSET
val factory = PsiFileFactory.getInstance(project) as PsiFileFactoryImpl
return factory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, true, false) as KtFile
}
private val JDK_PATH = File("${System.getProperty("java.home")!!}/lib/rt.jar")
private val RUNTIME_JAR = File(System.getProperty("kotlin.runtime.path") ?: "dist/kotlinc/lib/kotlin-runtime.jar")
private val LANGUAGE_FEATURE_SETTINGS =
LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(LanguageFeature.NewInference to LanguageFeature.State.ENABLED)
)
private fun newConfiguration(useNewInference: Boolean): CompilerConfiguration {
val configuration = CompilerConfiguration()
configuration.put(CommonConfigurationKeys.MODULE_NAME, "benchmark")
configuration.put(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, "../idea/resources")
configuration.addJvmClasspathRoot(JDK_PATH)
configuration.addJvmClasspathRoot(RUNTIME_JAR)
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
val newInferenceState = if (useNewInference) LanguageFeature.State.ENABLED else LanguageFeature.State.DISABLED
configuration.languageVersionSettings = LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(
LanguageFeature.NewInference to newInferenceState
)
)
return configuration
}
@State(Scope.Benchmark)
abstract class AbstractSimpleFileBenchmark {
private var myDisposable: Disposable = Disposable { }
private lateinit var env: KotlinCoreEnvironment
private lateinit var file: KtFile
@Param("true", "false")
protected var isIR: Boolean = false
protected open val useNewInference get() = isIR
@Setup(Level.Trial)
fun setUp() {
if (isIR && !useNewInference) error("Invalid configuration")
env = KotlinCoreEnvironment.createForTests(
myDisposable,
newConfiguration(useNewInference),
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
if (isIR) {
Extensions.getArea(env.project)
.getExtensionPoint(PsiElementFinder.EP_NAME)
.unregisterExtension(JavaElementFinder::class.java)
}
file = createFile(
"test.kt",
buildText(),
env.project
)
}
protected fun analyzeGreenFile(bh: Blackhole) {
if (isIR) {
analyzeGreenFileIr(bh)
} else {
analyzeGreenFileFrontend(bh)
}
}
private fun analyzeGreenFileFrontend(bh: Blackhole) {
val tracker = ExceptionTracker()
val storageManager: StorageManager =
LockBasedStorageManager.createWithExceptionHandling("benchmarks", tracker)
val context = SimpleGlobalContext(storageManager, tracker)
val module =
ModuleDescriptorImpl(
Name.special("<benchmark>"), storageManager,
JvmBuiltIns(storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
)
val moduleContext = context.withProject(env.project).withModule(module)
val result = TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
moduleContext.project,
listOf(file),
NoScopeRecordCliBindingTrace(),
env.configuration,
{ scope -> JvmPackagePartProvider(LANGUAGE_FEATURE_SETTINGS, scope) }
)
assert(result.bindingContext.diagnostics.none { it.severity == Severity.ERROR })
bh.consume(result.shouldGenerateCode)
}
private fun analyzeGreenFileIr(bh: Blackhole) {
val scope = GlobalSearchScope.filesScope(env.project, listOf(file.virtualFile))
.uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(env.project))
val session = createSession(env, scope)
val builder = RawFirBuilder(session, stubMode = false)
val totalTransformer = FirTotalResolveTransformer()
val firFile = builder.buildFirFile(file).also((session.getService(FirProvider::class) as FirProviderImpl)::recordFile)
for (transformer in totalTransformer.transformers) {
transformer.transformFile(firFile, null)
}
bh.consume(firFile.hashCode())
}
protected abstract fun buildText(): String
}
fun createSession(
environment: KotlinCoreEnvironment,
sourceScope: GlobalSearchScope,
librariesScope: GlobalSearchScope = GlobalSearchScope.notScope(sourceScope)
): FirSession {
val moduleInfo = FirTestModuleInfo()
val project = environment.project
val provider = FirProjectSessionProvider(project)
return FirJavaModuleBasedSession(moduleInfo, provider, sourceScope).also {
createSessionForDependencies(provider, moduleInfo, librariesScope, environment)
}
}
private fun createSessionForDependencies(
provider: FirProjectSessionProvider,
moduleInfo: FirTestModuleInfo,
librariesScope: GlobalSearchScope,
environment: KotlinCoreEnvironment
) {
val dependenciesInfo = FirTestModuleInfo()
moduleInfo.dependencies.add(dependenciesInfo)
FirLibrarySession.create(
dependenciesInfo, provider, librariesScope, environment.project,
environment.createPackagePartProvider(librariesScope)
)
}
class FirTestModuleInfo(
override val name: Name = Name.identifier("TestModule"),
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
override val platform: TargetPlatform = JvmPlatforms.unspecifiedJvmPlatform,
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
) : ModuleInfo {
override fun dependencies(): List<ModuleInfo> = dependencies
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class CommonCallsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(): Int = 1
|
|fun bar() {
|${(1..size).joinToString("\n") { " foo()" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,42 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ComplexDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|
|fun bar(x: Any?) {
| var y = x
|${(1..size).joinToString("\n") {
"""
|if (x is String) {
| y = x
|}
|y = 1
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,73 @@
/*
* Copyright (c) 2014, Oracle America, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Oracle nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ControlFlowOperators : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|var isTrue = true
|var s = ""
|fun bar() {
|${(1..size).joinToString("\n") {
"""
|var x$it: String
|
|when (s) {
| "A" -> { x$it = "1" }
| "B" -> { x$it = "2" }
| else -> { x$it = "3" }
|}
|
|while (isTrue) {
| x$it.hashCode()
|}
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceBaselineCallsBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceExplicitArgumentsCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo<Int>(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceForInApplicableCandidate : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 1
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T : Comparable<T>> foo(x: MutableList<T>) {}
|fun <T> foo(x: MutableList<T>, y: (T, T) -> Int) {}
|fun bar(x: MutableList<Any>) {
|${(1..size).joinToString("\n") { " foo(x) { a, b -> 1 }" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromArgumentCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromReturnTypeCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: Int): T = null!!
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class IntArrayPlusBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
//@Fork(jvmArgsAppend = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"])
fun benchmark(bh: Blackhole) {
if (!isIR) error("Doesn't make sense to run it on old frontend on buildserver")
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar(x: IntArray, y: IntArray) {
|${(1..size).joinToString("\n") { " x + y" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyValsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " val x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyVarsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " var x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class SimpleDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|var x = 1
|fun bar(v: Int) {
|${(1..size).joinToString("\n") { " x = foo(v)" }}
|}
""".trimMargin()
}

View File

@@ -32,12 +32,12 @@ sourceSets {
"test" { projectDefault() }
}
publish()
runtimeJar()
sourcesJar()
javadocJar()
testsJar()
projectTest()
publish()
projectTest(parallel = true)

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -22,9 +22,11 @@ import org.jetbrains.kotlin.utils.sure
import java.io.File
open class GeneratedFile(
val sourceFiles: Collection<File>,
sourceFiles: Collection<File>,
val outputFile: File
)
) {
val sourceFiles = sourceFiles.sortedBy { it.path }
}
class GeneratedJvmClass (
sourceFiles: Collection<File>,

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
@@ -25,6 +24,7 @@ import kotlin.reflect.KVisibility;
import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
@@ -60,7 +60,7 @@ public class ArgumentUtils {
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException, InvocationTargetException {
for (KProperty1 property : KClasses.getMemberProperties(clazz)) {
Argument argument = ContainerUtil.findInstance(property.getAnnotations(), Argument.class);
Argument argument = findInstance(property.getAnnotations(), Argument.class);
if (argument == null) continue;
if (property.getVisibility() != KVisibility.PUBLIC) continue;
@@ -90,4 +90,14 @@ public class ArgumentUtils {
}
}
}
@Nullable
private static <T> T findInstance(Iterable<? super T> iterable, Class<T> clazz) {
for (Object item : iterable) {
if (clazz.isInstance(item)) {
return clazz.cast(item);
}
}
return null;
}
}

View File

@@ -16,15 +16,15 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class OutputItemsCollectorImpl implements OutputItemsCollector {
private final List<SimpleOutputItem> outputs = ContainerUtil.newArrayList();
private final List<SimpleOutputItem> outputs = new ArrayList<>();
@Override
public void add(Collection<File> sourceFiles, File outputFile) {

View File

@@ -45,7 +45,10 @@ interface IncrementalCacheCommon {
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
abstract class AbstractIncrementalCache<ClassName>(
workingDir: File,
protected val pathConverter: FileToPathConverter
) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
@@ -70,17 +73,16 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
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))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile, pathConverter))
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))
private val complementaryFilesMap = registerMap(ComplementarySourceFilesMap(COMPLEMENTARY_FILES.storageFile, pathConverter))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
@@ -153,14 +155,17 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) :
protected class ClassFqNameToSourceMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
storage[fqName.asString()] = pathConverter.toPath(sourceFile)
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
storage[fqName.asString()]?.let(pathConverter::toFile)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2019 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.
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2019 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.
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

View File

@@ -19,10 +19,7 @@ package org.jetbrains.kotlin.incremental
import com.intellij.util.io.DataExternalizer
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.BasicStringMap
import org.jetbrains.kotlin.incremental.storage.DirtyClassesFqNameMap
import org.jetbrains.kotlin.incremental.storage.SourceToFqNameMap
import org.jetbrains.kotlin.incremental.storage.StringToLongMapExternalizer
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull
@@ -30,25 +27,31 @@ import org.jetbrains.kotlin.metadata.js.JsProtoBuf
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.parentOrNull
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import java.io.DataInput
import java.io.DataOutput
import java.io.File
open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName>(cachesDir) {
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private val TRANSLATION_RESULT_MAP = "translation-result"
private val INLINE_FUNCTIONS = "inline-functions"
private val HEADER_FILE_NAME = "header.meta"
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val INLINE_FUNCTIONS = "inline-functions"
private const val HEADER_FILE_NAME = "header.meta"
private const val PACKAGE_META_FILE = "packages-meta"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesFqNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val packageMetadata = registerMap(PackageMetadataMap(PACKAGE_META_FILE.storageFile))
private val dirtySources = hashSetOf<File>()
@@ -63,6 +66,12 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
override fun markDirty(removedAndCompiledSources: Collection<File>) {
removedAndCompiledSources.forEach { sourceFile ->
// The common prefix of all FQN parents has to be the file package
sourceToClassesMap[sourceFile].map { it.parentOrNull()?.asString() ?: "" }.minBy { it.length }?.let {
packageMetadata.remove(it)
}
}
super.markDirty(removedAndCompiledSources)
dirtySources.addAll(removedAndCompiledSources)
}
@@ -95,6 +104,10 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
for ((srcFile, inlineDeclarations) in incrementalResults.inlineFunctions) {
inlineFunctions.process(srcFile, inlineDeclarations, changesCollector)
}
for ((packageName, metadata) in incrementalResults.packageMetadata) {
packageMetadata.put(packageName, metadata)
}
}
private fun registerOutputForFile(srcFile: File, name: FqName) {
@@ -113,14 +126,20 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
fun nonDirtyPackageParts(): Map<File, TranslationResultValue> =
hashMapOf<File, TranslationResultValue>().apply {
for (path in translationResults.keys()) {
val file = File(path)
if (file !in dirtySources) {
put(file, translationResults[path]!!)
}
hashMapOf<File, TranslationResultValue>().apply {
for (file in translationResults.keys()) {
if (file !in dirtySources) {
put(file, translationResults[file]!!)
}
}
}
fun packageMetadata(): Map<String, ByteArray> = hashMapOf<String, ByteArray>().apply {
for (fqNameString in packageMetadata.keys()) {
put(fqNameString, packageMetadata[fqNameString]!!)
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -152,35 +171,38 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
}
}
private class TranslationResultMap(storageFile: File) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
fun put(sourceFile: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[pathConverter.toPath(sourceFile)] =
TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
operator fun get(file: File): TranslationResultValue? =
storage[file.canonicalPath]
operator fun get(sourceFile: File): TranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
operator fun get(key: String): TranslationResultValue? =
storage[key]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun keys(): Collection<String> =
storage.keys
fun remove(file: File, changesCollector: ChangesCollector) {
val protoBytes = storage[file.canonicalPath]!!.metadata
val protoMap = getProtoData(file, protoBytes)
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
}
storage.remove(file.canonicalPath)
storage.remove(path)
}
}
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, JsSerializerProtocol.extensionRegistry)
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
@@ -199,15 +221,17 @@ fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData>
return classes
}
private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private class InlineFunctionsMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
fun process(srcFile: File, newMap: Map<String, Long>, changesCollector: ChangesCollector) {
val key = srcFile.canonicalPath
val key = pathConverter.toPath(srcFile)
val oldMap = storage[key] ?: emptyMap()
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -219,9 +243,40 @@ private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String,
}
fun remove(sourceFile: File) {
storage.remove(sourceFile.canonicalPath)
storage.remove(pathConverter.toPath(sourceFile))
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}
private object ByteArrayExternalizer : DataExternalizer<ByteArray> {
override fun save(output: DataOutput, value: ByteArray) {
output.writeInt(value.size)
output.write(value)
}
override fun read(input: DataInput): ByteArray {
val size = input.readInt()
val array = ByteArray(size)
input.readFully(array)
return array
}
}
private class PackageMetadataMap(storageFile: File) : BasicStringMap<ByteArray>(storageFile, ByteArrayExternalizer) {
fun put(packageName: String, newMetadata: ByteArray) {
storage[packageName] = newMetadata
}
fun remove(packageName: String) {
storage.remove(packageName)
}
fun keys() = storage.keys
operator fun get(packageName: String) = storage[packageName]
override fun dumpValue(value: ByteArray): String = "Package metadata: ${value.md5()}"
}

View File

@@ -43,8 +43,12 @@ val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
targetOutputDir: File?,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<JvmClassName>(
workingDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME),
pathConverter = pathConverter
), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
@@ -58,7 +62,7 @@ open class IncrementalJvmCache(
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesJvmNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val protoMap = registerMap(ProtoMap(PROTO_MAP.storageFile))
@@ -68,7 +72,8 @@ open class IncrementalJvmCache(
private val partToMultifileFacade = registerMap(MultifileClassPartMap(MULTIFILE_CLASS_PARTS.storageFile))
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile, pathConverter))
// gradle only
private val javaSourcesProtoMap = registerMap(JavaSourcesProtoMap(JAVA_SOURCES_PROTO_MAP.storageFile))
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory" } }
@@ -440,14 +445,16 @@ open class IncrementalJvmCache(
override fun dumpValue(value: String): String = value
}
inner class InternalNameToSourcesMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
inner class InternalNameToSourcesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Collection<File>) {
storage[internalName] = pathConverter.toPaths(sourceFiles)
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
pathConverter.toFiles(storage[internalName] ?: emptyList())
fun remove(internalName: String) {
storage.remove(internalName)

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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 java.io.File
import java.io.Serializable
data class IncrementalModuleEntry(
private val projectPath: String,
val name: String,
val buildDir: File,
val buildHistoryFile: File
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}
class IncrementalModuleInfo(
val projectRoot: File,
val dirToModule: Map<File, IncrementalModuleEntry>,
val nameToModules: Map<String, Set<IncrementalModuleEntry>>,
val jarToClassListFile: Map<File, File>,
// only for js and mpp
val jarToModule: Map<File, IncrementalModuleEntry>
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}

View File

@@ -55,10 +55,13 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
}
}
override fun serializeFunction(descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
childSerializer: DescriptorSerializer) {
super.serializeFunction(descriptor, proto, childSerializer)
override fun serializeFunction(
descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeFunction(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateMethod, true)
}
@@ -71,7 +74,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
override fun serializeProperty(
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)

View File

@@ -30,15 +30,18 @@ import java.io.IOException
import java.util.*
open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
open class LookupStorage(
targetDataDir: File,
pathConverter: FileToPathConverter
) : BasicMapsOwner(targetDataDir) {
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
}
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile))
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile, pathConverter))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile, pathConverter))
private val lookupMap = registerMap(LookupMap("lookups".storageFile))
@Volatile
@@ -72,12 +75,13 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
}
@Synchronized
fun addAll(lookups: Set<Map.Entry<LookupSymbol, Collection<String>>>, allPaths: Set<String>) {
val pathToId = allPaths.keysToMap { addFileIfNeeded(File(it)) }
fun addAll(lookups: MultiMap<LookupSymbol, String>, allPaths: Set<String>) {
val pathToId = allPaths.sorted().keysToMap { addFileIfNeeded(File(it)) }
for ((lookupSymbol, paths) in lookups) {
for (lookupSymbol in lookups.keySet().sorted()) {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = paths.mapTo(HashSet<Int>()) { pathToId[it]!! }
val paths = lookups[lookupSymbol]!!
val fileIds = paths.mapTo(TreeSet()) { pathToId[it]!! }
fileIds.addAll(lookupMap[key] ?: emptySet())
lookupMap[key] = fileIds
}
@@ -152,7 +156,7 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries) {
for ((file, oldId) in oldFileToId.entries.sortedBy { it.key.path }) {
val newId = addFileIfNeeded(file)
oldIdToNewId[oldId] = newId
}
@@ -174,11 +178,19 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
flush(false)
}
@TestOnly fun dump(lookupSymbols: Set<LookupSymbol>, basePath: File? = null): String {
@TestOnly
fun dump(lookupSymbols: Set<LookupSymbol>): String {
flush(false)
val sb = StringBuilder()
val p = Printer(sb)
p.println("====== File to id map")
p.println(fileToId.dump())
p.println("====== Id to file map")
p.println(idToFile.dump())
val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }
for (lookup in lookupMap.keys.sorted()) {
@@ -186,12 +198,11 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
val key = if (lookup in lookupsStrings) {
lookupsStrings[lookup]!!.map { "${it.scope}#${it.name}" }.sorted().joinToString(", ")
}
else {
} else {
lookup.toString()
}
val value = fileIds.map { idToFile[it]?.let { if (basePath == null) it.absolutePath else it.toRelativeString(basePath) } ?: it.toString() }.sorted().joinToString(", ")
val value = fileIds.map { it.toString() }.sorted().joinToString(", ")
p.println("$key -> $value")
}
@@ -217,4 +228,11 @@ class LookupTrackerImpl(private val delegate: LookupTracker) : LookupTracker {
}
}
data class LookupSymbol(val name: String, val scope: String)
data class LookupSymbol(val name: String, val scope: String) : Comparable<LookupSymbol> {
override fun compareTo(other: LookupSymbol): Int {
val scopeCompare = scope.compareTo(other.scope)
if (scopeCompare != 0) return scopeCompare
return name.compareTo(other.name)
}
}

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
@@ -32,6 +30,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
import java.util.*
import kotlin.collections.HashSet
@@ -67,11 +66,23 @@ fun makeModuleFile(
friendDirs
)
val scriptFile = File.createTempFile("kjps", StringUtil.sanitizeJavaIdentifier(name) + ".script.xml")
FileUtil.writeToFile(scriptFile, builder.asText().toString())
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
scriptFile.writeText(builder.asText().toString())
return scriptFile
}
private fun sanitizeJavaIdentifier(string: String) =
buildString {
for (char in string) {
if (char.isJavaIdentifierPart()) {
if (length == 0 && !char.isJavaIdentifierStart()) {
append('_')
}
append(char)
}
}
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
@@ -116,7 +127,7 @@ fun LookupStorage.update(
removeLookupsFrom(filesToCompile.asSequence() + removedFiles.asSequence())
addAll(lookupTracker.lookups.entrySet(), lookupTracker.pathInterner.values)
addAll(lookupTracker.lookups, lookupTracker.pathInterner.values)
}
data class DirtyData(

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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
@@ -18,4 +18,7 @@ class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) :
override val metadataVersion: IntArray
get() = JsMetadataVersion.INSTANCE.toArray() // TODO: store and load correct metadata version
override val packageMetadata: Map<String, ByteArray>
get() = cache.packageMetadata()
}

View File

@@ -0,0 +1,90 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.KeyDescriptor
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.utils.Printer
import java.io.File
abstract class BasicMap<K : Comparable<K>, V>(
storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage: LazyStorage<K, V>
private val nonCachingStorage = System.getProperty("kotlin.jps.non.caching.storage")?.toBoolean() ?: false
init {
storage = if (nonCachingStorage) {
NonCachingLazyStorage(storageFile, keyDescriptor, valueExternalizer)
} else {
CachingLazyStorage(storageFile, keyDescriptor, valueExternalizer)
}
}
fun clean() {
storage.clean()
}
fun flush(memoryCachesOnly: Boolean) {
storage.flush(memoryCachesOnly)
}
fun close() {
storage.close()
}
@TestOnly
fun dump(): String {
return with(StringBuilder()) {
with(Printer(this)) {
println(this@BasicMap::class.java.simpleName)
pushIndent()
for (key in storage.keys.sorted()) {
println("${dumpKey(key)} -> ${dumpValue(storage[key]!!)}")
}
popIndent()
}
this
}.toString()
}
@TestOnly
protected abstract fun dumpKey(key: K): String
@TestOnly
protected abstract fun dumpValue(value: V): String
}
abstract class BasicStringMap<V>(
storageFile: File,
keyDescriptor: KeyDescriptor<String>,
valueExternalizer: DataExternalizer<V>
) : BasicMap<String, V>(storageFile, keyDescriptor, valueExternalizer) {
constructor(
storageFile: File,
valueExternalizer: DataExternalizer<V>
) : this(storageFile, EnumeratorStringDescriptor.INSTANCE, valueExternalizer)
override fun dumpKey(key: String): String = key
}

View File

@@ -0,0 +1,108 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.File
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class CachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendData(key, { valueExternalizer.save(it, value) })
}
@Synchronized
override fun clean() {
try {
storage?.close()
} catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> = PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -0,0 +1,55 @@
/*
* 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.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import org.jetbrains.kotlin.name.FqName
import java.io.File
internal open class ClassOneToManyMap(
storageFile: File
) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
fun add(key: FqName, value: FqName) {
storage.append(key.asString(), listOf(value.asString()))
}
operator fun get(key: FqName): Collection<FqName> =
storage[key.asString()]?.map(::FqName) ?: setOf()
operator fun set(key: FqName, values: Collection<FqName>) {
if (values.isEmpty()) {
remove(key)
return
}
storage[key.asString()] = values.map(FqName::asString)
}
fun remove(key: FqName) {
storage.remove(key.asString())
}
fun removeValues(key: FqName, removed: Set<FqName>) {
val notRemoved = this[key].filter { it !in removed }
this[key] = notRemoved
}
}
internal class SubtypesMap(storageFile: File) : ClassOneToManyMap(storageFile)
internal class SupertypesMap(storageFile: File) : ClassOneToManyMap(storageFile)

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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 ComplementarySourceFilesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, complementaryFiles: Collection<File>) {
storage[pathConverter.toPath(sourceFile)] = pathConverter.toPaths(complementaryFiles)
}
operator fun get(sourceFile: File): Collection<File> {
val paths = storage[pathConverter.toPath(sourceFile)].orEmpty()
return pathConverter.toFiles(paths)
}
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(pathConverter.toPath(file)) }
}

View File

@@ -18,26 +18,27 @@ package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescriptor, IntExternalizer) {
override fun dumpKey(key: File): String = key.toString()
internal class FileToIdMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Int>(file, IntExternalizer) {
override fun dumpValue(value: Int): String = value.toString()
operator fun get(file: File): Int? = storage[file]
operator fun get(file: File): Int? = storage[pathConverter.toPath(file)]
operator fun set(file: File, id: Int) {
storage[file] = id
storage[pathConverter.toPath(file)] = id
}
fun remove(file: File) {
storage.remove(file)
storage.remove(pathConverter.toPath(file))
}
fun toMap(): Map<File, Int> {
val result = HashMap<File, Int>()
for (key in storage.keys) {
val value = storage[key] ?: continue
result[key] = value
result[pathConverter.toFile(key)] = value
}
return result
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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 java.io.File
interface FileToPathConverter {
fun toPath(file: File): String
fun toFile(path: String): File
}
fun FileToPathConverter.toPaths(files: Collection<File>): List<String> =
files.map { toPath(it) }
fun FileToPathConverter.toFiles(paths: Collection<String>): List<File> =
paths.map { toFile(it) }
object FileToCanonicalPathConverter : FileToPathConverter {
override fun toPath(file: File): String = file.canonicalPath
override fun toFile(path: String): File = File(path)
}

View File

@@ -1,26 +0,0 @@
/*
* 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

@@ -16,20 +16,24 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.ExternalIntegerKeyDescriptor
import java.io.File
internal class IdToFileMap(file: File) : BasicMap<Int, File>(file, ExternalIntegerKeyDescriptor(), FileKeyDescriptor) {
internal class IdToFileMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicMap<Int, String>(file, ExternalIntegerKeyDescriptor(), EnumeratorStringDescriptor.INSTANCE) {
override fun dumpKey(key: Int): String = key.toString()
override fun dumpValue(value: File): String = value.toString()
override fun dumpValue(value: String): String = value
operator fun get(id: Int): File? = storage[id]
operator fun get(id: Int): File? = storage[id]?.let { pathConverter.toFile(it) }
operator fun contains(id: Int): Boolean = id in storage
operator fun set(id: Int, file: File) {
storage[id] = file
storage[id] = pathConverter.toPath(file)
}
fun remove(id: Int) {

View File

@@ -0,0 +1,29 @@
/*
* 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.storage
interface LazyStorage<K, V> {
val keys: Collection<K>
operator fun contains(key: K): Boolean
operator fun get(key: K): V?
operator fun set(key: K, value: V)
fun remove(key: K)
fun append(key: K, value: V)
fun clean()
fun flush(memoryCachesOnly: Boolean)
fun close()
}

View File

@@ -0,0 +1,42 @@
/*
* 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.storage
import java.io.File
internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<Int>>(storage, LookupSymbolKeyDescriptor, IntCollectionExternalizer) {
override fun dumpKey(key: LookupSymbolKey): String = key.toString()
override fun dumpValue(value: Collection<Int>): String = value.toString()
fun add(name: String, scope: String, fileId: Int) {
storage.append(LookupSymbolKey(name, scope), listOf(fileId))
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]
operator fun set(key: LookupSymbolKey, fileIds: Set<Int>) {
storage[key] = fileIds
}
fun remove(key: LookupSymbolKey) {
storage.remove(key)
}
val keys: Collection<LookupSymbolKey>
get() = storage.keys
}

View File

@@ -0,0 +1,106 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.JpsPersistentHashMap
import java.io.File
class NonCachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: JpsPersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendDataWithoutCache(key, value)
}
@Synchronized
override fun clean() {
try {
storage?.close()
} catch (ignored: Throwable) {
}
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): JpsPersistentHashMap<K, V> =
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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 java.io.File
open class RelativeFileToPathConverter(baseDirFile: File?) : FileToPathConverter {
private val baseDirPath = baseDirFile?.canonicalFile?.invariantSeparatorsPath
override fun toPath(file: File): String {
val path = file.canonicalFile.invariantSeparatorsPath
return when {
baseDirPath != null && path.startsWith(baseDirPath) ->
PROJECT_DIR_PLACEHOLDER + path.substring(baseDirPath.length)
else -> path
}
}
override fun toFile(path: String): File =
when {
path.startsWith(PROJECT_DIR_PLACEHOLDER) -> {
val basePath = baseDirPath ?: error("Could not get project root dir")
File(basePath + path.substring(PROJECT_DIR_PLACEHOLDER.length))
}
else -> File(path)
}
private companion object {
private const val PROJECT_DIR_PLACEHOLDER = "${'$'}PROJECT_DIR$"
}
}

View File

@@ -21,32 +21,40 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
internal class SourceToJvmNameMap(storageFile: File) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile)
internal class SourceToFqNameMap(storageFile: File) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile)
internal class SourceToJvmNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile, pathConverter)
internal class SourceToFqNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile, pathConverter)
internal abstract class AbstractSourceToOutputMap<Name>(
private val nameTransformer: NameTransformer<Name>,
storageFile: File
private val nameTransformer: NameTransformer<Name>,
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(sourceFile.absolutePath, nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
}
fun contains(sourceFile: File): Boolean =
sourceFile.absolutePath in storage
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asFqName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)

View File

@@ -0,0 +1,62 @@
/*
* 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.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
internal class SourceToJvmNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile, pathConverter)
internal class SourceToFqNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile, pathConverter)
internal abstract class AbstractSourceToOutputMap<Name>(
private val nameTransformer: NameTransformer<Name>,
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(pathConverter.toPath(sourceFile), listOf(nameTransformer.asString(className)))
}
fun contains(sourceFile: File): Boolean =
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)
}
}

View File

@@ -177,20 +177,6 @@ object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())
override fun save(output: DataOutput, value: File) {
output.writeUTF(value.canonicalPath)
}
override fun getHashCode(value: File?): Int =
FileUtil.FILE_HASHING_STRATEGY.computeHashCode(value)
override fun isEqual(val1: File?, val2: File?): Boolean =
FileUtil.FILE_HASHING_STRATEGY.equals(val1, val2)
}
open class CollectionExternalizer<T>(
private val elementExternalizer: DataExternalizer<T>,
private val newCollection: () -> MutableCollection<T>

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.modules
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.util.text.StringUtil.escapeXml
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser.*
import org.jetbrains.kotlin.config.IncrementalCompilation
@@ -137,6 +135,13 @@ class KotlinModuleXmlBuilder {
}
private fun getEscapedPath(sourceFile: File): String {
return escapeXml(toSystemIndependentName(sourceFile.path))
return escapeXml(sourceFile.invariantSeparatorsPath)
}
private companion object {
private val xmlEscapeReplacement = mapOf("<" to "&lt;", ">" to "&gt;", "&" to "&amp;", "'" to "&#39;", "\"" to "&quot;")
private val xmlEscapeRegex = Regex(xmlEscapeReplacement.keys.joinToString("|", "(?:", ")") { Regex.escape(it) })
private fun escapeXml(string: String) = string.replace(xmlEscapeRegex) { xmlEscapeReplacement.getValue(it.value) }
}
}

View File

@@ -0,0 +1,90 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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 com.intellij.util.containers.MultiMap
import org.jetbrains.kotlin.TestWithWorkingDir
import org.jetbrains.kotlin.incremental.LookupStorage
import org.jetbrains.kotlin.incremental.LookupSymbol
import org.jetbrains.kotlin.incremental.testingUtils.assertEqualDirectories
import org.junit.Test
import java.io.File
class RelocatableCachesTest : TestWithWorkingDir() {
@Test
fun testLookupStorageAddAllReversedFiles() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedFilesOrderRoot = workingDir.resolve("reversedFiles")
fillLookupStorage(reversedFilesOrderRoot, reverseFiles = true, reverseLookups = false)
assertEqualDirectories(originalRoot, reversedFilesOrderRoot, forgiveExtraFiles = false)
}
@Test
fun testLookupStorageAddAllReversedLookups() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedLookupsOrderRoot = workingDir.resolve("reversedLookups")
fillLookupStorage(reversedLookupsOrderRoot, reverseFiles = false, reverseLookups = true)
assertEqualDirectories(originalRoot, reversedLookupsOrderRoot, forgiveExtraFiles = false)
}
@Test
fun testLookupStorageAddAllReversedFilesReversedLookups() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedFilesReversedLookupsOrderRoot = workingDir.resolve("reversedFilesReversedLookupsOrderRoot")
fillLookupStorage(reversedFilesReversedLookupsOrderRoot, reverseFiles = true, reverseLookups = true)
assertEqualDirectories(originalRoot, reversedFilesReversedLookupsOrderRoot, forgiveExtraFiles = false)
}
/**
* Fills lookup storage in [projectRoot] with N fq-names,
* where i_th fq-name myscope_i.MyClass_i has lookups for previous fq-names (from 0 to i-1)
*/
private fun fillLookupStorage(projectRoot: File, reverseFiles: Boolean, reverseLookups: Boolean) {
val storageRoot = projectRoot.storageRoot
val fileToPathConverter = RelativeFileToPathConverter(projectRoot)
val lookupStorage = LookupStorage(storageRoot, fileToPathConverter)
val files = LinkedHashSet<String>()
val symbols = LinkedHashSet<LookupSymbol>()
val lookups = MultiMap.createOrderedSet<LookupSymbol, String>()
for (i in 0..10) {
val newSymbol = LookupSymbol(name = "MyClass_$i", scope = "myscope_$i")
val newSourcePath = projectRoot.resolve("src/${newSymbol.asRelativePath()}").canonicalFile.invariantSeparatorsPath
symbols.add(newSymbol)
for (lookedUpSymbol in symbols) {
lookups.putValue(lookedUpSymbol, newSourcePath)
}
files.add(newSourcePath)
}
val filesToAdd = if (reverseFiles) files.reversedSet() else files
val lookupsToAdd = if (reverseLookups) lookups.reversedMultiMap() else lookups
lookupStorage.addAll(lookupsToAdd, filesToAdd)
lookupStorage.flush(memoryCachesOnly = false)
}
private val File.storageRoot: File
get() = resolve("storage")
private fun <K, V> MultiMap<K, V>.reversedMultiMap(): MultiMap<K, V> {
val newMap = MultiMap.createOrderedSet<K, V>()
for ((key, values) in entrySet().reversedSet()) {
newMap.putValues(key, values.reversed())
}
return newMap
}
private fun <T> Set<T>.reversedSet(): LinkedHashSet<T> =
reversed().toCollection(LinkedHashSet(size))
private fun LookupSymbol.asRelativePath(): String =
if (scope.isBlank()) name else scope.replace('.', '/') + '/' + name
}

View File

@@ -19,12 +19,14 @@ package org.jetbrains.kotlin.incremental.testingUtils
import java.io.File
data class BuildLogFinder(
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false,
private val isJsIrEnabled: Boolean = false
) {
companion object {
private const val JS_LOG = "js-build.log"
private const val JS_IR_LOG = "js-ir-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"
@@ -38,6 +40,7 @@ data class BuildLogFinder(
val names = dir.list() ?: arrayOf()
val files = names.filter { File(dir, it).isFile }.toSet()
val matchedName = when {
isJsIrEnabled && JS_IR_LOG in files -> JS_IR_LOG
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG

View File

@@ -17,7 +17,6 @@
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
@@ -37,6 +36,7 @@ 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 org.junit.ComparisonFailure
import java.io.*
import java.util.*
import java.util.zip.CRC32
@@ -72,7 +72,15 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool
}
}
Assert.assertEquals(expectedString, actualString)
if (expectedString != actualString) {
val message: String? = null
throw ComparisonFailure(
message,
expectedString.replaceFirst(DIR_ROOT_PLACEHOLDER, expected.canonicalPath),
actualString.replaceFirst(DIR_ROOT_PLACEHOLDER, actual.canonicalPath)
)
}
}
private fun File.checksumString(): String {
@@ -81,6 +89,8 @@ private fun File.checksumString(): String {
return java.lang.Long.toHexString(crc32.value)
}
private const val DIR_ROOT_PLACEHOLDER = "<DIR_ROOT_PLACEHOLDER>"
private fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
val buf = StringBuilder()
val p = Printer(buf)
@@ -109,7 +119,7 @@ private fun getDirectoryString(dir: File, interestingPaths: List<String>): Strin
}
p.println(".")
p.println(DIR_ROOT_PLACEHOLDER)
addDirContent(dir)
for (path in interestingPaths) {
@@ -205,7 +215,7 @@ private fun kjsmToString(kjsmFile: File): String {
}
private fun sourceMapFileToString(sourceMapFile: File, generatedJsFile: File): String {
val sourceMapParseResult = SourceMapParser.parse(StringReader(sourceMapFile.readText()))
val sourceMapParseResult = SourceMapParser.parse(sourceMapFile.readText())
return when (sourceMapParseResult) {
is SourceMapSuccess -> {
val bytesOut = ByteArrayOutputStream()

View File

@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util.*
import kotlin.math.max
private val COMMANDS = listOf("new", "touch", "delete")
private val COMMANDS_AS_REGEX_PART = COMMANDS.joinToString("|")
@@ -166,7 +167,7 @@ class TouchFile(path: String, private val touchPolicy: TouchPolicy) : Modificati
TouchPolicy.TIMESTAMP -> {
val oldLastModified = file.lastModified()
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(Math.max(System.currentTimeMillis(), oldLastModified + 1000))
file.setLastModified(max(System.currentTimeMillis(), oldLastModified + 1000))
}
TouchPolicy.CHECKSUM -> {
file.appendText(" ")

View File

@@ -2643,7 +2643,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2657,7 +2659,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -3220,7 +3224,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3236,7 +3242,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4365,7 +4373,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -4381,7 +4391,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4397,7 +4409,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -4416,7 +4430,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {

View File

@@ -4613,7 +4613,7 @@ public final class DebugJvmProtoBuf {
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*
* <pre>
* If absent, assumed to be JvmAbi.DEFAULT_MODULE_NAME
* If absent, assumed to be "main" (JvmProtoBufUtil.DEFAULT_MODULE_NAME)
* </pre>
*/
public static final

View File

@@ -1,7 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.gradle.api.file.FileCollection
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import proguard.gradle.ProGuardTask
@@ -10,11 +8,18 @@ import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.30-dev-1419", onlySuccessBootstrap = false))
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.60-dev-770", onlySuccessBootstrap = false))
repositories.withRedirector(project) {
repositories {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
} else {
maven("https://plugins.gradle.org/m2")
}
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
@@ -27,13 +32,8 @@ buildscript {
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:6.0.3")
classpath("net.sf.proguard:proguard-gradle:6.1.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
// a workaround to add another one buildSrc with Cidr-specific tools to Gradle classpath
if (findProperty("cidrPluginsEnabled")?.toString()?.toBoolean() == true) {
classpath("org.jetbrains.kotlin.ultimate:buildSrc:1.0")
}
}
}
@@ -59,11 +59,11 @@ buildScan {
}
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
it.forEach {
logger.info("Using ${it.majorVersion} home: ${it.homeDir}")
}
getConfiguredJdks().also {
it.forEach { jdkId ->
logger.info("Using ${jdkId.majorVersion} home: ${jdkId.homeDir}")
}
}
val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
@@ -91,6 +91,17 @@ val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
extra["ktorExcludesForDaemon"] = listOf(
"org.jetbrains.kotlin" to "kotlin-reflect",
"org.jetbrains.kotlin" to "kotlin-stdlib",
"org.jetbrains.kotlin" to "kotlin-stdlib-common",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk8",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk7",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-jdk8",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core-common"
)
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
@@ -111,20 +122,19 @@ extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPath("10")
extra["JDK_11"] = jdkPath("11")
gradle.taskGraph.beforeTask() {
// allow opening the project without setting up all env variables (see KT-26413)
if (!kotlinBuildProperties.isInIdeaSync) {
checkJDK()
}
var jdkChecked: Boolean = false
fun checkJDK() {
if (jdkChecked) {
return
val missingEnvVars = JdkMajorVersion.values()
.filter { it.isMandatory() && extra[it.name] == jdkNotFoundConst }
.mapTo(ArrayList()) { it.name }
if (missingEnvVars.isNotEmpty()) {
throw GradleException("Required environment variables are missing: ${missingEnvVars.joinToString()}")
}
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 {
@@ -145,8 +155,9 @@ 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"] = "1.0.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.0.1"
val coroutinesVersion = if (Platform[192].orHigher()) "1.2.1" else "1.1.1"
extra["versions.kotlinx-coroutines-core"] = coroutinesVersion
extra["versions.kotlinx-coroutines-jdk8"] = coroutinesVersion
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -156,104 +167,114 @@ 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
// NOTE: please, also change KTOR_NAME in pathUtil.kt and all versions in corresponding jar names in daemon tests.
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.3.50-dev-11052"
}
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf(if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j")
listOf(
if (Platform[191].orHigher()) "asm-all-7.0.1" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
extra["compilerModules"] = arrayOf(
":compiler:util",
":compiler:container",
":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.common",
":compiler:frontend.java",
":compiler:frontend.script",
":compiler:cli-common",
":compiler:daemon-common",
":compiler:daemon",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime"
":compiler:util",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:cli-common",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":kotlin-util-io",
":kotlin-util-klib",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:cli-js",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime",
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:fir2ir",
":compiler:fir:java"
)
val coreLibProjects = listOf(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":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"
val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// Local builds are disabled at the request of the lib team
// TODO: Enable when tests are fixed
":kotlin-stdlib-js-ir".takeIf { isTeamcityBuild },
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":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"
)
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
// ":kotlin-gradle-plugin-integration-tests", // TODO: build fails
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
)
apply {
@@ -282,34 +303,35 @@ val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toSt
allprojects {
jvmTarget = defaultJvmTarget
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.")
}
configurations.maybeCreate("embedded")
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
// There are problems with common build dir:
// - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location
// - idea seems unable to exclude common builddir from indexing
// - idea seems unable to exclude common buildDir from indexing
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
maven(protobufRepo)
maven(intellijRepo)
maven("https://dl.bintray.com/kotlin/ktor")
maven("https://kotlin.bintray.com/kotlin-dependencies")
bootstrapKotlinRepo?.let(::maven)
internalKotlinRepo?.let(::maven)
}
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOfNotNull(
"-Xuse-experimental=kotlin.Experimental",
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
@@ -357,21 +379,33 @@ allprojects {
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() } }")
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() }}")
try { 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@ {
run configureCompilerClasspath@{
val bootstrapCompilerClasspath by rootProject.buildscript.configurations
configurations.findByName("kotlinCompilerClasspath")?.let {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
configurations.findByName("kotlinCompilerPluginClasspath")
?.exclude("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
// Aggregate task for build related checks
tasks.register("checkBuild")
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
}
}
@@ -386,23 +420,18 @@ gradle.taskGraph.whenReady {
}
} 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
}
}
}
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
task.entryCompression = if (kotlinBuildProperties.jarCompression)
ZipEntryCompression.DEFLATED
else
ZipEntryCompression.STORED
}
}
val dist by task<Copy> {
val childDistTasks = getTasksByName("dist", true) - this@task
dependsOn(childDistTasks)
into(distDir)
from(files("compiler/cli/bin")) { into("kotlinc/bin") }
from(files("license")) { into("kotlinc/license") }
val dist = tasks.register("dist") {
dependsOn(":kotlin-compiler:dist")
}
val copyCompilerToIdeaPlugin by task<Copy> {
@@ -413,8 +442,7 @@ val copyCompilerToIdeaPlugin by task<Copy> {
val ideaPlugin by task<Task> {
dependsOn(copyCompilerToIdeaPlugin)
val childIdeaPluginTasks = getTasksByName("ideaPlugin", true) - this@task
dependsOn(childIdeaPluginTasks)
dependsOn(":prepare:idea-plugin:ideaPlugin")
}
tasks {
@@ -439,18 +467,18 @@ tasks {
create("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
create("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
@@ -460,10 +488,12 @@ tasks {
create("jvmCompilerTest") {
dependsOn("dist")
dependsOn(":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests")
dependsOn(
":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests"
)
dependsOn(":plugins:jvm-abi-gen:test")
}
@@ -472,15 +502,28 @@ tasks {
dependsOn(":js:js.tests:runMocha")
}
create("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
dependsOn(":compiler:fir:lightTree:test")
}
create("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-jvm-host:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
}
create("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
@@ -527,46 +570,59 @@ tasks {
create("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":eval4j:test")
dependsOn(
":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":nj2k:test",
":idea:jvm-debugger:jvm-debugger-core:test",
":idea:jvm-debugger:jvm-debugger-evaluation:test",
":idea:jvm-debugger:jvm-debugger-sequence:test",
":idea:jvm-debugger:eval4j:test"
)
}
create("idea-plugin-tests") {
dependsOn("dist")
dependsOn("idea-plugin-main-tests",
"idea-plugin-additional-tests")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
)
}
create("android-ide-tests") {
dependsOn("dist")
dependsOn(":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test")
dependsOn(
":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test"
)
}
create("plugins-tests") {
dependsOn("dist")
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test")
dependsOn(
":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test"
)
}
create("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
)
}
@@ -601,16 +657,27 @@ val zipCompiler by task<Zip> {
}
}
val zipStdlibTests by task<Zip> {
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-stdlib-tests.zip")
from("libraries/stdlib/common/test") { into("common") }
from("libraries/stdlib/test") { into("test") }
doLast {
logger.lifecycle("Stdlib tests are packed to ${archiveFile.get()}")
}
}
val zipTestData by task<Zip> {
destinationDir = file(distDir)
archiveName = "kotlin-test-data.zip"
dependsOn(zipStdlibTests)
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-test-data.zip")
isZip64 = true
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") }
from("compiler/tests-common/tests/org/jetbrains/kotlin/coroutineTestUtil.kt") { into("compiler") }
doLast {
logger.lifecycle("Test data packed to $archivePath")
logger.lifecycle("Test data packed to ${archiveFile.get()}")
}
}
@@ -641,11 +708,11 @@ val zipPlugin by task<Zip> {
configure<IdeaModel> {
module {
excludeDirs = files(
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
).toSet()
}
}
@@ -653,14 +720,19 @@ configure<IdeaModel> {
fun jdkPath(version: String): String {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath?:jdkNotFoundConst
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath ?: jdkNotFoundConst
}
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
val currentJavaHome = File(System.getProperty("java.home")!!).canonicalPath
val shouldFork = !currentJavaHome.startsWith(File(javaHome).canonicalPath)
tasks.withType<JavaCompile> {
if (name != "compileJava9Java") {
options.isFork = true
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.isFork = shouldFork
options.forkOptions.javaHome = file(javaHome)
options.compilerArgs.add("-proc:none")
options.encoding = "UTF-8"
@@ -676,6 +748,28 @@ fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<Test> {
executable = File(javaHome, "bin/java").canonicalPath
}
plugins.withId("java-base") {
configureShadowJarSubstitutionInCompileClasspath()
}
}
fun Project.configureShadowJarSubstitutionInCompileClasspath() {
val substitutionMap = mapOf(":kotlin-reflect" to ":kotlin-reflect-api")
fun configureSubstitution(substitution: DependencySubstitution) {
val requestedProject = (substitution.requested as? ProjectComponentSelector)?.projectPath ?: return
val replacementProject = substitutionMap[requestedProject] ?: return
substitution.useTarget(project(replacementProject), "Non-default shadow jars should not be used in compile classpath")
}
sourceSets.all {
for (configName in listOf(compileOnlyConfigurationName, compileClasspathConfigurationName)) {
configurations.getByName(configName).resolutionStrategy.dependencySubstitution {
all(::configureSubstitution)
}
}
}
}
tasks.create("findShadowJarsInClasspath").doLast {
@@ -683,12 +777,19 @@ tasks.create("findShadowJarsInClasspath").doLast {
sortedBy { it.path }.forEach { println(indent + it.relativeTo(rootProject.projectDir)) }
}
val mainJars = hashSetOf<File>()
val shadowJars = hashSetOf<File>()
for (project in rootProject.allprojects) {
project.withJavaPlugin {
project.sourceSets.forEach { sourceSet ->
val jarTask = project.tasks.findByPath(sourceSet.jarTaskName) as? Jar
jarTask?.outputFile?.let { mainJars.add(it) }
}
}
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(fileFrom(task.archivePath))
shadowJars.add(fileFrom(task.outputFile))
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
@@ -697,7 +798,8 @@ tasks.create("findShadowJarsInClasspath").doLast {
}
}
println("Shadow jars:")
shadowJars.removeAll(mainJars)
println("Shadow jars that might break incremental compilation:")
shadowJars.printSorted()
fun Project.checkConfig(configName: String) {
@@ -711,16 +813,14 @@ tasks.create("findShadowJarsInClasspath").doLast {
}
for (project in rootProject.allprojects) {
project.checkConfig("compileClasspath")
project.checkConfig("testCompileClasspath")
project.sourceSetsOrNull?.forEach { sourceSet ->
project.checkConfig(sourceSet.compileClasspathConfigurationName)
}
}
}
allprojects {
afterEvaluate {
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}
val Jar.outputFile: File
get() = archiveFile.get().asFile
val Project.sourceSetsOrNull: SourceSetContainer?
get() = convention.findPlugin(JavaPluginConvention::class.java)?.sourceSets

View File

@@ -1,15 +1,19 @@
import java.util.Properties
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
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"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
} else {
jcenter()
}
buildSrcKotlinRepo?.let {
@@ -62,9 +66,12 @@ rootProject.apply {
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
val flags = LocalBuildProperties(project)
val isTeamcityBuild = flags.isTeamcityBuild
val intellijUltimateEnabled by extra(flags.intellijUltimateEnabled)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
@@ -73,33 +80,29 @@ else
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps"
extra["customDepsOrg"] = "kotlin.build"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
jcenter()
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
}
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
}
dependencies {
compile(kotlin("stdlib", embeddedKotlinVersion))
compile("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
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")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.jetbrains.intellij.deps:asm-all:7.0")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.4.2")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}
samWithReceiver {
@@ -109,4 +112,44 @@ samWithReceiver {
fun Project.`samWithReceiver`(configure: org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension.() -> Unit): Unit =
extensions.configure("samWithReceiver", configure)
tasks["build"].dependsOn(":prepare-deps:android-dx:build", ":prepare-deps:intellij-sdk:build")
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks["build"].dependsOn(":prepare-deps:build")
allprojects {
tasks.register("checkBuild")
afterEvaluate {
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
}
}
// TODO: hide these classes in special gradle plugin for kotlin-ultimate which will support local.properties
class LocalBuildPropertiesProvider(private val project: Project) {
private val localProperties: Properties = Properties()
val rootProjectDir: File = project.rootProject.rootDir.parentFile
init {
rootProjectDir.resolve("local.properties").takeIf { it.isFile }?.let {
it.reader().use(localProperties::load)
}
}
fun getString(name: String): String? = project.findProperty(name)?.toString() ?: localProperties[name]?.toString()
fun getBoolean(name: String): Boolean = getString(name)?.toBoolean() == true
}
class LocalBuildProperties(project: Project) {
val propertiesProvider = LocalBuildPropertiesProvider(project)
val isTeamcityBuild = propertiesProvider.getString("teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled =
(propertiesProvider.getBoolean("intellijUltimateEnabled") || isTeamcityBuild)
&& propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
}

View File

@@ -0,0 +1,8 @@
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,124 +0,0 @@
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 org.gradle.jvm.tasks.Jar
val toolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val buildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val dxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
repositories {
ivy {
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()
}
}
}
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val dxModuleName = "android-dx"
val dxRevision = buildToolsVersion
val dxRepoModuleDir = File(customDepsRepoDir, "$customDepsOrg/$dxModuleName/$dxRevision")
val buildToolsZip by configurations.creating
val dxSourcesTar by configurations.creating
dependencies {
buildToolsZip("google:build-tools:$buildToolsVersion:$toolsOs@zip")
dxSourcesTar("google:dx:0@tar.gz")
}
val unzipDxJar by tasks.creating {
dependsOn(buildToolsZip)
inputs.files(buildToolsZip)
outputs.files(File(dxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(buildToolsZip.singleFile).files)
include("**/dx.jar")
into(dxRepoModuleDir)
}
}
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(dxSourcesTar)
inputs.files(dxSourcesTar)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(dxSourcesTar.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = dxRepoModuleDir
baseName = "dx"
classifier = "sources"
}
val prepareIvyXml by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
val ivyFile = File(dxRepoModuleDir, "$dxModuleName.ivy.xml")
outputs.file(ivyFile)
doLast {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, dxModuleName, dxRevision))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("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"
it.classifier = "sources"
})
writeTo(ivyFile)
}
}
}
val build by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar, prepareIvyXml)
}
val clean by tasks.creating(Delete::class) {
delete(dxRepoModuleDir)
delete(buildDir)
}

View File

@@ -0,0 +1,453 @@
@file:Suppress("PropertyName", "HasPlatformType", "UnstableApiUsage")
import org.gradle.internal.os.OperatingSystem
import java.io.Closeable
import java.io.FileWriter
import java.io.OutputStreamWriter
import java.net.URI
import java.text.SimpleDateFormat
import java.util.*
import javax.xml.stream.XMLOutputFactory
plugins {
base
}
val verifyDependencyOutput: Boolean by rootProject.extra
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("verifyDependencyOutput: $verifyDependencyOutput")
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val androidStudioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
url = URI("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease")
patternLayout {
artifact("[artifact]-[revision]-$androidStudioOs.[ext]")
}
metadataSources {
artifact()
}
}
ivy {
url = URI("https://dl.bintray.com/kotlin/as/")
patternLayout {
artifact("[artifact]-[revision]-$androidStudioOs.[ext]")
}
credentials {
username = System.getenv("AS_BINTRAY_USER_NAME") ?: findProperty("bintray.user") as String?
password = System.getenv("AS_BINTRAY_API_KEY") ?: findProperty("bintray.apikey") as String?
}
metadataSources {
artifact()
}
}
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val jpsStandalone by configurations.creating
val intellijCore by configurations.creating
val nodeJSPlugin by configurations.creating
/**
* Special repository for annotations.jar required for idea runtime only.
*
* See IntellijDependenciesKt.intellijRuntimeAnnotations for more details.
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val dependenciesDir = (findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File)
?: rootProject.rootDir.parentFile.resolve("dependencies")
val customDepsRepoDir = dependenciesDir.resolve("repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
dependencies {
if (androidStudioRelease != null) {
val extension = if (androidStudioOs == "linux" &&
(androidStudioRelease.startsWith("3.5") || androidStudioRelease.startsWith("3.6")))
"tar.gz"
else
"zip"
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
if (asmVersion != null) {
sources("org.jetbrains.intellij.deps:asm-all:$asmVersion:sources@jar")
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
val targetDir = File(repoDir, "$intellijRuntimeAnnotations/$intellijVersion")
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
from(provider { sources.map(::zipTree) })
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
archiveVersion.set(intellijVersion)
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
val buildNodeJsPlugin = buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
if (installIntellijUltimate) {
dependsOn(buildNodeJsPlugin)
}
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
tasks.named<Delete>("clean") {
delete(customDepsRepoDir)
}
fun buildIvyRepositoryTask(
configuration: Configuration,
organization: String,
repoDirectory: File,
pathRemap: ((String) -> String)? = null,
sources: File? = null
) = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
fun ResolvedArtifact.moduleDirectory(): File =
File(repoDirectory, "$organization/${moduleVersion.id.name}/${moduleVersion.id.version}")
dependsOn(configuration)
inputs.files(configuration)
if (verifyDependencyOutput) {
outputs.dir(provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory()
})
} else {
outputs.upToDateWhen {
configuration.resolvedConfiguration.resolvedArtifacts.single()
.moduleDirectory()
.exists()
}
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
from(fileTree.matching {
exclude("**/plugins/Kotlin/**")
})
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
}
}
}
}
}
fun writeIvyXml(
organization: String,
moduleName: String,
version: String,
fileName: String,
baseDir: File,
artifactDir: File,
targetDir: File,
vararg sourcesJar: File,
allowAnnotations: Boolean = false
) {
fun shouldIncludeIntellijJar(jar: File) =
jar.isFile
&& jar.extension == "jar"
&& !jar.name.startsWith("kotlin-")
&& (allowAnnotations || jar.name != "annotations.jar") // see comments for [intellijAnnotations] above
val ivyFile = targetDir.resolve("$fileName.ivy.xml")
ivyFile.parentFile.mkdirs()
with(XMLWriter(FileWriter(ivyFile))) {
document("UTF-8", "1.0") {
element("ivy-module") {
attribute("version", "2.0")
attribute("xmlns:m", "http://ant.apache.org/ivy/maven")
emptyElement("info") {
attributes(
"organisation" to organization,
"module" to moduleName,
"revision" to version,
"publication" to SimpleDateFormat("yyyyMMddHHmmss").format(Date())
)
}
element("configurations") {
listOf("default", "sources").forEach { configurationName ->
emptyElement("conf") {
attributes("name" to configurationName, "visibility" to "public")
}
}
}
element("publications") {
artifactDir.listFiles()?.filter(::shouldIncludeIntellijJar)?.forEach { jarFile ->
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
emptyElement("artifact") {
attributes(
"name" to relativeName,
"type" to "jar",
"ext" to "jar",
"conf" to "default"
)
}
}
sourcesJar.forEach { jarFile ->
emptyElement("artifact") {
val sourcesArtifactName = jarFile.name
.substringBeforeLast("-")
.substringBeforeLast("-")
attributes(
"name" to sourcesArtifactName,
"type" to "jar",
"ext" to "jar",
"conf" to "sources",
"m:classifier" to "sources"
)
}
}
}
}
}
close()
}
}
fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")
class XMLWriter(private val outputStreamWriter: OutputStreamWriter) : Closeable {
private val xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStreamWriter)
private var depth = 0
private val indent = " "
fun document(encoding: String, version: String, init: XMLWriter.() -> Unit) = apply {
xmlStreamWriter.writeStartDocument(encoding, version)
init()
xmlStreamWriter.writeEndDocument()
}
fun element(name: String, init: XMLWriter.() -> Unit) = apply {
writeIndent()
xmlStreamWriter.writeStartElement(name)
depth += 1
init()
depth -= 1
writeIndent()
xmlStreamWriter.writeEndElement()
}
fun emptyElement(name: String, init: XMLWriter.() -> Unit) = apply {
writeIndent()
xmlStreamWriter.writeEmptyElement(name)
init()
}
fun attribute(name: String, value: String): Unit = xmlStreamWriter.writeAttribute(name, value)
fun attributes(vararg attributes: Pair<String, String>) {
attributes.forEach { attribute(it.first, it.second) }
}
private fun writeIndent() {
xmlStreamWriter.writeCharacters("\n")
repeat(depth) {
xmlStreamWriter.writeCharacters(indent)
}
}
override fun close() {
xmlStreamWriter.flush()
xmlStreamWriter.close()
outputStreamWriter.close()
}
}

View File

@@ -1,285 +0,0 @@
@file:Suppress("PropertyName")
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
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val studioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
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()
}
}
}
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://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val `plugins-NodeJS` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
val repoDir = customDepsRepoModulesDir
dependencies {
if (androidStudioRelease != null) {
intellij("google:android-studio-ide:$androidStudioBuild")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
if (asmVersion != null) {
sources("org.jetbrains.intellij.deps:asm-all:$asmVersion:sources@jar")
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`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")
if (intellijUltimateEnabled) {
`plugins-NodeJS`("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration,
pathRemap: (String) -> String = { it },
extractor: (Configuration) -> Any) {
dependsOn(sourceConfig)
inputs.files(sourceConfig)
val targetDir = File(repoDir, sourceConfig.name)
outputs.dirs(targetDir)
doFirst {
project.copy {
from(extractor(sourceConfig))
into(targetDir)
eachFile {
path = pathRemap(path)
}
}
}
}
fun removePathPrefix(path: String): String {
if (androidStudioRelease == null) return path
val slashes = if (studioOs == "mac") 2 else 1
var result = path
repeat(slashes) {
result = result.substringAfter('/')
}
return result
}
val unzipIntellijSdk by tasks.creating {
configureExtractFromConfigurationTask(intellij, pathRemap = { removePathPrefix(it) }) {
zipTree(it.singleFile).matching {
exclude("**/plugins/Kotlin/**")
}
}
}
val unzipIntellijUltimateSdk by tasks.creating {
configureExtractFromConfigurationTask(intellijUltimate) {
zipTree(it.singleFile).matching {
exclude("plugins/Kotlin/**")
}
}
}
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
from(provider { sources.map(::zipTree) })
destinationDir = File(repoDir, sources.name)
baseName = "intellij"
classifier = "sources"
version = intellijVersion
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
val unzipNodeJSPlugin by tasks.creating { configureExtractFromConfigurationTask(`plugins-NodeJS`) { zipTree(it.singleFile) } }
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, vararg sourcesJar: File) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
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"
}
)
}
}
sourcesJar.forEach {
val sourcesArtifactName = it.name.substringBeforeLast("-").substringBeforeLast("-")
addArtifact(
FileBasedIvyArtifact(it, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also { artifact ->
artifact.conf = "sources"
artifact.classifier = "sources"
}
)
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, mergeSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
if (installIntellijCommunity) {
dependsOn(unzipIntellijSdk)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
}
if (installIntellijUltimate) {
dependsOn(unzipIntellijUltimateSdk)
inputs.dir(intellijUltimateSdkDir)
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
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"))
}
inputs.dir(File(repoDir, sources.name))
if (intellijUltimateEnabled) {
dependsOn(unzipNodeJSPlugin)
inputs.dir(File(repoDir, `plugins-NodeJS`.name))
outputs.file(File(repoDir, "${`plugins-NodeJS`.name}.ivy.xml"))
}
doFirst {
val sources = File(repoDir, sources.name).listFiles()
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
writeIvyXml(intellij.name,
intellij.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
*sources)
File(intellijSdkDir, "plugins").listFiles { file: File -> file.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), *sources)
}
}
if (installIntellijUltimate) {
val libDir = File(intellijUltimateSdkDir, "lib")
writeIvyXml(intellij.name, // important! the module name should be "intellij"
intellijUltimate.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
*sources)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), *sources)
}
}
flatDeps.forEach {
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), *sources)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), *sources)
}
}
}
val build by tasks.creating {
dependsOn(prepareIvyXmls)
}
val clean by tasks.creating(Delete::class) {
delete(customDepsRepoModulesDir)
delete(buildDir)
}

View File

@@ -1,15 +1,78 @@
pluginManagement {
repositories {
if (cacheRedirectorEnabled == 'true') {
logger.info("Using cache redirector for settings.gradle pluginManagement")
maven {
url "https://cache-redirector.jetbrains.com/plugins.gradle.org/m2"
}
} else {
gradlePluginPortal()
}
gradlePluginPortal()
}
}
include "prepare-deps:android-dx",
"prepare-deps:intellij-sdk"
include "prepare-deps"
def flags = new LocalBuildProperties(settings as Settings)
if (flags.includeCidrPlugins) {
logger.info("Including CIDR plugins in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
project(":prepare-deps:kotlin-native-platform-deps").projectDir = file("${flags.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
} else {
logger.info("NOT including CIDR plugins in buildSrc/settings.gradle")
}
if (flags.hasKotlinUltimate) {
logger.info("Including extension for IJ Ultimate in buildSrc/settings.gradle")
include ":prepare-deps:lldb-frontend"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:lldb-frontend").projectDir = file("${flags.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
project(":prepare-deps:native-debug-plugin").projectDir = file("${flags.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else {
logger.info("Not including extension for IJ Ultimate in buildSrc/settings.gradle")
}
class LocalBuildPropertiesProvider {
private Settings settings
private Properties localProperties = new Properties()
File rootProjectDir
LocalBuildPropertiesProvider(Settings settings) {
this.settings = settings
this.rootProjectDir = settings.rootProject.projectDir.parentFile
File propertiesFile = new File(rootProjectDir, 'local.properties')
if (propertiesFile.isFile()) {
propertiesFile.withInputStream { localProperties.load(it) }
}
}
String getString(String name) {
if (settings.hasProperty(name)) {
return settings[name]?.toString()
} else {
return localProperties[name]?.toString()
}
}
Boolean getBoolean(String name) {
return Boolean.parseBoolean(getString(name))
}
}
class LocalBuildProperties {
LocalBuildPropertiesProvider propertiesProvider
boolean includeCidrPlugins
boolean hasKotlinUltimate
LocalBuildProperties(Settings settings) {
propertiesProvider = new LocalBuildPropertiesProvider(settings)
hasKotlinUltimate = new File(propertiesProvider.rootProjectDir, 'kotlin-ultimate').exists()
includeCidrPlugins = propertiesProvider.getBoolean('cidrPluginsEnabled') && hasKotlinUltimate
}
}

View File

@@ -1,15 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
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")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar")
}
fun Project.androidDxJar() = "kotlin.build.custom.deps:android-dx:${rootProject.extra["versions.androidBuildTools"]}"

View File

@@ -7,10 +7,14 @@ import org.gradle.kotlin.dsl.*
var Project.bootstrapKotlinVersion: String
get() = this.property("bootstrapKotlinVersion") as String
private set(value) { this.extra["bootstrapKotlinVersion"] = value }
var Project.bootstrapKotlinRepo: String?
get() = this.property("bootstrapKotlinRepo") as String?
private set(value) { this.extra["bootstrapKotlinRepo"] = value }
val Project.internalKotlinRepo: String?
get() = bootstrapKotlinRepo?.replace("artifacts/content/maven/", "artifacts/content/internal/repo")
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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
@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P181, P182, P183, P191;
P181, P182, P183, P191, P192;
val version: Int = name.drop(1).toInt()
@@ -45,11 +45,13 @@ enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
IJ192(Platform.P192),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183),
AS35(Platform.P183);
AS35(Platform.P183),
AS36(Platform.P192);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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

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