Compare commits

...

5822 Commits

Author SHA1 Message Date
Nikolay Igotti
31e9b6d904 WIP 2020-03-03 17:09:17 +03:00
Nikolay Igotti
f45ba79a16 Add compose plugin. 2020-03-03 15:47:09 +03:00
Vyacheslav Gerasimov
75a3808230 Build: Use sourceMapBaseDirs in :kotlin-stdlib-js:compileKotlin2Js
instead of freeCompiler args to avoid snapshotting absolute paths
and fix caching
2020-03-03 14:33:57 +03:00
Vyacheslav Gerasimov
4b9c7a1ae1 Advance bootstrap to 1.4.0-dev-1818 2020-03-03 14:33:55 +03:00
Victor Petukhov
d6ccdb3caa NI: fix extensionLambdasAndArrow test 2020-03-03 13:55:15 +03:00
Kristoffer Andersen
6e40117116 [JVM IR] Refactor PromisedValue...
... for an _even leaner_ codegen!

- move discard from extention method to abstract method. This will at
  length avoid some calls to materialize.

- use newly abstract method to specialize discard in cases where it
  would introduce _and_ coerce values only to be popped by discard.

- move coerce to member method, introduce materializeAt with a view to
  eliminate calls to coerce outside of PromisedValue. This will allow
  us to specilaize materialization at particular types in some
  instances, at length avoiding casts etc.

- no calls to coerce outside of PromisedValue.kt! Progress.

- inlined coerce into materializeAt, anticipating specializing
  materializeAt across implementations of PromisedValue

- made materializeAt abstract, copied implementation everywhere!

- made materialize an extention function! Ready to specialize materializeAt

- coerce is no more!

- simplified and specialized all inlinings of materializeAt.

- adjust docs to match refactoring
2020-03-03 11:41:55 +01:00
Pavel Kirpichenkov
ad988dbf43 minor: update test data 2020-03-03 12:57:41 +03:00
Pavel Kirpichenkov
23ed6c4a1f [NI] Narrow nullability constraint check in incorporator
This commit is a hotfix rather then proper solution.
The source of the issue is that currently type variable fixation result
may change due to fixation order alteration for variables with the same priority.
For instance, having variables V1, V2, and proper types Type1, Type2, such that:
V1 <: Type1
V1 <: V2
Type2 <: V2
both variables will be fixed either to Type1, if V1 will be fixed first,
or to Type2 otherwise.

Since this limitation cannot be easily overcome, the taken approach is to remove
incedental constraint added after 2d5a0546 by restricting nullability constraint check
to `Nothing?` constraints only, thus postponing problematic variable fixation.
To clearify, additional constraint is correct and should cause no harm (in ideal world),
but currently its presence changes fixation order.
So without the restriction the previously used constraint from fixed outer variable
is no longer available by the time problematic variable type is being selected.

^KT-37043 Fixed
2020-03-03 12:57:25 +03:00
Dmitriy Novozhilov
ec01893237 [FIR] Resolve return expressions in independent context 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov
d4f57fb835 [FIR] Support comparision operator and reified parameter reference in html dump 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov
9eeee6aad7 [FIR-TEST] Move FirBlackBoxCodegenTestGenerated to :fir2ir module 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov
54e7c79257 [FIR] Safe implicit receiver stack in lambda atom for resolve of inner lambdas
#KT-36887 Fixed
2020-03-03 09:57:42 +03:00
Dmitriy Novozhilov
c7f5a2cba2 [FIR] Make ImplicitReceiverStack persistent 2020-03-03 09:57:41 +03:00
Dmitriy Novozhilov
a332a5f26d Add benchmark with case with a lot of implicit receivers 2020-03-03 09:57:41 +03:00
Dmitriy Novozhilov
7ee125e1ad [FIR] Add receiver for lambda in position of default argument
#KT-36905 Fixed
2020-03-03 09:57:41 +03:00
Dmitriy Novozhilov
c12fb1e069 [FIR] Fix determining type of when subject in exhaustiveness checker
#KT-37091 Fixed
2020-03-03 09:57:41 +03:00
Ivan Gavrilovic
6d4eb9ae52 KT-36113: Make KAPT classpath snapshot deterministic
When snapshotting a classpath entry, sort information about types
so there is no dependency on the order of entries in jar.

Test: ClasspathAnalyzerTest
2020-03-03 14:22:57 +09:00
pyos
9b68e4fe56 Android/IR: handle nulls from getView/getContainerView
Turns out it's possible to create an IR builder without a backend
context
2020-03-03 14:19:47 +09:00
Yan Zhulanow
390d062721 Fix class run configuration applicability (KT-33787)
The bug appeared when we turned “ultra light classes” on by default.
  The difference with the old implementation is that
  PsiClass.getTextRange() returns the correct non-null value.
  This triggers JavaExecutionUtil#stepIntoSingleClass() to return
  a light class instead of the original location (of a PsiIdentifier).
  So AbstractJavaTestConfigurationProducer#isConfigurationFromContext()
  returns true, and the wrong configuration is reused instead of
  creating the new one.

By the way, for Java it also returns an identifier because of the
  PsiTreeUtil.getParentOfType(element, PsiClass.class) != null check.

The proper fix should land in the newer versions of IDEA, however this
  (hopefully, temporary) hack will fix test method gutters for
  all platform versions.
2020-03-03 14:18:04 +09:00
Yan Zhulanow
b360fb5119 Revert "Import Kotlin JUnit run configuration settings from Gradle" 2020-03-03 14:18:03 +09:00
Yan Zhulanow
29566723b8 Partially revert "Prefer Kotlin Gradle test run configurations when possible (KT-33787)"
This commit reverts 987307cf92.
Tests are left behind as the different fix will be provided for KT-33787.
2020-03-03 14:18:03 +09:00
Yan Zhulanow
9016a573ca Partially revert "Prefer Kotlin Junit test run configurations when possible (KT-33787)"
This commit reverts parts of ef8b3cb72a.
Tests are left behind as the different fix will be provided for KT-33787.
2020-03-03 14:18:03 +09:00
Nikolay Krasko
208c7274dd Disable parallel execution for gradle tests 2020-03-02 23:21:46 +03:00
Natalia Selezneva
c0cd010b7d .gradle.kts: fix freezes by avoiding fs walking
^KT-36502 Fixed
2020-03-02 20:48:55 +03:00
Dmitry Petrov
01c4e66edb PSI2IR Use resulting descriptor extension receiver type
Use resulting descriptor extension receiver type instead of
ReceiverValue.type (which can contain captured types, which would be
approximated, and cause IR validation errors).
2020-03-02 20:34:02 +03:00
Victor Petukhov
51749b9747 NI: don't try to infer visible lambda parameters, if there is single one – extension parameter
^KT-37038 Fixed
2020-03-02 20:28:59 +03:00
pyos
ed83e3ccef Optimize more redundant kotlin/jvm/internal/Refs
The number of initializations of the `value` field before the live range
begins does not really matter so long as we insert a write of a default
value to the local if there were none.
2020-03-02 20:20:55 +03:00
pyos
7e6d080123 JVM_IR: default-initialize variables visible in the LVT
See KT-36812. Aside from the problem stated there, D8 will throw out the
entire LVT if it sees a variable that has not been written to (and will
generate incorrect SSA if the slot is reused with a different type).

Note: this only fixes a FIR test because it's missing an `else -> throw`
branch, and default initialization satisfies the verifier and masks the
incorrect control flow.
2020-03-02 20:17:10 +03:00
Dmitry Gridin
ecb7478794 ExperimentalFixesFactory: OptIn shouldn't be added for old version
#KT-36478
2020-03-03 00:09:00 +07:00
Nikolay Krasko
08dc03a704 201: Fix refineSignaturesWithResolve failure for primary constructors 2020-03-02 18:25:29 +03:00
Nikolay Krasko
096ff0e8a9 201: Enable mute in KotlinSuggestedRefactoringChangeListenerTest 2020-03-02 18:25:29 +03:00
Mikhail Zarechenskiy
d1a8f57740 Disable New Inference in JS backend
See #KT-37163 for details
2020-03-02 18:03:41 +03:00
Dmitry Savvinov
e6885323da Accept incorrect behaviour for run-config tests for AS
Short description.
It's a corner-case with old MPP plugins and AS, so we
don't care too much that it works incorrectly, but we'd like to avoid
muting it in order to keep track of this "known issue"

Long description.
In IDEA, KotlinJvmTestMethodGradleConfigurationProducer successfully
returns run configuration; in AS, it fails to do so.

This is becasuse it doesn't override 'forceGradleRunner', which means
that in 'setupConfigurationFromContext' we'll delegate to super-call,
which will pull 'GradleProjectSettings.getTestRunner()'.

In IDEA, it will return GRADLE, but in AS it will return PLATFORM,
because AS uses special instance of GradleProjectSettings which forces
runner to PLATFORM.

Note that KotlinMultiplatformJvmTestMethodGradleConfigurationProducer
does override 'forceGradleRunner' to true, that's why other tests work
successfully. However, this test uses old 1.2.X-MPP plugins, therefore
all new KotlinMultiplatform*ConfigurationProducers won't work here.\
2020-03-02 16:40:15 +03:00
Ilmir Usmanov
22de20e7e5 JVM_IR: Generate PUBLIC constructor for suspend lambda
if the lambda is inside inline function.
2020-03-02 14:03:35 +01:00
Ilmir Usmanov
42420cb6fc JVM_IR: Generate inner classes for continuations
Also, generate correct visibilities for constructors and continuation's fields.
2020-03-02 14:03:33 +01:00
Ilmir Usmanov
536e0e23a0 JVM_IR: Lazyly generate continuation classes of suspend functions
Otherwise, they will be generated, but unused, if the function is tail-call.
 #KT-36795 Fixed
2020-03-02 14:03:31 +01:00
Vladimir Dolzhenko
91ee63432a Disable CacheResetOnProcessCancele by default 2020-03-02 11:42:19 +01:00
Konstantin Tskhovrebov
60d592716d Disable KotlinMppTestLogger for non test executions.
Issue #KT-36716 Fixed
2020-03-02 13:41:33 +03:00
Konstantin Tskhovrebov
35055d1895 Fix empty run actions in context menu for non-JVM test results.
Issue #KT-36910 Fixed
Issue #KT-36909 Fixed
2020-03-02 12:25:36 +03:00
Vladimir Ilmov
dc8f24b8bc Revert "Registry key to show hidden variables in debugger."
This reverts commit f5e6001d82.
2020-03-02 08:35:09 +01:00
Dmitry Petrov
61f8d3e558 Minor: update FIR2IR testData 2020-03-02 10:11:51 +03:00
Mikhail Glukhikh
1bad380381 FIR: fix test data in IDEA multi-module tests 2020-03-02 10:03:49 +03:00
Dmitriy Novozhilov
70ee51d88c [FIR] Add anonymous objects to CFG 2020-03-02 09:49:29 +03:00
Dmitriy Novozhilov
e3f1f18ca3 [FIR] Add empty member scope for type variables 2020-03-02 09:49:29 +03:00
Dmitriy Novozhilov
985311d9f0 [FIR] Implement delegate inference 2020-03-02 09:49:29 +03:00
Dmitriy Novozhilov
1003b81c93 [FIR] Introduce inference session 2020-03-02 09:49:28 +03:00
Dmitriy Novozhilov
dfa6dfa960 [FIR] Support deserialization of annotations on JVM 2020-03-02 09:49:28 +03:00
Dmitriy Novozhilov
296ee2da4a [FIR] Support @LowPriorityInOverloadResolution annotation 2020-03-02 09:49:28 +03:00
Dmitriy Novozhilov
4454a0681b [FIR] Get rid of copying function call in process of completion 2020-03-02 09:49:28 +03:00
Dmitriy Novozhilov
cda8177502 [FIR] Add transformDelegate for FirProperty 2020-03-02 09:07:23 +03:00
Dmitriy Novozhilov
e8b0ce00e1 [FIR] Remove useless file argument from FirCallResolver 2020-03-02 09:07:23 +03:00
Dmitriy Novozhilov
807d41028e [FIR] FirComponentCall rendered same as FirFunctionCall 2020-03-02 09:07:23 +03:00
Toshiaki Kameyama
266149b88c RedundantLetInspection: fix false positive with nullable receiver extension call
#KT-31601 Fixed
2020-03-02 10:21:47 +07:00
Ilya Kirillov
a6139f3635 Wizard: minor: fix YamlParsingError package 2020-03-01 21:32:36 +03:00
Ilya Kirillov
a9c96a7cde Wizard: move downloading Kotlin version phase to the end 2020-03-01 19:07:51 +03:00
Ilya Kirillov
a03510e3c0 Wizard: add tags for project templates 2020-03-01 19:07:50 +03:00
Ilya Kirillov
d639816393 Wizard: use kotlinx-collections-immutable for storing IRs 2020-03-01 19:07:49 +03:00
Nikolay Krasko
e38448c6f2 No need to hack PsiSubstitutor anymore in AS 40 (KT-36039)
Remove KotlinCoreApplicationEnvironment for AS 40 after platform update.
2020-03-01 00:37:44 +03:00
Vyacheslav Gerasimov
b1ca06b21d Build: Add missing tools.jar to performance tests runtime 2020-02-29 23:30:27 +03:00
Vyacheslav Gerasimov
05b5894ef1 Build: Use configurations property for shadowJar in :kotlin-main-kts
It marked as classpath and improves cache reuse between different builds
2020-02-29 16:36:02 +03:00
Vyacheslav Gerasimov
0db69cadb6 Build: Make all compile dependencies on toolsJar compileOnly
tools.jar differs between different versions of JDK reducing cache reuse
so better to not leak it to other modules
2020-02-29 16:35:54 +03:00
Vyacheslav Gerasimov
8e0f403f02 Build: normalize inputs of :kotlin-reflect:stripMetadata as classpath 2020-02-29 16:33:34 +03:00
Vyacheslav Gerasimov
6e2fb72bb6 Build: Make :kotlin-reflect:relocateCoreSources task cacheable 2020-02-29 16:33:34 +03:00
Vyacheslav Gerasimov
0ebc11270b Build: Remove duplicated manifestAttributes call from reflectShadowJar
manifestAttributes call done in the result jar
2020-02-29 16:32:02 +03:00
Vyacheslav Gerasimov
54d8afea40 Build: Disable caching for Test tasks until we are sure it is safe
#KT-37089
2020-02-29 16:32:01 +03:00
Vyacheslav Gerasimov
5195cc8c12 Build: Add buildserver.labs.intellij.net to valid hosts in caching check 2020-02-29 16:32:01 +03:00
Vyacheslav Gerasimov
b64c7cce84 Build: Use Jar task for :kotlin-compiler:packCompiler
Right now can't be cached between builds because of compiler version.
We may move module containing compiler version directly to the final jar
2020-02-29 16:32:00 +03:00
Vyacheslav Gerasimov
35c4cc6d45 Build: Use Jar task instead ShadowJar task in :kotlin-daemon-client-new 2020-02-29 16:31:59 +03:00
Vyacheslav Gerasimov
07949aaf4f Build: Use Jar task instead ShadowJar task in :kotlin-daemon 2020-02-29 16:31:59 +03:00
Vyacheslav Gerasimov
6c8c126ebc as40: Update to AS 4.0 Beta 1 2020-02-29 16:15:11 +03:00
Sergey Rostov
7359bb8a00 Fix tests freeze because of ScriptChangesNotifier (KT-37112)
#KT-37112 Fixed
2020-02-29 01:14:26 +03:00
Dmitry Petrov
03913ff029 KT-33119 Generate IINC for primitive types only 2020-02-28 23:20:02 +03:00
Dmitry Petrov
2010d8d2b9 KT-36956 fix back-end part in JVM and JVM_IR
PSI2IR: deparenthesize LHS expression when generating assignment
receiver.

FE: record 'set' operator call for code generation.
2020-02-28 23:04:42 +03:00
Sergey Igushkin
f764d3a021 testCompileOnlyDependencyProcessingForMetadataCompilations -> Gradle 5+
This test fails with Gradle 4.9 due to a Gradle bug when Gradle is
unable to pick up task dependencies from providers nested into a file
collection. That doesn't seem feasible to fix.
2020-02-28 20:09:45 +03:00
Sergey Igushkin
b8602fa31a Fix missing installation dependencies in Gradle integration tests 2020-02-28 20:09:45 +03:00
Vladimir Dolzhenko
197e096017 Disable PerformanceNativeProjectsTest 2020-02-28 17:36:46 +01:00
Vladimir Dolzhenko
bc0e466981 Add undo typing kts performance test 2020-02-28 17:36:33 +01:00
Steven Schäfer
4ac45eb38b JVM IR: Fix inline class constructors taking default values of inline class type. 2020-02-28 17:11:59 +01:00
Vladimir Dolzhenko
846e50a0c0 Backport ActionUtil.underModalProgress to fix 191/192 compilation
Relates to #EA-143709
2020-02-28 15:16:26 +01:00
Nikolay Krasko
d47fc7280b Fix testUnresolvedMultiline test data 2020-02-28 16:51:12 +03:00
Nikolay Krasko
50c92f2a05 Bad string interpolation for empty string in batch (KT-37090)
#KT-37090 Fixed
2020-02-28 16:51:12 +03:00
Steven Schäfer
b173284d1d Add tests for super calls in inline classes 2020-02-28 14:48:17 +01:00
Steven Schäfer
0fe8fec1d1 Mute FIR tests 2020-02-28 14:48:17 +01:00
Steven Schäfer
465e9f2d68 JVM IR: Always produce stubs for interface methods in inline classes
This matches the behavior of the JVM backend, with the exception of
@JvmDefault methods, which are currently broken on the JVM backend.
2020-02-28 14:48:17 +01:00
Steven Schäfer
8c9ebc1bf9 JVM IR: Initialize parent field in InlineCallableReferenceToLambda 2020-02-28 14:48:17 +01:00
Mikhail Glukhikh
c2eab08cc9 FIR: fix arose problem with smartcast un-stability 2020-02-28 15:36:19 +03:00
Mikhail Glukhikh
d5fbd93fe6 Unmute additional FIR black box tests
This was result of comparison commits together (?) with override commits
2020-02-28 15:29:03 +03:00
Mikhail Glukhikh
9e69ffad36 FIR2IR (refactoring): introduce ConversionTypeContext 2020-02-28 15:29:03 +03:00
Mikhail Glukhikh
883dd95e3c FIR: fix class / constructor type parameter duplication 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh
2308e5bb7c FIR2IR: in case of use-site generic type use call from original class 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh
096dc25701 FIR: change callableId of fake overrides to derived class owner 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh
db7401d8eb FIR2IR: set GET_PROPERTY origin for property reads 2020-02-28 15:29:01 +03:00
Mikhail Glukhikh
e066afc67f FIR2IR: set parents for external enum entries 2020-02-28 15:29:01 +03:00
Mikhail Glukhikh
5b3b35cd78 FIR2IR: set "external stub" origin for external enum entries 2020-02-28 15:29:01 +03:00
Mikhail Glukhikh
3a3d6e740c FIR2IR: correctly set type parameters of property accessors
In particular, we generate different type parameters for
getters & setters here.
2020-02-28 15:29:01 +03:00
Mikhail Glukhikh
50abb07245 [FIR] Record & use type arguments of FirQualifiedAccessExpression 2020-02-28 15:29:00 +03:00
Ilya Matveev
f53b059410 [Gradle, tests] Fix native compiler arguments test for Windows 2020-02-28 17:50:55 +07:00
Toshiaki Kameyama
0b9106b0f8 CanBePrimaryConstructorPropertyInspection: do not report for 'open' property used in class initializer in 'open' class 2020-02-28 17:21:56 +07:00
Georgy Bronnikov
963258189a JVM_IR: change parameter type computation in InlineCallableReferenceToLambda
The reference type is approximated in Psi2Ir, so we may get Nothing as
a reference type argument. Better look at the arguments of the
referenced function.
2020-02-28 12:59:21 +03:00
pyos
456139fc5e JVM_IR: cache signatures in BridgeLowering
`mapAsmMethod` is somewhat slow, so this helps if there are a lot of
overrides of same methods and/or deep class hierarchies in a single file
(though it would probably help more if lowerings were not reconstructed
for every file).
2020-02-28 12:32:26 +03:00
Ilya Kirillov
97e320b57f Don't show IR_COMPILED_CLASS error in IJ when it arises in module with backend IR enabled
The problem here is that library resolver uses global project compiler
settings instead of the module ones. That behaviour is caused by more
global problem described in #KT-21246

As a temporary solution we just do not show IR_COMPILED_CLASS error in
IDE if it arises in a module which have -XuseIR or
-Xallow-jvm-ir-dependencies option provided

#KT-36907 fixed
2020-02-28 11:45:51 +03:00
Nikolay Krasko
7a4d414c59 201: Mute SuggestedRefactoring tests 2020-02-28 11:36:42 +03:00
Nikolay Krasko
6a9dfd4935 201: Mute HierarchicalMultiplatformProjectImportingTest: No module dependency found 2020-02-28 11:36:41 +03:00
Nikolay Krasko
774db02b23 201: Mute quick fix tests: Range must be inside element being annotated 2020-02-28 11:36:41 +03:00
Nikolay Krasko
06adac1abf 201: Mute TodoSearchTest: duplicate TODO items 2020-02-28 11:36:41 +03:00
Nikolay Krasko
543168c61d 201: Mute incremental compilation tests with constants 2020-02-28 11:36:40 +03:00
Nikolay Krasko
8501ea78c8 201: Mute a lot of tests with enums 2020-02-28 11:36:40 +03:00
Nikolay Krasko
79e663828a 201: Mute QuickFixTestGenerate: Range must be inside element being annotated 2020-02-28 11:36:39 +03:00
Nikolay Krasko
f5a97ea56e 201: Mute GradleScriptInputsWatcherTest failures 2020-02-28 11:36:39 +03:00
Nikolay Krasko
dad7fd383c 201: Upgrade nodejs plugin in 201 branch 2020-02-28 11:36:39 +03:00
Nikolay Krasko
f0a4f838f2 201: Mute NewMultiplatformProjectImportingTest tests
No module dependency found
No source folder found
2020-02-28 11:36:38 +03:00
Nikolay Krasko
f4cd25ce72 201: Mute MultiplatformProjectImportingTest tests
Failed search dependency in Gradle tests.
2020-02-28 11:36:38 +03:00
Nikolay Krasko
67dee52b8a 201: Mute NewJavaToKotlinConverterSingleFileTestGenerated tests 2020-02-28 11:36:38 +03:00
Nikolay Krasko
958b8a0b10 201: Fix maven plugin loading by adding repository-search to runtime 2020-02-28 11:36:37 +03:00
Nikolay Krasko
0fcd011abb 201: Fix loading project in configuration tests
De-bunch AbstractConfigureKotlinTest.kt, just don't use field in 193.
2020-02-28 11:36:37 +03:00
Nikolay Krasko
1a01ba0ae5 201: Trick idea home path exception with custom idea.home variable 2020-02-28 11:36:36 +03:00
Nikolay Krasko
da2683d180 Copy 192 muted tests 2020-02-28 11:36:36 +03:00
Nikolay Krasko
dd21736471 Register JDK for default project to prevent create leaking one for Gradle import 2020-02-28 11:36:36 +03:00
Nikolay Krasko
c9fd79c311 Enable mute in code for all KotlinLightCodeInsightFixtureTestCaseBase 2020-02-28 11:36:35 +03:00
Nikolay Krasko
1c0a9d2981 Minor: better asserts in TodoSearchTest.kt 2020-02-28 11:36:35 +03:00
Nikolay Krasko
26df2a5c68 Enable mute test with database in BaseKotlinJpsBuildTestCase 2020-02-28 11:36:34 +03:00
Nikolay Krasko
31ba40cc99 Ignore auto-mute files 2020-02-28 11:36:34 +03:00
Nikolay Krasko
c22272bbca Enable mute for KotlinCompletionTestCase 2020-02-28 11:36:34 +03:00
Nikolay Krasko
66e2f95dba Update method after UsefulTestCase update to make in work in 201 2020-02-28 11:36:33 +03:00
Nikolay Krasko
3c3b1bb5e4 Support auto-mute in parametrized JUnit 4 tests 2020-02-28 11:36:33 +03:00
Nikolay Krasko
f042b04320 Minor: remove unneeded class 2020-02-28 11:36:32 +03:00
Mikhail Zarechenskiy
14f7529c1b [NI] Reanalyze coroutine-block if there is inapplicable call
It's not clear how one should rollback _all_ resolution results if
 there is inapplicable call. Ideally, such calls should not be available
 in coroutine block but for now, to have backward compatibility, we'll
 just reanalyze coroutine block as a usual lambda if there is at least
 one such call.

 As a result, also remove diagnostic about non-applicable call as it
 become useless with current reanalysis

 #KT-37061 Fixed
 #KT-32097 Fixed
 #KT-32203 Fixed
 #KT-35306 Fixed
 #KT-36202 Fixed
 #KT-36220 Fixed
 #KT-32654 Fixed
2020-02-28 10:25:22 +03:00
Vladimir Dolzhenko
aab8555d65 Move adjustExtractionData.performAnalysis under modal progress
Relates to #143709
2020-02-28 08:02:45 +01:00
Vladimir Dolzhenko
ec431460b3 Do not lookup for kotlin tests in non kotlin files
Fixed #EA-220086
2020-02-28 08:02:45 +01:00
Vladimir Dolzhenko
2a27ca828c Commit document before actual imports optimization
Fixed #EA-209827
2020-02-28 08:02:44 +01:00
Vladimir Dolzhenko
acc4118903 Provide import alias suggestion for Companion
Fixed #EA-223797
2020-02-28 08:02:44 +01:00
Vladimir Dolzhenko
3ec2095c9f Don't log ControlFlowException
Fixed #EA-223788
2020-02-28 08:02:44 +01:00
Steven Schäfer
3881220386 JVM IR: Box arguments in abstract method stubs for "remove" bridges 2020-02-28 09:20:29 +03:00
kovalp
86f9cb6eef Adds AdditionalExtractableAnalyser EP.
Adds annotations to ExtractableCodeDescriptor.
Adds functionality of adding annotations to KtPsiFactory.CallableBuilder
2020-02-28 12:38:09 +07:00
Ilya Gorbunov
b53cb5cb4c Cover with a test current Double/Float companion values access 2020-02-28 01:26:56 +03:00
Vladimir Dolzhenko
1f47c6d54f Add missed calcHashCode for ModuleSourceScope subclasses 2020-02-27 21:17:25 +01:00
pyos
035cc57cf4 JVM_IR: don't remap current method signature when detecting clashes
TODO: don't repeatedly map signatures of inherited functions either.
2020-02-27 22:17:19 +03:00
Dmitry Petrov
ad0070ed8a KT-37059 Support 'String?.plus(Any?)' in JVM_IR 2020-02-27 22:13:32 +03:00
simon.ogorodnik
f9483b1f4f [FIR] KT-37027: Add 'out' projection to vararg elements 2020-02-27 19:07:17 +03:00
simon.ogorodnik
f405b3f827 [FIR] Reorganize ConeKotlinTypeProjection hierarchy 2020-02-27 19:07:16 +03:00
simon.ogorodnik
7c4f59dfcb [FIR] KT-37009: Fix loss of bound smart-cast due to synthetic removal 2020-02-27 19:07:16 +03:00
simon.ogorodnik
ec936b7286 [FIR] Setup FIR tests configuration 2020-02-27 19:07:16 +03:00
Denis Zharkov
fbf4abf0cf FIR: Unignore FIR2IR test 2020-02-27 19:01:32 +03:00
Denis Zharkov
53454a783c Fix project compilation 2020-02-27 18:54:26 +03:00
Denis Zharkov
8fca343ef0 FIR: Support FirComparisonOperator in Fir2Ir
^KT-31163 Fixed
2020-02-27 18:21:34 +03:00
Denis Zharkov
434444cd69 FIR: Support FirComparisonOperator in body transformers and DFA
^KT-31163 In Progress
2020-02-27 18:21:34 +03:00
Denis Zharkov
c3aed433ae FIR: Support FirComparisonOperator in builders
^KT-31163 In Progress
2020-02-27 18:21:34 +03:00
Denis Zharkov
80b7fbd07a FIR: Add new nodes kind for comparison operator
^KT-31163 In Progress
2020-02-27 18:21:34 +03:00
Svyatoslav Kuzmich
3ecee5c7cd [JS IR BE] Implement kotlin.js.jsTypeOf as intrinsics 2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich
dff7d7b7b9 [PSI2IR] Patch parents before referenceExpectsForUsedActuals
There were some ADAPTER_FOR_CALLABLE_REFERENCE functions with
uninitialized parents at this point.
2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich
1e02fa3db9 [JS IR BE] Create temporary variables with wrapped descriptors. 2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich
8877bac873 [JS IR BE] Don't fail typeOf lowering on reified type parameters. 2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich
b359bf1859 [JS IR BE] Stop checking mangling for klib-to-js compilation.
It it broken.
2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich
cd80eced32 [JS IR BE] Use fresh name for external JsModule declarations. 2020-02-27 16:54:55 +03:00
nataliya.valtman
5c6f452c10 Revert "add cleanup dependencies tasks for buildSrc"
This reverts commit 8a8536f8
2020-02-27 15:23:47 +03:00
Anton Bannykh
e7816b4ec2 JS: support callable references with vararg and default parameters conversion 2020-02-27 15:12:49 +03:00
Dmitriy Novozhilov
f6a23ea441 [FIR] Add infrastructure for call checkers 2020-02-27 15:11:10 +03:00
Dmitriy Novozhilov
9cee2962db [FIR] Add more nodes for declaration checkers 2020-02-27 15:11:09 +03:00
Nikita Skvortsov
04424a1ec3 Reduce UI freezes by preparing affected Gradle project files lists in advance, once per event. isRelevant() method is a hotspot, as it is called for each file in bulk VFS event 2020-02-27 15:01:34 +03:00
Mikhael Bogdanov
a9e03937a3 Minor. Update tests to support them on Android 2020-02-27 12:28:19 +01:00
nataliya.valtman
8a8536f8ae add cleanup dependencies tasks for buildSrc
change embedded kotlin version to bootstrap for buildSrc
2020-02-27 13:55:58 +03:00
Dmitry Petrov
ea7b5827ab Minor: update testData for bytecode listing tests 2020-02-27 13:36:24 +03:00
Dmitry Gridin
5827be4182 Tests: fix test for AS 3.6 2020-02-27 15:39:27 +07:00
Dmitriy Dolovov
ca3c72c143 IDE perf tests for Kotlin/Native projects
Issue #MMPP-201
2020-02-27 15:23:41 +07:00
Vladimir Ilmov
f5e6001d82 Registry key to show hidden variables in debugger. 2020-02-27 08:59:08 +01:00
Abduqodiri Qurbonzoda
e19c0c9768 Update idea-completion testData after introducing vararg maxOf/minOf 2020-02-27 02:24:49 +03:00
Valentin Kipyatkov
12bf8a44e7 Minor changes after code review 2020-02-26 22:57:35 +01:00
Valentin Kipyatkov
b9a9000569 Suggested Rename and Change Signature implementation for Kotlin 2020-02-26 22:57:34 +01:00
Vyacheslav Karpukhin
a01b840eab Android Import: Search for Android SDK using public API instead of reflection 2020-02-26 19:03:48 +01:00
Dmitriy Dolovov
ec23c25286 [Commonizer] Friendly displaying commonized KLIBs in IDE
Issue #MMPP-195
2020-02-27 00:35:03 +07:00
Anton Bannykh
23e218396e JS: support SAM conversion
The SAM adapter is generate on declaration site. This is different
from the JVM approach.

`external fun interface` is banned for now.

Reusing interface declaration for the adapter is a hack which
reduces code size and makes importing/exporting the adapter
effortless.
2020-02-26 18:57:11 +03:00
Anton Bannykh
2742e643c1 JS: prohibit external fun interface 2020-02-26 18:57:11 +03:00
Anton Bannykh
f20ed39b92 Fix a typo in an error message 2020-02-26 18:57:11 +03:00
Anton Bannykh
a01e66a618 Run IrJsTypeScriptExportTestGenerated tests with jsIrTest instead of jsTest 2020-02-26 18:57:11 +03:00
Kristoffer Andersen
c1d350f8f3 [JVM IR] Added null-checks of handler for non-super $default calls 2020-02-26 16:28:27 +01:00
Abduqodiri Qurbonzoda
fe50bb4b93 KProperty and ReadOnlyProperty type parameter names #KT-16529 2020-02-26 17:34:03 +03:00
Mikhail Zarechenskiy
5ed28b38be [NI] Fix coroutine inference for qualified chained call with stub type 2020-02-26 17:16:15 +03:00
Dmitry Petrov
a47c818a3c Minor: update testData in box tests with signature check 2020-02-26 16:02:04 +03:00
Ilmir Usmanov
af5a381c2b Minor. Use java 6 construct in test
So, the test can be run on android.
2020-02-26 13:23:12 +01:00
Roman Artemev
bb43a66716 [Metadata] Add platform dependent type transformer
- Fix forward declaration type construction
2020-02-26 14:55:54 +03:00
Roman Artemev
25a91a217e [KLIB] Fix package for NullFlexibleTypeDeserializer 2020-02-26 14:55:53 +03:00
Anton Bannykh
b744ee0aa4 JS IR: Remove nested blocks from bodies 2020-02-26 14:51:18 +03:00
Anton Bannykh
7152156659 JS IR: Don't yield methods with no body 2020-02-26 14:51:18 +03:00
Sergey Bogolepov
71cc288a14 [Linker][IdSignature] Rename classFqn property
classFqn is incorrect since this property represents
FqName of any declaration, including properties, functions and
type aliases.
2020-02-26 17:48:38 +07:00
Sergey Bogolepov
221d24c597 [Linker] Do not generate wrapped descriptor if descriptor is provided
Fixes metadata-based interop in Kotlin/Native.
2020-02-26 17:48:38 +07:00
Mikhail Zarechenskiy
6eec8c28ad Add JvmDefault to recently added method for compiler extensions
This should fix AbstractMethodError when newer compiler is used with
 Compose plugin that haven't implemented recently added method

 #KT-37042 Fixed
2020-02-26 13:16:05 +03:00
Stanislav Erokhin
74348d5ffb Fix compile configuration for maven compiler plugins
Previously in kotlin-maven-noarg & kotlin-maven-serialization plugins
java was compiled before kotlin, and because of that links from java
to kotlin was unresolved.
It was fixed as prescribed by docs: https://kotlinlang.org/docs/reference/using-maven.html#compiling-kotlin-and-java-sources
2020-02-26 12:12:35 +03:00
Stanislav Erokhin
453008e488 Deprecated reportFromPlugin way to report diagnostics from plugin
Originally reportFromPlugin method was introduced to address the problem
with loading of DefaultErrorMessages.Extension vis ServiceLoader.
For some cases this extension was not loaded by ServiceLoader because
classes was loaded via different class loader, common scenario here is
compiler plugins. Ideally we should load such extension point via
getService approach, but unfortunately to do that we need project and
DefaultErrorMessages.render is static method for now.
Also with reportFromPlugin approach is a problem -- all diagnostics
reported via this method has the same id: PLUGIN_[WARNING|ERROR|INFO]
and it isn't possible to suppress only one particular diagnostic.
To bypass this problem the new method
initializeFactoryNamesAndDefaultErrorMessages was introduced.
It basically store DiagnosticRenderer inside DiagnosticFactory.
It is not ideal, because one DiagnosticFactory could have different
renderers for different scenarios -- for compiler and for IDE, but
I think that it is better than reportByPlugin approach.
2020-02-26 12:12:31 +03:00
Dmitry Petrov
84baa0b4c2 Check more flags in bytecode listing tests 2020-02-26 12:03:37 +03:00
Ilya Goncharov
ee9be61c20 [Gradle, JS] Fix propogation useCommonJs to irTarget
#KT-37036 fixed
2020-02-26 11:40:45 +03:00
Ilya Goncharov
7719dfca4a [Gradle, JS] Fix timeout for debug
#KT-37035 fixed
2020-02-26 11:36:17 +03:00
Ilya Kirillov
870b7d234f Wizard: refactoring do not use context directly in UI 2020-02-26 11:19:09 +03:00
Ilya Kirillov
ad39d0520a Wizard: use first enum entry as default value for enumSetting 2020-02-26 11:19:08 +03:00
Ilya Kirillov
3967522c08 Wizard: fix Android minifyEnabled call for groovy 2020-02-26 11:19:08 +03:00
Ilya Kirillov
7e22572324 Wizard: add configuration for Android MPP target 2020-02-26 11:19:08 +03:00
Ilya Kirillov
3eca687611 Wizard: move module configurator settings to companion objects 2020-02-26 11:19:08 +03:00
Ilya Kirillov
4c62f64396 Wizard: minor, not to use reading context directly in some places 2020-02-26 11:19:08 +03:00
Ilya Kirillov
8259bf749d Wizard: always use all plugin set in tests 2020-02-26 11:19:08 +03:00
Ilya Kirillov
7a3d730aec Wizard: refactoring: rename contexts
TaskRunningContext -> WriteContext,
ValuesReadingContext -> ReadingContext
2020-02-26 11:19:08 +03:00
Ilya Kirillov
1c49b230f4 Wizard: force service to always return non-null value 2020-02-26 11:19:07 +03:00
Ilya Kirillov
05022109fc Wizard: save some setting values in UI
#KT-35585 fixed
2020-02-26 11:19:07 +03:00
Ilya Kirillov
9e47d0b33c Wizard: move Android SDK Setting to AndroidPlugin 2020-02-26 11:19:07 +03:00
Ilya Kirillov
9c5ff6c131 Wizard: create Gradle wrapper 2020-02-26 11:19:07 +03:00
Ilya Kirillov
6228fa4d3e Wizard: remove unused function 2020-02-26 11:19:07 +03:00
Ilya Kirillov
7448b8beb0 Wizard: fix invalid android package name
#KT-36169 fixed
2020-02-26 11:19:07 +03:00
Ilya Kirillov
2600ebb961 Wizard: use custom module icons for every module kind 2020-02-26 11:19:06 +03:00
Ilya Kirillov
299b0f0102 Wizard: prettify error messages 2020-02-26 11:19:06 +03:00
Ilya Kirillov
72f92d7a3b Wizard: use IntelliJ validator in UI instead of custom one 2020-02-26 11:19:06 +03:00
Ilya Kirillov
1431649c4d Wizard: use Kotlin Gradle Icon for Gradle Kotlin build system 2020-02-26 11:19:06 +03:00
Ilya Kirillov
e1b99580eb Wizard: introduce Android & JS multiplatform project kinds
#KT-36155 fixed
2020-02-26 11:19:06 +03:00
Ilya Kirillov
a5a72a89fc Wizard: allow to create multiple JVM targets
#KT-36177 fixed
2020-02-26 11:19:06 +03:00
Ilya Kirillov
bb455ec8f6 Wizard: make error messages in ui clickable
#KT-36162 fixed
2020-02-26 11:19:06 +03:00
Ilya Kirillov
087de68b3a Wizard: flatten JVM targets
#KT-36267 fixed
2020-02-26 11:19:06 +03:00
Ilya Kirillov
54c9582ac4 Wizard: fix wrong line separators
#KT-36328 fixed
2020-02-26 11:19:05 +03:00
Ilya Kirillov
fa4d790f5a Wizard: add jvm target setting for JVM configurations
#KT-36180 fixed
2020-02-26 11:19:05 +03:00
Ilya Kirillov
fabb0584da Wizard: remove module types for some module configurators
#KT-36176 fixed
2020-02-26 11:19:05 +03:00
Ilya Kirillov
0123dbce21 Wizard: trim paths in UI
#KT-36163 fixed
2020-02-26 11:19:05 +03:00
Ilya Kirillov
152def62cb Wizard: get current Kotlin version from compiler
#KT-35693 fixed
2020-02-26 11:19:05 +03:00
Dmitry Gridin
50c2c38624 Tests: fix some tests in formatter for AS 2020-02-26 13:51:47 +07:00
Dmitry Gridin
ca598b6465 Formatter: fix indent after trailing comma in calls
#KT-36917 Fixed
2020-02-26 10:55:58 +07:00
Abduqodiri Qurbonzoda
1f721796b8 Add vararg overloads for maxOf/minOf functions #KT-33906 2020-02-26 04:17:19 +03:00
Vyacheslav Gerasimov
5aae3b5d27 Build: Add localBuildCacheDirectory property to KotlinBuildProperties 2020-02-25 19:37:33 +03:00
Vyacheslav Gerasimov
fc2161c2a6 Build: Don't cache :kotlin-compiler:proguard
Requires to mark inputs of proguard task properly
2020-02-25 19:17:02 +03:00
Dmitry Savvinov
428dcd847f Flip default value of kotlin.gradle.testing.enabled to true 2020-02-25 17:18:49 +03:00
nataliya.valtman
d82dc86c71 Reverts commit 13afb2e4 (buildSrc bootstrap version) 2020-02-25 17:08:51 +03:00
Sergey Rostov
5e16373af6 .gradle.kts, changes notifier: process events async and on pooled thread
#KT-36401 Fixed
2020-02-25 16:00:20 +03:00
Mikhail Zarechenskiy
5393074d61 [NI] Update type of complex subcall for last lambda expressions 2020-02-25 15:26:25 +03:00
Dmitry Savvinov
66ef49cecc Fix CCE under composite mode
This commit essentially reverts change in IdeaResolverForProject made in
423aeb9a08

The issue is that 'platform.findAnalyzerServices' may return non-
CompositeAnalyzerServices even under composite analysis mode, when
platform is single-target (e.g. 'JvmAnalyzerServices' for JVM-only)

^KT-36978
2020-02-25 15:09:49 +03:00
Ilya Kirillov
b21a9476c0 New J2K: minor, use firstNotNullResult in j2k reference resolver 2020-02-25 13:58:29 +03:00
Ilya Kirillov
b7711678c2 EA-218474: fix IAE in resolving empty fqName in new J2K 2020-02-25 13:58:29 +03:00
Ilya Kirillov
af5a70dcf5 EA-218043: fix getting resolution facade for empty list of elements in new J2K 2020-02-25 13:58:29 +03:00
Ilya Kirillov
a64526acfb EA-210533: fix NPE in LiftReturnOrAssignmentInspection
It may be still active after its application due to slow IDEA responsiveness
Do not try to apply it again on invalid PSI elements
2020-02-25 13:58:29 +03:00
Ilya Kirillov
9af30f4ac7 EA-210362: fix invalid cast to KtFile in KtCodeFragment 2020-02-25 13:58:28 +03:00
Ilya Kirillov
7f50dcb3a8 EA-210234: Fix invalid access to Java resolution facade
Do not try to get Java resolution facade for non-Java PSI elements
2020-02-25 13:58:28 +03:00
Ilya Kirillov
af6d5b76f5 EA-209576: Fix access to disposed module in gradle importer 2020-02-25 13:58:28 +03:00
Steven Schäfer
2b6a0d6c58 JVM IR: Don't create $annotations stubs for fake overridden properties 2020-02-25 11:31:01 +01:00
Alexander Gorshenev
3eed0609b2 Brought back mppKlibs guard lost in rebase 2020-02-25 13:26:11 +03:00
Dmitry Gridin
36ebbc49f4 KotlinExpressionMover: trailing comma support
#KT-34744
2020-02-25 17:13:43 +07:00
Dmitry Gridin
72c8b38864 KotlinExpressionMover: convert to Kotlin 2020-02-25 17:10:58 +07:00
Dmitry Gridin
bca9242492 KotlinExpressionMover: rename .java to .kt 2020-02-25 17:03:28 +07:00
Dmitry Gridin
56064f2a92 JoinLines: add tests 2020-02-25 17:03:28 +07:00
Dmitry Gridin
feaa53c4f2 Formatter: shouldn't format property chains
#KT-36387 Fixed
#KT-36466 Fixed
2020-02-25 16:48:33 +07:00
Mikhail Glukhikh
522eeae062 FIR2IR: standardize expression with smart cast conversion
To convert smart cast expression, now we just convert
original expression in standard way and wrap it with TYPE_OP.
Before this commit original expression was converted in different way,
that led to errors e.g. for this expression casting.
2020-02-25 12:13:42 +03:00
Mikhail Glukhikh
d1fac6dce1 FIR2IR: declare receivers for all accessors of extension properties
Before this commit, extension receivers were declared only for
properties with container source, which is strange & inconsistent.
Now we declare accessor extension receiver iff corresponding property
has extension receiver.
2020-02-25 12:13:42 +03:00
Mikhail Glukhikh
8c155578f7 FIR2IR: generate both dispatch & extension receiver without 'else if' 2020-02-25 12:13:42 +03:00
Juan Chen
4f6fe1d0ca [FIR]: fix translation of top-level property accesses like array.indices
This commit addresses the following issues:

* accessors didn't take into account their property's receiver type,
which caused NoSuchMethod due to signature mismatch. Now the property's
receiver type is passed to Fir2Ir translation of accessors.

* property's parent was not class, e.g., kotlin.collections.indices.
Now the symbol table collects WrappedPropertyDescriptorWithContainerSource
besides WrappedFunctionDescriptorWithContainerSource, so that
facade classes for such properties can be generated before codegen.

* accessor's parent was not class. Now the containerSource of
the property descriptor is passed to accessor descriptor.
2020-02-25 12:13:42 +03:00
Vladimir Dolzhenko
c9658eb6e4 Adjust tests due to keep imports for extension functions used in kdoc
Relates to #KT-27601
2020-02-25 09:29:39 +01:00
Vladimir Dolzhenko
afd71d3d19 Adjust tests due to "Remove argument" quick fix for TOO_MANY_ARGUMENTS
Relates to #KT-34026
Relates to #KT-34332
2020-02-25 09:23:46 +01:00
Dmitry Petrov
b047d78580 Minor: update testData for IR bytecode text and unmute test 2020-02-25 11:17:08 +03:00
Mikhail Zarechenskiy
0b9fc1541d [NI] Don't try inferring variables for effectively empty system 2020-02-25 10:45:59 +03:00
Kristoffer Andersen
fe71d5256c [Minor] Refactor IR Suspend Main code to not use intrinsic 2020-02-24 19:33:43 +01:00
pyos
a3d85e108f JVM_IR: keep suspend fun return type in IrCalls
Otherwise:

  * should the dispatch receiver of a call be another call to a `suspend
    fun` wrapped in something that is optimized away later, the owner of
    the method will be incorrect;

  * references to functions returning non-Unit but casted to `() ->
    Unit` (allowed by new inference) might in fact not return Unit after
    tail call optimization.
2020-02-24 17:12:43 +01:00
Mads Ager
d982203d56 [JVM_IR] Handle big arity suspend functions in existing lowering.
Now that suspend function views are created in
AddContinuationLowering, we can let the
FunctionNVarargBridgeLowering deal with rewriting of large
arity FunctionN/SuspendFunctionN.
2020-02-24 13:01:18 +01:00
Toshiaki Kameyama
e406669190 Invert if condition intention: don't add unnecessary 'continue'
#KT-12329 Fixed
2020-02-24 11:17:20 +01:00
Toshiaki Kameyama
62e335ac88 Implement members: fix it works correctly for data class
#KT-36686 Fixed
2020-02-23 22:00:38 +01:00
Georgy Bronnikov
fe009ac695 IR: restore reading common Klib from JVM
Adapt to changes in linker
2020-02-23 14:55:29 +03:00
Toshiaki Kameyama
d54a35ef56 Add "Remove argument" quick fix for TOO_MANY_ARGUMENTS
#KT-34026 Fixed
#KT-34332 Fixed
2020-02-23 10:17:10 +01:00
nataliya.valtman
13afb2e45e Make kotlin build version for buildSrc the same as for kotlin project 2020-02-23 09:02:22 +03:00
Toshiaki Kameyama
699ea0aa2b Replace 'if' with 'when': don't swallow comments if there is no synthetic else branch
#KT-34640 Fixed
2020-02-22 16:50:37 +01:00
Toshiaki Kameyama
f487118be5 Change signature: fix it works correctly when call site function has no value argument list
#KT-23510 Fixed
2020-02-22 09:07:34 +01:00
kvirolainen
223ed1ad60 KT-27601 review fixes 2020-02-22 08:55:50 +01:00
kvirolainen
90cfa80683 KT-27601 keep imports for extension functions used in kdoc 2020-02-22 08:55:50 +01:00
Dmitry Savvinov
423aeb9a08 Always check project.useCompositeAnalysis in findAnalyzerServices
The important things here are changes in
ResovlerElementCache/PerFileAnalysisCache. Previously, we'd always use
'CompositeAnalyzerServices' for common-platform, even with HMPP turned
off.

However, with HMPP turned off, common-platform is always coerced to
[JVM, JS, Native], no matter which platforms that project actually
targets.
So, even if project compiles only for JVM/Native, we'll detect
platform of common module as [JVM, JS, Native], build composite analyzer
services *which include all checkers from all platforms*, and then
report false-positive errors from JS checkers.

^KT-35031 Fixed
^KT-33573 Fixed
^KT-34925 Fixed
2020-02-21 20:00:21 +03:00
Toshiaki Kameyama
e56abcbb85 Inline variable: fix it works correctly for 'when' subject variable
#KT-29870 Fixed
2020-02-21 17:30:13 +01:00
Toshiaki Kameyama
d8ab046136 Convert property to function: remove annotation use-site target
#KT-36834 Fixed
2020-02-21 17:03:26 +01:00
Toshiaki Kameyama
d5e71ebef1 Invert if condition intention: 'isEmpty' <-> 'isNotEmpty'
#KT-34593 Fixed
2020-02-21 16:39:35 +01:00
Toshiaki Kameyama
79c15e49b6 Convert function to property: suggest on fun keyword
#KT-34450 Fixed
2020-02-21 16:32:17 +01:00
Toshiaki Kameyama
820b8c3c54 Introduce "Redundant '?: return null'" inspection
#KT-34819 Fixed
2020-02-21 16:24:42 +01:00
Toshiaki Kameyama
5f1cc3b152 Introduce "Redundant 'inner' modifier" inspection
#KT-3262 Fixed
2020-02-21 16:12:49 +01:00
Dmitriy Dolovov
d76dc6f57e [Commonizer] Call commonizer on Gradle configuration phase
Issue #KT-36858

Initially it was called on execution step which may be omit
during project import into IDEA.
2020-02-21 21:54:15 +07:00
Mikhail Zarechenskiy
f2f95496e3 [NI] Complete contradictory candidates inside builder-inference
In this test `kotlin` was resolved to the extension
 `val Class<T>.kotlin` because it was saved in builder-inference.
 Usually, it's fine, but not for qualified expressions as they have
 fallback resolve in case of error
2020-02-21 17:39:50 +03:00
Toshiaki Kameyama
3398683093 Unused symbol: do not report for secondary constructor when class is used as typealias
#KT-20907 Fixed
2020-02-21 15:11:38 +01:00
Mikhail Glukhikh
81f1f441fc [FIR] Add stub default values to kotlin.Enum constructor parameters 2020-02-21 16:39:00 +03:00
Mikhail Glukhikh
39bd97147f [FIR] Don't create initializers for simple enum entries
Usually FIR enum entry is initialized by anonymous object,
which is the container for all enum entry' declarations.
However, for simple enum entries there is no need of initializer at all.
2020-02-21 16:38:52 +03:00
Mikhail Glukhikh
b1e9dbf994 [FIR] Use super<Enum> as delegated calls in enum constructors 2020-02-21 16:37:56 +03:00
Mikhail Glukhikh
f173af9238 FIR2IR: use enum constructor call for enum entries 2020-02-21 16:37:50 +03:00
Mikhail Glukhikh
9e3f17c52a [FIR TEST] Add test for unresolved reference in default argument
See KT-36905
2020-02-21 16:37:10 +03:00
Toshiaki Kameyama
a3252b9480 Unused symbol: fix false positive in anonymous object in top level or companion object
#KT-31800 Fixed
#KT-20868 Fixed
2020-02-21 14:36:18 +01:00
Toshiaki Kameyama
ef1e54eda9 ReplaceToStringWithStringTemplateInspection: insert curly braces if needed
#KT-36735 Fixed
2020-02-21 14:28:07 +01:00
Toshiaki Kameyama
c87bc2123c Add "Change to val" quick fix for MUST_BE_INITIALIZED
#KT-15723 Fixed
2020-02-21 14:09:54 +01:00
Nikolay Krasko
a46c6ce5df Revert global project settings to LATEST_STABLE in teardown 2020-02-21 16:07:24 +03:00
Nikolay Krasko
f995192f21 Always configure and restore api version settings in tests 2020-02-21 16:07:24 +03:00
Nikolay Krasko
6c83e9fb85 Clean LANGUAGE_VERSION_SETTINGS after the test 2020-02-21 16:07:24 +03:00
Nikolay Krasko
19bc39d3ab Clean facet if it wasn't set before test (fix tests on 201) 2020-02-21 16:07:23 +03:00
Nikolay Krasko
af3b057ba2 Always clean language and api versions after usage 2020-02-21 16:07:23 +03:00
Nikolay Krasko
c0dac9bf32 Refactoring: extract long function out of local context 2020-02-21 16:07:23 +03:00
Nikolay Krasko
3a5f42cc5e Refactoring: always use compiler settings with de-configuration in tests 2020-02-21 16:07:23 +03:00
Nikolay Krasko
018215f47d De-bunch KotlinLightCodeInsightFixtureTestCase.kt 2020-02-21 16:07:23 +03:00
Pavel Punegov
94be4d77ff Fix init order in inline fun (native test) 2020-02-21 16:04:53 +03:00
Toshiaki Kameyama
19093e2e02 Redundant companion reference: fix false positive when companion has same name member as companion name
#KT-36707 Fixed
2020-02-21 13:57:04 +01:00
Vasily Levchenko
98ce49ba73 [build][native] version with milestone clause 2020-02-21 13:51:20 +01:00
Vladimir Dolzhenko
7053f1d00c Drop CancellationCheck usage from 193
Relates to #KT-36891
2020-02-21 13:40:48 +01:00
Toshiaki Kameyama
5a6cf19c68 Complete statement for class declaration: add '()' to supertype
#KT-31668 Fixed
2020-02-21 13:21:26 +01:00
Dmitry Petrov
e9a7be4a46 Fix intersection type handling in PSI2IR 2020-02-21 15:11:16 +03:00
Mikhail Zarechenskiy
1624327ba4 [NI] Fix substitution in builder-inference for empty common system 2020-02-21 14:24:57 +03:00
pyos
c5ffbfd33c JVM_IR: mark origins of capture fields in suspend lambdas 2020-02-21 12:11:19 +01:00
pyos
6b98ea2378 JVM_IR: do not place suspend markers around crossinline lambda calls 2020-02-21 12:11:19 +01:00
pyos
39ebc8cfa5 Add a suspend test that fails on JVM_IR 2020-02-21 12:11:19 +01:00
Ilmir Usmanov
52e7cd5725 JVM_IR: Remove $$forInline suffix for fake inliner variables
Otherwise, IDE will not be able to navigate to inline functions.
 #KT-36797 Fixed
2020-02-21 12:08:25 +01:00
Ilmir Usmanov
325ad14ac9 JVM_IR: Treat suspend main wrapper as always tail-call function
In other words, never generate suspend call markers inside it.
2020-02-21 12:00:54 +01:00
Ilmir Usmanov
8c4eef9844 JVM_IR: Return COROUTINE_SUSPENDED from suspend main wrapper
Before, if the code inside suspend main suspended, the wrapper would
just ignore it and return Unit. This was a signal for runSuspend to exit
main loop and return said Unit.
Instead of poping whatever suspend main returns, just return it.
2020-02-21 12:00:52 +01:00
Kristoffer Andersen
5b62c9e54d [WIP] Add Compiler Smoke Tests for (suspend) main methods
This commit ports the (parameterless) main integration tests in
`CompilerSmokeTest` to the IR backend. It also includes a simple
suspend main test.

The advanced ones (like `helloAppSuspendParameterlessMain`) are
currently blocked by pending changes to capturing suspend lambdas,
which are underway.
2020-02-21 12:00:50 +01:00
Kristoffer Andersen
55aafb3430 [JVM IR] Support Suspend Main
This adds supports for (parameterless) suspend main entry points for
the JVM IR backend.

In case main is a suspend function, it gains a continuation during
lowering, so we simply generate a plain old `public static void
main(String[] args)`. This entry point invokes `suspend main` via
`kotlin.coroutines.jvm.internal.RunSuspendKt#runSuspend`.

This PR introduces `runSuspend` as a built-in, and generates the
following `main`, passing `args` as appropriate:

```
fun main(args: Array<String>) {
  runSuspend { main(args) }
}
```

The phase ordering has been reshuffled countrary to previous
discussion on #2780, as the MainMethodGeneration pass now introduces lambdas in
the IR. Hence, it has to run before InventNamesForLocalClasses, yet
still after JvmOverloadsAnnotations.

Some dead code was discovered in AddContinuationLowering
2020-02-21 12:00:47 +01:00
Ilya Goncharov
068d547375 [Gradle, JS] UpperCased KotlinJsCompilerType 2020-02-21 13:14:36 +03:00
Ilya Goncharov
9acd98071e [Gradle, JS] Divide KotlinJsCompilerAttribute 2020-02-21 13:14:36 +03:00
Ilya Goncharov
cc97138e9c [Gradle, JS] Extract JS presets container, no js in codegen since now 2020-02-21 13:14:36 +03:00
Ilya Goncharov
fa335b5360 [Gradle, JS] Js default compiler type for mpp 2020-02-21 13:14:36 +03:00
Ilya Goncharov
8dc75def19 [Gradle, JS] Use default configuration names only once in constants 2020-02-21 13:14:36 +03:00
Ilya Goncharov
664775a43f [Gradle, JS] Configure compiler type with single platform plugin 2020-02-21 13:14:35 +03:00
Ilya Goncharov
e631146fa7 [Gradle, JS] Fix DSL for Gradle JS wizard 2020-02-21 13:03:21 +03:00
Ilya Goncharov
3ae6b27556 [Gradle, JS] Fix DSL for JVM/JS wizard
#KT-36889 fixed
2020-02-21 13:03:18 +03:00
Abduqodiri Qurbonzoda
6670a2fff8 Update public api dump 2020-02-20 21:14:52 +03:00
Ilya Goncharov
569decce43 [Gradle, JS] Fix missed import 2020-02-20 19:32:35 +03:00
Ilya Goncharov
d114945b76 [Gradle, JS] Change message in polite manner
#KT-36489 fixed
#KT-36843 fixed
2020-02-20 19:32:35 +03:00
Ilya Goncharov
e0be8f271f [Gradle, JS] Not error, but warning with test fix 2020-02-20 19:32:35 +03:00
Ilya Goncharov
40fb6c67d2 [Gradle, JS] Add diagnostic messages for js targets 2020-02-20 19:32:34 +03:00
Ilya Goncharov
aefaa6dc7f [Gradle, JS] Remove deprecated configurations 2020-02-20 19:32:34 +03:00
Ilya Goncharov
92291c03e8 [Gradle, JS] Add methods with string definition of compiler 2020-02-20 19:32:34 +03:00
Ilya Goncharov
203ca018e5 [Gradle, JS] Rename public KotlinJsCompilerType 2020-02-20 19:32:34 +03:00
Ilya Goncharov
488538889b [Gradle, JS] Extract JS presets container, no js in codegen since now 2020-02-20 19:32:34 +03:00
Ilya Goncharov
956b57a55d [Gradle, JS] Do not duplicate target initialization 2020-02-20 19:32:34 +03:00
Ilya Goncharov
881de0a538 [Gradle, JS] Make default configuration of target 2020-02-20 19:32:34 +03:00
Ilya Goncharov
9112da2ad7 [Gradle, JS] Create predefined source sets for single platform plugin 2020-02-20 19:32:34 +03:00
Ilya Goncharov
06be32550b [Gradle, JS] Fix lib and app test for both type 2020-02-20 19:32:34 +03:00
Ilya Goncharov
a5602165ec [Gradle, JS] Fix names for js mpp 2020-02-20 19:32:33 +03:00
Ilya Goncharov
e1f7296426 [Gradle, JS] Fast test with both js compilers 2020-02-20 19:32:33 +03:00
Ilya Goncharov
37b3b3ec56 [Gradle, JS] Js default compiler type for mpp 2020-02-20 19:32:33 +03:00
Ilya Goncharov
3d30598774 [Gradle, JS] Js compiler type in interface 2020-02-20 19:32:33 +03:00
Ilya Goncharov
36631a5954 [Gradle, JS] Fix parallel tests 2020-02-20 19:32:33 +03:00
Ilya Goncharov
86e13c25b3 [Gradle, JS] Default conpiler type instead of legacy 2020-02-20 19:32:33 +03:00
Ilya Goncharov
ae89507736 [Gradle, JS] Add fish for js only lib-app test 2020-02-20 19:32:33 +03:00
Ilya Goncharov
16eb23c6b1 [Gradle, JS] Remove test with lib and app with not only legace
Because of performance reasons

- Fix usage of compiler type property
2020-02-20 19:32:33 +03:00
Ilya Goncharov
13594c80aa [Gradle, JS] Declare default configurations in js single plugin
Because in Kotlin DSL we want to declare configurations in methods instead of extensions of Strings
We need to create configurations explicitly in plugin
2020-02-20 19:32:33 +03:00
Ilya Goncharov
f3f818edc3 [Gradle, JS] Use default configuration names only once in constants 2020-02-20 19:32:32 +03:00
Ilya Goncharov
d9c08945a3 [Gradle, JS] Common dependency configurations for both js 2020-02-20 19:32:32 +03:00
Ilya Goncharov
ecb89ad259 [Gradle, JS] Disambiguation classifier consider single platform plugin 2020-02-20 19:32:32 +03:00
Ilya Goncharov
4189bc88c2 [Gradle, JS] Provide disambiguation classifier for both mode 2020-02-20 19:32:32 +03:00
Ilya Goncharov
b967e11511 [Gradle, JS] Configure compiler type with single platform plugin 2020-02-20 19:32:32 +03:00
Ilya Goncharov
22e826770d [Gradle, JS] Functions in extensions for configure compiler type 2020-02-20 19:32:32 +03:00
Ilya Goncharov
1346883837 [Gradle, JS] Fix published name for both compiler 2020-02-20 19:32:32 +03:00
Ilya Goncharov
185f7419d5 [Gradle, JS] Refactor with remove copypaste 2020-02-20 19:32:32 +03:00
Ilya Goncharov
397ff26e20 [Gradle, JS] With both compilers fully disambiguated names 2020-02-20 19:32:32 +03:00
Ilya Goncharov
ae391f3776 [Gradle, JS] Fix codegen for js platform 2020-02-20 19:32:31 +03:00
Ilya Goncharov
1bebcd398e [Gradle, JS] Move JsCompilerType to Gradle Plugin API 2020-02-20 19:32:31 +03:00
Ilya Goncharov
82d31adb24 [Gradle, JS] Remove js compiler property from MPP plugin 2020-02-20 19:32:31 +03:00
Ilya Goncharov
4af389ba92 [Gradle, JS] Rename target on js in case of single platform 2020-02-20 19:32:31 +03:00
Mikhail Glukhikh
285f613ef7 [FIR TEST] Add test with unresolved member in nested lambdas (KT-36887) 2020-02-20 19:25:50 +03:00
Zalim Bashorov
6f61ea7f67 [JS DCE] Add an ability to define overwriting strategy when copying dependencies in dev-mode
* CLI option "-Xdev-mode-overwriting-strategy"
* System Property "kotlin.js.dce.devmode.overwriting.strategy"

Possible values: "older", "all".

#KT-36349 Fixed
2020-02-20 19:10:29 +03:00
Pavel Kirpichenkov
07ca355af8 [NI] Fix smartcasts for conventional contains in when
Call argument for conventional `contains` after expanding `in` may come from a `when` subject during its branch analysis.
In this case data flow info from a previous when branch was not considered,
because data flow info for subject had been used instead of data flow before argument.
Use of the latter one for the conventional `contains` solves the issue.

The old FE uses `isExternal` property of value arguments to skip smartcast reporting on `when` subject,
if they come from branches. To prevent undesired smartcasts on `when` subject after branch analysis in the new FE,
`isExternal` arguments are skipped in diagnostic reporter and during recorded type update.

Also, the new FE interprets `isExternal` completely differently from the old FE.
In the old FE this property is used exclusively by `when` with subject.
In the new FE it is also used for parially resolved calls, lambda return arguments and receivers.
This may be preventing the use of data flow info before argument in the first place, but this assumption requires additional investigation.

^KT-36818 Fixed
2020-02-20 19:07:54 +03:00
Abduqodiri Qurbonzoda
afceec71a4 Create an interface with provideDelegate() method #KT-26494 2020-02-20 18:57:52 +03:00
Abduqodiri Qurbonzoda
2566fbea87 toMutableList documentation is vague #KT-35231 2020-02-20 18:52:10 +03:00
Abduqodiri Qurbonzoda
f9ee1dc22d Specify which element Iterable.distinctBy(selector) retains #KT-36356 2020-02-20 18:50:13 +03:00
Mikhail Glukhikh
fb49a586ef FIR2IR: add comment about type parameter indexes 2020-02-20 18:34:52 +03:00
Mikhail Glukhikh
984a11995a FIR2IR: pre-cache type parameters before property creation
Type parameters can be referred from e.g. property accessors,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:52 +03:00
Mikhail Glukhikh
a3f676317f FIR2IR: pre-cache type parameters before function creation
Type parameters can be referred from e.g. function return type,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:51 +03:00
Mikhail Glukhikh
899d471646 FIR2IR: determine type parameters before class super types
Type parameters can be referred from type arguments of super types,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:51 +03:00
Mikhail Glukhikh
8c21f04bf4 FIR2IR: determine type parameters before value parameters
Type parameters can be referred from value parameters,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:51 +03:00
Mikhail Glukhikh
334cab7357 [FIR] Don't build redundant fake overrides for private members
The only case we may need fake override for private members is
a situation when class refers itself with different type arguments.
So in this commit we forbid such fake overrides when we can prove
that class does not refers itself here.
2020-02-20 18:34:51 +03:00
Mikhail Glukhikh
b4d026f5bf [FIR] Add fast return from substitution scope when substitutor is empty 2020-02-20 18:34:50 +03:00
Mikhail Glukhikh
a6d11b0207 [FIR] Don't create redundant substitution scopes 2020-02-20 18:34:50 +03:00
Mikhail Glukhikh
01053c938a Generate IGNORE_BACKEND_FIR in black box tests properly 2020-02-20 18:11:43 +03:00
Mikhail Zarechenskiy
d921dd0eed Provide candidate interceptor for NI infrastructure 2020-02-20 18:07:12 +03:00
Igor Yakovlev
4693d595b7 Fix UL classes tests
Fixed #KT-36717
2020-02-20 18:03:10 +03:00
Sergey Igushkin
f47e602118 Use Kotlin/Native version 1.4-dev-14579, as it has the newest klib ABI 2020-02-20 17:48:24 +03:00
Mikhail Glukhikh
ace5d0357c [FIR TEST] Add problematic test describing KT-36881 2020-02-20 17:38:31 +03:00
Konstantin Tskhovrebov
018cfc7df6 Fix class name for test suite descriptor.
Issue #KT-36725 Fixed
Issue #KT-36716 Fixed
Issue #KT-36726 Fixed
2020-02-20 17:37:06 +03:00
Roman Golyshev
1dbb3d7c0f Revert "New J2K: fix testdata"
This reverts commit 285aa123
2020-02-20 17:33:39 +03:00
Roman Golyshev
4042214bb2 Fix tests broken by enhanced RedundantSamConstructor inspection
- The inspection now works in more cases, so the test data had to be
updated accordingly
2020-02-20 17:27:41 +03:00
Dmitriy Novozhilov
22a5bc4144 [FIR-TEST] Add build tasks for running all fir tests
- `:firCompilerTest` run all compiler fir tests
- `:idea:firTest` run all IDE fir tests
- `:firAllTest` run all fir tests
2020-02-20 16:56:34 +03:00
Dmitriy Novozhilov
82c960d40d [FIR-TEST] Run fir test in diagnostic test if fir testdata is missing 2020-02-20 16:56:34 +03:00
Dmitriy Novozhilov
d4d4697202 [FIR-TEST] Fix creating dirs in FirLoadCompiledKotlin test 2020-02-20 16:56:34 +03:00
Dmitriy Novozhilov
3edbf7f541 [FIR-TEST] Move abstract diagnostics tests to tests-common module 2020-02-20 16:56:34 +03:00
Dmitriy Novozhilov
102d5c7d5a [NI] Fix detecting expected type variable for postponed atoms
#KT-36819 Fixed
2020-02-20 16:56:33 +03:00
Vladimir Dolzhenko
7e832e50ac Move copy/paste resource bundles to Kotlin
#KT-36877 #EA-224686 Fixed
2020-02-20 14:06:11 +01:00
Dmitry Petrov
bc7c8e4819 Update bytecode text tests for JVM_IR 2020-02-20 14:59:29 +03:00
Yan Zhulanow
7581e0bd8e Unmute noParametersArgumentCallInExpression test in JVM IR backend 2020-02-20 20:56:36 +09:00
Juan Chen
9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00
Dmitry Petrov
81b30b7399 Update bytecode text tests for JVM_IR 2020-02-20 14:20:21 +03:00
Denis Zharkov
071149e0fb Fix exception when Java class has different methods with same erasure
^KT-36856 Fixed
2020-02-20 14:06:13 +03:00
Vladimir Ilmov
7efb32628e [Highlight] Fix for coloring annotation attributes in Kotlin
#KT-36156 Fixed
2020-02-20 11:51:42 +01:00
Vladimir Ilmov
8d4dac398d [COROUTINE] Information message added if breakpoint policy doesn't suspended all
threads.
2020-02-20 11:51:42 +01:00
pyos
eff02b6e72 JVM_IR: improve suspend tail call detection.
* TailCallOptimizationLowering should go into local classes in order to
   transform their suspend methods;
 * the check for invokes of noinline lambda arguments in codegen was
   incorrect, as it also returned true for calls of lambdas stored in
   local variables;
 * IrInlineCodegen should mark non-inlinable arguments used as inline
   suspend parameters;
 * detection of suspend/inline call sites was incorrect (or maybe it's
   the `compilationContextDescriptor` that was incorrect?..)
2020-02-20 11:10:26 +01:00
Steven Schäfer
3cf71c1d2b JVM IR: Move $assertionsDisabled field to interface DefaultImpls 2020-02-20 11:07:46 +01:00
Steven Schäfer
0ed719f792 JVM IR: Use package visibility for $assertionsDisabled field 2020-02-20 11:07:46 +01:00
Mikhail Zarechenskiy
d169435300 Fix construction of Mock classes in case of generic inner types
This fixes testMissingDependencyConflictingLibraries for NI and also
 fixes changed test for OI as well
2020-02-20 12:34:35 +03:00
Mikhail Zarechenskiy
83824d0ba6 [NI] Don't stop on a candidate with unstable smartcast error
#KT-36847 Fixed
2020-02-20 12:34:34 +03:00
Mikhail Zarechenskiy
162a2d5851 [NI] Add test to check how behavior will be changed after few commits 2020-02-20 12:34:34 +03:00
Sergey Igushkin
0e970407a4 Fixup for 9b861739 (the fix for KT-35942)
* Don't include the JS friend paths into the classpath
* Fix binary compatibility with Gradle < 5.1

Issue #KT-35942
2020-02-19 23:10:53 +03:00
Mikhail Glukhikh
3921613956 [FIR] Code cleanup: DeclarationsConverter 2020-02-19 22:47:59 +03:00
Mikhail Glukhikh
5d7999a808 [FIR] Handle explicitly private sealed class constructors properly
#KT-36850 Fixed
2020-02-19 22:41:24 +03:00
Mikhail Glukhikh
17b473fcb6 FirTowerResolver: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh
f1a418373c RawFirBuilder: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh
e66d6a8954 [FIR] ClassWrapper: code cleanup 2020-02-19 22:41:24 +03:00
Mikhail Glukhikh
bbf448b39d [FIR] Change visibility of default sealed class constructor to private 2020-02-19 22:41:23 +03:00
Mikhail Glukhikh
14fd1d3c9f [FIR] Check visibility correctly for sealed class in file 2020-02-19 22:41:23 +03:00
Mikhail Glukhikh
ace259314b Use 'symbol' instead of 'classId' in FirResolvedQualifier
This commit solves problem with resolved qualifier of local class
#KT-36758 Fixed
2020-02-19 22:41:23 +03:00
Mark Punzalan
3d51af2935 [JVM IR] Fix issue with suspend functions with @JvmOverloads. 2020-02-19 16:48:53 +01:00
Mikhail Glukhikh
c289612e57 [FIR] Remove debugging println in tree generator 2020-02-19 18:14:45 +03:00
Mikhail Glukhikh
a4c4b2650c FIR2IR: remove hacky & redundant resolve of delegating constructor calls 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh
82c8b5f368 [FIR] Eliminate isNotSAM optimization as ineffective (see dc4f332c) 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh
9017654b9d [FIR] Handle default parameters when checking callable reference type
#KT-36759 Fixed
2020-02-19 18:09:06 +03:00
Mikhail Glukhikh
04e6c63cc9 FirSymbolProvider: minor cleanup 2020-02-19 18:09:06 +03:00
Mikhail Glukhikh
1376dbf9cf Remove unused 'dispatchReceiverValue()' from FIR tower levels 2020-02-19 18:09:05 +03:00
Mikhail Glukhikh
e051251b27 FIR: set isOperator only for Java methods with appropriate names
#KT-35133 Fixed
2020-02-19 18:09:04 +03:00
Mikhail Zarechenskiy
cbbbf40b90 [NI] Fix isSuccessful property for member with LowPriority resolution
The problem was introduced in e40ba73950
2020-02-19 18:06:22 +03:00
simon.ogorodnik
8ca2aa47f8 [FIR] Remove duplicated code 2020-02-19 17:53:44 +03:00
simon.ogorodnik
c29c140a9c [FIR] Qualifier resolve 2020-02-19 17:53:44 +03:00
Sergey Igushkin
723ebb4f57 Fix compileOnly dependencies in HMPP (KT-36469)
The `compileOnly` configuration of a source set was not included in the
granular dependency transformation, which led to the dependencies from
the configuration being excluded as unrequested during dependency
processing.

Fix this by properly including the compileOnly scope into the
dependencies transformation.

Issue #KT-36469 Fixed
2020-02-19 17:30:46 +03:00
Sergey Igushkin
9b861739cd Include the production artifacts in friend paths (KT-35942)
In some setups, the friendArtifacts that we had in addition to direct
associate compilations' output classes were insufficient. For example:

1. When an Android module's tests depend on another module which
   transitively depends on the module containing tests: then the AGP
   API doesn't tell us that there are artifacts from the tested
   variant, but instead there's just the module's artifact.

2. Similar case but without Android, and if the classes are read from
   the module's artifact rather than the production output classes dir,
   then they are definitely not on the friend paths (which include the
   production classes dirs and not the the production artifact).

In both cases, the friendArtifacts mechanism allows us to add those
potential sources of the friend classes to the friend paths.

Issue #KT-35942 Fixed
2020-02-19 17:30:45 +03:00
Vladimir Dolzhenko
4eb04af01e Add checkStability to perf tests 2020-02-19 15:26:19 +01:00
Denis Zharkov
a6cf16ddfc FIR: Fix test data for FirMultiModuleResolveTestGenerated 2020-02-19 17:21:11 +03:00
Roman Golyshev
46ae6136cb Rewrite RedundantSamConstructorInspection to support more cases
- Now inspection does not rely on synthetic descriptors at all, instead
it uses `SamConversionOracle` and `SamConversionResolver` to detect
if the argument type support SAM conversion
- This transparently considers all language features like
`SAM conversions for kotlin functions`, `Functional interfaces` etc.
- In case of multiple SAM arguments, part of them can be converted only
when `SAM conversion per argument` is enabled
- Fix inspection and nj2k tests that were failing because of better
working inspection
- Rewrite automatically fixes multiple bugs that were present
- ^KT-36367 ^KT-36368 ^KT-36296 ^KT-36395 Fixed
2020-02-19 17:16:17 +03:00
Roman Golyshev
9b5110b9f3 Refactor RedundantSamConstructorInspection
- Does not change the behaviour
2020-02-19 17:16:17 +03:00
Roman Golyshev
3122760c49 Add more tests for RedundantSamConstructorInspection
- All those tests already pass, they are needed to fix the behaviour of the inspection before the changes
2020-02-19 17:16:17 +03:00
Victor Petukhov
e8524137c3 NI: exclude not fixed type variables from types on which null checks should be generated
^KT-36371 Fixed
2020-02-19 15:58:08 +03:00
Victor Petukhov
f10696da5e Fix formatting of RuntimeAssertion.kt 2020-02-19 15:58:08 +03:00
Denis Zharkov
6793b27330 FIR: Optimize Java types mapping
- Avoid duplicated computations for arguments
- Do not recreate types if they weren't enhanced
2020-02-19 15:53:34 +03:00
Denis Zharkov
c8269baa92 FIR: Fix NI handling flexible type bounds 2020-02-19 15:53:34 +03:00
Denis Zharkov
2ad8488e6a FIR: Rewrite Java type mapping
Previoisly, there were two places where mapping had happened:
- toConeKotlinTypeWithNullability
- enhancePossiblyFlexible

The first one was used for supertypes and bounds and the second one
was used for other signature parts

The main idea is to perform type mapping once to a flexible type,
and then use it as it's needed (it's lower bound, or for the further ehnancement)

Also, this commit fixes flexibility for type arguments, see the tests
2020-02-19 15:53:34 +03:00
Victor Petukhov
748a326104 NI: Discard definitely not-null types inside invariant positions during inference process
^KT-36816 Fixed
2020-02-19 15:32:12 +03:00
Roman Golyshev
36f4b6daf3 Update completion-ranking-kotlin dependency 2020-02-19 14:16:48 +03:00
pyos
3080b4c435 JVM_IR: remove a suspend-related hack from BridgeLowering
`invoke` in suspend lambdas overrides FunctionN.invoke, so the
refactored BridgeLowering already generates correct bridges there.
All the hack does is break overrides of interface suspend methods.
2020-02-19 11:26:45 +01:00
Steven Schäfer
ba90e87756 JVM, JVM IR: Fix assertion status for regenerated anonymous objects
We always set the $assertionsDisabled field based on the top-level
enclosing class. This means that for anonymous objects we have to
rewrite the call to Class.desiredAssertionStatus.
2020-02-19 11:23:24 +01:00
Steven Schäfer
272f6abe69 JVM IR: Fix suspend lambda generic signatures 2020-02-19 11:18:27 +01:00
pyos
e6efb81014 JVM_IR: inline findSuspendAndInlineLambdas 2020-02-19 10:47:27 +01:00
pyos
5d603a8be4 JVM_IR: detect lambdas capturing crossinline through fields 2020-02-19 10:47:27 +01:00
Ilya Kirillov
285aa123b7 New J2K: fix testdata 2020-02-19 12:02:32 +03:00
Ilya Kirillov
17a0e3a078 New J2K: do not call custom diagnostic fixes in EDT as they may have resolve inside 2020-02-19 12:02:31 +03:00
Ilya Kirillov
810966e408 New J2K: call reformat code & shorten references processings only single time 2020-02-19 12:02:30 +03:00
Ilya Kirillov
ee0ec421ce New J2K: do not print Unit types 2020-02-19 12:02:29 +03:00
Ilya Kirillov
6c1e2cc196 New J2K: disable additional post-formatting for J2K
As there is a formatting processing, it's not needed but takes some time
2020-02-19 12:02:28 +03:00
Ilya Kirillov
85be0450ba Fix invalidated element access exception in ObjectLiteralToLambdaIntention
#KT-36149 fixed
#KT-36152 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov
6b913da698 New J2K: Fix super call to Kotlin class with implicit constructor
#KT-36159 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov
7c586ce736 New J2K: Fix converting recursive types
#KT-36088 fixed
2020-02-19 12:02:26 +03:00
Pavel Semyonov
6982db7d02 chore: improved UI texts for new project wizard 2020-02-19 12:00:30 +03:00
Dmitry Petrov
0b9b1b6945 Update bytecode text tests for JVM_IR 2020-02-18 22:51:29 +03:00
Denis Zharkov
aac72871e7 Fix UI freezes caused by calls with a huge number overloads
While we have an overload resolution algorithm working for O(n^2),
call resolution for the single particular call may work more then just
a second.
Thus, we need to call ProgressManager.checkCanceled() with more granularity

^KT-35135 Fixed
2020-02-18 20:07:14 +03:00
Denis Zharkov
842e2dc02f Optimize retaining most specific methods in LazyJavaScope
See 62a55b7b00
Previously, it was working for O(n^2)
Now, we first group it by jvm descriptor,
then for each groups of size g_i finding the most specific for O(g_i^2)

It should help for the cases when we have a lot of overloads with
different JVM descriptors (modulo return type)
NB: Having the same JVM descriptors is rather rare, because
in Java one cannot generate such a class.

Looks like it's only possible for Scala or some other JVM languages (KT-17560)

It should help a lot for KT-35135
2020-02-18 20:07:13 +03:00
Denis Zharkov
d06e35b061 Minor. Reformat overridingUtils.kt 2020-02-18 19:59:56 +03:00
Pavel Kirpichenkov
a50911156d [NI] Add regression tests for builder inference
Actual fix is c02dd720
^KT-33542 Fixed
^KT-33544 Fixed
^KT-36446 Fixed
2020-02-18 19:12:53 +03:00
Pavel Kirpichenkov
6ed1cc5cd8 [JPS-TESTS] Update incremental compilation test for 1.4
Bug fix `NoConstantValueAttributeForNonConstVals` removes constant attribute from non-constant properties.
Code using such properties does not have to be recompiled, since its value is no longer inlined.
2020-02-18 18:31:47 +03:00
Ilmir Usmanov
f9f715c31e Support suspend lambda with arity 22 in old BE
Somehow, I missed, that its 'create' function has bit arity, while
'invoke' does not. Thus, instead of directly passing arguments of
'invoke' to 'create', pack them into an array first.
2020-02-18 16:21:27 +01:00
Mads Ager
752ff9de5d JVM_IR: Support suspend lambdas with many arguments. 2020-02-18 16:21:25 +01:00
Dmitriy Dolovov
f2b940ffd4 [Commonizer] Apply interner to avoid duplicated CirValueParameterImpl objects 2020-02-18 22:03:55 +07:00
Dmitriy Dolovov
5663dfb772 [Commonizer] Apply interner to avoid duplicated CirSetter objects 2020-02-18 22:03:49 +07:00
Dmitriy Dolovov
e54640ddad [Commonizer] Apply interner to avoid duplicated CirGetter objects 2020-02-18 22:03:41 +07:00
Dmitriy Dolovov
39125a75e7 [Commonizer] Apply interner to avoid duplicated CirAnnotation objects 2020-02-18 22:03:35 +07:00
Dmitriy Dolovov
c88ea2f2e6 [Commonizer] Apply interner to avoid duplicated CirSimpleType objects 2020-02-18 22:03:16 +07:00
Dmitriy Dolovov
84bc151cb3 Minor. Add toString() to CommonizedClassDescriptor.CommonizedClassTypeConstructor 2020-02-18 22:03:10 +07:00
Dmitriy Dolovov
d0e9dc05b5 [Commonizer] Apply interner to avoid duplicated Name objects 2020-02-18 22:03:03 +07:00
Dmitriy Dolovov
47d091702b [Commonizer] Apply interner to avoid duplicated FqName objects 2020-02-18 22:02:57 +07:00
Dmitriy Dolovov
adc5a55d65 [Commonizer] Apply interner to avoid duplicated String objects 2020-02-18 22:02:50 +07:00
Dmitriy Dolovov
667e96f971 [Commonizer] Don't keep references to descriptor objects when they are not needed anymore
This is necessary to reduce overall memory consumption.
2020-02-18 22:02:44 +07:00
Dmitriy Dolovov
9a8a1113db [Commonizer] Don't commonize deprecated functions
1. All functions marked with @Deprecated from Kotlin/Native platform libraries
have DeprecationLevel.ERROR, and therefore practically can not be used by
a developer in their code. So, it does not make sence to keep such
declarations in commonized libraries.

2. Commonization of such functions would also require commonization of
annotations with nested annotations as const values (ex:
@Deprecated(level = DeprecationLevel.ERROR), where both @Deprecated
and DeprecationLevel are annotation classes). This is not implemented yet.
2020-02-18 22:02:38 +07:00
Dmitriy Dolovov
11e0f427ac [Commonizer] Refactor CIR to avoid strong refs on descriptors
This is necessary to reduce memory consumption in commonizer while
processing sets of massive libraries.
Ex: ios_x64 (127 libraries) vs ios_arm64 (127 libraries).
2020-02-18 22:02:29 +07:00
Vladimir Dolzhenko
a0b0f72edf Add missed dependencies for performance tests 2020-02-18 16:00:44 +01:00
Dmitriy Novozhilov
635ff59d10 [FIR] Fix compiler error after 2aeb1ea2 2020-02-18 17:46:43 +03:00
Sergey Igushkin
faa95bfc33 Fix KT-36804 by eagerly instantiating the Kotlin/Native tasks
This commit partially reverts 970ee4539b.

The Kotlin/Native klib compilation task configuration logic involved
adding dependencies for the compiler plugin artifacts. However, the
compiler plugins classpath, shared across all of the K/N tasks, was
tracked as the tasks' input. This made the following scenario possible:

1. Configuration of some of the Kotlin/Native tasks is avoided at the
   evaluation phase;

2. During task graph construction, one of the tasks are evaluated, and
   to determine their dependencies, Gradle resolves their inputs,
   including the compiler plugins classpath mentioned above;

3. Another K/N task is evaluated afterwards, and the configuration logic
   attempts to add a dependency into the compiler plugin classpath
   configuration, which has already been resolved in (2).
   The build fails.

Fix this by cancelling task configuration avoidance for the K/N tasks.

Issue #KT-36804 Fixed
2020-02-18 16:48:12 +03:00
Vyacheslav Karpukhin
582ce1199f Merge remote-tracking branch 'origin/master' 2020-02-18 14:34:36 +01:00
Vyacheslav Karpukhin
eef86d47a0 Merge branch 'slava/mpp-import-experiments'
# Conflicts:
#	idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt
2020-02-18 14:14:23 +01:00
Vyacheslav Karpukhin
4462ecb280 Simplified SdkLocator usage in AndroidDependencyResolver 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin
d9f9c93dc8 KotlinMPPGradleProjectResolver: extracted similar Android checks 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin
082c358f9d Removed references to AndroidDependencyResolver from KotlinMultiplatformExtension 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin
bdb8811f95 Nullability check 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin
aaf939a650 Android dependency resolving stuff moved out of KotlinMultiplatformExtension.kt 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin
9788525ec7 Import sources for Android SDK, include proper identifiers for Gradle dependencies 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin
663c8e5a46 Import Android modules only if Android Plugin for IDEA is missing 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin
ad314e93eb Do not explicitly depend on prerelease Android Gradle Plugin 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin
a6e488e2b4 Android import: simplified configuration matching 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin
45a0aa04a1 Android import: import R.jar 2020-02-18 14:10:22 +01:00
Vyacheslav Karpukhin
17059682e9 Android import: initial implementation 2020-02-18 14:10:13 +01:00
Nikolay Krasko
f47e5cb2d0 Make 201 plugin compatible with IDEA trunk (KT-36780)
^KT-36780 Fixed
2020-02-18 16:08:27 +03:00
Dmitriy Novozhilov
6941cd6d28 [FIR] Add @PrivateForInline to prevent setting to var's from inconvenient places 2020-02-18 16:06:11 +03:00
Dmitriy Novozhilov
2aeb1ea234 [FIR] Move some util methods from resolve.calls to types package 2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov
cd3fc5b8ec [FIR] Reorganize packages for resolve module 2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov
41d2f41141 [FIR] Fix incorrect smartcasts from || expressions
#KT-36057 Fixed
2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov
89e377763a [FIR] Change rendering for captured types and stub types 2020-02-18 15:19:33 +03:00
Dmitriy Novozhilov
c83244c8b5 [FIR] Fix creating and substituting definitely not null types
#KT-36764 Fixed
2020-02-18 15:19:33 +03:00
Dmitriy Novozhilov
bf11f1892d [FIR] Change order of initialization synthetic fun in SAM resolution
It's needed because of `substitutedReturnType` relies on bounds
  of type parameters that should be build before access via symbol
  from lookup tag
2020-02-18 15:19:33 +03:00
Pavel Kirpichenkov
6430209074 [NI] Make error CST when any of included types is error
`ErrorType` is not subtype of `Any`, so any set of types containing an `ErrorType` has no common super constructors.
^KT-36745 Fixed
2020-02-18 14:46:29 +03:00
Dmitry Petrov
6d1da6e6d5 KT-36143 Fix type approximation for type arguments in PSI2IR 2020-02-18 14:39:12 +03:00
Nikolay Krasko
2340a86d8d Update to 201.5259.13-EAP-SNAPSHOT
- No UIUtil.removeLeakingAppleListeners anymore
- getParameterHints nullability
- versions of lz4-java and guava were changed
2020-02-18 14:13:55 +03:00
Nikolay Krasko
6c968859ad Access to test root disposable through accessor 2020-02-18 14:13:55 +03:00
Nikolay Krasko
272ccf64ae Refactoring: extract resetApplicationToNull to separate file 2020-02-18 14:13:54 +03:00
Ilmir Usmanov
c748b6f3ee JVM_IR. Minor. Update bytecode text test to JVM_IR or create issues when this
is not feasible.
2020-02-18 11:43:37 +01:00
Steven Schäfer
4b954c347a JVM IR: Avoid optimizing comparisons between boxed primitives and null
A comparison of the form `x == null` where `x` is of type `Int` might not
be vacuous if `x` is a boxed value coming from Java code.
2020-02-18 13:37:48 +03:00
Pavel Kirpichenkov
32e1ec8e98 [minor] Update build output in test to fit NI 2020-02-18 11:19:19 +03:00
Pavel Kirpichenkov
64590cc56b [JPS-TEST] Update test checking JPS build with NI in IDE
Set explicit 1.3 version to disable NI during compilation
2020-02-18 11:19:19 +03:00
Pavel Kirpichenkov
2ead2fba08 [IDEA-TESTS] Update quickfix test parameters for 1.4
Tests check language feature `ProhibitVarargAsArrayAfterSamArgument`
2020-02-18 11:19:18 +03:00
Mikhail Glukhikh
fdf4f477a6 FIR2IR: fix problems with enum entry / anonymous object visibility 2020-02-18 10:50:03 +03:00
Ilya Goncharov
9f0ef77531 [Gradle, JS] Provide js compilations parameters to link tasks
#KT-36796 fixed
2020-02-18 09:35:36 +03:00
Abduqodiri Qurbonzoda
ce8e511b79 Add setOfNotNull function #KT-35851 2020-02-18 02:33:59 +03:00
Abduqodiri Qurbonzoda
5a4ce2aa4c Mark shared global vals to fix K/N worker thread crash 2020-02-18 01:49:24 +03:00
Dmitry Petrov
94d20d9176 Update bytecode text tests in JVM_IR 2020-02-17 23:52:48 +03:00
Mark Punzalan
64141b8b38 [JVM IR] Fix issue where fields are not being set to their default
values within initializer blocks.

The issue occurs in code like this:
```
class C {
  var b = true
  init {
    b = false   // Missing PUTFIELD for this statement
  }
}
```

Added a new statement origin for field initialization (at declaration)
instead of relying on `origin == null` in ExpressionCodegen to determine
whether to generate the initializations.

This was unintentionally broken in
d68a1898d0.
2020-02-17 23:04:11 +03:00
Mikhail Glukhikh
56c819f06e FIR2IR: add two-statements block with iterator + while for 'for' loops
Before this commit we had two statements blocks for 'for' loops:
range variable declaration + iterator variable declaration + while loop.
However, BE requires a bit different loop structure to make lowerings
properly so in this commit iterator declaration & while loop were
extracted to separate block.
2020-02-17 20:35:17 +03:00
Mikhail Glukhikh
2bfce4f127 FIR2IR: provide correct origins for 'for' loops 2020-02-17 20:35:17 +03:00
Mikhail Glukhikh
83e68be2dc FIR2IR: add declarations to all library classes from kotlin.* package
Before this commit, all library classes were just stubs.
This commit helps to solve problems with some functions
indirectly used by BE, like IntProgression.first.
2020-02-17 20:35:17 +03:00
Mikhail Glukhikh
4a4fb5a590 Raw FIR: eliminate range variable declaration in 'for' loops 2020-02-17 20:35:17 +03:00
Mikhail Glukhikh
4abbcd1267 Unmute two passing FIR black box tests (fixed by commits of demiurg) 2020-02-17 20:35:16 +03:00
Mikhail Glukhikh
91814364de Mute two failing FIR black box tests (broken by commits of demiurg) 2020-02-17 20:35:16 +03:00
Dmitry Savvinov
baa2c56e2d Force-set path to exact project for MPP run configurations
Otherwise, path will be set to the root project. Given that we provide
task names in relative form rather than absolute, that will lead to
launching this task in all subprojects (e.g. task 'jvmTest'). This might
be a huge issue, because when we create run configuration for specific
test method/class, we pass test filter as well. This test filter will
execute in all projects with matched test tasks, so if some other
subproject has similarly-named test task, but doesn't have a suitable
tests for that filter, the whole build will fail.

Note that the ideal fix would involve using fully-qualified task names:
the current approach might lead to isses in advanced scenarious (e.g.
when user selects several test files from different modules -- then, we
won't be able to find one exact project path for the whole test run)

^KT-35038 Fixed
2020-02-17 20:05:50 +03:00
Dmitry Savvinov
cc2884b8ae Add test on multiplatform run configurations in multiproject build
The current behaviour is undesired, see next commit for fix
2020-02-17 20:05:50 +03:00
Dmitry Savvinov
1ea3db90e1 Add ability to render project of run configuration in tests 2020-02-17 20:05:50 +03:00
Victor Petukhov
51edf2b351 NI: introduce warning about implicitly inferred Nothing with existing non-Nothing expected type
^KT-35406 Fixed
2020-02-17 19:43:05 +03:00
Jinseong Jeon
e3184e407d KT-20844 Re-enable stack spilling during inline.
`dx` has entered the final stage of sunset:
https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
2020-02-17 15:44:48 +01:00
Vladimir Dolzhenko
c9ed27e674 KT-36685 "Convert to a range check" transform hex range to int if it is compared with "Less" or "Greater"
#KT-36685 Fixed
2020-02-17 14:43:37 +01:00
Dmitriy Novozhilov
811ed1ade4 [FIR] Don't update expression in receiver value with smartcast in candidate factory 2020-02-17 14:45:44 +03:00
Dmitriy Novozhilov
e302e06c73 [FIR-TEST] Add test with nullability annotation problem
#KT-36770
2020-02-17 14:45:44 +03:00
Dmitriy Novozhilov
47d5bbc224 [FIR-TEST] Move fixed tests out problems directory 2020-02-17 14:45:44 +03:00
Dmitriy Novozhilov
e67c8a55bf [FIR-TEST] Add test with callable reference to member of local class
#KT-36758
2020-02-17 14:45:44 +03:00
Dmitriy Novozhilov
d10e56c358 [FIR] Add mapping of primitive types to JVM signatures 2020-02-17 14:45:43 +03:00
Mikhael Bogdanov
031952268a Minor. Disable test on Android 2020-02-17 12:03:08 +01:00
Alexey Tsvetkov
ee2e40ce6b Regenerate test 2020-02-17 13:14:04 +03:00
Mikhail Zarechenskiy
70d416cafd Remove test that become useless after enabling NI everywhere
It checked that with default settings new inference is enabled in IDE
 and SAM conversions are _disabled_. Now this is useless as NI is
 enabled everywhere
2020-02-17 12:38:22 +03:00
Mikhail Zarechenskiy
dfe23e770c Update test about lookups for SAMs after enabling NI
In NI we don't perform lookup if argument is obviously can't be
 adapted by SAM conversion (and here there is no argument at all)
2020-02-17 12:38:21 +03:00
Igor Chevdar
297d296b62 [JS] Respect SKIP_DCE_DRIVEN in tests 2020-02-17 12:21:00 +03:00
Igor Chevdar
9bc7a43991 [IR] [JS_IR] Supported fun interfaces in JS 2020-02-17 12:21:00 +03:00
Pavel Kirpichenkov
4a7b4d655c [NI] Fix completion for ILT when Nothing constraint is present
Full completion should not be done if lower `Nothing`
is the only proper constraint when constraint with ILT type is present.
ILT will be selected as a resulting type and transformed into `Int`
without attention to possible restrictions from outer calls.
2020-02-17 12:02:51 +03:00
Sergey Bogolepov
208c06516b [IR][Serialization] Allow backends to skip files
This change is required for Native interop libraries.
For enums and structs we generate full-blown IR classes that should not
be serialized because they will be generated anew.
2020-02-17 16:00:37 +07:00
Natalia Selezneva
bcf6ee0c0b KotlinDslScriptsModel: pass provider mode properly 2020-02-17 11:44:50 +03:00
Natalia Selezneva
ed6f13cf56 KotlinDslScriptsModel: do not add prepare task for each gradle task invocation
^KT-36090 Fixed
2020-02-17 11:44:50 +03:00
Natalia Selezneva
e40dc37be8 KotlinDslScriptsModel: pass correlationId during the request
^KT-36200 Fixed
2020-02-17 11:42:21 +03:00
Pavel Kirpichenkov
55b836a0ac Mute light class tests
Muted test failures are stable with LV 1.4
Related ticket KT-36717
2020-02-17 10:56:46 +03:00
Pavel Kirpichenkov
fda8d7de8b [IDEA-TESTS] Specify language version in feature-dependent tests
Some quickfixes are relying on diagnostics, that won't be reported
with new language features enabled.
`MixedNamedArgumentsInTheirOwnPosition`
`AllowBreakAndContinueInsideWhen`
2020-02-17 10:56:46 +03:00
Pavel Kirpichenkov
85d7a0f6b1 [IDEA-TESTS] Fix ReplaceProtectedToPublishedApiCallFix
Register error factory in addition to warning factory
2020-02-17 10:56:46 +03:00
Pavel Kirpichenkov
05b00a1302 [JPS-TEST] Update deprecated language version in test 2020-02-17 10:56:46 +03:00
Pavel Kirpichenkov
bd3b23b933 Use LATEST_STABLE version during prerelease in VersionView
^KT-36644 Fixed
2020-02-17 10:56:41 +03:00
Mikhail Zarechenskiy
f9129332b7 [NI] Minor optimisation: don't call extra contains checks 2020-02-17 10:29:47 +03:00
Mikhail Zarechenskiy
724bb1b134 [NI] Force variable substitution for properties with stub types 2020-02-17 10:29:46 +03:00
Mikhail Zarechenskiy
155b716e7e Revert "Disable NewInference for stdlib tests"
This reverts commit cdf5323f8c.
2020-02-17 10:29:46 +03:00
Mikhail Zarechenskiy
18b218bfa8 [NI] Use projected type for constraint like Cap(out A) <: out @Exact T
This is an implicit semantics of Exact annotation
2020-02-17 10:29:46 +03:00
Mikhail Zarechenskiy
3cf77d29b5 Unmute test for NI
It was fixed in 7f6c03c9
2020-02-17 10:29:45 +03:00
Mikhail Zarechenskiy
4542f3b720 [NI] Finish analysis for coerced last lambda expressions if needed 2020-02-17 10:29:45 +03:00
Mikhail Zarechenskiy
220bf6d62f [NI] Update test data 2020-02-16 23:49:50 +03:00
Roman Golyshev
3461effd47 KT-33372 Remove renaming file reference to the contents of the file
- There is still a hack with returning null from `getLastFileReference`,
it is here to keep KT-25674 issue fixed
- Overrides of `bindToElement` are removed, they caused renames of the
file references to their contents
- Code of `KotlinFilePathReferenceContributor.kt` is refactored
- ^KT-33372 ^KT-32514 ^KT-36306 Fixed
2020-02-16 17:08:11 +03:00
Toshiaki Kameyama
7f2cf571b0 Convert to range check: do not transform binaries/hexadecimals to decimals
#KT-36685 Fixed
2020-02-16 15:56:44 +09:00
Steven Schäfer
50c477bee1 Update IR text test expectations for FIR 2020-02-15 22:38:10 +03:00
Kristoffer Andersen
de33b83bb3 Update asFunKSmall.kt 2020-02-15 22:38:10 +03:00
Kristoffer Andersen
577250d73f [FIR] Fix FIR2IR Types on SetVariable Expressions 2020-02-15 22:38:06 +03:00
Kristoffer Andersen
4dc6583f31 Update asFunKSmall.kt 2020-02-15 22:32:23 +03:00
Kristoffer Andersen
4f36e2ccfc [FIR] Fix FIR2IR Types on SetVariable Expressions 2020-02-15 22:32:23 +03:00
Dmitry Petrov
1e7f8ea037 PSI2IR test for coercion to unit in lambda 2020-02-15 22:32:23 +03:00
Steven Schäfer
5760c0be9c JVM IR: Avoid redundant coercions in ExpressionCodegen 2020-02-15 22:32:23 +03:00
Steven Schäfer
2b2ae8a5f1 IR: Optimize implicit integer coercions on constants. 2020-02-15 22:32:23 +03:00
Steven Schäfer
bc2b96f634 IR: Fix return types in IrConstImpl 2020-02-15 22:32:23 +03:00
Sergey Rostov
2677fa7472 .gradle.kts: more clear tooltip for out of project scripts notification
The current text/action/help text may not be clear: action is not related to project import, and help text doesn't make it clear.

#KT-36703 Fixed
2020-02-15 11:38:05 +03:00
Vladimir Dolzhenko
52bf630f6c Add ApplicationUtils.as40 as it does not have CancellationCheck
Relates to #KT-35135
2020-02-15 09:35:56 +01:00
Vladimir Dolzhenko
ba5a335e95 Add missed create in usage of new annotation highlighting API
Relates to #KT-36712
2020-02-15 08:23:58 +01:00
Roman Artemev
3407904e68 [JS IR] Add todo 2020-02-14 18:22:17 +03:00
Roman Artemev
e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Roman Artemev
46491c12ee [KLIB] Promote Klib ABI version 2020-02-14 18:22:16 +03:00
Roman Artemev
a411549e38 [KLIB] Fix zipped layout 2020-02-14 18:22:16 +03:00
Roman Artemev
5004bb3636 [Psi2Ir] Fix generation of hashcode for generic inline class 2020-02-14 18:22:16 +03:00
Roman Artemev
6a37955a36 [KLIB] Implement new linker based on IdSignature
- Remove klib dependency on metadata and uniqID
 - Refactored proto format to make it more effective and compact
  -- Use special encoding for some types of data (coordinates, flags, types)
  -- Remove symbols table
  -- Use packed proto list if it is possible
 - Remove extension from metadata
 - Remove special ids for function interfaces
 - Fix klib IO
 - Fix incremental cache
 - General code clean up
2020-02-14 18:22:16 +03:00
Roman Artemev
31d73c5d79 [Psi2Ir] Move to new linkage scheme based on IdSignature
Now SymbolTable operates with two types of symbols (public and private)
In case of Public symbol IdSignature is used as table key
Private one uses descriptor as the key in similar scheme as before
2020-02-14 18:22:16 +03:00
Roman Artemev
df7b7cf61a [K/N] Provide original class id for forward-declared declarataion 2020-02-14 18:22:15 +03:00
Roman Artemev
e81a7f10c1 [KLIB] Implement special encoding for Klib data 2020-02-14 18:22:15 +03:00
Roman Artemev
7688197841 [JS IR] Fix access to coroutine empty context for suspend main 2020-02-14 18:22:15 +03:00
Roman Artemev
cef9ed1dae [IR] Implement new IrSymbol API
- Add predicate whether symbol is PublicAPI
 - Split symbols into 2 types (Public/Private)
 - Fix special implementations
2020-02-14 18:22:15 +03:00
Roman Artemev
bb04eae93e [IR] Implement IdSignature API
- Basic implementation of IdSignature classes and interafces
 - Abstract and platform Ir/Descriptor based signature builders
2020-02-14 18:22:15 +03:00
Roman Artemev
45f036548b [Psi2Ir] Make IrEnumEntry corresponding class always privite 2020-02-14 18:22:15 +03:00
Roman Artemev
d51b14fe3c [IR] Fix classic mangler expect checker 2020-02-14 18:22:15 +03:00
Roman Artemev
0254734bb5 [IR] Refactored Kotlin Mangler API
- Implement abstract Ir-based, Descriptor-based
 mangler computers and export checkers and corresponding platform
 specializations
 - Add runtime verifier which check whether all types of mangler
 produces the same type of data

Note: code migration is not finished yet
2020-02-14 18:22:15 +03:00
Pavel Kirpichenkov
ba25b0faaf [NI] Report unsafe invoke properly for flexible types
`isNullable` check returns `true` for flexible types,
which leads to false positive unsafe invoke error, when
receiver for invoke's property is flexible.
^KT-30695 Fixed
2020-02-14 18:06:35 +03:00
Pavel Kirpichenkov
b161839092 [NI] Report unsafe implicit invoke accordingly to OI
This reverts commit df046683cc.
KT-30695
2020-02-14 18:06:34 +03:00
Dmitriy Novozhilov
1a2d28d25b [FIR-TEST] Add test with callable reference on function with default argument 2020-02-14 17:53:29 +03:00
Dmitriy Novozhilov
3790f31d80 [FIR] Support FirVarargArgumentsExpression in html dump 2020-02-14 17:53:29 +03:00
Dmitriy Novozhilov
e696d1d06a [FIR] Improve mapping arguments to parameters 2020-02-14 17:53:28 +03:00
Vladimir Dolzhenko
2e597a3a32 Use new annotation highlighting API
Fixed #KT-36712
2020-02-14 15:42:45 +01:00
Mikhail Glukhikh
2a55560f3b [FIR TEST] Add test on qualifier resolve priority (corner case) 2020-02-14 17:38:37 +03:00
Mikhail Glukhikh
abfe566255 [FIR] Add object support as implicit invoke receiver 2020-02-14 17:38:31 +03:00
Mikhail Glukhikh
a8a696c7e1 [FIR TEST] Extend test on invoke priorities 2020-02-14 17:38:25 +03:00
Georgy Bronnikov
79060e7f40 IR: handle conflicts in resolveFakeOverride() 2020-02-14 17:20:34 +03:00
Georgy Bronnikov
c71e87068a JVM_IR: in InheritedDefaultMethodsOnClassesLowering, skip bridges when resolving overrides 2020-02-14 17:20:34 +03:00
Svyatoslav Scherbina
829e5908d0 Allow Native @Throws on override when the same list is specified 2020-02-14 17:10:58 +03:00
Shagen Ogandzhanian
3fcdf6c78c Update dukat dependency to 0.0.28 2020-02-14 15:00:29 +01:00
Ilya Goncharov
64f13ab3ae [Gradle, JS] Migrate on strings 2020-02-14 16:36:49 +03:00
Ilya Goncharov
9b462b76d4 [Gradle, JS] Add all possible values of library target as enums 2020-02-14 16:36:49 +03:00
Ilya Goncharov
fbabbfab44 [Gradle, JS] Add webpack output 2020-02-14 16:36:49 +03:00
Natalia Selezneva
dc77df1083 GradleScriptInputsWatcher: move long running operation out of EDT
^KT-36502
2020-02-14 16:18:35 +03:00
Mikhail Zarechenskiy
2d15914d20 Enable new inference in IDE by default 2020-02-14 14:37:23 +03:00
Leonid Startsev
bdf1441c80 Remove special casing for Unit in kotlinx.serialization
Unignore test since it is in muted list and auto-generated
2020-02-14 14:28:51 +03:00
Dmitry Petrov
59cdf3c52e Update bytecode text tests in JVM_IR 2020-02-14 14:07:03 +03:00
Ilya Chernikov
db91b520a5 [minor] Fix test source - avoid warning about uused main args 2020-02-14 11:41:30 +01:00
Ilya Chernikov
6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Dmitry Gridin
238bfe3771 Fix compilation 2020-02-14 12:05:14 +03:00
Yan Zhulanow
1c945430bc Fix class loading deadlock in Error diagnostic classes
Because of non-trivial initialization logic, Errors/ErrorsJvm/etc.
  are prone to class loading issues. This commit prevents them by
  preloading all error on plugin initialization step.
2020-02-14 17:35:19 +09:00
Yan Zhulanow
2f34bc88dc Debugger: Add test for KT-14869 2020-02-14 17:35:19 +09:00
Yan Zhulanow
ea7ffa70b3 Debugger: Add test for KT-34905 2020-02-14 17:35:19 +09:00
Yan Zhulanow
6690f946d6 Debugger: Add test for KT-14296 2020-02-14 17:35:19 +09:00
Yan Zhulanow
6f425ee951 Debugger: Add test for KT-15652 2020-02-14 17:35:18 +09:00
Yan Zhulanow
dd33640238 Debugger: Skip inlined library frames on step over (KT-12016) 2020-02-14 17:35:18 +09:00
Yan Zhulanow
7490c229ac EA-219152 (partially): Support KClass 'unboxing' in debugger
KClass can be 'unboxed' to a plain Java class. Debugger should be aware of this.
Unfortunately, this commit is not enough to fully support this scenario, as it's impossible to invoke KClass methods/extension on java.lang.Class instance. There should be an additional diagnostic that will forbid such calls.
2020-02-14 17:35:18 +09:00
Yan Zhulanow
a7071344f5 EA-219152 (partially): Provide correct PropertyDescriptor for _field 2020-02-14 17:35:18 +09:00
Yan Zhulanow
9c889aab17 EA-213309: Eliminate "Invalid method id" exception 2020-02-14 17:35:18 +09:00
Yan Zhulanow
f6b62f2299 Minor: extract wrapEvaluateException() 2020-02-14 17:35:18 +09:00
Yan Zhulanow
3027fab238 EA-218160: Force-box only assignment l-values 2020-02-14 17:35:18 +09:00
Yan Zhulanow
d539a870ed EA-214668, EA-209980: Use StackFrameProxyImpl with safe implementation of thisObject() 2020-02-14 17:35:18 +09:00
Yan Zhulanow
fabbfdc7f8 EA-214654: Add missing read action 2020-02-14 17:35:18 +09:00
Yan Zhulanow
dc71ab5bb3 EA-211010: Fix receiver parameter name for lambdas passed as value arguments 2020-02-14 17:35:18 +09:00
Yan Zhulanow
b1414fa477 EA-214662: Support property accessors in UastLightIdentifier 2020-02-14 17:35:18 +09:00
Yan Zhulanow
be99f44c4f EA-209623: Check library disposed state 2020-02-14 17:35:18 +09:00
Yan Zhulanow
eb3685d6ac EA-218902: Check PsiElement for validity 2020-02-14 17:35:17 +09:00
Yan Zhulanow
615d24bbd2 Minor: Rename KotlinStepOverInlineFilter to KotlinStepOverFilter 2020-02-14 17:35:17 +09:00
Yan Zhulanow
f4337eede1 Debugger, BE: Support lambda breakpoints for lambdas passed to '@InlineOnly' functions 2020-02-14 17:35:17 +09:00
Yan Zhulanow
f129ab55c5 Debugger: Rewrite step out action
This commit fixes the following tests:
 - KotlinSteppingTestGenerated.Custom.testStepOutInlineFunctionStdlib
 - KotlinSteppingTestGenerated.StepOut.testStepOutSeveralInlineArgumentDeepest
2020-02-14 17:35:17 +09:00
Yan Zhulanow
cc2fe6b0c6 Debugger, BE: Generate original line number after inlining if call is used in an if condition
If a part of an 'if' condition is an inline function call, we need to insert the original condition line after it. Otherwise, the debugger will think it is inside the inline function implementation. Obviously, this breaks stepping – instead of the 'if' body, we go on stepping through the inline function.

This commit fixes 'KotlinSteppingTestGenerated.StepOver#testSoInlineLibFun' test.
2020-02-14 17:35:17 +09:00
Yan Zhulanow
f115bde682 Debugger, BE: Provide Java-like stepping for 'for' loops
- Visit '}' instead of 'for' keyword on post-condition
- Visit 'for' keyword on pre-condition
2020-02-14 17:35:17 +09:00
Yan Zhulanow
8b17718086 Debugger, BE: Make the NOP instruction optimizer save the first NOP, not the last
This commit fixes the following tests:
 - KotlinSteppingTestGenerated.StepOver#testSoInlineLibFun
 - KotlinSteppingTestGenerated.StepOver#testSoInlineIterableFun
 - KotlinSteppingTestGenerated.StepOver#testSoInlineFunOnOneLineFor
2020-02-14 17:35:17 +09:00
Yan Zhulanow
9cba72d5dd Debugger: Remove flaky sleep-based stepping tests 2020-02-14 17:35:17 +09:00
Yan Zhulanow
01a6e7abf3 Debugger, eval4j: Remove eager class loading in findField() (KT-35354) 2020-02-14 17:35:17 +09:00
Yan Zhulanow
8f29f8bc9d Debugger: Rewrite step over action (KT-14296)
The main goal is to make behavior similar to what happens in Java. For instance, now we always skip lambdas.
Also, we can reliably use '$i$f' and '$i$a' synthetic local variables. There is no need in complicated hacks any more.
2020-02-14 17:35:17 +09:00
Yan Zhulanow
b7449c2d6e Debugger, minor: Move Action to its own file, rename to KotlinStepAction 2020-02-14 17:35:17 +09:00
Yan Zhulanow
dd4a8d01c9 Debugger: Remove obsolete hacks needed for old Android dex 2020-02-14 17:35:16 +09:00
Yan Zhulanow
dd743f05c1 Debugger: Remove/change tests for the deprecated Android dex 2020-02-14 17:35:16 +09:00
Yan Zhulanow
f912602ddc Debugger, minor: Move KotlinSourcePosition to top level 2020-02-14 17:35:16 +09:00
Yan Zhulanow
2df646e273 Debugger, minor: Remove unneeded nullability dance 2020-02-14 17:35:16 +09:00
Yan Zhulanow
1a3553cdb7 Debugger: Simplify method filters, use smart pointer in KotlinLambdaMethodFilter 2020-02-14 17:35:16 +09:00
Yan Zhulanow
c6262b5ff2 Debugger, minor: Fix element equivalence check in basic step filter 2020-02-14 17:35:16 +09:00
Yan Zhulanow
fc09534464 Debugger, minor: move step filters to the 'filter' package 2020-02-14 17:35:16 +09:00
Yan Zhulanow
d53c554c8c Debugger, minor: Add missing 'const' modifier 2020-02-14 17:35:16 +09:00
Yan Zhulanow
6d606e5291 Debugger, minor: Move createStepOverCommandWithCustomFilter() to DebuggerSteppingFilter 2020-02-14 17:35:16 +09:00
Yan Zhulanow
26371ea023 Debugger, minor: Update getActiveFilters() implementation, use prepend() 2020-02-14 17:35:16 +09:00
Yan Zhulanow
c196ce5f09 Pill: Pack embedded dependencies to artifacts 2020-02-14 17:35:16 +09:00
Yan Zhulanow
a2be789d37 Pill: Move out Pill tasks from buildSrc 2020-02-14 17:35:16 +09:00
Yan Zhulanow
6f1b3e0f17 Pill: Fix pre-built run configurations 2020-02-14 17:35:15 +09:00
Yan Zhulanow
73813aef23 Pill: Support all Gradle source sets, not just main/test 2020-02-14 17:35:15 +09:00
nataliya.valtman
3acf7a4679 TCServiceMessageOutputStreamHandlerTest: fix tests
Fix test to support updates in ServiceMessageParser and attributes
remove TCServiceMessageOutputStreamHandlerTest from ignored tests
2020-02-14 11:14:17 +03:00
Dmitriy Novozhilov
389dcff125 [FIR] Discard argument with spread in place of non-vararg parameter 2020-02-14 09:18:54 +03:00
Dmitriy Novozhilov
50ac8eb95b [FIR] Add smartcast info to argument of invoke of function with receiver 2020-02-14 09:18:54 +03:00
Dmitriy Novozhilov
4fbed9b363 [FIR] Add builder for FirExpressionWithSmartcast 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
1da036ac98 [FIR-TEST] Split outdated dfa test to separate tests 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
1dd7417746 [FIR] Fix configuring label name for lambdas in light tree builder 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
6b378cab29 [FIR] Don't render lambda bodies in arguments of calls in cfg dump 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
28c95b1108 [FIR] Don't use psi for rendering control flow graph 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
a4b53b4a20 [FIR] Fix passing flow from contracts with form returns(false) ... 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
643a4b9c3b [FIR] Support makeDefinitelyNotNull for intersection types 2020-02-14 09:18:53 +03:00
Dmitriy Novozhilov
b71e4ebb3f [FIR-TEST] Add !DUMP_CFG directive. Get rid of cfg diagnostic tests 2020-02-14 09:18:52 +03:00
Dmitriy Novozhilov
f495c4e215 [FIR-TEST] Move stdlib resolve tests out from resolve directory 2020-02-14 09:18:52 +03:00
Dmitriy Novozhilov
90021f3ece [FIR-TEST] Reorganize tests for data flow analysis 2020-02-14 09:18:52 +03:00
Dmitriy Novozhilov
89fa3572ec [FIR-TEST] Move tests for solved issues from problems directory 2020-02-14 09:18:52 +03:00
Toshiaki Kameyama
0c9720f20c ReplaceGetOrSetInspection: do not report for 'get' with spread operator
#KT-36171 Fixed
2020-02-14 08:47:10 +03:00
Mark Punzalan
b782e8f0f0 Add IR equivalent of AbstractBytecodeListingTest and muted failures. 2020-02-13 23:44:53 +03:00
Mark Punzalan
06b6477d04 [JVM IR] Do not add nullability annotation for functions that return
platform types.

This behavior matches the non-IR backend, which was added in
f16dcdd8a9.
2020-02-13 23:44:53 +03:00
Dmitry Petrov
0c984c5e62 PSI2IR tests for b29993739e85dbceb02d04a964741b1410a568f8 2020-02-13 23:43:04 +03:00
Jinseong Jeon
5a49ccac76 JVM_IR: Relax bailout condition for SAM conversion generation.
Previously, resolved call is expected to have SAM converted argument map
if SamConversionPerArgument is enabled. However, if SAM argument is
followed by vararg parameter and an array _without_ a spread operator is
passed, New Inference left a type mismatch error on a resolved call, which
made that resolved candidate filtered out. Instead, another resolution
result wihtout SAM converted arugment map will be provided.

All other logics, such as adding SAM conversion type op and lowering SAM
conversion and/or call references, are already there for resolved calls
without SAM converted argument map. This change just relaxes the bailout
condition so that array passed to vararg after SAM argument can be
handled in JVM IR.
2020-02-13 23:43:03 +03:00
Kristoffer Andersen
f782ea075b [JVM IR] ProperVisibilityForCompanionObjectInstanceField
- Uncomment tests
- Add proper visibility to companion field
  + Make exception for interfaces -> they need to respect language versions 1.8
    before they can put private members there.
- Adjust synthetic accessor lowering to look for enclosing classes with access
  via companion object.
2020-02-13 21:50:48 +03:00
Igor Yakovlev
a67d97bdf8 Remove redundant fake facade classes
Fixed #KT-35122 #EA-218642 #EA-217640
2020-02-13 19:08:54 +03:00
Pavel Kirpichenkov
5d6d287faa [NI] Refactor UnstableSmartCast diagnostic
Split diagnostic classes for unstable smartcast with different resolution applicability.

^KT-36264 Fixed
2020-02-13 18:02:38 +03:00
Pavel Kirpichenkov
15d744c3da [NI] Continue resolution after unstable smart cast on receiver
The old inference cosideres candidates with unstable smartcast on
receiver unsuccessful, therefore another one may be selected.
KT-36264
2020-02-13 18:02:38 +03:00
Pavel Kirpichenkov
4997c9535c Mute test, affected by changes in unstable smart casts
Revealed by changes in e02b7b58, but they are not the source of a bug
See KT-36459
2020-02-13 18:02:37 +03:00
Pavel Kirpichenkov
e40ba73950 [NI] Add resolution applicability for resolved candidates with error
New resolution applicability is needed in cases when error is found,
but candidate still should be selected. Currently there are two cases,
when this behaviour is required:
- unstable smartcast (choose candidate with non-nullable parameter)
- unknown lambda parameter type (against non-functional expected type)

KT-36264
2020-02-13 18:02:37 +03:00
Ilya Goncharov
4fa87d2caa [Gradle, JS] Compilations with js type because of compatibility
- In kotlinx.html there is invocation of packageJson function on compilations["main"]
It can be casted in user script to KotlinJsCompilation, or override on plugin side
2020-02-13 17:49:46 +03:00
Steven Schäfer
76f8109ff6 JVM IR: Implement LookupLocation in IrSourceCompilerForInline
This is used when compiling calls to inline functions with a different
@JvmName for incremental compilation.
2020-02-13 14:46:35 +01:00
Alexander Udalov
3278451b07 JVM IR: do not generate certain special bridges as final
Special bridges which are generated as a replacement for a non-final
fake override and use invokespecial to call the already existing
implementation in the superclass, should not be final. Otherwise we
can't generate an override for the original Kotlin function in a
subclass with the same JVM signature.
2020-02-13 14:34:18 +01:00
Pavel Kirpichenkov
df046683cc Revert "[NI] Report unsafe implicit invoke accordingly to OI"
This reverts commit b045adf83a.
2020-02-13 16:06:40 +03:00
Nicolay Mitropolsky
bf9d4f065b Uast: eliminating the kotlin.uast.multiresolve.enabled, it is always true for a long time 2020-02-13 15:54:48 +03:00
Nicolay Mitropolsky
e4b7c39110 Uast: forcing kotlin.uast.force.uinjectionhost=true always 2020-02-13 15:54:48 +03:00
Mikhail Zarechenskiy
ee48580e06 [NI] Update test data 2020-02-13 15:01:39 +03:00
Ilya Kirillov
531a63bd19 Show experimental features panel only for non-stable plugin versions
Also, use registry as backend for features settings
2020-02-13 14:59:42 +03:00
Pavel Kirpichenkov
b045adf83a [NI] Report unsafe implicit invoke accordingly to OI
There are several issues with unsafe desugaring for convention calls.
Proper fix is not implemented here (see design proposal KT-30872).
This commit only applies the old logic in the new inference.
^KT-30695 Fixed
2020-02-13 14:49:43 +03:00
Vladimir Dolzhenko
9d51180202 Guard resolve calls with runWithCancellationCheck
Relates to #KT-35135
2020-02-13 12:47:58 +01:00
Mikhail Zarechenskiy
74becc7e96 Fix compilation of idea module for old inference
Also, fix code in a way so it'll compile in NI & -progressive too
2020-02-13 14:46:02 +03:00
Vladimir Dolzhenko
918895b88f Avoid using quite new ScratchFileService API
Relates to #KT-35918
2020-02-13 12:10:27 +01:00
Vladimir Dolzhenko
aa0c2486c3 Fix GenerateTests after performance tests modularization 2020-02-13 12:06:18 +01:00
Ilya Chernikov
b96109f23f Add diagnostic code to the ScriptDiagnostic
to allow checking for specific errors, e.g. incomplete statements in
the REPL
2020-02-13 11:33:40 +01:00
Ilya Chernikov
77eacae958 [minor] drop unused dependencies 2020-02-13 11:33:40 +01:00
Ilya Chernikov
49d092cae8 [minor] add incomplete test to the repl tests 2020-02-13 11:33:40 +01:00
Ilya Chernikov
0761a17e2f Fix embedding and relocation in main-kts
The relocation root different from the one in embeddable compiler
lead to "linking" errors for classes included in both jars, e.g.
Disposable. Reuse common root to avoid it.
2020-02-13 11:33:40 +01:00
Ilya Chernikov
514282fb0a Use correct platform classloader on script evaluation in cli compiler
#KT-28475 fixed
also minor testing infrastruct refactoring
2020-02-13 11:33:40 +01:00
Mikhail Zarechenskiy
489c4ec5ec Fix "progressive" warnings to fix compilation under progressive mode 2020-02-13 13:26:11 +03:00
Mikhail Zarechenskiy
3d28945ecb [NI] Disable feature explicitly as it's required in test 2020-02-13 12:08:10 +03:00
Mikhail Zarechenskiy
7526162f6f Mute one inline codegen test for NI
#KT-36448
2020-02-13 11:54:08 +03:00
Mikhail Zarechenskiy
3702d31cbc Set latest stable version for diagnostic tests with unsigned types 2020-02-13 11:54:08 +03:00
Dmitry Petrov
866f188120 Report JVM signature clashes from JVM_IR
Also:

* Do not rename public ABI fields
This includes backing fields for const, lateinit, @JvmField properties,
and instance fields for objects.

* FAKE_OVERRIDE declarations for static members of parent Java classes
Required to report cases when a Kotlin function accidentally overrides
Java class member.
2020-02-13 11:35:48 +03:00
Mikhail Zarechenskiy
c1db9b6d40 [NI] Fix incremental compilation for SAM adapters
This commit fixes test:
 - JavaUsedInKotlin.SamConversions#testMethodAddedSamAdapter
2020-02-13 11:16:00 +03:00
Mikhail Zarechenskiy
1ba0870ae3 [NI-MIGRATE] Update IR text tests 2020-02-13 11:16:00 +03:00
Mikhail Zarechenskiy
abc5eb4740 [NI-MIGRATE-BAD] Update problematic/questionable tests
These tests are going to be reviewed in more detail before 1.4
2020-02-13 11:15:59 +03:00
Mikhail Zarechenskiy
c2fc633ad6 [NI-MIGRATE] Update test about signature enhancements
It's required as now there are no synthetic candidates
2020-02-13 11:15:59 +03:00
Mikhail Zarechenskiy
319a38bd5c [NI-MIGRATE] Update diagnostic messages 2020-02-13 11:15:59 +03:00
Mikhail Zarechenskiy
cd0012c527 [NI-MIGRATE] Update CLI tests 2020-02-13 11:15:59 +03:00
Mikhail Zarechenskiy
ca57d6cd16 [NI-MIGRATE] Update pseudocode tests for NI 2020-02-13 11:15:58 +03:00
Mikhail Zarechenskiy
a0071885bf [NI-MIGRATE] Update type binding tests for NI 2020-02-13 11:15:58 +03:00
Mikhail Zarechenskiy
687c96060f [NI-MIGRATE] Update test data for resolve tests after enabling NI 2020-02-13 11:15:58 +03:00
Mikhail Zarechenskiy
17df92e999 Fix case in stdlib where more specific type lead to error
See #KT-30299 & #KT-32125
2020-02-13 11:15:57 +03:00
Mikhail Zarechenskiy
599ff4711e Temporary fix code before proper support of UnsafeVariance in NI
See #KT-34433
2020-02-13 11:15:57 +03:00
Mikhail Zarechenskiy
c64577b735 Temporary fixes for Kotlin project after enabling NI
Most of these fixes will gone away after compiler bootstraping
2020-02-13 11:15:57 +03:00
Mikhail Zarechenskiy
cdf5323f8c Disable NewInference for stdlib tests
There is one failing test namely `ValByMapExtensionsTest.doTest`, which
 is quite questionable because its checks the use of out projection and
 Exact annotation (see KT-18789)
2020-02-13 11:15:56 +03:00
Mikhail Zarechenskiy
2a4caf6dc8 Enable new inference in the compiler 2020-02-13 10:22:42 +03:00
Dmitry Gridin
8da05ed597 RemoveReturnLabelFix: introduce labelName parameter 2020-02-13 13:51:34 +07:00
Dmitry Gridin
7c65bb2e3f AbstractDiagnosticBasedMigrationInspection: cleanup code 2020-02-13 13:51:34 +07:00
Dmitry Gridin
b98bdca849 RemoveAnnotationFix: inline default argument 2020-02-13 13:51:34 +07:00
Dmitry Gridin
f8a21340d0 ProhibitRepeatedUseSiteTargetAnnotationsMigrationInspection: add test
#KT-36257
2020-02-13 13:51:33 +07:00
Dmitry Gridin
09e6ffdb0a AbstractDiagnosticBasedMigrationInspection: make lazy initialization 2020-02-13 13:51:33 +07:00
Valentin Kipyatkov
cfc2c0fb20 Changes after rebasing on master 2020-02-13 07:40:37 +02:00
Valentin Kipyatkov
4f5d121478 Minor code improvements 2020-02-13 07:40:37 +02:00
Valentin Kipyatkov
e7c72637a1 Removed misleading comments from test data 2020-02-13 07:40:37 +02:00
Valentin Kipyatkov
ae578e0a5d Copyright comments 2020-02-13 07:40:37 +02:00
Valentin Kipyatkov
ee6d6adf70 processAllExactUsages() only for KtDeclaration 2020-02-13 07:40:36 +02:00
Valentin Kipyatkov
c33a4c5c5b Code formatting 2020-02-13 07:40:36 +02:00
Valentin Kipyatkov
3ccb8fa3a8 Workaround for compiler crash 2020-02-13 07:40:36 +02:00
Valentin Kipyatkov
e71bd4e4a4 No need to intersect with element's useScope - it's performed by reference search by default 2020-02-13 07:40:36 +02:00
Valentin Kipyatkov
f43626f57f Refactoring 2020-02-13 07:40:36 +02:00
Valentin Kipyatkov
826c5dd92e Minor 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
3897f51f8e Refactoring code 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
f60d24c621 Refactoring 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
1b5b0d2839 Minor refactoring 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
af32cad1ae Minor 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
fd7331bbc0 Refactoring 2020-02-13 07:40:35 +02:00
Valentin Kipyatkov
8008185b77 Renamed mistyping in function name 2020-02-13 07:40:34 +02:00
Valentin Kipyatkov
8f7648c60a Reordered methods 2020-02-13 07:40:34 +02:00
Valentin Kipyatkov
ff39880677 Refactoring - converting extensions to normal functions 2020-02-13 07:40:34 +02:00
Valentin Kipyatkov
b1cd56ba91 We must check super property usages also when analyzing inflow 2020-02-13 07:40:34 +02:00
Valentin Kipyatkov
612fd6d1bf Refactoring to split big file 2020-02-13 07:40:34 +02:00
Valentin Kipyatkov
ff516cac73 Do not include overriders when analyzing parameter usages unless invoked on parameter 2020-02-13 07:40:33 +02:00
Valentin Kipyatkov
e76eaa4b5b Refactored code to avoid duplication 2020-02-13 07:40:33 +02:00
Valentin Kipyatkov
b406d85ca3 Analyze Data Flow to Here: Java super-methods supported 2020-02-13 07:40:33 +02:00
Valentin Kipyatkov
cfa1d91aa4 Analyze Data Flow to Here to work with virtual methods 2020-02-13 07:40:33 +02:00
Valentin Kipyatkov
c34286a327 More usable rendering of usage context in Analyze Data Flow to/from Here 2020-02-13 07:40:32 +02:00
Abduqodiri Qurbonzoda
ed7b8e9b85 Scan functions for Sequences and Iterable #KT-7657 2020-02-13 04:01:47 +03:00
Vladimir Dolzhenko
0d7e641736 Extra dependencies after performance tests modularization 2020-02-12 22:37:25 +01:00
Mark Punzalan
89cf32eccc Clarify comments about KT-36625 that it is pending design decision. 2020-02-12 23:38:12 +03:00
Mark Punzalan
ba606147c9 [JVM IR] Maintain KT-36625 bug compatibility between non-IR and IR
backends by removing IMPLICIT_NOTNULL casts from IrStringConcatenation
arguments.

Also fixed an issue where IrStringConcatenation can be lowered into
a null String instead of a literal "null" String if the lone argument
was a platform type String or String with enhanced nullability and the
value was null (e.g., "${FromJava.nullPlatformString()}").
2020-02-12 22:57:15 +03:00
Vladimir Dolzhenko
18a3d7ee08 Moved extra files after performance tests modularization 2020-02-12 20:56:19 +01:00
Vladimir Dolzhenko
60f17c3adf Modularization of performance tests 2020-02-12 20:06:01 +01:00
Pavel Kirpichenkov
572dee6835 Revert "Only create descriptors for candidates with lambda args"
This reverts commits:
349d07ad43
2249c223fe

Revert due to differences in test data with NI enabled
^KT-36247 Open
2020-02-12 20:52:30 +03:00
Anton Bannykh
52ae63f191 IR: decommonize AbstractSuspendFunctionsLowering.kt
Some issues emerged while building kotlinx.coroutines
Reverted changes to the common lowering.

TODO: fix after M1
2020-02-12 20:19:10 +03:00
Alexander Udalov
d5987fd7f3 Minor, move wrongAnnotationArgumentInCtor.kt to CLI tests
The fact that this was a codegen box test was probably an abuse of the
testing infrastructure. It was never meant to pass, since it checks
presence of an error, and diagnostic tests aren't enough since they
might not check the full compiler execution.
2020-02-12 17:36:08 +01:00
Alexander Udalov
9c9e13d93e Minor, move obsolete test to oldLanguageVersions
Ignore this directory in JVM IR boxAgainstJava tests (similarly to box
tests) so that we can ignore the fact that this test doesn't pass in
JVM_IR, since it shouldn't.
2020-02-12 17:36:08 +01:00
Alexander Udalov
0df455cb52 Minor, remove duplicate test
There's already a test that checks exactly this behavior at
box/oldLanguageVersions/platformTypes/primitives/equalsNull_lv11.kt.
2020-02-12 17:36:08 +01:00
Sergey Igushkin
c28d8c6575 Don't iterate over all tasks in KotlinProjectNpmResolver (KT-36472)
Iterating over all tasks triggered the tasks to configure even if that
was not necessary. Filter the task collection by type instead.

Issue #KT-36472 Fixed
2020-02-12 19:04:06 +03:00
Igor Yakovlev
9e05c702ab Fix KtDotQualifiedExpressionElementType stub building for complex qualified elements
Fixed #EA212081
2020-02-12 18:59:35 +03:00
Abduqodiri Qurbonzoda
ddcc3b39f7 JS Regex.find does not throw on invalid start index #KT-36082 2020-02-12 18:26:50 +03:00
Abduqodiri Qurbonzoda
c592201a43 Fail fast in Regex.findAll on an invalid startIndex #KT-28356 2020-02-12 18:26:49 +03:00
Pavel Kirpichenkov
95a8060946 [NI] Don't report uninferred type parameter error on special functions
Type parameters can't be specified explicitly for special constructions.
Reporting this error does not help fixing the cause of it and needlessly
reveals implementation details.

^KT-36342 Fixed
2020-02-12 17:33:42 +03:00
Ilya Goncharov
fd0c644b6f [Gradle, JS] Fix order of free compiler args assigning 2020-02-12 17:29:36 +03:00
Ilya Goncharov
cd8af5d3ec [Gradle, JS] Configure build for nodejs in ir 2020-02-12 17:29:36 +03:00
Ilya Goncharov
a1497682ed [Gradle, JS] Remove depending of link tasks on assemble 2020-02-12 17:29:36 +03:00
Ilya Goncharov
db86076864 [Gradle, JS] Remove redundant dependsOn
- in CopySpec if task in from, dependsOn is automatically set
2020-02-12 17:29:36 +03:00
Ilya Goncharov
752d676523 [Gradle, JS] Fix tests for VariantAwareDependenciesIT.kt 2020-02-12 17:29:35 +03:00
Ilya Goncharov
589cea557b [Gradle, JS] Fix tests after changing default on legacy instead of ir 2020-02-12 17:29:35 +03:00
Ilya Goncharov
fc872d5a53 [Gradle, JS] Fix clean output test 2020-02-12 17:29:35 +03:00
Ilya Goncharov
e53fd1b582 [Gradle, JS] Distribution and distribute task for KotlinBrowserJsIr.kt 2020-02-12 17:29:35 +03:00
Ilya Goncharov
bbb98f9168 [Gradle, JS] Change default on legacy instead of ir 2020-02-12 17:29:35 +03:00
Ilya Goncharov
a33affc325 [Gradle, JS] Fix android tests
- Can't write npm project to task data because 2 reasons:
-- May be not npm project (if not declared nodejs or browser)
-- In Android there is clash of clean tasks on creating NPM project
2020-02-12 17:29:35 +03:00
Ilya Goncharov
016dd91e37 [Gradle, JS] Fix destination dir for link tasks
- Add test on empty output with empty inputs
2020-02-12 17:29:35 +03:00
Ilya Goncharov
24d229e5a0 [Gradle, JS] Make entryModule internally 2020-02-12 17:29:35 +03:00
Ilya Goncharov
5aed541d9e [Gradle, JS] Remove redundant 2020-02-12 17:29:35 +03:00
Ilya Goncharov
333bb4da50 [Gradle, JS] Remove redundant delegation 2020-02-12 17:29:34 +03:00
Ilya Goncharov
196907b2ef [Gradle, JS] Compatibility with lower than 4.9 2020-02-12 17:29:34 +03:00
Ilya Goncharov
0129b71cfe [Gradle, JS] Link task is part of assemble 2020-02-12 17:29:34 +03:00
Ilya Goncharov
347f52ae10 [Gradle, JS] Fix tests for both mode 2020-02-12 17:29:34 +03:00
Ilya Goncharov
c8be2876bc [Gradle, JS] Remove redundant compiler flags and make them internal 2020-02-12 17:29:34 +03:00
Ilya Goncharov
bdf76f9264 fixup! [Gradle, JS] Fix review remarks
- setup compiler args in appropriate fun
- remove redundant
2020-02-12 17:29:34 +03:00
Ilya Goncharov
29a55fc47e [Gradle, JS] Remove redundant testTasks 2020-02-12 17:29:34 +03:00
Ilya Goncharov
300fd9bd07 [Gradle, JS] Extract archiveType property on Configurator level 2020-02-12 17:29:34 +03:00
Ilya Goncharov
cedfb71a1e [Gradle, JS] Task configuration avoidance with providers 2020-02-12 17:29:33 +03:00
Ilya Goncharov
05b48bbf85 [Gradle, JS] Fix names for js compiler property 2020-02-12 17:29:33 +03:00
Ilya Goncharov
d44aef3f3d [Gradle, JS] Check existence of input file before run and test
#KT-36326 fixed
2020-02-12 17:29:33 +03:00
Ilya Goncharov
bcd2707fe6 [Gradle, JS] Fix naming from jsMode to jsCompilerType 2020-02-12 17:29:33 +03:00
Ilya Goncharov
b30328a766 [Gradle, JS] Fix capilatiozation for gradle attributes 2020-02-12 17:29:33 +03:00
Ilya Goncharov
54e068dee2 [Gradle, JS] Attribute and compiler type is on one enum 2020-02-12 17:29:33 +03:00
Ilya Goncharov
d86384225e [Gradle, JS] Rename of property for control compiler type 2020-02-12 17:29:33 +03:00
Ilya Goncharov
8de4966e53 [Gradle, JS] Fix name of workers file 2020-02-12 17:29:33 +03:00
Ilya Goncharov
f342508a6e [Gradle, JS] Fix ambiguity with target name 2020-02-12 17:29:32 +03:00
Ilya Goncharov
6793fb285e [Gradle, JS] Prepare for review 2020-02-12 17:29:32 +03:00
Ilya Goncharov
85919ed0fc [Gradle, JS] Fix manifest destination 2020-02-12 17:29:32 +03:00
Ilya Goncharov
433053e479 [Gradle, JS] Fix manifest destination 2020-02-12 17:29:32 +03:00
Ilya Goncharov
a4ed71075d [Gradle, JS] Fix test for lib and app 2020-02-12 17:29:32 +03:00
Ilya Goncharov
43903e5d19 [Gradle, JS] Fix test incremental compilation (only for legacy) 2020-02-12 17:29:32 +03:00
Ilya Goncharov
c6935a57a4 [Gradle, JS] Fix test for old kotlin2js plugin 2020-02-12 17:29:32 +03:00
Ilya Goncharov
d69266de50 [Gradle, JS] Fix parallel tasks test 2020-02-12 17:29:32 +03:00
Ilya Goncharov
5ff07baf53 [Gradle, JS] Fix parallel tasks test 2020-02-12 17:29:31 +03:00
Ilya Goncharov
40f5663a57 [Gradle, JS] Fix associated compilations test and adopt to js ir 2020-02-12 17:29:31 +03:00
Ilya Goncharov
6698dc7597 [Gradle, JS] new-mpp-with-dce is actual only for legacy 2020-02-12 17:29:31 +03:00
Ilya Goncharov
57d2939cf9 [Gradle, JS] Fix lower case of target 2020-02-12 17:29:31 +03:00
Ilya Goncharov
d50f520639 [Gradle, JS] Fix WorkersIT tests 2020-02-12 17:29:31 +03:00
Ilya Goncharov
8646f6a098 [Gradle, JS] Commonization setting of js mode 2020-02-12 17:29:31 +03:00
Ilya Goncharov
e7b981c467 [Gradle, JS] Fix testBrowserDistribution 2020-02-12 17:29:31 +03:00
Ilya Goncharov
99d0fa0d29 [Gradle, JS] Fix newFileProperty for gradle <5.0 2020-02-12 17:29:31 +03:00
Ilya Goncharov
d2261f5491 [Gradle, JS] Fix legacy test
- kotlin2js depends on MPP
2020-02-12 17:29:30 +03:00
Ilya Goncharov
26c27f55b3 [Gradle, JS] Fix test for resolving 2020-02-12 17:29:30 +03:00
Ilya Goncharov
fff5d9a684 [Gradle, JS] Remove redundant disambiguation for ir preset 2020-02-12 17:29:30 +03:00
Ilya Goncharov
c208f038ad [Gradle, JS] Fix gradle <5.1 incompatibility with fileProperty 2020-02-12 17:29:30 +03:00
Ilya Goncharov
24451f62ac [Gradle, JS] Fix gradle <5.1 incompatibility #2 2020-02-12 17:29:30 +03:00
Ilya Goncharov
cd5ed54cd6 [Gradle, JS] Fix gradle <5.1 incompatibility 2020-02-12 17:29:30 +03:00
Ilya Goncharov
df5b86c289 [Gradle, JS] Use include instead of sources for link stage of compiler 2020-02-12 17:29:30 +03:00
Ilya Goncharov
da9080055c [Gradle, JS] Remove sources for link tasks 2020-02-12 17:29:29 +03:00
Ilya Goncharov
247da4984e [Gradle, JS] Fix naming 2020-02-12 17:29:29 +03:00
Ilya Goncharov
ded996aedf [Gradle, JS] Delegates all calls from js target to ir target 2020-02-12 17:29:29 +03:00
Ilya Goncharov
62aa6d01e9 [Gradle, JS] Remove redundant 2020-02-12 17:29:29 +03:00
Ilya Goncharov
406c249d99 [Gradle, JS] Fix mpp generator 2020-02-12 17:29:29 +03:00
Ilya Goncharov
0b06f0a05b [Gradle, JS] Remove redundant classes 2020-02-12 17:29:29 +03:00
Ilya Goncharov
5904591676 [Gradle, JS] Commonize targets with interfaces 2020-02-12 17:29:29 +03:00
Ilya Goncharov
d33521052f [Gradle, JS] In Ir target should configure Ir subtarget 2020-02-12 17:29:28 +03:00
Ilya Goncharov
831757018c [Gradle, JS] Check only once set producing type 2020-02-12 17:29:28 +03:00
Ilya Goncharov
9f3601412b [Gradle, JS] Commonize producing for js targets 2020-02-12 17:29:28 +03:00
Ilya Goncharov
8322d7b007 [Gradle, JS] Move producing dsl from subtarget to target in IR 2020-02-12 17:29:28 +03:00
Ilya Goncharov
7a3b6e2d71 [Gradle, JS] Move producing dsl from subtarget to target 2020-02-12 17:29:28 +03:00
Ilya Goncharov
2680ea6bdd [Gradle, JS] Fix after rebase on master 2020-02-12 17:29:28 +03:00
Ilya Goncharov
a2930b45f6 [Gradle, JS] Fix compilation after rebase 2020-02-12 17:29:28 +03:00
Ilya Goncharov
35c681685b [Gradle, JS] Set only one attribute for ir target
- Because if new library version can be consumed from old plugin, which doesn't know about new attribute
We don't add attribute for legacy variant, and Gradle find necessary variant with less attribute count
2020-02-12 17:29:28 +03:00
Ilya Goncharov
31f8fe0461 [Gradle, JS] Api and runtime variants for legacy and ir 2020-02-12 17:29:27 +03:00
Ilya Goncharov
15a33a8503 [Gradle, JS] Fix naming 2020-02-12 17:29:27 +03:00
Ilya Goncharov
8f8eaa28d5 [Gradle, JS] Add attribute for IR target 2020-02-12 17:29:27 +03:00
Ilya Goncharov
9833e2202e [Gradle, JS] Hack for npm resolving of js mixed mode 2020-02-12 17:29:27 +03:00
Ilya Goncharov
a1e6f566f6 [Gradle, JS] Add disambiguation classifier for MPP 2020-02-12 17:29:27 +03:00
Ilya Goncharov
246fb31786 [Gradle, JS] Add hack for process ir compilations in NPM resolver in mixed 2020-02-12 17:29:27 +03:00
Ilya Goncharov
18fa5266b7 [Gradle, JS] Producing for ir target through legacy target 2020-02-12 17:29:27 +03:00
Ilya Goncharov
21a1e2e89f [Gradle, JS] Add additinal DSL (with KotlinLibrary or Executable) for mixed and legacy 2020-02-12 17:29:26 +03:00
Ilya Goncharov
00572395da [Gradle, JS] Fix naming of produce Js 2020-02-12 17:29:26 +03:00
Ilya Goncharov
808a776efb [Gradle, JS] Default source-set name w/o legacy disambiguation in mixed 2020-02-12 17:29:26 +03:00
Ilya Goncharov
27b9c6ff29 [Gradle, JS] Fix compilation after cherry-pick 2020-02-12 17:29:26 +03:00
Ilya Goncharov
619b922215 [Gradle, JS] Difference through gradle attribute 2020-02-12 17:29:26 +03:00
Ilya Goncharov
4d323d3567 [Gradle, JS] Fix attribute type on type of zip 2020-02-12 17:29:26 +03:00
Ilya Goncharov
b3067d655e [Gradle, JS] Rebase on master 2020-02-12 17:29:26 +03:00
Ilya Goncharov
3731d4b89a [Gradle, JS] Publish with 2 variants 2020-02-12 17:29:26 +03:00
Ilya Goncharov
f15d1ef23e [Gradle, JS] Create not Jar tasks, but Zip tasks, because we can create klibs 2020-02-12 17:29:25 +03:00
Ilya Goncharov
3467230242 [Gradle, JS] Add appendix for archive in case of mixed mode 2020-02-12 17:29:25 +03:00
Ilya Goncharov
f169c8ea24 [Gradle, JS] Flags with producing unzipped klib is by default 2020-02-12 17:29:25 +03:00
Ilya Goncharov
b37c2a05fd [Gradle, JS] Configure ir target in legacy plugin #2 2020-02-12 17:29:25 +03:00
Ilya Goncharov
43ab4ad8e8 [Gradle, JS] Configure ir target in legacy plugin 2020-02-12 17:29:25 +03:00
Ilya Goncharov
04c0b8c07d [Gradle, JS] Inject ir's classes into legacy for mixed mode #2 2020-02-12 17:29:25 +03:00
Ilya Goncharov
fd93654c4f [Gradle, JS] Inject ir's classes into legacy for mixed mode 2020-02-12 17:29:25 +03:00
Ilya Goncharov
e6be134f2a [Gradle, JS] Activate legacy plugin and new plugin via gradle property 2020-02-12 17:29:25 +03:00
Ilya Goncharov
29c2d62e43 [Gradle, JS] Compile fix after rebase 2020-02-12 17:29:24 +03:00
Ilya Goncharov
0c7284de01 [Gradle, JS] Link test task with property of compile task 2020-02-12 17:29:24 +03:00
Ilya Goncharov
dd577e1008 [Gradle, JS] Migrate in KotlinJsIrTest 2020-02-12 17:29:24 +03:00
Ilya Goncharov
bf415704b6 [Gradle, JS] Generalization of Js test frameworks to work with ir 2020-02-12 17:29:24 +03:00
Ilya Goncharov
599215e74a [Gradle, JS] Migrate on properties to link output of compile with consumer 2020-02-12 17:29:24 +03:00
Ilya Goncharov
4bd744f163 [Gradle, JS] Fix run for nodejs with IR backend 2020-02-12 17:29:24 +03:00
Ilya Goncharov
14387332d5 [Gradle, JS] Distribution task depends on processed resources 2020-02-12 17:29:24 +03:00
Ilya Goncharov
9c89859c67 [Gradle, JS] Webpack catch files from js compilations 2020-02-12 17:29:24 +03:00
Ilya Goncharov
d827f9b040 [Gradle, JS] JS compile tasks nit in archives now 2020-02-12 17:29:23 +03:00
Ilya Goncharov
4861b47f9c [Gradle, JS] Enable IR backend for prod and dev tasks 2020-02-12 17:29:23 +03:00
Ilya Goncharov
2e22b8eb9a [Gradle, JS] Register link tasks 2020-02-12 17:29:23 +03:00
Ilya Goncharov
60da60757d [Gradle, JS] Extract KotlinJsLinkTask 2020-02-12 17:29:23 +03:00
Ilya Goncharov
c043fc2272 [Gradle, JS] Prod and dev compile tasks depends on klib compile task 2020-02-12 17:29:23 +03:00
Ilya Goncharov
3ee7e9272b [Gradle, JS] Depends on prod and dev compile tasks 2020-02-12 17:29:23 +03:00
Ilya Goncharov
222c663fac [Gradle, JS] Configure prod and dev compilations 2020-02-12 17:29:23 +03:00
Ilya Goncharov
abf2a9e073 [Gradle, JS] Extract ir compiler flags 2020-02-12 17:29:22 +03:00
Ilya Goncharov
ad321e45dc [Gradle, JS] Create KotlinJsIrCompilationFactory 2020-02-12 17:29:22 +03:00
Ilya Goncharov
5bdf9f6e39 [Gradle, JS] Fix codegen and avoid deprecate 2020-02-12 17:29:22 +03:00
Ilya Goncharov
544a6bf15e [Gradle, JS] Add production and development compilations 2020-02-12 17:29:22 +03:00
Ilya Goncharov
2f4f4dbbd8 [Gradle, JS] Fix deprecation replace with on register task 2020-02-12 17:29:22 +03:00
Ilya Goncharov
d0e2a653f7 [Gradle, JS] Reformat code 2020-02-12 17:29:22 +03:00
Ilya Goncharov
64def2e173 [Gradle, JS] Continue to migrate on ir compiler
- Create own inheritor of KotlinJsCompilation with specific tasks for production and development
- Copy TargetConfigurator for IR purposes
2020-02-12 17:29:22 +03:00
Ilya Goncharov
8b641bf613 [Gradle, JS] Add mpp presets for jsIr 2020-02-12 17:29:22 +03:00
Ilya Goncharov
a20e9ae0ed [Gradle, JS] Extract hack for Native and JS IR compiler
- IR to klib compiler needs all dependencies (including transitive implementations)
- move hack from native to common with extracting to protected fun
2020-02-12 17:29:21 +03:00
Ilya Goncharov
f936a0fc9b [Gradle, JS] NodeJs and browser producing handlers 2020-02-12 17:29:21 +03:00
Ilya Goncharov
2de7051165 [Gradle, JS] Add produceJs 2020-02-12 17:29:21 +03:00
Ilya Goncharov
64c2b4b076 [Gradle, JS] Add callbacks on configuring producing target for JS IR 2020-02-12 17:29:21 +03:00
Ilya Goncharov
e7c6653182 [Gradle, JS] Remove DCE from ir tooling 2020-02-12 17:29:21 +03:00
Ilya Goncharov
6be8a83ff9 [Gradle, JS] Configure compiler args for produceKotlinLibrary in IR 2020-02-12 17:29:21 +03:00
Ilya Goncharov
0ff84eaa63 [Gradle, JS] Copy JS subtargets dsl for IR 2020-02-12 17:29:21 +03:00
Ilya Goncharov
3ac2bae4ce [Gradle, JS] Copy JS plugin for IR 2020-02-12 17:29:21 +03:00
Mikhail Glukhikh
ba770f7b61 FIR2IR: fix type parameter indexes & fix some black-box & FIR2IR tests 2020-02-12 17:02:41 +03:00
Toshiaki Kameyama
3ebad2acec "Constructor has non-null self reference parameter": don't report for vararg parameter
#KT-36160 Fixed
2020-02-12 16:35:26 +03:00
Mikhail Glukhikh
f3f88cae7a FIR: unmute accidentally muted black-box test 2020-02-12 16:30:47 +03:00
Toshiaki Kameyama
6c93217539 Lift assignment out: don't report when expression is used as expression
#KT-36357 Fixed
2020-02-12 16:17:25 +03:00
Toshiaki Kameyama
8baba38099 "To raw string literal" intention: fix false negative with string content starts with newline symbol \n
#KT-36369 Fixed
2020-02-12 16:15:18 +03:00
Denis Zharkov
61d02d9ecb FIR: Unbound FirJavaElementFinder from Kotlin PSI 2020-02-12 16:05:11 +03:00
Denis Zharkov
9c1577092b FIR: Fix SAM conversion for constructor calls 2020-02-12 16:05:11 +03:00
Denis Zharkov
51db272e0e FIR: Clean environment in AbstractFirTypeEnhancementTest 2020-02-12 16:05:11 +03:00
Denis Zharkov
95b4fa4b31 FIR: Support flexible types in getErasedVersionOfFirstUpperBound 2020-02-12 16:05:11 +03:00
Denis Zharkov
42e8017bde FIR: Minor. Refactor calculation of erased upper bound 2020-02-12 16:05:11 +03:00
Denis Zharkov
bc34bc3f96 FIR: Use flexible type for generic parameters bounds
Otherwise star projections may be incorrectly approximated to strictly
nullable types (as in test)
2020-02-12 16:05:11 +03:00
Denis Zharkov
5a2cdfcab4 FIR: Run callable references resolution for synthetic-select calls 2020-02-12 16:05:11 +03:00
Denis Zharkov
003aea2e68 FIR: Consider abbreviation's nullability when expanding types 2020-02-12 16:05:11 +03:00
Alexander Udalov
2bb6e4fd97 Minor, add package to typeOfCapturedStar.kt test
This fixes this test on Android where packages are replaced.
2020-02-12 14:03:22 +01:00
Nikolay Krasko
eca562a006 Add possibility to depend on nightly repository 2020-02-12 14:54:47 +03:00
Natalia Selezneva
95b2a583ae build.gradle.kts: change notification text 2020-02-12 14:21:30 +03:00
Pavel Kirpichenkov
c02dd720dc [NI] Restore missing call checker errors in coroutine inference
Reported diagnostics from the call checkers didn't get to a top-level
trace, if an intermediate wrapping call was a lambda call.
Use of the top-level trace in call completer is a workaround for
the unreliable commit order of common calls' temporary traces.
^KT-33542 Fixed
2020-02-12 12:27:02 +03:00
Mikhail Zarechenskiy
6af8f320f7 Add JS runtime to the failing test 2020-02-12 12:23:13 +03:00
Dmitriy Novozhilov
9408bb84e9 [FIR-TEST] Update testname in testdata 2020-02-12 11:20:40 +03:00
Dmitriy Novozhilov
a7de4a8b4b [FIR-TEST] Update testname in testdata 2020-02-12 11:14:14 +03:00
Mikhail Zarechenskiy
759127df9a Add NI diagnostics for spec tests 2020-02-12 10:37:35 +03:00
Mikhail Zarechenskiy
c58e819a6a Regenerate tests 2020-02-12 10:36:46 +03:00
Mikhail Zarechenskiy
0d310c0fa4 [NI] Support signed-unsigned conversions for K/Native
#KT-34545 Fixed
2020-02-12 10:36:45 +03:00
Mikhail Zarechenskiy
e14e58c121 Update test about conversions, remove irrelevant case 2020-02-12 10:36:44 +03:00
Mikhail Zarechenskiy
1acce46133 [NI] Fix recording info about captured local variables 2020-02-12 10:36:43 +03:00
Mikhail Zarechenskiy
7f6c03c926 [NI] Fix search of effects for substituted descriptors
This fixed *testExactlyOnce* tests for NI
2020-02-12 10:36:42 +03:00
Mikhail Zarechenskiy
7df92cd00b Set isOperator property for dynamic calls by convention 2020-02-12 10:36:41 +03:00
Mikhail Zarechenskiy
a736551c2a Add test checking that fun isn't inherited from base interface 2020-02-12 10:36:40 +03:00
Mikhail Zarechenskiy
45bbdaf73f Add base declaration checker for fun interfaces 2020-02-12 10:36:39 +03:00
Dmitriy Novozhilov
6735cc8937 [FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
2020-02-12 10:17:45 +03:00
Ilya Kirillov
40f907ec2f Fix compilation for 191 & as35 2020-02-11 23:49:30 +03:00
Mikhail Glukhikh
67668d798b FIR2IR: update test data 2020-02-11 23:22:55 +03:00
Mikhail Glukhikh
12c001f491 FIR: unmute two additional black-box tests 2020-02-11 23:14:51 +03:00
Mikhail Glukhikh
76f78d3fde FIR2IR: don't mutate basic FIR for invoke / next calls 2020-02-11 22:50:06 +03:00
Juan Chen
37abdb1732 [FIR2IR] Fix NoSuchMethod for Iterator::next (same issue with invoke) 2020-02-11 22:50:06 +03:00
Juan Chen
8e35545e10 FIR2IR: provide type arguments for class 'this' receiver 2020-02-11 22:50:06 +03:00
Mikhail Glukhikh
df07b77271 FIR2IR: get rid of "creates list under the hood" warnings 2020-02-11 22:50:05 +03:00
Mikhail Glukhikh
fe5dd4dba1 FIR2IR: extract 'declareThisReceiverParameter', rename 'setThisReceiver' 2020-02-11 22:50:05 +03:00
Nikolay Krasko
b75d0eb1a1 201: Restrict 193 and own plugin for 201 2020-02-11 20:28:05 +03:00
Nikolay Krasko
a983b0bf74 201: Additional method getOwnReferences is introduced (bunched) 2020-02-11 20:28:05 +03:00
Nikolay Krasko
c9d97ae555 201: Notification group was rewritten to Kotlin (no sam conversion) 2020-02-11 20:28:05 +03:00
Nikolay Krasko
034243b5e7 201: ExecutionManager.contentManager was rewritten to Kotlin (bunched) 2020-02-11 20:28:05 +03:00
Nikolay Krasko
1cb56ee946 201: Processor<in PsiMethod> used in PsiShortNamesCache 2020-02-11 20:28:04 +03:00
Nikolay Krasko
9f6f8088e3 201: Processors changed for UsageInfo and SliceUsage 2020-02-11 20:28:04 +03:00
Nikolay Krasko
e23f3b54c6 201: New DynamicBundle.LanguageBundleEP.EP_NAME needed for Java
https://github.com/JetBrains/intellij-community/commits/master/platform/core-api/src/com/intellij/DynamicBundle.java
2020-02-11 20:28:04 +03:00
Nikolay Krasko
51244d7b1d 201: Return JavaCoreApplicationEnvironment subclassing (bunched) 2020-02-11 20:28:04 +03:00
Nikolay Krasko
cfd92f252a 201: Update version to 201.4515.24-EAP-SNAPSHOT 2020-02-11 20:28:04 +03:00
Nikolay Krasko
314474c33b 201: uast-tests.jar new dependency (depend on whole idea in tests) 2020-02-11 20:28:04 +03:00
Nikolay Krasko
7a89bd9c90 201: Change of ProblemDescriptorBase.getFixes() return type
15a39d5742
2020-02-11 20:28:04 +03:00
Nikolay Krasko
8cb4a8f5c6 201: Raw Class -> Class<?> (bunched)
f8b7e8b0b5
2020-02-11 20:28:04 +03:00
Nikolay Krasko
890109beb8 201: PsiElementVisitor.visitElement nullability 2020-02-11 20:28:04 +03:00
Nikolay Krasko
98c6efaed9 201: BinaryFileStubBuilders.EP_NAME dropped (bunched) 2020-02-11 20:28:03 +03:00
Nikolay Krasko
2cc4d878a8 201: ProjectManagerEx.forceCloseProject(project, true) - no second parameter 2020-02-11 20:28:03 +03:00
Nikolay Krasko
41ca51cb9e 201: MadTestingUtil.enableAllInspections second parameter was removed 2020-02-11 20:28:03 +03:00
Nikolay Krasko
ae1cfff5d2 201: IdeaTestApplication -> TestApplicationManager in tests 2020-02-11 20:28:03 +03:00
Nikolay Krasko
3eb4d46c3d 201: ExternalProjectsManagerImpl.disableProjectWatcherAutoUpdate removed (bunched) 2020-02-11 20:28:03 +03:00
Nikolay Krasko
10ce3c58e1 201: No PlatformTestCase.myProjectManager anymore (bunched) 2020-02-11 20:28:03 +03:00
Nikolay Krasko
75f05d8329 201: TemplateManagerImpl.setTemplateTesting() parameter removed 2020-02-11 20:28:03 +03:00
Nikolay Krasko
b17a28381b 201: Can't instantiate subclass of Task anymore 2020-02-11 20:28:03 +03:00
Nikolay Krasko
54b1c512c5 201: LookupImpl.focusedDegree renamed 2020-02-11 20:28:03 +03:00
Nikolay Krasko
56d960c65b 201: "testFramework" and "testFramework.core" libs introduced 2020-02-11 20:28:02 +03:00
Nikolay Krasko
641fa1f17c 201: TextEditorWithPreview.java update - no ApiStatus (bunched)
Class should be removed
2020-02-11 20:28:02 +03:00
Nikolay Krasko
10aef79434 201: AbstractProjectResolverExtension.createModule returns nullable 2020-02-11 20:28:02 +03:00
Nikolay Krasko
066d77f396 201: Tool windows - source incompatible change with Kotlin (bunched) 2020-02-11 20:28:02 +03:00
Nikolay Krasko
4afd7c553b 201: AbstractTreeNode generified in ide.projectView package (bunched) 2020-02-11 20:28:02 +03:00
Nikolay Krasko
b425bf9a1b 201: TreeStructureProvider api changed: AbstractTreeNode<Any -> *> 2020-02-11 20:28:02 +03:00
Nikolay Krasko
9261f69dc8 201: MoveDestination.analyzeModuleConflicts variance in parameter changed 2020-02-11 20:28:02 +03:00
Nikolay Krasko
7ea52ebb45 201: Print type explicitly as RefactoringBundle.message() not null 2020-02-11 20:28:02 +03:00
Nikolay Krasko
4bc10f4c4f 201: MoveMultipleElementsViewDescriptor constructor nullability 2020-02-11 20:28:01 +03:00
Nikolay Krasko
2c72f53937 201: AbstractNavBarModelExtension.adjustElement nullability (bunched) 2020-02-11 20:28:01 +03:00
Nikolay Krasko
78385d5f63 201: Update hierarchy to new API (fix bugs introduced by the platform)
193 plugins with old API are affected while being binary compatible.
2020-02-11 20:28:01 +03:00
Nikolay Krasko
5e58a66c58 201: Convert KotlinHierarchyViewTestBase.java because of typealiases 2020-02-11 20:28:01 +03:00
Nikolay Krasko
6bd91ec5b0 201: Rename .java to .kt 2020-02-11 20:28:01 +03:00
Nikolay Krasko
27467e4db7 201: Convert AbstractHierarchyTest.java because of typealiases 2020-02-11 20:28:01 +03:00
Nikolay Krasko
9f6f6838b8 201: Rename .java to .kt 2020-02-11 20:28:01 +03:00
Nikolay Krasko
579dd8f8fe 201: J2K manual 2020-02-11 20:28:01 +03:00
Nikolay Krasko
b92a228fb3 201: Convert KotlinCallHierarchyBrowser and KotlinCallHierarchyBrowser
Need convert to use Kotlin typealias feature.
2020-02-11 20:28:01 +03:00
Nikolay Krasko
b795b38794 201: Rename .java to .kt 2020-02-11 20:28:00 +03:00
Nikolay Krasko
866c33fbde 201: RefactoringHelper.prepareOperation nullability (bunched) 2020-02-11 20:28:00 +03:00
Nikolay Krasko
5440a5e228 201: No BinaryFileStubBuilders.EP_NAME anymore (bunched) 2020-02-11 20:28:00 +03:00
Nikolay Krasko
beb70526a2 201: CoreApplicationEnvironment.registerExtensionPointAndExtensions accepts Path 2020-02-11 20:28:00 +03:00
Nikolay Krasko
cf78058cc2 201: PsiShortNamesCache.getAllClassNames(HashSet<String>) removed 2020-02-11 20:28:00 +03:00
Nikolay Krasko
4668518b2f 201: ContainerUtil.newTroveSet<T>() removed 2020-02-11 20:28:00 +03:00
Nikolay Krasko
9d3d59fccb 201: Remove JpsPersistentHashMap (bunched) 2020-02-11 20:28:00 +03:00
Nikolay Krasko
1ecd1a293d 201: Processor<String> -> Processor<in String> in PsiShortNamesCache 2020-02-11 20:28:00 +03:00
Nikolay Krasko
2a71fe97cf 201: picocontainer.jar is removed 2020-02-11 20:27:59 +03:00
Nikolay Krasko
354d7306dd 201: versions.jar.streamex and versions.jar.gson versions 2020-02-11 20:27:59 +03:00
Nikolay Krasko
162c2f3dc9 201: openapi.jar is removed 2020-02-11 20:27:59 +03:00
Nikolay Krasko
c26e1e9c1a 201: Introduce 201 platform 2020-02-11 20:27:59 +03:00
Nikolay Krasko
0f4fadf104 201: Create bunch 2020-02-11 20:27:59 +03:00
simon.ogorodnik
4a1451ab63 [FIR] Optimize TowerGroup 2020-02-11 19:32:08 +03:00
simon.ogorodnik
d775852781 [FIR] Refactor tower resolver to coroutines 2020-02-11 19:32:07 +03:00
Vyacheslav Gerasimov
695558465d Build: Fix idea sources jar ivy for -EAP-SNAPSHOT versions 2020-02-11 19:09:50 +03:00
Steven Schäfer
6d23e50142 JVM IR: Create non-synthetic multifile parts for -Xmultifile-parts-inherit 2020-02-11 17:01:22 +01:00
Steven Schäfer
9db82bfcc8 JVM IR: Create package private synthetic multi file part classes 2020-02-11 17:01:22 +01:00
Steven Schäfer
6584df3e01 JVM IR: Fix references to const properties in facade classes 2020-02-11 17:01:22 +01:00
simon.ogorodnik
d9883067e6 [FIR] Hide primary constructor parameters from accessors 2020-02-11 18:50:51 +03:00
Vladimir Dolzhenko
a0ed2c8640 Enforce analysis inside top-level property initializer
Relates to #KT-36460
2020-02-11 16:47:10 +01:00
Vyacheslav Gerasimov
bf9e7ad09a Update 193 platform version to 193.6494.35 2020-02-11 18:21:46 +03:00
Steven Schäfer
058b229544 JVM IR: Handle external static declarations in companion objects 2020-02-11 15:53:25 +01:00
Igor Yakovlev
48db96b66d Improved kotlin decompiler range indexes
Fixed #KT-30628
2020-02-11 17:42:12 +03:00
Toshiaki Kameyama
cb1c0344b8 Rename: add test for overridden method renaming in generic class
#KT-26047 Fixed
2020-02-11 17:25:12 +03:00
Toshiaki Kameyama
ff76ba52d8 Inline Function: fix false positive with inner function with 'return'
#KT-34190 Fixed
2020-02-11 16:23:57 +03:00
Juan Chen
04e8cba857 [FIR] fixed overridden symbols of "invoke" in KFunction
IR expects overridden symbols of "invoke" in KFunction to be "invoke"
in the corresponding Function classes.
Before this commit we don't set overriddenSymbol, now we do.
2020-02-11 16:09:21 +03:00
Mikhail Glukhikh
e3721ed406 [FIR] Implement bare type modification with known type arguments 2020-02-11 16:09:21 +03:00
Mikhail Glukhikh
28332933ce [FIR TEST] Add test case about values() priority (static over companion) 2020-02-11 16:09:20 +03:00
Mikhail Glukhikh
dc7621a112 [FIR] Fix Java override ambiguity (Kotlin type parameter VS Java Object) 2020-02-11 16:09:20 +03:00
Toshiaki Kameyama
4b5f3b7a94 Extract property: do not add unnecessary extension receiver
#KT-24615 Fixed
2020-02-11 15:52:47 +03:00
Ilya Kirillov
0fe5694cb7 Do not render redundant Nullable annotations when generating declarations
#KT-36321 fixed
2020-02-11 13:48:58 +03:00
Ilya Kirillov
4df8744b34 Rename by-name parameter usage in function calls when renaming function's parameter
#KT-32999 fixed
2020-02-11 13:48:56 +03:00
Ilya Chernikov
349d07ad43 [minor] Fix testdata after commit "Only create descriptors for candidate"... 2020-02-11 11:20:05 +01:00
Dmitriy Dolovov
a5e9e09755 [Commonizer] Properly detect commonized KLIBs in IDE 2020-02-11 17:14:19 +07:00
Dmitriy Dolovov
51af1c13b1 [Commonizer] Don't use base64 with padding in paths to libraries 2020-02-11 17:14:11 +07:00
Dmitry Gridin
f46fc19fdf ProhibitRepeatedUseSiteTargetAnnotationsMigration: improve name and description
#KT-36477 Fixed
2020-02-11 10:25:46 +07:00
Dmitry Gridin
bcfd089473 AbstractDiagnosticBasedMigrationInspection: fix case with nullable custom factory
#KT-36479 Fixed
2020-02-11 09:58:59 +07:00
Dmitriy Dolovov
b9911d0e0c [Commonizer] Use only if kotlin.native.enableDependencyPropagation=false 2020-02-11 08:51:54 +07:00
Dmitriy Dolovov
f98a4e6715 Minor. Text formatted in commonizer CLI 2020-02-11 08:51:47 +07:00
Dmitriy Dolovov
63b03d29dc [Commonizer] Prevent from running commonizer from Gradle more then once 2020-02-11 08:51:39 +07:00
Dmitriy Dolovov
7cf4395ccd [Commonizer] Integrate commonizer to the Gradle plugin, p.2
Call commonizer CLI via Gradle tool runner.
2020-02-11 08:51:32 +07:00
Dmitriy Dolovov
d7e82bf899 [Commonizer] Integrate commonizer to the Gradle plugin, p.1
Detect when it's really necessary to run commonizer. Resolve Kotlin/Native
platform dependencies. Add dependencies to the proper Gradle configurations.

Note: The most common source sets such as "commonMain" and "commonTest"
should not be used as Native intermediate source sets.
2020-02-11 08:51:24 +07:00
Dmitriy Dolovov
4ccff3f1b1 [Commonizer] Add extendable uniform multi-task CLI 2020-02-11 08:51:15 +07:00
Dmitriy Dolovov
91fce721b3 [Commonizer] Publish artifact for Kotlin embeddable compiler 2020-02-11 08:51:07 +07:00
Dmitriy Dolovov
4027079b41 [Commonizer] Fix dependencies visible in POM file 2020-02-11 08:51:00 +07:00
Dmitriy Dolovov
b711c6d398 Rename :native:kotlin-native-commonizer to :native:kotlin-klib-commonizer 2020-02-11 08:50:50 +07:00
Igor Yakovlev
07863b61d8 Fix UL classes failing tests
UltraLightClassLoadingTestGenerated.testInferringAnonymousObjectTypes
UltraLightClassLoadingTestGenerated.testObjects
2020-02-10 23:35:47 +03:00
Alexander Udalov
dc7b1fbff9 JVM IR: report warning instead of error for language/API version 1.2
This is needed for testing JVM IR on existing projects which for some
reason are still on Kotlin 1.2.
2020-02-10 17:32:18 +01:00
victor.petukhov
b8aacf0786 Fix test data around flexibility after ae39d748e4 2020-02-10 19:23:57 +03:00
Dmitry Gridin
dc2a9cdc81 Add missing inspections for 191, 192 2020-02-10 23:13:50 +07:00
Mikhail Glukhikh
2c918d2787 [FIR TEST] Add example with invoke priority inconsistent with old FE 2020-02-10 18:51:35 +03:00
Mikhail Glukhikh
232efa6303 [FIR] Fix situation with synthetic property in implicit body 2020-02-10 18:51:35 +03:00
Mikhail Glukhikh
d19d52292e [FIR] Use builder to create synthetic properties 2020-02-10 18:51:34 +03:00
Mikhail Glukhikh
9a80850700 [FIR] Fix Kotlin-Java supertype recursion problem 2020-02-10 18:51:34 +03:00
Mikhail Glukhikh
cc0e39ebca [FIR] Support synthetic property setters 2020-02-10 18:51:34 +03:00
Mikhail Glukhikh
a9ba94cf0e [FIR] Use only variable symbol inheritors in processPropertiesByName 2020-02-10 18:51:34 +03:00
Mikhail Glukhikh
a569e29091 [FIR] Make SyntheticPropertySymbol derived from FirAccessorSymbol 2020-02-10 18:51:33 +03:00
Mikhail Glukhikh
a7f9e3ab09 [FIR] Accessor symbol is now a property symbol, not a function symbol 2020-02-10 18:51:33 +03:00
Mikhail Glukhikh
69809fef94 [FIR] Synthetic property symbol is now a property symbol, not a function 2020-02-10 18:51:33 +03:00
Georgy Bronnikov
17e1f081c7 JVM_IR: handle nested function references in InlineCallableReferenceToLambda 2020-02-10 18:47:04 +03:00
Alexander Udalov
15ff74209c JVM IR: do not resolve fake override in InterfaceSuperCallsLowering
This leads to problems after 4dd794c2d2, because the immediate super
function's DefaultImpls and the implementation's DefaultImpls have
differing type parameters.

Looks like resolveFakeOverride was used here (maybe unintentionally) as
a workaround to the problem caused by the incorrect origin check in
isDefinitelyNotDefaultImplsMethod.
2020-02-10 16:08:10 +01:00
Vladimir Dolzhenko
d9cbc459d0 Use PluginManagerCore instead of PluginManager
Relates to #KT-35918
2020-02-10 15:50:37 +01:00
Vladimir Dolzhenko
44cf0a9f72 Don't insert import if deprecation replacement contains stdlib typealias
Fixed #KT-14781
2020-02-10 14:59:40 +01:00
Ilya Chernikov
2249c223fe Only create descriptors for candidates with lambda args
#KT-36247 fixed
2020-02-10 14:21:02 +01:00
Dmitriy Novozhilov
6ed4229359 [FIR] Fix smartcasts on member vals in init blocks 2020-02-10 15:53:57 +03:00
Yan Zhulanow
36a6eedd9c Minor: Update generated tests for KT-34569 2020-02-10 21:25:01 +09:00
Vladimir Dolzhenko
052710db16 Added idea-plugin-performance-tests task 2020-02-10 12:27:38 +01:00
Denis Zharkov
becc9c21f0 FIR: Map raw types properly 2020-02-10 14:11:49 +03:00
Denis Zharkov
b3f9fa22b4 FIR: Fix inference when bound comes from type alias
It's type depth may be computed incorrectly
and relevant constraint is being skipped
2020-02-10 14:11:49 +03:00
Dmitry Gridin
733e596eed Create WarningOnMainUnusedParameterMigrationInspection
#KT-36256 Fixed
2020-02-10 17:04:07 +07:00
Dmitry Gridin
8d48d899d0 Create ProhibitRepeatedUseSiteTargetAnnotationsMigrationInspection
#KT-36257 Fixed
2020-02-10 17:04:07 +07:00
Dmitry Gridin
266a7a67f0 Create ProhibitUseSiteTargetAnnotationsOnSuperTypesMigrationInspection
#KT-36258 Fixed
2020-02-10 17:04:07 +07:00
Dmitry Gridin
181dd432ca RestrictReturnStatementTargetMigrationInspection: add quickfix
#KT-36262 Fixed
2020-02-10 17:04:07 +07:00
Dmitry Gridin
f1bad0c9ae Convert RemoveReturnLabelFix from LocalQuickFix to KotlinQuickFixAction 2020-02-10 17:04:07 +07:00
Dmitry Gridin
e9dc1e07b9 Extract RemoveReturnLabelFix 2020-02-10 17:04:07 +07:00
Dmitry Gridin
311860699e Create RedundantLabelMigrationInspection
#KT-36262
2020-02-10 17:04:06 +07:00
Dmitry Gridin
2441ee80e4 Create RestrictReturnStatementTargetMigrationInspection
#KT-36262
2020-02-10 17:04:06 +07:00
Dmitry Gridin
2f3e3b9c9e Create ProhibitJvmOverloadsOnConstructorsOfAnnotationClassesMigrationInspection
#KT-36260 Fixed
2020-02-10 17:04:06 +07:00
Dmitry Gridin
cbcc76c3ff Create ProhibitTypeParametersForLocalVariablesMigrationInspection
#KT-36261 Fixed
2020-02-10 17:04:06 +07:00
Dmitry Gridin
8c455d9e08 Create AbstractDiagnosticBasedInspection 2020-02-10 17:04:06 +07:00
Victor Petukhov
ae39d748e4 NI: Try to solve constraint system with another flexibility from a type variable if couldn't solve
^KT-36254 Fixed
2020-02-10 12:31:42 +03:00
Dmitriy Novozhilov
b5dd16784a [FIR] Add .gitattributes for correct line endings on windows 2020-02-10 11:58:54 +03:00
Dmitry Petrov
b9357b5486 Fix project build, part 2 2020-02-10 11:49:54 +03:00
Dmitry Petrov
5aa6d1d64b Fix project build 2020-02-10 11:29:03 +03:00
Dmitriy Novozhilov
031a79528a [FIR] Fix compiler error in build.gradle.kts 2020-02-10 11:23:43 +03:00
Dmitriy Novozhilov
55215ba187 [FIR] Fix generation root for FIR tree 2020-02-10 11:20:22 +03:00
Dmitriy Novozhilov
abfd87411d [FIR-TEST] Mute failing tests with java kotlin supertypes cycle 2020-02-10 10:54:05 +03:00
Dmitriy Novozhilov
779ab632da [FIR] Remove modifiable intermediate implementations from tree
All removed except `FirModifiableQualifiedAccess`
2020-02-10 10:54:05 +03:00
Dmitriy Novozhilov
3d671cbbad Fix compiler error in test generator 2020-02-10 10:54:04 +03:00
Dmitriy Novozhilov
5ceb68f19f [FIR-TEST] Update some testdata 2020-02-10 10:54:04 +03:00
Dmitriy Novozhilov
4b6c2f7a65 [FIR] Remove equality by fir from symbols 2020-02-10 10:54:04 +03:00
Dmitriy Novozhilov
c79fd61dba [FIR] Fix usage of typeParameterStack from parent class in java loading 2020-02-10 10:54:03 +03:00
Dmitriy Novozhilov
dd67568cf6 [FIR] Fix recursive annotation deserialization 2020-02-10 10:54:03 +03:00
Dmitriy Novozhilov
d57fa859c8 [FIR] Implement builders for leaf nodes of FIR tree 2020-02-10 10:54:03 +03:00
Dmitriy Novozhilov
b0c1387279 [FIR] Remove legacy annotation @VisitedSupertype 2020-02-09 20:01:43 +03:00
Dmitriy Novozhilov
fcd9ef043c [FIR] Reorganize some utility code of tree generator 2020-02-09 20:01:43 +03:00
Georgy Bronnikov
f7c784adeb JVM_IR: minor code cleanup in JvmStaticAnnotationLowering 2020-02-09 13:23:05 +03:00
Georgy Bronnikov
182e1c1b3b JVM_IR: Remove buggy special case accessor code from JvmStaticAnnotationLowering
General purpose accessors in SyntheticAnnotationLowering are sufficient.
2020-02-09 13:12:33 +03:00
Vladimir Dolzhenko
b451c25dba Fixed MoveJavaInnerClassKotlinUsagesHandler after obsolete API drop off
Relates to #KT-35918
2020-02-09 08:54:44 +01:00
Vladimir Dolzhenko
5b48f63bb9 Added missed runReadAction to access psi on bg thread
Relates to #KT-24122
2020-02-08 15:06:51 +01:00
Vladimir Dolzhenko
ce2d32620a Add JoinWithTrailingCommaHandler to plugin-common.xml 191, 192 2020-02-07 22:21:23 +01:00
Steven Schäfer
304700cf7b JVM IR: Add all relevant overridden symbols to generated bridge methods 2020-02-07 18:44:50 +03:00
Steven Schäfer
951b2fa770 JVM IR: Optimize type checks to null checks if possible 2020-02-07 18:44:50 +03:00
Steven Schäfer
07737f8fc6 JVM IR: Fix BridgeLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer
461d8ef368 Add renaming special bridges to SpecialBridgeMethods 2020-02-07 18:44:50 +03:00
Steven Schäfer
5f6af58aeb JVM IR: (Un)mute tests and add more tests for bridge generation 2020-02-07 18:44:50 +03:00
Steven Schäfer
12e31a1760 JVM IR: Use dispatchReceiver to calculate owner in MethodSignatureMapper 2020-02-07 18:44:50 +03:00
Steven Schäfer
0e243ca295 JVM IR: Fix receiver types in AddContinuationLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer
a4414829bc JVM IR: Fix dispatch receiver type in ResolveInlineCalls 2020-02-07 18:44:50 +03:00
Steven Schäfer
f46ad10266 JVM IR: Fix dispatch receiver type in InheritedDefaultMethodsOnClassesLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer
edd0ac6c6f JVM IR: Fix types of temporaries in AddContinuationLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer
30166b20b7 JVM IR: Fix dispatch receiver types in FunctionNVarargBridgeLowering and ReplaceKFunctionInvokeWithFunctionInvoke 2020-02-07 18:44:50 +03:00
Steven Schäfer
66cbe3b1a8 JVM IR: Remove IrReplacementFunction 2020-02-07 18:44:50 +03:00
Steven Schäfer
73b4f897b6 JVM IR: Fix modalities in JvmSymbols 2020-02-07 18:44:50 +03:00
Vladimir Dolzhenko
cfcdf05c92 Fix documentListener leakage in PluginStartupActivity
Relates to #KT-35918
2020-02-07 16:34:28 +01:00
Pavel Kirpichenkov
fee72839bf Report error if IR is enabled with incorrect language version
^KT-36338 Fixed
2020-02-07 16:10:03 +03:00
Alexander Udalov
feccf9cc1b Remove dependency of fir.tree on ir.tree 2020-02-07 13:02:11 +01:00
Ilya Matveev
10d2eebe28 Gradle, native: Fix running cinterop on Windows hosts 2020-02-07 18:51:07 +07:00
Mark Punzalan
8cdef13537 [JVM IR] Add tests to verify correct parameter reflection metadata for
suspend functions.
2020-02-07 12:24:13 +01:00
pyos
06408011f0 JVM_IR: prefer to move, not copy, suspend lambda bodies
Copying breaks reflection metadata.
2020-02-07 12:16:26 +01:00
pyos
5acb3e14fb IR: mark parameters for captures of crossinline parameters 2020-02-07 12:16:26 +01:00
pyos
2bf50cc91a JVM_IR: correctly name $$forInline versions of @JvmName suspend funs
Using a hack similar to $default stubs.
2020-02-07 12:16:26 +01:00
pyos
08074bb60e JVM_IR: wrap inline suspend references in suspend lambdas 2020-02-07 12:16:26 +01:00
Mikhail Glukhikh
c34d2f9daa [FIR] Fix signature calculation in JvmMappedScope 2020-02-07 13:04:21 +03:00
Mikhail Glukhikh
0c195be513 [FIR TEST] Add test with MutableMap.compute 2020-02-07 13:04:10 +03:00
Mikhail Glukhikh
2fb508aa1b [FIR] Fix DFA behaviour for a case with == (!=) true / false 2020-02-07 13:04:07 +03:00
Mikhail Glukhikh
36ba8bf6a9 [FIR] Add test imitating complex smart casts on descriptors 2020-02-07 13:04:06 +03:00
Mikhail Glukhikh
a8e89a6390 [FIR] Fix various corner cases in DFA 2020-02-07 13:03:43 +03:00
Mikhail Glukhikh
1344d6407c [FIR] DFA fix: imply != null after x as? NotNullType for real variables 2020-02-07 13:03:41 +03:00
Mikhail Glukhikh
1bbcec4935 [FIR] DFA fix after x?.syntheticProperty ?: return 2020-02-07 13:03:41 +03:00
Mikhail Glukhikh
d23c03e9dc [FIR] Add test about synthetic / non-synthetic smart casts 2020-02-07 13:03:40 +03:00
Mikhail Glukhikh
9f9d53cc5a [FIR] Fix handling of scope emptiness in case of synthetic properties 2020-02-07 13:03:40 +03:00
Denis Zharkov
c8c0ba480b FIR: Add problem tests for smart cast within init-section 2020-02-07 12:18:40 +03:00
Dmitry Petrov
3518fcf78c Fix psi2ir tests broken by 7249d2f889 2020-02-07 10:50:56 +03:00
Dmitry Petrov
a1326d3ef5 !RENDER_DIAGNOSTICS_FULL_TEXT directive
Compares diagnostics rendered as text with corresponding .diag.txt file
2020-02-07 10:50:56 +03:00
Dmitry Petrov
4e6c3b6b43 Diagnostics tests with JVM backend 2020-02-07 10:50:56 +03:00
Vladimir Dolzhenko
a17027e330 Fixed incompatibility with 191 and 192
Fixed #KT-35918
2020-02-06 22:49:08 +01:00
Anton Bannykh
5605eb5a31 Review fix: add TODO comments 2020-02-06 21:03:41 +03:00
Anton Bannykh
70a4c265de Add tests extracted from regressions 2020-02-06 21:03:41 +03:00
Anton Bannykh
1e96c3d21e DCE-driven mode
:js:js.tests:jsIrTest works same as before
:js:js.tests:jsPirTest runs tests in DCE-driven mode
2020-02-06 21:03:41 +03:00
Anton Bannykh
571bbba0e3 Change DCE a bit to touch less declarations 2020-02-06 21:03:40 +03:00
Anton Bannykh
f07fb91e9d Simple stage layers + enforce model 2020-02-06 21:03:40 +03:00
Anton Bannykh
f437da8ee5 Persistent IR implementation 2020-02-06 21:03:40 +03:00
Anton Bannykh
4c4b0ef013 Suspend Functions
2 tests muted due to duplicate variables found by the validator
If memory serves:
- there is a `suspend inline fun` and a callable reference to it
- the suspend function doesn't remove the original function in this
  case anymore
- the duplicate `var`'s are inside the function body and the
  callable reference state machine body
2020-02-06 21:03:40 +03:00
Anton Bannykh
94d2a79d2e FoldConstantLowering 2020-02-06 21:03:40 +03:00
Anton Bannykh
0efe2ab00a PropertyAccessorInlineLowering 2020-02-06 21:03:40 +03:00
Anton Bannykh
6e501e5f9b AnnotationConstructorLowering 2020-02-06 21:03:40 +03:00
Anton Bannykh
d76bfdf860 Enums 2020-02-06 21:03:39 +03:00
Anton Bannykh
3165556c6b PrivateMembersLowering 2020-02-06 21:03:39 +03:00
Anton Bannykh
f6d4ea469c PrimaryConstructorLowering 2020-02-06 21:03:39 +03:00
Anton Bannykh
76ff30b86e ObjectLowering 2020-02-06 21:03:39 +03:00
Anton Bannykh
ce625075f6 MoveBodilessDeclarationsToSeparatePlace 2020-02-06 21:03:39 +03:00
Anton Bannykh
09a2c145a9 CallableReferenceLowering 2020-02-06 21:03:39 +03:00
Anton Bannykh
9812291364 BlockDecomposerLowering 2020-02-06 21:03:38 +03:00
Anton Bannykh
e2d16d5096 FunctionInlining 2020-02-06 21:03:38 +03:00
Anton Bannykh
86a4e17dc4 LocalDelegatedProperties 2020-02-06 21:03:38 +03:00
Anton Bannykh
81e599c18f VarargLowering 2020-02-06 21:03:38 +03:00
Anton Bannykh
489ba508c3 TypeOperatorLowering 2020-02-06 21:03:38 +03:00
Anton Bannykh
05ab17f1e1 ThrowableLowering 2020-02-06 21:03:38 +03:00
Anton Bannykh
15b2312cec StaticMembersLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
d9fbe8b951 SecondaryCtorLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
fb36432cb5 PrimitiveCompanionLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
edf6dec63b MultipleCatchesLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
f1442f5ae9 ConstLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
21ef35bc25 ClassReferenceLowering 2020-02-06 21:03:37 +03:00
Anton Bannykh
d9646a5361 BridgesConstruction 2020-02-06 21:03:36 +03:00
Anton Bannykh
4142031fe7 AutoboxingTransformer 2020-02-06 21:03:36 +03:00
Anton Bannykh
38d409a487 Inline function removal + body copying 2020-02-06 21:03:36 +03:00
Anton Bannykh
76c7668162 CallsLowering 2020-02-06 21:03:36 +03:00
Anton Bannykh
64a5039ebe Refactor default arguments lowering 2020-02-06 21:03:36 +03:00
Anton Bannykh
9327776706 Rewrite inner class lowerings 2020-02-06 21:03:36 +03:00
Anton Bannykh
908c23cb48 Make ForLoopsLowering a BodyLoweringPass 2020-02-06 21:03:35 +03:00
Anton Bannykh
0d1c6e08c3 Refactor LateinitLowering into DeclarationTransformer's and a BodyLoweringPass 2020-02-06 21:03:35 +03:00
Anton Bannykh
6e96e271ae Make InitializersLowering a BodyLoweringPass and add a InitializersCleanupLowering 2020-02-06 21:03:35 +03:00
Anton Bannykh
600caaa636 Make ExpectDeclarationsRemoveLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh
d0284d19ec Make PropertiesLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh
03398e6025 Make StripTypeAliasDeclarationsLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh
3d726fe5a2 Make InlineClassDeclarationLowering a DeclarationTransformer 2020-02-06 21:03:34 +03:00
Anton Bannykh
0a5db9d222 Make inlineClassUsageLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh
fe236507a0 Make LocalDeclarationsLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh
1eec2acf43 Make LocalClassPopupLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh
d228de9008 Make ArrayConstructorLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh
bf26b86cf2 Make ProvisionalFunctionExpressionLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh
5aa2deb449 Make ReturnableBlockLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh
2fa04afbf2 Make SharedVariablesLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh
936e53d044 Make TailrecLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh
a42f849981 Change BodyLoweringPass API; add DeclarationTransformer + helper methods 2020-02-06 21:03:33 +03:00
Anton Bannykh
b087d2d756 IR impl: additional constructors for IrBody implementations 2020-02-06 21:03:33 +03:00
Anton Bannykh
20dc3ccdb8 New mechanism for mappings between old and produced declarations 2020-02-06 21:03:33 +03:00
Anton Bannykh
e8fba8bcb6 IR API: change val ... : MutableList to var ...: List for most lists
All mutable state for IR declarations should be either:
- var (mutable properties)
- or class member list

Mutable properties are straightforward to persist.

The class member list is handled in a special way.
2020-02-06 21:03:32 +03:00
Anton Bannykh
0bcde9dffc IR API: Make IrEnumEntry.initializerExpression IrExpressionBody
All non-declarations should be inside IrBody's now
2020-02-06 21:03:32 +03:00
Igor Yakovlev
3ec671d727 Fix getMirror for kotlin decompiled file
Possibly fixed EA142049
2020-02-06 20:24:20 +03:00
Ilya Gorbunov
ab32f2efac Use legacy configuration names to make jps import happy 2020-02-06 19:56:25 +03:00
Dmitry Gridin
f428bbb782 TrailingComma: Join Lines should remove trailing comma
#KT-34744
#KT-36084 Fixed
2020-02-06 23:55:59 +07:00
Dmitry Gridin
cb66625688 TrailingComma: fix case of when without expression or property
#KT-34744
#KT-36393 Fixed
2020-02-06 23:55:59 +07:00
Dmitry Gridin
6739d03823 TrailingCommaPostFormatProcessor: change recursive checker
#KT-34744
2020-02-06 23:55:58 +07:00
Dmitry Gridin
5054bc65a5 Introduce TrailingCommaHelper
#KT-34744
2020-02-06 23:55:58 +07:00
Alexander Udalov
c08c3d4d9b Update JVM metadata version to 1.4.0 2020-02-06 17:22:02 +01:00
Vladimir Dolzhenko
4d93b3d5ab Dropped unused UsageDescriptor
#KT-35918 Comment
2020-02-06 16:42:26 +01:00
Vladimir Dolzhenko
a0c9b275aa Removed deprecated usage of treeBuilder from currentProjectViewPane
It is outdated behaviour as all nested members have to appear as
children of file rather children of its package

#KT-35918 Comment
2020-02-06 16:28:56 +01:00
Vladimir Dolzhenko
617807beea Removed deprecated usage of ScratchFileService.isInScratchRoot
#KT-35918 Comment
2020-02-06 16:28:46 +01:00
Vladimir Dolzhenko
7c8f3b2b3b Use LightJavaModule.getModule instead of deprecated getModule
#KT-35918 Comment
2020-02-06 16:28:36 +01:00
Vladimir Dolzhenko
dd8a120d45 Use JList#getSelectedValuesList() instead of deprecated getSelectedValues()
#KT-35918 Comment
2020-02-06 16:28:26 +01:00
Vladimir Dolzhenko
670e016d34 PluginStartupComponent reworked into startup activity and service
As BaseComponent is deprecated in a platform

#KT-35918 Comment
2020-02-06 16:28:18 +01:00
Vladimir Dolzhenko
df23274aa5 Use Application.addListener(listener, disposable)
#KT-35918 Comment
2020-02-06 16:27:51 +01:00
Vladimir Dolzhenko
45e288be49 Drop deprecated file from @Storage
#KT-35918 Comment
2020-02-06 16:27:42 +01:00
Vladimir Dolzhenko
ff7221e1c4 Cleaned up from deprecated CallerMethodsTreeStructure(PsiMethod)
#KT-35918 Comment
2020-02-06 16:27:31 +01:00
Alexander Podkhalyuzin
13d8603c4b Fixed incompatibility with 192
#KT-35918 Comment
2020-02-06 16:27:19 +01:00
Alexander Podkhalyuzin
2408977a68 Fixed bunch file
#KT-35918 Comment
2020-02-06 16:27:04 +01:00
Alexander Podkhalyuzin
46526ab53c Removed deprecated icons usages
#KT-35918 Comment
2020-02-06 16:26:54 +01:00
Alexander Podkhalyuzin
d880a507dd Removed deprecated usage
#KT-35918 Comment
2020-02-06 16:26:45 +01:00
Alexander Podkhalyuzin
35fa812a19 Removed MethodNodeBase usage
#KT-35918 Comment
2020-02-06 16:26:36 +01:00
Alexander Podkhalyuzin
dd73629db1 Obsolete API usages removed from 193 branch
#KT-35918 Comment
2020-02-06 16:26:28 +01:00
Alexander Podkhalyuzin
312c7bc9bf Proper override in move
#KT-35918 Comment
2020-02-06 16:26:13 +01:00
Alexander Podkhalyuzin
e26dcdf10b Removed unnecessary deprecated method overrides
#KT-35918 Comment
2020-02-06 16:26:04 +01:00
Alexander Podkhalyuzin
4db89f073f Remove outdated icon creation API usage
#KT-35918 Comment
2020-02-06 16:25:56 +01:00
Alexander Podkhalyuzin
0890e6837b Proper check if plugin is disabled
#KT-35918 Comment
2020-02-06 16:25:47 +01:00
Alexander Podkhalyuzin
f3d66dcce8 proper way to distinguish JetBrains annotations
#KT-35918 Comment
2020-02-06 16:25:37 +01:00
Alexander Podkhalyuzin
aee3887604 removed deprecated usage for isAnnotated
#KT-35918 Comment
2020-02-06 16:25:29 +01:00
Alexander Podkhalyuzin
08d5471f51 isSearchForTextOccurencesAvailable usage replaced
#KT-35918 Comment
2020-02-06 16:25:17 +01:00
Alexander Podkhalyuzin
23fa21d37e getUsages -> getMetrics in FUSCollectors
#KT-35918 Comment
2020-02-06 16:25:06 +01:00
Ilmir Usmanov
8bb59e31e0 Minor. Remove textifyMethodNode, since it duplicates nodeText 2020-02-06 13:10:24 +01:00
Ilmir Usmanov
7dfd7b6081 Spill stack before analyzing it when looking for non-inline suspend lambda
parameters of inline function. Otherwise, it leads to AnalyzerException,
when inlined lambda contains try-catch block. The reason is simple:
in try block, we leave some variables on stack, while on catch block the
stack is empty. Spilling the variables before try block does the trick.
 #KT-34708 Fixed
2020-02-06 13:10:21 +01:00
Pavel Kirpichenkov
b7a6fc271c minor: remove unused import 2020-02-06 13:42:44 +03:00
Mikhail Glukhikh
e2a99f84a5 [FIR] Fix test data 2020-02-06 13:40:11 +03:00
Denis Zharkov
286622009d FIR: Cleanup PostponedArguments.kt 2020-02-06 13:00:29 +03:00
Denis Zharkov
6f6281a3f3 FIR: Support type aliases to function types in resolution 2020-02-06 13:00:29 +03:00
Juan Chen
7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
2020-02-06 12:44:14 +03:00
Svyatoslav Scherbina
5eedba3903 Add Native-specific frontend checker for @Throws 2020-02-06 11:00:31 +03:00
Svyatoslav Scherbina
2a4d995fd1 Add infrastructure for Native-specific frontend diagnostic tests 2020-02-06 11:00:28 +03:00
Svyatoslav Scherbina
99ba6b5ae1 Make :compiler:tests-common depend on :native:frontend.native 2020-02-06 11:00:25 +03:00
Svyatoslav Scherbina
e699965ed6 Add infrastructure for Native-specific frontend diagnostics 2020-02-06 11:00:22 +03:00
Svyatoslav Scherbina
1f97ae1084 Make :compiler:cli depend on :native:frontend.native 2020-02-06 11:00:19 +03:00
Svyatoslav Scherbina
cd92d3e9b4 Make :native:frontend.native depend on intellij-core 2020-02-06 11:00:16 +03:00
Dmitriy Dolovov
6d21e0c5e2 Fix: Kotlin/Native compiler tool name in Gradle IT 2020-02-06 14:13:18 +07:00
Dmitriy Dolovov
b8e49cb784 Fix: Kotlin/Native compiler tool name in Gradle root runner 2020-02-06 10:10:22 +07:00
Alexander Udalov
a4cc5ea1da Remove unneeded dependency of backend-common on ir.tree 2020-02-05 22:45:12 +01:00
pyos
18dcbb3c94 JVM_IR: copy annotations to nullary bridges for default constructors 2020-02-05 22:02:05 +01:00
Alexander Udalov
5d766eace4 JVM IR: process type arguments for function references in DefaultImpls
Local functions for lambdas declared in DefaultImpls are now also
getting additional type parameters from the containing class (see
4dd794c2d2), so function references to them should be adapted similarly
to normal calls.

This change fixes
`box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt`.
2020-02-05 21:56:01 +01:00
Alexander Udalov
763cb6dd6f JVM IR: keep original KotlinType in eraseTypeParameters
Otherwise EnhancedNullability annotation instance is lost (for some
reason it's not translated to IR elements), and in the newly added test,
the wrapper type in Java is confused with primitive, and this causes
a platform declaration clash error.

Also make IrTypeArgument.eraseTypeParameters private, since it's not
used outside.
2020-02-05 21:51:33 +01:00
Ilmir Usmanov
1ae0017401 JVM_IR: Minor. Support isFun in WrappedClassDescriptor
Otherwise, compilation of kotlinx-coroutines-core breaks.
2020-02-05 19:17:06 +01:00
Mark Punzalan
bc9edea527 [JVM IR] Fix issue with suspend functions in @JvmMultifileClass. 2020-02-05 19:00:54 +01:00
Sergey Igushkin
764bf1cb32 Add a non-public-API mechanism to import free args for MPP source sets
Arguments can be set using a project extra property following the
pattern: `kotlin.mpp.freeCompilerArgsForSourceSet.$sourceSetName`.

Only a compilation's default source set free args are appended to the
compiler args during Gradle builds.
2020-02-05 20:46:26 +03:00
Sergey Igushkin
a8aa334203 Fix API version parsing: add 1.4 to available values
In Kotlin 1.3, we didn't allow setting language version to 1.4. With
the default language version changed to 1.4, it worked because the
language version had only been checked in the setter of the language
settings, and the default value had not been checked.
2020-02-05 20:46:25 +03:00
Sergey Igushkin
cd32cef2b6 Fix MPP Gradle tests
* Use `maven { setUrl(...) }` in Groovy DSL
* Configure compilation tasks beforehand
  in testMppBuildWithCompilerPlugins
* Prevent `gradleSettingsScript()` from failing
  when no settings script is found
2020-02-05 20:46:24 +03:00
Sergey Igushkin
77f60d6d6c Enable KlibBasedMppIT by default and on all host (using Linux targets) 2020-02-05 20:45:40 +03:00
Sergey Igushkin
5cc8dfb2a3 Compile common code to klib whenever HMPP is enabled
As the HMPP with *.kotlin_metadata was never widespread, we can
immediately move to *.klib compilations whenever a build author
enables HMPP.
2020-02-05 20:45:40 +03:00
Sergey Igushkin
0ef8d23f57 Rework legacy metadata variant in MPP with source sets metadata
* Make publishing the compatibility variant optional, and don't publish
  the compatibility variant by default -- the library maintainer should
  do this explicitly
* To build the compatibility artifact, compile the commonMain source
  set using a separate compilation (the default `main` compilation,
  while creating a separate `commonMain` compilation; this separation
  is needed to be able to still compile *.kotlin_metadata from
  commonMain even when compiling *.klib from all source sets)
* When the compatibility variant is disabled, clear the dependencies of
  the `main` compilation and disable its Kotlin compilation task
* When the compatibility variant is enabled, exposed it for project
  dependencies resolution as well, so that its artifact can be used by
  the dependent project instead of the granular metadata artifact that
  will contain *.klib (which can't be read by the legacy compiler)
* Refactor the configuration of the metadata compilation dependencies:
  concentrate all the logic in one place and make it process the source
  sets graph lazily.
2020-02-05 20:45:39 +03:00
Sergey Igushkin
8a08fef2b3 Export implementation dependencies of Native-shared source sets as API
As the Kotlin/Native compiler always requires transitive dependencies
to be present among the libraries during compilation, it is necessary
to export the implementation dependencies of Native-shared source sets
as if they were API dependencies.

To do that, add the extendsFrom-relationship between the apiElements
configuration of the metadata target (so that Gradle adds the
dependencies to the transitive dependencies graph) and also add the
dependencies to the project structure metadata (so that the consumer
can find out that it's only their corresponding Native-shared source
sets that need these particular transitive dependencies)
2020-02-05 20:45:39 +03:00
Sergey Igushkin
81216ceb51 Use the project name + compilation name for secondary klib compilations
This helps avoid duplicate library names when compiling shared-Native
source sets (the resulting klibs will have a more unique name than just
the source set name which likely repeats between projects)
2020-02-05 20:45:38 +03:00
Pavel Kirpichenkov
2a15df6a20 [IDEA-TESTS] Update configuration tests involving LATEST_STABLE version
Change `LATEST_STABLE` with `VersionView.RELEASED_VERSION`
in tests checking default language configuration options.

Replace `LATEST_STABLE` with fixed version in `testDropKotlincOnVersionAutoAdvance`
as the test actually compares it with version from kotlinc.xml.
It being latest stable is not relevant.

By default the lastest stable Kotlin version is selected for module
when there is no explicit version in configuration. However, it is
the version previous to `LanguageVersion.LATEST_STABLE` during prerelease.
2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov
a5d201e263 Exclude unsupported language versions from gradle options
^KT-36146 Fixed
2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov
f530c0c903 minor: reformat 2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov
87e0186334 Cleanup test checking legacy inline suspend
Move expected library compilation output to file.
^KT-36240 Fixed
2020-02-05 19:34:59 +03:00
Ilmir Usmanov
8335ad7e98 JVM_IR: Minor. Add test 2020-02-05 15:07:55 +01:00
Ilmir Usmanov
5977799c59 JVM_IR: Get rid of non-local related hacks in coroutines inlining 2020-02-05 15:07:49 +01:00
Ilmir Usmanov
e5bd4f74f3 JVM_IR: Do not copy attributes into DEFAULT_IMPLS functions
Otherwise, on creating suspend function views these functions will clash
with interface ones. Instead, compute name of their continuation classes
based on attributes of the interface class.
2020-02-05 15:07:43 +01:00
Ilmir Usmanov
fc70455877 JVM_IR: Move suspend function views creation to lowering
Now AddContinuationLowering is responsible for both adding continuation
classes to suspend functions and adding continuation parameters to
them.
Because we cannot create a view if inline suspend function is defined
in another file, we generate a stub without body when we encounter call
to it. And then, when we lower the file containing the function we add
the body. This way we have no unlowered views after the lowering.
Thus, after the lowering there should be no suspend function, which
are not views, therefore, remove VIEW origins.
Because transformations of suspend functions can copy them into another
object, use attribute as a key inside function to view map.
2020-02-05 15:07:37 +01:00
Alexander Udalov
5e7343624b Update test data of wrongInlineTarget to 1.4 2020-02-05 13:09:53 +01:00
Alexander Udalov
9f9eef44b1 Use captured type approximation from new inference in ExpressionCodegen
This is needed in order to avoid star projections being expanded into
`out Any?`, which is visible for users of `typeOf` since 1.4.

 #KT-30278 Fixed
2020-02-05 13:09:08 +01:00
Toshiaki Kameyama
4d1937b92d "Redundant 'suspend' modifier": do not report when function has 'suspend' calls by parenthesized expression
#KT-24869 Fixed
2020-02-05 14:31:13 +03:00
Roman Golyshev
31315e2c45 Add plugin_version and file_type features for ML completion
- This is required to be able to use ML completion infrastructure to monitor code completion quality (even without ML enhancement)
2020-02-05 12:19:49 +03:00
Mikhail Glukhikh
98ea2231f1 [FIR] Code cleanup: NodeConfigurator 2020-02-05 11:19:25 +03:00
Mikhail Glukhikh
0fa98ed635 [FIR] Discriminate abstract members when resolving on super 2020-02-05 11:19:23 +03:00
Mikhail Glukhikh
8e40782e7b [FIR] Add test with abstract / non-abstract ambiguity 2020-02-05 11:19:22 +03:00
Mikhail Glukhikh
f7d658b624 FIR2IR: fix dispatch receiver generation (non-function case) 2020-02-05 11:19:21 +03:00
Mikhail Glukhikh
b09b2673bf FIR2IR: handle non-ambiguous super references properly 2020-02-05 11:19:20 +03:00
Mikhail Glukhikh
71b0840ef9 [FIR] Implement super resolve as a particular tower resolver case 2020-02-05 11:19:19 +03:00
Dmitry Petrov
ee020ef290 KT-36336 @EnhancedNullability and null checks
Don't insert implicit null check on a value of @EnhancedNullability type
used where @EnhancedNullability type is expected.

This uncovers a bunch of other problems in FE and BE.
KT-36343 and KT-36347 are bugs in StrictJavaNullabilityAssertions
implementation which should most likely be fixed in next major language
version (with proper breaking change notice).
KT-36344 is a design problem which should be addressed after 1.4 issues
are resolved.
2020-02-05 11:15:41 +03:00
Vladimir Dolzhenko
6489b56fb0 Fix 192 compilation for move remove redundant imports to bg thread
Relates to #KT-24122
2020-02-04 18:36:38 +01:00
Vladimir Dolzhenko
dd0613bc7a Move remove redundant imports to bg thread
#KT-24122 Fixed
2020-02-04 16:34:57 +01:00
Denis Zharkov
fef2e06db4 FIR: Fix test data 2020-02-04 17:55:12 +03:00
Pavel Kirpichenkov
75d57c7d3f Update pattern for finding diagnostics in diagnostic tests
Also use updated diagnostic pattern in TreesCompareTest.
In rare cases diagnostic was cut too early on !> characters,
that were a part of diagnostic parameter:
<!DIAGNOSTIC("Type<DefinitelyNotNullTypeArgument!!>")!>
2020-02-04 17:49:18 +03:00
Kristoffer Andersen
4dd794c2d2 [JVM_IR] Propagate Type Parameters to DefaultImpls
This ensures correct generation of generic signatures in the resulting
byte code, but it _is_ a work in progress: the actual type *arguments*
passed for these parameters during compilation are dummy `Any?` types.

Sites that need more work are indicated with TODO's.

- copy type parameters of interfaces to methods moved to DefaultImpls
- implement type parameter renaming scheme from JVM, with proper
  renaming and substitution.
- adjust call sites in bridges in classes->DefaultImpls
- adjust call sites in bridges from DefaultImpls->Interface
- adjust call sites in bridges from DefaultImpls->DefaultImpls
- adjust super calls ->DefaultImpls
- adjust calls in code of Interfaces->DefaultImpls
2020-02-04 17:41:31 +03:00
Kristoffer Andersen
3606a4104b [JVM IR] Documentation for remapTypeParameters 2020-02-04 17:41:31 +03:00
Dmitry Gridin
6c439ae85a Create TrailingCommaIntention
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin
195d9020a6 TrailingCommaInspection: shouldn't be associated with formatter settings
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin
b5d0956a5e Move call-site trailing comma to registry
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin
c34b417d0c Fix tests after disabling trailing comma
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin
3fb34596ae Code style: disable trailing comma by default
#KT-34744
2020-02-04 21:34:52 +07:00
Denis Zharkov
4f834cb16b FIR: Get rid of replacements map during calls completion
Otherwise, it's complicated to work with nested lambdas:
outer/inner ones may be replaced independently and still refer
to the old one instances.
So in the changed test, if we don't apply the commit, will remain
implicit return and receiver types for the nested lambda

Anyway, once we decided to leave immutable semantics,
replacements are not necessary anymore
2020-02-04 16:24:01 +03:00
Denis Zharkov
8d24e0f842 FIR: Add some absent "replace" methods for callable declarations
It's necessary to avoid copying lambdas in LambdaAnalyzerImpl
2020-02-04 16:24:01 +03:00
Denis Zharkov
c3e900b945 FIR: Make replace function accepting parameter with nullability as-is 2020-02-04 16:24:01 +03:00
Denis Zharkov
23e9a0c861 FIR: Force processing postponed arguments nested in lambdas
See the call-site of processAllContainingCallCandidates in getOrderedNotAnalyzedPostponedArguments
2020-02-04 16:24:01 +03:00
Ilya Goncharov
1e2e556328 [Gradle, JS] Fix test 2020-02-04 16:21:13 +03:00
Igor Chevdar
8214a9383c Enabled some tests 2020-02-04 16:14:29 +03:00
Igor Chevdar
562e8e357a [IR] SAM lowering: supported suspend functions 2020-02-04 16:14:27 +03:00
Igor Chevdar
d6f91333dc [IR] SAM lowering: use block body instead of expr body
irBlockBody { +irReturn(..) } instead of irExprBody { .. }
K/N doesn't support expr bodies for now
2020-02-04 16:14:27 +03:00
Igor Chevdar
645488b342 [IR] SAM lowering: place wrappers into file if no enclosing class exists 2020-02-04 16:14:27 +03:00
Igor Chevdar
6ecda9e8af [IR] [JVM_IR] Commonized SAM conversions lowering 2020-02-04 16:14:27 +03:00
Dmitriy Dolovov
4dbf60eb2c Fix: Load properties in konan Distribution in safe way
Issue #KT-36333
2020-02-04 19:24:42 +07:00
Dmitriy Dolovov
f69eef811b Minor: Remove unnecessary IO check 2020-02-04 19:24:36 +07:00
Mikhail Glukhikh
b1436804b3 [FIR, by demiurg] Fix exception in DFA for a case with lambda empty body 2020-02-04 15:00:13 +03:00
Mikhail Glukhikh
64c7ab1302 [FIR] Fix lambda resolve in independent context 2020-02-04 15:00:12 +03:00
Mikhail Glukhikh
4f8d0382f7 Get rid of FirControlFlowGraphOwner 2020-02-04 15:00:11 +03:00
Mikhail Glukhikh
f28144ff9c Minor FirRenderer code cleanup 2020-02-04 15:00:10 +03:00
Mikhail Glukhikh
e977c1c076 Get rid of name in FirConstructor 2020-02-04 15:00:10 +03:00
Mikhail Glukhikh
f20845ba40 Get rid of FirMemberFunction 2020-02-04 15:00:09 +03:00
Mikhail Glukhikh
677129ad20 Get rid of FirNamedDeclaration 2020-02-04 15:00:08 +03:00
Ilya Kirillov
7a52cf103a Fix change signature refactoring
Do not increase modification count for OutOfCodeBlockTracker when KtTypeCodeFragment is modified

KtTypeCodeFragment is used in UI for providing completion for types.
When OutOfCodeBlockModification happens it invalidates ModuleDescriptors
But change signature relies on them which causes InvalidModuleException

#KT-35903 fixed
#KT-35689 fixed
#KT-34415 fixed
#KT-34415 fixed
2020-02-04 14:15:25 +03:00
Ilya Kirillov
ed5156ee83 Wizard: do not show disable/enable checkbox for new project wizard in AS
#KT-36195 fixed
2020-02-04 14:15:24 +03:00
Jinseong Jeon
451fa245b8 JVM_IR: Change name for (dispatch|extension) receiver of inline class according to naming convention. 2020-02-04 11:52:56 +01:00
Alexander Udalov
19b516cbf4 JVM IR: do not erase static fields in annotation classes 2020-02-04 11:43:24 +01:00
Alexander Udalov
00de5dae32 JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering
This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
2020-02-04 11:43:24 +01:00
Alexander Udalov
e42a4b2fac IR: extract JvmPropertiesLowering out of PropertiesLowering 2020-02-04 11:43:23 +01:00
Ilya Goncharov
60da37404e [Gradle, JS] Distribution and distributeResources 2020-02-04 13:07:10 +03:00
Dmitriy Dolovov
e302818e26 Refactor KotlinNativeToolRunner to make it extendable
Now, it's possible to add new tool runners independent of Kotlin/Native
distribution. Ex: Upcoming KotlinNativeKlibCommonizerToolRunner
2020-02-04 15:49:49 +07:00
Mikhail Zarechenskiy
cb07c9172f [NI] Record substituted generic signature for SAM arguments
#KT-36297 Fixed
2020-02-04 10:26:48 +03:00
Dmitry Petrov
8ef79f932c JVM_IR: Implement some BE diagnostics
TODO proper diagnostics tests with BE diagnostics
2020-02-04 00:04:22 +03:00
Georgy Bronnikov
c9df17f2f1 Handle type arguments in IrType.eraseTypeParameters 2020-02-03 19:14:22 +03:00
Mikhail Glukhikh
22068dd6ad [FIR TEST] Update test data due to hardened receiver check (NB: broken)
In particular, nullable invoke extension call and some smart casts
are broken here
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh
7dca4d2fee [FIR TEST] Update test data for purely implements case (NB: broken)
In this case Java super type arguments should be not null, not flexible
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh
b25d99c1e5 [FIR TEST] Add test with some problematic smart casts 2020-02-03 16:45:20 +03:00
simon.ogorodnik
ca5fee77d4 [FIR] Fix generation of raw FIR for delegate with receiver 2020-02-03 16:45:20 +03:00
simon.ogorodnik
ef5aab374b [FIR] Fix implicit this aliasing in DFA 2020-02-03 16:45:20 +03:00
simon.ogorodnik
645602b675 [FIR] Fix data-flow after while loops 2020-02-03 16:45:20 +03:00
Mikhail Glukhikh
91b432b4a1 [FIR] Java super-type arguments are now handled as flexible 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh
aeb6f35571 Support nullable callable references in FIR resolve 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh
a584589665 Support nullable callable references in raw FIR 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh
95122f1d0b Add two more FIR problematic tests 2020-02-03 16:45:18 +03:00
Mikhail Glukhikh
0b377c103a Add FIR problematic test (safe extension invoke) 2020-02-03 16:45:18 +03:00
simon.ogorodnik
34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00
Roman Golyshev
fe779bf7bd KT-34795 Fix failing NewMultiplatformIT#testLibAndApp test
- Revert back `maven(...)` to `maven { setUrl(...) }`, because in this test this syntax is used intentionally to be valid both for `.gradle` and `.gradle.kts`
2020-02-03 15:55:28 +03:00
Vladimir Ilmov
c804190f36 [COROUTINE] NPE exception fix if no DebugMetadata in target jvm exists 2020-02-03 09:16:50 +01:00
Vladimir Ilmov
7175e5a927 [COROUTINE] Extra logging removed, bug in method signature fix
Relates to #KT-34906
2020-02-03 09:16:50 +01:00
Dmitriy Novozhilov
2174556505 [FIR-TEST] Update incorrect testdata 2020-02-03 10:38:01 +03:00
Vladimir Dolzhenko
cf9ceb4e99 Add more diagnostic context to LightClassUtil#findClass
Relates to #EA-5389872
2020-02-03 00:00:45 +01:00
Dmitriy Dolovov
80eb148092 IDE: Fix ToolingSingleFileKlibResolveStrategy to recongnize klib archives
Issue #KT-36213
2020-02-01 17:07:18 +07:00
Dmitriy Dolovov
ef199f8e45 Mark obsolete createKotlinLibrary() call as @Deprecated 2020-02-01 17:07:18 +07:00
Dmitriy Dolovov
acc3395ca5 IDE: Don't analyze incompatible KLIBs with components
Issue #KT-36213
2020-02-01 17:07:13 +07:00
Dmitriy Dolovov
623b554297 IDE: Fix friendly displaying of K/N KLIBs with components
Issue #KT-36213
2020-02-01 17:07:09 +07:00
Dmitriy Dolovov
4336096775 Use "tooling" KLIB resolve strategy in IDE and commonizer
Issue #KT-36213
2020-02-01 17:07:02 +07:00
Dmitriy Dolovov
1196044df7 Introduce 2 KLIB resolve strategies: "compiler" & "tooling"
Issue #KT-36213
2020-02-01 17:06:42 +07:00
Dmitriy Dolovov
1053428ee4 Minor: Formatted 2020-02-01 17:04:00 +07:00
Dmitriy Dolovov
8028a3f55b Minor: Clean-up in konan File 2020-02-01 17:03:51 +07:00
Mikhail Zarechenskiy
60a2d0f037 [NI] Approximate receivers for callable reference candidates
#KT-36221 Fixed
2020-01-31 18:26:32 +03:00
Pavel Kirpichenkov
517688e163 [NI] Revise variance calculation method for completion mode
Before fix only one level of type arguments was used to determine variance of type variable to find out direction requirements.
This incorrect in general case, because outer variance affects subtyping deductions, for example:
Inv<Out<A>> <: Inv<Out<B>> => A <: B; B <: A, despite A and B are in covariant position if only one level is considered

^KT-36233 Fixed
2020-01-31 17:59:11 +03:00
Will Boyd
e27b2990e3 Update message on KotlinReflectionInternalError to reflect that typealiases are also unsupported 2020-01-31 15:58:30 +01:00
Pavel Kirpichenkov
3819b2ce59 Change unsupported 1.0 version in maven plugin tests
KT-36146
2020-01-31 16:58:51 +03:00
Juan Chen
188abc243a [FIR] add vararg arguments support, improve vararg parameters support 2020-01-31 16:41:25 +03:00
Mikhail Zarechenskiy
069fbffaa3 Regenerate tests: fix LightAnalysisModeTestGenerated 2020-01-31 15:39:52 +03:00
pyos
bda5b0d5a9 JVM_IR: further refine synthetic accessor generation
References to protected members from crossinline lambdas in the same
package do not need accessors.
2020-01-31 13:20:30 +01:00
Mikhael Bogdanov
21d3adf084 Minor. Fix android test compilation 2020-01-31 11:39:55 +01:00
Mikhael Bogdanov
9e26491631 Beatify names for enum name and ordinal local variables 2020-01-31 11:39:54 +01:00
Mikhael Bogdanov
cd0c45c832 JVM_IR. Generate proper suffix for companion backing field accessor and parameter name 2020-01-31 11:39:53 +01:00
Mark Punzalan
3ee344b836 ForLoopsLowering: Fix issue with break/continue in loop over withIndex. 2020-01-31 10:37:03 +01:00
Pavel Kirpichenkov
724eda8fdb Advance explicit Kotlin versions in gradle integration tests
1.0 and 1.1 are no longer supported starting from 1.4, new errors break tests
See KT-36146
2020-01-31 11:47:25 +03:00
Alexander Udalov
9f25fdcedc Minor, skip mustBeDocumented.kt for JDK 6 codegen tests
Class.getDeclaredAnnotation is not available before JDK 8
2020-01-31 09:36:17 +01:00
Mads Ager
e8a640851a FIR: Change the Fir2Ir handling of smart casts.
Generate the expression with the original type and then insert
an implicit conversion. That matches the behavior of psi2ir
better and therefore avoids breaking backend assumptions.

In particular, IrGetValue expects the type of the underlying
symbol and the type of the IrGetValue to be the same.
2020-01-31 09:31:52 +01:00
Mads Ager
d68a1898d0 JVM_IR: Use direct field access instead of calling certain accessors.
Final default properties accessors that access a backing field
on the same class can be replaced by direct field use.

Perform the optimization late in the pipeline to allow lowerings
to expose more opportunities for optimizations.
2020-01-31 09:31:52 +01:00
Nikolay Krasko
09057c485b Update to a newer idea to fix bad initialization of PsiSubstitutor (KT-36039)
PsiSubstitutor instantiation doesn't need EmptySubstitutor service anymore.
Remove hack with interface field reassign that doesn't work with JDK >= 12.

Leave hack for PsiSubstitutor in AS40 as KotlinCoreApplicationEnvironment
is not expected to be triggered from the plugin.

#KT-36039 Fixed
2020-01-31 01:59:58 +03:00
Victor Petukhov
4490efab3e [NI] Use original descriptor for functions imported from object during JS mangling
^KT-35904 Fixed
2020-01-30 19:55:41 +03:00
Victor Petukhov
fa924065ca Enable NonStrictOnlyInputTypesChecks since 1.3
This is important for the case of the enabling new inference in 1.3 (so that there is no error in certain cases)
2020-01-30 19:20:12 +03:00
Vyacheslav Gerasimov
06448b6469 Revert "Set local build version to 1.4.255-SNAPSHOT"
This reverts commit a8650ccf
2020-01-30 18:20:27 +03:00
Kirill Shmakov
46b4620fdd Use better wording in plugin advertiser 2020-01-30 17:53:14 +03:00
Denis Zharkov
db6183644f FIR: Add problem test 2020-01-30 17:12:50 +03:00
Denis Zharkov
e0dca92370 FIR: Ignore whitespaces when comparing fir/non-fir diagnostic files 2020-01-30 17:12:50 +03:00
Denis Zharkov
47ecaa5b06 FIR: Fix scope intersection types
Otherwise overload resolution ambiguity is reported in the test
2020-01-30 17:12:50 +03:00
Denis Zharkov
d28e1f156a FIR: Fix capturing of flexible types 2020-01-30 17:12:50 +03:00
Denis Zharkov
ac2b5beb4e FIR: Optimize SupertypeComputationSession::breakLoops 2020-01-30 17:12:50 +03:00
Kirill Shmakov
a44fa8db50 Pack LLDB binaries into plugin 2020-01-30 16:40:04 +03:00
Mikhail Glukhikh
06bab6ec48 [FIR] Extract QualifierReceiver to a separate file 2020-01-30 16:28:26 +03:00
Mikhail Glukhikh
2bb5740f47 [FIR] Resolve ambiguities in Java static scopes 2020-01-30 16:28:08 +03:00
Mikhail Zarechenskiy
4c8905b00f Add forgotten test file for FIR
After ac69c287ec
2020-01-30 16:09:22 +03:00
Toshiaki Kameyama
2f19ad7bdc Redundant companion reference: fix false positive with overridden Java getter (#2935)
#KT-33771 Fixed
2020-01-30 15:55:47 +03:00
Ilya Kirillov
9f7af4b58d Fix testdata after ebe3619251 2020-01-30 15:52:54 +03:00
Pavel Kirpichenkov
736f5e365c [NI] Create error type for CST of error types
KT-36092 Fixed
2020-01-30 15:24:42 +03:00
Mikhail Zarechenskiy
ac69c287ec [NI] Don't treat last labeled return expression in lambda specially
#KT-36251 Fixed
2020-01-30 15:11:27 +03:00
Dmitry Gridin
66a15d23d8 Fix tests from LiveTemplatesTest 2020-01-30 19:04:25 +07:00
Steven Schäfer
cf3e4608f3 JVM IR: Support -Xno-call-assertions 2020-01-30 14:43:23 +03:00
Kristoffer Andersen
61e6d346aa [JVM IR] Interface Delegation by Property should use existing field
When a property backed by a final field is the delegate for interface
implementation by delegation, the backend should reuse the backing
field rather than introduce a new, extraneous `$$delegate_n` field.
2020-01-30 14:42:24 +03:00
Alexander Udalov
d4170bca6e Regenerate generated files after updating copyright year 2020-01-30 12:41:42 +01:00
Natalia Selezneva
e33a81a968 Tests: fix gradle tests for script configuration loading
Introduce `testAffectedGradleProjectFiles` property
to avoid full gradle project import in some tests
2020-01-30 14:39:29 +03:00
Dmitriy Novozhilov
f9a4b8f9cb [FIR] Split printer in tree generator to several files
Also use smart printer instead of `PrintWriter`
2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov
075068155b [FIR] Delay configuration of nodes in tree generator 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov
9f6cf5c8f4 [FIR] Add forgotten replacing lambdas in arguments of try and when calls 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov
f8c8925fd6 [FIR] Support DFA analysis of postponed lambdas. Add more kinds of edges of CFG
#KT-36248
#KT-35724 Fixed
2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov
c78da854f7 [FIR] Make Stack an abstract class 2020-01-30 14:38:02 +03:00
Dmitriy Novozhilov
5de37baf6e [FIR] Rename EnterNode and ExitNode interface to markers 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov
ec0f8a9c77 [FIR] Hide modifications of CFG from public API 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov
6716cb0bf3 [FIR] Add edge kinds to control flow graph
Another changes:
- Remove useless CFG plain text renderer
- Refactor CFG .dot renderer
- Add checking of consistency control flow graph
2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov
0c2157155d [FIR-TEST] Remove outdated empty test class 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov
237198758d [FIR] Get rid of alivePreviousNodes in control flow graph 2020-01-30 14:38:01 +03:00
Dmitriy Novozhilov
1180ec54ef [FIR] Add unique id's for nodes of control flow graph 2020-01-30 14:38:01 +03:00
Mikhael Bogdanov
10900e0d90 JVM_IR. Don't copy synthetic method for property annotations if @JvmStatic presented 2020-01-30 12:31:38 +01:00
Pavel Kirpichenkov
832064305f [NI] Set correct applicability for unknown lambda parameter diagnostic
Unknown lambda parameter should not change resolve.
So the new diagnostic should not have error status; othrewise candidates with lower priority but more specific expected type may be chosen.

KT-34335 Fixed
See also KT-36264
2020-01-30 13:52:18 +03:00
Pavel Kirpichenkov
eec039f5a2 [NI] Report error about unknown parameter type of lambda argument
KT-34335
2020-01-30 13:52:12 +03:00
Pavel Kirpichenkov
9fb8579252 [minor] Refactor KotlinCallCompleter
Move completion mode logic to CompletionModeCalculator.
2020-01-30 12:48:20 +03:00
Dmitry Gridin
96f49d8e3c Remove trailing comma from some tests 2020-01-30 15:32:09 +07:00
Dmitry Petrov
53f66e9509 PSI2IR: SAM conversion in varargs 2020-01-30 10:27:01 +03:00
Alexander Udalov
186a456e01 JVM IR: fix condition in Documented annotation generation 2020-01-30 00:06:03 +01:00
Alexander Udalov
d71dec9b64 Minor, fix typo in condition in AbstractWriteFlagsTest 2020-01-30 00:02:20 +01:00
Pavel Kirpichenkov
5a04b7935e Add workaround for obsolete inline suspend integration test
Restore test data dropped in 7abd87d5, add specific output check
KT-36240
2020-01-29 21:41:07 +03:00
Pavel Kirpichenkov
9902643a26 Remove unsupported versions from kotlin compiler tab in settings
KT-36146 In progress
2020-01-29 21:40:50 +03:00
Pavel Kirpichenkov
913ed71863 Update error about unsupported language and API versions
Set first supported version to 1.3
Add property for oldest depecated language version in order to control unsupported ones
Report error on attempts to manually disable language feature from unsupported versions
Update test data, drop compatibility tests for features from unsupported versions

KT-36146 In progress
2020-01-29 21:40:44 +03:00
Sergey Igushkin
715e7e1a3c Downgrade Kotlin/Native version to 1.4-dev-14287 as latest published 2020-01-29 21:17:22 +03:00
Sergey Igushkin
30a9f0a875 Update versions.kotlin-native to 1.4-dev-14288 2020-01-29 21:04:48 +03:00
Vyacheslav Gerasimov
a8650ccfd2 Set local build version to 1.4.255-SNAPSHOT
#KT-36128
2020-01-29 20:20:33 +03:00
Alexander Udalov
f4912ed433 Minor, simplify JS-related build files a bit
* remove test roots in modules which have no tests
* 1.8 is already the default JVM target in the project
* replace compilation dependency on kotlin-reflect with runtime
2020-01-29 18:03:22 +01:00
Alexander Udalov
d27bb76fd0 Remove dependency of serialization.js on cli
To break up compilation dependency of JS IR/WASM backends on JVM
backend.

 #KT-35854 Fixed
2020-01-29 18:03:22 +01:00
Alexander Udalov
dcf6a2199a Generate JvmOverloads methods as final
#KT-33240 Fixed
2020-01-29 18:01:57 +01:00
Mads Ager
73aa36ca59 JVM: Add D8 check that class files can be dexed with D8.
This change adds D8 in addition to Dx which is being deprecated.
At some point after the official Dx deprecation, we should remove
the Dx checker.

Moving to D8 has the additional benefit that D8 can dex code
using java 8 features without using a separate desugaring tool.
2020-01-29 18:00:45 +01:00
Nicolay Mitropolsky
222ceb7698 Uast: fix for Lambda in place call identifiers (KT-35432) 2020-01-29 19:57:43 +03:00
Nicolay Mitropolsky
ac3a8eb494 Uast: fixes for Enum identifiers (KT-35432) 2020-01-29 19:57:43 +03:00
Alexander Udalov
953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Kristoffer Andersen
f262f61096 [JVM + IR] Fix Generic Signature Test Expectations 2020-01-29 17:14:41 +01:00
Mark Punzalan
e226561150 [JVM IR] Copy metadata in IrFieldBuilder.
This fixes an issue with lateinit properties where the metadata from
the original field was not copied to the nullable field in
LateinitLowering. Also consolidated related tests.
2020-01-29 17:12:16 +01:00
Mikhael Bogdanov
f5f25224b0 JVM_IR. Add IrAsmLikeInstructionListingTestGenerated tests 2020-01-29 17:00:00 +01:00
Mikhael Bogdanov
342ff50e31 Minor. Update test 2020-01-29 16:59:59 +01:00
Mikhael Bogdanov
1ecf9d407f JVM_IR. Align order of JvmOverload functions between backends 2020-01-29 16:59:58 +01:00
Mikhael Bogdanov
504d79577d JVM_IR. Align outer parameter name generation between backends 2020-01-29 16:59:57 +01:00
Mikhael Bogdanov
17e89fbbdb JVM_IR. Align synthetic parameter name generation across backends 2020-01-29 16:59:57 +01:00
Mikhael Bogdanov
c42984ca33 Generate proper flags for <clinit> 2020-01-29 16:59:56 +01:00
Mikhael Bogdanov
6c07dbf351 JVM_IR. Support type annotations 2020-01-29 16:59:55 +01:00
Vyacheslav Gerasimov
e4258e528f Introduce internal property sourceMapBaseDirs for Kotlin2JsCompile
Separate property needed to prevent Gradle snapshotting absolute paths
as inputs when passed as compiler argument.
To reduce property visibility to external users put it to the impl class
which will make it invisible in completion but still usable in Kotlin
build.
2020-01-29 18:15:31 +03:00
Abduqodiri Qurbonzoda
b06645d1c0 Update number of reachable nodes because of MutableList.removeFirst/Last 2020-01-29 17:53:08 +03:00
Dmitriy Dolovov
9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00
Dmitriy Dolovov
abd86107d1 Include :native:frontend.native into kotlin-compiler.jar 2020-01-29 20:30:40 +07:00
Dmitriy Dolovov
25ff33cc3c Update NativePlatformAnalyzerServices from Kotlin/Native repo 2020-01-29 20:30:35 +07:00
Dmitriy Dolovov
b49e6ac581 Rename :kotlin-native:kotlin-native-library-reader to :native:frontend.native 2020-01-29 20:30:29 +07:00
Mikhail Glukhikh
53d50c935a [FIR] Do not use strict type equality in override checker 2020-01-29 15:58:12 +03:00
Mikhail Glukhikh
e43a57bdee [FIR] Do not process constructors in super-type scopes 2020-01-29 15:58:04 +03:00
Mikhail Glukhikh
b4267558d7 [FIR] Fix constructors aliased importing 2020-01-29 15:57:47 +03:00
Dmitry Petrov
bf9673a0a2 PSI2IR: SAM conversion should be performed once for index variables
Given esoteric code as in 'caoWithAdaptationForSam.kt', we should make
sure that we pass same objects to 'get' and 'set'.
2020-01-29 15:30:07 +03:00
Mikhail Zarechenskiy
e750528551 Fix project compilation against bootstrap compiler
This is needed after e3b6104489
2020-01-29 15:25:22 +03:00
Svyatoslav Kuzmich
091e8495cd [JS IR] Use util-klib tool to filter klib in JS IR gradle plugin 2020-01-29 15:22:07 +03:00
Stanislav Erokhin
e3225469b5 Fix typo in Copyright since year 2020-01-29 15:01:23 +03:00
Toshiaki Kameyama
ebe3619251 KT-33384 Intention to switch between single-line/multi-line lambda (#2790)
Add intention for single-line lambda <-> multi-line lambda conversion

#KT-33384 Fixed
2020-01-29 12:32:26 +03:00
David Schreiber-Ranner
f94d026e64 Retrieve outputFile from KotlinWebpack task 2020-01-29 12:15:04 +03:00
David Schreiber-Ranner
ae22dc352c Fix file components order
The path of the webpacked JavaScript file that should be included in the server JAR is constructed by taking the webpack tasks output directory, and appending the filename of the JavaScript module. Previously, the constructor arguments were flipped, leading to an invalid path.
2020-01-29 12:15:04 +03:00
Mikhail Zarechenskiy
a8edd08121 [NI] Do not rely on a key that returns non-substituted types 2020-01-29 11:43:15 +03:00
Mikhail Zarechenskiy
e42f16c95c [NI] Fix construction of common system for builder inference 2020-01-29 11:43:15 +03:00
Mikhail Zarechenskiy
e3b6104489 [NI] Map vararg to Array if it's resolved against type variable
While this behavior is questionable, it's consistent with OI and can
 be changed in future

 #KT-36201 Fixed
2020-01-29 11:43:14 +03:00
Mikhail Zarechenskiy
35f6810b58 [NI] Do not incorporate constraints that are needed only for nullability 2020-01-29 11:43:13 +03:00
Mikhail Zarechenskiy
ce690d8a1d Add test for obsolete issue
#KT-36121 Obsolete
2020-01-29 11:43:11 +03:00
Denis Zharkov
e725f255f1 FIR: Share the same ScopeSession instance between phases
^KT-34563 Fixed
2020-01-29 11:31:57 +03:00
Denis Zharkov
280fb94774 FIR: Cache file importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov
0b2b23189a FIR: Cache default importing scopes 2020-01-29 11:31:57 +03:00
Denis Zharkov
95084a5312 FIR: Minor. Inline unused parameter in FirDefaultStarImportingScope 2020-01-29 11:31:57 +03:00
Dmitriy Dolovov
3b33df6564 Reduce external dependencies in :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:49 +07:00
Dmitriy Dolovov
1b472b6b12 Move KonanLibraryConstants out of :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:42 +07:00
Dmitriy Dolovov
cd71f250e5 Move KonanFactories out of :kotlin-native:kotlin-native-library-reader 2020-01-29 15:29:35 +07:00
Mikhail Glukhikh
3f95ac341c [FIR] Implement SAM candidates discrimination 2020-01-29 11:09:28 +03:00
Ilya Gorbunov
c37a2d3dc3 Fix completion test: add coroutines-compat jar dependency
Related to KT-34582
2020-01-29 09:12:43 +03:00
Ilya Gorbunov
3bd3d61469 Test experimental coroutines version requirement on JVM only
Modify 'suspendFun' and 'nestedClassMembers' tests so that pre-release
suspend functions are tested only on JVM, where they are still supported.
2020-01-29 09:12:42 +03:00
Ilya Gorbunov
7792613f88 Finishing touch: drop experimental coroutines sourcesets from stdlib
#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov
c28710419a Drop noStdLib coroutines tests
They were disabled anyway because coroutines can't be compiled without
the support API in stdlib

#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov
30bccc431b Migrate tests to release coroutines
where it's not essential to use experimental ones

#KT-36083
2020-01-29 09:12:41 +03:00
Ilya Gorbunov
f465e7a957 Add coroutines-experimental-compat to idea plugin dist
It is required as a runtime dependency to instantiate async scripting
resolvers when importing Gradle 4.9 Kotlin DSL projects.

#KT-36083
2020-01-29 09:12:41 +03:00
Ilya Gorbunov
9f8e3dad33 Add coroutines-compat jar dependency to those tests that require it
#KT-36083
2020-01-29 09:12:40 +03:00
Ilya Gorbunov
cef81e11b7 Do not generate JS tests for experimental coroutines support
#KT-36083
2020-01-29 09:12:40 +03:00
Ilya Gorbunov
b5a0daabc3 Extract kotlin.coroutines.experimental API into compat artifact
Add public API dump for kotlin-coroutines-experimental-compat

#KT-36083
2020-01-29 09:12:39 +03:00
Stanislav Erokhin
075eea5a96 Update year and fix inconsistency with LICENSE.txt 2020-01-28 20:05:44 +03:00
Denis Zharkov
70ce63c8d4 FIR: Support rewritten implicit types calculator in IDE
Unlike the compiler, in the IDE different files may have different
resolve state.

So using ReturnTypeCalculatorForFullBodyResolve may be not correct there
2020-01-28 17:03:50 +03:00
Denis Zharkov
c6c773f6f9 FIR: Mark all dependencies' declarations as fully resolved 2020-01-28 17:03:50 +03:00
Denis Zharkov
dd51d5065a FIR: Rename classes properly in FirImplicitBodyResolve.kt 2020-01-28 17:03:50 +03:00
Denis Zharkov
1cb18a73db FIR: Get rid of old FirImplicitTypeBodyResolveTransformerAdapter 2020-01-28 17:03:50 +03:00
Denis Zharkov
f2abb57021 FIR: Introduce and use FirClass<*>::unsubstitutedScope 2020-01-28 17:03:50 +03:00
Denis Zharkov
6e8d67b96f FIR: Simplify contract in FirScopeProvider::getUseSiteMemberScope 2020-01-28 17:03:50 +03:00
Denis Zharkov
de4bfb3973 FIR: Implement FirApplyInferredDeclarationTypesTransformer 2020-01-28 17:03:50 +03:00
Denis Zharkov
8e672222bb FIR: Do not resolve implicitly typed function twice 2020-01-28 17:03:50 +03:00
Denis Zharkov
c295f2dc25 FIR: Reimplement implicit types calculator
Make it works through a single component tracking computation status
instead of storing it in the nodes
2020-01-28 17:03:50 +03:00
max-kammerer
f256547cc8 Revert "JVM_IR: Use direct field access instead of calling certain accessors."
This reverts commit 62f9e7a810.
2020-01-28 14:55:56 +01:00
Igor Yakovlev
6fdd4cb134 Add scroll bar to compiler configuration tab
Fixed #KT-24399
2020-01-28 15:45:39 +03:00
Dmitriy Novozhilov
056c3c95bb [FIR-TEST] Remove unnecessary test 2020-01-28 14:14:21 +03:00
Dmitriy Novozhilov
ff3116f0ed [FIR] Support intersection types in some type context methods 2020-01-28 14:14:21 +03:00
Dmitriy Novozhilov
57a1342aac [FIR] Fix creating DefinitelyNotNullTypes
Also fix substitutions to them
2020-01-28 14:14:21 +03:00
Dmitriy Novozhilov
4303cd2fc7 [FIR] Put rendering of cone types in one place and change render for error types 2020-01-28 14:14:21 +03:00
Dmitriy Novozhilov
a882cd98ea [FIR] Drop duplicate edges in fir tree graph 2020-01-28 14:14:20 +03:00
Dmitriy Novozhilov
985b61f925 [FIR] Drop ARRAY_CLASS_NAME and use name from StandardClassIds instead 2020-01-28 14:14:20 +03:00
Dmitriy Novozhilov
7d8363d6aa [FIR] Use Function<R> as super type for all FunctionNtypes 2020-01-28 14:14:20 +03:00
simon.ogorodnik
099d737e86 [FIR] Fix compiler configuration for modularized test 2020-01-28 13:21:14 +03:00
Igor Yakovlev
f7dfbbbfbd Remove const keyword requirement from UL final fields initializers 2020-01-28 13:01:03 +03:00
Vladimir Dolzhenko
00c71dd098 Clear computable when value is calculated and CallOnceFunction is added
Relates to #KT-35256
2020-01-28 10:50:46 +01:00
Mads Ager
62f9e7a810 JVM_IR: Use direct field access instead of calling certain accessors.
Final default properties accessors that access a backing field
on the same class can be replaced by direct field use.

Perform the optimization late in the pipeline to allow lowerings
to expose more opportunities for optimizations.
2020-01-28 10:42:15 +01:00
Georgy Bronnikov
e351d560d6 IR: remove KotlinIrLinker.checkAccessibility
This sanity check conflicted with cases where visibility test is
suppressed in the frontend.
2020-01-28 12:19:44 +03:00
Mikhail Zarechenskiy
678c74b17f [NI] Don't forget to update receivers for builder-inference 2020-01-28 12:19:44 +03:00
Georgy Bronnikov
97abc872b2 IR: deal with corresponding classes for enum entries in JvmDescriptorUniqIdAware 2020-01-28 12:19:44 +03:00
Georgy Bronnikov
f75400cc1a IR: avoid some calls of getUniqId() 2020-01-28 12:19:44 +03:00
Georgy Bronnikov
8f4b4007fe JVM_IR: Add test for compiling against cross-platform Klib 2020-01-28 12:19:43 +03:00
Georgy Bronnikov
f1b5198b86 Avoid calling ExternalDependenciesGenerator twice 2020-01-28 12:19:43 +03:00
Georgy Bronnikov
5ede65c525 JVM_IR: read Klib 2020-01-28 12:19:43 +03:00
Georgy Bronnikov
47d6bdfd35 IR: add isProvidedByDefault() to SearchPathResolver 2020-01-28 12:19:43 +03:00
Georgy Bronnikov
ed4be36484 JVM_IR, minor: change package for JvmMangler 2020-01-28 12:19:43 +03:00
Dmitry Petrov
2d3a142786 Commonize 'fun interface' handling as much as possible
TODO decide something about SamType.createByValueParameter in case of
out-projected types.
2020-01-28 11:40:14 +03:00
Dmitriy Dolovov
edff099ab1 [Commonizer] Don't use experimental Kotlin time in commonizer 2020-01-28 15:37:24 +07:00
Dmitriy Dolovov
40b358b43c [Commonizer] Process endorsed libraries in CLI 2020-01-28 15:37:18 +07:00
Dmitriy Dolovov
aa1c7bb562 [Commonizer] Fix classpath dependency for CLI 2020-01-28 15:37:11 +07:00
Vladimir Ilmov
e4d157c126 [coroutine] running coroutine stack frame merged with coroutine info 2020-01-28 08:40:14 +01:00
pyos
f1669e2230 IR: mark interface delegate fields as synthetic
This requires separating them origin-wise from property delegates.
2020-01-28 10:35:22 +03:00
Mikhail Glukhikh
ce1f746c5e [FIR] Allow more than one function with some name in local scope 2020-01-28 09:36:56 +03:00
Ilya Matveev
0725a336fc Fix data race in zip FileSystem reference counting
Issue #KT-36076 Fixed
2020-01-28 13:08:40 +07:00
Andrey Uskov
4eb38721a5 Minor. Fix BuildSessionLoggerTest 2020-01-27 22:25:28 +03:00
Andrey Uskov
e7057cf2b3 Fix classpath of IDEA plugin tests 2020-01-27 22:24:24 +03:00
Andrey Uskov
9ae3b2cf43 Fixed locking statistics files when multiple gradle daemons started 2020-01-27 22:23:21 +03:00
Igor Yakovlev
a68a6b77df Move top level declaration refactoring 2020-01-27 22:05:30 +03:00
Alexander Gorshenev
f58a6e054c Provide the same createKotlinLibrary even in multi-component situation 2020-01-27 20:21:32 +03:00
Alexander Gorshenev
8b036ace26 Moved several more components to resolveSingleFileKlib 2020-01-27 20:21:32 +03:00
Alexander Gorshenev
19cbdb096f Fine tuned the single file klib resolver 2020-01-27 20:21:32 +03:00
Alexander Gorshenev
fcce35c06f Move tools to resolveSingleFileKlib 2020-01-27 20:21:32 +03:00
Alexander Gorshenev
7390e74bbd Initial implementation of klib components 2020-01-27 20:21:32 +03:00
Victor Petukhov
f7626d6474 Exclude reporting IMPLICIT_NOTHING_AS_TYPE_PARAMETER warning for suspend lambdas
^KT-36101 Fixed
2020-01-27 18:12:58 +03:00
Dmitriy Dolovov
901bb904e0 Fix GradleNativeLibrariesInIDENamingTest 2020-01-27 21:33:30 +07:00
simon.ogorodnik
97f134eab1 Remove outdated fir-view module 2020-01-27 17:08:18 +03:00
Dmitry Petrov
c939fb7b05 PSI2IR: Fix argument adaptation for unbound references
NB front-end "lies".
2020-01-27 17:03:48 +03:00
Dmitry Petrov
0152f19d5f PSI2IR: Use substituted value parameter in function reference adaptation 2020-01-27 17:03:48 +03:00
Mikhael Bogdanov
6e94eddb71 JVM_IR. Fix bridge generation 2020-01-27 14:53:36 +01:00
Alexander Gorshenev
dfa509ec5b This reverts commits
afb2e9f38d.
    8c4fa6446d.
    f3bc533073.
    ccf084b1a5.
2020-01-27 15:30:16 +03:00
Mads Ager
e327b174a2 IR: Use name \$\$delegate_n for the field for interface delegation.
Without this change, these fields could have names such as
`<no name provided>$SuperClass$delegate` for something like
`object SuperClass by I { }`.
2020-01-27 15:28:27 +03:00
Ilya Chernikov
a37ec5a062 [minor] "fix" fir testdata for KT-32792 & KT-34857 2020-01-27 13:24:49 +01:00
Dmitry Petrov
dc4d453879 PsiErrorBuilder - error reporting abstraction for JVM_IR 2020-01-27 15:17:39 +03:00
Alexander Gorshenev
afb2e9f38d Fine tuned the single file klib resolver 2020-01-27 14:24:14 +03:00
Alexander Gorshenev
8c4fa6446d Moved several more components to resolveSingleFileKlib 2020-01-27 14:24:14 +03:00
Alexander Gorshenev
f3bc533073 Move tools to resolveSingleFileKlib 2020-01-27 14:24:14 +03:00
Alexander Gorshenev
ccf084b1a5 Initial implementation of klib components 2020-01-27 14:24:14 +03:00
Mikhail Glukhikh
f949b48b4a [FIR] Swap priority of kotlin libraries / built-ins #KT-35948 Fixed 2020-01-27 13:21:54 +03:00
Dmitriy Dolovov
c9b1c384e6 Clean-up: Split nativeLibrariesUtil.kt into separate files in idea-gradle 2020-01-27 17:09:21 +07:00
Dmitry Petrov
ba1415d7d1 Minor: remove assertion in getCallableReferenceAdaptation 2020-01-27 12:30:59 +03:00
Ilya Chernikov
9623b0eedb Report error instead of assertion when property is used as operator
#KT-34857 fixed
2020-01-27 10:10:44 +01:00
Ilya Chernikov
a1acb4afaf Return correct PSI expression for EmptyLabeledReturn
Fixes diagnostic reporting for appropriate constraint error
#kt-32792 fixed
2020-01-27 10:10:44 +01:00
Ilya Goncharov
ca150005a8 [Gradle, JS] Fix Task Configuration Avoidance 2020-01-27 11:50:08 +03:00
Ilya Goncharov
a2b774b186 [Gradle, JS] Distribution task depends on processResources 2020-01-27 11:50:08 +03:00
Toshiaki Kameyama
1ba8b52856 Constructor parameter is never used as a property: do not report if parameter is used as a reference
#KT-34686 Fixed
2020-01-27 11:33:50 +03:00
Toshiaki Kameyama
59f70a912a Convert to lambda reference: don't suggest when lambda is argument for 'suspend' function parameter
#KT-16907 Fixed
2020-01-27 11:31:16 +03:00
Mikhail Zarechenskiy
b75ab5c832 Refactoring: SingleAbstractMethodUtils -> JavaSingleAbstractMethodUtils 2020-01-27 11:03:58 +03:00
Mikhail Zarechenskiy
0530f9ed1c Refactoring: generify and remove duplicated code 2020-01-27 11:03:57 +03:00
Mikhail Zarechenskiy
4e3c27c4ec Refactoring: move SamConversionOracle to core 2020-01-27 11:03:57 +03:00
Mikhail Zarechenskiy
6c4f5ea9c9 Minor: generify check for sam conversions 2020-01-27 11:03:56 +03:00
Mikhail Zarechenskiy
02387e77dd Refactoring: rename SamConversionTransformer -> SamConversionOracle 2020-01-27 11:03:56 +03:00
Mikhail Zarechenskiy
08f80ba15a Refactoring: remove useless method 2020-01-27 11:03:55 +03:00
Mikhail Zarechenskiy
00469712d1 [NI] Don't use only platform specific checks for FIC in inference 2020-01-27 11:03:55 +03:00
Mikhael Bogdanov
7e85674c61 Minor. Allow IR compilation of FIR and IR.TREE module 2020-01-27 08:49:15 +01:00
Mikhail Glukhikh
71d8b41bef [FIR] Remove unused utilities 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh
dc4f332c08 [FIR] Implement early calculation of "not SAM" flag for classes 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh
279adae3e4 [FIR] Implement primitive tower for type resolving 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh
7721eaab23 [FIR] Transform qualified access / callable refs type arguments properly 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh
483ce8bf04 [FIR TEST] Stabilize top-level extension vs outer member behavior 2020-01-27 00:34:17 +03:00
Mikhail Glukhikh
ef8485a232 FIR2IR: change receiver handling in case it's an outer object
Before this commit, FIR2IR expected that FIR will have no receiver
in this case. However, now FIR *has* receiver, so we have to convert
it to object correctly
2020-01-27 00:34:16 +03:00
Mikhail Glukhikh
14204a842a Refactoring & clarification: implement new FIR tower resolver 2020-01-27 00:34:16 +03:00
simon.ogorodnik
a3ab763f0b [FIR] Get rid of processors in FirScope 2020-01-27 00:34:16 +03:00
Dmitriy Dolovov
224b2acdcc K/N: Get rid of remaining parts of "lite" KLIB API
Rewrite it in clean way and move to 'idea-gradle' module.
2020-01-26 22:17:50 +07:00
Dmitriy Dolovov
a7da605816 K/N: Drop unused part of "lite" KLIB API 2020-01-26 14:52:11 +07:00
Dmitriy Dolovov
345863a1d2 Fix: KotlinNativeABICompatibilityChecker.dispose() leads to dead lock
Issue #KT-36040
2020-01-26 11:07:30 +07:00
Dmitry Savvinov
d1e14598a6 Add IDE support for common klibs 2020-01-25 15:59:12 +03:00
Dmitry Savvinov
6d45b048cb Check for presence of ir-folder in klibs additionally for Kotlin/Native 2020-01-25 15:59:12 +03:00
Dmitry Savvinov
5665261e5b Minor: extract name of ir-folder in klib into const property 2020-01-25 15:59:12 +03:00
Dmitry Savvinov
7ecab7f0aa Pass proper metadata_version in K2MetadataKlibSerializer
Otherwise newer IDE Plugins will think that it's an old klib and will
refuse to analyze against it
2020-01-25 15:59:12 +03:00
Sergey Igushkin
823d3cc412 (minor) Fix accessing a shared-native compilation's konanTarget
As future some Kotlin/Native compilations in the future may have
different platforms within one target, it's more preferable to
access the konanTarget from the compilation, not its target.
2020-01-24 23:20:56 +03:00
Sergey Igushkin
1f42951152 Fix KlibBasedMppIT test compilation error (missing import) 2020-01-24 20:49:57 +03:00
Vyacheslav Gerasimov
1f3755248c Build: Make task inputs relative to improve caching 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov
8e0dd604af Build: Annotate KotlinModuleShadowTransformer with @CacheableTransformer 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov
131765537a Build: Implement preserveFileTimestamps for stripMetadata task 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov
82182893ad Build: Set preserveFileTimestamps & isReproducibleFileOrder properties
Otherwise some jars always have different key in the build cache
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
317972db2a Build: Make :kotlin-reflect:stripMetadata cacheable 2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
760e34aeec Build: Fix type of builtinsJar task
Should be org.gradle.api.tasks.bundling.Jar
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
526f29cc1a Build: Upgrade com.github.jengelman.gradle.plugins:shadow to 5.2.0 2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
3f10329347 Build: Fix publication of stdlib-js to avoid publishing all artifacts
Because of https://github.com/gradle/gradle/issues/4612 install and
uploadArchives tasks published artifacts which were not meant
to be published
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
7dcdc506d8 Build: Fix outputs for :kotlin-stdlib-js:compileJs
jsOutputMetaFile was missing
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov
770344770d Build: Make :kotlin-stdlib-js:compileJs task cacheable 2020-01-24 19:39:58 +03:00
Vyacheslav Gerasimov
392e5a6edd Build: Make :kotlin-compiler:proguard task cacheable 2020-01-24 19:39:58 +03:00
Vyacheslav Gerasimov
8dd6a34e17 Build: Make :core:builtins:serialize task cacheable 2020-01-24 19:39:58 +03:00
Sergey Igushkin
d1826374a6 Fix the K/N stdlib leaking into other common source sets
The Kotlin/Native stdlib was added to the shared-native source sets
in order for the IDE to import the stdlib dependency.

However, it was added to the '*Implementation' configuration, from
where it was also collected for the dependency source set
visibility inference algorithm. The current implementation of source
sets visibility inference only works for module dependencies and is
not quite suitable for local file dependencies. The implementation
should likely be fixed, but for now, it's enough to add the dependency
directly to the place where the visibility inference results are
taken from by the IDE during import, i.e. to the
'*ImplementationDependenciesMetadata' configurations.

Also, since all tests were flawed by the leakin K/N stdlib, the
K2Metadata/Klib compiler mistakenly didn't include its own built-ins
to the module dependencies (and everything worked because the K/N
built-ins were there). Now that the K/N doesn't leak, the compiler
must add its own built-ins.
2020-01-24 19:00:45 +03:00
Sergey Igushkin
970ee4539b Common klib support in the Kotlin Gradle plugin (KT-32677)
Refactor the Kotlin/Native compilations and tasks to support
Kotlin/Native-shared source sets compilation within the metadata target.

Provide the feature flag kotlin.mpp.enableCommonKlibs that enables
the following behavior:
* compilation of Kotlin/Native-shared source sets to a klib using
the Kotlin/Native compiler.
* compilation of common source sets (not just Kotlin/Native) into a
klib rather than *.kotlin_metadata

Issue #KT-32677 Fixed
2020-01-24 19:00:44 +03:00
Vyacheslav Gerasimov
dd9ac39b65 Build: Add :compiler:ir.serialization.common to kotlin-plugin.jar
:compiler:ir.serialization.jvm contains classes depending on this module
which makes idea plugin verifier to fail.

 #KT-36103
2020-01-24 18:27:41 +03:00
Vsevolod Tolstopyatov
e4d82a6dbb Merge remote-tracking branch 'origin/master' 2020-01-24 17:59:27 +03:00
Mikhail Zarechenskiy
b647d2c645 Prolong deprecation cycle for several restrictions until 1.5
ProhibitInvisibleAbstractMethodsInSuperclasses &
 ProhibitNonReifiedArraysAsReifiedTypeArguments were implemented in
 1.3.70, so actually they should be enabled only in 1.5
2020-01-24 17:29:55 +03:00
Victor Petukhov
5c6e710013 Revert "Workaround an inliner problem upon which the compiler code itself stumbled ^KT-35856 Fixed"
This reverts commit 59175912
2020-01-24 16:41:22 +03:00
Dmitry Petrov
90b250d241 PSI2IR: Fix bound inner class constructor callable reference generation 2020-01-24 16:32:07 +03:00
Alexander Udalov
f7321b497b Set KotlinCompilerVersion.IS_PRE_RELEASE = true
Since master is now 1.4-M1, and 1.4 is a pre-release version.
2020-01-24 14:18:51 +01:00
Vsevolod Tolstopyatov
a00e98bad9 KT-36118 Introduce AbstractCoroutineContextKey and corresponding extensions required by its implementors
* It enables subtyping relationship for keys and elements, allowing type-safe and concise manipulations on the context when complex hierarchies of elements (e.g. implementors of ContinuationInterceptor) are present
    * It unblocks possibility to implement suspendCancellableCoroutine in stdlib
    * Implementing proper polymorphic get and minusKey in AbstractCoroutineContextElement is impossible because it will introduce source-incompatible change
    * ContinuationInterceptor get and minusKey are adjusted in a completely backwards-compatible way
2020-01-24 16:17:14 +03:00
Anton Yalyshev
90fe1bb1ab Enable FUS for Code Completion in 1.3.70 2020-01-24 16:05:20 +03:00
Ilya Gorbunov
7bb504321c KT-15363 Rename expectedSize to capacity and edit docs 2020-01-24 15:28:35 +03:00
Ilya Gorbunov
14351446d7 KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation
2020-01-24 15:28:18 +03:00
Ilya Gorbunov
4aa7d45a5a KT-15363 Collection builders: improve tests and samples 2020-01-24 15:28:17 +03:00
Fleshgrinder
bf9d3d87a6 KT-15363 Collection Builders
Added container builders for lists, sets, and maps.
The new experimental type inference only works for the simple builders
with a single generic type. The versions with nullability and the maps
still require explicit specification of the types. Obviously explicit
specification is required for all users who are not using the new
experimental inference. Improving the type inference is something that
should be done separately and many things – including these builders –
will benefit from it, however, this is not a blocker for these builders
in my opinion.
2020-01-24 15:28:17 +03:00
Ilya Goncharov
fa811c731f [IDEA] Use withType instead of isAssignableFrom
#KT-36093 fixed
2020-01-24 15:25:25 +03:00
Ilya Goncharov
6dc9109736 [IDEA] Check assignable from task to KotlinTest class 2020-01-24 15:23:23 +03:00
Ilya Goncharov
6b860206bd [IDEA] Use GradleVersion fqn to use it in case when there is no import 2020-01-24 15:23:22 +03:00
Ilya Goncharov
c3951d394b [IDEA] Preload KotlinTest class instead of loop finding 2020-01-24 15:23:22 +03:00
Ilya Goncharov
2c4cfd2fb8 [IDEA] Add check on gradle version not to broke Gradle older 4.0 2020-01-24 15:23:22 +03:00
Dmitriy Novozhilov
20ac606df4 Add js runtime to failing blackbox test 2020-01-24 14:17:44 +03:00
Shagen Ogandzhanian
de07d3387b Update dukat dependency to 0.0.26 2020-01-24 12:09:05 +01:00
Alexander Udalov
2fca7f1a54 Add codegen tests for old behavior of null checks
#KT-22275
2020-01-24 11:56:28 +01:00
Yan Zhulanow
632fe18db6 Revert "Remove deprecated method from CommandLineProcessor"
This reverts commit 508330e0bb.

An external plugin depends on the deprecated API: com.jereksel.jailbreakk:0.0.2.
2020-01-24 18:12:21 +09:00
Yan Zhulanow
9bf63f5399 Kapt, minor: Add extra case for property initializers 2020-01-24 18:12:21 +09:00
pyos
ca3c1d04c5 Add an IR version of Android Extensions blackbox tests 2020-01-24 18:12:21 +09:00
pyos
4094841dc6 Add a basic IR extension to the Android plugin
Only supports uncached findViewById/findFragmentById for now; other
features are experimental and the cache only affects performance, so
this should probably be fine for testing Android apps with -Xuse-ir.
2020-01-24 18:12:21 +09:00
Kevin Bierhoff
6d32b3256b suppress duplicate @Override annotations 2020-01-24 18:12:21 +09:00
Natalia Selezneva
a55a0d94de Scripts: clear manual configuration loading state after project import
^KT-35268
2020-01-24 11:52:57 +03:00
Andrey Uskov
bbdad45201 Added project size and metrics collectors in gradle plugin 2020-01-24 11:23:31 +03:00
Dmitry Petrov
c540116b71 IR: additional callable reference adapter stuff in IR
- IrFunctionReference.reflectionTarget: IrFunctionSymbol?
- add separate declaration origin for callable reference adapters
- bump IR ABI version
2020-01-24 11:21:26 +03:00
Dmitry Petrov
57bbfbbfcc PSI2IR: capture adapted reference receiver to a local val if required 2020-01-24 11:21:25 +03:00
Dmitry Petrov
38b90b7fbd Minor: move callable reference IR tests to a separate directory 2020-01-24 11:21:25 +03:00
Dmitry Petrov
c5f14a29a4 PSI2IR: Generate adapted callable references
Callable reference is "adapted" if it requires some adaptation to an
expected function type - e.g., when a reference to
```
  fun foo(vararg xs: Int): Int
```
is used where `(Int, Int, Int) -> Int` is expected.

For such callable references we generate the following IR (in
pseudo-Kotlin):
```
  {
    fun foo'(p0: Int, p1: Int, p2: Int): Int {
      return [| foo(p0, p1, p2) |]
    }
    ::foo'
  }
```

where `[| foo(p0, p1, p2) |]` is calling function `foo` with arguments
`p0`, `p1`, and `p2`, as they were mapped by callable reference
resolution.
2020-01-24 11:21:25 +03:00
Dmitry Petrov
89c832b5a0 FE: provide argument mapping info for adapted callable reference 2020-01-24 11:21:25 +03:00
Ilya Kirillov
da7d594d0f Wizard: change new wizard title 2020-01-24 11:13:04 +03:00
Ilya Kirillov
90108e146a Wizard: make new wizard to be second in the Kotlin group 2020-01-24 11:13:03 +03:00
Ilya Kirillov
35076eb559 Wizard: add FUS statistic collection 2020-01-24 11:13:01 +03:00
Ilya Kirillov
6915193337 Wizard: allow simple js template to be used with JsSingleplatformModuleConfigurator 2020-01-24 11:13:00 +03:00
Ilya Kirillov
4854294bb5 Wizard: fix removing template in UI 2020-01-24 11:12:58 +03:00
Ilya Kirillov
3d6aa79f45 Wizard: allow enabling new wizard in UI 2020-01-24 11:12:56 +03:00
Ilya Kirillov
fa4cba341b Wizard: fix tests 2020-01-24 11:12:55 +03:00
Ilya Kirillov
217cf3edd1 Wizard: fix adding dependencies to targets 2020-01-24 11:12:54 +03:00
Ilya Kirillov
3d5007c1a5 Wizard: temporary hide sourcesets editing for users 2020-01-24 11:12:53 +03:00
Ilya Kirillov
c87ece8ae5 Wizard: fix incorrectly added classpath dependency for Android with Groovy dsl 2020-01-24 11:12:52 +03:00
Ilya Kirillov
d5618cadc8 Wizard: put pluginManagement section in the beginning of settings.gradle file 2020-01-24 11:12:50 +03:00
Ilya Kirillov
0a4d45b347 Wizard: add support of creating run configurations
#KT-36043 fixed
2020-01-24 11:12:48 +03:00
Ilya Kirillov
d330652eee Wizard: add support of react js to the js template 2020-01-24 11:12:47 +03:00
Ilya Kirillov
351a037bcd Wizard: fix not added dependencies for MPP modules 2020-01-24 11:12:46 +03:00
Ilya Kirillov
0f86a7e158 Wizard: fix text of module configurators which is shown in module editor 2020-01-24 11:12:44 +03:00
Ilya Kirillov
dc26138da3 Wizard: add support of JS singleplatform projects 2020-01-24 11:12:43 +03:00
Ilya Kirillov
b9226ce54f Wizard: automatically determine Kotlin version based on Kotlin plugin version
For snapshot plugin just take the latest eap or stable version
2020-01-24 11:12:40 +03:00
Ilya Kirillov
40d6fe7a00 Wizard: remove empty border from module settings 2020-01-24 11:12:39 +03:00
Ilya Kirillov
129ee55fe0 Wizard: remove unused function 2020-01-24 11:12:38 +03:00
Ilya Kirillov
18090c0e0a Wizard: fix incorrectly added modules to the tree 2020-01-24 11:12:37 +03:00
Ilya Kirillov
5392ff128f Wizard: move "validation error" string from message to title 2020-01-24 11:12:36 +03:00
Ilya Kirillov
5f8930e109 Wizard: add validation for project name 2020-01-24 11:12:35 +03:00
Ilya Kirillov
09b50a209b Wizard: do not suggest invalid groupId 2020-01-24 11:12:25 +03:00
Ilya Kirillov
1b4e282540 Wizard: do not show expert panel form wizard 2020-01-24 11:12:10 +03:00
Ilya Kirillov
7527e4b02d Wizard: remove duplicated string validator 2020-01-24 11:12:09 +03:00
Ilya Kirillov
b33ae61508 Wizard: add validators for POM data 2020-01-24 11:12:08 +03:00
Ilya Kirillov
7df1b54c82 Wizard: Show message when module has no configurable settings 2020-01-24 11:12:06 +03:00
Ilya Kirillov
923f646b3d Wizard: Move test framework settings to module configurators 2020-01-24 11:12:04 +03:00
Ilya Kirillov
ba62ba39f1 Wizard: Move module templates to modules: separate SourcetModuleIR to MultiplatformModuleIR & SourcesetIR 2020-01-24 11:12:03 +03:00
Ilya Kirillov
0ebcf482ca Wizard: move module templates to modules 2020-01-24 11:12:02 +03:00
Ilya Kirillov
5673804707 Wizard: add module dependencies for JPS 2020-01-24 11:12:01 +03:00
Ilya Kirillov
479f6a4402 Wizard: add kotlin native console application template 2020-01-24 11:11:59 +03:00
Ilya Kirillov
9e96cd4507 Wizard: do not print binaries specification for all native targets
#KT-35719 fixed
2020-01-24 11:11:58 +03:00
Ilya Kirillov
bf93d767b3 Wizard: sort & distinct imports in Gradle build files 2020-01-24 11:11:57 +03:00
Ilya Kirillov
dd882c2717 Wizard: move fqName to import in NativeTargetConfigurator 2020-01-24 11:11:56 +03:00
Ilya Kirillov
97416e651e Wizard: add irs for build files from targets 2020-01-24 11:11:55 +03:00
Ilya Kirillov
2a83111fa3 Wizard: do not add empty gradle project to settings.gradle 2020-01-24 11:11:54 +03:00
Ilya Kirillov
afc320ac8d Wizard: use settings.gradle instead of .kts for Groovy DSL Gradle projects
#KT-35694 fixed
2020-01-24 11:11:53 +03:00
Ilya Kirillov
4f4106a17e Wizard: print repositories for Maven
#KT-35715 fixed
2020-01-24 11:11:52 +03:00
Ilya Kirillov
bced2655e8 Wizard: retrieve repositories from artifacts 2020-01-24 11:11:51 +03:00
Ilya Kirillov
baedd2a253 Wizard: correctly add Kotlin dependencies to singleplatform modules with gradle dsl build system
#KT-35695 fixed
2020-01-24 11:11:47 +03:00
Ilya Kirillov
796848b5a9 Wizard: fix adding invalid dependencies for maven build files
#KT-35711 fixed
2020-01-24 11:11:45 +03:00
Ilya Kirillov
029dad4d9e Wizard: allow dashes for module names
#KT-35584 fixed
2020-01-24 11:11:40 +03:00
Ilya Kirillov
6acf279a34 Wizard: Use default Java source roots for JPS projects
#KT-35710 fixed
2020-01-24 11:11:37 +03:00
Ilya Kirillov
206284d33c Wizard: rework UI components for settings
#KT-35712 fixed
2020-01-24 11:11:36 +03:00
Ilya Kirillov
89199e5cc0 Wizard: fix incorrect ktor repository
#KT-35718 fixed
2020-01-24 11:11:34 +03:00
Ilya Kirillov
2df499b12d Wizard: remove redundant return in native target configuration
#KT-35720 fixed
2020-01-24 11:11:33 +03:00
Ilya Kirillov
bfe3b58264 Wizard: fix swapped artifactId and groupId fields titles
#KT-35690 fixed
2020-01-24 11:11:32 +03:00
Ilya Kirillov
49e8513928 Wizard: do not overwrite existing artifactId & groupId settings
#KT-35713 fixed
2020-01-24 11:11:31 +03:00
Dmitry Savvinov
37c7212a30 Normalize line separators in GradleImportingTestCase 2020-01-24 11:00:17 +03:00
Dmitry Savvinov
56286cd4dc Fix overly restrictive cast to allow running multiplatform tests for objects
^KT-35480 Fixed
2020-01-24 11:00:17 +03:00
Dmitry Savvinov
77a7ceaa55 Add test on object with tests in common module
^KT-35480 In Progress

(current behavior is undesired, see fix in next commit)
2020-01-24 11:00:17 +03:00
Dmitry Savvinov
f78ea75431 Fix running tests from expect class by using FakeLightClasses
Unfortunately, IJ API requires us to return instances of
PsiClass/PsiMethod in order to proceed with run configuration creation.

In fact, those instances will be queried only by trivial requests, like
containingFile or name. Therefore, full-blown LightClasses are not
needed and even harmful, because for some declarations we can not build
proper light classes (like for expect declarations, for example)

Previously it mostly worked because most of declarations in common
indeed have corresponding Light-instances (because common source-set can
be seen from Java through JVM-part of a project).

^KT-34503 Fixed
2020-01-24 11:00:16 +03:00
Dmitry Savvinov
cea612cba4 Add test on expect class with test methods inside
^KT-34503 In Progress

(current behaviour is undesired, see next commit for fix)
2020-01-24 11:00:16 +03:00
Dmitry Savvinov
36aa14ead4 Add testing support for MPP projects 2020-01-24 11:00:16 +03:00
Dmitry Savvinov
b34f091fa4 Introduce tests runner for run configurations + highlighting + Gradle
This allows us to check two things:
- presence of line markers (haven't been checked by old
  GradleTestRunConfigurationTests, though could've been checked by
  LineMarkerTests)
- some properties of run configurations which will be created from those
  line markers

Old GradleTestRunConfigurationTest have been renamed to
GradleTestRunConfigurationCustomTest and slightly modified to be able
to re-use the same testdata if necessary.
2020-01-24 11:00:16 +03:00
Dmitry Savvinov
4f5c3d1387 Allow rendering extra tags for lineMarkers in tests 2020-01-24 11:00:16 +03:00
Dmitry Savvinov
5800160ee1 Rewrite GradleDaemonAnalyzerTest
Previously, GradleDaemonAnalyzer reused common IJ infrastructure for
highlighting tests (see DaemonAnalyzerTеstCase, ExpectedHighlightingData
and such).

Unfortunately, this infrastructure had several flaws,
mainly around checking expected highlighting against actual one:

- overlapping line markers lead to crash (fixed in 193+)

- no way to sanitize descriptions of line markers (important for cases
where description returns HTML-formatted text, which makes testdata
completely unreadable and also drives parser insane)

- thrown FileNotFoundException doesn't have a physical file with
expected testdata attached, which makes browsing diff a little less
convenient (no way to apply changes to expected file)

- no easy way to plug-in with additional after-highlighting checks

This commit fixes it by overriding doCheckResult and providing custom
checking of highlighting/line markers, based on TagsTestDataUtil.
Because we don't rely on IJ-checking anymore, we also remove weird hoops
with removing/adding testdata markup in checkFiles.
Also this commit adds strings sanitization in TagsTestDataUtil, removing HTML-tags
and line breaks, so that description of tag is always one-liner with
plain text.
2020-01-24 11:00:16 +03:00
Dmitry Savvinov
a02e5d452f Minor: remove unnecessary callback from checkFiles
Filter list of files on call-sites instead
2020-01-24 11:00:16 +03:00
Dmitriy Novozhilov
3dfad4f0c3 [FIR] Fix generating properties for varargs in primary constructors 2020-01-24 10:57:52 +03:00
Dmitriy Novozhilov
69927409fc [FIR] Fix exhaustiveness check when subject has flexible type 2020-01-24 10:57:52 +03:00
Anton Yalyshev
0f049fd536 Properly handle a case when Code Style settings = null 2020-01-24 10:14:46 +03:00
Abduqodiri Qurbonzoda
e89893b6fd Optimize ArrayDeque tests run time 2020-01-24 05:52:18 +03:00
Ilya Gorbunov
8733d5f9ed ArrayDeque: avoid triggering JDK 1.6 bug in tests
Use System.arraycopy instead of Arrays.copyOfRange to
avoid triggering JDK-7174363 bug in copyOfRange.

Fix package of ArrayDequeTest
2020-01-24 01:39:48 +03:00
Vladimir Dolzhenko
6352cded1b Add modCounter to invalidate synthetic file cache
#KT-35186 Fixed
2020-01-23 21:18:13 +01:00
Mark Punzalan
7329a1641a [JVM IR] Fix lambdaInLocalFunction.kt by adding helper methods that
return the target backend under test.
2020-01-23 19:16:27 +01:00
Andrey Uskov
beb3165839 Added FUS extensions and new metrics for reporting statistics from gradle 2020-01-23 20:47:21 +03:00
Andrey Uskov
bac0309a9b Added tests to gradle statistics reporter 2020-01-23 20:47:20 +03:00
Andrey Uskov
33d89e15b5 Metric description and anonymization rules added
Added metrics and their anonymization rules added. Persisted gradle
statistical information will not contain any sensitive information.
#KT-33404 Fixed
2020-01-23 20:47:19 +03:00
Andrey Uskov
763e02b3e8 Collecting performance information in Gradle plugin supported
The build performance information is collected during the build
when the Kotlin Gradle plugin is applied. Only hashed values are
saved if they may contain sensitive information. Numeric metrics
obtained on the basis of user's project are saved with random seed.
Persisted information is saved in gradleUserHomeDir.

#KT-33404 Fixed
2020-01-23 20:47:19 +03:00
Andrey Uskov
e1d03e1f3a Open files leak on incremental compilation fixed
#KT-25206 Fixed
2020-01-23 20:47:18 +03:00
Andrey Uskov
44edfc3717 Do not show warnings when some projects are not generated before import
#KT-35442 Fixed
2020-01-23 20:45:26 +03:00
Ilya Gorbunov
76759d3a5f Drop compatibility stub for experimental unsigned API from 1.3.0 2020-01-23 19:38:02 +03:00
Ilya Gorbunov
39078342ee Remove mod function deprecation tests
#KT-26654
2020-01-23 19:28:23 +03:00
Ilya Gorbunov
b1766b167f Remove mod function usage from tests
#KT-26654
2020-01-23 19:28:23 +03:00
Ilya Gorbunov
9fffa61596 Update builtin serialization tests
#KT-26654
2020-01-23 19:28:22 +03:00
Ilya Gorbunov
8f37ace9ee Finally drop deprecated mod functions from numeric types
#KT-26654
2020-01-23 19:28:22 +03:00
Pavel Kirpichenkov
06550a6d31 [NI] Actualize spec tests, affected by KT-35668
Update test data, remove obsolete 'UNEXPECTED BEHAVIOUR'
2020-01-23 19:12:02 +03:00
Pavel Kirpichenkov
78c9bbcc0d [NI] Soften restictions on using Nothing as proper constraint for full call completion
Consider lower `Nothing` constraint non-proper only if there is a dependant not analyzed postponed atom.
Early completion to `Nothing` provides data flow info for smart casts.

KT-35668 Fixed
2020-01-23 19:12:01 +03:00
Mikhail Zarechenskiy
f1d9177112 [NI] Fix issue with returning non-deparenthesized lambdas from labmdas
#KT-36080 Fixed
2020-01-23 18:56:02 +03:00
Mikhail Zarechenskiy
6b07ef42dd [NI] Update testdata for NI after switching language versions 2020-01-23 18:56:01 +03:00
Mikhail Zarechenskiy
7bd7db839d [NI] Fix adapting arguments for callable references with receivers
#KT-35912 Fixed
2020-01-23 18:56:00 +03:00
Leonid Startsev
43858e8169 Do not include annotations and KDoc into NO_EXPLICIT_VISIBILITY_IN_API_MODE report range
Rename positioning strategy to better reflect its behavior.
#KT-36021 fixed.
2020-01-23 17:05:51 +03:00
Leonid Startsev
4285c6045a Fix unavailable 'Specify visibility explicitly' quickfix
in explicit API mode due to incorrect cast.
Add tests for applying this quickfix.
#KT-36020 fixed.
2020-01-23 17:05:50 +03:00
Dmitry Gridin
f44fa67a51 Fix compilation for 192 2020-01-23 18:55:06 +07:00
Dmitriy Novozhilov
194d5a61dc [FIR-TEST] Add tests with problems of fir resolve 2020-01-23 14:52:56 +03:00
Dmitriy Novozhilov
f68542e651 [FIR] Add FirEnumEntry to HTML dump 2020-01-23 14:31:33 +03:00
Dmitriy Novozhilov
14cf7a3d16 [NI] Add collecting forgotten type variables from callable references
#KT-35959 Fixed
2020-01-23 14:30:28 +03:00
Dmitriy Novozhilov
be74e92c27 [NI] Add missing type variables to common system in builder inference
#KT-35967 Fixed
2020-01-23 14:30:28 +03:00
Anton Yalyshev
6d49f36cd6 Add bunches for unsupported versions 2020-01-23 14:21:06 +03:00
Anton Yalyshev
1d7dcf3633 Add Formatter settings tracking to FUS 2020-01-23 14:21:05 +03:00
Anton Yalyshev
7c0d8ad6c7 Add languageVersion tracking to FUS 2020-01-23 14:21:05 +03:00
Dmitry Gridin
556814e9b6 TrailingCommaVisitor: add checkCanceled for the recursive case
#KT-34744
2020-01-23 18:02:29 +07:00
Dmitry Gridin
522ae4945e TrailingCommaPostFormatProcessor: convert mapNotNull to filter
#KT-34744
2020-01-23 18:02:29 +07:00
Roman Golyshev
a2b2c47b51 KT-34795 Use maven(...) instead of maven { setUrl(...) } for gradle scripts generation
- Use new syntax in tests, but not in actual gradle files
- Reuse public `toKotlinRepositorySnippet` instead of private one
- ^KT-34795 Fixed
2020-01-23 13:45:16 +03:00
Roman Golyshev
3dbc058db9 KT-34795 Remove obsolete Gradle 3.5 test data
- Tests do not run with Gradle 3.5 anymore
2020-01-23 13:45:16 +03:00
Dmitry Gridin
7627834dd0 TrailingCommaInspection: report Missing trailing comma on argument
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin
5aa413014b FormatterUtil: cleanup code 2020-01-23 17:36:38 +07:00
Dmitry Gridin
80194dd536 Trailing comma: cleanup code after review
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin
ac8a8ecab4 ktPsiUtil: cleanup code 2020-01-23 17:36:38 +07:00
Dmitry Gridin
b045513642 KotlinCommonBlock: cleanup code 2020-01-23 17:36:38 +07:00
Dmitry Gridin
63ee723928 TrailingCommaPostFormatProcessor: improve findInvalidCommas
Add case for line break between argument and comma
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin
ca1aa6ed4e TrailingCommaInspection: should report Missing line break
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin
3e722887ab RedundantSemicolonInspection: move isLineBreak to utils 2020-01-23 17:36:38 +07:00
Dmitry Gridin
9b64a1d18a TrailingCommaInspection: should report Missing trailing comma on symbol after argument
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin
66fa54d805 TrailingCommaInspection: introduce enum TrailingCommaAction
#KT-34744
2020-01-23 17:36:37 +07:00
Pavel Kirpichenkov
c5893913f3 [NI] Remove lambda coersion to Unit in case of error return type(s)
Coersion to Unit from error type leads to misleading type mismatches:
"expected <expected lambda return type> found Unit", despite no user-provided Unit / empty lambda.
These diagnostics were collected, but not reported before, and that had been disguising the issue for a while.

KT-34729 Fixed
2020-01-23 13:18:50 +03:00
Pavel Kirpichenkov
3a98c84105 [NI] Make behaviour of anonymous functions consistent with lambdas
Fix completion of anonymous functions with expression body without expected type.
Premature completion led to losing type info from outer calls.
Also report type mismatches on empty lambda expressions.

KT-34729 In progress
2020-01-23 13:18:49 +03:00
Kirill Shmakov
4554f91aff Add cocoa binary dependencies 2020-01-23 13:08:01 +03:00
Leonid Startsev
9e8f21cc20 Search for standard serializers in both internal and root packages
To allow graduate migration of some classes (e.g. IntSerializer)
from kotlinx.serialization.internal.* to kotlinx.serialization.*
2020-01-23 12:40:06 +03:00
Leonid Startsev
db4273d677 Pass actual serializable properties count in the generated code
to SerialClassDescImpl.
This is needed to optimize space allocation.
2020-01-23 12:40:04 +03:00
Leonid Startsev
9558538d15 Refactor plugin-generated call to EnumSerializer():
support new values() argument.
Get rid of old @JvmOverloads requirements in runtime.
2020-01-23 12:40:03 +03:00
Mikhail Glukhikh
94ec22762a Rename: FirLibrarySymbolProviderImpl -> FirBuiltinSymbolProvider 2020-01-23 12:32:41 +03:00
Mikhail Glukhikh
2086c34cb9 [FIR] Fix callable references to fields / parameters / etc.
Before this commit, only references to functions & properties
were possible, now fields & parameters are also supported
2020-01-23 12:32:40 +03:00
Mikhail Glukhikh
c37394ec83 [FIR] Count alias reference with type arguments as qualifier w/out value 2020-01-23 12:32:40 +03:00
Mikhail Glukhikh
e39df5bb91 [FIR] Support type aliases in double colon expression resolver 2020-01-23 12:32:40 +03:00
Mikhail Glukhikh
84c8697720 [FIR] Do not build synthetics for static or Unit returning get 2020-01-23 12:32:40 +03:00
Mikhail Glukhikh
69ecbd93a9 [FIR] Fix type alias handling in qualifier position 2020-01-23 12:32:39 +03:00
Mikhail Glukhikh
e644edfe84 [FIR] Handle unresolved callable references more correctly 2020-01-23 12:32:39 +03:00
Mikhail Glukhikh
97d8f3fa4b [FIR TEST] Add test for erroneous callable reference resolve 2020-01-23 12:32:39 +03:00
Mikhail Glukhikh
c1207dd5af [FIR] QualifierReceiver minor cleanup 2020-01-23 12:32:38 +03:00
Natalia Selezneva
858698cf9a Provide a notification for gradle script that aren't related to any gradle project (KT-35268)
Add action to load/reload configuration for them manually
^KT-35268 Fixed
2020-01-23 11:12:54 +03:00
Natalia Selezneva
a373ab96d4 Implement persistent storage for script class path roots (KT-35886)
Save absolute paths instead of getCanonicalPath usages

^KT-34444
^KT-35886 Fixed
2020-01-23 11:06:01 +03:00
Dmitriy Dolovov
c59e794ab4 K/N KLIBs detection in Gradle plugin: drop useless code 2020-01-23 15:05:07 +07:00
Dmitriy Dolovov
72b7023529 Minor: Rename NativePlatformConfigurator for consistency 2020-01-23 15:05:00 +07:00
Dmitriy Dolovov
6a24d8432c Properly retrieve compiler version from K/N distribution 2020-01-23 15:04:44 +07:00
Mikhail Glukhikh
5eb0c83965 [FIR] Fix failing tests 2020-01-23 10:12:15 +03:00
Abduqodiri Qurbonzoda
1203df7405 Deprecate floating point to integral types lesser than Int #KT-30360 2020-01-22 23:27:35 +03:00
Abduqodiri Qurbonzoda
e459542e6f Add removeFirst(OrNull) and removeLast(OrNull) methods to MutableList 2020-01-22 23:22:28 +03:00
Abduqodiri Qurbonzoda
b6849efd47 Common ArrayDeque 2020-01-22 23:22:21 +03:00
Vladimir Dolzhenko
db8b0a6593 Show Review Added Imports on paste action
Fixed multi-caret selection in kotlin-to-kotlin copy-paste processor

Relates to #KT-33939
2020-01-22 17:14:04 +01:00
Vladimir Ilmov
84fd5b35eb Revert "[coroutine] For RUNNING coroutines -1 is the correct number"
This reverts commit cc317d7548.
2020-01-22 16:39:55 +01:00
Vladimir Ilmov
ed09c673f8 AsyncStackTraceContext extra logging removed 2020-01-22 16:35:57 +01:00
Steven Schäfer
aea5e3ffbc JVM IR: Remove type substitutions from ExpressionCodegen
Instead, determine whether the return type of a call is Nothing, by
looking at the type of the call expression.
2020-01-22 15:51:11 +01:00
pyos
2f0f4e570f JVM_IR: do not remap locals in contexts nested inside lambdas
The only case where this code is reachable at all is objects in lambdas
that use reified type parameters of the outer inline function. Since the
type parameters are declared outside the inlining root, regenerating the
object is actually pointless, and remapping its captures even more so
(not to mention that the code under the condition uses the captures of
the lambda, not of the method it's currently transforming).
2020-01-22 15:36:09 +01:00
nikita.movshin
8e79d9b90e Add changelog for 1.3.60 2020-01-22 16:58:05 +03:00
Alexander Udalov
3ca0f8a569 Fix incorrect message for new nullability assertion exception in 1.4
#KT-36026 Fixed
2020-01-22 14:41:20 +01:00
Vladimir Ilmov
cc317d7548 [coroutine] For RUNNING coroutines -1 is the correct number 2020-01-22 14:40:19 +01:00
Mikhail Zarechenskiy
aa48f2e363 Unmute test about fun interfaces for JVM IR 2020-01-22 15:35:06 +03:00
Zalim Bashorov
e6074e8759 [JS BE] Unmute test 2020-01-22 15:20:41 +03:00
Zalim Bashorov
f92376fbbd [BE test] Extract and mute cases which don't work on JS from eqNullableDoubles.kt and eqNullableDoubles.kt 2020-01-22 15:20:41 +03:00
Ilya Goncharov
79fa3c2c30 [Gradle, JS] Fix check on klib 2020-01-22 14:52:45 +03:00
Dmitriy Novozhilov
72cb0de705 [FIR-TEST] Update testdata 2020-01-22 14:49:23 +03:00
Dmitriy Novozhilov
93906bad1d [FIR] Add workaround about incorrect safe call invoke desugaring
#KT-36014
2020-01-22 14:49:23 +03:00
Dmitriy Novozhilov
62e01a8aa4 [FIR] Update smartcast info for receiivers when enter to when condition 2020-01-22 14:49:23 +03:00
Dmitriy Novozhilov
9684ff7071 [FIR] Don't create smartcasts to error types 2020-01-22 14:49:23 +03:00
Dmitriy Novozhilov
384a094193 [FIR] Unbound aliased variables in DFA more carefully 2020-01-22 14:49:23 +03:00
Dmitriy Novozhilov
2a23e14e2b [FIR-TEST] Fix problem test without proper smartcast 2020-01-22 14:49:22 +03:00
Dmitriy Novozhilov
d7c85406fb [FIR-TEST] Mute some failing tests according to changes in DFA 2020-01-22 14:49:22 +03:00
Dmitriy Novozhilov
9bc62fc34d [FIR-TEST] Mute test due to incorrect invoke desugaring 2020-01-22 14:49:22 +03:00
Dmitriy Novozhilov
5f639dd2ae [FIR-TEST] Update testdata of old frontend tests 2020-01-22 14:49:22 +03:00
Dmitriy Novozhilov
19e0b8039b [FIR] Cleanup DFA code and rename some classes for better understanding 2020-01-22 14:49:22 +03:00
Dmitriy Novozhilov
16a9ca5912 [FIR] Remove old DFA 2020-01-22 14:49:21 +03:00
Dmitriy Novozhilov
5d3b75ebc3 [FIR] Implement new data flow analysis 2020-01-22 14:49:21 +03:00
Ilya Matveev
2c66c3b0b6 Gradle, native: Allow setting destination directory for binaries
Issue #KT-29395 fixed
2020-01-22 17:29:32 +07:00
Ilya Matveev
df46dfc63d Gradle, native: Don't pass to compiler missing klib files
We don't compile a klib if there are no sources for it (NO-SOURCE
checks). So, we need to take this fact into account and don't
pass such libraries to compiler in dependent modules. See also:
GH-2617 in the K/N repo.

This patch checks that a klib file exists before passing it to the
compiler.
2020-01-22 17:29:31 +07:00
Ilya Matveev
ce45df2c96 Gradle, tests: Skip building in native binaries test for Groovy DSL
This test is one of the most time-consuming tests because
it builds a lot of final native binaries. Moreover, it exists
in two versions: for Groovy DSL and for Kotlin DSL. The only
difference between these versions is build script DSL.

This patch disables project building for the Groovy DSL version to
reduce total test execution time. Now this test only checks that
project configuration is successful. But it's enough to detect DSL
problems.
2020-01-22 17:29:30 +07:00
Ilya Matveev
01622f069e Gradle, native: Support exporting dependencies for static and shared libs
Issue #KT-35352 fixed
2020-01-22 17:29:30 +07:00
Sergey Rostov
c7e3df506d gradle.kts importing: proper check for root project 2020-01-22 12:08:30 +03:00
Natalia Selezneva
b38836c488 Fix script configurations for gradle project without source roots in 193 and as40
GradleKtsImportTest:testEmpty fixed
2020-01-22 09:48:04 +03:00
Ilya Gorbunov
7ec04a1bf9 generators: extract OperationsMap generator to a separate source set
Refactor generators so that OperationsMapGenerator is in its own
source set with minimal dependencies.
2020-01-22 06:16:56 +03:00
Ilya Gorbunov
2251c27167 J2K GeneratorsFileUtil 2020-01-22 06:04:38 +03:00
Ilya Gorbunov
d64ec71205 J2K GeneratorsFileUtil: Rename .java to .kt 2020-01-22 06:04:38 +03:00
Dmitry Petrov
64a405e7a0 IR: 'fun interface' support 2020-01-22 00:12:03 +03:00
Ilmir Usmanov
a55989a2a5 JVM_IR: Support interface delegation of suspend functions
The issue was, that built IR function does not have a PSI element,
which is required to report error on suspend functions inside monitors.
In this case, use PSI element of the class, containing the function,
which is consistent with old BE.
2020-01-21 19:59:02 +01:00
Alexander Udalov
e34a207725 Implement KTypeProjection.toString
The implementation is checked by tests on typeOf.

 #KT-30071 Fixed
2020-01-21 19:34:01 +01:00
Vladimir Dolzhenko
3a90e2dd75 Store addUnambiguousImportsOnTheFly in kotlin code insight settings
store optimizeImportsOnTheFly in kotlin code insight workspace settings

#KT-36034 Fixed
2020-01-21 17:53:23 +01:00
Alexander Podkhalyuzin
70ed03ac4b Now using Kotlin setting instead of Java one in 191 as well 2020-01-21 17:52:41 +01:00
Ilya Chernikov
dca0a71d9b Add only non-jdk classpath entries from the compiler to script
remove unnecessary manifest classpath entries in the saved compiled
script jar
2020-01-21 17:42:48 +01:00
Ilya Chernikov
75441386e3 Use scripting cache earlier in the pipeline:
before initializing compiler and processing callbacks
2020-01-21 17:42:48 +01:00
Ilya Chernikov
c7d9eaed40 Speed up REPL package member declaration provider
about 10-15% on specific test
also preparing test infrastructure for it
2020-01-21 17:42:48 +01:00
Ilya Chernikov
cb7cc8ac6b [minor] fix typo in function name 2020-01-21 17:42:48 +01:00
Ilya Chernikov
1b65ec75ad Immplement default cache in main-kts 2020-01-21 17:42:48 +01:00
Ilya Chernikov
a4752087db Get rid of kotlinx.coroutines usage in saved script runner
to reduce dpendencies for the save dscipt running
2020-01-21 17:42:48 +01:00
Ilya Chernikov
891914167a Switch cli expression evaluation argument syntax to -expression/-e
#KT-35414 fixed
2020-01-21 17:42:48 +01:00
Ilya Chernikov
5f15cacb1b Fix ivy mapping to the maven repos in main-kts 2020-01-21 17:42:48 +01:00
Ilya Chernikov
b5ac35dec1 Implement automatic loading of .main.kts scripts support
also fix discovery from ScriptDefinitionsProvider
2020-01-21 17:42:48 +01:00
Ilya Chernikov
d15d62a338 Check REPL snippet syntax before calling analysis
restores the behaviour of the GenericRepl implementation and fixes
issues then invalid code is being compiled
#KT-34888 fixed
2020-01-21 17:42:48 +01:00
Steven Schäfer
8e07482862 JVM IR: Fix generation of parameterless default constructor
The JVM backend does not generate parameterless default constructors for
private constructors and constructors of local, inner, or inline
classes.
2020-01-21 16:34:33 +01:00
Alexander Udalov
5321a6af33 Forbid spread operator in signature-polymorphic calls
#KT-35226 Fixed
2020-01-21 15:57:35 +01:00
Alexander Udalov
b6feec4115 Add language version 1.5 2020-01-21 15:57:35 +01:00
Alexander Udalov
8e2b76698a Remove -Xno-use-ir from modules where JVM IR problems are fixed
The problems in JVM IR backend in these modules are fixed by:
* kapt3-cli -- 1c527fc1
* frontend -- 174b3db7
* daemon-common-new -- 6fe214d8 & d17afdda
2020-01-21 15:09:29 +01:00
Alexey Tsvetkov
d3a93b2015 Remove unneeded IncrementalCompilerRunner#postCompilationHook
The method is no longer needed, since the only implementation is empty.
2020-01-21 16:36:37 +03:00
Alexey Tsvetkov
ba0ce92159 Report messages only after IC scope expansion converged
Incremental compilation scope (set of files to be compiled)
could be expanded, even if the frontend reported some errors
to a message collector.
The next iteration of IC could produce a different set of
compiler messages, so we want to report them only after
scope expansion converged.
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
c912f76d6f Add IC scope expansion tests
#KT-13677
  #KT-28233
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
b979be701e Remove some unneeded gradle specific IC logs
They stoped being different from JPS logs for some time
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
ef83431618 Recompile all dirty files in case of error 2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
2d598d50d7 Expand compilation scope for IC before backend is run
Sometimes IC raises compilation errors when rebuild succeeds.
This happens because IC uses serialized decriptors
for non-dirty files. Serialized descriptors can be different
from source file descriptors. For example, a source file
may contain an implicit return type or an implicit visibility
for overridden methods, but serialized descriptors always
contain explicit return types & methods' visibilities.

These problems can be solved by expanding a scope of incremental compilation
just after the analysis, but before error reporting & code generation.
In other words, we need to compare descriptors before error reporting and code generation.
If there are new dirty files, current round of IC must be aborted,
next round must be performed with new dirty files.

This commit implements IC scope expansion for JS Klib compiler

    #KT-13677
    #KT-28233
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
4f3418dc89 Minor: use CompilerConfiguration#putIfNotNull for IC services 2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
a950226602 Format and cleanup incremental-compilation-impl 2020-01-21 16:36:36 +03:00
Alexey Tsvetkov
5816722a64 Minor: remove unused property 2020-01-21 16:36:36 +03:00
Ilya Gorbunov
db252f60cd Rename task generateTests in android-tests project
The new name is generateAndroidTests.

The output of this task is not committed to VCS, so there's no need
to run it when "Generate All Tests" run configuration is executed.
2020-01-21 16:20:47 +03:00
Natalia Selezneva
f0cb51a5bc KotlinDslScriptModel request shouldn't fail the gradle build 2020-01-21 15:56:01 +03:00
Natalia Selezneva
606279b462 as36: Update to AS 3.6 RC (192.7142.36.36.6071332)
^KT-36005 Fixed
2020-01-21 15:56:01 +03:00
Natalia Selezneva
4699ba758e Remove unnecessary bunch file for AS4.0 2020-01-21 15:56:01 +03:00
Ilya Gorbunov
61b3f447b1 Remove jsIrDist (kotlin.stdlib.js.ir.dist) flag and the logic it enables
It is no longer needed since JS IR is published in JS artifacts,
and there's no longer separate "-js-ir" artifacts.

Changes in BuildProperties.kt will take effect after the next
kotlin-build-gradle-plugin publishing.
2020-01-21 15:54:24 +03:00
Tsvetan
5f0e3018db KT-27856 Add contracts to Timing.kt lambdas (#1987) 2020-01-21 15:42:21 +03:00
Vladimir Ilmov
7dc29a1840 Coroutine debugger starting even if registry key set to false - fixed 2020-01-21 11:39:13 +01:00
Vladimir Ilmov
9f720e576d [coroutine] ComboBox disabled as in progress 2020-01-21 11:39:13 +01:00
Vladimir Ilmov
c33546f678 [coroutine] Exception fixed for SUSPEND coroutines. 2020-01-21 11:39:13 +01:00
Alexander Udalov
99294cfdae Minor, fix test data
TypeCastException was unresolved after an accidental change in
f48bdc1fcb.
2020-01-21 11:26:21 +01:00
Mads Ager
79840a05b2 Fix test expectations.
Do not check for occurrences of "this" on the current backend.
I accidentally unified the checking for the two backends
without checking that it worked (used the wrong test suite to
test).
2020-01-21 11:26:02 +01:00
Georgy Bronnikov
1c527fc159 IR: avoid name clashes between raised local functions. 2020-01-21 12:50:55 +03:00
Dmitriy Novozhilov
4e0b54e1a6 [FIR] Add equality to ConeTypeVariableType 2020-01-21 12:06:34 +03:00
Toshiaki Kameyama
2daedc98b5 KT-35648 RemoveArgumentNameIntention: Support MixedNamedArgumentsInTheirOwnPosition
- ^KT-35648 Fixed
2020-01-21 11:43:37 +03:00
Yaroslav Chernyshev
401baa35ab [Gradle, Native] Implement custom name for generated framework for XCode 2020-01-21 10:23:53 +03:00
Natalia Selezneva
a24e62eaf7 Scripting: do not call getConfiguration inside ScriptClassRootsCache
We already have all configurations inside `all` property.
If script doesn't have loaded configuration getting script sdk - ask for configuration explicitly to avoid situations when configuration is already loaded but not yet saved in memory cache

Looks related to KT-35590
^KT-35590
2020-01-21 10:07:25 +03:00
Ilya Gorbunov
1336da8453 Rename Clock to TimeSource, ClockMark to TimeMark
Step 2: rename classes and interfaces.
Provide deprecated typealiases to smooth migration.
2020-01-21 03:28:35 +03:00
Ilya Gorbunov
a11a25087a Rename Clock to TimeSource, ClockMark to TimeMark
Step 1: rename files
2020-01-21 03:28:35 +03:00
Igor Yakovlev
ac9c106a77 Fix of UL classes muted tests
Add visibility modifier to companion field
Const initializer is now getting for const properties only

Fixed tests:
UltraLightClassLoadingTestGenerated.testAnnotations
UltraLightClassLoadingTestGenerated.testInheritance
UltraLightClassLoadingTestGenerated.testProperties
UltraLightClassSanityTestGenerated.IdeRegression.testImplementingMutableSet
UltraLightClassSanityTestGenerated.IdeRegression.testOverridingFinalInternal_extra
UltraLightClassSanityTestGenerated.IdeRegression.testOverridingInternal
UltraLightClassSanityTestGenerated.IdeRegression.testOverridingInternal_extra
UltraLightClassSanityTestGenerated.IdeRegression.testOverridingProtected_extra
UltraLightFacadeClassTestGenerated.testProperties
UltraLightClassLoadingTestGenerated.testObjects
2020-01-21 03:26:09 +03:00
Ilya Gorbunov
15a441141f Update public API dump after KT-11567 codegen changes came into effect
The only questionable case left is a private companion
in a public interface, which is generated as a public synthetic field
2020-01-20 21:29:50 +03:00
Alexander Udalov
c0600e6873 JVM IR: minor, mute and adapt noCallAssertions.kt to 1.4 2020-01-20 19:12:59 +01:00
Alexander Udalov
078b934580 Mute/unmute JVM backend tests for language version 1.4 2020-01-20 19:12:59 +01:00
Alexander Udalov
f48bdc1fcb Fix codegen box tests for language version 1.4
Since API version 1.4, NullPointerException is thrown for casts of null
to any type instead of TypeCastException.
2020-01-20 19:12:59 +01:00
Alexander Udalov
6a90dc2efe Fix bytecode text tests for language version 1.4
New null check assertions are generated a bit more efficiently, with a
call to `checkNotNull` instead of IFNONNULL+jump.
2020-01-20 19:12:59 +01:00
Ilmir Usmanov
1ef5e25c60 JVM_IR: Minor. Update test data 2020-01-20 18:59:00 +01:00
Ilya Gorbunov
51c5fcc8b8 Drop experimental stdlib sourceset
Haven't used it after pre 1.3
2020-01-20 18:35:21 +03:00
Ilmir Usmanov
6ede10c1ca JVM_IR: Minor. Add test for SMAP of inner object/lambda of inline suspend function 2020-01-20 16:00:36 +01:00
Ilmir Usmanov
877509306d JVM_IR: Minor. Unmute tests. 2020-01-20 16:00:36 +01:00
Ilmir Usmanov
891a55d79a JVM_IR: Fix visibility of inner suspend lambda inside inline function
It should be public, otherwise, after inlining, we will get IllegalAccessError.
2020-01-20 16:00:36 +01:00
Ilmir Usmanov
56c8fdc6c4 JVM_IR: Perform tail-call optimization on IR
It is easier to introduce a new lowering so the codegen will emit code for the old
tail-call optimizer to understand. Also, this is more flexible and would allow to
optimize cases, which are now feasible with the old optimizer.
Note, that because of bytecode inlining, we cannot replace the old one, but we cannot
emit code, that is simpler for it to optimize.
2020-01-20 16:00:35 +01:00
Ilmir Usmanov
9f5b51ed43 JVM_IR: Do not generate fake continuation markers inside inline suspend lambdas
Since the markers replace ALOAD 0 as continuations, passed to suspend calls, in
JVM_IR we do not need this, since in JVM_IR all inline lambdas are static
functions.
2020-01-20 16:00:35 +01:00
Ilmir Usmanov
16d63cd1d0 JVM_IR: Use attributes to find $$forInline version of crossroutine
This way it would not get unlowered version.
2020-01-20 16:00:35 +01:00
Ilmir Usmanov
4d9d62ad12 JVM_IR: Also check attributes for suspendImpls when generating continuation
Otherwise, it would not generate continuations for overloads.
2020-01-20 16:00:34 +01:00
Ilmir Usmanov
d17afddaa9 JVM_IR: Fix bridges generation for suspend functions
Use view's signature as jvm signature.
2020-01-20 16:00:34 +01:00
Ilmir Usmanov
2507e2b526 JVM_IR: Fix parents of $$forInline companions 2020-01-20 16:00:33 +01:00
Ilmir Usmanov
7167d5f75c JVM_IR: Generate $$forInline companion for transformed crossroutines 2020-01-20 16:00:33 +01:00
Ilmir Usmanov
33c0bfb4c2 JVM_IR: Generate $$forInline companion for transformed crossroutines 2020-01-20 16:00:33 +01:00
Ilmir Usmanov
64c1446fbe JVM_IR: Generate $$forInline companion for suspend inline functions
Set isInline flag for $$forInline functions. Otherwise, SMAP will not be generated
for inner objects/lambdas, leading to error in inliner.
2020-01-20 16:00:32 +01:00
Ilmir Usmanov
4ef2ecf9a9 JVM_IR: Add returns unit marker if suspend call returns unit 2020-01-20 16:00:32 +01:00
Vladimir Dolzhenko
1911cbb077 Fixed ProgressIndicatorUtils.kt for 201
#KT-36008 Fixed
Relates to #KT-33939
2020-01-20 15:01:40 +01:00
Dmitriy Novozhilov
5cb7cf040a Update some testdata according switching compiler to 1.4 2020-01-20 16:41:46 +03:00
Sergey Igushkin
796d4da9f5 Fix testLanguageSettingsConsistency with default language version 1.4 2020-01-20 16:37:51 +03:00
Mikhail Zarechenskiy
5c5635ce20 Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
2020-01-20 16:36:03 +03:00
Mads Ager
1ed7e33f42 JVM_IR: Fix default argument bit mask for methods made static.
When called by reflection the bit mask will be generated
discounting dispatch/extension receivers. Make sure that the
interpretation of the bit mask is consistent for direct and
reflective calls.

In addition, this also fixes the modifiers on java 8 parameter
metadata for the dispatch and extension receivers for these
inline class methods.
2020-01-20 12:59:25 +01:00
Leonid Startsev
137c500e3a Support SerializerFactory in Native
kotlinx.serialization plugin now adds additional function to companions
of generic classes in order to overcome lack of reflection. This
helps retrieving generic serializers from KType.
2020-01-20 13:16:17 +03:00
Dmitry Gridin
976db65911 TrailingCommaInspection: replace "Redundant trailing comma" message with "Useless trailing comma"
#KT-34744
2020-01-20 16:56:06 +07:00
Dmitry Gridin
abb82f791e TrailingCommaInspection: add option for missing comma
#KT-34744
2020-01-20 16:56:06 +07:00
Mads Ager
33a24bfd27 JVM_IR: Avoid using parent name in name of captures.
If parent is an anonymous object that could lead to the use
of names such as `$this$no name provided` which is invalid
in dex files.
2020-01-20 10:49:46 +01:00
Yan Zhulanow
9782f6808d Minor: Fix deprecation notice in KotlinIndicesHelperExtension 2020-01-20 17:42:00 +09:00
Yan Zhulanow
520f9a6da5 Kapt: Support all kinds of constant types (KT-35536) 2020-01-20 17:39:22 +09:00
Yan Zhulanow
532e879d5c Pill: Fix gradle-api artifacts attaching after migration to compileClasspath/runtimeClasspath 2020-01-20 17:39:22 +09:00
Yan Zhulanow
ea957872eb Pill: Support Kotlin JUnit configurations 2020-01-20 17:39:22 +09:00
Yan Zhulanow
66cd78fbc0 Pill: Remove robolectric classpath passing 2020-01-20 17:39:22 +09:00
Pavel Kirpichenkov
cb0b44273d [NI] Check stub types in result type
An uninferred parameter stub may leak through calculation of CST(Inv<Uninferred Stub>, Nothing) into a result type.
A stub type in the result type means a type error. So we can afford recalculating
CST with stub-containing types filtered out, since its an error anyway.
This prevents stub types leakages and helps with reporting type error diagnostics.

KT-35914 Fixed
KT-35943 Fixed
2020-01-20 11:11:31 +03:00
Mikhail Zarechenskiy
581db19544 Fix test after advancing bootstrap compiler to 1.4
Now test is correct as it was previously, see 76b3964e96 (diff-03626fd0c49fefdea63cff24d50ea9eaL10)
2020-01-20 11:01:28 +03:00
Nikolay Krasko
f01b4706d1 Switch to 193 platform 2020-01-19 12:01:53 +03:00
Nikolay Krasko
388797618a Update 193 to 193.6015.22-EAP-SNAPSHOT 2020-01-19 11:48:43 +03:00
Nikolay Krasko
688ccc4a87 Allow to auto-mute failed tests in RunnerWithIgnoreInDatabase 2020-01-19 11:48:43 +03:00
Dmitriy Novozhilov
689d1fff42 Fix compiler error discovered after switching to 1.4 2020-01-19 10:58:44 +03:00
Dmitriy Novozhilov
a5a75180a8 Change language version in build.gradle.kts to 1.4 2020-01-19 10:58:44 +03:00
Dmitriy Novozhilov
49584ac031 Update bootstrap 2020-01-19 10:58:44 +03:00
nataliya.valtman
578132ef1f CleanDataTask: use provider for input cleanStore 2020-01-18 11:34:21 +03:00
nataliya.valtman
abd60b97f8 YarnPlugin: configuration should be required only at build phase 2020-01-18 11:34:20 +03:00
Alexander Udalov
55e29363dc Update test data for kotlinp
Inline functions require Kotlin compiler at least 1.3.50 if they were
generated by the compiler with API version >= 1.4. This is because since
API version 1.4, we've changed the generation scheme of parameter
nullability assertions and they now refer to methods from the standard
library which did not exist until 1.4. See
JvmSerializerExtension.writeInlineParameterNullCheckRequirement.
2020-01-17 20:40:35 +01:00
Alexander Udalov
3c4e5d7615 Fix JvmFieldInInterfaceCompanion.kt for language version 1.4
Since 1.4, constant value is no longer written to the class file (and
thus cannot be read) for non-const properties. But in sources,
corresponding property descriptors still have the initializer which is
rendered to text. Therefore we disable the source-vs-binary check and
update the test data to check the new behavior.
2020-01-17 20:35:46 +01:00
Zac Sweers
482874fdc1 Embed proguard/R8 rules in kotlin-reflect artifact jar
The Android build pipeline can extract embedded proguard configurations
from dependencies and merge them automatically. This adds a conservative
proguard configuration to the kotlin-reflect JVM artifact in support of
that. This focuses mostly on just retaining what's necessary for
kotlin-reflect's own functionality to operate, but could be expanded if
community feedback discovers other good candidate rules.

With this in place - most Android projects using R8 or Proguard should
Just Work™️ with kotlin-reflect.
2020-01-17 20:03:52 +01:00
Alexander Udalov
ae395bda09 Do not depend on proguard directly in :kotlin-reflect:modularJar
This is useful if proguard is disabled with
-Pkotlin.build.proguard=false.
2020-01-17 19:58:27 +01:00
Mikhail Zarechenskiy
547865d5c7 Fix tests for completion after fun keyword
It's correct from the current implemention but still questionable and
 should be discussed

 #KT-35990 Open
2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy
58c235e722 Set up tests for fun interfaces for JVM backend for now 2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy
39e0f101b1 Add dependency because some SAM related classes moved to core module 2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy
76a78fe918 FIC: render fun before interfaces in descriptor renderer 2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy
8350cf7d14 FIC: rename FunctionConversion -> FunctionalConversion 2020-01-17 19:37:47 +03:00
Mikhail Zarechenskiy
27e104187f FIC: remove isFun from IR proto as conversion should happen in psi2ir 2020-01-17 19:36:12 +03:00
Mikhail Zarechenskiy
8206cadce2 FIC: support fun interfaces in stub builder 2020-01-17 19:36:12 +03:00
Mikhail Zarechenskiy
70094884ca FIC: support suspend conversions in jvm codegen 2020-01-17 19:36:11 +03:00
Mikhail Zarechenskiy
b98d8bd7c1 Regenerate tests after rebase on master, add FIR tests 2020-01-17 19:36:11 +03:00
Mikhail Zarechenskiy
3849b5e723 FIC: add codegen tests, adapt previously tests for SAMs 2020-01-17 19:36:09 +03:00
Mikhail Zarechenskiy
b7c43fc7db Refactoring: move test folder out of "inline classes" folder
It was added there by mistake
2020-01-17 19:36:08 +03:00
Mikhail Zarechenskiy
0e90d538df FIC: propagate info about conversions for deserialized classes 2020-01-17 19:36:08 +03:00
Mikhail Zarechenskiy
0fdebdfeba Refactoring: move SamConversionResolverImpl to core module 2020-01-17 19:36:07 +03:00
Mikhail Zarechenskiy
cd5c1b96bb Refactoring: move SamConversionResolver to more applicable package 2020-01-17 19:36:07 +03:00
Mikhail Zarechenskiy
c93c82236c Refactoring: move common parts about SAMs to frontend module 2020-01-17 19:36:06 +03:00
Mikhail Zarechenskiy
fc32e8b017 FIC: Add synthetic constructors for fun interfaces aka explicit FIC 2020-01-17 19:36:05 +03:00
Mikhail Zarechenskiy
0f242a9931 FIC: Support conversions for suspend functions 2020-01-17 19:36:04 +03:00
Mikhail Zarechenskiy
f43769c50d FIC: Add diagnostic tests 2020-01-17 19:36:03 +03:00
Mikhail Zarechenskiy
562f0e62a3 FIC: Move sam related methods to ClassDescriptor, fix JVM backend part 2020-01-17 19:36:03 +03:00
Mikhail Zarechenskiy
87e79e72a9 Refactoring: move SamConversionResolver to core.descriptors 2020-01-17 19:36:02 +03:00
Mikhail Zarechenskiy
0ee977c42e FIC: Support base version of conversions in JVM backend
Proper support for JVM backend will be in the further commmits
2020-01-17 19:36:02 +03:00
Mikhail Zarechenskiy
c71c1d45c6 FIC: Make SAM conversions also for fun interfaces, add base test 2020-01-17 19:36:01 +03:00
Mikhail Zarechenskiy
193d807a1e Refactoring: make parameters of getFunctionTypeForSamType not null 2020-01-17 19:36:01 +03:00
Mikhail Zarechenskiy
55935cc98a FIC: introduce language feature, modifiers checks and basic tests 2020-01-17 19:36:00 +03:00
Mikhail Zarechenskiy
303811cbd9 FIC: Increase JVM metadata version 2020-01-17 19:35:06 +03:00
Mikhail Zarechenskiy
f7ce1c669b FIC: Introduce isFun property for descriptors and proto 2020-01-17 19:35:06 +03:00
Mikhail Zarechenskiy
6655f0fc4c FIC: Increase STUB version because of changes in parser for declarations 2020-01-17 19:35:05 +03:00
Mikhail Zarechenskiy
4aa195e912 FIC: Parse fun keyword in front of interface as a modifier 2020-01-17 19:35:05 +03:00
Georgy Bronnikov
174b3db723 IR: capture more type parameters for local functions.
Types of value parameters and captured variables, even unused, need to
be considered.
2020-01-17 19:20:19 +03:00
Victor Petukhov
437a26684d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed and remember flexibility of type parameters based on flexibility of its upper bounds
^KT-32435 Fixed
2020-01-17 19:16:09 +03:00
Victor Petukhov
68576da494 Temporary change sinceVersion to null for ProhibitVarargAsArrayAfterSamArgument
It will be set to `KOTLIN_1_5` as it will be added.
2020-01-17 19:04:04 +03:00
Sergey Igushkin
38feadcfe8 Fix non-existing files passed in classpath to Kotlin/JS compiler 2020-01-17 18:28:25 +03:00
Michael Kuzmin
e8a821986f Build: drop IntelliJ 2018.3 support (KT-35374)
Delete references in code
2020-01-17 18:20:38 +03:00
Michael Kuzmin
9b7717c37a Build: drop Android Studio 3.4 support (KT-35374)
Delete references in code
2020-01-17 18:20:38 +03:00
Steven Schäfer
a49ed1eca2 JVM IR: Generate interface delegations for specialized interface defaults 2020-01-17 18:19:26 +03:00
Steven Schäfer
8746d08dd5 JVM IR: Don't skip bridge generation for concrete fake overrides 2020-01-17 18:19:26 +03:00
Steven Schäfer
c027c0e659 JVM IR: Handle special names for overridden Enum.name/ordinal in MethodSignatureMapper 2020-01-17 18:19:26 +03:00
Dmitry Gridin
6c166e744a Implement TrailingCommaInspection
#KT-34744
2020-01-17 21:02:55 +07:00
Dmitry Gridin
8d37b86e82 KotlinStyleGuideCodeStyle: enable trailing comma by default
#KT-34744
2020-01-17 21:02:55 +07:00
Dmitry Gridin
481900b258 TrailingCommaPostFormatProcessor: introduce TrailingCommaVisitor
#KT-34744
2020-01-17 21:02:55 +07:00
Dmitry Gridin
b9ed0706fa FormatterUtil: rename parameters in needTrailingComma functions
#KT-34744
2020-01-17 21:02:55 +07:00
Dmitry Gridin
e3cbc56974 TrailingCommaPostFormatProcessor: extract API for inspections
#KT-34744
2020-01-17 21:02:55 +07:00
Dmitry Gridin
20836f5788 TrailingCommaPostFormatProcessor: allow everything except adding before 1.4
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
c5c035b67c TrailingCommaPostFormatProcessor: fix comments position before comma
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
5a922e5cff KotlinCommonBlock: refactoring
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
d06787886a Fix tests after implementing trailing comma in formatter
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
d98794479d kotlinSpacingRules: fix cases with EOL comments and comma
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
8142ad3f4d FormatterUtil: fix getLineCount
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
b1fc3963d2 AbstractFormatterTest: enable trailing comma by default
#KT-34744
2020-01-17 21:02:54 +07:00
Dmitry Gridin
9109f29c88 AbstractFormatterTest: cleanup code 2020-01-17 21:02:54 +07:00
Dmitry Gridin
c27bf051d5 TrailingCommaPostFormatProcessor: add language feature check
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
9511348497 TrailingCommaPostFormatProcessor: should be completed in one round
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
8a45d2eb58 Formatter: add line break between comma and semicolon
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
bbd92a11bc TrailingCommaPostFormatProcessor: add case for empty comma owner
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
b72da6c4fc Formatter: support trailing comma in destruction declarations
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
96a11707ca Formatter: support trailing comma in lambda value parameters & fix comments in KtParameter
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
d013fc2234 Formatter: support trailing comma in when entry
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
4adfaab3ec Formatter: support trailing comma in lambda parameters
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin
07bda5a759 Formatter: support trailing comma in collection literal expression
#KT-34744
2020-01-17 21:02:52 +07:00
Dmitry Gridin
bf92517500 KtVisitorVoid: add missing visitCollectionLiteralExpression 2020-01-17 21:02:52 +07:00
Dmitry Gridin
ccd780c008 Formatter: support trailing comma in type arguments
#KT-34744
2020-01-17 21:02:52 +07:00
Dmitry Gridin
b99c7f8d14 Formatter: support trailing comma in type parameters
#KT-34744
2020-01-17 21:02:52 +07:00
Dmitry Gridin
58058eef21 Formatter: support trailing comma in indexing suffix
#KT-34744
2020-01-17 21:02:52 +07:00
Dmitry Gridin
c195cd46f2 Formatter: support trailing comma in value arguments
#KT-34744
2020-01-17 21:02:52 +07:00
Dmitry Gridin
13ae4a28a8 Formatter: support trailing comma in value parameters
#KT-34744
2020-01-17 21:02:52 +07:00
Alexander Udalov
463728a96a Fix compiler test on Throws+delegation for 1.4
No exceptions are generated for delegation in 1.4 (see KT-35834).
2020-01-17 12:47:20 +01:00
Alexander Udalov
de683c0768 JVM IR: mute more tests after advancing language to 1.4 2020-01-17 12:47:20 +01:00
Dmitry Petrov
135cd6fd77 Enable ProperIeee754Comparisons in KOTLIN_1_4 2020-01-17 14:15:32 +03:00
Dmitry Petrov
933ac3a16b Fix nullable number comparisons in JS 2020-01-17 14:14:59 +03:00
Dmitry Petrov
f8341ad7eb JVM: Update tests for IEEE 754 comparisons 2020-01-17 14:14:59 +03:00
Dmitry Petrov
d5ff1047a5 JVM: Fix IEEE 754 comparison generation for boxed numbers 2020-01-17 14:14:58 +03:00
Alexander Udalov
26f435eb90 JVM IR: mute tests which fail after advancing language to 1.4 2020-01-17 12:07:30 +01:00
Alexander Udalov
e7864c7351 Fix inlineCallsStaticMethodFromOtherPackage.kt by disabling related language feature
This test is not possible for 1.4, where protected calls from public
inline functions are prohibited.
2020-01-17 12:07:30 +01:00
Sergey Rostov
6ac21856cc NodeJsRootExtension, YarnRootExtension: introduce configuration phase
Some properties were calculated based on yarn and nodeJs version. So,
when version is changed properties were not updated. This change moves
calculation to the end of configuration phase and adds assertion to
ensure that version and other poperties are not changed
after configuration was done.
2020-01-17 13:44:57 +03:00
nataliya.valtman
9c08ea3bf1 Gradle: introduce CleanabeStore 2020-01-17 13:44:56 +03:00
Vladimir Dolzhenko
c0c929c449 ProgressIndicatorUtils.kt for 191 is added
Relates to #KT-33939
2020-01-17 11:39:44 +01:00
Roman Golyshev
4b50fb18fb KT-35258 Add better completion for MixedNamedArgumentsInTheirOwnPosition feature
- When named parameter is on its own position, the completion of the next argument will not be limited by named arguments only
- The completion will not suggest already used arguments names
- ^KT-35258 Fixed
2020-01-17 12:06:08 +03:00
Roman Golyshev
bd713db70e KT-35258 Refactor mapArgumentsToParameters
- We assume that, if method has no stable parameters names, `parametersByName` should be empty
2020-01-17 12:01:44 +03:00
pyos
82ddd700ce JVM_IR: patch parents of defaults in MemoizedInlineClassReplacements
A minor fix for #2909
2020-01-17 11:03:04 +03:00
Dmitriy Novozhilov
da4807e6b8 Disable AllowNullableArrayArgsInMain in corresponding run configuration tests 2020-01-17 10:48:20 +03:00
Dmitriy Novozhilov
76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Nikolay Krasko
5bfb92661e More version updates 2020-01-17 10:33:50 +03:00
Nikolay Krasko
7fa8c982b4 Advance version to 1.4 in libraries 2020-01-17 10:33:50 +03:00
Nikolay Krasko
ca49672a7a Advance version to 1.4 2020-01-17 10:33:50 +03:00
Ilya Matveev
55e97fee09 Gradle, native: Don't use an arg file when compiler daemon is enabled
We pass compiler flags using an arg file if the compiler is executed
in a separate process because Windows limits maximal command line
length (see https://github.com/JetBrains/kotlin-native/issues/1999).

But for the compiler daemon we pass the args directly to the compiler
entry point method. So we can abandon using an arg file here.
2020-01-17 12:44:37 +07:00
Ilya Matveev
8158d34bda Gradle, native: Escape spaces in K/N compiler args
We use an argument file to pass arguments to the K/N compiler.
Earlier each line of such a file was treated by the compiler
as a separate argument. But this logic was updated some time
ago and now content for this file is treated as a space separated
list of arguments.

This patch takes this into account at the Gradle side and quotes
arguments written to the arg file.

Issue #KT-35934 Fixed
2020-01-17 12:44:37 +07:00
Vladimir Ilmov
a2a3ca0558 Flaky ConcurrentModificationException in NewMultiplatformProjectImportingTest.testFileCollectionDependency fixed 2020-01-16 22:09:21 +01:00
Abduqodiri Qurbonzoda
3cad1bbb51 Create method Collection.randomOrNull() #KT-35347 2020-01-16 22:25:53 +03:00
Nikolay Krasko
80d5723a07 Advance version to 193.5662.53 2020-01-16 20:37:58 +03:00
Nikolay Krasko
b4ae1645ec Mute TCServiceMessageOutputStreamHandlerTest for 193 platform (KT-35938) 2020-01-16 20:37:58 +03:00
Nikolay Krasko
fd8ff463bb JUnit 4 runner for ignoring muted tests 2020-01-16 20:37:58 +03:00
Nikolay Krasko
6963c81b40 Run tests in kotlin-gradle-plugin in repository working dir
Unify with other modules and make GradleNodeModuleBuilderTest work under
JPS.
2020-01-16 20:37:57 +03:00
Vyacheslav Gerasimov
9b7e904390 Delete gradle wrapper validation workflow
Workflows are not enabled in JetBrains organization yet
2020-01-16 18:28:48 +03:00
Vyacheslav Gerasimov
a0e73bffa0 Build: Add kotlinPluginPublication to idea-gradle-tooling-api 2020-01-16 18:26:20 +03:00
Vladimir Dolzhenko
5730a21e7b Reworked k2k copy-paste action.
Get rid of resolve from copy phase, paste phase performs resolve in bg

#KT-33939 Fixed
2020-01-16 15:59:37 +01:00
Roman Golyshev
9f15c0f4d7 Add commentary about inserting type for lateinit var in completion
- Also, use dedicated method to check modifier
2020-01-16 17:38:01 +03:00
Mikhail Zarechenskiy
4f74515508 [NI] Fix CST calculation for covariant type projections 2020-01-16 17:18:20 +03:00
Vladimir Ilmov
082cbae74a Revert "Flaky ConcurrentModificationException in NewMultiplatformProjectImportingTest.testFileCollectionDependency fixed"
This reverts commit af71955fde.
2020-01-16 15:02:14 +01:00
Jonathan Leitschuh
7da26ce705 Add pull_request to list of actions 2020-01-16 16:48:57 +03:00
Jonathan Leitschuh
19e989bc61 Official Gradle Wrapper Validation GitHub Action
See: https://github.com/gradle/wrapper-validation-action
2020-01-16 16:48:57 +03:00
pyos
6e6f4d0503 IR: close over the set of captured type parameters 2020-01-16 16:37:40 +03:00
Ilya Gorbunov
e9cea3358d Do not use libraryJarWithoutIr as runtime output artifact
This avoids having both libraryJarWithoutIr and default jar artifact,
which points to the same path as libraryJarWithIr, in the dependent
projects' classpath.
Use libraryJarWithIr instead.
For local builds where libraryJarWithIr doesn't contain any IR, this
should have the same effect.
2020-01-16 16:01:56 +03:00
Ilya Gorbunov
3fabf9b6ad Add dependency in disabled jar task on custom libraryJarWithIr
jar task is disabled, but its artifact is still used through
the runtime configuration in the other projects.
In fact, dependent projects get both
libs/kotlin-stdlib-js-1.3-SNAPSHOT.jar
lib/dist/kotlin-stdlib-js-1.3-SNAPSHOT.jar
in their classpath.

However the former artifact is built with libraryJarWithIr task after
jar task is skipped. This leads to a situation during the parallel build
that a dependent project tries to read that artifact
when libraryJarWithIr task writes it.

This commit adds a dependency edge between the disabled jar and custom
libraryJarWithIr tasks, so that the artifact is ready by
the moment jar task has finished.
2020-01-16 16:01:55 +03:00
Ilya Gorbunov
3d7c7c4656 Add problem zip file name when unable to open it 2020-01-16 16:01:55 +03:00
Ilya Gorbunov
09b1960dd0 Regenerate stdlib sources: update copyright year 2020-01-16 15:57:06 +03:00
Ilya Gorbunov
30bdd463ad Do not lower SinceKotlin version for unsigned arrays extensions if they already has some 2020-01-16 15:52:35 +03:00
Ilya Gorbunov
9566f329f0 Mute FIR test failures and adjust failing test data due to KT-35948 2020-01-16 15:36:19 +03:00
Ilya Gorbunov
0f6df5971b Mute tests failing in JS_IR backend due to KT-35944 2020-01-16 15:36:16 +03:00
Ilya Gorbunov
ac7e54f651 Improve terminological consistency in KClass docs 2020-01-16 15:36:13 +03:00
Ilya Gorbunov
71d847841e Use real kotlin-stdlib jar in addKotlinReflect configuration test
The presence of "Add kotlin-reflect.jar..." action depends on whether the API
that requires full kotlin-reflect is actually resolved. Since builtins now
do not contain the entire JVM reflect API, but rather the common one,
we need a real kotlin-stdlib instead of dummy one to have 'KProperty1.getter'
symbol resolved.
2020-01-16 15:36:10 +03:00
Ilya Gorbunov
3a78ab6d40 Do not use qualifiedName property in KClass.cast function, because it's not supported in K/JS
Introduce an internal property that returns either qualified or simple name, and use it instead.
2020-01-16 15:36:07 +03:00
Ilya Gorbunov
43e08a5717 Specify some real kotlin version in maven configuration test
Now availability of the configuration quick fix depends on
whether the unavailable reflect declaration are actually resolved,
and for that we need a dependency on stdlib.
2020-01-16 15:36:05 +03:00
Ilya Gorbunov
b3ecf84c43 Improve unexpected declaration exception message 2020-01-16 15:36:02 +03:00
Ilya Gorbunov
ac790bea71 Reorganize diagnostics tests with stdlib and reflect
DiagnosticsTestWithStdLib now require stdlib only.
Move test data accordingly.
The only test that required kotlin-reflect is transformed into
codegen box test.
2020-01-16 15:35:58 +03:00
Ilya Gorbunov
ec6fdc5d4d Fix noStdlib cli test
Replace 'isExternal' with 'name', since 'name' is still available in builtins and 'isExternal' is only accessible with a proper stdlib dependency.
2020-01-16 15:33:16 +03:00
Ilya Gorbunov
8af43155c3 Remove reflect API not actually supported in K/JS
#KT-32186
2020-01-16 15:33:16 +03:00
Ilya Gorbunov
562bac3f6f Copy JVM reflect declarations to JS 2020-01-16 15:33:16 +03:00
Alexander Udalov
0815ed2cbd JVM IR: do not load KDeclarationContainer from builtins
Like other classes declared in the standard library, construct a mock of
it in JvmSymbols. This is needed to move classes in kotlin.reflect out
from builtins and to the JVM part of the standard library.
2020-01-16 15:33:15 +03:00
Ilya Gorbunov
ea95aabbb0 Optimistically add isInstance and qualifiedName to common KClass
Because they are used in common cast and safeCast functions
2020-01-16 15:33:15 +03:00
Ilya Gorbunov
47f78c424d Commonize KType API
Move KTypeProjection, KVariance, KClassifier, KTypeParameter to stdlib-common.

#KT-29748 Fixed
#KT-32855 Fixed
2020-01-16 15:33:15 +03:00
Ilya Gorbunov
d87fb0ece0 Introduce expect KFunction in common 2020-01-16 15:33:14 +03:00
Ilya Gorbunov
427e34fe5a Do not serialize JVM kotlin.reflect to builtins
Serialize common types from kotlin-reflect as builtins instead.
2020-01-16 15:32:29 +03:00
Mikhail Glukhikh
f27611939e Raw FIR builder: fix situation with explicit type of for parameter
Before this commit we omitted for parameter type,
even if it was stated explicitly. This also fixes PSI consistency test
2020-01-16 14:46:50 +03:00
Alexander Udalov
621936e951 Do not generate Throws attribute for delegated members from Kotlin interfaces
#KT-31763 Fixed
 #KT-35834
2020-01-16 12:43:09 +01:00
Alexander Udalov
79d7335b8d JVM IR: minor, add toString for FunctionHandleForIrFunction
Useful for debugging problems in BridgeLowering.
2020-01-16 12:38:16 +01:00
Alexander Udalov
86996bf546 IR: workaround exceptions in IrElement.dump
Fallback to IrElement.render if exception happens in DumpIrTreeVisitor
(due, for example, to invalid IR structure).
2020-01-16 12:38:03 +01:00
Alexander Udalov
c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01:00
Vladimir Ilmov
af71955fde Flaky ConcurrentModificationException in NewMultiplatformProjectImportingTest.testFileCollectionDependency fixed 2020-01-16 11:38:54 +01:00
Pavel Kirpichenkov
fd1305c369 [NI] Refactor OnlyInputType annotation check
Hold position consumed during incorporation in Constraint instead of ConstraintPosition.
2020-01-16 12:01:07 +03:00
Pavel Kirpichenkov
0d393e3fd7 [NI] Update filtering of constraints with equal types
Make check for synthetic nullability constraint status before skipping
new constraint with nonunique type.
2020-01-16 12:01:06 +03:00
Pavel Kirpichenkov
2896642f94 [NI] Consider synthetic lower nullability constraint non-proper 2020-01-16 12:01:06 +03:00
Sergey Rostov
07041574da AbstractScriptConfigurationLoadingTest: add asserting messages 2020-01-16 11:45:51 +03:00
Sergey Rostov
40914e79ee .gralde.kts: optimize getAffectedGradleProjectFiles (EA-220597 fixed) 2020-01-16 11:45:50 +03:00
Denis Zharkov
676c99b933 NI: Fix exception during callable references overload resolution
^KT-35847 Fixed
2020-01-16 10:49:49 +03:00
Mikhail Zarechenskiy
588259a034 Add feature that allows references to synthetic properties with warning
See KT-35933 for details
2020-01-16 09:37:34 +03:00
Sergey Bogolepov
595362b99f [kotlinx-metadata-klib] Proper support for enum entries 2020-01-16 11:38:39 +07:00
Sergey Igushkin
ffa2f97d2c Deprecate 1.2.x MPP Gradle plugins
Issue #KT-31570 Fixed
2020-01-16 00:02:47 +03:00
Sergey Igushkin
f9acc0ab88 Support Gradle instant execution for Kapt tasks
* In the Kotlin/JVM tasks, move the compiler arguments setup logic to
  a separate class, so that it can be reused by the Kapt tasks without
  directly referencing the Kotlin/JVM tasks

* In the Kapt tasks, carefully capture the values using the Provider API
  so that the task can be serialized for Instant Execution and then
  deserialized and executed without relying on the project model

Issue #KT-35181 Fixed
2020-01-15 23:53:49 +03:00
Dmitriy Novozhilov
5111d1721a [TEST] Add js runtime to failing box test 2020-01-15 22:12:29 +03:00
Dmitriy Novozhilov
a3037a081e [NI] Fix resolve of lambdas with expected function type with receiver
#KT-30245
2020-01-15 22:12:29 +03:00
Dmitriy Novozhilov
7733611c47 [TEST] Replace Experimental with OptIn in testdata 2020-01-15 22:12:28 +03:00
Dmitriy Novozhilov
04ce10b6c1 [NI] Improve completing callable references with type variable as expected type
#KT-32462 Fixed
2020-01-15 22:12:28 +03:00
Alexander Udalov
6fe214d825 JVM IR: fix handling of suspend extension lambdas with captured receiver
The problem in the added test was that a suspend lambda was represented
by a function reference with a bound argument for the ObjectRef value,
and the corresponding parameter was not the first parameter of the
referenced local function. This happens because
LocalDeclarationsLowering lifts the local function up and adds a
new parameter for the captured ObjectRef (which is bound at the call
site), but the original receiver parameter remains the first unbound
parameter. So, it's no longer correct to rely on the fact that all bound
parameters of a function reference are located in the beginning of the
parameter list, which was kind of assumed in the `withIndex` call in
`AddContinuationLowering.addCreate`.
2020-01-15 19:42:13 +01:00
Alexander Udalov
f45ca7acd3 Add -Xno-use-ir to override useIR flag for custom-built compiler 2020-01-15 19:39:07 +01:00
Ilmir Usmanov
4fa8266606 Unconditionally remove $$forInline suffix from enclosing method
when transforming objects with suspend functions/lambdas, which
capture crossinline suspend lambdas. Since functions with the
suffix have a counterpart without the suffix, for java interop
and reflection call purposes, it is safe change.
 #KT-31242 Fixed
2020-01-15 15:12:26 +01:00
Mikhail Glukhikh
7bcd3c4c13 [FIR] Introduce & use FirScopeProvider.getStaticMemberScopeForCallables 2020-01-15 16:52:13 +03:00
Mikhail Glukhikh
aaace40912 [FIR] Split Receiver/ReceiverValue, QualifierReceiver/ExpressionReceiver 2020-01-15 16:52:13 +03:00
Mikhail Glukhikh
42ba54fffd [FIR] Add test for qualifier resolve priority 2020-01-15 16:52:12 +03:00
Mikhail Glukhikh
cef71b0349 [FIR] Add static / companion ambiguity to test data
This is temporary test data change until we prioritize this properly
2020-01-15 16:52:12 +03:00
Mikhail Glukhikh
f0ced642d9 [FIR] Use static & qualified scopes to access qualified callables
This commit provides more correct logic for creating scopes based
on FirResolvedQualifier & eliminates QualifiedReceiverTowerDataConsumer
2020-01-15 16:52:12 +03:00
Dmitry Petrov
6bbfb2ffe9 JVM: add tests for companion object accessor generation 2020-01-15 16:40:06 +03:00
Dmitry Petrov
3d85e5da5f Enable ProperVisibilityForCompanionObjectInstanceField in 1.4 2020-01-15 16:40:06 +03:00
pyos
02722e0238 JVM_IR: mark the exception local as live only after the store
Otherwise, should the local coincide with another one, the incorrect
range causes D8 to generate invalid bytecode in debug mode.
2020-01-15 14:35:15 +01:00
Denis Zharkov
bcad6aeda6 Fix project compilation after fix for KT-35920
See KT-35931 for a feature request allowing to write IrConstImpl::int
2020-01-15 16:10:34 +03:00
Denis Zharkov
d4c34afb94 NI: Do not resolve static callable references on generic types
As they weren't resolved in old inference

^KT-35920 Fixed
2020-01-15 16:10:34 +03:00
Denis Zharkov
c48539feb3 NI: Fix callable references resolution when LHS is generic nested class
In case of null qualifier, we should not look into any static scope
NB: factory::createCallableProcessor returns NoExplicitReceiver processor
in case of null-receiver, that makes resolving the call in the test as
`property(::key)` that matches to the property itself, thus leading to
overload resolution ambiguity

^KT-35887 Fixed
2020-01-15 16:10:34 +03:00
Vladimir Ilmov
4ff8acf5d7 POC coroutine panel removed 2020-01-15 14:02:05 +01:00
Vladimir Ilmov
c8c0f3383d [debug] coroutine's stack frame locations pre-calculated on initialization 2020-01-15 14:02:05 +01:00
Sebastian Schuberth
4191d1d699 Make NodeJsSetupTask and YarnSetupTask cacheable
For users that have Gradle's build cache [1] enabled, make NodeJsSetupTask
and YarnSetupTask cacheable to avoid the distribution archives being
downloaded again if they have been downloaded before by other builds of
other projects that apply the Kotlin plugin.

[1] https://docs.gradle.org/current/userguide/build_cache.html
2020-01-15 12:51:37 +01:00
Sebastian Schuberth
2760034281 NodeJsSetupTask: Check for the node executable instead of its directory
We want NodeJs to be downloaded again if nodeBinDir exists but the node
binary is missing.

Fixes https://youtrack.jetbrains.com/issue/KT-34989.
2020-01-15 12:51:37 +01:00
Pavel Kirpichenkov
3fcf3d6fea Add regression tests
KT-32358
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov
d36dd12f58 [NI] Restore old behaviour of AbstractPartialBodyResolveTest
Smartcasts between partial and full resolution mode should almost never match,
comparing smartcasted types in test runner is incorrect in general case.
Mute failing test until decision about correct behaviour (KT-35922).
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov
b9a1fc294c [minor] Move quickFixUtil to util package 2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov
69e800c695 Remove dependencies on data flow aware expression type in BindingContext
`BindingContext.getType`'s behaviour on argument expression has been different for OI and NI for some time.
New inference used to rewrite argument's type after smartcast, which led to missing subsequent smartcasts in some cases.
This commit makes retrieval of smartcasted argument type explicit.
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov
4d11fac365 [NI] Add restored smart casts to spec tests
KT-35668 Fixed
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov
396b226462 [NI] Restore missing smart casts after another smart cast in call
Expression type serves as a part of a key for retrieving smart cast info.
Rewriting expression type with SmartCastManager leads to incorrect processing of following smartcasts for same expression, therefore it was removed.

KT-32507 Fixed
KT-32358 Fixed
2020-01-15 14:39:40 +03:00
Mikhail Glukhikh
d3de2d419b FIR2IR: fix failing enum entry test 2020-01-15 14:30:15 +03:00
Dmitriy Novozhilov
88a1cb5a17 [NI] Use new type substitutor instead of old in completion of callable references
It's necessary because of new type substitutor is eager than odl, so
  if there is a substitution of type parameter deep inside type arguments
  then second substitutor wins against first

#KT-35896 Fixed
2020-01-15 14:01:25 +03:00
Dmitriy Novozhilov
3428a17759 [NI] Postpone calls with not enough information in builder inference 2020-01-15 14:01:25 +03:00
Mikhail Glukhikh
f4b3e9b4b2 [FIR] Fix qualifier handling by FirQualifierNameResolver 2020-01-15 13:20:27 +03:00
Mikhail Glukhikh
ae774a0ab9 [FIR] Add test for qualified access to base class member case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh
c129714bf9 [FIR] Add test for inner class based qualifier case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh
33104a3ef8 [FIR] Add accidentally missed JvmMappedScope.processClassifiersByName 2020-01-15 13:20:26 +03:00
Igor Yakovlev
fb56e14654 Fix UAST method NPE for incomplete method PSI
Fixed #KT-35871
2020-01-15 13:14:41 +03:00
Leonid Startsev
9bd966c123 Supply correct Native platform for module descriptor while compiling from CLI 2020-01-15 12:48:49 +03:00
Leonid Startsev
f2026a49bb Support .decodeSequentially call on JVM and Native and remove READ_ALL handling from all platforms
Fix codegen test

Ignore JVM IR codegen test for a while since it requires updated kotlinx-serialization-runtime in classpath
2020-01-15 12:46:25 +03:00
Steven Schäfer
cb98588202 Psi2Ir: Add an IrTextTest for enums with multiple constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer
1b5109b6ee JVM IR: Refactor EnumClassLowering 2020-01-15 10:18:09 +01:00
Steven Schäfer
b0e61ab470 JVM IR: Remove IrEnumValueOf intrinsic 2020-01-15 10:18:09 +01:00
Steven Schäfer
f8779ddf9d Psi2Ir: Create instance initializer calls in enum class constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer
83edc7fa73 IR: Remove unused argument from DeclarationFactor.getFieldForEnumEntry 2020-01-15 10:18:09 +01:00
Nicolay Mitropolsky
ed57a53ad6 191: Uast: fix compilation for 191 2020-01-15 11:40:47 +03:00
Alexander Udalov
b5afdc7553 Keep annotation FQ name in experimental API diagnostics
This fixes compilation of ExperimentalFixesFactory where this FQ name
is used to construct a correct quick fix instance.
2020-01-15 00:32:19 +01:00
Alexander Udalov
514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov
f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov
9187a85aaf Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests 2020-01-14 21:04:43 +01:00
Alexander Udalov
da077b5353 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in Gradle plugin 2020-01-14 21:04:42 +01:00
Alexander Udalov
8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Alexander Udalov
7742a3b697 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests 2020-01-14 21:04:42 +01:00
Alexander Udalov
b839b905b5 Rename Experimental/UseExperimental in compiler diagnostic messages
#KT-34647
2020-01-14 21:04:41 +01:00
Alexander Udalov
d547af00aa Fix NPE in ExperimentalUsageChecker in corner case
Since there's no nullability assertion, null could end up in this list
and cause NPE further at `reportNotAcceptedExperimentalities`. This
could happen if a declaration was annotated with WasExperimental, the
marker was annotated with the new RequiresOptIn, and API version 1.2 was
used.

No new tests are added because 1.2 is obsolete and WasExperimental is
internal.
2020-01-14 21:04:40 +01:00
Mads Ager
ca05ff1791 JVM_IR: Fix bug in suspend function with many default arguments. 2020-01-14 20:48:44 +01:00
Mark Punzalan
e46adbae29 [JVM IR] Fix checkLocalVariablesTableTest/parametersInSuspendLambda
for JVM IR.
2020-01-14 20:47:36 +01:00
pyos
f73891af98 JVM_IR: actually forward the parameters to $suspendImpl 2020-01-14 20:46:48 +01:00
Nicolay Mitropolsky
54285d328f Uast: KotlinIDERenderLogTest for running UAST tests with ULC
In case of result difference the `-ide`-suffixed testdata is used.
Actually the difference in results is more likely to be a bug
but currently we are fixating at least some behaviour to protect from
 unexpected regressions in Ultra Light Classes.

`object Local` were removed because there is no local objects in actual
 Kotlin syntax
2020-01-14 19:48:40 +03:00
pyos
99eab5a058 IR: unify 3 copies of function body remapping
Also,

  1. remove some redundant copies;

  2. fix remapping of non-local returns in lambdas if the body is moved
     after LocalDeclarationsLowering (the lambda is no longer inside the
     body, but must still be visited)
2020-01-14 18:48:27 +03:00
Nikolay Krasko
4d1677be06 Invalidate PerModulePackageCache on content change in file without view provider (KT-35907)
Investigation was started because of flaky behaviour in
NewJavaToKotlinConverterSingleFileTestGenerated tests. Approximately 1
of 3 all tests executions caused failure in one of the tests.

Analyze showed that unlike the successful run, failure test was missing
PSI event with PerModulePackageCache index invalidation.

This was caused by null from FileManagerImpl.findCachedViewProvider()
and null from FileDocumentManagerImpl.getDocumentFromCache().
Both methods use weak references maps to operate:
FileManagerImpl.myVFileToViewProviderMap and
FileDocumentManagerImpl.myDocumentCache.

#KT-35907 Fixed
2020-01-14 18:11:37 +03:00
Vladimir Ilmov
092fb131e5 CodeConformanceTest @author mention in sources fixed 2020-01-14 16:06:44 +01:00
Svyatoslav Kuzmich
1333267983 [JS IR] Add serialization regressions tests 2020-01-14 18:00:29 +03:00
Svyatoslav Kuzmich
fbf71be30c [JS IR BE] Support mode of linking multiple klibs without .kt files 2020-01-14 18:00:29 +03:00
Vladimir Ilmov
553128c3c9 Coroutine as35 compatibility patch also added to 191. 2020-01-14 15:55:51 +01:00
Denis Zharkov
d6b01f1007 NI: In subtyping do not intersect arguments for non-covariant types
It partially reverts 7898922066
because it's not obvious that it's a safe operation
for invariant/contravariant types.

Also, there's a necessary fix in prepareReceiverRegardingCaptureTypes
to make types order stable
Otherwise test bareTypesWithStarProjections becomes flaky.

Also, the changes in bareTypesWithStarProjections.kt are also expected
because the type of the expression `coneSymbol` after the second "if" is
FirVariableSymbol<*> & FirPropertySymbol & AbstractFirBasedSymbol<*>
thus we fix D in the call `coneSymbol.phasedFir()` to FirVariableSymbol<*>
because it's the first type in the list
(see the next line after the last changed in AbstractTypeChecker)
2020-01-14 17:35:24 +03:00
Denis Zharkov
4202c9c1a4 NI: Fix regression for star-projections approximation
See the test added

^KT-35703 Fixed
2020-01-14 17:35:24 +03:00
Denis Zharkov
7255ee0a5b NI: Fix smart-cast related regression
See the test and the issue for the clarification
After the change 7898922066
the expected type for "a" in expression "foo(a)" is A<E & B<*>>
But we have the original type A<E> and smart-casted enriched type A<B<*>>
(non of them is a subtype of A<E & B<*>>)
and fail in checkTypeInternal when checking types in during completion

^KT-35844 Fixed
2020-01-14 17:35:24 +03:00
Dmitriy Novozhilov
02d9f258d1 [FIR-TEST] Mute failing blackbox test 2020-01-14 17:34:21 +03:00
Pavel Kirpichenkov
4a29de3716 [NI] discriminate Nothing for reified parameters
Related issues: KT-32836, KT-35728
2020-01-14 16:27:42 +03:00
Dmitry Petrov
a16b21a7cc JVM: Don't generate accessors to companions in earlier language versions 2020-01-14 16:12:19 +03:00
Dmitry Petrov
6ad159bb01 JVM: Rewrite companion object accessor generation
Old version handled only private companions correctly.
Some situations require multiple companion object accessors
(including accessors for protected companion objects from supertypes)
to be generated in the corresponding class.
2020-01-14 16:12:18 +03:00
Alexander Udalov
04a6f4d92b JVM IR: minor, use chars from JvmSimpleNameBacktickChecker in ClassCodegen 2020-01-14 13:54:12 +01:00
Mark Punzalan
be228d594c [JVM IR] Ensure class names are valid for JVM.
The JVM IR backend was producing class names with "<no name provided>"
for unnamed functions (i.e., `fun(...) {}`). This produces class files
with names invalid in Windows. This change adds validation of names
using the same set of invalid characters used in the frontend, which
should ensure class file names are valid.
2020-01-14 13:54:12 +01:00
Georgy Bronnikov
049bb54ea6 IR: use map in remapTypeParameters
In LocalDeclarationLowering, the moved local function does not
necessarily receive a continuous chunk of type parameters that it captures.
2020-01-14 15:16:54 +03:00
Kristoffer Andersen
0abdd0cb7b [JVM IR] Refactor InterfaceDelegationPhase
Rename and refactor interface delegation phase. It didn't actually do
what was said on the box. It should be more in line with the
intentions of the phase now.
2020-01-14 13:10:24 +01:00
Alexander Udalov
a5ff88f897 IR: implement some missing features in wrapped descriptors for JVM IR
Wrapped descriptors are still used in reporting of the "conflicting JVM
signatures" diagnostic in the JVM IR backend, and TODOs in
implementations prevent that diagnostic from being shown, obscuring even
the place where the error happens.
2020-01-14 12:49:57 +01:00
Mikhail Zarechenskiy
6fe61c9056 [NI] Fix ambiguity when there are no applicable candidates
#KT-35064 Fixed
2020-01-14 14:30:01 +03:00
Vladimir Dolzhenko
8d3e4a2965 IAE: RangeMarkerImpl.<init>
#EA-141884 Fixed
2020-01-14 12:15:26 +01:00
Vladimir Dolzhenko
83c3763096 Access index under runReadActionInSmartMode in ProbablyContractedCallableNamesImpl
#EA-219476 Fixed
2020-01-14 12:15:14 +01:00
Vladimir Dolzhenko
d176a26cdb Improve investigation info in KtDotQualifiedExpression
Relates to #EA-212081
2020-01-14 12:15:04 +01:00
Vladimir Dolzhenko
19164781f4 Access index under runReadActionInSmartMode in KotlinRuntimeLibraryUtil
#EA-220414 Fixed
2020-01-14 12:14:55 +01:00
Vladimir Dolzhenko
b2b90bd495 Edit kdoc reference in Introducing import alias
#KT-35837 Fixed
2020-01-14 12:14:46 +01:00
Vladimir Dolzhenko
f5545b3740 Handle kdoc case for Introduce import alias inspection
#EA-210889 Fixed
2020-01-14 12:14:36 +01:00
Vladimir Dolzhenko
ffc6786f06 Module info has to be read under readAction in KotlinConfigurationCheckerComponent
#EA-209610 Fixed
2020-01-14 12:14:28 +01:00
Vladimir Dolzhenko
3260e41111 Improve investigation info in PackageCodegenImpl
Relates to #EA-218779
2020-01-14 12:14:19 +01:00
Vladimir Dolzhenko
a63123b556 Handle \r line endings in plaintext j2k
#KT-35831 #EA-209568 Fixed
2020-01-14 12:14:05 +01:00
Vladimir Dolzhenko
dc6adc805a Handle java ctor case for Introduce import alias inspection
#KT-35824 #EA-218654 Fixed
2020-01-14 12:13:51 +01:00
Vladimir Dolzhenko
be65eed801 Add more investigation info to diagnoseUnknownModuleInfo
Relates to #EA-220276
2020-01-14 12:13:38 +01:00
Vladimir Dolzhenko
2f953f5049 Add disposable to document listener in ScratchEditorSyncHighlighter
#EA-220382 Fixed
2020-01-14 12:13:27 +01:00
Vladimir Dolzhenko
6da24deec5 Fix renaming class according to a file name when file name has no name (but extension)
#EA-219715 Fixed
2020-01-14 12:12:58 +01:00
Vladimir Dolzhenko
4425bb8fa1 Commit documents before createResourceReference in KotlinAndroidAddStringResource
#EA-127016 Fixed
2020-01-14 12:11:56 +01:00
Vladimir Dolzhenko
d644c0125a Add more investigation info to getFilesForElements
Relates to #EA-209630
2020-01-14 12:11:32 +01:00
Vladimir Dolzhenko
93ce4c003f Module info has to be read under readAction in scriptDefinitionsFromDependencies
#EA-220355 Fixed
2020-01-14 12:11:21 +01:00
Vladimir Dolzhenko
aefad5cf5e Module info has to be read under readAction in KotlinNativeABICompatibilityChecker
#EA-220356 Fixed
2020-01-14 12:11:10 +01:00
Vladimir Ilmov
e340651e47 CoroutineAsyncStackTraceProvider stack corruption fix 2020-01-14 11:49:09 +01:00
Dmitriy Novozhilov
9367c6a762 [NI] Use infered delegate expression type if there is no resolved call in trace
#KT-35707 Fixed
2020-01-14 12:18:24 +03:00
Dmitriy Novozhilov
605ef647e6 Regenerate tests 2020-01-14 12:18:23 +03:00
Vladimir Ilmov
cac4a991f5 coroutine debugger toolbar added 2020-01-14 10:14:56 +01:00
Vladimir Ilmov
e570450c59 coroutine debugger logic moved to jvm-debugger-coroutine module 2020-01-14 10:14:56 +01:00
Vladimir Ilmov
b1b0817336 [coroutine][debugger] implementation basing on X-* approach
XCoroutine view added for direct comparison with Coroutines
2020-01-14 10:14:56 +01:00
Vladimir Ilmov
61c5ef61cc [coroutine][debugger] refactoring being done
X-view approach added for review, thread groups added
2020-01-14 10:14:55 +01:00
Kirill Shmakov
7f0437da68 Update AS version to 4.0 Canary 8 2020-01-14 11:32:55 +03:00
Ilya Gorbunov
0764a065e8 Rewrite UnderMigration and MigrationStatus in Java
to remove dependency on kotlin-stdlib.

#KT-33141
2020-01-13 23:30:32 +03:00
Vyacheslav Gerasimov
fa1c6c9697 Build: Add missing com.github.node-gradle.node plugin versions 2020-01-13 19:40:08 +03:00
Vyacheslav Gerasimov
b2039a9a13 Build: Specify version explicitly for com.github.node-gradle.node 2020-01-13 18:17:43 +03:00
Vyacheslav Gerasimov
bf5bba42ce Build: Upgrade gradle enterprise plugin to 3.1.1 2020-01-13 18:17:43 +03:00
victor.petukhov
fc7b836151 Fix isNegated psi method in KtWhenConditionInRange
^KT-34395 Fixed
2020-01-13 15:36:33 +03:00
Ilya Kirillov
a10f37dd50 New J2K: fix exception when met PsiLambdaParameterType
#KT-35431 fixed
2020-01-13 14:32:48 +03:00
Ilya Kirillov
5be80be74d New J2K: fix converting multiline comment with /* inside
#KT-18001 fixed
#KT-35081 fixed
2020-01-13 14:32:47 +03:00
Ilya Kirillov
a87de01c74 New J2K: add missing line break between property and getter
#KT-35739 fixed
2020-01-13 14:32:46 +03:00
Ilya Kirillov
b83a529b77 New J2K: fix incorrectly removed line break before constructor comment
That caused class body brace to be under the comment

#KT-35478 fixed
2020-01-13 14:32:45 +03:00
Ilya Kirillov
7bfad12e6a New J2K: correctly convert compound Java assignment expression
#KT-35476 fixed
2020-01-13 14:32:45 +03:00
Ilya Kirillov
6a8a68a263 New J2K: fix UninitializedPropertyAccessException when calculating type of anonymous class
#KT-35395 fixed
2020-01-13 14:32:44 +03:00
Ilya Kirillov
7882f566be New J2K: Fix SOE in nj2k Java declarations printer 2020-01-13 14:32:44 +03:00
Ilya Kirillov
14a8d3726d New J2K: remove initializer from property without backing field
#KT-33637 fixed
2020-01-13 14:32:43 +03:00
Mikhail Glukhikh
1756857237 Rename: FirMemberScopeProvider -> FirDeclaredMemberScopeProvider 2020-01-13 13:26:19 +03:00
Mikhail Glukhikh
5c6341b4e4 [FIR] Handle fully qualified expressions separately in tower resolver 2020-01-13 13:26:13 +03:00
Mikhail Glukhikh
587430ff90 [FIR] Minor: remove FirSymbolProvider unused functions
buildDefaultUseSiteMemberScope & getSessionForClass were removed
2020-01-13 13:23:51 +03:00
Mikhail Glukhikh
c343e5c9b7 [FIR] Refactoring: extract FirTowerResolver.towerDataConsumer() 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh
c96e6e9da4 [FIR] Refactoring: store name in CallInfo 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh
9e0db86900 [FIR] Refactoring: create consumer inside tower resolver 2020-01-13 13:23:51 +03:00
Mikhail Glukhikh
30e339a2d7 [FIR] Convert CallKind to enum class 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh
f07adf085c [FIR] Minor refactoring: createFunctionConsumer 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh
02a57aab7d [FIR] Code refactoring: InvokeReceiverCandidateCollector 2020-01-13 13:23:50 +03:00
Mikhail Glukhikh
5dbb98a5c8 [FIR] Code cleanup: CandidateCollector 2020-01-13 13:23:50 +03:00
Toshiaki Kameyama
6b2e58cc0b Inline function: fix it works correctly for callable reference receiver
#KT-26248 Fixed
2020-01-13 11:59:42 +03:00
Vladimir Dolzhenko
272ca002d7 Drop UNREACHABLE_CODE eager text range calculation
#KT-35242 Fixed
2020-01-12 17:23:30 +01:00
Ilya Gorbunov
9e4d7df86e Revert "[JS IR] stdlib: switch between artifacts rather than artifact content"
The default Jar task is disabled, but its archive file is still
configured as an artifact to be published in the 'archives' configuration.
Thus, neither 'install', nor 'publish' tasks could not find this file
when `libraryJarWithIr` isn't triggered and does not build it.
Removing that artifact from the 'archives' configuration artifacts makes
'install' task publish nothing.

Therefore it's better to revert the change so that 'libraryJarWithIr' task
always runs and produces an artifact with the default name.

This reverts commit a9fec211
2020-01-11 02:27:05 +03:00
Igor Yakovlev
e2bb602271 Fix invalid test data file names 2020-01-11 00:03:48 +03:00
Igor Yakovlev
0c4134470d Fix exception of rename readonly overridden methods 2020-01-10 21:37:12 +03:00
Igor Yakovlev
3a2704d956 Remove usage of deprecated method 2020-01-10 21:22:51 +03:00
Igor Yakovlev
df2a0e1087 Add MPP warning message for move refactoring 2020-01-10 21:22:51 +03:00
Alexander Udalov
2b4dc1199a JVM IR: fix monitorEnterMonitorExit.kt
After an inaccurate merge of 31936890 and d6ed93b2, this test was now
failing with the newly added assertion. It seems that currently the best
way to handle it would be to special-case these two methods in
SyntheticAccessorLowering.kt.
2020-01-10 18:07:27 +01:00
Mads Ager
b2f8a4e82a JVM_IR: Put continuation parameter before default mask and handler.
This is important for calls using reflection as the reflect
library assumes this ordering of arguments.

It would be nice if this could be handled in the lowerings.
Currently AddContinuationLowering is after
DefaultArgumentStubGenerator. If we could add the continuation
first and then do default stub generation maybe we could avoid
the reshuffling introduced in coroutine codegen in this change.
2020-01-10 17:52:46 +01:00
Alexander Udalov
c948459ed5 Minor, add comment to synthetic accessor generation for super calls
Also fix "useless elvis" warning in SyntheticAccessorLowering.
2020-01-10 14:09:00 +01:00
Alexander Udalov
b48d7f4ba7 JVM IR: fix InterfaceLowering for $default methods from base interfaces
The first change here is swapping the isCompatibility and hasJvmDefault
checks. Otherwise behavior could be different depending on -Xjvm-default
mode even for non-JvmDefault declarations, which makes little sense.

Another change is avoiding generating $default stubs for fake overrides
in interfaces, which replicates the behavior of the current backend.
(Note that this change also fixes the first problem on the newly added
tests, but the first change seems useful anyway.)
2020-01-10 14:05:27 +01:00
Alexander Udalov
3848ac9cac JVM IR: never produce "$s<hash>" suffix for accessors in interfaces
Not sure if this affects real code, but this could happen in erroneous
cases such as in the subsequent commit, where it was a bit weird to see
this suffix without any supercalls involved.
2020-01-10 14:05:26 +01:00
Alexander Udalov
3193689086 JVM IR: do not add suffix for accessors to top level functions
This only reproduced when compiling (technically incorrect) code in the
standard library, where private functions monitorEnter/monitorExit are
accessed from another file, and their names with suffixes are not
recognized as intrinsics which should be replaced by
monitorenter/monitorexit JVM bytecode instructions.
2020-01-10 14:05:25 +01:00
Alexander Udalov
d6ed93b2b8 JVM IR: fail when SyntheticAccessorLowering adds accessor to other files
This would help for example in debugging the issue fixed in the previous
commit.

The only problem by now where this lowering tried to add accessors to
foreign files was reproduced for interfaces inheriting from Cloneable.
There, we generate a DefaultImpls bridge that calls protected method
`clone` from java.lang.Cloneable.DefaultImpls. This makes no sense, but
the old backend behaves the same. Instead of generating accessor for it
in JVM IR, we now see all DefaultImpls bridges as public as a
workaround. (The fact that assertion no longer fails here is checked
e.g. by box/reflection/mapping/methodsFromObject.kt.)
2020-01-10 13:53:11 +01:00
Alexander Udalov
957b100cd1 JVM IR: do not generate hidden constructor for inline classes more than once
SyntheticAccessorLowering was initially implemented under the assumption
that any access to an invisible declaration will cause an accessor to be
generated _in the same file_. Moreover, it's declared in the group of
phases that are performed by file.

But this assumption is incorrect for constructors which need to be
hidden (those which take parameters of inline class types), since such
constructor is public and can be called from anywhere. In this case,
SyntheticAccessorLowering actually generated a new accessor for the
hidden constructor for each (!) source file where that constructor is
called, which led to ClassFormatError because of the class file having
multiple methods with the same signature. The internal `functionMap`
cache didn't help because it's not shared among phase instances for
different files (well, it helped to generate not more than one accessor
per usage-file).

In this change, we use the global cache, stored in JvmBackendContext,
for accessors to hidden constructors. Note that after this change, calls
to hidden constructors are always transformed to the corresponding
accessor in SyntheticAccessorLowering right away, but that accessor
might be orphaned for a while (not declared in any parent's
declarations). Only when SyntheticAccessorLowering encounters the
original constructor which needs to be hidden, it adds the accessor
beside it.

The test is sensitive to the file order, so both variants are added.
2020-01-10 13:49:05 +01:00
Sergey Rostov
a339e7af19 build.gradle.kts: tests and docs for LastModifiedFiles collection 2020-01-10 15:41:23 +03:00
Dmitry Petrov
4cf8203ce7 PSI2IR: Unify behavior for lambda return values with old back-end
See KT-35849.

1. When expected lambda return type is a type parameter, don't generate
introduce implicit casts (even if the corresponding type parameter has
an upper bound that would otherwise require such cast).

2. Do not generate implicit null check for lambda return value of
@EnhancedNullability type.
2020-01-10 15:23:33 +03:00
Mads Ager
c47e04ac8d JVM_IR: handle suspend functions for signatures in callable references. 2020-01-10 11:24:27 +01:00
anastasiia.spaseeva
3253907317 [Spec tests] Hotfix for not-null-assertion-expression test 2020-01-10 13:12:01 +03:00
Pavel Kirpichenkov
2a4e235e34 [NI] Decrease only input types check diagnostic level to warning 2020-01-10 13:05:40 +03:00
Nicolay Mitropolsky
23c2a5c830 Uast: fake light method for uast is created only when containing class exists (KT-35310, EA-219604) 2020-01-10 12:46:37 +03:00
Victor Petukhov
5917591205 Workaround an inliner problem upon which the compiler code itself stumbled
^KT-35856 Fixed
2020-01-10 12:13:46 +03:00
simon.ogorodnik
5b8ab76613 [FIR] Move JvmMappedScope to fir:jvm module 2020-01-10 12:02:10 +03:00
Alex Chmyr
16c82030a3 KT-20120 fixing bug for Java 9 Deprecated
Unconditionally changing it to @Deprecated("") in kotlin
2020-01-10 11:45:17 +03:00
simon.ogorodnik
ba4163ba02 [FIR] Improve synthetic functional interfaces support
Rename fictitiousFunctionSymbols -> syntheticFunctionalInterfaceSymbols
Support suspend function interfaces
Add supertypes for KFunction / KSuspendFunction
2020-01-10 10:57:36 +03:00
Juan Chen
573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mikhail Glukhikh
6b4e5bc2f0 [FIR] Cleanup code and fix type check in SAM resolution 2020-01-10 10:23:53 +03:00
Juan Chen
c464322b3a [FIR2IR] Fix translation of library func parameters with default values
In the existing implementation, the information that a library function
parameter has a default value is lost during Fir2Ir translation,
and thus later on,
calls to such functions are not converted to the corresponding stubs.

Test cases such as kt5844, which calls kotlin.test.assertEquals,
fail with messages like "java.lang.IllegalArgumentException:
Null argument in ExpressionCodegen for parameter VALUE_PARAMETER
name:message index:2 type:kotlin.String?",
due to nonnull checks in ExpressionCodegen.visitFunctionAccess
(ExpressionCodegen.kt:421)

Functions defined in the code to be compiled don't have this problem,
only those from deserializing jars.

This commit sets default values in IrValueParameterImpl
for such parameters during Fir2Ir translation.
Now kt5844 passes the nonnull check in
ExpressionCodegen.visitFunctionAccess but still fails in a later stage
(java.lang.ClassNotFoundException: kotlin.internal.ir.Intrinsic).
2020-01-10 10:23:53 +03:00
Juan Chen
7eaac0bf2a [FIR]: allow char comparison in Fir2Ir 2020-01-10 10:23:53 +03:00
Juan Chen
d407663734 Add another binding for wrapped parameter descriptors. 2020-01-10 10:23:53 +03:00
Juan Chen
d3b21aed8a [FIR]: add missed bindings for WrappedReceiverParameterDescriptor. 2020-01-10 10:23:53 +03:00
Mikhail Glukhikh
ea267d9ef4 [FIR IDE]: support enum entry search properly 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh
2f6a48f70c Handle phase for FirEnumEntry correctly 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh
05ee6fdd77 Add problematic enum test 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh
7e946c6f5b Forbid manual phase updates during FIR compilation (non-IDE mode) 2020-01-10 10:23:52 +03:00
simon.ogorodnik
961037506a FIR2IR: support FirEnumEntry 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh
3671c8489f FirEnumEntry: set correct child class name 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh
97670e5036 [Raw FIR] Fix PSI consistency test (enum entry) + some cleanup 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh
2b05320ae9 [Raw FIR] Synchronize enum entry building in PSI / light AST modes 2020-01-10 10:23:51 +03:00
simon.ogorodnik
65a44e2e20 Migrate to FirEnumEntry 2020-01-10 10:23:50 +03:00
simon.ogorodnik
5b5a5292b7 Support FirEnumEntry in FirRenderer 2020-01-10 10:23:50 +03:00
simon.ogorodnik
c6e28537ff Create node for FirEnumEntry 2020-01-10 10:23:50 +03:00
Simon Ogorodnik
13132e69a3 [FIR] Start enum entries reworking 2020-01-10 10:23:50 +03:00
Ilya Matveev
68d64f1b5c IDEA plugin: Don't create iOS test in the share lib project template
Since 1.3.70 an iOS simulator test task is created by the MPP Gradle
plugin out of the box. So we stop creating such a task manually in
the shared library project template.

Issue #KT-35560 Fixed.
2020-01-10 11:52:34 +07:00
Ilya Gorbunov
c084dfa1d7 [JS IR] stdlib: use 'base' plugin instead of kotlin("jvm")
'base' plugin is enough in this case, given that a couple of tasks is registered and configured manually.

Fix kotlin-reflect dependency to be a project dependency.
2020-01-09 22:57:50 +03:00
Ilya Gorbunov
a9fec21178 [JS IR] stdlib: switch between artifacts rather than artifact content
The switch `includeStdlibJsIr` now affects which artifact is published:
the one with IR or the one without. Previously it affected
whether or not IR was bundled into the artifact "with IR".
2020-01-09 22:57:45 +03:00
Ilya Gorbunov
372a4009bd Fix coreLibsInstall composite task again
See the commit f0e67f8397 for details
2020-01-09 22:54:57 +03:00
Georgy Bronnikov
8d0ffa1444 IR: copy type parameters for local functions in LocalDeclarationLowering
Local functions raised in LocalDeclarationLowering continue to refer to
type parameters that are no longer visible to them.
This commit only adds new type parameters to their declarations, which
makes JVM accept those declarations. The generated IR is still
semantically incorrect (needs further fix), but code generation seems
to proceed nevertheless.
2020-01-09 22:10:27 +03:00
Georgy Bronnikov
01da7f289b JVM_IR: rework type parameters in AddContinuationLowering 2020-01-09 22:10:27 +03:00
Georgy Bronnikov
d81231fdf7 JVM_IR: fix type arguments in inline callable references 2020-01-09 22:10:27 +03:00
Georgy Bronnikov
a67df82b1e IR: modify IrTypeParametersContainer.copyTypeParameters() 2020-01-09 22:10:27 +03:00
Pavel Kirpichenkov
96c1b96f3a [NI] Report "not enough information" on callable references in lambdas
^KT-34314 Fixed
2020-01-09 20:43:15 +03:00
Mads Ager
4e4e57f60a JVM_IR: deal with inline class default values in AddContinuationLowering.
Whenever we want the default 0/null value for a type we need to
check if it is a non-nullable inline class type and produce
the right value for the underlying type.
2020-01-09 18:05:28 +01:00
Mark Punzalan
31ba2d64db [JVM IR] Mangle variable names for anonymous parameters in lambdas. 2020-01-09 17:57:50 +01:00
pyos
88cac53d88 JVM_IR: skip synthetic enum parameters in signatures 2020-01-09 15:58:59 +01:00
anastasiia.spaseeva
94c008872e [Spec tests] Fix tests 2020-01-09 17:16:13 +03:00
anastasiia.spaseeva
7dc469b32d [Spec tests] Minor changes of TestInfoParser and Generated files 2020-01-09 17:16:13 +03:00
anastasiia.spaseeva
e0743f2268 [Spec tests] Add fixed tests for expressions section, fix linkage for reference-equality-expressions section 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
9e3ecbd902 [Spec tests] Add codegen tests for indexing-expression (paragraph 3) 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
0a1b8a928c [Spec tests] Add tests for not-null-assertion-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
e4d12593be [Spec tests] Add tests for postfix-expressions, postfix-decrement-expression && postfix-increment 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
7980db8613 [Spec tests] Add tests for prefix-expressions, logical-not--expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
e5a9a58d65 [Spec tests] Add tests for prefix-expressions, unary-minus-expression and unary-minus-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
a8af3dc3c9 [Spec tests] Add tests for prefix-decrement-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
01a4562076 [Spec tests] Add tests for additive-expression and Multiplicative expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
72358aa52a [Spec tests] Add tests for range-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva
84cf4c5049 [Spec tests] Add tests for elvis-expression 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
479fa0e7b8 [Spec tests] Add tests for containment-checking-expression 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
4a94ffa5dd [Spec tests] Add tests for type-checking-expression 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
2a1e084f03 [Spec tests] Add tests for comparison-expression 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
5e42a20575 [Spec tests] Add tests for value-equality-expressions (paragraph 2-3) 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
3bb5ddb224 [Spec tests] Add tests for reference-equality-expressions (paragraph 3) 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
15b561195f [Spec tests] Add tests for logical-conjunction-expression 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
6da8ccb9eb [Spec tests] Add tests for logical-disjunction-expression (paragraph 2) 2020-01-09 17:16:11 +03:00
anastasiia.spaseeva
d4a83d535c [Spec tests] Add tests for KT_35565 (local-property-declaration) 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
31df799103 [Spec tests] Add codegen tests for logical-disjunction-expression (paragraph 1) 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
1ea5eb6850 [Spec tests] Add test for return expression 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
dcfcc9c7b6 [Spec tests] Add tests for when-expression (p-3, 4) 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
bd979a12de [Spec tests] Review fix tests for try-expression and if-expression 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
e865327386 [Spec tests] Add tests for try-expression (paragraphs 1, 2, 5-9) 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
3aa3f0c50c [Spec tests] Add tests for character-literals 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
8187405dbd [Spec tests] fix test parser exceptions handler 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
fdef51e8b7 [Spec tests] Add tests for boolean-literals (p-1 sentence 2) 2020-01-09 17:16:10 +03:00
anastasiia.spaseeva
744cc54dff [Spec tests] Add tests for if-expression 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
a41c4c84a6 [Spec-tests] Add tests for prefix increment expression 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
f95a03cba3 [Spec-tests] Add tests for abstract classes 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
6c644448c2 [Spec tests] Add tests for abstract classes 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
20ed66cd82 [Spec tests] Add remove link to the issue KT-27825 from all tests which are not related to the issue 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
6accbf6284 [Spec tests] Add prefix increment expression codegen tests 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
86d072e3aa [Spec tests] Add diag tests for abstract classes and prefix increment 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
44d0a99875 [Spec tests] Add spec tests for kotlin.Nothing, kotlin.Unit, reference equality and cast expressions 2020-01-09 17:16:09 +03:00
anastasiia.spaseeva
bf50edee17 [Spec tests] Add tests for kotlin.Nothing and kotlin.Unit built-in types 2020-01-09 17:16:08 +03:00
Mikhael Bogdanov
52ac8d788d Minor. Convert test 2020-01-09 14:00:13 +01:00
Mikhael Bogdanov
70d71f0f07 Don't generate type annotations on synthetic accessors
#KT-35843 Fixed
2020-01-09 14:00:12 +01:00
Mikhael Bogdanov
1032e3a17c Support field type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Mikhael Bogdanov
2ed0cb2a89 Support type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Alexander Udalov
fde9b21a40 Fix syntheticMethodForProperty.kt for JDK 9+ and Android tests 2020-01-09 11:34:51 +01:00
Dmitriy Dolovov
5803fcdeb4 Bugfix: KotlinIdeaResolutionException on absent/corrupted KLIB artifact
Issue #KT-35839
2020-01-09 17:13:54 +07:00
Ilya Chernikov
995c6a32b8 Allow only single expression eval in cli compiler and kotlin runner
#KT-35740 fixed
also add tests and drop logger usage in the cli dependencies manager:
the logger is normally unitialized in the usage scenarios, but related
warnings are annoying.
2020-01-09 10:51:25 +01:00
Dmitriy Dolovov
7ffb64ec57 Minor: formatted code 2020-01-09 16:01:22 +07:00
Dmitriy Dolovov
e0d90ccf4b [Commonizer] Log commonization stats into a single file 2020-01-09 16:01:16 +07:00
Dmitriy Dolovov
f18aa3e0be [Commonizer] Re-organize commonizer CLI 2020-01-09 16:01:09 +07:00
Dmitriy Dolovov
805ac2d307 [Commonizer] Re-organize utilities 2020-01-09 16:01:03 +07:00
Nicolay Mitropolsky
ed4e73c8e9 Uast: the returnType support for light methods for reified functions (KT-35610) 2020-01-09 11:55:22 +03:00
Nicolay Mitropolsky
c04ba009e6 Uast: properly handling annotations on destructured variables (KT-35673, EA-220128) 2020-01-09 11:55:22 +03:00
Ilya Chernikov
9da536c202 [minor] "fix" fir testdata for KT-30245 test, todo: fix problems in fir accordingly 2020-01-09 08:08:45 +01:00
Ilya Chernikov
caa677e6d2 [NI] Convert extension lambda to the non-extension one, if needed
#KT-30245 fixed
2020-01-09 08:08:45 +01:00
pyos
ef5fe0675a JVM_IR: refactor suspendFunctionView
fixing the check for DescriptorWithContainerSource in the process
(containerSource *may* be null).
2020-01-08 19:52:20 +01:00
Mark Punzalan
137ef26723 [JVM IR] Fix issue with destructuring declaration in parameter for
suspend lambda.

The Name for the special destructuring declaration parameter was
incorrectly turned into a regular/non-special Name when the parameter
was moved to a field.
2020-01-08 19:51:16 +01:00
Mark Punzalan
36c4df6d99 [JVM IR] Use names of local functions in names of local classes.
This undoes changes in
fbe66c3496
which broke calculation of the simple name of local classes in
reflection (the enclosing method was not a substring of the name of the
local class).
2020-01-08 18:45:40 +01:00
Mark Punzalan
70b304e6e4 [JVM IR] Support target templates in
AbstractCheckLocalVariablesTableTest and fix
`checkLocalVariablesTable/localFun.kt` for JVM IR.

Also improved diagnosability of CheckLocalVariablesTableTest failures.
2020-01-08 18:45:40 +01:00
Alexander Udalov
152d88e747 Mute generated FIR tests after 929fb5c8 2020-01-08 18:06:07 +01:00
Steven Schäfer
929fb5c82b Mute FIR tests containing broken function calls 2020-01-08 13:20:00 +01:00
Steven Schäfer
5309e774ac JVM IR: Remove FAKE_OWNER from MethodSignatureMapper
FAKE_OWNER is a hack for when we encounter IrFunctions with non-class
parents during codegen. This can only happen for unhandled intrinsic
functions and resolving them to FAKE_OWNER can cause codegen to succeed
while producing broken bytecode.
2020-01-08 13:20:00 +01:00
Steven Schäfer
5ffbf9264a JVM IR: Implement the enumValues and enumValueOf intrinsics
These were previously handled in the inliner.
2020-01-08 13:20:00 +01:00
Steven Schäfer
bd74e976c9 JVM IR: Lower calls to the emptyArray intrinsic in VarargLowering
There are two array intrinsics which are handled in the inliner on the
JVM backend: arrayOf and emptyArray. In the IR backend we are already
lowering arrayOf as part of VarargLowering and this commit adds support
for lowering emptyArray as well.
2020-01-08 13:20:00 +01:00
Mads Ager
1b1dff9191 JVM_IR: fix default argument stub visibility.
Match the rules from the old backend:

1. Private and inline only methods get package private default
   argument stubs.

2. Everything else is public.
2020-01-08 13:19:14 +01:00
Steven Schäfer
7f319c18de JVM IR: Mark Enum.$VALUES field as synthetic (#2957) 2020-01-08 13:17:58 +01:00
pyos
6b5d92a693 IR: work around a bug in interface delegation descriptors
interface I {
        fun f(x: Int = 1)
    }
    class C(val y: I) : I by y {
        // implicit `override fun f(x: Int) = y.f(x)` has a default value for `x`
    }

-- the only case where a function with overridden symbols has defaults.
2020-01-03 17:09:31 +01:00
Mads Ager
98f5c5aa95 JVM_IR: Preserve annotations on inline class replacement methods. 2020-01-03 16:44:50 +01:00
Mads Ager
e7835fecfc JVM_IR: fix a couple of inline class reflection issues.
1. Postpone the computation of the signature for property
   reference getters for extension properties until codegen time.

2. Generate metadata for static replacement functions instead
   of the original functions.
2020-01-03 16:38:53 +01:00
Mads Ager
2ebb797e61 JVM_IR: Remove accessor for internal inline class properties. 2020-01-03 15:29:34 +01:00
Dmitry Petrov
d27593aeda PSI2IR: SAM conversion in method arguments of out-projected Java classes
It uses the same logic as an old back-end
(see SamType#createByValueParameter and genericSamProjectedOut.kt),
split into two parts:

1. When inserting SAM casts, use SamType#createByValueParamerer to get
the target SAM type.

2. When inserting implicit casts, cast SAM conversions as arguments of
methods of out-projected types to the original type of value parameter
instead of 'Nothing'.
2020-01-03 15:32:44 +03:00
Alexander Udalov
a55bce801e Update year in the license to 2020 2020-01-03 13:09:43 +01:00
Alexander Udalov
e0b9ffa780 Regenerate builtins sources 2020-01-03 13:09:43 +01:00
Alexander Udalov
d73e6c855b Regenerate FIR tree 2020-01-02 10:59:24 +01:00
Alexander Udalov
8a4510c21b Regenerate tests 2020-01-02 10:31:00 +01:00
Vyacheslav Gerasimov
a55296db26 Mute flaky GradleKtsImportTest.testCompositeBuild 2019-12-31 17:11:09 +03:00
Vyacheslav Gerasimov
1b00996c86 Mute failing test-kotlin-version-in-manifest
Should be unmuted after #KT-35776 is fixed
2019-12-31 16:37:14 +03:00
Dmitry Petrov
8054e2960e PSI2IR: Post-process return expressions based on expected return type
Consider the following example:

Java:
  public class J {
    public static String foo() { return null; }
  }

Kotlin:
  fun check(fn: () -> Any) = fn()
  fun test() = check { J.foo() }

When a lambda expression returns a value of platform type ('String!'),
corresponding lambda has platform type in its return type, which is
approximated to corresponding nullable type ('String?') in IR.
However, the lambda itself could occur in position with a functional
expected type ('() -> Any'). This implies an extra implicit cast on a
return value of lambda expression ('J.foo()'), although it conforms to
the return type of lambda.
2019-12-31 13:30:23 +03:00
Dmitry Petrov
0e4e5ac287 Update nullability assertion tests that use newer Java features 2019-12-31 11:14:52 +03:00
Dmitry Petrov
d622542824 PSI2IR: Fix delegated members generation
When generating bodies for members implemented by delegation, invoke
corresponding delegate member, not an interface member. Otherwise we
might lose platform-specific nullability information in case of mixed
Kotlin-Java hierarchies, as in
implicitNotNullOnDelegatedImplementation.kt
2019-12-30 18:36:16 +03:00
Alexander Udalov
cc0b231b3b Convert SyntheticMethodForAnnotatedPropertyGenTest to a box test 2019-12-30 16:30:50 +01:00
Alexander Udalov
8f30b25b24 Minor, fix some codegen tests for language version 1.4
These tests check behavior of an old language version on purpose: the
original bug KT-24708 has been fixed by introducing an error here in
1.4.
2019-12-30 16:30:45 +01:00
Alexander Udalov
e2a42446ed Use getter names for $annotations methods in most codegen tests
This is needed to update master to 1.4, while still testing the latest
compiler by default. Also add one test on the old behavior.
2019-12-30 16:29:13 +01:00
Dmitry Petrov
330dd789de Minor: mute test in FIR+JVM_IR 2019-12-30 16:08:44 +03:00
Nikolay Krasko
c7d39b612c Simplify adding Kotlin sdk by inlining internals of ProjectSdksModel
Because of using cloning sdks inside ProjectSdksModel tests fail with sdk leaked errors.
2019-12-30 13:50:12 +03:00
Nikolay Krasko
70067bc9bf Better fix for compiler plugin test initialization
The previous one didn't work in 191.
Also revert changes in tests-common module.
2019-12-30 13:22:34 +03:00
Simon Ogorodnik
1715f1a864 [FIR] Refactoring: create use-site scopes via scope provider 2019-12-30 12:52:58 +03:00
Mikhail Glukhikh
5f08fe88a5 [FIR] Move ScopeSession to fir:tree 2019-12-30 12:52:53 +03:00
Dmitry Petrov
98bf0e278f Fix problem with empty vararg of boxed primitives in JVM_IR
When calling a generic Java generic method with vararg parameters with empty
vararg, incorrect array creation instruction was generated for primitive type:
NEWARRAY T_INT instead of ANEWARRAY java/lang/Integer. Here for Java method

  public static <T> void takesVarargOfT(T x1, T... xs) {}

corresponding vararg parameter was considered to be of type 'Array<T>?',
which is not a non-null array type, so, NewArray intrinsic failed to generate
proper bytecode.
2019-12-30 11:26:21 +03:00
Dmitry Petrov
0667ee9796 Minor: optimize imports 2019-12-30 11:26:21 +03:00
Dmitry Petrov
76e7a9ba4a Generate instructions as text in case of other exceptions
It makes possible to analyze what causes a failure if DxChecker.check fails
2019-12-30 11:26:21 +03:00
Mikhael Bogdanov
4b6202c902 JVM_IR. Support inlining of bound CR 2019-12-30 08:35:46 +01:00
Roman Golyshev
42deb7db48 KT-34582 Exclude kotlin.coroutines.experimental package from completion and auto-import
- Exclusion happens only when `ReleaseCoroutines` feature is supported
- Add `LANGUAGE_VERSION` to few tests to make sure that previous exclusions still work when `experimental` package is not excluded entirely
- ^KT-34582 Fixed
2019-12-29 15:35:49 +03:00
Pavel Kirpichenkov
8399614de8 Move muted test failing on all platforms to mute-common
KT-35728
2019-12-28 13:18:00 +03:00
Ilya Gorbunov
a98f36bce4 Reorganize existing Closeable/AutoCloseable.use tests 2019-12-28 03:02:01 +03:00
Toshiaki Kameyama
941de655c4 Add contract for 'use'
#KT-35216 Fixed
2019-12-28 02:54:29 +03:00
Ilya Gorbunov
043eddb432 Cleanup: use effects introduced by contracts of assert* functions 2019-12-28 02:51:56 +03:00
Zalim Bashorov
04fe0dc795 Minor: enable commit message inspections in IDEA 2019-12-27 22:34:02 +03:00
Zalim Bashorov
9cf1a2b404 [Build] Remove the property to skip JS IR BE tests
It's no longer needed since we going to start building libraries using the new BE,
so we have to be sure that everything works well in releases branches too.
2019-12-27 22:34:02 +03:00
Zalim Bashorov
9557034cf7 [Build] Mark tmp dir in the root of project as excluded 2019-12-27 22:34:02 +03:00
Pavel Kirpichenkov
40812cd116 Mute quickfix test (KT-35728) 2019-12-27 19:01:32 +03:00
Pavel Kirpichenkov
2d21b82501 [NI] Remove hack for special functions
Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect.
Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
2019-12-27 18:40:42 +03:00
Alexander Gorshenev
9a12641fde Allow parallel access to klib zip filesystem 2019-12-27 18:19:48 +03:00
Nikolay Krasko
ddda93ad96 Mute flaky JavaAgainstKotlin.testUsingMutableInterfaces 2019-12-27 16:53:21 +03:00
Nikolay Krasko
e20c66011a Enable mute tests feature for BuiltInDecompilerTest 2019-12-27 16:53:20 +03:00
Nikolay Krasko
28e23f0aa8 Mute flaky step over tests on Android Studio 2019-12-27 16:53:20 +03:00
Nikolay Krasko
11e4b710b5 Mute GradleMigrateTest.testMigrateStdlib in AS 2019-12-27 16:53:19 +03:00
Nikolay Krasko
77edfed764 Mute tests for preferring JDK classes in completion and auto-import in 191 and 192 (KT-35709)
BasicCompletionWeigherTestGenerated.testPreferFromJdk
AutoImports.testAmbiguousNamePreferFromJdk
2019-12-27 16:53:19 +03:00
Nikolay Krasko
74e2c98426 Fix test data for QuickFixTestGenerated.SupertypeInitialization in 191 2019-12-27 16:53:19 +03:00
Nikolay Krasko
0d48855333 Mute JavaToKotlinConverterSingleFileTestGenerated in 191 2019-12-27 16:53:18 +03:00
Nikolay Krasko
28eb6a223d Fix UpdateConfigurationQuickFixTest.testEnableCoroutinesFacet test 2019-12-27 16:53:18 +03:00
Nikolay Krasko
4c28e0dec3 Split tests to common and platform parts 2019-12-27 16:53:17 +03:00
Nikolay Krasko
570b522e8e Minor: sort tests in mute database 2019-12-27 16:53:17 +03:00
Mikhail Glukhikh
6da3c2fa4e FIR2IR: set parent correctly (~) for anonymous functions 2019-12-27 16:13:02 +03:00
Natalia Selezneva
a653feb2dc Scripting: use VFS events instead of document changes to track changes outside of IDE (KT-35557)
^KT-35557 Fixed
2019-12-27 15:57:11 +03:00
Natalia Selezneva
6bf0e4b1a9 Simplify check for that gradle script configurations is up to date
Get time stamp for script inputs before gradle import
2019-12-27 15:57:11 +03:00
Natalia Selezneva
3dfbd824e4 Implement persistent storage for time stamps of files that affect build script configuration (KT-3556)
^KT-3556 Fixed
2019-12-27 15:57:11 +03:00
Natalia Selezneva
ecb05ace91 Scripting: extract API to check if script is related to any gradle project
KT-35268 cannot be implemented without explicit action for loading configurations for script outside of project model

^KT-35268
^KT-34625
2019-12-27 15:57:11 +03:00
Toshiaki Kameyama
716036a000 RemoveModifierFix: fix message for 'companion object'
#KT-35604 Fixed
2019-12-27 15:38:32 +03:00
Juan Chen
3dc58bc995 [FIR2IR] Fix translating primitive array types
This commit fixes two issues in the existing implementation of translating primitive array types:

 * IrType.getArrayElementType throws an exception when the receiver is a primitive array type, because IR expects primitive array types use symbols defined in IrBuiltIns, but fir2ir translation doesn't;
 * IteratorNext.toCallable assumes all element types are boxed.

The first issue is fixed by changing the fir2ir type translation to use symbols in IrBuiltIns for primitive array types, and the second by not unboxing primitive types.
2019-12-27 15:32:18 +03:00
Mikhail Glukhikh
1cf582e9ed FIR2IR: set extension receiver for anonymous functions 2019-12-27 15:31:36 +03:00
Mikhail Glukhikh
aa796e962a FIR2IR (minor): remove duplicate of generateErrorCallExpression 2019-12-27 15:10:23 +03:00
Mikhail Zarechenskiy
95dd322bf0 Update FIR diagnostics test 2019-12-27 14:11:47 +03:00
Mikhail Glukhikh
e4b2c238c7 FIR2IR: temporarily allow null receivers & use findIr*Receiver also for fields 2019-12-27 13:46:06 +03:00
Mikhail Glukhikh
338281e05f [FIR TEST]: add test for KT-35730 2019-12-27 13:46:06 +03:00
Mikhail Glukhikh
15f373a864 FIR2IR: support object receiver case (this fixes 24 black box tests) 2019-12-27 13:46:05 +03:00
Mikhail Glukhikh
f3b5ee4cba FIR2IR: fix assertion in getIrFunctionSymbol (anonymous function case) 2019-12-27 13:46:05 +03:00
simon.ogorodnik
5e426fdc71 [FIR] Optimization & checking fix: remove usage of dispatchReceiverValue 2019-12-27 13:45:59 +03:00
simon.ogorodnik
686965c0d3 [FIR] Code cleanup: get rid of typeProvider hack 2019-12-27 13:45:57 +03:00
Denis Zharkov
caf02806d5 NI: Fix resolution ambiguity for references returned from lambda
^KT-32267 Fixed
2019-12-27 11:36:19 +03:00
Denis Zharkov
534718794c Minor. Extract PSICallResolver::createCallableReferenceKotlinCallArgument 2019-12-27 11:36:18 +03:00
Denis Zharkov
840acbac68 Minor. Make properties in KotlinResolutionCallbacksImpl private 2019-12-27 11:36:18 +03:00
Juan Chen
4c04ad2371 FIR: Add bindings for dispatch receiver parameters
Before this commit, such descriptors have null owners, which causes problems when the getter of the owner property is called.
2019-12-27 10:13:44 +03:00
Mikhail Glukhikh
a54ef3e427 FIR invoke resolve: remove redundant candidates 2019-12-27 09:57:36 +03:00
Mikhail Glukhikh
f47c3f0f5a FIR: if necessary, use explicit receiver as argument in invoke collector 2019-12-27 09:57:36 +03:00
Mikhail Glukhikh
0c88ecdc56 FIR resolve: introduce builtInExtensionFunctionReceiverValue
This commit allows us to distinguish extension lambda receivers
from simple extension receivers thus fixing some resolve problems.
2019-12-27 09:57:36 +03:00
Mikhail Glukhikh
de50f8aef3 FIR resolve: add partial support of extension lambda calls
Here we introduce ONLY_IMPLICIT_RECEIVER tower level
to support extension lambda calls on local variables,
and soften extension receiver checks to make such extensions visible & applicable.
Also here we try to map arguments twice for functional types
2019-12-27 09:57:36 +03:00
Mikhail Glukhikh
49e94f1ee3 FIR invoke consumer: minor rename 2019-12-27 09:57:35 +03:00
Mikhail Glukhikh
9a514dfdd9 FIR invoke consumer: do not process last data twice 2019-12-27 09:57:35 +03:00
Mikhail Glukhikh
933bdc98e5 Minor: extract val FirTowerConsumer.resultCollection 2019-12-27 09:57:35 +03:00
Mikhail Glukhikh
20fee028f9 [FIR TEST] Add test with incorrect invoke receiver 2019-12-27 09:57:35 +03:00
Mikhail Glukhikh
a8a50fa657 Fix raw FIR building with parenthesized expression as selector 2019-12-27 09:57:34 +03:00
Dmitrii Petrov
a18fecb05f Minor: mute test for pre-1.3 behavior in JVM_IR 2019-12-26 23:45:11 +03:00
Zalim Bashorov
ee06678484 [JS BE] Fix is check with Function
#KT-33149 fixed
2019-12-26 22:49:53 +03:00
Dmitriy Novozhilov
04e567dbf9 [NI] Don't replace context dependency for blocks with expected type
#KT-35702 Fixed
2019-12-26 20:31:06 +03:00
Miguel Serra
4fa5e2d85c KT-20357: Add samples for linkedSetOf 2019-12-26 20:07:39 +03:00
Tillmann Berg
95300ae31d KT-20357: Add sample for reduce, reduceRight and their indexed counterparts 2019-12-26 19:57:33 +03:00
Ilya Gorbunov
6d092b5f71 Add more reduceOrNull tests
- Test for unsigned arrays
- Update binary api dump with the new functions
2019-12-26 19:27:47 +03:00
Alfredo Delli Bovi
9546307243 Add sample for reduceOrNull and reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi
06008c40ab KT-33761 Add reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi
f5d696d3c4 KT-33761 Add reduceOrNull 2019-12-26 19:27:46 +03:00
Alexander Gorshenev
39e1b24c2c Don't search for expects when not given -Xmpp-klibs 2019-12-26 18:17:36 +03:00
Dmitriy Novozhilov
d210df9ea3 Update spec testdata according to previous commits 2019-12-26 17:43:28 +03:00
Dmitriy Novozhilov
5dfe100ae5 Allow use reference to reified type parameters in contracts since 1.4 2019-12-26 17:43:28 +03:00
Dmitriy Novozhilov
9c1b68f839 Prohibit using references to this from outer scope in contract declarations 2019-12-26 17:43:28 +03:00
Dmitriy Novozhilov
f083edfac2 Allow contracts on final non-override members since 1.4 2019-12-26 17:43:27 +03:00
Vyacheslav Gerasimov
5a9070b6da as40: Minor: Fix copyright header in AbstractModelBuilderTest.java 2019-12-26 16:25:12 +03:00
Vyacheslav Gerasimov
3d79e4609e as40: Fix duplicate registration of kotlin-copyright 2019-12-26 16:25:12 +03:00
Vyacheslav Gerasimov
7b1c4e72ba Build: Fix android-wizardTemplate-plugin dependencies
Present only in AS 3.6
2019-12-26 16:25:12 +03:00
Yaroslav Chernyshev
1a3cf3b792 [Gradle, Native] Added subspecs support in CocoaPods plugin
#KT-32750 fixed
2019-12-26 15:28:00 +03:00
Mikhail Zarechenskiy
8871c8b4fd Migrate diagnostic tests to 1.4 2019-12-26 15:08:51 +03:00
Dominic Fischer
07d35a3ad1 Fix template indentation (#2923) 2019-12-26 18:44:41 +07:00
Victor Petukhov
d3f63166f3 [JPS] Include Kotlin reflection for tests-spec though explicit specifying in gradle dependencies 2019-12-26 14:27:44 +03:00
Dmitry Petrov
babe6eb581 Fix explicit 'equals' for primitive types 2019-12-26 12:44:54 +03:00
Dmitry Petrov
1d5370a56a Fix rationale for test muted in JVM_IR (see KT-35656) 2019-12-26 12:44:54 +03:00
Denis Zharkov
7898922066 NI: Fix type mismatch caused by smartcast
^KT-25434 Fixed
2019-12-26 12:35:35 +03:00
Denis Zharkov
ae4397fbfb Fix bare typed smartcasts in NI
Star projections should be replaced with star projections
not for their expansions

See the test
2019-12-26 12:35:34 +03:00
Denis Zharkov
abee908b94 Remove effectively dead code in AbstractTypeCheckerContext 2019-12-26 12:35:33 +03:00
Denis Zharkov
0b385cc532 NI: Approximate captured-for-star-projections to *
^KT-35602 Fixed
2019-12-26 12:35:32 +03:00
Dmitriy Novozhilov
7728102a77 Cleanup and reformart DelegatedPropertyResolver.kt 2019-12-26 10:54:07 +03:00
Dmitriy Novozhilov
c8a1b876e8 [NI] Fix completion of error delegates with receiver with type parameters 2019-12-26 10:54:07 +03:00
Dmitriy Novozhilov
e83941a98e [NI] Don't resolve delegates twice
#KT-31219 Fixed
#KT-31679 Fixed
#KT-32249 Fixed
2019-12-26 10:54:06 +03:00
Dmitriy Novozhilov
0c01499d98 [NI] Improve completing calls with multiple postponed arguments
#KT-27999 Fixed
#KT-30244 Fixed
#KT-31102 Fixed
2019-12-26 10:53:03 +03:00
Aleksey Kladov
0aa527347d Stubs don't break KtTypeAlias::isTopLevel
`foo ?: bar is baz` is parsed as `(foo ?: bar) is baz`. So, if stub is non-null, this always returns `False`, because `Boolean` is definitely not a `KtFile`. See https://pl.kotl.in/6DtggcImf 

This Kotlin's "most vexing parse" badly needs a diagnostics.
2019-12-26 10:36:40 +03:00
Dmitry Petrov
08454aa47e Minor: add reference to language design issue 2019-12-26 10:31:12 +03:00
Mark Punzalan
2dd8727baf [JVM IR] ForLoopsLowering: Keep IMPLICIT_NOTNULL type-casts in next()
and `componentN()` calls.

There were issues when we have iterables from Java where the element
type has "not null" type information.
2019-12-26 10:11:18 +03:00
pyos
e54ef3bdb8 PSI2IR: ignore enum annotation arguments of error type
Similar to references to error type, this may happen if library A uses
an entity from library B annotated with an annotation from C, but A is
compiled without C on the classpath.
2019-12-26 10:10:29 +03:00
Vyacheslav Gerasimov
a9848305a3 Build: Use tar.gz extension for linux AS distributions 2019-12-25 20:50:52 +03:00
Vyacheslav Gerasimov
d8d21b0cba as40: Fix test compilation for AS 4.0 C7 2019-12-25 20:19:36 +03:00
Vyacheslav Gerasimov
89a259837f as40: Fix KotlinDslScriptModelProvider and KotlinDslScriptModelResolver for AS 4.0 C7 2019-12-25 20:19:36 +03:00
Vyacheslav Gerasimov
68f1d91e1b as40: Upgrade to AS 4.0 C7 2019-12-25 20:19:36 +03:00
Vyacheslav Gerasimov
eda27ab298 Build: Add Ide.AS40 constant 2019-12-25 20:19:36 +03:00
Vyacheslav Gerasimov
19233ee120 Build: Add as40 to .bunch 2019-12-25 20:19:35 +03:00
Yan Zhulanow
5fe06ceb06 Pill: Support api/implementation configurations 2019-12-26 00:17:17 +09:00
Victor Petukhov
4309f53e11 NI: don't filter flexible types during CST calculation and force return as result the first of such types
^KT-35658 Fixed
2019-12-25 18:00:23 +03:00
Dmitriy Novozhilov
51424ec598 [NI] Add constraint K <: T from constraint K <: CapturedType(in T)
#KT-33263 Fixed
2019-12-25 16:19:19 +03:00
Dmitriy Novozhilov
b54169d312 [NI] Fix substitution in completion of callable references in coroutine inference 2019-12-25 16:19:19 +03:00
Dmitriy Novozhilov
04d4366f2a [NI] Update testdata broken in NI 2019-12-25 16:19:18 +03:00
Dmitriy Novozhilov
6ca0df59c1 [FIR-TEST] Fail old FE diagnostics test if testdata doesn't exist 2019-12-25 15:29:09 +03:00
Pavel Kirpichenkov
77e4212774 [minor] unmute fixed spec tests 2019-12-25 14:59:06 +03:00
Pavel Kirpichenkov
7ee71450bc [NI] Discriminate Nothing? result type from nullability constraints
Nullability constraints should not be chosen when proper
argument constraints for variables in contravariant position present.

^KT-32106 Fixed
^KT-33166 Fixed
2019-12-25 14:59:06 +03:00
Pavel Kirpichenkov
a1ad680edb [NI] Disallow full completion based on lower Nothing constraint 2019-12-25 14:59:06 +03:00
Pavel Kirpichenkov
384bd858e9 [NI] Support fixation to subtype in completion mode calculator
Allow full compltion mode for return type depending on type parameters in
contravariant position only if they have proper equality constraint.
2019-12-25 14:59:05 +03:00
Pavel Kirpichenkov
e69e45e2a6 [NI] Remove direcion calculator from variable fixation
Force constraint system completer to always fix variable with unknown position.
This makes inferred type for in parameters less specific, but OI infers to
subtype in such cases, so NI won't infer to less specific types than before.
2019-12-25 14:59:05 +03:00
Pavel Kirpichenkov
e9941f8c12 [NI] Implement algorithm for completion mode selection
Current selection of completion mode for call is not always correct in case of full mode,
and sometimes too conservative in case of partial mode. Updated algorithm checks constraints
wrt position of type variables in return type and in other related constraints.
Full completion happens if proper constraint requirements are satisfied for variables.
2019-12-25 14:59:05 +03:00
Pavel Kirpichenkov
a9391c8dfb [NI] Remove Nothing result type restriction in most cases
Make Nothing as result type not suitable only for if, when, try and ?: special functions.
2019-12-25 14:59:05 +03:00
Mikhail Zarechenskiy
ae1630f376 [NI] Don't discriminate Nothing-type from resulting ones
^KT-32106 Fixed
2019-12-25 14:59:04 +03:00
Dmitry Petrov
a8e9a6a1d0 Properly reference type parameter descriptors
'descriptor -> descriptor.original' relation is often inconsistent
wrt 'containingDeclaration', parameters, and type parameters,
we have to introduce some workarounds here.
2019-12-25 14:20:47 +03:00
Igor Chevdar
f8fd5092c6 [native-gradle-plugin] Disabled cache building for iOS devices 2019-12-25 16:16:55 +05:00
Nikolay Krasko
70ff3d36d0 Fix running tests in compiler plugins 2019-12-25 14:05:16 +03:00
Nikolay Krasko
5583b57ed7 Regenerate spec tests to activate muting framework for them 2019-12-25 14:05:15 +03:00
Nikolay Krasko
7a94b1d88b Mute SpringReferenceNavigationTestGenerated test 2019-12-25 14:05:15 +03:00
Nikolay Krasko
2f129ea435 Allow resolve during fixing AddSpringBeanQualifierFix action
Fix SpringQuickFixTestGenerated test
2019-12-25 14:05:15 +03:00
Nikolay Krasko
bf79b660c4 Fix HighlightingWithDependentLibrariesTest in 193 by using relative path 2019-12-25 14:05:14 +03:00
Nikolay Krasko
1b9bae0cca Mute more flaky tests
JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin
ConfigureKotlinInTempDirTest
MavenMigrateTest
2019-12-25 14:05:14 +03:00
Nikolay Krasko
d575df56e9 Minor: show method key in parse error 2019-12-25 14:05:14 +03:00
Nikolay Krasko
143cfc7030 Minor: put first actual item to the new line in tests 2019-12-25 14:05:13 +03:00
Nikolay Krasko
9b68008208 Mute JvmSmartCompletionTestGenerated (KT-32919) 2019-12-25 14:05:13 +03:00
Nikolay Krasko
c372dc7f0a Fix AmbiguousCalls in >= 192 2019-12-25 14:05:13 +03:00
Nikolay Krasko
0884681662 Mute flaky stub builder tests 2019-12-25 14:05:12 +03:00
Nikolay Krasko
1e14c48742 Mute KotlinMavenInspectionTestGenerated 2019-12-25 14:05:12 +03:00
Nikolay Krasko
9206f1cfb2 Remove compatibility hack with reflection usage 2019-12-25 14:05:12 +03:00
Nikolay Krasko
1682ace428 Mute MultiPlatformHighlightingTestGenerated 2019-12-25 14:05:11 +03:00
Nikolay Krasko
3210e1d44c Fix testHighlightingWithDependentLibraries 2019-12-25 14:05:11 +03:00
Nikolay Krasko
03bd80b1ba Mute CreateActual.testWithTestDummy 2019-12-25 14:05:11 +03:00
Nikolay Krasko
d2909814c2 Mute DeprecatedSymbolUsageFixSpecialTest 2019-12-25 14:05:10 +03:00
Nikolay Krasko
d80fdf307f Fix testNoSynthesizedParameterNames in 192 and 193 2019-12-25 14:05:10 +03:00
Nikolay Krasko
dca5ff10c7 Mute testKotlin_moveTopLevelDeclarations_moveFunctionToPackage_MoveFunctionToPackage in 193 2019-12-25 14:05:10 +03:00
Nikolay Krasko
6613b73657 Mute highlighting tests 2019-12-25 14:05:09 +03:00
Nikolay Krasko
1e3736ec1e Mute SerializationIrBytecodeListingTestGenerated 2019-12-25 14:05:09 +03:00
Nikolay Krasko
1058f04c53 Mute ShortenRefsTestGenerated 2019-12-25 14:05:09 +03:00
Nikolay Krasko
84604b91bf Mute StringInterpolationInjectionTest 2019-12-25 14:05:08 +03:00
Nikolay Krasko
c11f36cf1d Mute IncrementalJvmJpsTestGenerated tests 2019-12-25 14:05:08 +03:00
Nikolay Krasko
18b1d64adc Update FindUsagesTestGenerated$Kotlin$Conventions.testSet test data 2019-12-25 14:05:07 +03:00
Nikolay Krasko
3520d5b81d Mute JavaAgainstKotlinBinariesCheckerTestGenerated tests in 192 and 193 2019-12-25 14:05:07 +03:00
Nikolay Krasko
5f25242cbf Mute QuickFixTestGenerated.Libraries tests 2019-12-25 14:05:07 +03:00
Nikolay Krasko
712517a02e Mute testWithJava9ModuleInfo tests 2019-12-25 14:05:07 +03:00
Nikolay Krasko
f41b588f70 Mute gradle.NewMultiplatformProjectImportingTest tests
Stable failure on windows.
2019-12-25 14:05:06 +03:00
Nikolay Krasko
08ade450ff Mute gradle.ImportAndCheckHighlighting (KT-35631) 2019-12-25 14:05:06 +03:00
Nikolay Krasko
c848212ae9 Mute GradleBuildFileHighlightingTest test 2019-12-25 14:05:06 +03:00
Nikolay Krasko
c935078f05 Mute JavaToKotlinConverterSingleFileTestGenerated tests 2019-12-25 14:05:05 +03:00
Nikolay Krasko
c5d4213a5c Mute CoroutineDumpTestGenerated, stable failure on windows 2019-12-25 14:05:05 +03:00
Nikolay Krasko
9d54d1ec40 Mute GradleFacetImportTest tests in 192 and 193 2019-12-25 14:05:05 +03:00
Nikolay Krasko
482cb07420 Mute GradleConfiguratorTest tests 2019-12-25 14:05:04 +03:00
Nikolay Krasko
8014a6509e Allow to mute JUnit 4 tests with parameters 2019-12-25 14:05:04 +03:00
Svyatoslav Kuzmich
d74721716a [JS IR] Use short klib names instead of absolute paths 2019-12-25 13:44:57 +03:00
Svyatoslav Kuzmich
31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Pavel Punegov
70111f8db1 Ignore test in Native backend 2019-12-25 13:40:38 +03:00
victor.petukhov
be8ae24713 Temporary mute some spec tests through apply changes after 45e881f03f 2019-12-25 12:44:54 +03:00
Sergey Igushkin
1129b2d3eb Support serializing a module's own descriptors without dependencies
The KlibMetadataSerializer used to serialize all package fragments that a module
could provide, including those coming from the module's dependencies. In order
to produce a klib from a module that is analyzed by the K2MetadataCompiler, the
serializer needs to take just the own package fragments of the module, excluding
those of the dependencies.
2019-12-25 12:09:08 +03:00
Sergey Igushkin
ed6034e449 Support generating a klib from common code with K2MetadataCompiler 2019-12-25 12:09:08 +03:00
Sergey Igushkin
28e0089259 Allow not providing IR to serialize a klib with just the frontend metadata 2019-12-25 12:09:07 +03:00
Georgy Bronnikov
cea0f08049 Regenerate compiler tests 2019-12-25 12:04:04 +03:00
Dmitriy Dolovov
45d894ee6e K/N: remove unused code 2019-12-25 11:42:29 +07:00
Dmitriy Dolovov
84e8b895be Minor: Fix compilation warnings 2019-12-25 11:42:21 +07:00
Dmitriy Dolovov
59e84e826b Fast check of Kotlin/Native KLIBs by virtual files 2019-12-25 11:42:14 +07:00
Dmitriy Dolovov
98e9642a1e Stop publishing old KLIB reader 2019-12-25 11:42:04 +07:00
Igor Yakovlev
4afbbda858 Minor fixes of move refactoring
Fix NPE for case when target path for package is not exists
Clarify case when target path for file move does not exists
Fix NPE when file selector shows with empty edit box of file name in Move dialog
2019-12-24 21:25:38 +03:00
Igor Yakovlev
a2db1f8314 Fix move tests for bunch 192 2019-12-24 19:49:07 +03:00
Roman Artemev
f2f7d144aa [JS] Fix failing test 2019-12-24 19:26:06 +03:00
Roman Artemev
6ba8fbd451 [IR BE] Refactored FoldConstantLowering
- Fix `toString` evaluation for unsigned types in FoldConstantLowering
 - make corner cases around float/double evaluation work for K/JS
 - remove usage of kotlin type
2019-12-24 19:26:06 +03:00
Roman Artemev
e4f83b96a3 [JS BE] Reduce temporary variable number produced during lowering
- Do not create temporary variable for pure expressions
 - Clean up unused and unreachable r-value on top level of statement block
2019-12-24 19:26:06 +03:00
Roman Artemev
fb3bd8a9ac [JS BE] Implement accessor inlining optimization (WIP)
- enable constant folding
2019-12-24 19:26:05 +03:00
Roman Artemev
9871f8c579 [JS BE] Fix DCE to let it remove constant properties 2019-12-24 19:26:05 +03:00
Roman Artemev
2c94f590ca [JS BE] Improve error message in JS BE 2019-12-24 19:26:05 +03:00
Roman Artemev
738db7e511 [IR BE] Make FoldConstantLowering common 2019-12-24 19:26:05 +03:00
Roman Artemev
540b3cfec3 [JS IR] Fix test to make them able to run with JS 2019-12-24 19:26:05 +03:00
Roman Artemev
b5af28b28d [JS IR] Fix state machine builder to fit into switch optimizer requirements 2019-12-24 19:26:05 +03:00
Roman Artemev
50889e77a8 [JS IR] Support switch optimization for when-expression 2019-12-24 19:26:05 +03:00
Roman Artemev
23caf15457 [JS IR] Implement Switch optimizer for JS IR codegen 2019-12-24 19:26:05 +03:00
Igor Yakovlev
8dd467bde0 Fix build for bunch 191 2019-12-24 19:16:52 +03:00
pyos
982a088f00 JVM_IR: do not copy defaults in functions with inline class parameters 2019-12-24 18:59:33 +03:00
Igor Chevdar
9e17140daf [JS_IR] Turned on passing JS_IR tests 2019-12-24 15:54:45 +03:00
Igor Chevdar
7a5e8b4316 [IR] Inliner: supported tricky function references
This includes references to functions with varargs and default arguments
2019-12-24 15:54:45 +03:00
Dmitry Petrov
cdf9ef63ba Remove nullability assertions from special bridge call arguments 2019-12-24 12:50:06 +03:00
Toshiaki Kameyama
fabeca5955 Redundant curly braces in string template: do not report labeled 'this'
#KT-35475 Fixed
2019-12-24 14:46:46 +07:00
Mikhail Glukhikh
80d29cdad1 FIR resolve: soften processBlock limitation during inference completion
This allows us to enter some lambdas unentered before
2019-12-24 10:42:55 +03:00
Mikhail Glukhikh
fd73f5af20 FIR: simplify problematic test 2019-12-24 10:42:49 +03:00
Toshiaki Kameyama
03ec76b570 Redundant visibility modifier: do not report for 'internal' inside 'private'
#KT-35639 Fixed
2019-12-24 14:41:10 +07:00
Toshiaki Kameyama
49e5f170d1 "Replace 'when' with 'if'" intention: do not suggest if 'when' subject is variable declaration
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Toshiaki Kameyama
1cdcef3b08 "Split property declaration" intention: do not suggest in 'when' subject
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Ivan Gavrilovic
eab6864269 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.
2019-12-24 15:14:47 +09:00
Ivan Gavrilovic
62924ddcd4 KT-35472: Detect when content of annotation processor changes
Even if annotation processor classpath is the same, in case
individual entries change (e.g. bulding annotationo processor
from source), KATP should run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testUnchangedAnnotationProcessorClasspathButContentChanged
2019-12-24 15:14:47 +09:00
Stéphane Nicolas
7b227f3113 Remove Redundant Project
Just some syntax cleanup when visting the file.
Note: I was trying to understand why the output folders of kapt are creating so eagerly in a build, during configuration time indeed...(they should be created later, during execution).
2019-12-24 15:14:47 +09:00
Georgy Bronnikov
d4b0151f51 JVM_IR: fix name of received field for suspend lambdas
$ at the start caused AnonymousObjectTransformer to skip the field.
2019-12-23 18:03:46 +01:00
Ilmir Usmanov
068d3f4beb JVM_IR: Use IrInlineReferenceLocator to find inline suspend lambdas and lambdas, which capture crossinline 2019-12-23 18:03:45 +01:00
Ilmir Usmanov
1ea89ce28e JVM_IR: Minor. Unmute tests 2019-12-23 18:03:44 +01:00
Ilmir Usmanov
5c92da3f35 JVM_IR: Do not generate parameter annotations for continuation constructors
The idea is the same as in case of anonymous objects: they are created only
from Kotlin code, so we are sure, that the parameters are valid.
Also, the inliner complains on their transformations.
2019-12-23 18:03:43 +01:00
Ilmir Usmanov
9292022f88 JVM_IR: Support inner lambdas which capture crossinline 2019-12-23 18:03:42 +01:00
Ilmir Usmanov
daa76cbf1e JVM_IR: Support inner objects with multiple suspend functions
Do not clean `functionsToAdd`
2019-12-23 18:03:41 +01:00
Ilmir Usmanov
a1448ebb37 JVM_IR: Support crossinline suspend lambdas
The main idea is the following: since we need to generate
(fake)continuations before inlining, we move IrClasses of suspend
lambdas and continuation classes of named functions into the functions.
Thus, it allows the codegen to generate them prior to inlining and
the inliner will happily transform them for us.
Because of that, lowerings which transform call-site function are likely
to change reference to lowered suspend lambdas or functions.
Hence, do not rely on references to lowered suspend lambdas or
functions, instead, rely on attributes.

Do not generate continuation for inline suspend lambdas.
Previously, inline suspend lambdas were treated like suspend functions,
thus we generated continuations for them. Now we just do not treat them
as suspend functions or lambdas during AddContinuationLowering.
We should add continuation parameter to them, however.

Do not generate secondary constructor for suspend lambdas, otherwise,
the inliner is unable to transform them (it requires only one
constructor to be present).

Generate continuation classes for suspend functions as first statement
inside the function.
This enables suspend functions in local object inside inline functions.
Since we already have attributes inside suspend named functions, we
just reuse them to generate continuation class names. This allows us
to close the gap between code generated by old back-end and the new
one.

If a suspend named function captures crossinline lambda, we should
generate a template for inliner: a copy of the function without
state-machine and a continuation constructor call. The call is needed
so the inliner transforms the continuation as well.

Refactor CoroutineTransformerMethodVisitor, so it no longer depends on
PSI.
2019-12-23 18:03:40 +01:00
Ilmir Usmanov
3b37f6bd32 JVM_IR: Add attributes to named suspend functions
This is a prerequisite to moving continuation classes inside said
functions, which is needed to support crossinline suspend lambdas.
The logic of whether to copy attributes on lowerings or not is simple:
  - if the lowering moves function body to a new place, it should copy
  the attributes.
  - if the lowering just generates new declarations (i.e. bridges), it
  should leave attributes as is.
2019-12-23 18:03:39 +01:00
Igor Yakovlev
0f1592b023 Remove deprecated method usage 2019-12-23 16:32:43 +03:00
Igor Yakovlev
6fb788d446 Fix move refactoring for several class files
Fixed #KT-35235
(also fixed #KT-35427)
2019-12-23 16:32:43 +03:00
Mads Ager
51f726be9b JVM_IR: Fix check for whether classes are from Java.
This allows us to not generate redundant immutable collection
stubs. The code to generate the immutable collection stubs does
not deal well with thinking that all external declarations
come from Java.
2019-12-23 14:24:48 +01:00
Steven Schäfer
e261b1e2de JVM IR: Fix line numbers in callable reference classes 2019-12-23 14:03:34 +01:00
pyos
59f2aa7add JVM_IR: remove constructors of nested annotations 2019-12-23 13:59:42 +01:00
pyos
17d2fda946 JVM_IR: keep nullability when remapping type parameters 2019-12-23 14:28:05 +03:00
Igor Chevdar
1b95040934 [kotlin-native-plugin] Two fixes:
* Added property to select the cache kind (none, dynamic, static)
* Fixed the check if the cache needs to be rebuilt
2019-12-23 12:37:38 +03:00
Mikhail Zarechenskiy
e078282767 Fix ambiguity between Java and Kotlin SAM candidates
Because of incorrect flag we generated synthetic SAM candidates and got ambiguity when feature `SamConversionPerArgument` was enabled (Gradle case) because candidates for Java were duplicated

 #KT-35579 Fixed
2019-12-23 12:22:20 +03:00
Mikhail Glukhikh
99e02665b5 Add forgotten FIR test data for old FE test 2019-12-23 12:11:07 +03:00
Mikhail Glukhikh
81ac46d35d Fix FIR test data for old FE test 2019-12-23 12:02:54 +03:00
Ilya Goncharov
74889ef3ad [Gradle, JS] Actualize node and yarn version
#KT-35599 fixed
2019-12-23 11:31:15 +03:00
Ilya Goncharov
24e3310393 [Gradle, JS] Add check on run and dist task
- Check existence of compile output file to prevent fail in case of NO-SOURCE

#KT-31894 fixed
2019-12-23 11:29:17 +03:00
Dmitry Petrov
fefdce0406 KT-35550 Generate type parameters for delegating property accessors 2019-12-23 10:10:16 +03:00
Igor Yakovlev
4efab51751 Fix allopen call from UL methods
Fixed #KT-35577
2019-12-20 16:57:53 +03:00
Igor Chevdar
8d02d00f22 [IR Serialization] Removed native-specific hack in mangler 2019-12-20 16:13:11 +03:00
pyos
1f55b59fa3 Unmute a fixed Fir2IrText test 2019-12-20 15:12:37 +03:00
pyos
26822a0cde Minor: IGNORE_BACKEND: ANY_FIR -> IGNORE_BACKEND_FIR: ANY
for consistency with blackbox tests.
2019-12-20 15:12:36 +03:00
Mikhail Glukhikh
38a3797325 Unmute FIR2IR test (due to fixed bug in FIR) 2019-12-20 14:44:46 +03:00
Ilya Kirillov
69e9ae94c6 Use snakeyaml from maven instead of from intellij
As new-project-wizard-cli module is not bundled into the plugin jar
2019-12-20 14:13:29 +03:00
pyos
2adcb5dec4 Add the ANY_FIR target for muting Fir2IrText tests 2019-12-20 13:03:39 +03:00
pyos
a4b005fd5d PSI2IR: generate field writes for all val property assignments
Assuming the frontend is correct, and it hopefully is, all of them are
initializations even if not done in the owner class directly.
2019-12-20 13:03:39 +03:00
Ilya Kirillov
92f8432b1e New J2K: Fix not converted jetbrains nullability annotations for types
it became broken after annotation started to be assigned to type elements
instead of declarations after 4da7d11

#KT-34987 fixed
2019-12-20 13:02:51 +03:00
Mikhail Zarechenskiy
3840294f44 Add tests for obsolete issues
#KT-11979 Obsolete
 #KT-12898 Obsolete
 #KT-30657 Obsolete
 #KT-28446 Obsolete
2019-12-20 12:06:20 +03:00
Mikhail Zarechenskiy
c3ffef1840 Fix incorrect use of language feature
See #KT-34889 for details
2019-12-20 12:06:17 +03:00
Dmitriy Novozhilov
c94dd2939e [NI] Add test for KT-32429
#KT-32429 Can't Reproduce
2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov
e730965bc5 [NI] Approximate intersection type in type argument to star if it's necessary
#KT-32196 Fixed
2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov
26f7bf1c21 Regenerate tests 2019-12-20 11:33:06 +03:00
Dmitriy Novozhilov
e466fd5196 [NI] Infer type variable to Nothing if all upper constraints are from upper bounds
#KT-32196 Fixed
2019-12-20 11:17:47 +03:00
Dmitriy Novozhilov
7fed7a840b [NI] Update some testdata broken in NI 2019-12-20 11:17:47 +03:00
Ilya Kirillov
c311a66e5e Fix 191 & as35 compilation 2019-12-20 04:15:26 +03:00
Ilya Kirillov
d6daaf14f8 Fix "Protected function call from public-API inline function is prohibited" error 2019-12-20 04:12:49 +03:00
Nikolay Krasko
2dcc617774 Minor: reformat 2019-12-20 02:39:05 +03:00
Nikolay Krasko
e99dc0f87f Show only unique diagnostics in psi checker (KT-35578)
MissingDependencyClassChecker.collectDiagnostics now show only unique diagnostics

As per-file analyzer trace used in checker delegates to resolve session trace, diagnostics might be duplicated because of race condition:
 1. If a non-checker thread performs analyze first, diagnostics for global elements will be stored in the resolve session trace only once.
 2 If the checker threads comes to the analyze first, diagnostics will be stored in the local trace, and after that might be duplicated in the resolve session trace by other analyzers.

 #KT-35578 Fixed
2019-12-20 02:39:05 +03:00
Nikolay Krasko
75beaa861f Use abstract class to prevent GradleDaemonAnalyzerTestCase running as test 2019-12-20 02:37:57 +03:00
Nikolay Krasko
3e48494837 Proper ignore new daemon tests without warning about tests absence 2019-12-20 02:37:57 +03:00
Vyacheslav Gerasimov
19422b12b4 Build: Add buildScanUserData script gradle-build-scan-snippets 2019-12-19 20:51:05 +03:00
Victor Petukhov
c89def9e06 [minor] Update test data for 1.4 2019-12-19 19:31:32 +03:00
Michael Kuzmin
254dc8f71c Build: Drop IntelliJ 2018.3 and Android Studio 3.4 support
Delete *.183 and *.as34 bunch-files
2019-12-19 18:31:07 +03:00
Ilya Chernikov
ae0efa77e3 [minor] updating fir testdata 2019-12-19 16:28:45 +01:00
Vyacheslav Gerasimov
75c94f3b0f Build: Upgrade kotlin-build-gradle-plugin to 0.0.8 2019-12-19 17:45:31 +03:00
Vyacheslav Gerasimov
20faa9e3e4 Build: Make use of user & password properties in build cache configuration 2019-12-19 17:45:30 +03:00
Vyacheslav Gerasimov
e43ea7e183 Build: Add build cache user and password properties to BuildProperties 2019-12-19 17:45:30 +03:00
Simon Ogorodnik
1ee54d74d0 [FIR] Use FIR resolution API in explorer window 2019-12-19 17:36:13 +03:00
Simon Ogorodnik
87c698f843 [FIR] Remove obsolete total kotlin resolve test 2019-12-19 17:35:02 +03:00
Simon Ogorodnik
a3d531e8b4 [FIR] Extract jvm-only call conflict resolver 2019-12-19 17:34:56 +03:00
Simon Ogorodnik
05308a3652 [FIR] Introduce module for all jvm extensions 2019-12-19 17:30:12 +03:00
Mikhail Glukhikh
99489321f1 [FIR] Add forgotten test data for old FE test 2019-12-19 17:16:14 +03:00
Mikhail Glukhikh
fe8d68ecc7 Use different transformers per module in FIR diagnostics tests
Before this commit, we used same transformers for all modules,
which provoked using same ScopeSession for all modules.
Now we re-create transformers for any new module.
This fixes some problems with incorrect caching in ScopeSession.

NB: this provokes ambiguities in some old FE tests,
mostly they're correct (same as old FE).
2019-12-19 17:16:14 +03:00
Mikhail Glukhikh
c4e6f8a640 Cache FirPackageMemberScope in ScopeSession instead of member scope provider 2019-12-19 17:16:14 +03:00
Mikhail Glukhikh
cb93b25fca FIR: make possible to use differently typed IDs in ScopeSession 2019-12-19 17:16:14 +03:00
Mikhail Glukhikh
4d1b032c1f Rename: FirSelfImportingScope -> FirPackageMemberScope 2019-12-19 17:16:14 +03:00
Ilya Chernikov
4e14d04926 [minor] fix testdata for compiler 1.4 2019-12-19 14:25:56 +01:00
Mikhail Glukhikh
6e6d9ae795 FIR body resolve: start analyzing files with independent context 2019-12-19 16:03:17 +03:00
Mikhail Glukhikh
ada7f3da6c FIR: resolve anonymous initializer in context independent mode 2019-12-19 16:03:17 +03:00
Mikhail Glukhikh
99643e1b2d FIR: do not run full tower resolve on integer literal type 2019-12-19 16:03:17 +03:00
Mikhail Glukhikh
cb3f02d015 FIR modularized test: do not print unnecessary stuff to the console 2019-12-19 16:03:16 +03:00
Mikhail Glukhikh
48c74fd1ba FIR black box codegen tests: do not print bytecode to the console
#KT-35030 Fixed
2019-12-19 16:03:16 +03:00
Mikhail Glukhikh
ad6f4fa92e FirResolveBench: do not print unnecessary stuff to the console #KT-35030 Fixed 2019-12-19 16:03:16 +03:00
Ilya Chernikov
f38bb19fc6 [minor] Fix testdata for compiler 1.4 2019-12-19 14:01:01 +01:00
Ilya Kirillov
06dc2caf41 Fix compilation for AS 2019-12-19 15:56:34 +03:00
Pavel Kirpichenkov
ac47c0cf3c [minor] Update test data for 1.4 2019-12-19 15:18:19 +03:00
Toshiaki Kameyama
ba640be81d KT-32178 Keyword completion: don't add 'fun' after 'suspend' in type position
#KT-32178 Fixed
2019-12-19 15:07:20 +03:00
Nikolay Krasko
1f878049eb Allow @author usage in ...projectWizard.settings.version.maven package 2019-12-19 15:02:41 +03:00
Nikolay Krasko
280cb5b60b Exclude kotlin-test-nodejs-runner generated folders from code conformance test 2019-12-19 15:02:41 +03:00
Nikolay Krasko
2c684c56a3 Mute testVersionsAreConsistent test (KT-35567) 2019-12-19 15:02:41 +03:00
Mikhael Bogdanov
650cfeaaed Update inline tests to void PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR 2019-12-19 12:46:36 +01:00
Ilya Chernikov
8322398133 [minor] Fix testdata for compiler 1.4 2019-12-19 12:32:14 +01:00
Ilya Chernikov
45e881f03f [NI] Fix inference if inner system has only by "uninteresting" constraint
#KT-32250 fixed
2019-12-19 11:20:10 +01:00
Ilya Chernikov
3e537cfcb4 [minor] [NI] Additional test for loosing type annotations on extension functions
taken from KT-34820
2019-12-19 11:20:07 +01:00
Mikhail Glukhikh
1c6da8b9b4 [FIR] Add separate diagnostic tests working in light tree mode
Now we have separate raw fir builder based and light tree builder based tests.
Note: one light tree test was ignored due to lack of JavaElementFinder in this mode.
2019-12-19 12:29:01 +03:00
Mikhail Glukhikh
9efb1fc527 Change FIR modularized test to be able to work in light tree mode 2019-12-19 12:29:01 +03:00
Mikhail Glukhikh
3f76408c6f Protect FirResolveBench from light tree (this prevents cast to KtFile exception) 2019-12-19 12:29:01 +03:00
Dmitry Petrov
09c3279cc7 PSI2IR: Infer smart cast on dispatch receiver of FAKE_OVERRIDE calls
NB here we have use derived class type with type arguments replaced
with star-projections. This emulates JVM erasure (to some degree),
but, unfortunately, that's best we can offer here at the moment.
2019-12-19 12:24:58 +03:00
Natalia Selezneva
feda832eb7 Tests: switch off script configuration update in MutlifileRefactoringTests 2019-12-19 11:52:27 +03:00
Natalia Selezneva
233d400e93 Scripting: remove unexpected cache clear 2019-12-19 11:52:26 +03:00
Mikhail Glukhikh
7ba0a11f43 FIR light tree: add forgotten default bound for type parameters 2019-12-19 11:19:02 +03:00
Mikhail Glukhikh
ebb1ca7cd9 Fix 'fir:lightTree' build script to be able to run light tree tests 2019-12-19 11:19:02 +03:00
Mikhail Glukhikh
7abb3fc987 Protect FirJavaElementFinder from light tree 2019-12-19 11:19:01 +03:00
Mikhail Glukhikh
774eb62118 FIR resolve bench: make possible building FIR files via light tree 2019-12-19 11:19:01 +03:00
Mikhail Glukhikh
d702dc862a FIR light tree: eliminate unused 'project' argument 2019-12-19 11:19:00 +03:00
Denis Zharkov
e8131d6e30 Choose Java field during overload resolution with a pure Kotlin property
^KT-31244 Fixed
2019-12-19 10:53:31 +03:00
Dmitriy Novozhilov
aa8578b675 Allow null operators for result and using Result as return type with enabled InlineClasses 2019-12-19 10:22:45 +03:00
Dmitriy Novozhilov
eed5b3f1d1 Add quickfix for removing redundant spread operator
#KT-25306 Fixed
2019-12-19 10:22:45 +03:00
Dmitriy Novozhilov
ee36fb903f Allow use expression of array type as named argument for vararg 2019-12-19 10:22:44 +03:00
Alexander Udalov
0cb48999ff JVM IR: retain optional annotations as package private classes
Similarly to how it's done in the old backend (see
PackageCodegenImpl.generateClassesAndObjectsInFile and
AnnotationCodegen.genAnnotation)
2019-12-18 20:25:11 +01:00
Steven Schäfer
5d3ef4c632 JVM IR: Fix names of fake local variables for inline arguments 2019-12-18 18:50:29 +01:00
Denis Zharkov
c486fa6189 NI: Report incompatible receiver of callable reference
^KT-35535 Fixed
2019-12-18 19:33:55 +03:00
Denis Zharkov
dd56c3d918 NI: Fix property references overload ambiguity
^KT-35213 Fixed
2019-12-18 19:33:55 +03:00
Alexander Gorshenev
ab79c3e0a0 Properly mute (and unmute) tests for unrelated backends 2019-12-18 19:29:56 +03:00
Alexander Gorshenev
ffa368e0a7 Reconciled -Xklib-mpp with commonizer 2019-12-18 19:29:56 +03:00
Alexander Gorshenev
dc8240c24e Expect/actual support in klibs under -Xklib-mpp 2019-12-18 19:29:56 +03:00
Alexander Udalov
218d7c31ed Remove muted tests on automatic experimental->release coroutine migration 2019-12-18 17:21:44 +01:00
Alexander Udalov
3ac5cb9a6e Minor, fix typos in exception message 2019-12-18 17:17:21 +01:00
Pavel Kirpichenkov
ebb9f09656 [NI] Fix issues with star projection uncapturing
Prevent stack overflow during uncapturing of star projection
for parameter with recursive upper bound.
Uncapture star projections for flexible type parameters with
respect to flexible upper bound.

^KT-35210 Fixed
2019-12-18 16:19:33 +03:00
Pavel Kirpichenkov
86dc0925b1 [NI] Preserve constraint position for OnlyInputType during incorporation
Variable with complex dependency on other variable loses its
original constraint position when variable it depends on is fixed.
To prevent that, original input position is saved in incorporation
position.
2019-12-18 16:19:33 +03:00
Pavel Kirpichenkov
2fc79856a2 [NI] Fix OnlyInputTypes for captured types
Uncapture projections recursively for cases when captured type is not
top-level type or first level type argument
2019-12-18 16:19:32 +03:00
Alexander Udalov
16db3a8b5f Fix compiler and IDE tests on Experimental/RequiresOptIn
See cdbabf224f, e009c7064e
2019-12-18 14:09:06 +01:00
Ilya Kirillov
830f0c6137 Fix class not found exception in gradle wizard tests 2019-12-18 15:54:54 +03:00
Ilya Kirillov
1ab405a86c Wizard: introduce unit test mode 2019-12-18 15:54:51 +03:00
Ilya Kirillov
1c30572844 Wizard: fix android tests 2019-12-18 15:54:50 +03:00
Ilya Kirillov
b2166dc40d Wizard: fix wrong checking for project kind in UI 2019-12-18 15:54:48 +03:00
Ilya Kirillov
c1ce215b5d Wizard: disable abbility to switch between targets in existing module 2019-12-18 15:54:47 +03:00
Ilya Kirillov
7204ab091a Wizard: add suggested module names for js targets 2019-12-18 15:54:44 +03:00
Ilya Kirillov
fc9f63d49f Wizard: do not allow to create more than one target of each type 2019-12-18 15:54:42 +03:00
Ilya Kirillov
aa2992e84a Wizard: add additional applicability checker for template 2019-12-18 15:54:41 +03:00
Ilya Kirillov
40367635cc Wizard: remove unused android service 2019-12-18 15:54:40 +03:00
Ilya Kirillov
af174b4f74 Wizard: format templates code 2019-12-18 15:54:38 +03:00
Ilya Kirillov
b29e6d0c69 Wizard: add simple js template 2019-12-18 15:54:36 +03:00
Ilya Kirillov
5d56f3d28b Wizard: do not print duplicated repositories 2019-12-18 15:54:35 +03:00
Ilya Kirillov
32a151f561 Wizard: introduce interceptors for module templates 2019-12-18 15:54:33 +03:00
Ilya Kirillov
8bf9c31880 Wizard: add simple JS client template 2019-12-18 15:54:30 +03:00
Ilya Kirillov
56fccce305 Wizard: add basic ktor server template 2019-12-18 15:54:27 +03:00
Ilya Kirillov
f927fb3471 Wizard: introduce ServicesManager & correctly handle disabled gradle & maven Idea plugins 2019-12-18 15:54:24 +03:00
Ilya Kirillov
9011eecfdf Wizard: change wizard title to experimental 2019-12-18 15:54:22 +03:00
Ilya Kirillov
b10e157147 Wizard: Create parent group for current and experimental project wizard 2019-12-18 15:54:20 +03:00
Ilya Kirillov
8684b0d6c1 Wizard: show experimental new project wizard only by registry flag 2019-12-18 15:54:19 +03:00
Ilya Kirillov
aca193ddd2 Wizard: Add initial version of the new project wizard 2019-12-18 15:54:16 +03:00
Mikhael Bogdanov
4916f166fe Move android.test.dependencies under dependencies folder 2019-12-18 13:34:28 +01:00
Georgy Bronnikov
0d8036bb14 JVM_IR: do not generate main() when extension main is present
Extension methods with signature C.main() should not cause generation
of main(args: Array<String>).
2019-12-18 15:25:57 +03:00
Victor Petukhov
9d0c736f0e Use assertAllTestsPresentByMetadataWithExcluded for addSpreadOperatorForArrayAsVarargAfterSam IDE quick fix test 2019-12-18 15:21:01 +03:00
Georgy Bronnikov
220ea72d65 JVM_IR: add coercion for index in ArrayGet intrinsic 2019-12-18 13:03:12 +03:00
Igor Chevdar
cca3f13e48 Added multi-module test on inline functions 2019-12-18 12:45:41 +03:00
Roman Golyshev
bd805d71b1 KT-35463 EA-214439 Pass adjusted files to KotlinAwareMoveFilesOrDirectoriesDialog instead of originals
- Passing raw `sourceElements` have lead to `ClassCastException` when `KtClassOrObject` was casted to `PsiFileSystemItem` in `KotlinAwareMoveFilesOrDirectoriesDialog::initializeData`
- Migrate from `[PsiElement]` to more precise `[PsiFileSystemItem]`
  - This removes the cast to `PsiFileSystemItem` at all
- This bug can be reproduced only in Android Studio for some reason
- ^KT-35463 Fixed
- ^EA-214439 Fixed
2019-12-18 12:00:47 +03:00
Toshiaki Kameyama
dd8396efbc Convert lambda to reference: support nested class constructor call (#2877)
#KT-34690 Fixed
2019-12-17 22:52:46 +01:00
Zalim Bashorov
646c7ad0af [IDE, klib] Support in IDE klibs with dynamic type 2019-12-17 22:06:55 +03:00
Vyacheslav Gerasimov
34eb664504 Build: Remove teamcity tag setup from settings.gradle (tag via gradle arguments instead) 2019-12-17 20:53:13 +03:00
Alexander Udalov
7eda60d57e Minor, add more tests on signature-polymorphic calls
Add a test on null (since null is a special case in the
PolymorphicSignature spec), and a test on a call without assignment to a
variable
2019-12-17 18:44:19 +01:00
Alexander Udalov
64d40b4743 Support JVM polymorphic signature calls to methods with void return type
#KT-32026 Fixed
2019-12-17 18:39:05 +01:00
Alexander Udalov
e009c7064e Add -Xopt-in command line argument
As per https://github.com/Kotlin/KEEP/pull/201
2019-12-17 18:17:48 +01:00
Alexander Udalov
cdbabf224f Introduce RequiresOptIn and OptIn annotations
RequiresOptIn should be used now instead of Experimental, OptIn instead
of UseExperimental. See https://github.com/Kotlin/KEEP/pull/201.

This change adds the new declarations only to the stdlib, and supports
them in the compiler. Because of the way compiler loads annotations, we
need to bootstrap it first before deprecating the old annotations and
updating tests.

 #KT-34647 Fixed
2019-12-17 18:17:48 +01:00
Alexander Udalov
33bc3db144 Deprecate -Xexperimental compiler argument
This option is not widely used and its implementation relies on a
complicated mechanism of a module-wide metadata, which is not properly
supported in the IDE (see IdeModuleAnnotationsResolver).

 #KT-34649 Fixed
2019-12-17 18:17:48 +01:00
Vyacheslav Gerasimov
571bba7c04 Build: Add teamcity tag to build scans 2019-12-17 20:10:49 +03:00
Abduqodiri Qurbonzoda
b868e6f8da Rename Appendable methods parameters 2019-12-17 19:04:00 +03:00
Simon Ogorodnik
d1c0dfe8ac [FIR] Run System.gc() before each pass in modularized tests 2019-12-17 18:25:08 +03:00
Roman Artemev
0f71460833 Add missed comment 2019-12-17 18:04:52 +03:00
Toshiaki Kameyama
dbb282e60f Arg postfix postfix completion: fix typo in description
#KT-34386 Fixed
2019-12-17 18:03:43 +03:00
Roman Artemev
cad3cb1bbe [KLIB] Fix references to type made from TypeParameter in KotlinMangler
- promote ABI version
2019-12-17 17:56:07 +03:00
Mikhail Glukhikh
3544bf17f4 ConeIntegerLiteralType: extract COMPARABLE_TAG 2019-12-17 17:28:17 +03:00
Mikhail Glukhikh
3d961ffe8f ConeTypeContext: use built-in nullable any type 2019-12-17 17:28:16 +03:00
Mikhail Glukhikh
4d0b121223 FIR SAM resolution: use built-in nullable any type 2019-12-17 17:28:16 +03:00
Mikhail Glukhikh
c6db5abb14 FIR call resolve: make earlier qualifier resolver reset 2019-12-17 17:28:09 +03:00
Mikhail Glukhikh
684bdc44bb FIR: add implementation of reified type parameter references
This adds support of T::class.java for reified type parameters
2019-12-17 17:28:01 +03:00
Mikhail Glukhikh
cccb95465e FIR status resolve: update type alias phase
This prevents repeating of this phase for aliases
2019-12-17 17:28:00 +03:00
Mikhail Glukhikh
a6b6c9ba18 Minor: remove when unreachable branches 2019-12-17 17:28:00 +03:00
Mikhail Glukhikh
af3ab9178a Minor: remove unused imports 2019-12-17 17:27:59 +03:00
Roman Golyshev
8e53ccb852 Add ML completion jar to the resulting plugin jar
- Without it, ML completion jar will not be present in the runtime, causing errors when ML completion is enabled
- This step should have been done in 28ec74648e commit
2019-12-17 16:33:20 +03:00
Georgy Bronnikov
e92985458b JVM_IR: skip private declarations in imported classes 2019-12-17 15:53:29 +03:00
Igor Chevdar
776736a25a [IR] Remapped some forgotten types during IR copying 2019-12-17 15:48:56 +03:00
Svyatoslav Kuzmich
f099277210 [JS IR] Unmute tests and add KJS_WITH_FULL_RUNTIME 2019-12-17 15:33:43 +03:00
Svyatoslav Kuzmich
e32ec2a789 [JS IR BE] Support typeOf 2019-12-17 15:33:43 +03:00
Svyatoslav Kuzmich
3df8393ede [JS IR] Properly report compiler errors
Report compiler errors using message collector
Instead of crashing with stack trace
2019-12-17 15:33:43 +03:00
Nikolay Krasko
ea8fa55f12 Rename kotlinJUnitSettings test data folder to fix tests 2019-12-17 15:09:50 +03:00
Denis Zharkov
2aa1c40de4 Avoid checking trivial incorporated constraints 2019-12-17 15:06:17 +03:00
Denis Zharkov
02f3cedcf4 FIR: Optimize ConeInferenceContext::typeDepth 2019-12-17 15:06:17 +03:00
Denis Zharkov
b53c00cf69 FIR: Optimize simple things in inference 2019-12-17 15:06:17 +03:00
Mikhael Bogdanov
03c2350e79 Keep original casts during reification to avoid VerifyError
#KT-26435 Fixed
2019-12-17 12:41:22 +01:00
Igor Chevdar
6f16d02920 [gradle-native-plugin] Build static caches instead of dynamic 2019-12-17 14:37:34 +03:00
Ilmir Usmanov
b6de3c2fcc Disable tail-call optimization for suspend functions with Unit return type
if it overrides functions with another return type.
Otherwise, we cannot determine on call site that the function returns Unit
and cannot { POP, PUSH Unit } in order to avoid the situation when callee's
continuation resumes with non-unit result. The observed behavior is that
suspend function, which should return Unit, suddenly returns other value.
 #KT-35262: Fixed
2019-12-17 12:08:35 +01:00
Dmitry Gridin
09acdb655d KtScratchExecutionSession: fix compilation for 191 2019-12-17 17:54:36 +07:00
Dmitry Gridin
898308c7ba KotlinDebuggerCaches: fix INRE
#EA-219472 Fixed
2019-12-17 17:20:36 +07:00
Dmitry Gridin
3f500c6e92 KotlinConsoleRunner: fix INRE
#EA-219478 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
02beb72ab1 IDEKotlinAsJavaSupport: fix INRE
#EA-213321 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
4d7fe78a51 KotlinFunctionBreakpoint: fix INRE
#KT-35316 Fixed
#EA-219418 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
09bcfab047 KotlinNativeModuleConfigurator: fix INRE
#EA-219416 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
86f9253fa0 KtScratchExecutionSession: fix INRE
#EA-218701 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
78f7ed2c27 KotlinVariableInplaceIntroducer: fix PIEAE
#EA-209820 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
580885245d JavaToKotlinAction: fix KNPE
#EA-215300 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
34dcc72e7f idea: fix some ControlFlowException
#EA-219412 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
cdabff1941 KotlinImportOptimizer: should use with isIndeterminate=false
#KT-34928 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
7c9826b60b PerModulePackageCacheService: fix NPE for code injection
#KT-35208 Fixed
2019-12-17 17:20:35 +07:00
Dmitry Gridin
ebf3bfc048 KotlinIntroduceImportAliasHandler: remove unnecessary transformations 2019-12-17 17:20:34 +07:00
Mikhail Glukhikh
9f1f743d55 FIR: fix test data after Make 'statics visible from nested classes' 2019-12-17 12:24:14 +03:00
Toshiaki Kameyama
7b1771d432 Remove braces from 'when' entry: do not suggest when statement is lambda that has no arrow
#KT-35288 Fixed
2019-12-17 11:20:36 +03:00
Toshiaki Kameyama
afc680d5c9 JavaMapForEachInspection: do not report when lambda parameter is destructuring declaration
#KT-34511 Fixed
2019-12-17 11:18:27 +03:00
Toshiaki Kameyama
8857827dce "Add not-null asserted (!!) call": do not add this when implicit receiver is not extension receiver
#KT-34894 Fixed
2019-12-17 11:15:53 +03:00
Toshiaki Kameyama
f1c605d0f7 AddFunctionParametersFix: improve parameter name for 'it' argument
#KT-33297 Fixed
2019-12-17 11:10:15 +03:00
Toshiaki Kameyama
f8f50b2131 DeprecatedCallableAddReplaceWithInspection: add argument name if needed
#KT-34297 Fixed
2019-12-17 11:04:50 +03:00
Toshiaki Kameyama
23749bdde7 Add constructor parameter: add generic types correctly
#KT-34203 Fixed
2019-12-17 11:00:51 +03:00
tommykw
76a65af14b Fix #KT-31967 Typo in inspection name: "+= create new list under the hood" 2019-12-17 10:56:56 +03:00
Mikhail Glukhikh
ae827bfd80 Use declaration-site session in phased FIR instead of use-site session
This allows us to successfully find containing file for another module declaration
2019-12-17 10:43:23 +03:00
Mikhail Glukhikh
37839a181c Introduce FirIdeModuleDependenciesSymbolProvider #KT-35424 In Progress
This solves problems with inter-module dependencies, at least in small projects.
However, Kotlin project still does not see stdlib.
Also, we often have problems with untouched types during expected type checks
(FirUserTypeRef instead of FirResolvedTypeRef)
2019-12-17 10:41:24 +03:00
Mikhail Glukhikh
befcfad898 Rename: IdeFirProvider -> FirIdeProvider 2019-12-17 10:41:23 +03:00
Mikhail Glukhikh
8703da5a25 Rename: FirResolveState -> FirModuleResolveState to reflect per-module status 2019-12-17 10:41:23 +03:00
Dmitry Gridin
8dbbd64beb idea: cleanup code 2019-12-17 13:56:48 +07:00
Natalia Selezneva
e77d8657f4 Fix configuration for AS 3.5 2019-12-16 23:17:33 +03:00
pyos
54d707b3b6 JVM_IR: make constructors of named local classes public
They are accessible through reflection
2019-12-16 20:54:48 +01:00
Mads Ager
82f48cdd11 JVM_IR: Backwards compatible handling of default tailrec params.
Before 1.4 tailrec function default arguments were evaluated
right-to-left instead of left-to-right. This is controlled
by a compile-time flag. This change adds support for the
right-to-left evaluation order when that flag is not set.
2019-12-16 20:52:52 +01:00
Simon Ogorodnik
90a1b15b77 [FIR] Make statics visible from nested companion/classes 2019-12-16 21:21:12 +03:00
Simon Ogorodnik
02cbe990c0 [FIR] Use fast firSymbolProvider access 2019-12-16 21:21:11 +03:00
Simon Ogorodnik
2e27862d38 [FIR] Cache lookupTag lookup on creation from symbol (partially) 2019-12-16 21:21:10 +03:00
Simon Ogorodnik
0fb883ef62 [FIR] Use builtinTypes instead of creating new ones 2019-12-16 21:21:09 +03:00
Simon Ogorodnik
5de69471b0 [FIR] Use yieldIfNeed instead of yield 2019-12-16 21:21:09 +03:00
Simon Ogorodnik
81759e8c55 [FIR] Use proper sourceScope for modularized tests 2019-12-16 21:21:08 +03:00
Simon Ogorodnik
0a2c457f54 [FIR] Properly check typealias fqn matching 2019-12-16 21:21:07 +03:00
Simon Ogorodnik
d0c58be4e9 [FIR] Pass proper use-site session in deserialized provider 2019-12-16 21:21:06 +03:00
Simon Ogorodnik
85ff834fdb [FIR] Do not create Kotlin scopes for handledByJava classes 2019-12-16 21:21:06 +03:00
Simon Ogorodnik
dd803cb650 [FIR] Fix moduleInfo module names 2019-12-16 21:21:05 +03:00
Alexander Udalov
7f51be9cd3 Minor, change parameter name of FrameMap.enter/leave
It's not a descriptor in case of IrFrameMap
2019-12-16 17:38:11 +01:00
Alexander Udalov
f51a0048f6 Minor, rename test and avoid commented directive
Get rid of "_lv12" in the test name, since it's actually a test on the
modern compiler. Also, avoid the commented "IGNORE_BACKEND: JVM_IR"
directive in another test to make JVM IR test failures more greppable.
2019-12-16 17:38:11 +01:00
Alexander Udalov
561cde9d06 JVM IR: minor, add exception message to IrFrameMap.typeOf 2019-12-16 17:38:11 +01:00
Roman Artemev
0b7c11c96e [JS IR] Fix external fields naming 2019-12-16 18:08:09 +03:00
Roman Artemev
02db5ea0eb [JS IR] Fix state machine builder 2019-12-16 18:08:08 +03:00
Mikhail Glukhikh
ccb9a4e0a9 [FIR TEST]: add problematic test for T::class.java case 2019-12-16 15:23:46 +03:00
Natalia Selezneva
38b0de4ab6 Scripting: do not start multiple request when related file was changed 2019-12-16 14:55:50 +03:00
Natalia Selezneva
fba17d5b9a Minor, tests: clear memory cache in tests that check scripting file attributes 2019-12-16 14:55:49 +03:00
Natalia Selezneva
780c61dc16 Fix line separators in tests 2019-12-16 14:55:47 +03:00
Natalia Selezneva
31887d2fd1 Scripting: check if affected scripts are changed using file modification stamp instead of mark them out of date in cache
^KT-35205 Fixed
2019-12-16 14:55:47 +03:00
Natalia Selezneva
ec04f0059c Scripting: do not threat comments and spaces as modifications inside essential block 2019-12-16 14:55:46 +03:00
Natalia Selezneva
2f35d6d868 Scripting: save inputs stamp and diagnostics to file attributes
Check if they are up to date and initiate configuration update only in case they are out of date

^KT-35205
2019-12-16 14:55:45 +03:00
Natalia Selezneva
13b4e8716c Changes inside initscript and pluginManagement blocks should invalidate script configuration
^KT-35129 Fixed
2019-12-16 14:55:43 +03:00
Natalia Selezneva
d68c3584f2 Scripting: add test for loading configuration for gradle scripts 2019-12-16 14:55:42 +03:00
Natalia Selezneva
424a2c72b2 Implement KotlinWordsScanner
This will allow to correctly calculate the file modification crc based on it. this is needed for build.gradle.kts files which show notification about necessity of importing project. Otherwise this notification is shown on every file modification (after virtualFile save)
2019-12-16 14:55:41 +03:00
Natalia Selezneva
886e9613b8 Move script related extensions to separate xml-s 2019-12-16 14:55:40 +03:00
Natalia Selezneva
2e933507c6 Fix duplicated “Kotlin Script” definition for Gradle/Kotlin projects (KT-35096)
^KT-35096 Fixed
2019-12-16 14:55:40 +03:00
Denis Zharkov
153d894afb FIR: Optimize ConeTypeContext::asSimpleType 2019-12-16 13:09:48 +03:00
Denis Zharkov
1790dcf80c FIR: Reorder when entries in ConeTypeContext::typeConstructor
More expected types should be checked first
2019-12-16 13:09:48 +03:00
Denis Zharkov
a14852a6ec Minor. Make ConeClassLikeTypeImpl final 2019-12-16 13:09:48 +03:00
Sergey Rostov
ac81f046fd gradle.kts importing test: don't run on 191 (including as34) 2019-12-16 12:59:02 +03:00
Leonid Startsev
a2d8e2435f Reorder steps in psi2ir so postprocessing goes before unbound symbols stub generating
This is required because currently IR compiler plugins are launched during 'postprocess' step
and for correct work they require unbound symbols for plugin-provided declarations
(see commit message of 3e18350a for detailed explanation)
2019-12-16 12:42:18 +03:00
Mikhail Glukhikh
737eaebee6 FIR resolve: fold flexible types whenever possible #KT-31528 Fixed 2019-12-16 12:06:10 +03:00
Sergey Rostov
9f5a02dc7a gradle.kts importing: fix as36 2019-12-16 11:24:35 +03:00
Mikhail Glukhikh
637e6f5acc FIR: add forgotten test data for old FE test 2019-12-16 11:10:19 +03:00
Mikhail Glukhikh
acf48a1af7 Return NONE from FirSuperTypeScope if nothing is found 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
001af68495 FIR: distinguish lazy/non-lazy nested scopes more clear 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
fea224749b FIR: introduce symbolProvider.getNestedClassifierScope to choose lazy/non-lazy
For some reason this breaks two old FE based tests with member type aliases.
It's not very interesting because member aliases aren't supported.
2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
663d545d79 FIR: get rid of symbolProvider.getClassDeclaredMemberScope at all 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
af87a183c2 FIR: get rid of symbolProvider.getClassDeclaredMemberScope usages in compiler 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
f497231acd FIR: try to use JavaSymbolProvider directly in lazy nested classifier scope 2019-12-16 10:50:52 +03:00
Sergey Rostov
48d60ed4ea revert accidentally changed vcs.xml 2019-12-16 10:38:42 +03:00
Sergey Rostov
039090d2bf gradle.kts importing tests: run gradle 6.0.1 only for that test 2019-12-16 10:31:12 +03:00
Sergey Rostov
1930ab7c38 gradle.kts importing: reduce bunch files 2019-12-16 10:31:11 +03:00
Sergey Rostov
c0690ff5f6 gradle.kts importing: move code to dedicated package 2019-12-16 10:31:11 +03:00
Sergey Rostov
6e3e65c490 gradle.kts importing: add support for included builds and fix sub projects 2019-12-16 10:31:11 +03:00
Sergey Rostov
fef193be63 gradle.kts: add tests for importing scripts configuration 2019-12-16 10:31:11 +03:00
Sergey Rostov
dcd67d79f4 gradle.kts: script models should be imported in ProjectData key, not in GradleSourceSetData
Or it will be fail if there is no source sets (see org.jetbrains.kotlin.idea.codeInsight.gradle.GradleKtsImportTest.testEmpty for reproduction)
2019-12-16 10:31:11 +03:00
Sergey Rostov
fd16078a34 gradle.kts: add clearCaches method for testing 2019-12-16 10:31:11 +03:00
Sergey Rostov
559b067f91 gradle.kts: move areSimilar to utils.kt to use in tests 2019-12-16 10:31:11 +03:00
Mikhail Glukhikh
249f72585d Fix test data in FIR old FE diagnostics test
Probably broken by 13 Dec commits of Denis Zharkov
2019-12-16 10:27:05 +03:00
Igor Yakovlev
2639ed2c48 Fix invalid equality for UL methods
Potentially fixed #KT-34796
2019-12-15 23:42:31 +03:00
Anton Bannykh
d6fcde7316 JS_IR: fix typecheck corner case
Consider `fun <E : I> foo(a: Any?) = a as? E`, where I is an interface.
This check used to fail, because the `a == null` was missing, and
the `isInterface` stdlib method crashes if the first argument
is null. This change adds the null check.

Also this change prettifies the instance check in case of type parameter
left operand.
2019-12-15 17:36:24 +03:00
Anton Bannykh
9a971172c9 JS: fix object expression constructor delegation to secondary constructors with default arguments (KT-30517 fixed) 2019-12-15 15:21:23 +03:00
Victor Petukhov
419d414681 NI: Update FIR test data after 07269661b4 2019-12-14 17:52:57 +03:00
Georgy Bronnikov
92c2cfa968 JVM_IR: handle property references at class level 2019-12-13 20:44:09 +03:00
Vyacheslav Gerasimov
8d303af395 Build: Add build scan server url setting 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
724884513e Build: Extract build cache setup to kotlin-build-gradle-plugin 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
68ce5dbd90 Build: Use property for disabling/enabling local build cache 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
bfcac5b091 Build: Update kotlin-build-gradle-plugin to 0.0.4 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
283933ace5 Build: Add localBuildCacheEnabled property 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
729b4d33cf Build: Replace deprecated compile configuration with implementation in build script of buildSrc 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
85dcc65695 Build: Use kotlin-build-gradle-plugin in build script of buildSrc 2019-12-13 20:11:18 +03:00
Alexander Shustanov
c9cba34d67 KT-35454 Weird implementation of KtUltraLightFieldImpl.isEquivalentTo 2019-12-13 20:07:45 +03:00
Dmitry Savvinov
f45c11c6f2 Use constantSdkDependencyIfAny in getKeyForSdk as well 2019-12-13 19:11:02 +03:00
Dmitriy Dolovov
5b8be16f13 Kotlin/Native IDE plugin clean-up
- Re-organize classes
2019-12-13 15:52:25 +03:00
Dmitriy Dolovov
36ed29d4d5 Convert KotlinNativeMetaBinary from Java to Kotlin 2019-12-13 15:52:17 +03:00
Dmitriy Dolovov
511a4089ca Kotlin/Native IDE plugin clean-up
- Drop KotlinNativeMetadataVersion in favor of KlibMetadataVersion
- Drop KotlinNativeProtoBasedClassDataFinder in favor of KlibMetadataClassDataFinder
2019-12-13 15:52:10 +03:00
Dmitriy Dolovov
992a702762 Minor: organized imports 2019-12-13 15:52:03 +03:00
Dmitriy Dolovov
deb4025987 Fix: Use more precise KLIB compatibility check (by metadata version)
Issue #KT-34811
2019-12-13 15:51:54 +03:00
Denis Zharkov
34e1ab4e7a FIR: Leave single implementation of ConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
28f4d62ccf FIR: Add different extension for FirSession.inferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
b33d0c2594 Minor. Reformat ConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
0baf1e8fa7 Minor. Get rid of UniversalConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
bbc9927bce Minor. Get rid of DataFlowInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
0064429339 Avoid using TypeSystemInferenceExtensionContextDelegate in FIR
It's only needed in old FE to avoid clashes when initializing DI

The main idea is gettind rid of intermediate interfaces because
each of them adds another intermediate DefaultImpls call
2019-12-13 14:39:06 +03:00
victor.petukhov
25fdbdfecb NI: Update FIR test data 2019-12-13 11:49:32 +03:00
Yan Zhulanow
a19f8ffe6a Revert "Debugger: Add IR-powered ranking tests"
This reverts commit ce21a559

Because of the erroneous behavior in 'BuilderFactoryForDuplicateSignatureDiagnostics.groupMembersDescriptorsBySignature', two functions with arguments of different inline class types are considered to have the same JVM signature.
Before the error wasn't reported, as classes didn't have proper source elements.
This issue has to be fixed before enabling ranking tests.
2019-12-13 12:23:24 +09:00
Victor Petukhov
1534e2b76d NI: Actualize FIR test after 2d5a05466d 2019-12-13 00:17:37 +03:00
Victor Petukhov
07269661b4 NI: Allow to resolve to functions with SAM conversion and passing array without spread as vararg (with warning)
^KT-35224 Fixed
2019-12-12 23:46:16 +03:00
Simon Ogorodnik
fe875d628d Revert "[FIR] Fix outputs for logs of modularized test"
This reverts commit ae15fa76
2019-12-12 21:23:27 +03:00
Simon Ogorodnik
60cc9fa6f5 Revert "[FIR] Fix outputs for logs of modularized test"
This reverts commit ae15fa76
2019-12-12 20:55:13 +03:00
victor.petukhov
71cb65c064 NI: Add flexible Nothing to trivial constraints to filter it 2019-12-12 18:45:11 +03:00
victor.petukhov
2d5a05466d NI: Fix some unwanted exclusions constraints with remained corresponding optimization 2019-12-12 18:45:07 +03:00
Juan Chen
15f6beed57 Fix Compose extension points in compiler.xml 2019-12-12 18:30:54 +03:00
Mikhael Bogdanov
b95e7dfb6f Don't mark super call to method from any as interface one
#KT-35426 Fixed
2019-12-12 15:29:53 +01:00
Igor Chevdar
df2adb060c Bumped K/N version 2019-12-12 16:53:59 +03:00
Igor Chevdar
a7b3f26cef [native-gradle-plugin] Supported klib cache (building and using) 2019-12-12 16:53:59 +03:00
Ilya Goncharov
364d6a5afa [Gradle, JS] Actualize NPM dependencies 2019-12-12 16:44:30 +03:00
Dmitriy Novozhilov
f1f2e1830b [FIR-TEST] Fix incorrect testdata 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
4faa2c0c2c [FIR] Replace static cone types for integers with default classIds in ILT 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
c6b9593157 [FIR-TEST] Add identity checker of old frontend and fir testdata to old FE diagnostics tests 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
579cb5014a [FIR-TEST] Add !FIR_DUMP directive to diagnostics tests from old frontend 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov
e9c02a1cca [FIR-TEST] Add fir diagnostics test based on diagnostics tests from old frontend 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov
e7f8c8e155 [TEST] Regenerate tests after previous commit 2019-12-12 16:11:45 +03:00
Dmitriy Novozhilov
5b1f96ba1b [TEST] Add ability to exclude some testdata with pattern in test generator 2019-12-12 16:11:42 +03:00
Dmitriy Novozhilov
ae15fa7676 [FIR] Fix outputs for logs of modularized test 2019-12-12 16:11:42 +03:00
Georgy Bronnikov
bb301f8aca JVM_IR: fix wrong check in skipping captured vars 2019-12-12 15:38:18 +03:00
Mikhael Bogdanov
26032e4297 Split exception table on finally insertion before non-local return
in nested try blocks without finally

 #KT-31653 Fixed
2019-12-12 13:33:40 +01:00
Mikhael Bogdanov
c335015c05 Generate proper exception table
Don't forget to split nested try blocks without finally block
 on generating finally blocks from outer ones.

 #KT-31923 InProgress
2019-12-12 13:33:39 +01:00
Igor Chevdar
078cfc02a5 [IR] Removed wrong validation
IrEnumConstructorCall behaves differently whether it is inside IrEnumEntry or not.
Remove the validation for now.
2019-12-12 15:05:47 +03:00
Alexander Udalov
62ef280c53 Add compiler:ir.serialization.jvm to IDEA plugin
This fixes a problem caught by the Plugin Verifier. Kotlin IDEA plugin
depends on the JVM IR backend, which depends on ir.serialization.jvm now
2019-12-12 15:03:47 +03:00
Alexander Udalov
5f367278c1 Psi2ir: support generic properties in class delegation
Since property accessor descriptors (unlike corresponding IR elements)
do not have type parameters, we need to take them from the corresponding
property to ensure the correct IR for delegated property accessors.
2019-12-12 15:02:32 +03:00
Alexander Udalov
025360edc4 JVM IR: lookup symbols by name in ProgressionHandlers in known classes only
Alternatively, we could improve the lookup utilities and their usages to
always find the exact override of a symbol from
Collection/Iterable/CharSequence/etc, but since we need to load the
original symbol anyway in cases when the loop subject's type is a type
parameter, we might as well simplify everything and always reference the
original symbol.

Also improve exception message and removed unused declarations in
IrBackendUtils.kt.
2019-12-12 14:55:47 +03:00
Dmitriy Dolovov
359e49fa02 [Commonizer] Blacklist conflicting K/N functions from commonization 2019-12-12 14:52:31 +03:00
Dmitriy Dolovov
c79fcb8cf3 [Commonizer] Add compatible metadata version checks 2019-12-12 14:52:18 +03:00
Dmitriy Dolovov
503fc4883c [Commonizer] Log duration of each CLI phase 2019-12-12 14:52:10 +03:00
Dmitriy Dolovov
18117ed1f3 [Commonizer] Serialize commonized metadata for KLIB writer
- introduce EmptyDescriptorTable
- wipe out unused BindingContext from KlibMetadataSerializer
2019-12-12 14:52:02 +03:00
Dmitriy Dolovov
ce376f49fd [Commonizer] CLI for Kotlin/Native KLIBs 2019-12-12 14:51:55 +03:00
Dmitriy Dolovov
5bc2a4e1e8 [Commonizer] Fix: Don't commonize contents of stdlib 2019-12-12 14:51:44 +03:00
Dmitriy Dolovov
ee42e8c64c [Commonizer] Fix: Correct resolution of nested classes 2019-12-12 14:51:36 +03:00
Dmitriy Dolovov
a74e364849 [Commonizer] Support Kotlin/Native forward declarations 2019-12-12 14:51:29 +03:00
Dmitriy Dolovov
f4780206d9 [Commonizer] Fix: Skip KNI bridge functions 2019-12-12 14:51:21 +03:00
Dmitriy Dolovov
0a6c132241 [Commonizer] Fix: Cache package fragments with module name 2019-12-12 14:51:14 +03:00
Dmitriy Dolovov
a3e3b43aed [Commonizer] Fix: approximate signatures with type parameter upper bounds 2019-12-12 14:51:05 +03:00
Dmitriy Dolovov
92656a53ae [Commonizer] Fix: don't process same package fragments more than once 2019-12-12 14:50:56 +03:00
Pavel Kirpichenkov
8dc2784fc4 Reapply "Drop deprecated displayName from descriptor visibility"
Cancel revert due to update in kotlin-mirror/master in native
This reverts commit 39e0c6d55b
2019-12-12 13:57:52 +03:00
Ilya Goncharov
6e19004a4f [Gradle, JS] Add comment for test 2019-12-12 12:42:35 +03:00
Ilya Goncharov
1bc47b3f6f [Gradle, JS] Add test for package.json deserializing 2019-12-12 12:42:35 +03:00
Ilya Goncharov
b9a529d7d0 [Gradle, JS] Hack for GSON to get non-null values 2019-12-12 12:42:35 +03:00
Ilya Goncharov
7d98d33e3d [Gradle, JS] Hack for GSON to get non-null values 2019-12-12 12:42:34 +03:00
Dmitriy Novozhilov
53480c2266 [FIR] Fix fir2ir testdata broken in 4777dd6 2019-12-12 10:04:12 +03:00
Pavel Kirpichenkov
39e0c6d55b Revert "Drop deprecated displayName from descriptor visibility"
This reverts commit 6fa11d1573.
2019-12-11 18:30:24 +03:00
Pavel Kirpichenkov
d9ef7d0c8a [NI] Update / mute diagnostics
Update diagnostics for new inference.
'Not enough information for parameter' should not be reported for
fake calls and functions with error return type, muted in tests.
2019-12-11 17:53:43 +03:00
Pavel Kirpichenkov
6fa11d1573 Drop deprecated displayName from descriptor visibility
Deprecated displayName has been replaced with internal and external display
names for better diagnostic messages.
2019-12-11 17:30:29 +03:00
Simon Ogorodnik
ebc1562b32 Filter out non-xml model files in modularized test 2019-12-11 17:21:02 +03:00
Simon Ogorodnik
48a05e3688 Support prefixed modularized test-data installation 2019-12-11 17:21:01 +03:00
pyos
498b41b148 JVM_IR: do not do invokeinterface on Object methods
This works on HotSpot, but might confuse other VMs.
2019-12-11 15:09:37 +01:00
Ilmir Usmanov
df0a86ea57 Add NOP as first instruction in coroutine's try blocks
#KT-35035 Fixed
2019-12-11 15:01:41 +01:00
Mark Punzalan
4777dd652b [FIR] Add tests to catch issues with smartcasting of accesses to functions
and properties (type information is stored for the symbol and ALL accesses
to the same symbol are smartcasted).
2019-12-11 16:57:41 +03:00
Mark Punzalan
f031b47363 [FIR] Fix issue with multiple smartcasts of this. 2019-12-11 16:57:41 +03:00
Mark Punzalan
91f97fa611 [FIR] Support FirCheckNotNullCall in HTML dump. 2019-12-11 16:54:15 +03:00
Mark Punzalan
6e00df06e8 [FIR] Add data flow analysis for FirCheckNotNullCall. 2019-12-11 16:54:15 +03:00
Mark Punzalan
692a83f7bb [FIR] Add FirCheckNotNullCall converted to CHECK_NOT_NULL intrinsic
function call.
2019-12-11 16:54:15 +03:00
Ilya Matveev
6bc0fe121a Gradle: Escape TC service messages in debug logs
The MPP plugin uses TC service messages to interact with JS and
native test runs an writes received messages to a debug log. But
if a build is executed by TeamCity, these log messages may be
treated by TC as actual service messages.

This patch transforms the logged messages to avoid this issue.
2019-12-11 19:57:22 +07:00
Ilya Matveev
33df86338b Gradle, tests: Improve tests for running simulator unit-tests 2019-12-11 19:57:22 +07:00
Ilya Matveev
254864a49d Gradle, native, JS: Support excluding tests using TestFilter
TestFilter.excludePatterns was introduced in Gradle 5.0. This
patch adds support for this API in native and JS test tasks
and deprecates the old property used for test excludes.
2019-12-11 19:57:21 +07:00
Ilya Matveev
cc3438f20c Gradle, native: Add separate classes for targets with different tests 2019-12-11 19:57:21 +07:00
Ilya Matveev
e6ab70c18d Gradle, native: Support simulator tests 2019-12-11 19:57:21 +07:00
Mikhael Bogdanov
8225c5a9ce Remove obsolete logic to IS_BUILT_WITH_ASM6 2019-12-11 13:49:34 +01:00
victor.petukhov
a92f58b1ac Revert "NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed ^KT-32435 Fixed"
This reverts commit 09c2b92b
2019-12-11 15:32:46 +03:00
Ilya Goncharov
ccea2b73da [Gradle, JS] Add using Debuggable non headless chrome 2019-12-11 14:29:12 +03:00
Ilya Chernikov
354be2b14f [minor] Change expression evaluation cli argument to -Xexpression 2019-12-11 12:20:49 +01:00
Ilya Chernikov
ba056bf78c [minor] Remove irrelevant part of the test 2019-12-11 12:20:48 +01:00
Yan Zhulanow
748cbd7eec Import Kotlin JUnit run configuration settings from Gradle 2019-12-11 20:04:03 +09:00
Yan Zhulanow
0a9a08eab6 Rename Kotlin-specific Gradle configuration to "Kotlin Gradle" to avoid disambiguation 2019-12-11 20:04:03 +09:00
Yan Zhulanow
1bdff8f884 Rename Kotlin-specific JUnit configuration to "Kotlin JUnit" to avoid disambiguation 2019-12-11 20:04:03 +09:00
Toshiaki Kameyama
8477c1935c Run configuration: do not contain FQN in name
#KT-16886 Fixed
2019-12-11 20:04:03 +09:00
Yan Zhulanow
ce21a55943 Debugger: Add IR-powered ranking tests 2019-12-11 20:04:03 +09:00
Dmitry Gridin
31596f0d0b Formatter: fix some cases of call chain with wrap first call chain
#KT-35388 Fixed
2019-12-11 18:00:39 +07:00
Dmitry Gridin
e7ff0315d4 Formatter: fix line break before value parameter with annotation
#KT-23811 Fixed
2019-12-11 17:57:11 +07:00
Vladimir Ilmov
f05a452ef2 [coroutine][debugger] Unit test support added for Gradle run configurations. 2019-12-11 11:46:28 +01:00
Vladimir Ilmov
82cdcb421b jdi.StringReferenceImpl references replaced with StringReference 2019-12-11 11:44:02 +01:00
Egor Ushakov
e2010cb90d Do not cast to jdi impl classes 2019-12-11 13:16:27 +03:00
Mikhail Glukhikh
038ec8edcf Rethrow ProcessCanceledException in FIR resolve
Before this commit, we catched all exceptions at some points
and wrap them. For ProcessCanceledException it's incorrect,
because IDE logic does not expect wrapping of ProcessCanceledException
2019-12-11 13:01:38 +03:00
Mikhail Glukhikh
2b82618715 Fix unresolved references in bunch generate tests 2019-12-11 13:01:38 +03:00
Mikhail Glukhikh
9e263b6af2 FIR IDE: use registry to obtain kotlin.use.fir.resolution 2019-12-11 13:01:38 +03:00
Mikhail Zarechenskiy
cad0d7ff7f Fix compilation of maven-plugin test after 508330e0bb 2019-12-11 12:43:23 +03:00
Victor Petukhov
09c2b92b1d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed
^KT-32435 Fixed
2019-12-11 12:15:02 +03:00
pyos
78dfcef160 JVM_IR: move generateParameterNames to FunctionCodegen.kt 2019-12-11 08:19:55 +01:00
pyos
13a2879b78 JVM_IR: generate more correct parameter metadata 2019-12-11 08:19:55 +01:00
Tillmann Berg
cf86dc9a89 KT-20357: Add sample for Collections distinct and distinctBy methods 2019-12-11 07:42:05 +03:00
Ilya Gorbunov
f0e67f8397 Fix coreLibsInstall composite task
It was broken after the commit bbdbc2896b,
which included kotlin-stdlib-js-ir project into coreLibs list,
but that project didn't have 'install' task, on which 'coreLibsInstall' depends
2019-12-11 06:36:40 +03:00
Igor Yakovlev
6792d22c31 Fix minor bugs for UL methods and parameters representation
Remove INSTANCE field for local object declarations
Remove private suspend functions create from UL
Add correct extension function parameter name
Add support for setparam annotation modifier
2019-12-10 18:26:08 +03:00
Georgy Bronnikov
094de9fb5e IR: Do not capture variables from method calls in ClosureAnnotator
To call a method of a class, you never need to supply any values of
local variables (they would always be provided to the constructor).
2019-12-10 17:31:12 +03:00
Mikhail Glukhikh
344bc33096 [FIR TEST]: add problematic test with WeakHashMap.get ambiguity 2019-12-10 16:25:01 +03:00
Toshiaki Kameyama
12f17a6724 "Add constructor parameters" quick fix should add default parameters from super class (#2869)
#KT-33109 Fixed
2019-12-10 13:09:31 +01:00
Denis Zharkov
f0298aad77 FIR: Refine SAM support for methods with names from j.l.Object 2019-12-10 14:21:21 +03:00
Denis Zharkov
e89c777fc6 FIR: Create DefinitelyNotNull only for annotated types 2019-12-10 14:21:21 +03:00
Abduqodiri Qurbonzoda
56cae75404 Fix StringBuilder reverse test 2019-12-10 13:07:27 +03:00
Mikhail Glukhikh
edf5675415 [FIR TEST]: add problematic test with covariant array as receiver 2019-12-10 12:58:40 +03:00
Mikhail Glukhikh
7d62e3ce56 FIR: fix hasTopLevelClassOf optimization in deserialized provider
Before this commit, we answered 'no top level class' if Java class finder
could not calculate known class names. However, it's incorrect,
because this situation means 'don't actually know'.

To precise semantics, function name was also inverted
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
fa89aa0b49 Do not use member scope provider from FIR resolution API
In this commit we build self importing scope from scratch.
Using member scope provider is probably incorrect because of possible changes.
At any invalidation we should rebuild it.
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
718a679b72 FIR IDE API: add preliminary control of file in-block modifications
In this commit, we build FirFile from the beginning if in-block modifications are detected.
However, better way would be to rebuild only part of FirFile in this case
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
83ccd7dd1c FIR: implement separate diagnostic collector/reporter for IDE 2019-12-10 12:58:38 +03:00
Mikhail Glukhikh
fbf1dbf2da FIR: introduce error message renderer 2019-12-10 12:58:38 +03:00
Mikhail Glukhikh
e07b85ff34 FIR Java providers: insert some protection against ProcessCanceledException 2019-12-10 12:57:57 +03:00
Mikhail Glukhikh
cd089658bd IdeFirProvider: insert protection against ProcessCanceledException 2019-12-10 12:57:56 +03:00
Mikhail Glukhikh
fc117466a8 AbstractFirPsiCheckerTest: do partial error diagnostic comparison for some cases 2019-12-10 12:57:15 +03:00
Mikhail Glukhikh
4b251eb986 FIR IDE: lock FIR files before calling runResolve on them
This also fixes various synchronization problems
2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
63121df6ba Synchronized IdeFirProvider.getOrBuild file, don't share RawFirBuilder
Before this commit RawFirBuilder was reused,
that provoked a lot of synchronization problems
2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
ccb343e26b FIR: preliminary implementation of diagnostics highlighter (~30% supported) 2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
34202faaa5 Code cleanup: KotlinPsiChecker 2019-12-10 12:57:12 +03:00
Mikhail Glukhikh
1d6d88b50c FIR reference resolve test: observe mute tests which are actually passing 2019-12-10 12:57:12 +03:00
Mikhail Glukhikh
f8c86d2f9f FIR reference resolve test: mute 37/107 cases which aren't yet supported 2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
900227fdfa KtReferenceResolver: implement resolveToPsiElements() via FE IR (~60% supported) 2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
809b7d8381 FirResolution: store enabled value in field with initial reading from component
Before this commit, we read/wrote 'enabled' directly from PropertiesComponent.
Now we do only initial reading and then store modified value in field.
This should make 'enabled' reading faster.
2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
0d2d76696c Add FirResolution.enabled wrapper 2019-12-10 12:57:10 +03:00
Dmitriy Novozhilov
00112d4227 [FIR] Copy receiver of delegateProvider in fir building
There was a problem that receiver of `delegateProvider` and `expression` field
  of `FirWrappedDelegateExpression` was the same object, so after some changes in
  FirCallCompletionResultsWriterTransformer (where call was partially completed and then
  copied) there was a problem with resolve of `delegateProvider`, because reference of it's
  receiver had resolved reference, but type arguments were unsubstituted (see
  `testCommonCaseForInference`).

Maybe there is a better solution. E.g. we can transform type arguments in completion, so we don't need coping of function call at all
2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
51560f2f17 [FIR] Fix order of resolving children of FirProperty 2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
e281d224a3 [FIR] Fix testdata broken in b76c984b 2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
a89e9966e6 [FIR] Fix call completion of complex constant expressions with integer contants 2019-12-10 12:25:42 +03:00
Ilya Goncharov
f8b1e95830 [Gradle, JS] Inline single used method for prefix matching 2019-12-10 11:41:03 +03:00
Ilya Goncharov
8c6941dc5b [Gradle, JS] Java and JS difference in fqn should affect exclude patterns too 2019-12-10 11:37:13 +03:00
Ilya Goncharov
770e5147d0 [Gradle, JS] Java and JS difference in fqn should affect exclude patterns too 2019-12-10 11:37:13 +03:00
Ilya Goncharov
da16d48068 [Gradle, JS] Remove debug console 2019-12-10 11:26:48 +03:00
Ilya Goncharov
096a6c9551 [Gradle, JS] Fix failing Karma tests for empty tests
#KT-35318 fixed
2019-12-10 11:25:35 +03:00
Natalia Selezneva
36d87c9905 Mute GradleMultiplatformWizardTest
^KT-35368
2019-12-10 09:16:27 +03:00
Natalia Selezneva
b66fdad80c Set since build to IDEA 192.7142.36 for 192 bunch
Fix compilation in idea-gradle module
Android Studio 3.6 doesn't still contain some of those changes
2019-12-10 09:16:27 +03:00
Abduqodiri Qurbonzoda
19e001afad Commonize Float.rangeTo(Float) #KT-35299 2019-12-09 20:24:06 +03:00
Dmitriy Novozhilov
b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Dmitriy Novozhilov
5577f0f8cb [TMP] Make context in inference components universal 2019-12-09 15:28:24 +03:00
Dmitriy Novozhilov
4f3ff84d30 [FIR] [TMP] Complete lambdas that are not part of some call 2019-12-09 15:02:41 +03:00
Dmitriy Novozhilov
e560a67a89 [FIR] Resolve this reference in delegating constructors 2019-12-09 15:01:54 +03:00
Dmitriy Novozhilov
583e07b3e4 [FIR] Don't analyze properties twice 2019-12-09 13:31:39 +03:00
Ilya Chernikov
99b0435de5 Add possibility for JDKs substitution in the build script...
configure substitutions for 1.6 and 1.7 for non-TeanCity builds
2019-12-06 15:51:52 +01:00
Dmitry Petrov
f6b99955f8 Update testData in bytecodeText (argument nullability assertions) 2019-12-06 11:03:07 +03:00
Dmitry Petrov
d28743157a Mute testPlatformValueContains in JVM_IR 2019-12-06 11:03:07 +03:00
Dmitry Petrov
c83f68151c Support @EnhancedNullability in psi2ir 2019-12-06 11:03:07 +03:00
Dmitry Petrov
429bf78afa Add 'Collection#contains' as a special case to psi2ir tests 2019-12-06 11:03:07 +03:00
Dmitry Petrov
26782d7216 Fix exception message checking
Looks like there's no big difference between "J.s() must not be null"
and "s() must not be null".
2019-12-06 11:03:07 +03:00
Dmitry Petrov
a819104d81 JVM_IR: generate nullability assertions for private operators
If a fun is private, we still generate nullability assertions
in case when it is an operator.
This is for bug-to-bug compatibility with 1.3.
2019-12-06 11:03:07 +03:00
Dmitry Petrov
331347f9fe Mute tests for explicit 'equals' on boxed primitives 2019-12-06 11:03:06 +03:00
Dmitry Petrov
89e1941dfd Update testData for argument nullability assertion tests 2019-12-06 11:03:06 +03:00
Dmitry Petrov
fc7783c7dd JVM_IR: JvmArgumentNullabilityAssertionsLowering 2019-12-06 11:03:06 +03:00
Dmitry Petrov
c676b58c14 Minor: JvmBuiltinOptimizationLowering.kt: reformat & fix warnings 2019-12-06 11:03:06 +03:00
Dmitry Petrov
20fb519f1a PSI2IR: Generate IMPLICIT_NOTNULL casts for platform type values 2019-12-06 11:03:06 +03:00
Abduqodiri Qurbonzoda
dabf6376db Update js reachable nodes count after expanding StringBuilder api 2019-12-06 05:37:09 +03:00
Nicolay Mitropolsky
df3bee3038 Annotations: support injections in string arrays (KT-35222) 2019-12-05 19:31:57 +03:00
Mikhail Glukhikh
f82fe20d43 [FIR] fix test data according to last commits 2019-12-05 18:27:47 +03:00
Mikhail Glukhikh
53935db992 [FIR] fix compilation error (arose due to commit conflict) 2019-12-05 18:25:17 +03:00
Dmitriy Novozhilov
6f222edb88 [FIR] Add unresolved type counter to html dump 2019-12-05 18:17:13 +03:00
Mikhail Glukhikh
bef344b33e Optimization / clarifying: getFirClassifierContainerFile 2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
2f3618041b FIR resolve: eliminate CallInfo.containingDeclaration as unused
This also fixes potential KNPE during its calculation
2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
c1789a0ecc FIR IDE: synchronous creation/registration of sessions 2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
70fa12d9d2 Extract FirDiagnosticsCollector to have creation logic in one place 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
9782ec1b1e FIR resolve phases: set BODY_RESOLVE phased properly
Before this commit, we never set this phase to declaration or file
2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
26ee02ed02 FIR: replace resolve phase in FirFile properly 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
1539ee30ff FIR IDE: fix local class containing file search 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
d35a26a75b Optimization: introduce FirIdeResolveStateService to cache FirResolveState 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
b4760bcbd3 Extract AbstractResolveElementCacheTest to use in FIR cache testing 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
74a7a8c881 FIR resolve (minor): provide source element for resolved qualifier 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
8808c775a4 Introduce FirResolvedTypeRef.delegatedTypeRef to see children types in IDE
This is needed to have access to resolved children types (e.g. type arguments) from IDE
2019-12-05 18:02:02 +03:00
Dmitriy Novozhilov
38c1a50c1d [FIR] Resolve delegating constructor calls 2019-12-05 17:47:15 +03:00
Dmitriy Novozhilov
de77bd526b [FIR] Change default visibility for sealed class constructors from private to public 2019-12-05 17:47:15 +03:00
Dmitriy Novozhilov
d840671620 [FIR] Don't create delegating super constructor call to kotlin.Enum for enums 2019-12-05 17:47:14 +03:00
Dmitriy Novozhilov
a0d8e5bde7 [FIR] Don't create delegating constructor call to kotlin.Annotation 2019-12-05 17:47:14 +03:00
Dmitriy Novozhilov
25720e20f4 [FIR] Fix bug in defining of completion mode 2019-12-05 17:46:59 +03:00
Dmitriy Novozhilov
088a949403 [FIR] Add implicit type counter to html dump 2019-12-05 17:46:59 +03:00
Denis Zharkov
e58711cde3 FIR: Select most specific members from supertypes scope 2019-12-05 17:35:33 +03:00
Denis Zharkov
e5166e0e7d FIR: Extract common parts in FirSuperTypeScope 2019-12-05 17:35:33 +03:00
Denis Zharkov
43aa1f87df FIR: Optimize supertypes scope structure 2019-12-05 17:35:33 +03:00
Denis Zharkov
91fce215d2 FIR: Simplify super type scopes related code
- Get rid of unnecessary subclass
- Use more abstract type where possible
2019-12-05 17:35:33 +03:00
Denis Zharkov
b8984d154b FIR: Do not copy type parameters from class to constructors
Use the same instances from class declaration instead

Otherwise, primary constructor value parameter types when used
in the class body are considered as different from types
based on the class type parameters

See the test genericConstructors.kt, before this commit
"id" call was reported in inapplicable
2019-12-05 13:08:51 +03:00
Abduqodiri Qurbonzoda
20d02dd0ee Commonize StringBuilder 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
1431e27a7b Move StringBuilder to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
0c033297a8 Move Appendable to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
50752d47fe Move CharacterCodingException to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
956e085b22 Rename text.kt file to StringBuilderJs.kt 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
2155f1680f Fix small mistake in CharSequence.lastIndexOf documentation 2019-12-04 22:15:33 +03:00
Georgy Bronnikov
4a0f683bea JVM_IR: repair after switching Ir.Symbols to non-lazy table
Symbols referenced from Jvm>Ir.Symbols stayed unbound, hence I have
to run ExternalDeopendenciesGenerator a second time after
creating JvmBackendContext :(
2019-12-04 16:05:53 +03:00
Georgy Bronnikov
08aeed3b46 IR: do not use lazyWrapper for Ir.Symbols
The reason for switching from lazyWrapper to SymbolTable itself is that
(at least in JS_IR) some of those lazily created structures could later
be deserialized, which created conflicts.
2019-12-04 16:05:53 +03:00
Vladimir Dolzhenko
b0b04eb4cd Use kotlin specific setting "Optimize imports on the fly" in quick fix
#KT-35266 Fixed
2019-12-04 11:19:19 +01:00
Denis Zharkov
be5b7adb5a FIR: Support captured types for sub-arguments 2019-12-04 10:52:19 +03:00
Denis Zharkov
5b4e8170ae Fix variables leaking when adding other system under transaction 2019-12-04 10:52:19 +03:00
Denis Zharkov
692442d7a2 Do not look into captured star projection as types 2019-12-04 10:52:19 +03:00
Denis Zharkov
3634d80cae FIR: Order type variables for fixation
Otherwise there are subtle issues with captured types
(see FirDiagnosticsSmokeTestGenerated$Inference.testDependantOnVariance)
2019-12-04 10:52:19 +03:00
Ivan Gavrilovic
7f77cc55f3 Update the test for cleanup
Make sure all sources are removed before adding a new Java source,
and make assertions about stubs and kotlinc generated .class files.
2019-12-03 23:05:22 +01:00
Ivan Gavrilovic
e07b2e30e2 KT-34258: Make sure to clean up stale files even if no Kotlin sources
If running incrementally, even if there aren't any Kotlin sources to
compile, there could be stale output files that need to be removed. E.g
stub generation must have generated .java files removed if all Kotlin
sources are removed. Kotlin compile task will be skipped only if there
are no Kotlin sources and task run is non-incremental.

Test: KaptIncrementalIT.testRemoveAllKotlinSources
2019-12-03 23:05:21 +01:00
Sergey Igushkin
a22a60118c Fix 'Project#afterEvaluate(Action) <...> cannot be executed' on IDE test run
Update kotlinx.benchmark to 0.2.0-dev-7 which contains the fix for
https://github.com/Kotlin/kotlinx-benchmark/issues/13
2019-12-03 23:57:29 +03:00
Ilya Gorbunov
edfd933348 Improve Result docs to emphasize that any Throwable exception is caught
#KT-33447 Fixed
2019-12-03 21:08:31 +03:00
Alexander Udalov
d84daa0a4b JVM IR: fix value argument offset in -Xjvm-default=compatibility mode 2019-12-03 18:39:43 +01:00
Pavel Kirpichenkov
3de6289c6c [NI] Run completion on subatoms of error calls
Call transformer previously ran completion of argument atoms
only for non-error candidates. This led to missing diagnostics,
i.e. from collection literal resolver.

Now arguments of calls resolved to error descriptor are completed,
with exception to not found provideDelegate calls.
provideDelegate's subatoms are not completed after failure, because
it is a part of delegate competion, which does not end with
unresolved provideDelegate.
Completing after provideDelegate failure removes constraint system
from resolved arguments, which breaks resolve for get/setValue.

^KT-33592 Fixed
2019-12-03 18:19:32 +03:00
Nikolay Krasko
29fbb8e22f Update to 193.5233.102 release (KT-35239)
- Mute android specific import tests (KT-35225).
- Mute GradleMultiplatformWizardTest (IDEA-225878).
- Minor update of test data.
2019-12-03 17:34:47 +03:00
Nikolay Krasko
fa64b5794b Allow to mute parameterized GradleImportingTestCase JUnit 4 tests 2019-12-03 17:34:46 +03:00
Roman Artemev
ca0bff75cd [KLIB] Keep order of constant properties depending on backend
- Fix K/N performance regression
2019-12-03 16:20:52 +03:00
Vyacheslav Gerasimov
6ef3831f14 Build: Take parent directory as rootProject directory in case of buildSrc 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
462d6ac5b6 Build: Add remote build cache parameters for teamcity builds 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
d3c1ef9251 Build: Use kotlin-build-gradle-plugin in buildSrc 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
ab8542bbdb Build: Advance kotlin-build-gradle-plugin version to 0.0.2 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
46d77419a8 Build: Add build cache properties to kotlin-build-gradle-plugin 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
ad79efeba3 Build: Use kotlin version embedded to gradle 2019-12-03 16:16:44 +03:00
Denis Zharkov
fa7bd3dd2e FIR: Support SAM constructors for type aliases 2019-12-03 15:49:22 +03:00
Denis Zharkov
ae01d050c9 FIR: Abstract parts for type alias constructors resolution
It's necessary to support combination of type aliases + SAM
2019-12-03 15:49:22 +03:00
Denis Zharkov
fbe7db5471 FIR: Move constructor processing parts to a separate file 2019-12-03 15:49:22 +03:00
Denis Zharkov
bf68e85a5c FIR: Support SAM conversion for interfaces containing Object methods 2019-12-03 15:49:22 +03:00
pyos
7cd55c85e6 JVM/JVM_IR: fix mapping of KClass in annotation classes
* JVM incorrectly mapped T<KClass<...>> to T<Class<...>> because the
   annotation-ness of the type mapping mode was inherited one level
   down into a generic signature independent of T

 * JVM_IR was even worse as it did not use VALUE_FOR_ANNOTATION at all,
   mapping T<T<KClass<...>> to T<T<Class<...>> as well.

The correct behavior is to map KClass to Class only at top level or as
an argument of Array.
2019-12-03 11:42:23 +01:00
Alexander Udalov
f869be6a71 JVM IR: do not mangle synthetic methods with inline class parameters
For example, synthetic `$annotations` methods for properties were
previously mangled to `$annotations-...`, which breaks annotation
loader, and fails an assert in ClassCodegen.generateMethod.
2019-12-03 11:34:55 +01:00
Roman Golyshev
66ffdf1b2d KT-33979 KT-34150 Remove filtering overridden object members and nested objects
- ^KT-33979 Fixed
- ^KT-34150 Fixed
- Also, in extension completion check descriptor instance first
2019-12-03 13:29:30 +03:00
Alexander Udalov
2552540f71 IR: wrap exceptions and add file path in per-file lowerings
Also add file path to the wrapped exception in JVM IR codegen
2019-12-03 11:06:54 +01:00
Alexander Udalov
fd627603a0 Refactor CompilationErrorHandler
It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
2019-12-03 10:48:34 +01:00
Dmitry Petrov
2435b8d9fa Update testData for enum constructor result type in IR 2019-12-03 11:54:41 +03:00
pyos
35c2573b33 PSI2IR: generate IrEnumConstructorCalls with correct return type
Normally, the fact that is was Unit was not visible as enum constructors
are lowered to normal class constructors anyway. The exception is when
the arguments are reordered, causing the incorrect return type to leak
into the block that holds temporary variables.
2019-12-03 11:54:41 +03:00
Denis Zharkov
145ad1a6fa FIR: Minor. Extract common parts in FirCallCompletionResultsWriterTransformer 2019-12-03 11:52:21 +03:00
Dmitriy Novozhilov
71bf8a14e8 [FIR] Make ConeTypeCheckerContext implements ConeInferenceContext 2019-12-03 11:36:34 +03:00
pyos
69033b7b15 JVM_IR: handle @JvmName on annotation getters 2019-12-03 10:53:49 +03:00
pyos
ac7d9fa90d JVM_IR: implement -Xpolymorphic-signature 2019-12-03 08:31:46 +01:00
Mikhail Glukhikh
fe6be0f436 Fix failed FIR multi-module test (forgotten test data update) 2019-12-03 10:25:53 +03:00
Igor Yakovlev
0ff77bd3c5 Add UL support for const fields initializers
Fixed #KT-34081
2019-12-02 20:41:47 +03:00
Victor Petukhov
775eb67219 NI: Add constraints which contain constraining type without projection
^KT-32243 Fixed
^KT-35172 Fixed
2019-12-02 19:42:18 +03:00
pyos
65cc0fa463 PSI2IR: have GeneratorExtensions implement StubGeneratorExtensions 2019-12-02 17:10:04 +01:00
pyos
a950df3c80 PSI2IR: copy isPropertyWithPlatformField to GeneratorExtensions 2019-12-02 17:10:04 +01:00
Ilya Chernikov
3cae90dd26 [minor] fix source root creation from imported scripts:
make the usages of KotlinSourceRoot consistent everywhere
2019-12-02 16:46:55 +01:00
Ilya Chernikov
f2a4a835e7 Improve script cli diagnostics 2019-12-02 16:46:55 +01:00
Ilya Chernikov
49de5e19fb Implement repl, script and expressions evaluation support in kotlin runner 2019-12-02 16:46:54 +01:00
Ilya Chernikov
531ff92791 Implement support for expression evaluation in jvm cli compiler 2019-12-02 16:46:54 +01:00
Ilya Chernikov
7bb9f97b11 Allow to separate top-level script declarations and statements with semicolon
This fix allows to write one-liner scripts like "val x = 3; println(x)", which
were previously rejected by the parser.
2019-12-02 16:46:54 +01:00
Ilya Chernikov
b8034567ef Change script definition lookup key from File to ScriptSource
to make it more generic and allow easier implementation fo the
non-file based scripts.
2019-12-02 16:46:54 +01:00
Ilya Chernikov
615624802c Add kotlinx-html test
Among other things it tests the packagePartProvider fix above
2019-12-02 16:46:53 +01:00
Ilya Chernikov
4439582d23 Remove unnecessary update of the source roots, simplify interface accordingly
The update became unnecessary after the packagePartProvider fix above.
2019-12-02 16:46:53 +01:00
Ilya Chernikov
02a71d2cda Save updated roots before a packagePartProvider is created
Since the function createPackagePartProvider uses initialRoots for
creating packagePartsProvider, if the updateClasspath function
was called before createPackagePartProvider, the provider was created
with incomplete list of roots, that leaded to the unresolved top-level
functions.
Now if no providers are created yet, the initialRoots is updated.
This still may lead to the inconsistencies, when/if we'll have several
providers.
2019-12-02 16:46:53 +01:00
Ilya Chernikov
a190ab260e Load main-kts jar automatically from scripting plugin, if available 2019-12-02 16:46:52 +01:00
Ilya Goncharov
22cb6fa836 [Gradle, JS] Fix case with null distribution 2019-12-02 17:44:26 +03:00
Ilya Goncharov
c267357596 [Gradle, JS] Add distribution DSL 2019-12-02 17:44:26 +03:00
Ilya Goncharov
fe9ddd9f22 [Gradle, JS] Check if resourcesDir exists and resourceDir is input directory 2019-12-02 17:44:26 +03:00
Ilya Goncharov
053469dcec [Gradle, JS] Copy index.html from resources to dist 2019-12-02 17:44:26 +03:00
Mikhael Bogdanov
b9dee4e93a Remove assertion on sorted ranges: it could be empty if lambda doesn't contain any linenumber
#KT-35101 Fixed
2019-12-02 12:08:36 +01:00
Ilya Goncharov
ae4a1e3cca [Gradle, JS] Fix check on Kotlin/JS modules from NPM in DCE
#KT-35198 fixed
2019-12-02 14:06:41 +03:00
Nikolay Krasko
0380380de4 More cleanups after tests execution 2019-12-02 13:29:37 +03:00
Nikolay Krasko
0cbb3a3956 Remove unused ProjectRootModificationTrackerFixer.kt 2019-12-02 13:29:37 +03:00
Nikolay Krasko
c12599a045 Fix test data for testParamTypeLambdaMismatch in >= 192 2019-12-02 13:29:36 +03:00
Ilya Goncharov
408f958273 [Gradle, JS] Add idle run for debug node tests
Source maps can be loaded by NodeJS
2019-12-02 13:23:03 +03:00
Andrey Uskov
38de98429d Fix importing tests in bunch 183 2019-12-02 13:17:21 +03:00
Andrey Uskov
9643d5d28e Added import-resolve integration tests 2019-12-02 13:17:17 +03:00
Alexander Udalov
e9946b21b5 JVM IR: do not hide constructor with inline class types and defaults
This corresponds to the ABI generated by the old backend. Moreover, when
compiling the module 'ir.tree' with JVM IR (could not reproduce on a
small sample), this led to a codegen crash when trying to reassign
parameter value to the default stub, which is an error expression and
can't be generated by ExpressionCodegen.
2019-12-02 10:19:55 +01:00
Mikhail Glukhikh
4e1cd6bcd5 Mute 2 black-box FIR test due to disallowed Kotlin synthetic properties problem
Yet FIR allows synthetic properties both in Kotlin & Java code.
It's unclear how to forbid them in Kotlin fast. Subject to discussion.
2019-12-02 11:33:22 +03:00
Kristoffer Andersen
18e8896c08 [JVM IR] Leave private @JvmDefault methods on interface
Like the old backend, always leave private @JvmDefault annotated
interface members (properties, methods) on the interface, just like
the old backend. Fix naming, and introduce test to document the naming
scheme.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
6f8682c950 [JVM IR] Stabilize accesor names in IR Backend
- introduce a scoped counter instead of a global one for name
  generation for accessors. Naive solution not working.

- Introduced hardcoded "jd" suffix for accessors on interfaces, under
  the assumption that the only such accessors are due to JvmDefault
  and their bridges from `$DefaultImpls`. Removed all associated
  templated tests, so the old and IR backend correspond on this matter
  again.

- Respecialized writeFlags from regexps to string-equality: we are
  going for exact matches now!

- Fixed package calculation in `IrUtils.kt`.

- Accessors for static members must be due to accessing super
  classes. Actual super-qualified calls are naturally also accessing
  super classes. Hence the `$s+{hashcode(superClassName)}`
  suffix. Added test to affirm this naming scheme.

- Field getters/setters for static fields must be companion accessors,
  otherwise just labelled as accessors. They are also tagged with `s`
  suffix when accessing static fields.

- For naming of accessors to coincide with the old backend, field
  renaming to avoid JVM signature clashes must be done _after_
  generation of accessors for those fields.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
d1c2862e27 IR: Align Interface Defaults with Old Backend
Change the treatment of default implementations on interfaces in JVM
compatibility mode. Previously, the IR backend moved the actual
default implementation to the DefaultImpls class, and then bridged to
it from the interface default. The old backend did the reverse, at the
cost of an additional accessor, in order to gain better binary
compatibility properties. See #2612 for discussion.

The accessor needs to call a specific implementation, so must be
performed through an `invokespecial`. We trick the
SyntheticAccessorLowering into doing this for us, by marking the
bridging call as a super call. We do this in want of an explicit
`invokespecial` Ir Node.

InterfaceDefaultCallsPhase previously assumed the old behaviour of the
IR backend (that calls to default implementations, e.g. `foo$default`
should target `DefaultImpls.foo$default`). But now the bridge to
foo$default resides on `DefaultImpls` already, causing that pass to
create a recursive loop. We cut that loop with a simple check.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
b5de625350 Minor refactor: lifting common code 2019-12-02 08:19:52 +01:00
Kristoffer Andersen
6a41700689 [JVM_IR] Fix interface method resolution
The JVM IR was too agressive in delegating statically to $DefaultImpls
class.

Consider the following library, compiled separately, and then client,
compiled against that library:

```
//library
interface A { @JvmDefault fun foo() = "A" }

interface Left : A { }
interface Right : A { @JvmDefault override fun foo() = "Right" }

//client
interface C : Left, Right {}

fun main() {
  val x = object : C {}
  println(x.foo())
}
```

Previously, the IR backend generates an overriding bridge in C, which
calls C$DefaultImpls which calls statically into Right$DefaultImpls.

When then library is recompilerd with an override of foo in Left, the
existing binary of the client continues to run against the recompiled
library erroneously running Right.foo().

The old backend throws an IncompatibleClassChange exception due to
ambiguity of multiple inherited default implementations. kotlinc indeed
rejects the client when recompiled against the new library.

We have no tests constraining this behaviour, but we could conceivably
strap something together in CustomBinaries tests.
2019-12-02 08:19:52 +01:00
Mikhael Bogdanov
df96841c9d Prohibit protected method calls from inline function
#KT-21178 Fixed
2019-12-02 08:04:26 +01:00
Mads Ager
8383274144 Add explicit irReturn when transforming expression body to block body. 2019-12-02 07:10:50 +01:00
Vladimir Dolzhenko
7fede87825 Performance tests DSL is added 2019-12-01 22:54:00 +01:00
Vladimir Dolzhenko
1b075340f8 Fixed dependencies for performance tests 2019-12-01 09:35:32 +01:00
Vladimir Dolzhenko
f8a6217fb5 Fix compilation for 183 after adding support incremental analysis of comment and kdoc
Relates to #KT-35189
2019-11-30 18:50:44 +01:00
Alexander Gorshenev
a923e0d130 Only allow version triples for klib metadata and ir versions 2019-11-30 18:37:38 +03:00
Alexander Gorshenev
b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Alexander Udalov
bf12f7eee0 JVM IR: do not lower trimIndent/trimMargin if API version is too high
We cannot be sure that we won't change behavior of these functions in
some corner cases, so only perform this optimization if the API version
specified by the user is not greater than the compiler's own stdlib
version it was compiled against. This is the same as the similar code in
the old backend in IntrinsicMethods.
2019-11-29 19:39:55 +01:00
Ilya Gorbunov
555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00
Burak Eregar
e30d87ee01 KT-20357: Add samples for indexOf 2019-11-29 21:34:49 +03:00
Vladimir Dolzhenko
a6f829f267 Add secondary ctors to incremental analysis
Relates to #KT-35121
2019-11-29 18:30:01 +01:00
Kerooker
c16b89d770 Fix XorWowRandom documentation
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.

This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:

    Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.

 Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5

 At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.

 Closes KT-35175
2019-11-29 19:31:55 +03:00
pyos
3e67ff097e JVM_IR: keep offsets of const val reads when inlining them 2019-11-29 16:49:52 +01:00
pyos
e4b1599457 JVM_IR: do not erase constant non-static field initializers...
...unless in 1.4 mode.
2019-11-29 16:49:52 +01:00
pyos
fc6b03b08f JVM_IR: move const initialization handling to lowering
Had to edit some bytecodeText tests to account for the fact that JVM_IR
no longer generates explicit initializations for ConstantValue fields,
but NoConstantValueAttributeForNonConstVals is not the default yet.
2019-11-29 16:49:52 +01:00
pyos
2ebe269448 IR: refactor InitializersLoweringBase and descendants 2019-11-29 16:49:51 +01:00
Mikhail Glukhikh
a6f8859a49 FIR Java: generate accessors only in override Kotlin case, make them non-synthetic 2019-11-29 18:11:27 +03:00
Mikhail Glukhikh
5275b4d0fc Move possibleGetterNamesByPropertyName to FirSyntheticPropertiesScope 2019-11-29 18:11:26 +03:00
Mikhail Glukhikh
d15dae6ac6 FIR: use SyntheticPropertySymbol & synthetic scope instead of FirAccessorSymbol
Before this commit, we used FirAccessorSymbol to emulate synthetic properties.
These symbols were generated in Java use-site scope.
Now, we use synthetic scope instead which is above MemberScopeTowerLevel.
This is more performance-friendly and does not require override matching.
However, accessor symbols should be used in situation when Java accessor
overrides Kotlin property which is broken in this commit
(that's why MapEntry test is corrupted here).
Also, we should not create synthetics for pure Kotlin accessors
(that's why javaAccessorConversion test is corrupted here).
2019-11-29 18:11:25 +03:00
Mikhail Glukhikh
ae62ccb76d [FIR TEST]: add test with synthetic on Java getter overridden in Kotlin 2019-11-29 18:11:24 +03:00
Mikhail Glukhikh
88e260269f FIR resolve: consider SYNTHETIC_RESOLVED as tower-stopper 2019-11-29 18:11:23 +03:00
Mikhail Glukhikh
8bcae80877 [FIR TEST]: add test with Map.Entry-based J/K hierarchy 2019-11-29 18:11:22 +03:00
Mikhail Glukhikh
8a601b5a0e FIR accessors: add protection against special names 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh
b48a4ace57 FIR accessor symbols: check all possible getter name variants 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh
ed6238db4b FIR accessor symbols: support 'is' prefix 2019-11-29 18:11:20 +03:00
Mikhail Glukhikh
eb90bd0e89 FIR: correctly process accessor symbols in derived classes 2019-11-29 18:11:19 +03:00
Mikhail Glukhikh
f1eb0dff1f FIR: disable synthetic scope, make accessor symbols synthetic
Before this commit, we had two methods to do generally the same synthetic thing.
It's an attempt to keep only one of them.
Accessor symbols are generated in Java use-site member scopes,
at this place we know better whether we are in Java class or not.
However, we have to do this at every use-site level, which is relatively slow.
Also we could encounter problems when accessor function is overridden in Kotlin,
and accessor symbol can still contain reference to Java accessor.
2019-11-29 18:09:07 +03:00
Simon Ogorodnik
2f9c94bd9e [FIR] Fix Definitely Not Null type substitution 2019-11-29 18:04:49 +03:00
Simon Ogorodnik
e5f60253f7 [FIR] Improve path usages in generator, provide default output 2019-11-29 18:04:48 +03:00
Simon Ogorodnik
5eb5d8e515 [FIR] Separate generated tree files from non-generated sources 2019-11-29 18:04:47 +03:00
Vladimir Dolzhenko
95129939d4 Add secondary ctors to incremental analysis
#KT-35121 Fixed
2019-11-29 15:45:09 +01:00
Vladimir Dolzhenko
f709377735 Support incremental analysis of comment and kdoc
#KT-35189 Fixed
2019-11-29 15:44:58 +01:00
Dmitry Borodin
664d69b752 Add flatMap sample KT-20357 2019-11-29 17:35:06 +03:00
Vladimir Dolzhenko
29b25e3901 Reworked resolve references in background thread in PlainTextPasteImportResolver
Relates to #KT-16774
2019-11-29 15:27:20 +01:00
Dmitry Gridin
37371edb8c Auto-import: add quickfix for overloaded generic function
#KT-34667 Fixed
2019-11-29 21:09:24 +07:00
Dmitry Gridin
4b98430058 Formatter: fix line break after package & file annotation
#KT-23957 Fixed
2019-11-29 21:09:04 +07:00
Dat Trieu
f334ad2ffc KT-20357: Add samples for associate* functions (#2798)
* KT-20357: Add samples for functions related to associate

* KT-20357: Use same fib function for both samples

* KT-20357: Use examples with duplicate keys and simplify examples with primitives

* KT-20357: Use primitive samples for all arrays

* KT-20357: Use String splitting example to better illustrate the use for associate over associateBy with a valueSelector
2019-11-29 16:54:02 +03:00
Mikhael Bogdanov
d2e5432b2d Minor. Update test data 2019-11-29 13:49:13 +01:00
Ilya Chernikov
b3c5362003 [NI] Fix diagnostic reporting for missing type parameter info
#KT-31975 fixed
2019-11-29 13:44:42 +01:00
Ilya Chernikov
7dd9ed7e38 [NI] Fix loosing type annotations on extension functions
#KT-32138 fixed
2019-11-29 13:44:41 +01:00
Mads Ager
467e6e3d97 JVM_IR: Fix field initialization in secondary enum constructors. 2019-11-29 13:40:18 +01:00
Mads Ager
8cd6dc0cd9 JVM_IR: Use IrInlineReferenceLocator for inline local var lowering. 2019-11-29 13:38:34 +01:00
Mads Ager
e2a1cb1077 JVM_IR: Generate fake inlining local variables for debugging. 2019-11-29 13:38:34 +01:00
pyos
fa8cb7b6e0 PSI2IR: support NewInference + SamConversionPerArgument
except for SAM conversions of varargs (which aren't implemented in the
non-IR JVM backend either btw)
2019-11-29 15:25:32 +03:00
Mikhael Bogdanov
cf6f823d29 Use descriptor from resolved call to inline accessors
In case of inline it should be same descriptor (except of fake override), In general case getter could be synthetic accessor and in such case it's not inline
2019-11-29 13:15:42 +01:00
Mikhael Bogdanov
320c5f6f00 Cast dispatch receiver to actual declaration owner though inline
Otherwise corrupted frame information is generated in bytecode

 #KT-29242 Fixed
2019-11-29 13:15:42 +01:00
Ilya Goncharov
25dea2ccce [Gradle, JS] Add description of separator of java inner classes 2019-11-29 15:09:36 +03:00
Ilya Goncharov
8d123d209a [Gradle, JS] Add description of hack on our side to avoid IDEA run only JVM tests by gutters 2019-11-29 15:09:36 +03:00
Ilya Goncharov
d02bcb30e3 [Gradle, JS] Move classNameOnlyRegExp to class level 2019-11-29 15:09:36 +03:00
Ilya Goncharov
38bd738724 [Gradle, JS] Add comments 2019-11-29 15:09:36 +03:00
Ilya Goncharov
418c0496f1 [Gradle, JS] Fix regex on method
- Find method declaration like not containing dot
2019-11-29 15:09:36 +03:00
Ilya Goncharov
3e1fe0af92 [Gradle, JS] Add exact filter by class name only 2019-11-29 15:09:36 +03:00
Ilya Goncharov
0037e74d3e [Gradle, JS] Fix StartsWith filter 2019-11-29 15:09:35 +03:00
Ilya Goncharov
de8610a279 [Gradle, JS] Add java class filters like in gradle 2019-11-29 15:09:35 +03:00
Ilya Goncharov
50d165167c [Gradle, JS] Update npm dependencies 2019-11-29 15:09:35 +03:00
Ilya Goncharov
1cc980e21b [Gradle, Idea] Create dummy tasks with type Test to WA platform problem
Platform set filters only for Test task
Create dummy Test task
Non JVM test task depends on Test task
After evaluate copy filters from Test task to non JVM test task
2019-11-29 15:09:35 +03:00
Ilya Goncharov
86e665e2b3 [Gradle, Idea] Add Gutter Configurator for non-jvm tests 2019-11-29 15:09:35 +03:00
Roman Golyshev
3112d70420 KT-35042 Fix InsertHandlerProvider.kt to work with suspend functional parameters
- ^KT-35042 Fixed
- Also, fix review suggestions for KOTLIN-CR-3495
2019-11-29 14:55:22 +03:00
Roman Golyshev
6f234beb9c KT-34414 Make sure completion for suspend functional parameters works too
- Replace `isFunctionType` with `isBuiltinFunctionalType` where it is relevant
- ^KT-34414 Fixed
2019-11-29 14:55:21 +03:00
Igor Yakovlev
541ca31584 Fix for exception on HelpAction in KotlinInlineValDialog 2019-11-29 14:42:34 +03:00
Igor Yakovlev
a672427e72 Add invokeLater for inlining extra refactoring in branchedTransformations intension
Fixed #EA214432
2019-11-29 14:42:26 +03:00
Dmitry Petrov
a2188610b1 Promote KotlinABI version 2019-11-29 13:53:05 +03:00
Dmitry Petrov
55e9e8afbf IR ser/deser: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
0681c0d956 IR BE Common: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
4591dfdf47 JVM_IR: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
31b63c0fc8 JS_IR: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
cb1b9c2ccf IR testData: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
e4303b0173 FIR2IR: IrSimpleFunction.isOperator 2019-11-29 13:53:04 +03:00
Dmitry Petrov
d6db6becb9 IR: IrSimpleFunction.isOperator 2019-11-29 13:53:04 +03:00
Nikolay Krasko
ec03c3b85d Minor: remove url to avoid difference in test data in 183 and 191 2019-11-29 12:56:50 +03:00
Nikolay Krasko
9c0c9ea849 Use Kotlin wrapper for LightIdeaTestCase 2019-11-29 12:56:50 +03:00
Nikolay Krasko
32f4ab96c4 Use Kotlin wrapper for LightCodeInsightTestCase tests
This will help in resolving compatibility issues and will allow to add
common functionality to all tests.
2019-11-29 12:56:49 +03:00
Nikolay Krasko
6f3e7acfa2 Remove adhock flaky highlighting performance tests
We now have dedicated tests for it.
2019-11-29 12:35:44 +03:00
Dmitry Gridin
2fabf86f29 Formatter: cleanup code 2019-11-29 16:28:59 +07:00
Dmitry Gridin
70185ba2a6 Formatter, NJ2K: fix indent for comments inside function literals
#KT-4194 Fixed
#KT-31881 Fixed
#KT-34673 Fixed
#KT-35152 Fixed
2019-11-29 16:28:59 +07:00
Nicolay Mitropolsky
bfa6bd1396 Uast: buildLightMethodFake provides proper containing class and parent 2019-11-29 12:28:02 +03:00
Kirill Shmakov
79bfada65b Read xcodeproj file location from gradle.properties 2019-11-29 12:22:43 +03:00
Toshiaki Kameyama
f7ff397a31 Move statement: enable single lambda expression function
#KT-10478 Fixed
2019-11-29 11:33:27 +03:00
Ilmir Usmanov
51a9df2902 JVM_IR: Support suspend lambdas with receivers and multiple parameters
In old BE we generate `create` for this kind of suspend lambdas, which,
like in simple suspend lambdas is responsible for putting arguments
(including extension receiver) to fields.
But, if number of parameters of suspend lambda (including receiver) >= 1,
there is no need to generate `create`, since `create` is called only by
`createCoroutine` and friends from stdlib, and there is no version of
`createCoroutine` for lambdas with multiple parameters.
Thus, in old BE we generate a redundant method, which affects method
count.
In JVM_BE we decided to 'inline' create into `invoke` for suspend lambdas
with multiple parameters.
2019-11-28 21:19:27 +03:00
pyos
98660cdf2d JVM_IR: serialize anonymous functions' descriptors 2019-11-28 18:17:01 +01:00
victor.petukhov
e246c23a46 Fix prematurely analyzing a lambda while fixing a type variable for another argument
^KT-35168 Fixed
2019-11-28 19:03:30 +03:00
Dmitriy Novozhilov
c4a115720e [FIR-TEST] Update testdata
It was forgotten in 61c17d91
2019-11-28 18:01:14 +03:00
pyos
2f4f09e3a2 JVM_IR: remove some redundant calls to deepCopyWithSymbols 2019-11-28 15:42:06 +01:00
Simon Ogorodnik
dbf0742c00 [FIR] Fix self-type for enum 2019-11-28 17:23:05 +03:00
Vyacheslav Gerasimov
26113b1e0f Create target directories while copying compiler.xml for tests 2019-11-28 16:02:41 +03:00
Mikhail Glukhikh
6401596d58 FIR resolve: support processing extensions before members (forEach case) 2019-11-28 15:36:58 +03:00
Dmitriy Novozhilov
61c17d9110 [FIR-TEST] Add test with missing smartcast 2019-11-28 15:28:21 +03:00
Dmitriy Novozhilov
dcd1c2647e [FIR-TEST] Add test with problem with default java importing scope 2019-11-28 15:28:21 +03:00
Dmitriy Novozhilov
bb89fee431 [FIR-TEST] Add test with ambiguity in static java scopes 2019-11-28 15:28:20 +03:00
Roman Artemev
4759c16428 [JS IR] Fix IrGetClass for Throwable successors
- add test
2019-11-28 14:45:34 +03:00
Roman Artemev
757ddd9179 [JS IR] Fix standard collections
- remove PlatformDependent annotated methods
2019-11-28 14:45:34 +03:00
Yan Zhulanow
606cad1059 Pill: Add fir/lightTree module 2019-11-28 20:02:41 +09:00
Yan Zhulanow
60a77acd7a Pill: Fix compiler tests (support both JPS build and Pill in JUnit 3 runner) 2019-11-28 20:02:40 +09:00
Mikhail Glukhikh
f58af2e4c3 FIR2IR: fix constructor referencing in return statement 2019-11-28 13:50:10 +03:00
Sergey Bogolepov
96e6602da2 [kotlinx-metadata-jvm] Fix typo 2019-11-28 17:32:03 +07:00
Mikhail Glukhikh
29e882eae7 FIR resolve: add minor comments about substitutions around JvmMappedScope 2019-11-28 13:18:11 +03:00
Mikhail Glukhikh
e43a1ee1c5 FIR JvmMappedScope: substitute type parameters in Java scope with Kotlin ones
Without it, override mapping does not work properly.
NB: at this moment Java forEach often supersedes Kotlin forEach,
because call isn't reported as erroneous properly.
2019-11-28 13:18:11 +03:00
Mikhail Glukhikh
2c611d75bc [FIR TEST]: two more tests on forEach potential ambiguity (both passing) 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
4f1167b16f Move buildDefaultUseSiteMemberScope to FirSymbolProvider 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
71b95bd91d FIR resolve: make substitution also for mapped Java type parameters 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
b3056b8bf5 FIR resolve: implement JVM K/J type mapping
Declared member scopes are now wrapped in JvmMappedScope
2019-11-28 13:18:10 +03:00
Toshiaki Kameyama
3a576ce14f KT-21811 Convert string concatenation into multiline string (#2772)
New J2K: Convert string concatenation into multiline string

#KT-21811 Fixed
2019-11-28 13:14:48 +03:00
Nikolay Krasko
c14affd6cd Minor: forgotten change after review 2019-11-28 12:02:00 +03:00
Nikolay Krasko
35fec9e9db Fix withJava test after resorting annotation targets
Was broken after eb71e68.
2019-11-28 12:02:00 +03:00
Nicolay Mitropolsky
c06f737519 Uast: SimpleKotlinRenderLogTest.testBitwise UMethod testdata fix 2019-11-28 11:41:00 +03:00
Toshiaki Kameyama
bfa6c7d399 Move statement: don't move declarations above package and import directives 2019-11-28 11:20:09 +03:00
Mikhael Bogdanov
742c3a228a JVM_IR. Proper lower toArray functions 2019-11-28 08:31:15 +01:00
Natalia Selezneva
6a18ef1417 Minor: compare system independent paths 2019-11-28 09:40:04 +03:00
Sergey Bogolepov
a08cf59017 [kotlinx-metadata] Add extensions for KmValueParameter
There is no extension on jvm, but klibs have parameter annotations.
2019-11-28 10:40:21 +07:00
Sergey Bogolepov
18bb615dd9 [kotlinx-metadata-klib] Fix library reading
* To be able to deserialize metadata we need to include ":core:deserialization".
* Use per-fragment string tables.
* Read file names from strings instead of file names list.
2019-11-28 10:40:20 +07:00
Nikolay Krasko
c341a3e709 Avoid collecting events from other projects in PerModulePackageCacheService (KT-33802)
It looks like VFS_CHANGES subscription ignores project boundaries so all events are processed by every listener. If event has a hard reference to project in the requestor field, it might leak through the collection of pending events.

An attempt to fix holding test projects through pending events.

 #KT-33802 Fixed
2019-11-27 22:34:48 +03:00
Nikolay Krasko
7245bbd822 Explicitly disconnect in KotlinPackageContentModificationListener (KT-33802) 2019-11-27 22:34:48 +03:00
Vyacheslav Gerasimov
0cde2e2f5b Build: Fix ivy repository for android sdk
There is no `artifact()` in metadataSources by default in gradle 6.0
2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
8d31d4a60f Replace com.moowork.node plugin with com.github.node-gradle.node 2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
81e24fbdb4 Build: Extract version of com.moowork.node to the settings.gradle 2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
ea9b490467 Fix usage of nullable in gradle 6.0 DomainObjectContext.project 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
b9031f0c68 Fix overrides of removed in gradle 6.0 AbstractCompile.compile
5e7476de95
2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
7de023135e Build: Remove outdated fix broken in gradle 6.0
Can't remove from dependsOn anymore
2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
aa05bcc16b Build: Fix usages of this project unavailable in gradle 6.0 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
01929cb234 Build: Upgrade build scan plugin for gradle 6.0 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
d74e53e6bb Build: Properly annotate input properties of IntelliJInstrumentCodeTask 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
9d162ec1f3 Build: Upgrade gradle to 6.0.1 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
5f158f5ce7 Build: Add kotlin-build-gradle-plugin & use it prebuilt from bintray
With extracted buildProperties.kt from buildSrc required for settings.gradle, using buildSrc classes is not allowed there since gradle 6.0
2019-11-27 21:26:32 +03:00
Georgy Bronnikov
1ed23d7c54 IR: reorganize IrProvider handling
Make DeclarationStubGenerator a subclass of IrProvider,
anticipating deserialization of IR structures for JVM_IR backend.
2019-11-27 20:02:27 +03:00
Toshiaki Kameyama
be04912f6f KT-19574 Code with inferred default parameters and parameter vs property name clashes (#2671)
New J2K: add 'this' receiver to default parameter value if needed

#KT-19574 Fixed
2019-11-27 18:55:50 +03:00
Anton Yalyshev
1bbd17c4d6 Turn off FUS data sending in 1.3.61+ as we as we sent enough in 1.3.60 2019-11-27 18:42:42 +03:00
Dmitriy Novozhilov
e38fdae1bc Regenerate DiagnosticsTestWithJsStdLibGenerated 2019-11-27 18:03:05 +03:00
Dmitriy Novozhilov
5190ff9733 [FIR-TEST] Add test with SAM conversion in constructor call 2019-11-27 18:01:20 +03:00
Dmitriy Novozhilov
71acd42727 [FIR-TEST] Add test with ambiguity produced by definitely not null types 2019-11-27 18:01:20 +03:00
Sergey Igushkin
fa2ef816b1 Support Gradle instant execution with Kotlin/JVM and Android tasks
Issue #KT-35126 Fixed
2019-11-27 17:59:45 +03:00
Simon Ogorodnik
d59a171b65 [FIR] Fix isMyTypeVariable in ConeInferenceContext 2019-11-27 17:15:07 +03:00
Anton Yalyshev
ffa0896592 Minor correction of attributes naming 2019-11-27 16:59:27 +03:00
Anton Yalyshev
c57c9b2e63 Prepare data for successful FUS Whitelist parsing 2019-11-27 16:59:27 +03:00
Toshiaki Kameyama
c72622c6d7 KT-32551 New J2K: Non-canonical modifiers order inspection is not applied during convertion of inner super class (#2806)
New J2K: add SortModifiers inspection to post-processing

#KT-32551 Fixed
2019-11-27 16:08:54 +03:00
victor.petukhov
dbacae94d0 Fix common super type calculation for captured dynamic types
^KT-32499 Fixed
2019-11-27 15:48:00 +03:00
Vladimir Dolzhenko
1c4c5520a2 Fix incremental analysis in case of property does not have initializer but could be initialized on a class level
#KT-35028 Fixed
2019-11-27 13:43:30 +01:00
Vladimir Dolzhenko
c67222c176 Add ERRORs check to AbstractOutOfBlockModificationTest 2019-11-27 13:43:10 +01:00
Vladimir Dolzhenko
144f721a44 Kotlinify AbstractOutOfBlockModificationTest, p2 2019-11-27 13:42:49 +01:00
Vladimir Dolzhenko
8f8ed4dbcf Kotlinify AbstractOutOfBlockModificationTest, p1 2019-11-27 13:42:32 +01:00
Dmitriy Novozhilov
567248ebd7 [FIR] Add default upper bounds to type parameter of synthetic when and try calls 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
5770d19d61 [FIR] Fix calculating of completion mode 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
9c3117ba40 [FIR] Git rid of creating new when and try fir nodes
It's necessary because of before change we safe original `when`
  without infered type as return statement of lambda and after that
  we add incorrect constraint system from it to outer call
2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
8085ec8b0b [FIR-TEST] Add test with ambiguity between java field and java accessor 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
3c661dd142 [FIR-TEST] Add test with unresolved invoke of lambda with receiver 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
96d3a06129 [FIR-TEST] Add test with hiding local functions 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
5d14c76f70 [FIR-TEST] Add test with unresolved Array<T>.clone() 2019-11-27 15:00:02 +03:00
Dmitriy Novozhilov
4059fae1b7 [FIR-TEST] Add test with type mismatch on receiver with captured type 2019-11-27 15:00:02 +03:00
Dmitriy Novozhilov
572256e2eb [FIR-TEST] Add test with not-working bound smartcast 2019-11-27 15:00:02 +03:00
Mark Punzalan
1a2e09e6a5 ForLoopsLowering: Handle Iterable.withIndex() where the type is a
bounded type parameter.

TODO: Handle Sequences by extending DefaultIterableHandler.
2019-11-27 10:59:34 +01:00
Kevin Bierhoff
e8252ea874 handle kotlin shifts like bitwise binary ops 2019-11-27 12:42:31 +03:00
Nikolay Krasko
a9baec4727 Add headless mode for tests to avoid graphic card switch 2019-11-27 12:26:54 +03:00
Nikolay Krasko
54338686d4 Add test for lambda parameter type 2019-11-27 12:26:54 +03:00
Nikolay Krasko
eb71e686da Stable order of generated annotation targets
A random order of usages is enabled in 193 platform that makes tests flaky without the commit.
2019-11-27 12:26:54 +03:00
Nikolay Krasko
592df477e9 Mute MultiModuleHighlightingTest tests 2019-11-27 12:26:54 +03:00
Denis Zharkov
00a70c51f0 FIR: Generate fake overrides always if there are type parameters
See the comment
2019-11-27 11:20:52 +03:00
Denis Zharkov
8efd59403d FIR: Avoid redundant substitution when type parameters don't change 2019-11-27 11:20:52 +03:00
Denis Zharkov
07a4352809 FIR: Add hack for Fir2IrVisitor
See the comment
2019-11-27 11:20:52 +03:00
Denis Zharkov
3b7ad066fc FIR: Substitute type alias constructors properly 2019-11-27 11:20:52 +03:00
Denis Zharkov
f68929fe74 FIR: Leave functions type parameters in subsituting scope 2019-11-27 11:20:52 +03:00
Denis Zharkov
b5ef063b0f FIR: Cache functions in use-site member scope 2019-11-27 11:20:52 +03:00
Denis Zharkov
f659dc0bea FIR: Add synthetic values/valueOf methods to Java classes 2019-11-27 11:20:52 +03:00
Denis Zharkov
256f5ca0a1 FIR: Support inherited default parameters 2019-11-27 11:20:52 +03:00
Natalia Selezneva
c9cb4dff52 Scripting: introduce ide-specific comparision of script compilation configurations (KT-34626)
Do not take into account fields that doesn't affect IDE
Also it will threat configurations from old and new scripting API as similar
FIt will make sense for script dependencies loaded using Gradle TAPI (new Scripting API) and Old Scripting API
^KT-34626
2019-11-27 11:08:45 +03:00
Natalia Selezneva
07b6dadbf0 Scripting: move additional classpath to the end of script classpath (KT-34626)
Do not add duplicated entries
Original script dependencies should go first
2019-11-27 11:08:44 +03:00
Natalia Selezneva
72e99b5863 Scripting: avoid just in case configuration requests to Gradle (KT-34442)
Listen to changes in files that may affect gradle configuration
Remove configuration request if none of such file was changed since last request
^KT-34442 Fixed
2019-11-27 11:08:44 +03:00
Natalia Selezneva
f27e13035a Minor: introduce helper method to check registry option 2019-11-27 11:08:44 +03:00
Natalia Selezneva
7ade2ec576 Scripting: configurations from gradle import should be always taken into account (KT-34442)
Do not rely on registry option
^KT-34442
2019-11-27 11:08:44 +03:00
Natalia Selezneva
2f1915d85e Scripting: check that kotlin dsl models are provided during import as soon as possible 2019-11-27 11:08:44 +03:00
Dmitry Gridin
249789d6eb Formatter: add test for enum entry with comment
Relates to #KT-15980
2019-11-27 15:01:44 +07:00
Roman Artemev
97c8b2074e [JS] Set correct EXPECTED_REACHABLE_NODES 2019-11-27 00:06:42 +03:00
Igor Yakovlev
12f29bacab Exclude checking for unimplemented method for binary origin classes
Fixed #KT-34971
2019-11-26 21:13:10 +03:00
Mads Ager
8d5e5210a6 JVM_IR: Copy annotations to suspend function views. 2019-11-26 21:00:50 +03:00
Nicolay Mitropolsky
3d1061ee3c Uast: KotlinUMethodWithFakeLightDelegate 183-related fixes 2019-11-26 19:42:30 +03:00
Nicolay Mitropolsky
c5fb51bd85 191: Uast: KotlinUMethod compilation fix 2019-11-26 19:42:29 +03:00
Leonid Startsev
19c28c55c5 Allow serialization plugin to work with inline types which are primitives (e.g. Char in JS IR) 2019-11-26 19:34:49 +03:00
Leonid Startsev
ed786c4daf Enable compiler plugins in JS IR backend (and WASM too, since they use same loadIr function) 2019-11-26 19:34:48 +03:00
Jiaxiang Chen
0441e484a6 PSI2IR: For implicit function return, use expression's end offset as start offset of the IrReturn to generarate correct line number. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
e49431a12c Debug information test: make stepping information more readable. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
331b085b2f JVM_IR: Fix line number for catch clause. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
3ea878b1c6 JVM_IR: Fix line number for varible initializer 2019-11-26 17:59:28 +03:00
Natalia Selezneva
8bb9c572ac Move inProgress lock at the onFinish of background task (KT-34688)
Setting inProgress to false inside run method can lead to multiple notifications because of delay between run method end and progress hide
^KT-34688 Fixed
2019-11-26 16:35:59 +03:00
Ilya Goncharov
ad09492eb0 [Gradle, JS] Migrate on only name-version npm dependencies
#KT-32179 fixed
2019-11-26 16:05:17 +03:00
Ilya Goncharov
95b56e10b4 [Gradle, JS] Activate root npm dependency declaration for multiplatform 2019-11-26 16:04:37 +03:00
Ilya Goncharov
5397023f71 [Gradle, JS] Add Groovy Closure support 2019-11-26 16:04:37 +03:00
Ilya Goncharov
028c73d959 [Gradle, JS] Add compatible operators for npm dependencies 2019-11-26 16:04:37 +03:00
Ilya Goncharov
26cd392a9a [Gradle, JS] First steps for npm dependencies in root 2019-11-26 16:04:37 +03:00
Ilya Goncharov
f73fc5199b [Gradle, JS] Mute testWeb false positive test 2019-11-26 16:03:26 +03:00
Ilya Goncharov
be5b8c1bdb [Gradle, JS] Mute false positive test for MPP JS-JVM 2019-11-26 16:03:26 +03:00
Dmitry Gridin
b40a888f1d Formatter: fix line break between declarations with annotations
#KT-35093 Fixed
#KT-35106 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
bfd539d5d1 Formatter: fix line break between declarations with comment
#KT-12490 Fixed
#KT-35088 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
b6b755506c Formatter: support Chop down if long for Chained method calls
#KT-23929 Fixed
#KT-33553 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
351fef5628 DoubleBangToIfIntention: fix invalid psi tree 2019-11-26 19:40:50 +07:00
Svyatoslav Kuzmich
f48ad25626 Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI

(cherry picked from commit bffbe89f53)
2019-11-26 15:39:28 +03:00
Nikolay Krasko
8185c452fe Ignore jarRepositories.xml 2019-11-26 15:39:28 +03:00
Nikolay Krasko
13b0054e0a Fix compilation for service messages tests in 193 branch 2019-11-26 15:39:28 +03:00
Nikolay Krasko
89f26cc89d Minor: Make diff function for AbstractKotlinFoldingTest
~true~ and ~false~ cases left unresolved
2019-11-26 15:39:27 +03:00
Nikolay Krasko
5d6333f0f4 193: Better services registration for parser tests 2019-11-26 15:39:27 +03:00
Leonid Startsev
3d2800f99b Move out symbols that do not depend on a BackendContext to a separate BuiltinSymbolsBase class.
The goal was to be able to use such symbols before BackendContext is even created – in psi2ir postprocessing step (i.e., IR compiler plugins).

Remove old code from serialization ir plugin.
2019-11-26 15:26:35 +03:00
Leonid Startsev
3e18350a1f Rewrite IR plugin infrastructure (and serialization plugin) so it won't emit LazyIR.
LazyIR was emitted because plugin was not able to declare symbols, only to reference them.
Moreover, declarations added by frontend plugin were also unbound symbols produced by psi2ir,
and declaration stub generator was stubbing them with LazyIR – therefore access to global symbol table is not enough for plugins. IrProvider won't help here, because some functions produced by plugin have circular dependencies.

By moving compiler plugins step between psi2ir and declaration stub generator, both problems are resolved
– unbound symbols produced by psi2ir and compiler plugins are declared where they would be declared if this was a user code,
and only unbound symbols left are external dependencies, which is a correct input for lazy ir.
2019-11-26 15:26:28 +03:00
Nicolay Mitropolsky
e4d0d450ab Uast: keeping annotations from sources in non-light-methods backed UMethods (KT-27806) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
833571d8b2 Uast: tests for suspend and DeprecationLevel.HIDDEN functions appears in Uast tree (KT-27806, KT-32031) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
2772659ed2 Uast: Uast produces reified methods on his own because light-classes doesn't (KT-34316) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
9c18df61ca Uast: KotlinUMethod and KotlinUAnnotationMethod are separated (KT-30489) 2019-11-26 15:13:40 +03:00
Anton Bannykh
9fec2c78d1 JS IR: apply forLoopsLowering
Replaced createTemporaryVariable usages with createTmpVariables.
The latter doesn't rely on KotlinType's. Using KotlinType with
JS_IR backend causes runtime excpetions, as some expected descriptor
API is not implemented, because it avoids descriptors as much as
possible.
2019-11-26 15:08:10 +03:00
Jiaxiang Chen
0ea407fef9 debug information test: handle vm resume correctly. 2019-11-26 14:52:58 +03:00
Toshiaki Kameyama
251899c31a Fix bad indentation when copy-paste to trimIndent()
#KT-33888 Fixed
2019-11-26 18:00:38 +07:00
Mikhail Glukhikh
178dbd3c5d Remove hacky re-initialization of PsiSubstitutor.KEY (branch 193)
After IDEA commit
8b0af11724 (diff-9b39aafa0a7b8d4f089100f3968931d0)
this re-initialization is no more necessary. Moreover, it's harmful,
because this KEY is used as a map key in IDEA code,
and we cannot find information stored by this key.
This was a hidden reason of FIR / IR test failures in branch 193.

After this commit, FIR / IR tests in branch 193 should be fixed
2019-11-26 13:13:48 +03:00
Anton Bannykh
81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Roman Golyshev
faf4c05fc8 KT-34644 Give return keyword more priority in completion where appropriate
- See `returnExpressionItems::returnIsProbableInPosition` to get an idea where return is supposed to be more appropriate
  - End of the block (except for top level block of unit function or cycle) or as single expression in if or when
  - Right side of the elvis operator (which is not already in return)
- Add additional `probable_keyword` weigher to signalize about probable keyword (for now it is only for `return`)
- ^KT-34644 Fixed
2019-11-26 11:56:32 +03:00
Roman Golyshev
de11b4cb64 KT-34644 Refactor CompletionUtils::returnExpressionItems
- Collecting `return` lookups to `blockBodyReturns` will later allow to modify them to increase priority in the completion
2019-11-26 11:56:19 +03:00
Pavel Kirpichenkov
cf82efb49f [NI] Add missing diagnostic on callable references in fake calls
Unresolved reference diagnositc was not reported on callable references
returned from if or when expression because of additional block wrapper.

^KT-30953 Fixed
2019-11-26 11:02:25 +03:00
Mikhail Zarechenskiy
eb73650209 Fix race in IDE: inject proper storage manager for type parameters
With NO_LOCKS strategy we can easily end up in a situation when
 constraint system for a generic call is built incorrectly,
 producing flaky errors (or don't produce errors at all)

 Now proper storage manager is injected for all cases except:
 - IR
 - Codegen
 - Serialization plugin
 - Fake local objects

 Most likely, NO_LOCKS strategy for these cases is fine as at that point
 the compiler works in one thread

 #KT-34786 Fixed
2019-11-26 10:52:45 +03:00
Mads Ager
399667a434 JVM_IR: Implement data class array member intrinsics. 2019-11-25 19:00:31 +01:00
Svyatoslav Kuzmich
ea8ade0852 [JS] Refactor and comment for typeOf fix 2019-11-25 20:25:03 +03:00
Svyatoslav Kuzmich
dc336c3c8a [JS] Add marker function getReifiedTypeParameterKType to runtime
So compiler bugs would produce a nicer error message instead of:
"TypeError: getReifiedTypeParameterKType is not a function"
2019-11-25 20:25:03 +03:00
Svyatoslav Kuzmich
600fb723f4 [JS] Fix typeOf for some reified type parameters
Fix getting kType metadata in cases when corresponding jsClass value
is passed through temporary variable.
This can happen when jsClass expression is not consided trivial by
local variable optimizer. This happens for object declarations from
different modules, for example kotlin.Unit
2019-11-25 20:25:02 +03:00
Roman Artemev
c4d993d14c [KLIB] Fix top level property index. Include const properties as well. 2019-11-25 20:22:04 +03:00
Roman Artemev
1e4f8b2946 [JS IR] Do not forbid typeOf inlining if it is not required 2019-11-25 20:22:03 +03:00
Roman Artemev
2e22ddba39 [JS IR] Fix annotation constructor body generation 2019-11-25 20:22:03 +03:00
Roman Artemev
c5e25a0382 [JS IR] Make PrivateMembersLowering global to handle inlined private references correctly
- Fixes [KT-33334]
2019-11-25 20:22:03 +03:00
Roman Artemev
9946feb66c [JS IR] Fix name clash between class members defined on prototype
- Fixes [KT-33327]
2019-11-25 20:22:03 +03:00
Roman Artemev
987c6ab3ee [JS IR] Roll making Char inline class back
- un/mute falling tests
2019-11-25 20:22:03 +03:00
Leonid Startsev
b9ac1341ff Export generic serializer constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/609
2019-11-25 20:06:15 +03:00
Leonid Startsev
73b9d2466a Do not report 'Missing @Serializable on enum with @SerialInfo' if enum
has custom serializer

#KT-34991 Fixed
2019-11-25 20:06:14 +03:00
Mads Ager
98ceee784a JVM_IR: More special bridge rewriting.
If there is an existing method that will have its argument types
remapped to boxed types, make sure to reflect that in the IR so
that code will be generated for a boxed value instead of a
primitive value.
2019-11-25 17:37:57 +03:00
Ilya Kirillov
f368d9761a Fix for loop conversion when multiple initializers are present
#KT-35074 fixed
2019-11-25 17:01:46 +03:00
Ilya Chernikov
b73625ad9e Switch main-kts to the updated resolvers infrastructure 2019-11-25 14:46:32 +01:00
Ilya Chernikov
baec10fb40 Update apache ivy version to 2.5.0
#KT-34893 fixed
2019-11-25 14:46:32 +01:00
Ilya Chernikov
4234c5ec31 Fix ivy resolver: deps config and maven repos:
Transitive dependencies weren't fetched properly in some cases, because of the two problems:
- missing dependency configuration for the root dependency
- using URLResolver for the maven-based (IBiblio) resolvers

Also adding resolver name for easier debugging.
2019-11-25 14:46:32 +01:00
Dmitriy Novozhilov
5e5038416e Revert "tmp"
This reverts commit 3e336913
2019-11-25 16:20:06 +03:00
Dmitriy Novozhilov
3e336913b6 tmp 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
4fc554fa9a [FIR-TEST] Add test with unresolved SAM usage of Comparator 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
98af866417 [FIR] Fix stopping in AbstractFirUseSiteMemberScope 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
52caa6a58d [FIR] Don't recreate type resolver in FirSpecificTypeResolverTransformer 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov
841ba6ea11 [FIR] Add generating of rawBuilder tests for light tree 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov
43e621530f [FIR] Add type parameters to FirQualifierExpression
It is needed for resolving qualifiers with type arguments
  like `Array<String>::class`
2019-11-25 14:44:44 +03:00
Victor Turansky
9330547f87 Gradle 6.0.1 support. Fix Yarn loading progress logging
Details - https://github.com/michel-kraemer/gradle-download-task/issues/143

Otherwise - no loading progress log
2019-11-25 13:00:46 +03:00
Pavel Kirpichenkov
4622041706 Update box test for unsigned to signed conversions
Updated test checks, that large unsigned numbers are converted to corresponding
negative signed numbers properly. Using unsinged constants instead of signed
in test allows to remove supressed OI error as well as use test with NI.
2019-11-25 12:22:58 +03:00
Yan Zhulanow
076166c22f Debugger: Generate line numbers for class initializers with a number on the 'init' keyword (KT-16277)
Debugger tests not absent as they use the bootstrap version of kotlinc.
Obviously, this change is not present in it yet.
2019-11-25 17:26:31 +09:00
Yan Zhulanow
bebc8974b2 Report 5308947: check module validity before asking for library versions 2019-11-25 17:26:30 +09:00
Yan Zhulanow
cf620cc60d Debugger: Synchronize "Add field breakpoint" dialog with the platform code 2019-11-25 17:26:30 +09:00
Yan Zhulanow
75b366fc5e EA-211653: Wrap field breakpoint dialog into a transaction guard 2019-11-25 17:26:30 +09:00
Yan Zhulanow
ffeef6c18d EA-210460: Use 'safeAllLineLocations()' instead of throwing 'allLineLocations()' 2019-11-25 17:26:30 +09:00
Yan Zhulanow
aaa45425da EA-210002: handle interruption in case of background inline callable searcher task 2019-11-25 17:26:30 +09:00
Yan Zhulanow
36073ef61e EA-209923: Add missing read action 2019-11-25 17:26:30 +09:00
Yan Zhulanow
69d5115b89 EA-214241: Remove worthless error reporting 2019-11-25 17:26:29 +09:00
Yan Zhulanow
16c4b0e458 EA-210823: Fix AIE in breakpoint applicability test 2019-11-25 17:26:29 +09:00
Yan Zhulanow
ab06f772fc EA-209419: Fix read action requirement in Light constant evaluator 2019-11-25 17:26:29 +09:00
Yan Zhulanow
2983c87212 EA-215308: Fix unsafe check casts in template entry handling 2019-11-25 17:26:29 +09:00
Yan Zhulanow
3534d4af36 EA-215324: Fix "Module already disposed" in Scratch combo-box 2019-11-25 17:26:29 +09:00
Yan Zhulanow
3d17af0ada EA-215375: Check range, not rangeMarker with nullable 'range' inside 2019-11-25 17:26:29 +09:00
Yan Zhulanow
89bd3b8767 EA-215872: Check text range validity before 'getText(range)' 2019-11-25 17:26:28 +09:00
Yan Zhulanow
49bcb103ef EA-216005: Do not request KotlinFacetSettingsProvider for dead projects 2019-11-25 17:26:28 +09:00
Yan Zhulanow
f91a84872a EA-216299: fix SIOOBE in completion 2019-11-25 17:26:28 +09:00
Yan Zhulanow
f75288b480 EA-216333: check PsiElement validity before light class generation 2019-11-25 17:26:28 +09:00
Yan Zhulanow
59296d6a6b EA-217068: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
e12f17d5dc EA-217069: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
54203100bc EA-217072: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
6a4b658ad4 EA-217153: Add line count check 2019-11-25 17:26:27 +09:00
Yan Zhulanow
ab0f841642 Debugger: Provide fixed implementation of 'toString()' for lambdas (KT-32691) 2019-11-25 17:26:27 +09:00
Yan Zhulanow
82a1750d26 Debugger: Forbid 'Nothing' constructor calls in evaluated code (KT-33093) 2019-11-25 17:26:27 +09:00
Pavel Kirpichenkov
55b3637f03 Fix case of inner object usage in missing supertypes checker
FakeCallableDescriptorForObject instance, which is not ConstructorDescriptor,
is checked with call checkers when object's contents are being used.
Checker of missing supertypes should not be run against this fake descriptor.
Object's members belong to separate member scope, so their resolution doesn't
force containing class' supertypes evaluation. I.e. object's methods
may work fine even if some supertypes of containing class are missing.
2019-11-25 10:57:52 +03:00
Mark Punzalan
5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00
Dmitriy Dolovov
58dd9a6004 Fix AWT freeze in KotlinNativeABICompatibilityChecker (part 2)
Issue #KT-35052
2019-11-25 09:07:09 +07:00
Dmitriy Dolovov
0747a4d9b7 Fix AWT freeze in KotlinNativeABICompatibilityChecker
Issue #KT-35052
2019-11-25 09:07:02 +07:00
Vladimir Dolzhenko
e321c9e4e7 Fix diagnostics calculations for incremental analysis 2019-11-23 23:36:49 +01:00
Vladimir Dolzhenko
c7c512d55e Merge pull request #2815 from t-kameyama/KT-35022
Remove `const` modifier on "change to var" quickfix

#KT-35022 Fixed
2019-11-23 13:42:00 +01:00
Vladimir Dolzhenko
d599322503 Calculate method parameter hint info in updateParameterInfo method (with a progress till 201)
Fixed #EA-216268
2019-11-23 09:24:14 +01:00
Svyatoslav Kuzmich
84757964bb Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI

Add dependency of KotlinCoverageExtension to idea test classpath because of a new check introduced in 1806.

(cherry picked from commit bffbe89f53)
2019-11-22 22:12:39 +03:00
Nikolay Krasko
73a152ccc7 Re-mute inspection tests in AS34 (KT-32856) 2019-11-22 22:12:39 +03:00
Nikolay Krasko
e49d7c86ff Re-mute move refactoring tests (KT-34106) 2019-11-22 22:12:38 +03:00
Nikolay Krasko
0ae677e945 Re-mute checker tests (KT-34105) 2019-11-22 22:12:38 +03:00
Nikolay Krasko
394a812329 Re-mute completion tests (KT-32919) 2019-11-22 22:12:37 +03:00
Nikolay Krasko
6797fb476c Support auto-mute from file for database with mutes 2019-11-22 22:12:37 +03:00
Nikolay Krasko
9356155f60 Minor: add bunch directives for better discoverability banched code 2019-11-22 22:12:36 +03:00
Toshiaki Kameyama
f6059c3eb5 "Change to var": remove const modifier
#KT-35022 Fixed
2019-11-23 01:17:38 +09:00
Vyacheslav Gerasimov
027bc671c1 Build: Remove duplicated compiler.xml from idea module
Workaround for JPS build by copying compiler.xml in test runner before tests

For gradle just copy it in the processResourcesTask of idea project

 #KT-34528
2019-11-22 18:52:00 +03:00
Pavel Kirpichenkov
8c103629a6 Disable FIR box test for callable references to vararg function 2019-11-22 18:22:04 +03:00
Nikolay Krasko
4267e9e3d0 Revert "Advance bootstrap to 1.3.70-dev-1806"
This reverts commit bffbe89f
2019-11-22 16:24:04 +03:00
Alexey Tsvetkov
e506efb5b2 Include Klib metadata utils into jps-plugin
#KT-34958 Fixed
2019-11-22 15:35:30 +03:00
Vladimir Ilmov
a0d4d0da58 [coroutine][debug] rollback compilation failed exception as it breaks test scenarios 2019-11-22 13:17:37 +01:00
Denis Zharkov
9dc628bd72 Fix FirJavaElementFinder.kt.183 compilation 2019-11-22 13:01:56 +03:00
Alexey Tsvetkov
d3f906a1a2 Minor: extract method & reformat to improve readability 2019-11-22 12:54:42 +03:00
Kevin Bierhoff
ed6b90002e conservatively generate code if descriptor unavailable, which happens for some suspend inline functions
KT-33604
2019-11-22 12:54:42 +03:00
Kevin Bierhoff
0285b26e40 make FunctionCodegen skip method bodies we don't need, which avoids problems with inlining methods inside methods we don't need
KT-33604
2019-11-22 12:54:42 +03:00
Natalia Selezneva
b10f47b50e Minor: merge util methods for scripting to one file in idea-gradle 2019-11-22 11:43:35 +03:00
Natalia Selezneva
23f95872ad Minor: fix packages after moving classes to idea-gradle module 2019-11-22 11:43:35 +03:00
Sergey Rostov
75a23b4bc4 Minor: changes after review 2019-11-22 11:43:35 +03:00
Sergey Rostov
fc100d13dd Scripting: move gradle specific logic to idea-gradle 2019-11-22 11:43:34 +03:00
Sergey Rostov
0fb58ed94c Scripting loading tests and extension points 2019-11-22 11:43:34 +03:00
Natalia Selezneva
ca71b2fe90 Add script configuration dependencies to script classpath
It was missing during configuration refinement thought new scripting API and during loading script configuration on Gradle project import

Do not pass additional classpath to configuration classpath: this may only affects Gradle with New scripting API (because it isn't used from other places)
In additional classpath kotlin-compiler and kotlin-stdlib was passed and there is no needs for this during loading Script Definitions through new scripting API

^KT-34626 Fixed
2019-11-22 11:43:34 +03:00
Natalia Selezneva
29ef10a919 Check gradle version for loading script configuration during import option 2019-11-22 11:43:33 +03:00
Natalia Selezneva
72ef43f462 Show filePattern in settings for new script definitions if present 2019-11-22 11:43:32 +03:00
Natalia Selezneva
c40cd07cf0 Do not show duplicated error gradle templates in settings
^KT-34530 Fixed
2019-11-22 11:43:32 +03:00
Natalia Selezneva
d355a9f686 Minor: fix typo 2019-11-22 11:43:32 +03:00
Natalia Selezneva
229665d2fc Remove unused environment properties from gradle configuration resolver
getScriptContents is no longer used by Gradle
see https://github.com/gradle/gradle/blob/master/subprojects/kotlin-dsl/src/main/kotlin/org/gradle/kotlin/dsl/resolver/ResolverEnvironment.kt
2019-11-22 11:43:32 +03:00
Natalia Selezneva
9710f1da77 Minor: move class 2019-11-22 11:43:32 +03:00
Natalia Selezneva
6c4de96dcb Minor: extract class to separate file 2019-11-22 11:43:31 +03:00
Natalia Selezneva
4b0844b21d Minor: move classes in idea-gradle module related to scripting 2019-11-22 11:43:31 +03:00
Roman Golyshev
28e2d2faf2 KT-34740 Make getImplicitReceiversWithInstanceToExpression keep script implicit receivers
- This makes completion aware of scripts implicit receivers (it matters in .gradle.kts files, for example)
- ^KT-34740 Fixed
2019-11-22 11:22:46 +03:00
Roman Golyshev
be2fe256ba KT-34740 Refactor implicitReceiversUtils.kt 2019-11-22 11:22:46 +03:00
Pavel Kirpichenkov
34b8b96cde Generate forgotten FIR box test 2019-11-22 11:10:47 +03:00
Ivan Gavrilovic
d269c194c7 Fix java version parsing in KAPT
Handle case when "java.version" returns
"11" or "12". Previously, we expected it to
contain at least one dot in the version string.
2019-11-22 16:06:35 +09:00
Jens Klingenberg
508330e0bb Remove deprecated method from CommandLineProcessor 2019-11-22 16:06:35 +09:00
Ivan Gavrilovic
3a7deffe2e KT-33050: Pass source version to KAPT for JDK12+
In JDK 12+ source version should be passed using --source option,
instead of -source. This commit uses correct option based on the
JDK current build is using.

Fixes KT-33050
2019-11-22 16:06:35 +09:00
Ivan Gavrilovic
f4c6f57354 KT-34194: Pass error/NonExistentClass for incremental KAPT run
When running KAPT incrementally, make sure to pass error/NonExistentClass.java
when there is at least one source file to process. This is to make sure
APs that must resolve all types are able to do so.

Test: updated KaptIncrementalWithAggregating/WithIsolating
2019-11-22 16:06:34 +09:00
Vladimir Ilmov
7bdda22cfa [coroutine][debugger] broken testCompileOnly fix missing dependency aether-dependency-resolver in 192,193 versions 2019-11-22 07:27:18 +01:00
Zalim Bashorov
3fa431e114 [JS IR] Don't use full paths when generating comments with a path for file blocks 2019-11-21 23:51:09 +03:00
Zalim Bashorov
c05c07f243 [JS IR] Generate special region comments at the start and the end of each file block
It allows to fold these blocks and navigate to them in the IDEA.

Also, this commit adds compiler configuration keys to control generating comments with paths for file blocks,
and now generating such comments is enabled only in our tests.
2019-11-21 23:51:08 +03:00
Zalim Bashorov
fa76b9cf83 [JS IR] Use single line comment instead of JsDoc comment for comments with path 2019-11-21 23:51:08 +03:00
Zalim Bashorov
83e85b3ec8 [JS AST] Add single line comment node 2019-11-21 23:51:08 +03:00
Zalim Bashorov
5fe79f71ad [JS IR] Don't generate comment with path for "empty" files 2019-11-21 23:51:08 +03:00
Zalim Bashorov
4e3a2a0b3e [JS AST] Don't generate a new line after try and if-then blocks 2019-11-21 23:51:08 +03:00
Igor Yakovlev
8f9895e64e Add external keyword support for UL
Fixed #KT-34923
2019-11-21 22:49:23 +03:00
Pavel Kirpichenkov
f80a71517f [NI] Handle vararg parameter in reflection type wrt array types
Vararg parameter in reflection type is interpreted as covariant
array type against array in expected functional type and as
vararg element type otherwise. For instance having function
fun foo(vararg args: Int): Unit { /*...*/ }
reference ::foo can be passed against expected
(Int) -> Unit,
(Int, Int) -> Unit, etc.
In none of such cases type for parameter in foo's reflection type
should be changed to array.
However, against expected type (IntArray) -> Unit args' type
must become IntArray.

^KT-25514 Fixed
2019-11-21 20:07:14 +03:00
Igor Yakovlev
aba5ff0c1e Fix copy refactoring for multiply kotlin files
Fixed #KT-34971
2019-11-21 19:19:15 +03:00
Mikhail Glukhikh
7d944e2023 FIR dispatch receiver: check nullability only (expected vs actual type)
This gives a minor performance boost and prepares for upcoming K/J type mapping
2019-11-21 19:00:50 +03:00
Dmitry Savvinov
0dc7c37b62 Choose SDK consistently at least for non-COMPOSITE analysis
In COMPOSITE analysis we don't have a constant SDK dependency for whole
ResolutionFacade, so we have to find it manually via calling
'findSdkAcrossDependencies'

In SEPARATE mode we do have such a constant SDK dependency, but there
was an assumption that it doesn't make a difference (i.e.
findSdkAcrossDependencies always return the same SDK as passed constant
one)

Turns out that assumption was wrong, particularly for projects with
duplicate SDK entries in project structure. Then we would choose one SDK
in some cases, and the other one on other cases - even though they a
bit-to-bit equal, we will create separate descriptors for them, which
might lead to some issues, like in KT-34802

^KT-34802 Fixed
2019-11-21 18:56:49 +03:00
Alexander Udalov
e4afbae954 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-21 16:44:30 +01:00
Alexander Podkhalyuzin
4e331d0fb9 Update ReadMe.md
Update usages of old IDEA versions in readme
2019-11-21 18:36:01 +03:00
sergey.igushkin
88dae8025e Fix failure with Kotlin/Native distributions that have no stdlib
Add a warning message during Gradle configuration phase if the
Kotlin/Native distribution is missing the stdlib.

Issue #KT-35033 Fixed
2019-11-21 18:28:59 +03:00
Vladimir Dolzhenko
6a28d1da82 Resolve references in background thread in PlainTextPasteImportResolver
#KT-16774 Fixed
2019-11-21 16:05:08 +01:00
Ilya Goncharov
bdb1c2a27f [Gradle, JS] Fix tasks naming
#KT-35019 fixed
2019-11-21 17:48:22 +03:00
pyos
d221c1f242 JVM_IR: refactor MoveCompanionObjectFieldsLowering
* Extract replacement of IrGetField/IrSetField into a separate
   file-level lowering (should reduce the amount of work to linear in
   the number of classes rather than potentially quadratic)

 * Extract static backing field construction into JvmDeclarationFactory
   and move that lowering after PropertiesToFields lowering to reduce
   code duplication
2019-11-21 15:14:44 +01:00
Pavel Kirpichenkov
afd59f0d46 [NI] Fix 'only input type' check for intersection types
Check worked incorrectly in case when argument type and expected type are the
same intersection type, which is possible for local variables without explicit
type declaration.
2019-11-21 15:59:26 +03:00
pyos
57760e5873 FIR: set anonymous initializers' parents 2019-11-21 15:53:52 +03:00
Alexander Udalov
b38153e402 Minor, add runtime and comment to test on multi-file isInitialized 2019-11-21 13:46:53 +01:00
Alexander Udalov
bf06d381b9 Minor, move old Java nullability assertion tests under oldLanguageVersions/
Also drop the (now confusing) "_lv12" suffix from newer tests
2019-11-21 13:46:17 +01:00
Vladimir Dolzhenko
16e76fb75a Resolve imports in background thread in PlainTextPasteImportResolver
#KT-34956 Fixed
2019-11-21 13:40:55 +01:00
Svyatoslav Kuzmich
bffbe89f53 Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI
2019-11-21 15:33:48 +03:00
pyos
0f4f3f2429 FIR: set correspondingPropertySymbol of backing fields 2019-11-21 15:27:53 +03:00
Mikhail Glukhikh
0dcce9f584 FIR: add forgotten annotation calls resolve at some points 2019-11-21 14:25:27 +03:00
Mikhail Glukhikh
1bc4642fc9 Run CompileKotlinAgainstJava tests in both APT / non-APT modes 2019-11-21 14:25:16 +03:00
Mikhail Glukhikh
393047883e JavacWrapper: add Kotlin classes to classpath only in APT mode 2019-11-21 14:25:13 +03:00
Mikhail Glukhikh
89a582b694 JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode
For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
2019-11-21 14:25:08 +03:00
Ilya Goncharov
64380670c5 [Gradle, JS] Add more info for check exit code 2019-11-21 12:59:52 +03:00
Ilya Goncharov
ac241852de [Gradle, JS] Add verbose option to yarn in debug mode 2019-11-21 12:59:52 +03:00
Dmitriy Dolovov
28f2a2a864 Fix: Kotlin/Native libs have non-user friendly representation in IDE
Issue #KT-30288
Issue #KT-34998
Issue #KT-34400 (partially fixes)
2019-11-21 16:56:47 +07:00
Dmitry Petrov
d3a5dcb601 KT-35004: keep track of KotlinType for 'when' subject 2019-11-21 10:48:14 +03:00
Mikhail Glukhikh
338b4e2eab Refactor AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:58 +03:00
Mikhail Glukhikh
32aba31819 Cleanup: AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:53 +03:00
Georgy Bronnikov
307c82e3a4 JVM_IR: redirect to correct function in special brigdes
The fix in MethodSignatureMapper allows us to avoid the hack
with orphanedCopy() in BridgeLowering.
2019-11-20 21:00:59 +03:00
Mikhail Zarechenskiy
ef567c868e [NI] Add checkCanceled checks before resolving a candidate
This is an analogue that was done for old inference in CandidateResolver
2019-11-20 18:14:58 +03:00
Mikhail Zarechenskiy
63e62dcf42 Add checkCanceled check on resolving imports path
Imports resolution is a rather time consuming task and doesn't have
 `checkCanceled` on its computation path. So, if a thread is resolving
 imports it will do it until the end of computation, which can lead to
 unnecessary work and some IDE freezes.

 #KT-34990 Fixed
2019-11-20 18:14:57 +03:00
Denis Zharkov
db24d4ac9a FIR: Drop ConeTypeAliasLookupTag 2019-11-20 18:02:08 +03:00
Denis Zharkov
38500d27e8 FIR: Add cache for expanded types 2019-11-20 18:02:07 +03:00
Denis Zharkov
159aefd26d FIR: Refactor Cone types
- Get rid of AbbreviatedType
2019-11-20 17:57:35 +03:00
Denis Zharkov
e03162f2dd FIR: Rename ConeClassTypeImpl -> ConeClassLikeTypeImpl 2019-11-20 17:55:23 +03:00
Denis Zharkov
f178cb6fb3 FIR: Replace trivial usages of ConeClassType with ConeClassLikeType 2019-11-20 17:55:23 +03:00
Alexander Udalov
a485a5ffd6 JVM IR: load fields for JvmField properties from dependencies
This is needed to properly lower JvmField property calls to field
accesses.
2019-11-20 15:35:12 +01:00
Alexander Udalov
608449f41d IR: introduce StubGeneratorExtensions for ExternalDependenciesGenerator
This is a refactoring to simplify the API of
ExternalDependenciesGenerator and to constrain future additions of
platform-specific stub generator extensions.
2019-11-20 15:16:57 +01:00
Mikhael Bogdanov
c3af2d5a10 JVM_IR. Combine all inline function resolve logic in ResolveInlineCalls lower 2019-11-20 14:37:53 +01:00
pyos
939a9ff53e JVM_IR: fix NPE in interface companion initializers
* When referencing the companion itself, they should use the $$INSTANCE
  field, not the (null until <clinit> returns) Companion field of the
  interface.

* Interface companion init blocks should be made static.
2019-11-20 14:37:19 +01:00
pyos
7c015564ce JVM_IR: do not set ACC_VARARGS if vararg is not the last parameter
Fun fact: this is not actually validated when loading the class; and
even when compiling a java file against a class file that does this,
only javac 9 has a check (1.8 and before simply crashes with
NullPointerException somewhere deep inside the compiler).
2019-11-20 13:40:46 +01:00
Mark Punzalan
7adffe0007 Handle withIndex() on Iterables (including progressions) and Sequences
in ForLoopsLowering.
2019-11-20 13:02:21 +01:00
Mark Punzalan
a54d9482dd Handle withIndex() on arrays and CharSequences in ForLoopsLowering. 2019-11-20 13:02:21 +01:00
Mark Punzalan
735535dd5a Extract HeaderInfo base class and add NumericHeaderInfo class, in
preparation for handling withIndex().
2019-11-20 13:02:21 +01:00
Mark Punzalan
2ab539c5eb Encapsulate variable construction and declaration order logic within
ForLoopHeader instead of in HeaderProcessor.
2019-11-20 13:02:21 +01:00
Mark Punzalan
60c05362d2 Refactor ForLoopHeader to clarify the purpose of its functions. 2019-11-20 13:02:21 +01:00
Mark Punzalan
7f803e60b6 Fix typo in forInArrayWithIndex testdata filenames. 2019-11-20 13:02:21 +01:00
Mikhael Bogdanov
9066614cb9 Support inlining of implicitly casted lambda parameter 2019-11-20 12:57:41 +01:00
Mikhael Bogdanov
d28ec1d449 Add test for default lambda inlining in suspend inline 2019-11-20 12:57:41 +01:00
Mikhael Bogdanov
a92afc5a89 JVM_IR. Disable private default flag test
JVM_IR generates `public` flag
2019-11-20 12:57:40 +01:00
Mikhael Bogdanov
344c11af7f JVM_IR. Support multifile facades in default function inlining 2019-11-20 12:57:39 +01:00
Mikhael Bogdanov
19ce055322 JVM_IR. Pass stub function reference in 'getSignature' 2019-11-20 12:57:38 +01:00
Mikhael Bogdanov
a214d61567 IR. Change visibility to lowered default function/constructors to public 2019-11-20 12:57:38 +01:00
Mikhael Bogdanov
abef5daea9 IR. Hack to distinguish default values 2019-11-20 12:57:37 +01:00
Mikhael Bogdanov
ac31e0e8c7 Support default lambda inlining in IR 2019-11-20 12:57:36 +01:00
Mikhael Bogdanov
8adac2d1ea Don't add unused label if variables are absent 2019-11-20 12:57:36 +01:00
Mikhael Bogdanov
be3eed5f1f Access to receiver thought reference class 2019-11-20 12:57:35 +01:00
Mikhael Bogdanov
7bab3a1048 Set non-synthetic origin for generated members of PropertyReference 2019-11-20 12:57:34 +01:00
Mikhael Bogdanov
3196893166 Don't write synthetic arguments to LVT 2019-11-20 12:57:33 +01:00
Mikhael Bogdanov
f264942bf9 Don't coerce intrisic value, it's already coerced 2019-11-20 12:57:33 +01:00
Mikhael Bogdanov
e409387078 Don't generate jump for last when condition 2019-11-20 12:57:32 +01:00
Mikhael Bogdanov
9a07063d8b Decrease number of 'invokeMethodDescriptor' usage in inliner 2019-11-20 12:57:31 +01:00
Mikhael Bogdanov
3eec67e5d3 JVM_IR. Don't compare with 0 defaultFlag 2019-11-20 12:57:30 +01:00
Mikhael Bogdanov
f5fb50b224 IR. Add separate origins for synthetic parameters in default functions.
Keep information about types and default values in lowered funtion
2019-11-20 12:57:30 +01:00
Alexey Trilis
764a25f6ae [JS] Add deprecated typealias and extension properties for renamed in dukat update entities 2019-11-20 12:49:03 +01:00
Andrey Uskov
937cffd273 Support Gradle 5.x in GradleInspectionTest 2019-11-20 13:53:58 +03:00
Andrey Uskov
21b9987a76 Support Gradle 5.x in GradleMigrateTest 2019-11-20 13:53:56 +03:00
Andrey Uskov
5fe4baa4a5 Fix GradleNativeLibrariesInIDENamingTest 2019-11-20 13:53:54 +03:00
Andrey Uskov
968ccf667a Fix GradleNativeLibrariesPropagationTest
Dev plugin in tests were replaced with release version
2019-11-20 13:53:52 +03:00
Andrey Uskov
8a3dfe93f2 Fixed GradleFacetImportTests for gradle 5.x 2019-11-20 13:53:50 +03:00
Andrey Uskov
9e7eff7e72 Enable ImportCompilerArgumentsWithInvalidDependencies test 2019-11-20 13:53:48 +03:00
Vladimir Ilmov
25acb1e191 [coroutine][debugger] removed and regenerated tests for not-ready-to-be-tested logic, kt* tests are failing due to KT-32691 2019-11-20 13:17:56 +03:00
Vladimir Ilmov
09d2bd33f8 [coroutine][debug] incorrect merge conflicting with 00a06ef9b9 2019-11-20 12:36:13 +03:00
Mikhail Glukhikh
137e54db05 FIR Java (raw type bounds erasure): make better protection from recursion 2019-11-19 23:22:36 +03:00
Mikhail Glukhikh
95203e9310 FIR: unmute passing black-box tests (nested constructor resolve) 2019-11-19 23:02:35 +03:00
Mikhail Glukhikh
fa739f1aae FIR: optimize classifier scope: don't search for nonexistent symbols 2019-11-19 22:41:19 +03:00
Mikhail Glukhikh
d39a36ee25 FIR declared member scope: remove constructors from callable index
This removes constructor resolve ambiguity in some cases.
Now constructors are resolved only via classifiers
2019-11-19 22:41:17 +03:00
Mikhail Glukhikh
bd71d1dc3f FIR resolve: use lazy nested classifier scopes for Java classes
It's necessary because JavaSymbolProvider adds nested classifiers lazily.
Commit slows things down due to relatively slow search in symbol providers
2019-11-19 22:40:22 +03:00
Dmitriy Novozhilov
cc891c46b1 Mute failing fir blackbox test 2019-11-19 21:09:29 +03:00
Mads Ager
15ed342282 JVM_IR: Generate args check in existing methods for special bridge methods.
Fix the number of arguments checked (1 for getOrDefault and 2 for
remove).
2019-11-19 19:10:04 +03:00
Alexander Gorshenev
369d9bfdab Dropped index from DeserializedSourceFile as it is no longer needed 2019-11-19 18:19:46 +03:00
Alexander Gorshenev
e7ef453d22 Got rid of klib file registry 2019-11-19 18:19:46 +03:00
Simon Ogorodnik
f49bc0e96d [FIR] Improve keyword colors (light-theme) in html dump 2019-11-19 16:50:46 +03:00
Simon Ogorodnik
36979e7937 [FIR] Support ConeDefinitelyNotNullType in html dump 2019-11-19 16:50:44 +03:00
Simon Ogorodnik
9249d1b727 [FIR] Support diagnostics in Html dump 2019-11-19 16:50:43 +03:00
Simon Ogorodnik
6e8f8f9a65 [FIR] Partially support raw types 2019-11-19 16:50:40 +03:00
Georgy Bronnikov
119a3f1306 JVM_IR: do not generate accessors to lateinit private properties 2019-11-19 16:30:04 +03:00
victor.petukhov
be0516348b IDE formatting: add indention for new line in parameters list when there is a trailing comma 2019-11-19 16:08:42 +03:00
Ilya Goncharov
d246d12093 [Gradle, JS] Add intregration test on browser pipeline with transitive dependencies 2019-11-19 14:02:47 +03:00
Ilya Goncharov
c87961dcad [Gradle, JS] Dce should work with runtime classpath
#KT-34946 fixed
2019-11-19 14:02:45 +03:00
Ilya Goncharov
c2b53dfce7 [Gradle, JS] Add debugger; only for debug mode 2019-11-19 13:52:37 +03:00
Ilya Goncharov
4d3698313d [Debugger, JS] Configure timeouts for debugging 2019-11-19 13:52:37 +03:00
Ilya Goncharov
79ef361e1a [Debugger, JS] Remove Mocha configuring in KotlinKarma 2019-11-19 13:52:37 +03:00
Ilya Goncharov
15a606c2b6 [Debugger, JS] Rename karma-debug on karma-debug-runner 2019-11-19 13:52:37 +03:00
Ilya Goncharov
5f8a5d5fca [Debugger, JS] Extract Debug's configurations 2019-11-19 13:52:37 +03:00
Ilya Goncharov
d57127ed08 [Debugger, JS] Fix for mocha timeout 2019-11-19 13:52:36 +03:00
Ilya Goncharov
d7c2d098af [Debugger, JS] Add configuring debuggable browser 2019-11-19 13:52:36 +03:00
Ilya Goncharov
550cc9d775 [Gradle, JS] Add karma debugger by timeout 2019-11-19 13:52:36 +03:00
Ilya Goncharov
821a4ea472 [Debugger, JS] Use default js debug configuration with Karma 2019-11-19 13:52:36 +03:00
Mikhail Glukhikh
3d00212e34 FIR Java: add minor comment (type parameter types) 2019-11-19 13:13:24 +03:00
Mikhail Glukhikh
f60842efe1 FIR resolve: add test with Java static class constructor access from Kotlin
This test does not work because nested classifier scope works incorrectly for Java
2019-11-19 13:08:54 +03:00
Mikhail Glukhikh
19aff81b55 FIR tower resolve: make static members accessible from derived classes 2019-11-19 13:07:53 +03:00
Mikhail Glukhikh
7dea06d2a7 FIR tower resolve: make companion members accessible from derived classes 2019-11-19 13:07:52 +03:00
Mikhail Glukhikh
802ed9b502 FIR: implement protected visibility checker #KT-34788 Fixed 2019-11-19 13:07:52 +03:00
Mikhail Glukhikh
ad3659d1d9 FIR deserializer: add forgotten type parameter bounds for FunctionX 2019-11-19 13:07:51 +03:00
Mikhail Glukhikh
1e548e3f21 FIR substitution: use intersection of bounds for * projection 2019-11-19 13:07:46 +03:00
Dmitriy Novozhilov
43a8c1282f [FIR] Add toString() call to expressions in string templates 2019-11-19 13:04:49 +03:00
Dmitriy Novozhilov
8d9d6fd181 [TEST] Regenerate FirBlackBoxCodegenTest 2019-11-19 13:04:49 +03:00
Vladimir Ilmov
022a31398a [coroutine][debug] creation stack trace jump to line fixed 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
25222b55e6 [coroutine][debug] AsyncStackTraceProvider refactored 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
310b3611ef coroutine extention refactored to minimize brunch-related logic 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
c90cd8c490 [coroutine][debug] compilation error fixed 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
3ca5d2d64f Debugger: Add 193 bunch for coroutines debugger 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
1dc44b4000 Debugger: Tests refactor 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
12313fa5aa Debugger: Fix for coroutine debugger after review 2019-11-19 12:29:52 +03:00
Aleksandr Prokopyev
5975251a32 Debugger: Coroutines stack frames with variables & coroutine dumps 2019-11-19 12:29:06 +03:00
Roman Artemev
c459b2ca6e [JS IR] Fix state machine control flow
- exception loop unwinding: make sure exception state is reset after try block is finished
 - break/continue of suspended loops
2019-11-19 11:15:36 +03:00
Roman Artemev
18d0b477b6 [JS IR] Fix arrayOfNulls API 2019-11-19 11:15:36 +03:00
Roman Artemev
f2093a1763 [JS IR] Fix boxing/unboxing of inline classes in coroutine scope
- don't box/unbox when value is known to be an inline class
 - add unbox state when coroutine resumed
 - correctly handle suspension in case of inline class
 - add tests
2019-11-19 11:15:35 +03:00
Roman Artemev
52b24ead91 [IR] Add REINTERPRET_CAST operator in IrTypeOperatorCall
- fix BE
 - fix Serializer
 - implement builder
 - make Ir a bit more type-correct
 - support developer mode (lowering [dynamic]implicit cast meterialized as general cast)
 - fix autoboxing lowering
2019-11-19 11:15:35 +03:00
Roman Artemev
3795897fb7 [JS IR] Add developer mode in configuration 2019-11-19 11:15:35 +03:00
Roman Artemev
a2703b1534 [IR] Unlink isLocal and isAnonymousObject from Descriptors API 2019-11-19 11:15:35 +03:00
Mikhail Glukhikh
f633102b8c Unmute one of generated FIR black box codegen tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
9c9cf2086d Unmute recently fixed FIR black box tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
f3d0a976b2 Disable recently added FIR black box tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
779b9e97d5 Add IGNORE_BACKEND_FIR into generated black box tests (InRange, Ranges, ...) 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
7a7fc89c00 Regenerate FIR black box codegen tests 2019-11-19 11:00:09 +03:00
Mikhail Glukhikh
2ab3769998 Generation test utils: extract compileFilesUsing standard mode / FIR 2019-11-19 11:00:09 +03:00
Mark Punzalan
9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Mark Punzalan
fc9ccafb84 [FIR] Generate and enable blackbox codegen tests. 2019-11-19 11:00:06 +03:00
Dmitriy Novozhilov
ac590fa4c9 [FIR] Fix deserializing nullability of type parameters 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
950d1f4fe4 [FIR] Fix enhancement of java array type 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
d56412e397 [FIR] Analyze lambda arguments in erroneously resolved calls 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
a85ece1d83 [FIR-TEST] Add test with problem of invisible static members of supertype 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
35dd1cf75a [FIR] Fix binding return expression to function 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
98378d8973 [FIR] Infer type of lambda using all return statements 2019-11-19 10:43:45 +03:00
Dmitriy Novozhilov
99da7272f5 [FIR] Change children order in FirConstructor 2019-11-19 10:43:45 +03:00
Dmitriy Novozhilov
01b47854c6 [FIR] Fix implicit builtin types usages in body resolve 2019-11-19 10:43:45 +03:00
Sergey Bogolepov
e4702bf438 [kotlinx-metadata] Add extensions for type aliases. 2019-11-19 11:41:06 +07:00
Steven Schäfer
85b36dcd88 IR: Introduce IrClassifierSymbol.defaultType 2019-11-18 19:40:04 +01:00
Steven Schäfer
3d7d1022e4 JVM IR: Add supertypes for PropertyReference classes in JvmSymbols
This is still missing overrides, but this change is enough to make
the code generated in PropertyReferenceLowering typecheck.
2019-11-18 19:40:04 +01:00
Steven Schäfer
2db8471dd7 IR: Avoid "raw" IrTypes
The ir type checker cannot deal with types with an incorrect number of arguments.
On the other hand, the JVM IR backend sometimes produces "raw types" - types with
generic parameters but without arguments. This commit removes such raw types as
much as possible, by replacing calls to "typeWith()" with calls to "defaultType"
for classes without type parametes (defaultType doesn't allocate, unlike typeWith)
and with calls to "starProjectedType" for classes with type parameters.
2019-11-18 19:40:04 +01:00
Steven Schäfer
4d67803f04 JVM IR: Fix IR types in default argument stubs 2019-11-18 19:40:04 +01:00
Steven Schäfer
9ef627ebec JVM IR: Fix types in EnumClassLowering 2019-11-18 19:40:04 +01:00
Steven Schäfer
492a46206b JVM IR: Fix return type of IrSetField in SharedVariablesManager 2019-11-18 19:40:04 +01:00
Alexander Udalov
e8cb19fe22 IR: minor, remove obsolete IrBasedDeclarationDescriptor
It was introduced to reference wrapped descriptors in `ir.tree`, but
since 2f544280 it's no longer necessary
2019-11-18 18:58:41 +01:00
Alexander Udalov
0daab88f97 JVM IR: make RemoveInlinedDeclarations a final module phase
Code in inline lambdas can call multifile part members. These calls are
replaced in GenerateMultifileFacades with the call to the facade member.
Previously this didn't happen though because the lambda body was removed
before the GenerateMultifileFacades phase, which led to
IllegalAccessError in the -Xmultifile-parts-inherit mode (because the
part class is package private in another package).
2019-11-18 18:58:41 +01:00
Alexander Udalov
cdb7703947 JVM IR: fix VerifyError on annotated annotation properties
The problem was that we tried to generate an `$annotations` method for a
property declared in an annotation class. That method is final and has a
body, which is not allowed in annotation classes. Now we're generating
this method in the separate `$DefaultImpls` class as for properties in
interfaces.

Note that the added test still doesn't find any annotations because the
proper support is needed in reflection (KT-22463). Currently it only
checks that no VerifyError happens.
2019-11-18 18:58:41 +01:00
Alexander Udalov
994d4e081b JVM IR: fix names of monitorenter/monitorexit intrinsics
Since they're "illegally" accessed from another file in stdlib,
accessors are generated for them, and the calls go through these
accessors
2019-11-18 18:58:41 +01:00
Alexander Udalov
f47b67781d JVM IR: fix containing declaration for top level members in wrapped descriptors
In addition to fixing getContainingDeclaration, change origin of
multifile facades to FILE_CLASS since the corresponding class descriptor
should also be skipped when computing containing declaration. This fixes
the problem with internal function calls in -Xmultifile-parts-inherit
mode (previously we incorrectly mangled the function name in
MethodSignatureMapper), and also fixes coroutine intrinsic calls when
compiling kotlin-stdlib with JVM IR. In the latter case, all intrinsics
(such as isBuiltInSuspendCoroutineUninterceptedOrReturn) are present in
sources, and were previously not detected as intrinsics by the code in
`generateInlineIntrinsic` because the FQ name didn't match: it had an
additional component for the file class name.
2019-11-18 18:58:41 +01:00
Alexander Udalov
59af967292 JVM IR: support suspend inline functions in -Xmultifile-parts-inherit mode
Support in the normal (without -Xmultifile-parts-inherit) mode is a bit
more complicated, see the added test.
2019-11-18 18:58:40 +01:00
Alexander Udalov
6f5aa58338 JVM IR: support -Xmultifile-parts-inherit mode 2019-11-18 18:58:40 +01:00
Alexander Udalov
3b6b3c7e66 JVM IR: minor, don't use symbols for maps of multifile members
To simplify usage of these maps at call sites
2019-11-18 18:58:40 +01:00
pyos
9182f2c796 IR: don't attempt to move defaults to actual in another module
May happen when a function in an `expect` class is aliased through an
`actual typealias`; the matching declaration is filtered out in
`ExpectedActualResolver.findActualForExpected` as it has no source.
2019-11-18 18:41:21 +01:00
pyos
1bc48c3df9 IR: copy annotations when making lateinit fields nullable 2019-11-18 18:35:15 +01:00
Alexey Trilis
4f56b1a960 Add support for Touch API in JS Stdlib
#KT-34948 fixed
#KT-21445 fixed
2019-11-18 19:44:03 +03:00
Vyacheslav Gerasimov
2dfa6c360b Fix version range for Idea 191 plugin
#KT-34385
2019-11-18 18:49:40 +03:00
Svyatoslav Kuzmich
a46e970f47 [JS] Remove kotlin-test-js build from JPS
kotlin-test-js is also built by JS IR backend
JS IR backend does not support JPS yet
2019-11-18 15:31:12 +03:00
Svyatoslav Kuzmich
c8e5b2f2f8 [KLIB] Add error message when failed to resolve library 2019-11-18 15:31:12 +03:00
Pavel Kirpichenkov
3e8c15c62a Introduce component for caching missing supertypes
Profiling has shown, that supertype hierarchy scan for all calls has considerable
performance cost. However, missing supertypes may be calculated only once per
descriptor which would help avoiding multiple supertype hierarchy scans for
resolved calls from the same class. New memoizer is injected into call completers
and checker contexts and then used for retrieving missing super classifiers.

#KT-19234 Fixed
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
4b405c6c0f Supply kotlin mock JDK to relevant test runners
Default mock JDK from IDEA 193, "wins" mock JDK from kotlin in some tests.
In script configuration test this breaks resolution of java declarations from script environment.
Overriding getTestProjectJdk replaces default test project JDK with kotlin mock JDK.
Configuration in AbstractMultiFileHighlightingTest was updated similarly to fix test failures.
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
8c52bb4212 Add frontend checks for missing dependency supertypes
Call checker and declaration checker are used in order to preserve backward compatibility.
Attempt to use classifier usage checker was not good enouth,
since not all errors found with it would actually be reported before.
For example types and constructor calls don't cause supertypes to resolve,
so missing supertypes would not lead to errors in case they are the only use of class name.

Updated tests failing due to missing Java dependencies in superclasses.
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
388cd53105 Add filtering during generation of mockJDK JAR
Adjustments for missing superclasses checker.
Some hierarchies in mock JDK are incomplete.
Absence of its .class file causes some tests to fail without an actual error.
To mitigate this problem, top-level classes and interfaces can only inherit from entries that belong to mock JDK.
Absent superclasses are replaced with java.lang.Object.
This only affects runtime jar of mock JDK.
2019-11-18 12:06:41 +03:00
Ilya Chernikov
27ff2d7816 Prohibit using array based on non-reified type parameters as reified type arguments
#KT-31227 fixed
2019-11-18 09:32:52 +01:00
Andrey Uskov
8a1f8714e7 Fix GradleConfiguratorTest
Kotlin gradle plugin was removed from test classpath
2019-11-18 11:26:13 +03:00
Mikhail Zarechenskiy
43d916e92d [NI] Add tests for obsolete issues
#KT-26303 Obsolete
 #KT-32205 Obsolete
2019-11-18 10:25:41 +03:00
victor.petukhov
cf161f8234 Rework notForIncompletionCall test 2019-11-17 15:19:28 +03:00
pyos
ba93bdb14d JVM_IR: keep the $default suffix for stubs for @JvmName functions
Technically a backwards compatibility problem, as the new backend
*consistently* renamed `f$default` on `f` with `@JvmName("g")` to
`g` instead of `g$default`, so it all worked out. However, this
breaks when encountering libraries compiled with the non-IR backend.
2019-11-15 17:40:52 +01:00
Steven Schäfer
23dfade24f JVM IR: Fix inlining of inline class properties in external modules 2019-11-15 17:30:16 +01:00
Vladimir Dolzhenko
fa62d0c325 Don't clear InBlockModifications on CanceledException
#KT-34914 Fixed
2019-11-15 15:48:27 +01:00
Pavel Kirpichenkov
92dae5d8a9 [NI] Split substitution of inferred type parametes into two steps
Substituting inferred type parameters with single substitutor leads
to incorrect behaviour in cases, when class' type parameters are used in constructor.
As a side effect of two-step substitution, intermediate descriptor is created,
which prevents incorrect substitution. To preserve this side effect, single
resulting substitutor was split into two substitutors: one for substituting fresh
variables and another for substituting inferred variables and known parameters.

^KT-32415 Fixed
2019-11-15 16:58:32 +03:00
Pavel Kirpichenkov
b6af13f18d [NI] Add missing substitution of known type parameters
Known type parameters appear after inheriting from class with type
parameters. Their substitution matters for inner class constructor,
because without substitution it's parameters will be type checked
against incorrect (original) parameter descriptor with unsubstituted
type parameters.

Skip creation of composite substitutor, if old substitutor is empty.

New substitutors return null in case they don't substitute a type,
but old type substitutors have explicit isEmpty method. Composite
substitutor with empty old substitutor leads to creation
of incorrect descriptor copies.
2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov
3122f2704c [Minor] Refactor resulting descriptor substitution in call transformer 2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov
ea66f02035 [Minor] Rename fresh variable substitutor in resolved atom 2019-11-15 16:58:07 +03:00
victor.petukhov
25f3de2085 Use more stable kotlin dependency in tests for enabling inline classes flag 2019-11-15 16:13:44 +03:00
Sergey Bogolepov
4438dd282f [kotlinx-metadata-klib] Bugfixes:
1. Add dependency on `:core:descriptors`
2. Wrap module name with < and >
3. Remove redundant question marks.
4. Fix string table writing.
2019-11-15 19:10:30 +07:00
Sergey Bogolepov
95399b3a41 Introduce kotlinx-metadata-klib.
`kotlinx-metadata-klib` is an extension of `kotlinx-metadata` that can be used to read and write metadata that is stored inside KLIBs.
Note: current version is in its early days and in active development. Almost nothing is stable or properly tested.
2019-11-15 16:38:07 +07:00
Ilya Gorbunov
d91453fb7a Do not preprocess apiVersionIsAtLeast calls inlined into kotlin package
If such call were to be inlined into an inline function in kotlin
package, it would be expanded there preventing the further expansion in
client code.
2019-11-15 05:22:24 +03:00
Andrey Uskov
352a10a0ed Do not fail tests on unknown version of gradle Kotlin plugin 2019-11-14 21:13:21 +03:00
Andrey Uskov
e963b71921 Tests of import with latest gradle plugin are implemented 2019-11-14 21:13:19 +03:00
Andrey Uskov
51590ef1b7 Migrate import tests to annotation-driven determination of target
kotlin plugin versions
2019-11-14 21:13:16 +03:00
Andrey Uskov
d05f893233 Import tests with gradle 5.6.4 were added 2019-11-14 21:13:13 +03:00
Andrey Uskov
a51e2ca4d6 Limit initial heap of gradle daemon in import tests 2019-11-14 21:13:11 +03:00
Andrey Uskov
1f2767ae21 Remove gradle testing import from gradle 3.x 2019-11-14 21:13:09 +03:00
Andrey Uskov
48f6207d26 Support annotation-based declaration of target plugin and gradle version
in gradle importing tests
2019-11-14 21:13:07 +03:00
Andrey Uskov
14aa0eae71 Extract kotlin gradle plugin versions to constants in tests 2019-11-14 21:13:05 +03:00
Roman Golyshev
633005fb57 KT-25732 Perform keywords completion earlier to complete them before freeze
- If you complete keywords too late, the completion list may become frozen, and `null` will never make it to the top of it
- Remove `flushToResultSet` between `addReferenceVariantElements` calls because flush already happens inside of them
- ^KT-25732 Fixed
2019-11-14 19:50:38 +03:00
Alexander Udalov
36ca280b86 Fix compilation error in ResolveInlineCalls.kt 2019-11-14 17:19:27 +01:00
Mikhail Glukhikh
635add4823 FIR substitution: generate fake overrides for accessor symbols 2019-11-14 19:10:59 +03:00
Mikhail Glukhikh
bd70daa3d1 FIR Java: use definitely not-null types for type parameters
We support & use ConeDefinitelyNotNullType more properly here
2019-11-14 19:10:59 +03:00
Mikhail Glukhikh
63f38bb28a FIR [rendering only]: render fake overrides for properties 2019-11-14 19:10:58 +03:00
Dmitriy Novozhilov
4733c78a6a [FIR] Add toString() to ErrorTypeConstructor and ConeClassifierLookupTag 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
944be132de [FIR-TEST] Add test with calling constructor of type with aliased import 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
d9fe70f97c [FIR] Fix binding overrides with flexible types in arguments 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
3a7251a90b [FIR-TEST] Add test with problems in mapping getter name to property name 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
6f9e576502 [FIR-TEST] Add test with ambiguity on accidental override property 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
f43d77d422 [FIR-TEST] Move nestedClassConstructor test to problems test suite 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
2409a74fb5 [FIR-TEST] Add test for problem with += and java synthetic property 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
11063a25a8 [FIR] Replace FirEmptyDiagnostic with FirStubDiagnostic
FirStubDiagnostic hold reason from original diagnostic
It's useful in HTML fir dump
2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
ee20f88837 [FIR] Propagate smartcasts in safe calls chain 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
833648d8e0 [FIR] Fix smartcasts on receivers of implict invoke call 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
660bcce90a [FIR] Add smartcasts for reassigned vars 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
2a74e37e28 [FIR] Ignore expected type for resolve constant expressions 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
6a3c07688f Add print of detailed stack trace to NonFir modularized test 2019-11-14 18:33:46 +03:00
pyos
a235dd2891 IR: move defaultParameterDeclarationsCache access up one level
to avoid recomputing overriddenSymbols for fake overrides of default
stubs on repeated calls to generateDefaultsFunction.
2019-11-14 17:41:47 +03:00
pyos
70f09a7531 IR: make DefaultArgumentStubGenerator a few lines shorter 2019-11-14 17:41:47 +03:00
pyos
2b2dd097a3 IR: refactor DefaultParameterInjector 2019-11-14 17:41:47 +03:00
pyos
7a2715da44 IR: refactor generateDefaultsFunction
The check for whether a function needs a default stub should run fewer
times now, and in particular is no longer quadratic. Also, this fixes
a weirdness in that certain inheritance hierarchies would produce
a default stub that points to a non-stub through its overriddenSymbols
field.
2019-11-14 17:41:47 +03:00
pyos
29a14e2330 JVM_IR: resolve inline fake overrides before codegen
See KT-33054 and KT-29242.
2019-11-14 15:29:24 +01:00
Dmitriy Dolovov
1b2091d536 Fix: KLIB reading error on Windows
Issue #KT-34909
2019-11-14 20:37:43 +07:00
Ilya Goncharov
77950c5410 [Gradle, JS] Remove redundant from kotlin-test-js-runner 2019-11-14 16:03:54 +03:00
Ilya Goncharov
6a6bef0f6c [Debugger, JS] Remove kotlin source map support from tests and build 2019-11-14 15:53:18 +03:00
Ilya Goncharov
35cb412dc3 [Gradle, JS] Fix source map support initializing for mocha 2019-11-14 15:53:18 +03:00
Ilya Goncharov
4e427d2ce4 [Gradle, JS] Fix source map support initializing for nodejs 2019-11-14 15:53:18 +03:00
Ilya Goncharov
20e33806ec [Debugger, JS] Provide possibility to debug mocha tests 2019-11-14 15:53:18 +03:00
Igor Yakovlev
30b4622a45 Remove invalid unused reference 2019-11-14 14:54:44 +03:00
Sergey Rostov
c905bbca36 Scripting: invalidate caches on roots changes 2019-11-14 14:01:30 +03:00
Denis Zharkov
b0327964b7 Fix compilation on 183 and as34 2019-11-14 11:26:11 +03:00
Anatoly Nikitin
c7e9a6c5d9 Add new script dependency resolvers
Changes in new API for dependency resolvers (GenericDependenciesResolver) comparing to an old one (GenericResolver:
- Add ability to fast check whether artifact or repository is suitable for current resolver to distinguish between unsuitable resolvers and resolution failures
- Return all artifact resolution failures in ResultWithDiagnostics
- Use single string for artifact coordinates
- Add compound resolver that combines several resolvers
- Merge Direct and FlatLib resolver into single FileSystemDependencyResolver
- Mark resolve() method as suspend to indicate long operation
- Add credentials support for maven resolver (https://youtrack.jetbrains.com/issue/KT-27701)
2019-11-14 08:38:50 +01:00
Anatoly Nikitin
81e2e119e2 Fix propagation of dependency resolution failure reports during script compilation 2019-11-14 08:38:50 +01:00
Mikhael Bogdanov
744dfc6bf9 Minor. Pass proper timeout to logger 2019-11-14 08:32:36 +01:00
Mikhael Bogdanov
4281fd6bd5 Don't write nop for extension lambda during inline 2019-11-14 08:17:33 +01:00
Sergey Rostov
b757224df1 Scripting: invalidate caches on roots changes 2019-11-14 09:50:03 +03:00
Sergey Rostov
df0c250fd8 Scripting: fix lost caches clearing call 2019-11-14 09:50:03 +03:00
Sergey Rostov
542f21b701 Scripting, minor: cache firstScriptSdk 2019-11-14 09:50:03 +03:00
Vladimir Ilmov
ab3f9586b3 Suspend function calls highlighting added.
'If' highlighting fixed at settings sample area.

 #KT-27496 Fixed
2019-11-14 08:07:56 +03:00
Vladimir Ilmov
46423443e9 'it' parameter highlighting fixed for chain usage.
#KT-31037 Fixed
2019-11-14 08:07:56 +03:00
Alexander Udalov
fb9fb2e048 JVM IR: minor, remove obsolete code 2019-11-13 19:30:26 +01:00
Alexander Udalov
180e718752 JVM IR: minor, repurpose JvmBackendContext.getLocalClassInfo to store Type 2019-11-13 19:26:40 +01:00
Alexander Udalov
6be9101675 JVM IR: add jvmLocalClassExtractionPhase to lift out local classes from initializers
Otherwise a local class in a field initializer or anonymous init block
is copied into each constructor of the containing class (because
InitializersLowering calls deepCopy).

Since the code structure no longer resembles the original source code
here, record a custom EnclosingMethod mapping before moving such
classes, and use it in codegen.
2019-11-13 19:26:39 +01:00
Georgy Bronnikov
c5159d9cbe IR: Add UniqId to IrSymbol 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
1647279a8c IR: move UniqId to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
76016b1a3c IR: move KotlnMangler to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
92ebb092a2 JvmMangler 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
2f5442800b Move WrappedDescriptors to ir.tree module 2019-11-13 20:07:57 +03:00
igoriakovlev
cb11282183 Merge pull request #2516 from t-kameyama/KT-18539
KT-18539 Default implement fun/property text shouldn't contain scary comment
2019-11-13 19:33:44 +03:00
Sergey Igushkin
3429c07016 Fix Native dependencies not transformed when imported from a source set
Those were only transformed when imported from compilations, not
intermediate source sets. Ue the substitutor for source set dependencies
as well.

(minor) extract function for the Gradle module-qualified IDs
2019-11-13 17:45:31 +03:00
Sergey Igushkin
94f66c237b (minor) replace the predicate for intermediate source set
Use a condition that is safe in projects with just one target and
intermediate source sets.
2019-11-13 17:45:31 +03:00
Dmitry Savvinov
bcabbcf3e1 Add Native stdlib to intermediate source set dependencies
Also fix the dependsOn source set IDs not matcing those
in the IDE.
2019-11-13 17:45:25 +03:00
Igor Yakovlev
1ccda6a8d4 Add fast find usages for data class components
This commit add feature for disabling searching for data class ComponentN method and destruction declarations that could encrease usages search.
See KT-23278
2019-11-13 17:38:35 +03:00
Natalia Selezneva
6d9c00addd Do not add preparation task to project import if registry option is switched off 2019-11-13 15:18:31 +03:00
Mikhail Zarechenskiy
455b9f852d [NI] Disable caching of LHS expression types for "+=" operators
New behavior was introduced in ab506c1579 which breaks compilation on IDE module (see test example) for new inference.

 Now we temporarily disable this optimisation. This is temporarily restriction which will be fixed once we'll have the same rules for lambdas completion

 #KT-34889 Open
2019-11-13 15:07:39 +03:00
Kristoffer Andersen
4973baae4e [JVM IR] Fix JvmOverloads+Parameterless Main
Resolves the interaction of @JvmOverloads annotations and
parameterless main methods.

In the following code, both mechanisms generate methods that
ultimately produce the signature `public static void main(String[] args)`
of which there can be only one (true in general of any signature).

```
fun main() { }

@JvmOverloads
fun main(Array<String> args, x: Int = 42) { }
```

This PR simply shuffles the lowerings around, letting parameterless
main methods detect the presence of the default overload produced by
the annotation.

Additionally, this PR improves the testing of parameterless main
methods by actual bytecode patterns, and not simple check for
successful compilation (as @sfs and I discovered, there are issues in
flagging an error on duplicate signatures on the IR backend).
2019-11-13 13:03:14 +01:00
Sergey Rostov
b4185c9d47 ScriptClassRootsCache: load configuration if it is not cached 2019-11-13 12:39:02 +03:00
Sergey Rostov
a84e948051 Scripting: pass KtFile to ScriptConfigurationLoader 2019-11-13 12:39:02 +03:00
Pavel Kirpichenkov
9a231bbbfa Update trailing lambda quickfix, add tests
Case of incorrect call expression as the receiver of dot-qualified expression
was not handled properly.

Now the following order is used:
- If parent is a call expression or if this call is a receiver of parent
dot-qualified expression, parent must get last lambda as a new receiver;
- Otherwise, if parent is a dot-qualified expression, this call is in selector position.
Then grandparent is checked for being call or dot-qualified expression. If so, trailing
lambda must become grandparent's new receiver. If not, trailing nodes become standalone
epressions after parent.
- Otherwise, incorrect call expression is a standalone expression, so trailing nodes
may be lifted and put after it.
2019-11-13 11:00:01 +03:00
Pavel Kirpichenkov
f1934fa49d Amend "Terminate preceding call with semicolon" quickfix
Quickfix wasn't aware of cases, when expression to be fixed
 is a part of parent call expression or dot-qualified expression.
 Incorrect position for extracting trailing lambdas led to broken
 formatting.

 #KT-34694 Fixed
2019-11-13 11:00:01 +03:00
Denis Zharkov
0f638db3e5 FIR: Turn SupertypeSupplier into a class 2019-11-13 10:52:24 +03:00
Denis Zharkov
56b5d170eb FIR: Minor. Rename FirSupertypeResolverTransformerAdapter -> FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov
3a4f9e9109 FIR: Drop FirClassLikeDeclaration::supertypesComputationStatus
It became unused with rewritten supertype resolution
2019-11-13 10:52:24 +03:00
Denis Zharkov
2fba6b54a0 FIR: Minor. Drop old FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov
3f7bffa6fd FIR: Do not use FirClass::supertypesComputationStatus 2019-11-13 10:52:24 +03:00
Denis Zharkov
5e0e78e555 FIR: Rewrite supertype resolution 2019-11-13 10:52:24 +03:00
Toshiaki Kameyama
4d9b19da82 Remove comments from function/property implementation template
#KT-18539 Fixed
2019-11-13 08:37:25 +09:00
Alexander Udalov
9a55f418fa IR: extract StaticInitializersLowering out of InitializersLowering
And use it in JVM backend only. Also remove unneeded
`patchDeclarationParents` call.
2019-11-12 19:21:46 +01:00
Alexander Udalov
098561dd5f IR: cleanup InitializersLowering.kt 2019-11-12 19:19:03 +01:00
Alexander Udalov
9772de0088 JVM IR: generate kotlin.Metadata.packageName value for JvmPackageName files
Support this for single file facades as well as for multi-file classes,
similar to code in
MultifileClassCodegen.writeKotlinMultifileFacadeAnnotationIfNeeded.
Extend the test on this attribute to also cover multi-file classes.
2019-11-12 19:13:03 +01:00
Ilya Chernikov
808000e458 Implement warning when non-abstract classes containing abstract members invisible from that classes
#KT-27825 fixed
2019-11-12 19:08:53 +01:00
Dmitriy Novozhilov
eae3688c61 [FIR] Fix collecting approved data flow info from rhs of boolean operator 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
8d6cfdf0b1 [FIR] Fix passing data flow info from while loop condition 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
7ef13caa33 [FIR] Add test for ambiguity in nested class constructor call 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
e9551e2022 [FIR] Don't generate setter by delegate for vals 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
2f2aa4ae83 [FIR] Create error type instead of implicit type for incorrect functional types 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
cf61a6c30f [FIR] Add support of multiple condition branches to exhaustiveness checker 2019-11-12 21:03:53 +03:00
Roman Artemev
86570a2f91 [KLIB] Promote ABI version 2019-11-12 21:00:32 +03:00
Roman Artemev
63110ab636 [IR] Remove deprecated correspondingProperty from IrField 2019-11-12 20:45:11 +03:00
Roman Artemev
646df8d40a [IR BE] Get rid of descriptor usage in KCallable name property lowering 2019-11-12 20:45:11 +03:00
Roman Artemev
ec1c2eb42d [IR] Remove deprecated correspondingProperty from IrSimpleFunction 2019-11-12 20:45:11 +03:00
Roman Artemev
a343a57207 [IR] Refactor ir infrastructure
- Remove range-based uniq id indexes using to link built ins
 - Limit KotlinType usages, replace them with corresponding IrType
2019-11-12 20:45:11 +03:00
Roman Artemev
90d07eee53 [IR] Move wrapped descriptors from backend.common to ir.descriptors 2019-11-12 20:45:11 +03:00
Roman Artemev
ed79ab68ab [IR] Remove DeclarationDescriptor from IrExpression* tree API 2019-11-12 20:45:11 +03:00
Roman Artemev
d4fc7fcd96 [IR] Get rid of substituted descriptor from IrMemberAccessExpression interface 2019-11-12 20:45:11 +03:00
Roman Artemev
b391c066d6 [IR] Pass class Type Parameters into IrConstructorCall factory explicitly
to avoid unexpected crash on uninitialized parent in psi2ir phase
2019-11-12 20:45:11 +03:00
Roman Artemev
ba373c67d7 [IR] Remove FunctionDescriptor from IrCall-like node's constructor interface 2019-11-12 20:45:11 +03:00
Roman Artemev
bf367003f9 [IR] Make IrMemberAccessExpression be IrDeclarationReference 2019-11-12 20:45:10 +03:00
Roman Artemev
eee594101a [IR] Remove superQualifier property from IrCall 2019-11-12 20:45:10 +03:00
Ilmir Usmanov
ea5b529d19 Check default parameters of expect suspend functions on original
functions instead of function views.
 #KT-24461 Fixed
2019-11-12 20:12:37 +03:00
igoriakovlev
633d1c9ea3 Merge pull request #2773 from t-kameyama/KT-28607
KT-28607 Extract/Introduce variable fails if caret is just after expression
2019-11-12 19:13:56 +03:00
Svyatoslav Kuzmich
42c4591df8 [JS IR] Add -Xgenerate-dts CLI argument 2019-11-12 18:19:06 +03:00
Toshiaki Kameyama
e81fbe0a05 Folding: fold function with expression body (KT-6316)
#KT-6316 Fixed
2019-11-12 16:07:52 +03:00
Toshiaki Kameyama
58fb1dede3 Multiline string enter handler: do not insert 'trimIndent()' in const (KT-34785)
#KT-34785 Fixed
2019-11-12 16:07:52 +03:00
pyos
ce0fb662c0 JVM_IR: fold inline lambdas when computing OUTERCLASS
so that the enclosing method of objects defined inside lambdas is the
one they are declared in.

Note that this does not fix *all* enclosingInfo tests because JVM_IR
currently follows the KT-28064 proposal, i.e. does not regenerate
objects defined inside lambdas under any circumstances. For example,
this causes test boxInline/enclosingInfo/inlineChain2.kt to fail because
the enclosing method of objects is _2Kt.box instead of (non-existent in
source code) `_2Kt$box$inlined$call$1.invoke` or whatever. What's more
important is that OUTERCLASS no longer points to a non-existent
`box$lambda-N` and therefore `.enclosingMethod` no longer throws.
2019-11-12 12:44:46 +01:00
pyos
f906524d76 Mark a SAM conversion test as JVM-only 2019-11-12 12:24:55 +01:00
Mikhail Glukhikh
c66b6b6a3a FIR visibility check: support companion private members correctly 2019-11-12 11:24:31 +03:00
Mikhail Glukhikh
e96aeb77a6 FIR visibility check: support private class members 2019-11-12 11:24:25 +03:00
Mikhail Glukhikh
a5ad05083a Add some stubs for FIR visibility checking 2019-11-12 11:24:24 +03:00
Mikhail Glukhikh
7e07b88eab Code cleanup: FirCallResolver 2019-11-12 11:03:59 +03:00
Mikhail Glukhikh
ac13a8c8b2 Cone conflict resolver: extract JVM equivalent call filtering to a separate class 2019-11-12 11:03:58 +03:00
Mikhail Glukhikh
96c5003a13 Cone conflict resolver: filter equivalent top-level callables 2019-11-12 11:03:58 +03:00
Mark Punzalan
dc10d25661 Ensure ForLoopsLowering only handles the CharSequence.iterator()
extension function from the standard library (kotlin.text.iterator()).
2019-11-12 08:09:30 +01:00
Toshiaki Kameyama
d04f88ff66 Extract/Introduce variable: fix to work correctly if caret is before right parenthesis or comment
#KT-28607 Fixed
2019-11-12 12:03:16 +09:00
Simon Ogorodnik
1bd861c5eb Save use_ni key state to log 2019-11-11 20:32:07 +03:00
Alexander Udalov
57a674e9e6 Make fast class files reading mode default in compiler tests
This makes sense because this mode is the default in the production
compiler. Forgetting to enable it where necessary led to different
bizarre test failures, see for example changes around 3fee84b966 and
KT-34826
2019-11-11 15:40:49 +01:00
Mikhail Glukhikh
dde2d08cfc FIR resolve: add extra test for generic with bounds in Java 2019-11-11 17:07:58 +03:00
Mikhail Glukhikh
f66b2ca772 FIR resolve: add forgotten constraint subsystem from generic qualified access
This fixes exception in resolve of an attached test
2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
26281bfe89 FIR Java: use different names for anonymous parameters (p0, p1, p2, ...) 2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
c657d46437 FIR Java: add nullable (instead of not-null) type parameter bounds 2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
db11c14fee FIR Java: don't add type parameter bounds multiple times 2019-11-11 17:07:57 +03:00
Roman Golyshev
a18da68171 Remove redundant toList call in LazyJavaPackageScope 2019-11-11 16:01:23 +03:00
pyos
82fb5c4d19 JVM_IR: move lambda captures to end of signature when inlining
For example, a lambda `{ param -> captured }` of type `E.(T) -> U` will
be transformed by LocalDeclarationsLowering into a private static method

    fun f$lambda-0($this: E, $captured: U, param: T) = $captured

The reason for such an ordering is that a lambda looks the same as a
local function, and local function can have default arguments, and those
arguments can reference captured variables; thus, captured variables
must come before actual declared arguments.

However, this is not the order that the inliner wants. Moreover, since
it was written to handle lambdas represented as `invoke` methods of
anonymous objects, it does not expect the actual callable method to have
any parameters corresponding to captured variables at all. This results
in it attempting to generate a temporary node with descriptor

    (LE;LU;LT;LU;)LU;

while still using locals 1 and 2 as `param` and `$captured` respectively.
In the example above, this is not critical, as they both have reference
type and the lambda will eventually be pasted into a different node
anyway; however, if it happens that one of them is a primitive, or both
are primitives of different types, the bytecode will use incorrect
instructions, causing verification errors. The correct descriptor is

    (LE;LT;LU;)LU;
2019-11-11 13:46:42 +01:00
pyos
433e0e4740 JVM_IR: remember facade fqnames of imported classes
Necessary to support importing file classes annotated @JvmPackageName,
since the actual package fragment they are a part of has the name from
the `package` declaration.
2019-11-11 13:31:57 +01:00
Natalia Selezneva
42cb53a380 Always apply new script configuration in tests 2019-11-11 15:15:17 +03:00
Natalia Selezneva
423f1909fa Disable script configuration update in AbstractInspectionTest 2019-11-11 15:15:17 +03:00
Sergey Rostov
698d675efe Scripting: fix saving to file attributes 2019-11-11 15:15:17 +03:00
Sergey Rostov
05e8acffa7 Scripting: restore reports for applied configuration in case of previous error 2019-11-11 15:15:17 +03:00
Sergey Rostov
96b4ceb067 scripting: skip loading when reverting to applied configuration 2019-11-11 15:15:17 +03:00
Sergey Rostov
2499c42ac4 scripting: PsiModificationStamp add virtual file modification stamp 2019-11-11 15:15:17 +03:00
Sergey Rostov
789ad23e8d Minor: isScriptDependenciesUpdaterDisabled -> isScriptChangesNotifierDisabled 2019-11-11 15:15:17 +03:00
Sergey Rostov
61b17de625 Minor: change ScriptConfigurationCache.kt declarations order for better readability, more docs 2019-11-11 15:15:16 +03:00
Sergey Rostov
fbb2b260dd Split script configuration state into applied and loaded to make markUpToDate more clear 2019-11-11 15:15:16 +03:00
Natalia Selezneva
fde1d3fdf7 Wrap exceptions from external script configuration loader with error handling 2019-11-11 15:15:16 +03:00
Natalia Selezneva
56eb86b7c6 Remove KotlinGradleBuildScriptsResolver for IDEA < 191
In 191 there is no method to invoke model building after invocation of some task
2019-11-11 15:15:16 +03:00
Natalia Selezneva
2a22cc23e9 KotlinGradleBuildScriptsResolver: update to new API from IDEA Gradle plugin 2019-11-11 15:15:16 +03:00
Natalia Selezneva
8bb6cf81c5 Extract logic common for different platforms to simplify bunch process 2019-11-11 15:15:16 +03:00
Sergey Rostov
e2928550ca Fix retrieving virtual file 2019-11-11 15:15:16 +03:00
Sergey Rostov
9105e38041 Mark not applied configuration as up-to-date, simplify concurrency handling 2019-11-11 15:15:16 +03:00
Sergey Rostov
0422abdb7b LoadedScriptConfiguration and CachedConfigurationSnapshot are merged to ScriptConfigurationSnapshot 2019-11-11 15:15:15 +03:00
Sergey Rostov
a89ce4c590 BackgroundExecutor: cancel all tasks on user cancel, remove useless updateProgress call 2019-11-11 15:15:15 +03:00
Sergey Rostov
19d35d7f27 Implement Gradle specific behavior for script configuration update logic
We have plans to extract separate implementation for Gradle scripts, but it
would be better to support something at this point.
For now, we have custom listener, loader and up-to-date check for default configuration manager:
- listener will do forced reload on editor activation, even it is already up-to-date
this is required for Gradle scripts, since it's classpath may depend on other files (`.properties` for example)
- loader will force save failures before running loader. also it will skip loading if
`kotlin.gradle.scripts.useIdeaProjectImport` registry key is enabled
- loader will return inputs with overridden up-to-date checks: file will be considered
out-of-date only when `buildscript` or `plugins` blocks are changed
2019-11-11 15:15:15 +03:00
Natalia Selezneva
548e8e27dc Minor: rename parameter 2019-11-11 15:15:15 +03:00
Natalia Selezneva
f0053ee34c Minor: use properties instead of string constants 2019-11-11 15:15:15 +03:00
Sergey Rostov
9d2cc484aa ide, scripting: rework script configuration caching, introduce persistent fs cache
## Simplify ScriptConfigurationManager mental model
Everything related to cache managing moved to `org.jetbrains.kotlin.idea.core.script.configuration`.
DefaultScriptConfigurationManager slitted into:
- `AbstractScriptConfigurationManager`
- `DefaultScriptConfigurationManager`
- `ScriptClassRootsCache`
The main idea is to simplify the mental model of ScriptConfigurationManager.
Concrete implementation should provide just two things:
- `createCache(): ScriptConfigurationCache` that should return cache implementation with `get` and `set` methods
- `reloadOutOfDateConfiguration(...)` will be called on [cache] miss or when [file] is changed.

Implementation should initiate loading of [file]'s script configuration and call [saveChangedConfiguration]
immediately or in some future (e.g. after user will click "apply context" or/and configuration will be
calculated by some background thread).
Everything around it is implemented in `AbstractScriptConfigurationManager`.

`ScriptClassRootsCache` is extracted from `DefaultScriptConfigurationManager`:
this simplifies `AbstractScriptConfigurationManager`
Also it simplifies ScriptClassRootsCache reset: we can just drop old `ScriptClassRootsCache`
and create new one instead of resetting all internals of `ScriptClassRootsCache`.
Please see KDoc of these classes for more details:
- AbstractScriptConfigurationManager
- DefaultScriptConfigurationManager
- ScriptClassRootsCache

## Cache and up-to-date checks
Writer should put related inputs snapshot for loaded configuration.
This allows reader make up-to-date check for existed entry to avoid starting loading
process for same inputs.
Cache entry may be marked out-of-date.
Also it can be marked up-to-date, but it means that we have up-to-date loaded configuration,
ScriptConfigurationSnapshot.configuration will still contain old applied configuration.
todo: make it more clear by splitting cache entry into loaded and applied configuration with
it's own inputs.

## Loaders
Previously both sync and background loaders may be started for same files - this was useful, but not
required anymore and at the same time greatly complicates the model. So, it was dropped
and now exactly one loader should work for given file (first applicable loader will be called).
Also `ScriptConfigurationLoadingContext` is introduced to limit access to the `ScriptConfigurationManager`
internals.

## Listeners and updating configuration
This things is introduces:
- `ScriptChangesNotifier`
- `ScriptChangeListener`
- `ScriptConfigurationUpdater`
`ScriptChangesNotifier` will call first applicable `ScriptChangeListener` when editor is activated or document changed.
(it treated as applicable if [editorActivated] or [documentChanged] will return true).
Listener may call [ScriptConfigurationUpdater] to invalidate configuration and schedule reloading.
Plugins may override default listening logic by adding it's oven `ScriptChangeListener`.
`ScriptConfigurationUpdater` was extracted from `ScriptConfigurationManagerImpl`.

## Fixed issues and implement persistent FS cache
- Script configuration was not reloaded if query for same file already in progress or ready but not yet applied
- Don't start async loaders for outsider files
- Unused imports: don't start loading script configuration if the result will be not applied automatically
- Fix cases when virtual file can be null

See `DefaultScriptConfigurationManager.reloadOutOfDateConfiguration` KDoc for more details on
dealing with concurrent operations.

## Background executor and progress indicator
This things changed and fixed:
- progress displayed not only when we have more then 3 loading tasks, but also
after 1sec of loading (including case with 1 loading task for example)
- current file is displayed under the progress bar
- progress indication added: it works similar to indexing indicator. When
progress bar is displayed, max is fixed. When all work done for this max,
progress will be started from zero and new max is fixed, and so on
- cancel will drop all loading operation, not just current
- concurrency issues fixed: EA-5244265 and other related to switching between silent and
under progress worker
See `BackgroundExecutor` for more details.

## Gradle specific behavior
We have plans to extract separate implementation for Gradle scripts, but it
would be better to support something at this point.
For now, we have custom listener, loader and up-to-date check for default configuration manager:
- listener will do forced reload on editor activation, even it is already up-to-date
this is required for Gradle scripts, since it's classpath may depend on other files (`.properties` for example)
- loader will force save fails before running loader. also it will skip loading if
`kotlin.gradle.scripts.useIdeaProjectImport` registry key is enabled
- loader will return inputs with overridden up-to-date checks: file will be considered
out-of-date only when `buildscript` or `plugins` blocks are changed
2019-11-11 15:15:15 +03:00
Natalia Selezneva
915c9c367c Minor: rename script related classes 2019-11-11 15:15:15 +03:00
Natalia Selezneva
33475f30bc Minor: move files 2019-11-11 15:15:15 +03:00
Sergey Rostov
9f3c2d0292 build.gradle.kts: import script dependencies on Gradle Project sync 2019-11-11 15:15:14 +03:00
Alexander Udalov
de54e549af Refactor CHECK_BYTECODE_LISTING directive for JVM IR tests
Create a separate _ir.txt bytecode listing file for JVM IR, to avoid
duplicate tests and to fix "Codegent tests on different JDKs"
configuration where this test is muted but passes because only execution
is checked there, not bytecode listing.
2019-11-11 12:10:31 +01:00
Alexander Udalov
ce09be3f59 Add TargetBackend.isIR, simplify JVM IR test configuration 2019-11-11 12:10:29 +01:00
Vladimir Ilmov
ab65a6bc6c Build fix, tests regenerated 2019-11-11 12:34:58 +03:00
Sergey Bogolepov
608885d118 [Linker] Extend KotlinIrLinker infrastructure to support libraries that
doesn't contain IR. Also bump ABI version because of addition of `ir_provider` property
2019-11-11 15:55:36 +07:00
Kirill Shmakov
5629627cca Mobile MPP: Initialize Mobile MPP plugin 2019-11-11 11:20:37 +03:00
Yan Zhulanow
f3770314c5 Pill: Fix reflect dependency in compiler/fir.resolve module 2019-11-11 17:13:58 +09:00
Yan Zhulanow
ef8b3cb72a Prefer Kotlin Junit test run configurations when possible (KT-33787) 2019-11-11 17:13:58 +09:00
Yan Zhulanow
987307cf92 Prefer Kotlin Gradle test run configurations when possible (KT-33787) 2019-11-11 17:13:58 +09:00
Vladimir Ilmov
214810ca01 Suspend test removed. Will be added later as part of appropriate ticket. 2019-11-11 00:57:52 +03:00
Dmitriy Novozhilov
0c190f6040 Enable -Xuse-mixed-named-arguments feature for compiler project 2019-11-10 11:46:22 +03:00
Dmitriy Novozhilov
be4ae5d7ba Upgrade kotlin version in gradle configuration testdata 2019-11-10 11:46:22 +03:00
Dmitriy Novozhilov
d485ea44e8 Update bootstrap version 2019-11-10 11:45:59 +03:00
Vadim Brilyantov
ba77e5eba8 #KT-29622: Fix bunches for 191 and earlier idea versions 2019-11-09 16:44:12 +03:00
Vadim Brilyantov
66eeeb4705 Add Focus Mode support to kotlin language 2019-11-09 16:44:10 +03:00
Alexander Udalov
f7ef16d2d5 Regenerate tests
This fixes project compilation after incorrect merge of
da4097f4/e89a87b2 and 4ed64b02
2019-11-09 00:42:10 +01:00
Alexander Udalov
f9b66d57cf Fix test data for -Xuse-mixed-named-arguments
Remove incorrect jar clash warning and avoid unrelated unused parameter
warnings
2019-11-08 20:52:22 +01:00
Alexander Udalov
228fdb4436 Don't optimize null checks for unsafe primitive type boxes as well
#KT-34829 Fixed
2019-11-08 18:54:33 +01:00
Steven Schäfer
b80e157381 JVM, JVM IR: Don't optimize null-checks based on nullability information
Since Java interop allows us to circumvent the Kotlin type system we
cannot rely on nullability information.
2019-11-08 18:28:07 +01:00
Alexander Udalov
de082543f1 Minor, ignore another test with java.util.function on JDK 6 2019-11-08 17:50:10 +01:00
Alexander Udalov
9b3e64257f Minor, ignore test with java.util.function on JDK 6 2019-11-08 17:46:43 +01:00
Roman Golyshev
e89a87b2e3 KT-29926: Support completion of suspend lambda body and parameters
- ^KT-29926 Fixed
2019-11-08 19:24:05 +03:00
Roman Golyshev
da4097f488 KT-29926: Support completion of suspend lambda parameters in the body
- `suspendLambdaSignature` directory is just a copy of `lambdaSignature`
2019-11-08 19:24:05 +03:00
Roman Golyshev
84b9044187 KT-29926: Get rid of filterFunctionExpected
- `filterFunctionExpected` does not provide meaningful concept, and will be a problem in the next steps on this issue.
- Refactor `SmartCompletionSession::descriptorKindFilter` to more precisely tell why we include references to constructors if we are completion functions
2019-11-08 19:24:05 +03:00
Vladimir Ilmov
e2b91cfec7 Properties with custom property declarations highlighting rule.
Added support for package and class-level properties with custom PD.
Java syntethic extensions are ignored from this rule.

 #KT-30806 Fixed
2019-11-08 17:58:49 +03:00
Dmitriy Dolovov
bf37572b93 Offload heavy part of KotlinNativeABICompatibilityChecker to non-EDT thread pool
Issue #KT-34814
2019-11-08 17:12:57 +03:00
Dmitriy Dolovov
d97aeb9fe0 Build KotlinNativeABICompatibilityChecker notifications in a separate function
Issue #KT-34814
2019-11-08 17:12:52 +03:00
Nikolay Krasko
526e7e463b Mute flaky failure in KotlinGotoImplementationMultiModuleTestGenerated in 193 2019-11-08 16:34:20 +03:00
Nikolay Krasko
ce1e57d798 Mute IdeReplCompletionTestGenerated tests in 193 (KT-34825) 2019-11-08 16:34:19 +03:00
Mikhail Glukhikh
93aba85f51 Fix FIR built-ins test 2019-11-08 15:54:21 +03:00
Dmitriy Novozhilov
5313c964c6 [FIR] Fix SOF in fir consistency checker 2019-11-08 15:30:55 +03:00
Dmitriy Novozhilov
bc453e5917 [FIR] Fix testdata forgotten in e910653d 2019-11-08 15:30:55 +03:00
Dmitriy Novozhilov
e6b005a7dc Disable -Xuse-mixed-named-arguments feature for compiler project 2019-11-08 15:30:50 +03:00
Dmitriy Novozhilov
45523a5767 Fix -Xuse-mixed-named-arguments compiler arg 2019-11-08 15:30:04 +03:00
Kristoffer Andersen
8561f08f06 [JVM_IR] Reintroduce non-IEEE comparisons
- Ieee754Equality and PrimitiveComparisons intrinsics
  respects absence of -Xproper-ieee754-comparisons, unmuted tests to
  show.
2019-11-08 12:58:31 +01:00
Alexander Udalov
0675b54e11 Minor, add regression test for KT-34766 2019-11-08 12:29:08 +01:00
Roman Artemev
ea543eac13 [IC KLIB] Fix after rebase 2019-11-08 14:14:59 +03:00
Roman Artemev
3e3cb8734b [IC] Unmute IC klib tests 2019-11-08 14:14:59 +03:00
Roman Artemev
b11d69b719 [IC] Temporary restore removed method to fix proto comparison tests 2019-11-08 14:14:59 +03:00
Roman Artemev
a91ed694bf [IC KLIB] Use new klib argument 2019-11-08 14:14:59 +03:00
Alexey Tsvetkov
eb5e954e2a Minor: adjust formatting 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
d776e92111 Use Klib JS serializer protocol for IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
6e9cd85b54 Exclude some proto messages from proto comparison in IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
ac9b7fa268 Exclude some proto fields from proto comparison in IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
28e6219b0b Fix proto comparison for fields mapped to type table 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
c694752b4f Generate Klib JS extensions for proto comparison 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
83f060ad3e Minor: add functions to distinguish initial and incremental builds when debugging IC tests 2019-11-08 14:14:57 +03:00
Alexey Tsvetkov
537199e0fa Minor: replace UsefulTestCase with KtUsefulTestCase
UsefulTestCase does not resolve in IDE for some reason
2019-11-08 14:14:57 +03:00
Roman Artemev
72c4be785d [JS IR] Add proper extension point in FE to customize incremental data loading
- fix IC klib
2019-11-08 14:14:57 +03:00
Alexander Gorshenev
21c436c64c Klib metadata cached package fragment and package fragment provider 2019-11-08 14:14:57 +03:00
Roman Artemev
1bced5d2a2 [KLIB IC] Fix file index allocation, make them stable between recompilations 2019-11-08 14:14:57 +03:00
Steven Schäfer
ab506c1579 Frontend: Avoid retypechecking the right hand side of assignment operators 2019-11-08 14:02:56 +03:00
Mikhail Glukhikh
41c81d25a0 FIR body resolve: use nested classifier scopes only via member scopes 2019-11-08 13:42:42 +03:00
Mikhail Glukhikh
f0130d0460 FIR (minor): remove unnecessary withScopeCleanup call 2019-11-08 13:39:45 +03:00
Mikhael Bogdanov
cf15359079 Decrease number of forked test processes on local machine
There are no any benefits in execution time
2019-11-08 11:32:30 +01:00
Steven Schäfer
7c9578116b JVM IR: Fix types in LateInitLowering
On the JVM backend the throwUninitializedPropertyAccessException
function is implemented in Java and has a return type of Unit instead of
Nothing. In order to make the types match up we have to wrap its call in
a block with an additional IrThrow.
2019-11-08 11:20:43 +01:00
Dmitriy Novozhilov
3ee013aac6 Change compiler flag for enabling mixed named argumetns in compiler project
It's neccessary to avoid useless warnings until build
2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
5b1cc7d8d5 Update bootstrap version 2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
e910653d6f [FIR] Add pretty rendering of functional types 2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
18dc652404 [FIR] Get rid of operation in FirVariableAssignment
`FirVariableAssignment` is creates only for expressions `x = y`
For other assign operators there is a `FirOperatorCall`
2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
b5210e6a9b [FIR] Fix building fir for += with complex rhs
Also fix choosing candidate for assignment operator call
2019-11-08 12:12:38 +03:00
Dmitriy Novozhilov
cadc2dfe4d [FIR] Fix generating fir for invoke calls 2019-11-08 12:12:38 +03:00
Pavel Kirpichenkov
ff32eab3d1 [NI] Run call checkers on resolved calls for callable references
#KT-34391 Fixed
2019-11-08 11:04:43 +03:00
Mark Punzalan
f444702cf3 JVM: Always invoke get()/charAt() in optimized for-loop over
CharSequence.withIndex(), even if element variable is unused in
destructuring declaration.

#KT-34779 Fixed
2019-11-08 10:55:09 +03:00
Mikhail Glukhikh
411dc5d60e FIR nested classifier scope building: optimize companion search 2019-11-08 09:58:37 +03:00
Mikhail Glukhikh
48938a20a7 Raw FIR: add synthesized Enum.valueOf() function 2019-11-08 09:58:02 +03:00
Alexander Udalov
1978db9d0e Move codegen tests on old language versions under oldLanguageVersions/
This directory is skipped in JVM IR test generator, so they won't show
up as failed anymore.

Note that only failing tests are moved to oldLanguageVersions/. Tests
which already pass are still being run. It may be useful not to break
them in case we _do_ need to support some pre-1.3 language feature
switches in JVM IR.
2019-11-07 19:05:24 +01:00
Alexander Udalov
c3729c8189 Reorganize codegen tests for old language versions
Put all files under a single "oldLanguageVersions" directory under test
data of each test
2019-11-07 18:49:27 +01:00
Steven Schäfer
dcd72b06d8 JVM IR: Implement CHECK_NOT_NULL as a lowering 2019-11-07 18:47:53 +01:00
Nikolay Krasko
ea6c43dabd Mute inline testMultipleInExpression because of unstable order of usages in 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
fe9c5cac45 Fix TypedHandlerTest in 193
Unify TypedHandlerTest.kt with the KotlinLightCodeInsightTestCase
2019-11-07 20:23:29 +03:00
Nikolay Krasko
f6bdaf992e Fix jps build in buildSrc by explicitly using mutable set 2019-11-07 20:23:29 +03:00
Nikolay Krasko
c053bd213a Don't assert order of todo items to fix platform update to 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
b2a61eb5e6 Additional mute for IdeReplCompletionTestGenerated.testFunctions in 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
2aa251fd0c Remove deprecated API from InlayScratchFileRenderer 2019-11-07 20:23:28 +03:00
Vladimir Ilmov
9fb95e776e [HIGHLIGHT] Specific keyword rules for val,var highlighting.
'Kotlin keyword' rule configured as fallback rule for all Kotlin keywords:
- Created 'var'/'val' rules with fallback to 'Kotlin keyword'
- BUILTIN_ANNOTATION rule fallback changed from Java to 'Kotlin keyword'

 #KT-13344 Fixed
2019-11-07 18:48:59 +03:00
Dmitriy Dolovov
34ea47a868 Extract Konan Gradle model into a separate JAR file 2019-11-07 18:25:35 +03:00
pyos
fb9f43c119 JVM_IR: fix load check in inliner (should accept primitives too) 2019-11-07 15:58:44 +01:00
Alexander Udalov
4164b620e8 Minor, remove obsolete directives and suppressions from contracts test data 2019-11-07 15:20:34 +01:00
Alexander Udalov
66e19b13ce IR: create shared variables for val-variables when needed
This is possible when a lambda's contract guarantees initialization of a
variable.
2019-11-07 15:20:34 +01:00
Igor Chevdar
5c4b47c336 [native-gradle-plugin] Disabled native daemon for tests for now 2019-11-07 17:01:18 +03:00
Igor Chevdar
83331a0afb [native-gradle-plugin] Test fix 2019-11-07 17:00:59 +03:00
Igor Chevdar
ecb001d5db Bumped K/N version 2019-11-07 17:00:03 +03:00
Igor Chevdar
d36effd725 [native-gradle-plugin] Run konan directly from the gradle process 2019-11-07 17:00:03 +03:00
Nikolay Krasko
d755002ac4 Advance bootstrap to 1.3.70-dev-1231 2019-11-07 16:24:13 +03:00
Nikolay Krasko
0ea64c8d4b Avoid using js dist library during jps build as it absent in bootstrap 2019-11-07 16:24:13 +03:00
Nikolay Krasko
155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Steven Schäfer
181d023e3c JVM IR: Remove JvmBackendContext.getTopLevelClass 2019-11-07 13:48:43 +01:00
Steven Schäfer
1ac753602e JVM IR: Avoid getTopLevelClass in CollectionStubMethodLowering 2019-11-07 13:48:43 +01:00
Steven Schäfer
f9ff3771e5 JVM IR: Avoid getTopLevelClass in AddContinuationLowering 2019-11-07 13:48:43 +01:00
Steven Schäfer
481d4d72b9 JVM IR: Avoid getTopLevelClass in JvmSymbols 2019-11-07 13:48:43 +01:00
Mark Punzalan
d0c261c779 Ensure the correct functions (with correct params) are being used in
ForLoopsLowering.
2019-11-07 13:43:24 +01:00
Mark Punzalan
21178a4f1a Fix issue getting the size property from Collection bounded type
parameters, when lowering for-loops over Collection.indices.
2019-11-07 13:43:24 +01:00
Mikhail Glukhikh
30679ebfaf FIR Java: implement correct type matching in SuperTypeScope 2019-11-07 15:07:41 +03:00
Ilya Kirillov
7fffd3d0f2 Fix using method removed from 193 in old J2K 2019-11-07 14:59:08 +03:00
Toshiaki Kameyama
39db76b2ab "Indent raw string" intention: do not suggest in const
#KT-34784 Fixed
2019-11-07 14:57:56 +03:00
Georgy Bronnikov
688a2185fa Tests for Kapt3 with JVM_IR backend 2019-11-07 13:28:09 +03:00
Mikhail Glukhikh
4d9839a790 JavaClassUseSiteMemberScope: add mutable vs non-mutable type matching 2019-11-07 13:08:38 +03:00
Dmitriy Novozhilov
61c337588b Revert testdata accidentally committed in 665405c4 2019-11-07 10:41:15 +03:00
Dmitriy Novozhilov
4f8a8f84ba [FIR] Update some testdata in fir visualizer test 2019-11-07 10:39:22 +03:00
Dmitriy Novozhilov
abf41f87a1 [FIR] Fix rendering of local variables in Visualizer 2019-11-07 10:39:21 +03:00
Dmitriy Novozhilov
f0ba9c3c40 [FIR] Make file separator in AbstractVisualizer OS independent 2019-11-07 10:39:21 +03:00
Mikhail Glukhikh
581504aac5 Raw FIR: add synthesized Enum.values() function #KT-24076 Fixed 2019-11-07 09:29:00 +03:00
Mikhail Glukhikh
6e0148c7a8 FIR: cleanup of DataClassUtils: remove redundant status field assignments 2019-11-07 09:28:16 +03:00
Leonid Startsev
3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00
Leonid Startsev
24688f3503 Do not disable 'redundant visibility modifier' inspection completely in Explicit API mode.
Instead, disable it only for effectively public declarations.

Add tests for this IDE inspection.
2019-11-06 19:54:00 +03:00
Leonid Startsev
5ab262c977 Skip explicit API inspection for data class properties and add inspection for public API in interfaces
Add tests for almost all the cases
2019-11-06 19:54:00 +03:00
Leonid Startsev
ebb7e434c8 Explicit Api mode: Renamings after design discussions
Change CLI flag to -Xexplicit-api=strict|warning. 'Disable' state and 'mode' suffix are left out as implementation details.

Change intention title to 'make X public explicitly'

Do not report 'no explicit visibility' on property accessors

Set DECLARATION_SIGNATURE as a range for report

Rename internal diagnostic from _MIGRATION to _WARNING
2019-11-06 19:53:59 +03:00
Leonid Startsev
7fada51c42 Add quickfix for setting explicit public visibility for diagnostic reported in API mode 2019-11-06 19:53:59 +03:00
Leonid Startsev
2b708093c0 Add explicit return type check for API mode
It will use the same SpecifyTypeExplicitlyIntention as in other places; to reuse check logic, some parts of code were moved from corresponding inspection (PublicApiImplicitTypeInspection) into ApiModeDeclarationChecker.

Also disable RedundantVisibilityModifierInspection when API mode is on.
2019-11-06 19:53:58 +03:00
Leonid Startsev
7058492b55 Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
2019-11-06 19:53:58 +03:00
Alexander Udalov
a7d60fbf2d JVM IR: minor, fix IR builder scope for multifile bridges 2019-11-06 17:05:49 +01:00
Alexander Udalov
7a2c467bb5 JVM IR: remove obsolete hack in JvmMultifileClass facade generation 2019-11-06 17:05:49 +01:00
pyos
5d8aac456f JVM_IR: create temporaries for complex super constructor arguments
As for SAM wrappers, the bytecode sequence

    new A
    dup
    new B
    dup
    invokespecial B.<init>
    invokespecial A.<init>

breaks the inliner, so instead we do

    new B
    dup
    invokespecial B.<init>
    store x
    new A
    dup
    load x
    invokespecial A.<init>
2019-11-06 15:54:40 +01:00
pyos
42f75b3247 JVM_IR: have SAM wrapper constructors accept FunctionN
Otherwise, the cached instances cannot be reused for different wrapped
types. Also, if the wrapped type is regenerated during inlining, the
inliner would produce a call to a nonexistent constructor that takes the
regenerated type as an argument.
2019-11-06 15:54:40 +01:00
pyos
862197d713 JVM_IR: create temporaries for complex SAM conversion arguments
To avoid bytecode sequences like

    new _1Kt$sam$i$java_lang_Runnable$0
    dup
    new _1Kt$f$1
    dup
    invokespecial _1Kt$f$1.<init>()V
    invokespecial _1Kt$sam$i$java_lang_Runnable$0.<init>(...)V

as the different order of `new` and `<init>` confuses the inliner.
2019-11-06 15:54:40 +01:00
Mikhail Zarechenskiy
650e2501bb [NI] Prioritize variables with trivial constraints over complex ones
Consider the following constraint system (from the test example):

Nothing? <: V1
F!! <: V2
Inv<V1> <: S
Inv<V2> <: S

Where V1, V2, S are type variables, and F has nullable upper bound.
Type variable fixation order should be: V2 -> V1 -> S, and the problem
was that previously after fixation of type variable V2 we were trying
to fix S (before V1), so we had the following constraints on S:
Inv<F!!> <: S
Inv<V1> <: S
=> S were fixed to Inv<F!!>

And after this V1 was fixed to F!! which is contradictory as Nothing?
is not a subtype of F!!.

 #KT-33033 Fixed
2019-11-06 15:20:17 +03:00
Mikhail Zarechenskiy
5582fd4056 [NI] Discard DefNotNull types inside invariant positions
#KT-30297 Fixed
 #KT-32168 Fixed
 #KT-27722 Fixed (actually, it was fixed with addition of DefNotNullTypes, and now test was added to save this behavior)
 #KT-32345 Fixed
2019-11-06 15:20:17 +03:00
pyos
4fc1bd9ec5 Support inlining functions with KT-28064 style objects
Namely, anonymous objects defined in lambdas that have all captured
variables as loose fields instead of a single reference to the parent.

The question is, when a lambda inside an inline function defines an
anonymous object, and that object is not regenerated during codegen for
the inline function itself, but then has to be regenerated at call site
anyway, do we use an outer `this` or loose capture fields? For example,
before KT-28064:

    inline fun f1(g: () -> Unit) = object { g() }
    // -> f1$1 { $g: () -> Unit }
    inline fun f2(g: () -> Unit) = f1 { object { g() } }
    // -> f2$$inlined$f1$1 { $g: () -> Unit }
    //    f2$$inlined$f1$1$lambda$1 { this$0: f2$$inlined$f1$1 }
    inline fun f3(g: () -> Unit) = f2 { object { g() } }
    // -> f3$$inlined$f2$1 { $g: () -> Unit }
    //    f3$$inlined$f2$1$1 { this$0: f3$$inlined$f2$1 }
    //    f3$$inlined$f2$1$1$lambda$1 { this$0: f3$$inlined$f2$1$1 }

After KT-28064:

    inline fun f2(g: () -> Unit) = f1 { object { g() } }
    // -> f2$$inlined$f1$1 { $g: () -> Unit }
    //    f2$1$1 { $g: () -> Unit }
    inline fun f3(g: () -> Unit) = f2 { object { g() } }
    // -> f3$$inlined$f2$1 { $g: () -> Unit }
    //    f3$$inlined$f2$2 { ??? }
    //    f3$1$1 { $g: () -> Unit }

Should `???` be `this$0: f3$$inlined$f2$1` or `$g: () -> Unit`? This
commit chooses the latter for KT-28064 bytecode and keeps `this$0` when
inlining the old bytecode.
2019-11-06 13:11:44 +01:00
Dmitriy Novozhilov
27e1a54d4e [FIR] Add descriptors.runtime as dependency to psi2fir test 2019-11-06 15:05:06 +03:00
Dmitriy Novozhilov
665405c435 [FIR] Add discriminating generics into ConeOverloadConflictResolver 2019-11-06 15:05:06 +03:00
Mikhail Zarechenskiy
86a8412b05 Don't try loading PSI tree in IDE mode via stubs (e.g. decompiled code)
Here we want getting trailing comma in order to check its correctness
  and then to report diagnostics. Now, note that if we have stub for
  some PSI element, it means that we're definitely not in the compiler as
  there are no stubs and we're definitely not in the current source file,
  because in the current file we have full PSI tree in IDE.

  Stubs are required, for example, for decompiled code and there is no
  need to report any diagnostics about trailing comma there.

  Also, because we don't have stubs for destructuring declarations,
  one check for trailing commas is left without similar guard (
  see resolveLocalVariablesFromDestructuringDeclaration method)

  This commit fixes several IDE-tests:
   MultiFileJvmBasicCompletionTestGenerated.testDoNotCompleteWithConstraints
   MultiFileJvmBasicCompletionTestGenerated.testInImport
   MultiFileJvmBasicCompletionTestGenerated.testInImportedFunctionLiteralParameter
   MultiFileJvmBasicCompletionTestGenerated.testMoreSpecificExtensionGeneric
   MultiFileJvmBasicCompletionTestGenerated.testNoGenericFunDuplication
   MultiFileJvmBasicCompletionTestGenerated.testNotImportedExtensionFunction2
2019-11-06 14:32:09 +03:00
Mikhail Glukhikh
aff9ae2ecf FIR resolve bench: collect unique problems also from callee, ignore empty problems 2019-11-06 14:04:24 +03:00
Mikhail Glukhikh
bd1127cfa3 FIR: resolve lambda arguments even if an outer call is unresolved 2019-11-06 13:19:20 +03:00
Mikhail Glukhikh
3b4edb3901 Don't recreate FirSpecificTypeResolverTransformer during type resolve stage 2019-11-06 13:19:20 +03:00
Mikhail Glukhikh
3dd3421437 Temporary: resolve type to kotlin/reflect/Function instead of kotlin/Function
This arises in callable reference resolve test due to incorrect fictitious symbols caching
2019-11-06 13:19:19 +03:00
Mikhail Glukhikh
60e6d2e521 Resolve local declaration statuses & types inside bodies in FirBodyResolveTransformer 2019-11-06 13:19:10 +03:00
Mikhail Glukhikh
668a2a58be FIR: switch off body visiting in status & type resolve transformers (breaks many tests) 2019-11-06 13:19:09 +03:00
Mikhail Glukhikh
d6daf321a2 FIR: render implicit built-in type references as resolved ones 2019-11-06 13:19:08 +03:00
Alexander Udalov
7f4b568021 Mark new KClass.cast/safeCast extensions as low-priority
To avoid overload resolution ambiguity error in sources where everything
from both kotlin.reflect and kotlin.reflect.full is imported with a
star-import
2019-11-05 19:34:06 +01:00
Nikolay Krasko
3c7b0e6ccc Fix gradle runtime dependency issue for completion-ranking-kotlin library
Execution failed for task ':idea:idea-test-framework:test'.
> Could not resolve all files for configuration ':idea:idea-test-framework:testRuntimeClasspath'.
   > Could not find org.jetbrains.intellij.deps.completion:completion-ranking-kotlin:0.0.2.
...
        Required by:
            project :idea:idea-test-framework > project :idea

It looks like when resolving this dependency gradle doesn't check the list of repositories in :idea module.
2019-11-05 20:13:30 +03:00
Nikolay Krasko
279deb3a78 Mention navigation fails asserts in 193 in common file (KT-34542) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
5ca3698d13 Remute JoinLinesTestGenerated tests in 193 (KT-34408) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
651a70ae54 Remute MultiLineStringIndentTestGenerated tests in 193 (KT-34566) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
c50e60f90f More mutes for 193 branch
One more test for KT-34689.
2019-11-05 20:13:30 +03:00
Nikolay Krasko
5d19b2c3c4 Allow to mute tests with spaces in names 2019-11-05 20:13:30 +03:00
Alexander Podkhalyuzin
e3c6a1fbd8 Updating progress for optimize imports
#KT-33905 Fixed
2019-11-05 18:10:06 +03:00
Alexander Podkhalyuzin
d2ae39489f SmartPointers in Smart Completion for anonymous object generation
#KT-32615 Fixed
2019-11-05 17:51:34 +03:00
Dmitry Gridin
d321f4626f Formatter: fix line break before OperationReference in elvis
#KT-22362 Fixed
2019-11-05 20:13:11 +07:00
Dmitry Gridin
247619c565 Formatter: fix line break between label and property
#KT-22273 Fixed
2019-11-05 20:13:11 +07:00
Dmitry Gridin
7f1935b82e formatter: cleanup code 2019-11-05 20:13:11 +07:00
Dmitry Gridin
0098588a6b NodeIndentStrategy: remove code duplication 2019-11-05 20:13:11 +07:00
Dmitry Gridin
196dd25637 ProjectCodeStyleImporter: fix deprecated elements 2019-11-05 20:13:11 +07:00
Mark Punzalan
f2289c216c Fix type of IllegalArgumentException call for illegal step in StepHandler. 2019-11-05 14:04:56 +01:00
Dmitriy Novozhilov
ca4784ffd3 Fix CLI testdata broken in 7f58162a 2019-11-05 15:41:35 +03:00
Dmitriy Novozhilov
c58ca27b2e [FIR] Introduce ResolutionMode as data for body resolve instead of Any? 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
7f58162abc Add -Xuse-mixed-named-arguments compiler flag
That flags enables MixedNamedArgumentsInTheirOwnPosition feature
  (see #KT-7745) without experimental warning
2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
23d492646d [FIR] Update testdata of SAM conversions diagnostics tests after lambda resolution fix 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
010dae454e [FIR] Fix extracting parameters from extension function types 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
9c8d6fb49b [FIR] Check for lambda arguments that expected type is functional type 2019-11-05 15:22:22 +03:00
Dmitriy Novozhilov
297d07f465 [FIR] Refactor fir resolve tests
Now there is only base test runner for all kinds of diagnostics test
  (`AbstractFirBaseDiagnosticsTest`)
2019-11-05 15:22:22 +03:00
Dmitriy Novozhilov
66abbe1aad [FIR] Fix testdata in fir diagnostic tests broken in 01f09af6 2019-11-05 15:22:22 +03:00
Steven Schäfer
704e6e96fa Fir2Ir: Produce IR_TEMPORARY_VARIABLE origins 2019-11-05 14:58:47 +03:00
Steven Schäfer
733c7579aa Normalize names of temporary variables in IrTextTests 2019-11-05 14:58:47 +03:00
Nikolay Krasko
740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Alexander Podkhalyuzin
722f7ff056 Now using Kotlin setting instead of Java one 2019-11-05 11:57:08 +03:00
Alexander Udalov
efaf779133 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-04 16:17:58 +01:00
Georgy Bronnikov
51459adb8c Add integration test for Kapt3+IR 2019-11-04 11:26:45 +03:00
Georgy Bronnikov
195f225e36 Run Kapt3 with old backend, even if IR is specified in configuration
Kapt does not currently work with IR backend. Temporarily switch to the
old JVM backend when running it.
2019-11-04 11:26:45 +03:00
Svyatoslav Kuzmich
b9f88350dd [JS IR] Build hybrid versions of stdlib and kotlin.test
IR version of libraries are no published by default inside pre-IR JARs
2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
d872b27663 [JS IR] Add gradle plugin integration tests 2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
bc47594c7a Update bootstrap
New compiler arguments needed to publish JS IR libraries:
    - stdlib
    - kotlin-test
2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
victor.petukhov
62d204f4d6 Support trailing comma
^KT-34743 Fixed
2019-11-01 19:40:20 +03:00
LepilkinaElena
e638b9fd12 K/N performance gradle plugin. Added options and right code size for … (#2752) 2019-11-01 18:16:43 +03:00
Ilmir Usmanov
8c079706a5 Add tests for case when result of tail-call suspend function returning
Unit is not Unit.
 #KT-34703 Fixed
2019-11-01 17:48:06 +03:00
Ilmir Usmanov
ca527444cb Return Unit manually in callSuspend and callSuspendBy if callable
returns Unit. The reason is the same as in the previous commit.
If the callable is tail-call and its callee returns something other that
Unit and suspends, on resume the result of the call will not be Unit.
 #KT-34703
2019-11-01 17:48:04 +03:00
Ilmir Usmanov
04441da095 Replace result on stack with Unit if callee is suspend function
returning Unit. Because on resume the result might be not a Unit if
the callee is tail-call and its callee return something different from
Unit and suspends.
Luckily, we generated ReturnsUnitMarker on such calls in all release
versions since 1.3. So, even if the code is inline and generated by
older versions, it will still work correctly.
The only version of the compiler, which does not generate the markers,
is 1.3.60-eap-76, because we did not generate the markers since
cc06798e2c. But I think, this is not
an issue.
 #KT-34703
2019-11-01 17:48:02 +03:00
Vyacheslav Gerasimov
3b088818a5 Build: Add sources and javadocs to Kotlin Plugin publication 2019-11-01 16:22:42 +03:00
Vyacheslav Gerasimov
579645bcfa Build: Publish ide-common as separate artifact in KotlinPlugin publication
#KT-34452
2019-11-01 16:22:42 +03:00
Vyacheslav Gerasimov
7401a7c63f Build: Fix dependencies of ide-common
#KT-34452
2019-11-01 16:22:42 +03:00
Dmitry Petrov
1e63101a27 FIR2IR: fix testData after rebase 2019-11-01 14:55:12 +03:00
Dmitry Petrov
6cde86139c IR: isFakeOverride: fix testData after rebase 2019-11-01 14:55:11 +03:00
Dmitry Petrov
35b9f43608 IR: use isFakeOverride
(and see what breaks)
2019-11-01 14:55:11 +03:00
Dmitry Petrov
f79909d724 IR serialization: isFakeOverride in proto
NB It's not clear yet if we actually want to serialize fake overrides
or generate and resolve them on deserialization.
2019-11-01 14:55:11 +03:00
Dmitry Petrov
5c390d9426 IR serialization: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
ce96053940 JVM_IR: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
0b26f32674 JS_IR: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
6101f00611 IR BE common: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
3fcdbf2c88 FIR2IR: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
edaa42ea46 IR: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
e9337ec8f2 IR serialization: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
da63d16c33 IR BE common: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
8b8b96bff4 FIR2IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
82c527c2cc IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
2682057767 IR tests: update testData for IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
65e6a84831 IR tests: check IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
46745adfd9 FIR2IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
d23f13e3dc IR serialization: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
5831b08a6e JVM_IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
f24278941d JS_IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
b36d8f556a IR BE common: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
843fb88459 IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitriy Novozhilov
01f09af608 [FIR] Fix generated name for FirErrorNameReferenceImpl 2019-11-01 13:24:57 +03:00
Dmitriy Novozhilov
829227255d [FIR] Add rendering of error numbers per file/package/module in HTML dump 2019-11-01 13:24:57 +03:00
Dmitriy Novozhilov
528e538b2a [FIR] Remove duplicating diagnostics from error function calls 2019-11-01 13:24:57 +03:00
Nikolay Krasko
a3ae629f53 Fix bunch file in 193 2019-11-01 12:25:44 +03:00
Nikolay Krasko
ffafd96f1b Fix url for developers builds (KT-34246)
#KT-34246 Fixed
2019-11-01 12:25:44 +03:00
Ilya Matveev
955300dd34 Deserializer: Fix initialization of private top-levels
Consider a file with only private top-level properties compiled into
a klib. If this klib is deserialized with deserializationStrategy.ALL
(e.g. if this library if passed using the -Xinclude flag),
initializers of these properties will not be generated  in a final
binary.

This patch fixes this error by unconditionally adding IrFiles into
deserialization queue if deserializationStrategy.ALL is specified.

Issue #KT-34722 fixed
2019-11-01 12:02:59 +03:00
Dmitriy Novozhilov
073578bf1c [FIR] Fix Fir2Ir testdata broken in a501e514 2019-11-01 11:07:16 +03:00
Dmitriy Novozhilov
098616ac76 [FIR] Add dependency of :descriptors.runtime to :fir2ir module 2019-11-01 11:06:33 +03:00
Dmitriy Novozhilov
1b44566e6f [FIR] Fix compilation error in lightTree module
There was a extra comma that I missed
2019-11-01 11:06:31 +03:00
Dmitriy Novozhilov
27c70eedd9 Enable MixedNamedArgumentsInTheirOwnPosition feature in compiler module 2019-11-01 10:25:37 +03:00
Dmitriy Novozhilov
09fa15c22b [FIR] Support old FE-like multifile tests 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
65eed24dbb [FIR] Add diagnostics reporting to FIR resolve tests 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
38bb9f78d6 [FIR] Add diagnostic collector component that collects diagnostics from error nodes 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
0428916d3c [FIR] Add error nodes to default transformer and visitors 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
a501e514c9 [FIR] Add meaningful diagnostics in all error elements 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
7503449e8d [FIR] Add kind to diagnostics reported by RawFirBuilder 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
8b5f568a15 [FIR] Introduce FirDiagnostic in FIR instead of errorReason 2019-11-01 10:25:34 +03:00
Dmitriy Novozhilov
8eabe08e7a [FIR] Move components into separate package 2019-11-01 10:25:34 +03:00
Dmitriy Novozhilov
f72fa87583 [FIR] Add old FE-like diagnostic tests 2019-11-01 10:25:33 +03:00
Dmitriy Novozhilov
8b900624d3 [FIR] Add bridge for diagnostics from old FE to ConeDiagnostic 2019-11-01 10:25:33 +03:00
Dmitriy Novozhilov
9b77dec99c [FIR] Add prototype of diagnostic collector 2019-11-01 10:25:33 +03:00
Andrey Uskov
e909b63d30 Revert "Fix GradleConfiguratorTest"
This reverts commit 5360a7a3
2019-10-31 21:40:44 +03:00
Andrey Uskov
fd2b75e39b Fixed import of MPP project with single Android target
#KT-34639 Fixed
2019-10-31 21:39:18 +03:00
Andrey Uskov
5c3b00cd0c Improve performance of import in Android Studio
Improve performance of dependency tree calculation when module per
source set mode is disabled.
#KT-34663 Fixed
2019-10-31 21:39:16 +03:00
Alexander Udalov
e8e04ca98e Do not use new stdlib API in reflection implementation
Otherwise this brings incompatibility between kotlin-reflect 1.3.70+ and
kotlin-stdlib 1.3.60-.

This commit reverts the relevant parts of c164745301, 5c89f2fa54 and
896512f7cd.
2019-10-31 17:39:34 +01:00
Kirill Shmakov
72591e34b3 Support android_x64/86 in cinterop definitions 2019-10-31 18:35:06 +03:00
Alexander Podkhalyuzin
4c21b234b1 Fixed compilation in 191 2019-10-31 17:31:09 +03:00
Alexander Podkhalyuzin
7b8fbb5fea Fixed freezes with add unambiguous imports on the fly
We still had backup way to recalculate things for the case when fix
is not available. So if error is not importable, or we have second
error, which will be outdated after adding first import, we could get
freezes. 2019.2 and 2019.1 have different APIs, so it's implemented in
different way.

#KT-30863 Fixed
2019-10-31 17:25:29 +03:00
Alexander Podkhalyuzin
24d620657b Java doesn't have extension methods, so we don't need to look
for imports for qualified references

#KT-26162 Fixed
2019-10-31 16:00:44 +03:00
Vyacheslav Gerasimov
95ac0e328f Build: Extract bootstrap teamcity url to parameter 2019-10-31 15:41:57 +03:00
Dmitry Gridin
f641e2a139 RedundantRequireNotNullCallInspection: should use BodyResolveMode.PARTIAL_WITH_CFA instead of BodyResolveMode.PARTIAL
#KT-34672 Fixed
2019-10-31 19:24:37 +07:00
Dmitry Gridin
04c8c888ee KotlinLightCodeInsightFixtureTestCase: remove deprecated call for 193 2019-10-31 19:24:36 +07:00
Dmitry Gridin
17429d333e Create expect/actual should move cursor to target declaration
#KT-34411 Fixed
2019-10-31 19:24:36 +07:00
Mikhael Bogdanov
8e2943ae2a Temporary increase timeout to avoid NPE 2019-10-31 13:15:51 +01:00
Ilya Matveev
7c4033f0bf Deserializer: Fix initialization order
Top-level initializers must be deserialized in the same order they
where in the original source file. Before this patch this rule might
be violated. Consider the following case:

// lib1.kt
val a = 5
val b = a * 5

// lib2.kt
fun foo() = println(b)

Compile both files into libraries and then link an application
against them. During deserialization of lib2 'b' will be added
to the deserialization queue of lib1. After that we will add 'a'
to this queue too. Thus 'b' and 'a' will be in a wrong order
in this queue resulting in a wrong order of corresponding
top-level initializers in a final executable.

This patch fixes this issue by adding all top-level initializers
to a deserialization queue before all other declarations.
2019-10-31 14:51:56 +03:00
Roman Artemev
78b29349c9 Fix lateinit isInitialized check in multi-file case 2019-10-31 14:45:15 +03:00
Toshiaki Kameyama
d75b938089 Formatter: don't format elvis operator in string template
#KT-34049 Fixed
2019-10-31 18:34:42 +07:00
Roman Golyshev
bcee8ce04b KT-34692: Invoke ScratchAction::update without invokeLater
- `invokeLater` is bad here, since `AnAction::update` must update action look immediately, not later in the future
- Because of `invokeLater`, `RunScratchAction` wasn't properly rendered in the context menu
- `invokeLater` was added in the a24da280ca to fix EA-210180
  - EA-210180 is not reproducible; however, the main reason of the exception is that `AnAction::update` was called not from EDT, but from regular thread updating "Run From Here" (>>) gutter actions
  - all exception under EA-210180 are from 1.3.50; my guess is that those exceptions were caused by changes in scratch editor implementation details and will not appear again; if they will, we will need to investigate them
- ^KT-34692 Fixed
2019-10-31 14:22:06 +03:00
Roman Golyshev
28ec74648e Use ML completion extension point from 193 platform
- completion-ranking-kotlin jar used to be in the IDEA itself; thanks to new extension it can reside in the plugin from now on
- ML completion is turned off by default
- use `implementation` dependency because `completion-ranking-kotlin` is required during runtime
2019-10-31 13:37:38 +03:00
Mikhail Zarechenskiy
b30a9e1d3e [NI] Remove capturing from supertypes during computation of CST 2019-10-31 11:32:05 +03:00
Mikhail Zarechenskiy
e8907c078d [NI] Don't recreate subtyping context every time 2019-10-31 11:32:04 +03:00
Mikhail Zarechenskiy
de009a2ff2 [NI] Minor, use singleton instead of creating anonymous object 2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy
77577dfa6f [FIR] Introduce ConeStubType to have subtyping for non-fixed variables
Currently, it's needed after changes in d7b47108f70a107818a04c8b8db33bfbf7c7e590

 Later it'll be also used for builder-inference
2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy
01ad9c47c8 [NI] Fix subtyping between integer literal types and intersection ones
Consider a call like `select(1, "")`, the resulting type for it is
 Comparable<Int & String> & Serializable.

 After variable fixation, the compiler incorporates this type into the
 constraint system to check for a contradiction, so it checks
 applicability of argument to the resulting type.

 In other words, for the above call it checks is
 `Comparable<Int & String> & Serializable` subtype of `IntegerLiteralType`?
 Which ends up in checking is `IntegerLiteralType` subtype of `Int & String`.

 Before this commit, such check was leading to the false result, but
 because of losing diagnostic (which was fixed in the previous commit:
 29f591b1), there was no error
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy
e0fb586aaf [NI] Don't loose diagnostic after type variable fixation
#KT-24488 Fixed
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy
ca8da22569 [NI] Improve CST algorithm to handle non-fixed variables
#KT-32456 Fixed
 #KT-32423 Fixed
 #KT-32818 Fixed
 #KT-33197 Fixed
2019-10-31 11:32:00 +03:00
Mikhail Zarechenskiy
ba6648d535 Minor, reformat Annotations.kt file 2019-10-31 11:31:59 +03:00
Dmitry Petrov
2ff36c808e Minor: mute testEa35963 in WASM 2019-10-31 11:13:45 +03:00
Dmitry Petrov
8b2fdca706 FIR2IR: fix testData 2019-10-31 11:13:45 +03:00
Steven Schäfer
b1b70e503c JVM IR: Improve codegen for try/catch statements 2019-10-31 11:13:44 +03:00
Steven Schäfer
af74fd047a psi2ir: Consistently use type unit for statements
These changes allow us to accurately distinguish between statements and
expressions in the IR.

This also fixes the types of non-exhaustive conditional statements.
2019-10-31 11:13:44 +03:00
Steven Schäfer
0da4b06074 psi2ir: Fix return insertion
We should only insert a return statement at the end of a lambda or
function if the final statement is used as an expression (slice
USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).
2019-10-31 11:13:44 +03:00
Nikolay Krasko
b3e733ea4f 193: More mutes in 193 (SurroundWithTestGenerated, KT-34689, KT-34542, KT-34672) 2019-10-31 11:11:50 +03:00
Nikolay Krasko
f7c775a080 193: Mute tests for find usages in libraries in 193 (KT-34542) 2019-10-31 11:11:50 +03:00
Nikolay Krasko
7e5316b9f1 Fix completion test for Java in 193
It looks like java completion doesn't use () anymore.
2019-10-31 11:11:50 +03:00
Nikolay Krasko
42312c3060 Fix GradleConfiguratorTest.testProjectWithModule in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko
0d2e790b32 Fix IdeaModuleInfoTest.testSdkForScript in 193
There's automatic jdk 7 registration starting from 193.
2019-10-31 11:11:49 +03:00
Nikolay Krasko
c9793e4bf4 Fix IdeaModuleInfo tests in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko
4ef063c656 Log information about failed test 2019-10-31 11:11:49 +03:00
Nikolay Krasko
201859be92 Mute RedundantRequireNotNullCall tests in 193 (KT-34672) 2019-10-31 11:11:49 +03:00
Nikolay Krasko
bed2e21a1a Mute CoroutineNonBlockingontextDetectionTest tests in 193 (KT-34659) 2019-10-31 11:11:49 +03:00
Nikolay Krasko
1811b79503 Mute custom navigation tests (KT-34542) 2019-10-31 11:11:48 +03:00
pyos
a835f07d51 JVM_IR: don't regenerate objects in lambdas inlined into objects 2019-10-31 09:09:54 +01:00
Ilya Goncharov
eeadc95bc1 [Gradle, JS] Remove check on duplicated targets
Useful (for KT-33828), if provider of artifact has changed, but remained only one

#KT-33828 fixed
2019-10-31 10:46:17 +03:00
Kristoffer Andersen
1074a0ef69 JVM_IR: Fix Inline CallableReferences with Varargs
- Added tests to demonstrate broken behaviour: the interaction of inline
  functions and callable references with varargs and defaults in various
  combinations.
- Refactored InlineCallableReferencesToLambdaPhase to look like and use
  some of the infrastructure from CallableReferenceLowering.
- Lifted some of this infrastructure out to be broadly reusable.
2019-10-31 08:15:22 +01:00
Andrey Uskov
5360a7a3fe Fix GradleConfiguratorTest
Fixed naming of jdk platforms in mocks in order to pass IDE validation
2019-10-31 00:40:13 +03:00
Andrey Uskov
33cacb87d3 Fix import tests for IDE 183 2019-10-31 00:40:11 +03:00
Vladimir Dolzhenko
4b2834c4a8 Provide incremental analysis of a file when it is applicable
#KT32868 Fixed
2019-10-30 21:41:29 +01:00
Kirill Shmakov
c7bd6d8ede Support watchos and tvos in cinterop definitions 2019-10-30 22:14:38 +03:00
Ilya Goncharov
08f9dd2aea [Gradle, JS] Fix entry for webpack (with Configuration Avoidance broke) 2019-10-30 18:58:56 +03:00
Dmitriy Novozhilov
6f91c0e679 [FIR] Don't check @ExtensionFunction in fir consistency tests 2019-10-30 18:49:12 +03:00
Dmitriy Novozhilov
ad9bf62b2f [FIR] Remove adding annotations from bounds to type parameter in lightTree2Fir 2019-10-30 18:49:11 +03:00
Dmitriy Novozhilov
36ad065792 [FIR] Fix testdata broken after d2b895d8 2019-10-30 18:49:07 +03:00
Alexander Podkhalyuzin
ddd25c703a SmartPointers in Introduce Variable refactoring
It's often case, when psi can die after reparse, especially after
reformatting cases, SmartPointers are opposite to it, can survive

#KT-32601 Fixed
2019-10-30 18:08:14 +03:00
Alexander Podkhalyuzin
aa604d0854 Fixed new/old type inference diff, sometimes causes problems in JPS 2019-10-30 18:05:34 +03:00
Stanislav Erokhin
607249e899 Make computeTasksAndResolveCall public for compiler plugins 2019-10-30 16:44:38 +03:00
Vyacheslav Gerasimov
17bd547666 Build: Fix internalKotlinRepo url for JPS build 2019-10-30 16:38:10 +03:00
Alexander Udalov
28187da750 Fix compilation of :idea:compileTestKotlin
Original patch authored by @h0tk3y.
2019-10-30 12:56:42 +01:00
Jiaxiang Chen
6454cfad87 add local variable test. This test runs box() method and checks local variable types and names avaiable at every step. 2019-10-30 14:13:12 +03:00
Jiaxiang Chen
6b73ef4b0b refactor stepping test to extract common logic for other debug information test 2019-10-30 14:13:12 +03:00
Anton Yalyshev
dec7f51902 Return an old stepping cause new one requires a big refactoring for GradleModuleBuilder 2019-10-30 13:49:40 +03:00
Anton Yalyshev
9075a83ebe Prevents creating of new Gradle-based Kotlin project in a path of previous one 2019-10-30 13:49:40 +03:00
Mads Ager
1713625718 JVM: Improve line number handling for suspend calls.
Take branching and method calls into account when finding the line
number of the continuation. If there is no line number before
branching instructions or method calls, the following code is
still on the line of the suspend call itself.

This fixes a couple of issues with incorrect line numbers for
multiple throws on the same line or multipe suspend calls on
the same line.

In addition, it avoids the need to spam the method node with
repeated line number instructions in the IR backend.
2019-10-30 13:40:21 +03:00
Mikhail Glukhikh
34d9959b17 FIR: add more correct handling of Java raw types 2019-10-30 12:55:38 +03:00
Mikhail Glukhikh
d4af35d794 FIR: add substitution for Java fields 2019-10-30 12:55:37 +03:00
Mikhail Glukhikh
83cd7cf516 FIR: add new problematic tests 2019-10-30 12:55:37 +03:00
Alexander Udalov
544b402d06 Update bootstrap to 1.3.70-dev-1070 2019-10-30 10:31:51 +01:00
Georgy Bronnikov
9c8e8651be IR: make stub marker parameter for constructors nullable
In constructor stubs for default arguments, a marker parameter used
to have a non-null type, but null was passed as the corresponding
argument. This patch corrects the type.
2019-10-30 12:23:27 +03:00
Natalia Selezneva
35e2c9eb59 Fix scripting tests in 193
^KT-34541 Fixed
2019-10-30 12:02:45 +03:00
Natalia Selezneva
4613bf4b06 Minimize bunch files size for AbstractScriptConfigurationTest.kt 2019-10-30 12:02:45 +03:00
Dmitriy Novozhilov
d2b895d8c2 [FIR] Add @ExtensionFunction to lambdas with receivers 2019-10-30 11:03:15 +03:00
Vyacheslav Gerasimov
5776d115b7 Build: Add space packages to maven-settings servers 2019-10-29 23:31:43 +03:00
Ilya Chernikov
9aaf08de08 Fix equality for the KtFileScriptSource 2019-10-29 20:44:18 +01:00
Vladimir Dolzhenko
26255f8501 Added AllowNullableArrayArgsInMain (1.4+) language setting 2019-10-29 19:20:35 +01:00
Ilya Goncharov
6ecc7eab7e [Gradle, JS] Add compatible aliases for old tasks
#KT-32323 fixed
#KT-32283 fixed
2019-10-29 19:41:20 +03:00
Ilya Goncharov
dc3f3ce80d [Gradle, JS] Rename experimental annotation with warning level 2019-10-29 19:39:12 +03:00
Ilya Goncharov
e7a45fb536 [Gradle, JS] JS specific build variants 2019-10-29 19:39:12 +03:00
Ilya Goncharov
e3ec37b14f [Gradle, JS] Common webpack's configurations 2019-10-29 19:39:12 +03:00
Ilya Goncharov
eb7fe6b0a4 [Gradle, JS] Each task configure your own dceOutputFileApplier 2019-10-29 19:39:12 +03:00
Ilya Goncharov
2d026e7973 [Gradle, JS] Make disambiguate take vararg 2019-10-29 19:39:12 +03:00
Ilya Goncharov
92c5b9c66e [Gradle, JS] Configure build and run in one place: configureMain 2019-10-29 19:39:12 +03:00
Ilya Goncharov
aca5628622 [Gradle, JS] Use experimental dce annotation 2019-10-29 19:39:12 +03:00
Ilya Goncharov
f55680a737 [Gradle, JS] Configure build and run in one place: configureMain 2019-10-29 19:39:12 +03:00
Ilya Goncharov
ead4528445 [Gradle, JS] Make multiple entry points and output for webpack 2019-10-29 19:39:12 +03:00
Ilya Goncharov
f66e6337fe [Gradle, JS] Fix test on DCE working with usual js files 2019-10-29 19:39:11 +03:00
Ilya Goncharov
83527a6d0e [Gradle, JS] DCE dsl interface used in browserDsl 2019-10-29 19:39:11 +03:00
Ilya Goncharov
2ffd8bed48 [Gradle, JS] Depends on according to Task Configuration Avoidance 2019-10-29 19:39:11 +03:00
Ilya Goncharov
d2727e2f25 [Gradle, JS] Add possibility to configure dce task 2019-10-29 19:39:11 +03:00
Ilya Goncharov
e1387e3d3d [Gradle, JS] Provide entry for DCE to webpack 2019-10-29 19:39:11 +03:00
Ilya Goncharov
174fd5975d [Gradle, JS] Add resolveFromModulesFirst option
When we collect all DCE'd files, we need, that webpack to watch on these files, not on node_modules module
2019-10-29 19:39:11 +03:00
Ilya Goncharov
51f4dc5af0 [Gradle, JS] Filter DCE candidates
We should process DCE only for:
- JARs
- JSs with neighbors meta.js
2019-10-29 19:39:11 +03:00
Ilya Goncharov
faa5846252 [Gradle, JS] Add DCE task with dependsOn relationships 2019-10-29 19:39:11 +03:00
Ilya Goncharov
a7cae0fc78 [Gradle, JS] Cartesian product of build variant and task types 2019-10-29 19:39:11 +03:00
Ilya Goncharov
6e0f5f71f1 [Gradle, JS] Divide values for devtool (source maps) 2019-10-29 19:39:11 +03:00
Ilya Goncharov
6c4e7921f7 [Gradle, JS] Single entry for webpack 2019-10-29 19:39:11 +03:00
Ilya Goncharov
973cd51497 [Gradle, JS] Add webpack mode depends on build variant kind 2019-10-29 19:39:10 +03:00
Ilya Goncharov
603e263003 [Gradle, JS] Add BuildVariants 2019-10-29 19:39:10 +03:00
Ilya Goncharov
3e9e9c02c6 [Gradle, JS] Extract build task configuration from run task 2019-10-29 19:39:10 +03:00
Georgy Bronnikov
cd78e6ec50 JVM_IR: handle property references in SAM conversions 2019-10-29 18:38:59 +03:00
Alexander Udalov
74c9120d9d Minor, don't use outdated Groovy dependency
See https://ossindex.sonatype.org/vuln/91433254-870c-47a2-aa06-1b303a92c018

 #TPV-3545 Fixed
2019-10-29 16:07:52 +01:00
Alexander Udalov
59959c52ad Don't report missing reflection diagnostic for KType/KTypeProjection/KVariance 2019-10-29 15:52:01 +01:00
Alexander Udalov
896512f7cd Support KClass.isInstance/cast/safeCast in stdlib-only reflection implementation
#KT-14720 Fixed
2019-10-29 15:52:00 +01:00
Alexander Udalov
5c89f2fa54 Support KClass.qualifiedName in stdlib-only reflection implementation
#KT-34586 Fixed
2019-10-29 15:51:25 +01:00
Alexander Udalov
c164745301 Support KClass.simpleName in stdlib-only reflection implementation
#KT-33646 Fixed
2019-10-29 15:51:21 +01:00
Anton Yalyshev
e146d308db Add statistics collector 2019-10-29 16:40:53 +03:00
Igor Yakovlev
63e687f67e Add feature for data and inline class parameters smart typing
When one typing data/inline class primary ctor this feature adds missing val keyword for parameters
i.e.
data class xxx(x: Int<caret>)
when typing comma symbol convert code to
data class xxx(val x: Int,<caret>)

Fixed #KT-34567
2019-10-29 16:40:52 +03:00
Mikhail Glukhikh
0708f574fc FIR: simplify companion scope building for implicit dispatch receiver 2019-10-29 16:27:42 +03:00
Mikhail Glukhikh
79e584519f FirTypeResolverImpl: minor style fix 2019-10-29 16:27:42 +03:00
Mikhail Glukhikh
37cad476e8 Fix incorrect assertion in FIR DFA 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
4adacfa5a2 Add a pair of new tests for FIR local classes / objects 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
384134a069 FIR2IR: fix handling constructors & their symbols (related also to local classes) 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
7dee1cd9d2 Build member scope for FirAnonymousObject correctly 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
e1c889e871 Make FirClass a kind of FirClassLikeDeclaration, introduce FirRegularClass/AnonymousObject symbols 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
1e4f07ebc7 FIR: expect getClassLikeSymbolByFqName to return null for local classes 2019-10-29 16:27:40 +03:00
Mikhail Glukhikh
a13ae08b52 FIR: add classifiers to local scopes, process local class symbols correctly 2019-10-29 16:27:40 +03:00
Vyacheslav Gerasimov
aa2765bab8 Build: Setup pom for KotlinPlugin maven publication 2019-10-29 15:32:32 +03:00
Nikolay Krasko
f5cdaafeb0 Fix compilation errors in QuickFixMultiModuleTestGenerated 2019-10-29 15:04:13 +03:00
Alexander Udalov
df4ab4ed81 Add JVM bytecode target version 13
#KT-34119 Fixed
2019-10-29 12:54:24 +01:00
Georgy Bronnikov
1354de1780 JVM_IR: stylistic, use transform instead of add/remove
In InterfaceDeclarationLowering, functions are being replaced by
redirections to default implementations. Use `transform`, as suggested
by @pyos.
2019-10-29 14:42:35 +03:00
Toshiaki Kameyama
68ea677cc4 Import quick fix: support extension iterator function
#KT-34303 Fixed
2019-10-29 18:35:14 +07:00
Dmitry Savvinov
3abfe59d75 Deduplicate incompatible actual descriptors
Otherwise, we might get false positive AMBIGUOUS_ACTUALS due to one and
the same descriptor appearing multiple times in a list
2019-10-29 14:28:41 +03:00
Dmitry Savvinov
9198b7a039 Add test on weakly incompatible actual in intermediate source-set 2019-10-29 14:28:41 +03:00
Dmitry Savvinov
2c6fbb6ece Fix dependsOn module names
Use Gradle Project IDs instead of names, because for composite Gradle
builds module names are appended with some additional prefixes, which
causes mismatch
2019-10-29 14:27:38 +03:00
LepilkinaElena
b37dc32e03 Kotlin/Native performance gradle plugin (#2713) 2019-10-29 14:23:50 +03:00
Nikolay Krasko
7160653546 Fix KotlinConfidenceTest in 193 2019-10-29 13:47:14 +03:00
Nikolay Krasko
8d50aea471 Allow to use mutations from several files 2019-10-29 13:45:04 +03:00
Nikolay Krasko
620898c73e Use local single-thread cached value instead of thread locals (KT-28940)
It looks like thread locals are not needed here as their global state
is not utilized but creates troubles with memory management.
2019-10-29 13:40:34 +03:00
Nikolay Krasko
02f9b255e6 Clean using thread local in all threads (KT-28940) 2019-10-29 13:40:34 +03:00
Dmitry Gridin
587b0de2b8 RemoveExplicitTypeIntention: fix false positive for type aliases
#KT-33902 Fixed
2019-10-29 17:26:59 +07:00
Dmitry Gridin
6ea82a0c7d MoveMember: cleanup code 2019-10-29 17:26:34 +07:00
Dmitry Gridin
18aa9ffce8 expectActualUtil: introduce runCommandOnAllExpectAndActualDeclaration function 2019-10-29 17:26:34 +07:00
Dmitry Gridin
9aa49e61fe expectActualUtil: add parameter useOnSelf to runOnExpectAndAllActuals 2019-10-29 17:26:34 +07:00
Dmitry Gridin
4285f63bcc ChangeVisibilityFix: cleanup code 2019-10-29 17:26:34 +07:00
Dmitry Gridin
9c61f42121 ChangeVisibilityModifierIntention: should affect all actual/expect declarations
#KT-29737 Fixed
2019-10-29 17:26:34 +07:00
Dmitry Gridin
13e98e712e RedundantLetInspection: fix false negative for references
#KT-34603 Fixed
2019-10-29 17:25:50 +07:00
Dmitry Gridin
5fc70f6cfd RedundantLetInspection: fix false positive for inner lambda expression
#KT-25271 Fixed
2019-10-29 17:25:50 +07:00
Dmitry Gridin
5d16753285 ImportFix: add support for WRONG_NUMBER_OF_TYPE_ARGUMENTS
#KT-23834 Fixed
2019-10-29 17:25:17 +07:00
Dmitry Gridin
e14d589279 KotlinInternalInJavaInspection: fix false positive for java test module
#KT-17659 Fixed
2019-10-29 17:24:46 +07:00
Dmitry Gridin
865e1bf631 KotlinInternalInJavaInspection: cleanup code 2019-10-29 17:24:46 +07:00
Dmitry Gridin
81f3a98f49 Convert ConvertTwoComparisonsToRangeCheck intention to inspection
Relates to #KT-17310
2019-10-29 17:24:21 +07:00
Alexander Udalov
8e4c7ad65d Merge pull request #2727 from pyos/fix-synthetic-accessors-v101
JVM_IR: add accessors for protected members in divergent hierarchies
2019-10-29 11:10:58 +01:00
Dmitriy Novozhilov
3658bee253 [FIR] Fix testdata related to callable references 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
0d15ff1ddd [FIR] Introduce FirSourceElement instead of FirElement as source in fir nodes 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
b93357be48 [FIR] Support assignment operators 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
6298889358 [FIR] Add forgotten exhaustiveness checking for erroneously resolved when 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
7e55960943 [FIR] Support Conditional effects 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
57f1eac9a8 [FIR] Support CallsInPlace effects 2019-10-29 13:03:12 +03:00
Dmitriy Novozhilov
fd852ec07d [FIR] Add deserialization of contracts 2019-10-29 13:03:12 +03:00
Dmitriy Novozhilov
18c3d1c140 [FIR] Add contract description classes to fir 2019-10-29 13:03:12 +03:00
Roman Golyshev
3661dedacf KT-31762: Fix completion in enum entries constructors
- The issue was caused by incorrect parsing of enum entry because of `$` in the `KotlinCompletionContributor::DEFAULT_DUMMY_IDENTIFIER`
  - Incorrect parsing caused arguments next to completed one to be recognized as another enum entries
- Change `KotlinCompletionContributor::isInClassHeader` to accept classes without bodies, so identifier without `$` is used inside enum entries constructors
- ^KT-31762 Fixed
2019-10-29 12:35:13 +03:00
Ilya Goncharov
042100ea77 [Gradle, JS] Disable puppeteer downloading Chrome 2019-10-29 12:03:49 +03:00
Mikhael Bogdanov
63b115abb6 Workaround for KT-34656: temporary disable assertion 2019-10-29 09:48:49 +01:00
Mark Punzalan
de333c18fc JVM_IR: Enable loopVarInterval and forInReversedCollectionIndices
bytecode text tests.
2019-10-29 07:43:37 +01:00
Natalia Selezneva
934cbcbbec Use more abstract class for gradleModuleBuilder
In IDEA 201.* another class is in super class list
^KT-34463 Fixed
2019-10-29 09:11:12 +03:00
Vladimir Dolzhenko
46d843643d Fixed BoxJsTestGenerated.Main due to nullable arguments in main method 2019-10-28 16:42:14 +01:00
Steven Schäfer
2043dd8a10 JVM IR: Respect extension receiver parameter type in AddContinuationLowering 2019-10-28 18:34:06 +03:00
Steven Schäfer
184c83bcb0 JVM IR: Fix type of IrReturn in AddContinuationLowering 2019-10-28 18:34:06 +03:00
Mark Punzalan
b4d2eae12d Add test data generator for stepped progression box tests. 2019-10-28 15:26:38 +01:00
Mark Punzalan
1738c2d4f6 Invoke GenerateInRangeExpressionTestData and
GeneratePrimitiveVsObjectEqualityTestData during
:compiler:generateTests.
2019-10-28 15:26:38 +01:00
Mark Punzalan
3c775c598c Extract utility function to create temporary variables if necessary. 2019-10-28 15:26:38 +01:00
Mark Punzalan
9bb9ab67a7 Add bytecode text tests for ForLoopsLowering. 2019-10-28 15:26:38 +01:00
Mark Punzalan
277cb39e3b Add new tests for step progressions and fix existing tests. 2019-10-28 15:26:38 +01:00
Mark Punzalan
27642514b1 Move ForLoopsLowering before JvmStringConcatenationLowering.
ForLoopsLowering may produce IrStringConcatenations which should be
eliminated before codegen.
2019-10-28 15:26:38 +01:00
Mark Punzalan
8a4185202f Handle step progressions in ForLoopsLowering. 2019-10-28 15:26:38 +01:00
Vyacheslav Gerasimov
38f0fd256e Build: Specify LIBRARY_ELEMENTS_ATTRIBUTE to JAR for configurations with js libraries 2019-10-28 17:21:23 +03:00
Vyacheslav Gerasimov
1a68a772c4 Build: Update gradle to 5.6.2 2019-10-28 17:21:23 +03:00
Denis Zharkov
ea43d2880c FIR: Update FIR2IR test data changed because of callable references
^KT-32725 Fixed
2019-10-28 17:07:26 +03:00
Denis Zharkov
9ac0ac50ea FIR: Support callable references to vars
^KT-32725 In Progress
2019-10-28 17:07:25 +03:00
Denis Zharkov
4233cf1bd6 FIR: Get rid of the cycle in delegated properties resolution
^KT-32725 In Progress
2019-10-28 17:07:23 +03:00
Denis Zharkov
f97f06a99a FIR: Support callable references for constructors
^KT-32725 In Progress
2019-10-28 17:07:22 +03:00
Denis Zharkov
1e0105d40e FIR: Fix initialization pieces for callable references after rebase
^KT-32725 In Progress
2019-10-28 17:07:21 +03:00
Denis Zharkov
7ae3eda37f FIR: Rename FirResolvedRealCallableReference -> FirResolvedCallableReference
^KT-32725 In Progress
2019-10-28 17:07:19 +03:00
Denis Zharkov
1564e72b59 FIR: Rename FirResolvedCallableReference -> FirResolvedNamedReference
^KT-32725 In Progress
2019-10-28 17:07:18 +03:00
Denis Zharkov
5e322a2dd9 FIR: Refactor ResolvedCallableReferenceAtom
^KT-32725 In Progress
2019-10-28 17:07:16 +03:00
Denis Zharkov
fe8cd195aa FIR: Support callable references outside of the calls
^KT-32725 In Progress
2019-10-28 17:07:15 +03:00
Denis Zharkov
152236d84a FIR: Support callable references to declarations with implicit types
^KT-32725 In Progress
2019-10-28 17:07:14 +03:00
Denis Zharkov
af72cea8b3 FIR: Add simple test on SAM conversion for callable receivers
^KT-32725 In Progress
2019-10-28 17:07:12 +03:00
Denis Zharkov
7feb1aecfe FIR: Add constraints for extension receiver of callable reference
^KT-32725 In Progress
2019-10-28 17:07:11 +03:00
Denis Zharkov
74b9ba1613 FIR: Support callable references to properties
^KT-32725 In Progress
2019-10-28 17:07:10 +03:00
Denis Zharkov
38ab6521aa FIR: Support static methods in callable references
^KT-32725 In Progress
2019-10-28 17:07:09 +03:00
Denis Zharkov
937ea3d8a0 FIR: Support postponed callable references resolution
^KT-32725 In Progress
2019-10-28 17:07:08 +03:00
Denis Zharkov
cb50ea2707 FIR: Resolve callable references separately for each outer candidate
^KT-32725 In Progress
2019-10-28 17:07:02 +03:00
Denis Zharkov
03a9bfbea5 FIR: Provide Candidate receiver to argument resolution helpers
The receiver might be useful for working with postponed atoms
and other info from the Candidate

^KT-32725 In Progress
2019-10-28 17:04:53 +03:00
Denis Zharkov
006e475a99 FIR: Support callable references partially
^KT-32725 In Progress
2019-10-28 17:04:48 +03:00
Denis Zharkov
cdb2bb2b45 FIR: Prepare tree for callable references resolution
^KT-32725 In Progress
2019-10-28 17:04:44 +03:00
Denis Zharkov
aeceee5af0 FIR: Fix StoreReceiver transformer
^KT-32725 In Progress
2019-10-28 17:04:39 +03:00
Denis Zharkov
e359791ab4 Minor. FIR: Simplify createFunctionalType
^KT-32725 In Progress
2019-10-28 17:04:29 +03:00
Florian Kistner
bffcf8478e 193: Fix outdated gradle plugin id 2019-10-28 14:19:14 +01:00
Nikolay Krasko
01d3b8d9c4 Store mute tests database in the code instead of build server 2019-10-28 14:06:06 +03:00
Nikolay Krasko
edc1fa3ae8 Change version to the stable one to avoid downloading from teamcity 2019-10-28 14:06:06 +03:00
Nikolay Krasko
3643ae4765 Update 193 to more recent 193.4778.7-EAP 2019-10-28 14:06:06 +03:00
Nikolay Krasko
810e1973f6 193: Mute multiline enter tests in 193 (KT-34566) 2019-10-28 14:06:06 +03:00
Nikolay Krasko
697d3a0e5a 193: Mute scripting test in 193 (KT-34541) 2019-10-28 14:06:06 +03:00
Nikolay Krasko
8563614b69 193: Mute navigation tests in 193 (KT-34542) 2019-10-28 14:06:05 +03:00
Nikolay Krasko
3e7767f096 Fix compilation on 193 and clean up other warnings 2019-10-28 14:06:05 +03:00
Igor Chevdar
7b0f03cc1c [IR] Made IR validator weaker during validating IrConstNull 2019-10-28 12:39:29 +03:00
Igor Chevdar
f413da3e58 Turned off test for native
It fixes current JVM BE behavior but seems like this should've been a FE error.
2019-10-28 12:38:19 +03:00
Georgy Bronnikov
b63f9176a3 JVM_IR: repair overriddenSymbols in InterfaceDelegationLowering
When creating delegation redirectors for default implementations of
interface functions, `overriddenSymbols` should be repaired across the
whole module, not just a particular file.
2019-10-28 12:12:32 +03:00
Ilya Goncharov
c127cbaa6a [Gradle, JS] Fix stack trace for inner classes
Necessary only classname, Gradle find package on itself

#KT-30917 fixed
2019-10-28 11:50:52 +03:00
Mads Ager
88dd8f663c JVM_IR: Do not generate null checks for suspend function views.
The arguments are null whenever the suspend function is resumed
and takes its state from the continuation parameter.
2019-10-27 07:37:15 +03:00
Vladimir Dolzhenko
03c7f4bf00 Wrap KtClassOrObject.isLocal, KtFile.isScript with runReadAction in LightClasses
#EA-211576 Fixed

(cherry picked from commit 75a59d4bced714af51abd7e354bc873313b28051)
2019-10-26 21:10:38 +02:00
Vladimir Dolzhenko
00055fc20a Wrap KtClassOrObject.isLocal, KtFile.isScript with runReadAction in LightClasses
#EA-211576 Fixed

(cherry picked from commit 75a59d4bced714af51abd7e354bc873313b28051)
2019-10-26 09:42:49 +02:00
Vladimir Dolzhenko
96768cbf2d Clean up after acquire lock for several seconds to create LightClasses to workaround dead-lock over resolve
Relates to #KT-34279
2019-10-25 22:05:28 +02:00
Vyacheslav Gerasimov
28e34f5175 Build: Exclude kotlin-stdlib-common from kotlin-osgi-bundle
#KT-31365
2019-10-25 21:53:41 +03:00
Alexander Udalov
dac0fc7397 Remove obsolete assertion in ExpressionCodegen
With the mangling added in 488418d960, there's no longer any risk in
writing "special" function name ("<anonymous>" in this case) to the
local variable table.

 #KT-34356 Fixed
2019-10-25 19:31:20 +02:00
Alexander Udalov
e7fe144f5c Minor, fix markdown rendering in GenerateGradleOptions
To make it more in line with changes in
649bd6bbc4
and
4e78c2ea94
2019-10-25 19:26:20 +02:00
Alexander Udalov
f248e4a2ee Update CLI test data and Gradle option descriptions 2019-10-25 19:26:20 +02:00
Pavel Semyonov
c6f54b6412 Improve descriptions of compiler options 2019-10-25 19:26:19 +02:00
Pavel Kirpichenkov
87b88a738e [Minor] Update test data for NI 2019-10-25 19:37:06 +03:00
Nikolay Krasko
1b96e14b1e Remove reference to temporary thread local explicitly (KT-28940)
There're issue with storing variables in memory longer than needed.
2019-10-25 17:01:52 +03:00
Mikhail Zarechenskiy
588218658c [NI] Fix ambiguity for extension functions with exact transient receiver 2019-10-25 16:28:40 +03:00
Vladimir Dolzhenko
eb3f50dce7 Revert "Fix readAccess in IDELightClassGenerationSupport on obtaining script"
This reverts commit ba01678a
2019-10-25 14:11:46 +02:00
Steven Schäfer
210c354ae5 Fir2Ir: Set initializers for temporary variables 2019-10-25 14:27:19 +03:00
Alexander Udalov
cf61957e3c Minor, fix kotlinx-serialization bytecode test data
After some changes to the JVM IR backend
2019-10-25 11:23:11 +02:00
Pavel Kirpichenkov
c21e699783 Fix default type of static classes inside parametrized parents
Default type of LazySubstitutingClassDescriptor is not lazy. However, most of default types are,
and there is an optimization in KotlinTypeFactory, which uses default type for simple type without
type arguments and/or annotations. LazySubstitutingClassDescriptor's default type creates simple type
with factory, which may therefore cause recursion.

#KT-34029 Fixed
2019-10-25 11:59:27 +03:00
Dmitriy Dolovov
905823fb1d Fix: Notify user in IDE on K/N KLIBs with incompatible ABI version
Issue #KT-34159
2019-10-25 11:10:46 +07:00
Dmitriy Dolovov
8ffc58a77d Fix: Don't index and decompile incompatible .knm files from K/N KLIBs
Issue #KT-34159
2019-10-25 11:10:40 +07:00
Dmitriy Dolovov
9c887c1e79 Fix: Don't analyse incompatible K/N KLIBs in IDE
Issue #KT-34159
2019-10-25 11:10:34 +07:00
Vyacheslav Gerasimov
b1d7df697d Build: Add dependency on gradle plugin to android-extensions-idea module 2019-10-24 21:01:27 +03:00
Vyacheslav Gerasimov
e096691bd8 Build: Add dependency on gradle plugin to idea-android module 2019-10-24 19:32:16 +03:00
Mads Ager
52febbcc07 [JVM_IR] Support default interface suspend functions.
Do this by reordering the lowerings so that the lowering that
adds continuations happen after default methods have been
eliminated if needed.

Mark more functions as known to be tail-calls: bridges and
delegated members.

Preserve source info and annotations when creating replacement
functions.
2019-10-24 18:51:41 +03:00
Vladimir Dolzhenko
d16a1b14d8 Acquire lock for several seconds to create LightClasses to workaround dead-lock over resolve
Relates to #KT-34279
2019-10-24 17:32:36 +02:00
Alexander Udalov
c676a30919 Minor, clarify comment on SafePublicationLazyImpl.final 2019-10-24 16:57:54 +02:00
Alexander Udalov
c24f2d06d4 Mark value fields in ReflectProperties as volatile
These fields were originally non-volatile because of an incorrect
assumption I had at the time that a value was safely published if the
underlying object's class has at least one final field. This is true for
almost all values used in lazy/lazySoft: DeserializedFunctionDescriptor,
DeserializedPropertyDescriptor, KTypeImpl, java.lang.reflect.Field, etc.
But of course, this only means that the object was _safely initialized_
and not safely published via the non-volatile reference, where other
threads can still observe null, even after that constructed object was
leaked to the outer world by some other means and led to observable
changes in behavior.

This can fix some concurrency issues in kotlin-reflect. I wasn't able to
reproduce the problem in stress tests though.
2019-10-24 16:57:53 +02:00
Kristoffer Andersen
8af3b3e51e [Backend] Reorganize version 1.0 codegen tests
- Extract all backend codegen tests that specifically target behaviour
  in to-be-deprecated functionality from language versions < 1.3"
- Remove those tests from the JVM IR test suite.
2019-10-24 16:51:19 +02:00
Vyacheslav Gerasimov
38ea5a85a3 Build: Add maven publication for Kotlin plugin artifacts 2019-10-24 17:06:19 +03:00
Ilya Gorbunov
c1cb6da436 Use stable compiler option for enabling progressive mode 2019-10-24 16:05:48 +03:00
Ilya Gorbunov
59482f6827 Do not blank opt in for allowing kotlin package in all subprojects
-Xallow-kotlin-package must be specified explicitly to prevent
unintended declarations in kotlin package.
2019-10-24 16:05:48 +03:00
Kevin Bierhoff
5c9cbf7e77 allow relative friend paths matching relative classpaths 2019-10-24 14:56:46 +02:00
Yan Zhulanow
68deedb589 Kapt: Register AP options as inputs in worker mode as it done with kotlinc compiler plugin mode
This commit fixes the 'KotlinAndroid32GradleIT.testKaptUsingApOptionProvidersAsNestedInputOutput()' test that started to fail after switching to the worker API mode by default.
2019-10-24 21:33:02 +09:00
Yan Zhulanow
958e6623fc Kapt: Enable worker API mode by default (KT-32832) 2019-10-24 21:33:02 +09:00
Ivan Gavrilovic
68723125f2 Clean up KAPT incremental tests
Remove redundant class to invalidate sources, because it is already
handled in the KaptContext constructor.
2019-10-24 21:33:01 +09:00
Yan Zhulanow
7fc25a9c04 Pill: Add GenerateRuntimeDescriptorTests to the "Generate all tests" run configuration (KT-34494) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
2cb055a3bd Debugger: Log evaluation status from Java contexts
IntelliJ doesn't call KotlinDebuggerEvaluator from Java contexts; instead, it calls JavaDebuggerEvaluator.
Unfortunately, there seems to be no way to figure out the exact evaluation type for Java contexts. However, we can at least log the evaluation status itself.
2019-10-24 21:33:01 +09:00
Yan Zhulanow
6bf15b6d37 Kapt: Generate constant value initializers for mutable properties (KT-30164, KT-29355) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
9edd4554a9 Kapt: Support @Deprecated annotations (KT-30368) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
1309c0c67a An attempt to fix flaky debugger tests 2019-10-24 21:33:01 +09:00
Yan Zhulanow
bf027fb824 Do not show Smart Step Into targets for @InlineOnly callables (KT-33728) 2019-10-24 21:33:00 +09:00
Yan Zhulanow
ff7f1c62a9 Minor: Refactor KotlinMethodStepTarget a bit 2019-10-24 21:33:00 +09:00
Yan Zhulanow
87e0a2d98c Debugger: Fix evaluation of function declarations with expression bodies (KT-32704)
Before this commit, the substituted FunctionDescriptor didn't have a source element.
As a result, 'CodeFragmentParameterAnalyzer.isCodeFragmentDeclaration' failed to recognize such a descriptor as fragment-local, and it was erroneously captured.
2019-10-24 21:33:00 +09:00
Yan Zhulanow
fa45122c6b Minor: Fix warnings in KtCodeFragment 2019-10-24 21:33:00 +09:00
Yan Zhulanow
716c9f79f7 Debugger: Do not use expression code fragments for evaluator (KT-32736, KT-32741)
It seems like it doesn't make much sense to create expression code fragments.
People type statements or several expressions separated with a semicolon to a single-line expression line.
That is exactly what block code fragment was designed for.
2019-10-24 21:33:00 +09:00
Yan Zhulanow
39662c09e9 Debugger: Fix breakpoints and stepping on a first line (KT-33304)
This commit fixes the 'SmartStepIntoTestGenerated#testFunWithExpressionBody' test.
2019-10-24 21:32:59 +09:00
Yan Zhulanow
c3e46ebe5c Debugger: Search candidates for smart step into in a read action 2019-10-24 21:32:59 +09:00
Yan Zhulanow
9cc7ff0efc Debugger: Fix "smart step into" for library declarations (KT-33303) 2019-10-24 21:32:59 +09:00
Yan Zhulanow
c6a5733b3d Debugger: Move 'smart step into' classes to the 'smartStepInto' package 2019-10-24 21:32:59 +09:00
Yan Zhulanow
d2b058c1e5 Debugger: Extract Smart step visitor 2019-10-24 21:32:58 +09:00
Yan Zhulanow
8325216d38 Debugger: Fix "Step over" with inline function calls in non-functions (KT-20342) 2019-10-24 21:32:58 +09:00
Yan Zhulanow
7bd628f989 Debugger: Check max document index before figuring out line offsets 2019-10-24 21:32:58 +09:00
Yan Zhulanow
d7eb0f4bb0 Debugger: Cleanup stepping code 2019-10-24 21:32:58 +09:00
Yan Zhulanow
00a06ef9b9 Debugger: Move "Show Kotlin variables" check button to the Debugger settings menu (KT-30909) 2019-10-24 21:32:58 +09:00
Yan Zhulanow
f93549748a Fix a number of compiler/IDE warnings in IDE and kapt modules 2019-10-24 21:32:57 +09:00
Yan Zhulanow
9fb622e148 Debugger: Do not disable breakpoints on evaluation (KT-12242) 2019-10-24 21:32:57 +09:00
Ilya Goncharov
d46510897b [Gradle, JS] Refactor and extract team city formatting in separate file 2019-10-24 15:00:31 +03:00
Ilya Goncharov
7f49caf503 [Gradle, JS] Depends node test on our own mocha reporter 2019-10-24 15:00:31 +03:00
Ilya Goncharov
e69ff4363f [Gradle, JS] Copy mocha-teamcity-reporter with licensies 2019-10-24 15:00:31 +03:00
Ilya Goncharov
1ad8ecabfd [Gradle, JS] Fully copy of karma-teamcity-reporter (remove npm dependency on it) 2019-10-24 15:00:31 +03:00
Ilya Goncharov
0c911f4359 [Gradle, JS] Fix module.exports for adapter and modulization
- semicolon should be before Function expression, because in JS Standard there is no terminated semicolons
- If use output.libraryExport for Webpack, entry files for karma should export something

#KT-34554 fixed
#KT-34555 fixed
2019-10-24 14:58:57 +03:00
pyos
75aef4633a JVM_IR: add accessors for protected members in divergent hierarchies
Class B : A cannot access a protected field of A through a reference to
an instance of C : A.
2019-10-24 12:46:48 +02:00
Mikhail Glukhikh
5e2b594638 FirBodyResolveTransformerAdapters: optimize imports 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
e14b63dfe1 FIR Java enhancement: get rid of FirAnnotationCall.resolvedFqName 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
be6100527b FIR Java enhancement: fix JVM signature generation for type parameters 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
47cf7373af Add extra tests for FIR J/K type mapping 2019-10-24 13:04:26 +03:00
Mikhail Glukhikh
dc657dfda5 FIR Java refactoring: calculate JVM signatures directly by Java types 2019-10-24 13:04:26 +03:00
Vladimir Dolzhenko
6250f1a042 Detects main method with argument Array<String?> 2019-10-24 11:06:13 +02:00
Mikhail Glukhikh
cb3d027463 Fix typo in file name 2019-10-23 20:26:03 +03:00
Mikhail Glukhikh
f63c3aeac9 Extract FirMemberScopeProvider to a separate file 2019-10-23 19:28:42 +03:00
Mikhail Glukhikh
b86f529a8a Minor: add a pair of TODO about FIR scopes 2019-10-23 19:28:41 +03:00
Mikhail Glukhikh
e28d41aa61 FIR supertype resolve: decrease priority of type parameter scope 2019-10-23 19:28:41 +03:00
Mikhail Glukhikh
634f324f51 FIR supertype resolve: generate error types for type parameters 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
15a8da5f7b Rename: Fir...UseSiteScope -> Fir...UseSiteMemberScope 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
bb60a8f334 Code cleanup: get rid of FirPosition 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
374c3b4561 Cache FirSelfImportingScope and callables inside 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
f136813059 Return "lazy" kind of nested classifier scope for special cases 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
bf75274053 Organize FirClassDeclaredMemberScope & FirNestedClassifierScope in the similar way 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
17b966daaa Unify API of FirScope.processClassifiersByName (use ProcessorAction) 2019-10-23 19:28:39 +03:00
Pavel Kirpichenkov
d886d48cf0 Record resolution results for ambiguous callable references
#KT-34282 Fixed
2019-10-23 18:52:53 +03:00
Stanislav Erokhin
352a4dc836 Added extension points to the second compiler.xml
This is a workaround for KT-34528.
Extension points from 26728711
2019-10-23 18:14:35 +03:00
Igor Yakovlev
2dfe3c568d Copy refactoring update kotlin packages on target files
Fix #KT-18191
2019-10-23 16:44:18 +03:00
Igor Yakovlev
59a6f03a47 Copy refactoring refactoring 2019-10-23 16:44:18 +03:00
Vladimir Dolzhenko
072b67442f Detects main method with argument Array<String?> 2019-10-23 15:36:31 +02:00
Dmitry Gridin
474645f04f idea-core: fix compatibility of insertMembersAfter function 2019-10-23 20:10:34 +07:00
Dmitriy Novozhilov
45de26763a [FIR] Fix import broken in 93a3c232 2019-10-23 15:50:43 +03:00
Dmitriy Novozhilov
93a3c23292 [FIR] Split FirBodyResolveTransformer to separate transformers 2019-10-23 15:21:26 +03:00
Anton Bannykh
a1569dfbf0 JS IR: fix circular dependencies in Gradle tasks 2019-10-23 13:17:29 +03:00
Ilya Goncharov
651dd363e3 [Gradle, JS] Add timeout property 2019-10-23 13:04:41 +03:00
Nikolay Krasko
ebf5e4b590 Mute IncrementalJsKlibCompilerRunnerTestGenerated tests (KT-34538)
#KT-34538 Fixed
2019-10-23 12:49:49 +03:00
Nikolay Krasko
e1a5a55972 Refactoring: remove ownImports method 2019-10-23 12:49:49 +03:00
Nikolay Krasko
6d5dc6ea9a Allow to auto-generate files for asserting failures 2019-10-23 12:49:48 +03:00
Nikolay Krasko
4ed64b0283 Regenerate tests with TargetBackend.ANY remove and using runTest with this 2019-10-23 12:49:48 +03:00
Nikolay Krasko
28abfe6dfa Avoid generating irrelevant imports in test classes
Now methods can request generating additional imports.
2019-10-23 12:49:47 +03:00
Nikolay Krasko
0c5dc507e9 Allow to add additional annotations to generated classes 2019-10-23 12:49:47 +03:00
Nikolay Krasko
b885b848f4 Allow to mute test working with directories 2019-10-23 12:49:47 +03:00
Nikolay Krasko
f3e5b8c67f Allow to setup additional extension for mute with annotation 2019-10-23 12:49:47 +03:00
Nikolay Krasko
98ac2af402 Use TargetBackend.ANY as default parameter and migrate to more generic runTest method 2019-10-23 12:49:47 +03:00
Nikolay Krasko
3891f9fcaa Refactoring: extract tests files utilities to separate class 2019-10-23 12:49:47 +03:00
Nikolay Krasko
2c0ce40f75 Refactoring: extract test dummy traces 2019-10-23 12:49:47 +03:00
Nikolay Krasko
fda2022214 Refactoring: extract mutation with file logic to separate file 2019-10-23 12:49:47 +03:00
Nikolay Krasko
a9c84299c6 Allow to auto-mute tests with file 2019-10-23 12:49:46 +03:00
Nikolay Krasko
e4436c80c4 Refactoring: extract mute with file to the separate method 2019-10-23 12:49:38 +03:00
pyos
55acc296a2 JVM_IR: never create temporaries in $default stubs
Given the strict pattern-matching in the inliner, this is the only way
to make it not crash when attempting to inline these stubs. Note that
the IR backend does not currently use the inliner's default method stub
handling; the crash only occurs when a module compiled with the non-IR
JVM backend is attempting to call an inline function with default
arguments defined in a module that was compiled with the IR backend.
2019-10-23 11:11:16 +02:00
Alexander Udalov
95be7171bc JVM IR: fix "null" as the first entry in MappedEnumWhenLowering
If "null" was the first entry in an optimizable "when" over enum,
mapRuntimeEnumEntry was called before mapConstEnumEntry, and the
$WhenMappings field was not created. Now both mapConstEnumEntry and
mapRuntimeEnumEntry create this field on the first access
2019-10-23 11:03:22 +02:00
Efeturi Money
35d7bb4a26 Add support for @CompilerOptions annotation for supplying compiler
options from scripts.

#KT-34274 fixed
2019-10-23 11:37:28 +03:00
pyos
8c6916af52 JVM_IR inliner fixes: remove code that does nothing
other than randomly throw assertion errors on inline calls in synthetic
functions, which have no line number attached.

`lazySourceMapper.callSiteMarker` is set in `InlineCodegen.inlineCall`;
`IrSourceCompilerForInline.doCreateMethodNodeFromSource` does not need
to touch it.
2019-10-22 19:29:42 +03:00
Toshiaki Kameyama
60f4ed914a "Add parameter to function" quick fix: apply for TYPE_MISMATCH error
#KT-8478 Fixed
2019-10-22 21:22:33 +07:00
Pavel Kirpichenkov
636f5da883 [Minor] Inline and drop reduntant isCallableReflectionType property 2019-10-22 14:51:04 +03:00
Pavel Kirpichenkov
02fc921eed Report diagnostics about callable reference resolution ambiguity
Found diagnostics were not reported before.
#KT-32862 In Progress
2019-10-22 13:50:59 +03:00
Pavel Kirpichenkov
138d558f6a Fix compiler exception during resolution of ambiguous callable references
Function return type can't and should not be used during overload resolution of callable references.
Since it can be DeferredType, its substitution in CS caused exception.
2019-10-22 13:20:27 +03:00
Mads Ager
8b97819c04 [JVM_IR] Support suspend functions that can be overriden.
The challenge for overridable suspend functions is that the calling
the state machine method to resume after suspension would be
virtually dispatced to the wrong method. To avoid that a static
suspend implementation method is generated which becomes the
state machine method used to resume.
2019-10-22 12:48:21 +03:00
Dmitry Petrov
eebb071ae9 KT-34509 Properly unwrap callable reference descriptor
NB there's a problem with callable references to SAM constructors,
see also KT-16789
2019-10-22 12:30:15 +03:00
Dmitry Petrov
7dde503697 KT-34500 Use correct loop parameter type in ForInArrayLoopGenerator 2019-10-22 12:23:59 +03:00
Toshiaki Kameyama
bdc04547cc "Redundant qualifier name": fix false positive with inner class as constructor parameter for outer
#KT-33123 Fixed
2019-10-22 13:44:10 +07:00
Igor Yakovlev
bc66834c3c Fix UL classes descriptors leaks
UL classes built upon descriptors and UL support classes are saving a descriptors.
This could lead to descriptors leakage so we have to eliminate any fields with descriptor references.

Fixed #KT-34337
2019-10-21 22:04:49 +03:00
Andrey Uskov
b01014982f Disable new MPP kapt paths importing test in IDEA 183 2019-10-21 21:38:52 +03:00
Andrey Uskov
0188a0923e Update Kotlin plugin in KaptImportingTests
#KT-34033 Fixed
2019-10-21 21:38:49 +03:00
Andrey Uskov
40bb48e19b Fix actualisation of common source sets when HMPP is disabled
#KT-34256 Fixed
#KT-34402 Fixed
2019-10-21 21:38:45 +03:00
pyos
847e287bd6 JVM_IR: add $assertionsDisabled when an inlined function uses it
NOTE: jvmCrossinlineLambdaDeclarationSite.kt is muted because the
inliner does not remap references to an anonymous object's parent
class after regenerating it. Unlike the JVM backend, JVM_IR uses the
top level named class' assertion status for all inner classes. (The
test used to pass because the lambda in `inline fun call` read the
`$assertionsDisabled` field of `CrossinlineLambdaContainer`, which
was not reloaded after changing the assertion status of package `test`.)
2019-10-21 21:05:18 +03:00
Leonid Startsev
e89aabbba1 Provide a diagnostic when @Serializable annotation is missing on enum.
It is required when enum members contain some special annotations which should be recorded in descriptor.
Due to some recursive/lazy resolve problems, compiler plugin frontend can't infer @Serializable on enum automatically, therefore, we ask a user to explicitly provide it.

Also fix ir tests
2019-10-21 19:48:29 +03:00
Leonid Startsev
3c9a02e271 Associate serializers added via @UseSerializers by argument class, not type
Use class instead of type because MyType<T> and MyType<Int> are different types, therefore map lookup was failing.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/533
2019-10-21 19:48:27 +03:00
Leonid Startsev
855a867893 Support sealed, generic and abstract polymorphic inheritors in sealed class serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev
1ebc65b8e4 Sealed classes serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev
72f8f2b7b5 Custom-serializable enums for IR 2019-10-21 19:48:24 +03:00
Leonid Startsev
bd8133e02c Custom-serializable enums for JS 2019-10-21 19:48:24 +03:00
Leonid Startsev
e76ab06029 Custom-serializable enums for JVM 2019-10-21 19:48:23 +03:00
Leonid Startsev
e9e7d1479a Remove redundant additional check for @Polymorphic annotation 2019-10-21 19:48:23 +03:00
Leonid Startsev
8a90b82e9b Object serialization for JVM, JS and Native 2019-10-21 19:48:22 +03:00
Toshiaki Kameyama
449c406e24 Redundant visibility modifier: do not report for public modifier that overrides protected setter visibility
#KT-33580 Fixed
2019-10-21 23:45:09 +07:00
Toshiaki Kameyama
e8effe6727 Replace with safe call: do not add redundant elvis operator
#KT-34432 Fixed
2019-10-21 23:28:19 +07:00
Vladimir Dolzhenko
fa0398ffd3 Fix readAccess in ScriptExtraImportsProviderExtension on checking isScript
#EA-214435 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko
34e941f26f Render unresolved types in a presentable way in refactorings
#KT-34459 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko
7ecaef377f Fix readAccess in KtFileClassProviderImpl on checking isScript
#EA-214283 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
30229da95a Don't render pure error types in OverrideMemberChooserObject
#KT-34379 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
148a6bd54d Fix read action in 'searchReferences'
#EA-209421 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
96198a1cd3 Report no parent KtNamedDeclaration for declaration instead of NPE in BindingContextUtils.getEnclosingDescriptor
#EA-210816 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
46a083cd1e Fix readAccess in ResolveSession.java on checking is a local declaration
#EA-213627 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
78527abad9 Fix readAccess in TargetPlatformDetector.java on checking is file a script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
15997bf635 Save change script configuration within a transaction
#EA-214281 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
625dbfa699 Fix readAccess in getModuleInfo.kt on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
ba01678abb Fix readAccess in IDELightClassGenerationSupport on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:05 +02:00
Vladimir Dolzhenko
10ea8abc2b Wrap file.declarations with runReadAction
#EA-209932 Fixed
2019-10-21 17:18:04 +02:00
Alexander Gorshenev
597e760fab Broght back a condition lost during a refactoring 2019-10-21 17:41:56 +03:00
Roman Artemev
2cde7f2402 [KLIB] Fix explicitlyExported mode
- Refactor deserialization pipeline
 - Fix K/N test
2019-10-21 17:41:56 +03:00
Roman Artemev
43e855150c [KLIB] Correctly restore top level property order during deserialization - Add test - Fix KT-34273 2019-10-21 17:41:56 +03:00
Roman Artemev
aecd08e562 [Psi2Ir] Fix IrText test generation 2019-10-21 17:41:55 +03:00
Ilya Goncharov
6ddc05a5a8 [Gradle, JS] Fix for wildcard npm dependency version
#KT-34460 fixed
2019-10-21 17:37:07 +03:00
Ilya Goncharov
e17b9097df [Gradle, JS] Add test on success installation of duplicated dependencies 2019-10-21 17:29:47 +03:00
Ilya Goncharov
bdd6186a07 [Gradle, JS] Resolve devDependencies and dependencies modules clash 2019-10-21 17:29:46 +03:00
Ilya Goncharov
fa647680d3 [Gradle, JS] Update npm dependencies
- Karma - provide possibility to check exit code
- Webpack - bug fixes
- Mocha - bug fixes
2019-10-21 17:28:49 +03:00
Ilya Goncharov
2cf79b7502 Check Karma exit code with disabled failOnFailingTestSuite
https://github.com/karma-runner/karma/pull/3116
2019-10-21 17:28:49 +03:00
Denis Zharkov
d902a5f304 Temporary disable assertion in bridges generation
^KT-34431 Fixed
^KT-34507 Open
2019-10-21 17:24:15 +03:00
Kristoffer Andersen
28b6913a25 JVM IR: Support parameterless main methods
This commit:

- introduces tests explicating what is and isn't considered a
  proper main method on the JVM backends.
- implements support for parameterless main methods on the JVM IR
  backend
- See KT-34338 for more tests.
2019-10-21 15:08:34 +02:00
Mads Ager
4b77db8979 Fix test to actually fail if expected exception is not thrown. 2019-10-21 15:05:32 +02:00
Mikhail Glukhikh
1a59e41224 Add JvmSymbols.String & StringBuilder for FIR mode to fix context initialization
This commit fixes in particular testFirHello
2019-10-21 16:01:35 +03:00
pyos
0c3dfca6ee JVM_IR: remove an assertion that triggers due to a frontend bug 2019-10-21 14:59:03 +02:00
Nikolay Krasko
e5cc0eec9c 193: Adjust test data for HierarchyTestGenerated tests in 193 2019-10-21 15:52:33 +03:00
Nikolay Krasko
693603db68 193: Mute join lines tests in 193 (KT-34408) 2019-10-21 15:52:33 +03:00
Nikolay Krasko
9665870118 Fix AbstractSmartStepIntoTest tests in 193 2019-10-21 15:52:33 +03:00
DmiitriiJarosh
613fbf7a5d Merge else-if intention (KT-34218)
#KT-34218 Fixed
2019-10-21 15:52:32 +03:00
Jim Sproch
383239aff6 Make useIR available from Gradle KotlinJvmOptions 2019-10-21 13:20:54 +03:00
Mads Ager
8be6a1fe8a [JVM_IR] Contain 'invokeSuspend' rewriting to the suspend function.
Do not rewrite returns in methods in nested lambda implementations.
That leads to unintended non-local returns from nested non-suspend
lambdas.
2019-10-21 13:16:57 +03:00
Ilmir Usmanov
78b9c082e7 JVM_IR: Generate 'create' for suspend lambdas with one parameter 2019-10-21 13:15:45 +03:00
Ilmir Usmanov
5eeb2958f7 JVM_IR: Support is/as SuspendFunction operators 2019-10-21 13:15:43 +03:00
Ilmir Usmanov
6f47699796 JVM_IR: Calculate correct arity of callable reference to suspend
function
2019-10-21 13:15:41 +03:00
Ilmir Usmanov
b0a0399dd0 JVM_IR: Support callable references to suspend functions 2019-10-21 13:15:39 +03:00
Ilmir Usmanov
e736b782dd JVM_IR: Support suspend lambdas with multiple parameters 2019-10-21 13:15:37 +03:00
Ilmir Usmanov
f4a7c839d3 JVM_IR: Generate as much LINENUMBER information as possible inside
suspend functions and lambdas.

Otherwise, when state-machine builder splits instructions and adds
LINENUMBER between states, the information becomes corrupted.
2019-10-21 13:15:35 +03:00
Dmitry Petrov
69a9559eac IR serialization: isExpect in proto and ser/deser 2019-10-21 13:04:59 +03:00
Dmitry Petrov
922b1e576d IR serialization: isExpect (TODO actual value in proto) 2019-10-21 13:04:59 +03:00
Dmitry Petrov
66b63c4296 JS_IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
e87517764d JVM_IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
6bdc9ee65b IR BE common: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
1d229b6dca FIR2IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
6532f29cc6 IR: isExpect 2019-10-21 13:04:59 +03:00
Ilya Matveev
3a234d46ed Gradle, native: Support watchOS and tvOS in CocoaPods plugin
Issue #KT-34329 fixed
2019-10-21 12:43:20 +03:00
Dmitriy Novozhilov
4df4c58a05 [FIR] Resolve type of when expression to Unit if it is not exhaustive 2019-10-21 11:59:44 +03:00
Toshiaki Kameyama
131567474a "Redundant qualifier name": fix false positive with enum constant initialized with companion object field
#KT-33526 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama
27eea882fb ChangeVisibilityFix: remove redundant property setter
#KT-33796 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama
48968c0fe2 Replace deprecated symbol usage: do not include 'Companion' in import directives when importing companion object
#KT-34078 Fixed
2019-10-21 15:55:04 +07:00
Dmitriy Novozhilov
5250421002 Regenerate tests forgotten in f19a8789 2019-10-21 10:47:15 +03:00
Dmitriy Novozhilov
b8bc449bc3 [FIR] Fix generating of redundant empty else branch in light tree fir generator 2019-10-21 10:44:30 +03:00
Ilya Chernikov
d97e497da0 Remove embeddable tests - they are causing conflicts...
between embeddable compiler contents and intellij sdk modules
To make it work, the dependencies to the intellij sdk should
be eliminated
2019-10-19 11:22:55 +03:00
Ilya Chernikov
08b77bc916 Implement tests to sam-with-receiver support in new scripting API
plus minor tests refactoring
2019-10-19 11:22:55 +03:00
Ilya Chernikov
cf3bf5a9b9 [minor] Fix files and jars pattern matching on windows 2019-10-19 11:22:54 +03:00
Igor Yakovlev
8c65a9a2aa Move AllOpen UL support to separate extension 2019-10-18 23:22:48 +03:00
Igor Yakovlev
58b8d8868a Remove fallbacking of UL (to LightClasses) by complexity checking 2019-10-18 23:22:47 +03:00
Igor Yakovlev
3f9bffcc5f Move UL compiler plugin support to separate extension point 2019-10-18 23:22:47 +03:00
Igor Yakovlev
6ce37fff95 Add UL support for AllOpen compiler plugin 2019-10-18 23:22:47 +03:00
Igor Yakovlev
558a700f51 Add UL support for ParcelableCodegenExtension compiler plugin 2019-10-18 23:22:47 +03:00
Igor Yakovlev
110a6700e4 Add UL support for NoArg compiler plugin 2019-10-18 23:22:47 +03:00
Mikhail Glukhikh
c9f6482f25 Throw exception from FIR smoke test if failure file does not exist
It's more convenient to see exception from the beginning and
not a strange message about generated .fir.fail file
2019-10-18 20:40:21 +03:00
Steven Schäfer
eb744cc9e1 JVM IR: Fix constant folding for unsigned toString 2019-10-18 17:24:53 +02:00
Steven Schäfer
c905209504 JVM IR: Lower IrStringConcatenation 2019-10-18 17:24:53 +02:00
Steven Schäfer
78b4024ccb JVM IR: Unify the handling of IrStringConcatenation and toString 2019-10-18 17:24:12 +02:00
Steven Schäfer
c2de89cb8c Minor: Make String.valueOf bytecode tests more precise 2019-10-18 17:24:12 +02:00
Steven Schäfer
64aa50a921 Add more tests for SAM wrappers 2019-10-18 17:22:58 +02:00
Steven Schäfer
c3d0a7582c JVM IR: Fix names, caching, and visibilities for SAM wrappers used in inline functions. 2019-10-18 17:22:58 +02:00
Steven Schäfer
f2e0c1a930 JVM IR: Minor fix for nullable SAM wrappers 2019-10-18 17:22:58 +02:00
Dmitriy Novozhilov
4d43c13fb1 [FIR] Add logging to artifact in ModularizedTest for old frontend 2019-10-18 18:21:36 +03:00
Steven Schäfer
f2d01aeabd Update serialization IR bytecode listing test 2019-10-18 17:20:22 +02:00
Steven Schäfer
18940ab0cb JVM IR: Refactor SyntheticAccessorLowering to use a single traversal 2019-10-18 17:20:22 +02:00
Steven Schäfer
3098723406 Minor: Fix outdated test 2019-10-18 17:20:22 +02:00
Steven Schäfer
3db3f5bf7f JVM IR: Don't compute signatures in CallableReferenceLowering 2019-10-18 17:20:22 +02:00
Steven Schäfer
417c570243 IR: Fix InnerClassConstructorCallsLowering
Prevent repeated passes over nested functions.
2019-10-18 17:20:22 +02:00
Steven Schäfer
a8730eae62 Minor: Fix error message in reflection.jvm 2019-10-18 17:20:22 +02:00
Steven Schäfer
21af7dfbe1 Add tests for constructors taking inline class arguments 2019-10-18 17:20:22 +02:00
Steven Schäfer
9389d88232 JVM IR: Hide constructors with inline class parameters 2019-10-18 17:20:22 +02:00
Steven Schäfer
bdd5705a30 JVM IR: Fix test for anonymous object constructors in FunctionCodegen 2019-10-18 17:20:22 +02:00
Roman Golyshev
6560ecc82b KT-15286: Provide object member extensions in the completion
- Add extensions only when completion of static members is enabled (double ctrl + space and nonempty prefix)
- Add full import for callables with receiver in `LookupElement.decorateAsStaticMember`
2019-10-18 17:17:28 +03:00
Toshiaki Kameyama
15613afa20 Control flow with empty body: do not report 'if' with comments
#KT-34325 Fixed
2019-10-18 21:07:52 +07:00
Dmitriy Novozhilov
615d3aafef [FIR] Automatically generated abstract classes instead of interfaces if possible 2019-10-18 16:45:14 +03:00
pyos
6b48112a2b IR: deserialize backing field annotations
Probably going to be necessary for handling imported @JvmField
annotated declarations.
2019-10-18 16:43:53 +03:00
Dmitriy Novozhilov
ecf98d3141 Regenerate tests forgotten in f19a8789 2019-10-18 16:03:41 +03:00
Toshiaki Kameyama
74970ddfeb Introduce "Unused unary operator" inspection
#KT-12073 Fixed
2019-10-18 18:50:53 +07:00
Jordan Demeulenaere
158f7f1cd7 Avoid PsiFile searching when resolving imported scripts descriptors. 2019-10-18 13:17:28 +03:00
Mikhail Glukhikh
91a58fffb8 Add CLI test for K/javac project with non-transitive dependency, KT-33932 2019-10-18 12:29:05 +03:00
Mikhail Glukhikh
87e2f9d96b Add CLI test for K/javac project with K/J interdependency
Yet this test fails if JavacWrapper does not add Kotlin output dir to classpath
2019-10-18 12:02:04 +03:00
Mikhail Glukhikh
9f3d834b2a JavacWrapper: optimize building of tree-based stuff 2019-10-18 11:56:18 +03:00
Mikhail Glukhikh
39ff04e043 JavacWrapper: optimize toJavacList away 2019-10-18 11:55:59 +03:00
Georgy Bronnikov
7f32f43a48 Pass isIR flag from KotlinToJVMBytecodeCompiler to GenerationState 2019-10-17 16:44:20 +03:00
pyos
d1f25d1c26 JVM_IR: discard results of nonexhaustive whens' branches 2019-10-17 15:41:42 +02:00
Dmitriy Novozhilov
cfa9950c22 [FIR] Fix building CFG and resolving when expression without branches 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
f8f2d8b9a1 [FIR] Add FirAbstractElement as base type for all fir node implementations 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
f19a878948 [FIR] Add exhaustive checker for when expressions
Also remove generating default else branch introduced in 38fa0122 and 54eb4cf9
2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
25e853606e [FIR] Add deserialization of inheritors of sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
3dc49ab1d4 [FIR] Add resolve phase for resolving inheritors of sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
59fd47bfd0 [FIR] Add special node for sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
d0089c6747 [FIR] Add flag that enables fir dump in modularized test 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
2ec305b34e [FIR] Don't generate replace and transform in implementations with kind = Interface 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
f86f582922 [FIR] Automatically make field mutable if it has replace function 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
89fc17da41 [FIR] Allow generate boolean fields with replace 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
2c2a1cdfe8 [FIR] Fix smartcasts in when expressions with this subject
Also get rid of excess `getOrCreateRealVariable` function.
2019-10-17 16:20:58 +03:00
Kirill Shmakov
739340a57d Rename cidr-native -> common-cidr-native
Modules in :kotlin-ultimate:ide
2019-10-17 14:15:43 +03:00
Mikhael Bogdanov
c78dbaf6b3 Initializer default values in 'tailrec' method in proper order
#KT-31540 Fixed
2019-10-17 13:06:36 +02:00
Mikhael Bogdanov
077092d619 Convert TailRecursionCodegen.java to Kotlin 2019-10-17 13:06:35 +02:00
Mikhael Bogdanov
2eda7cb4b0 Rename .java to .kt 2019-10-17 13:06:34 +02:00
Mikhail Glukhikh
b3d8f2d677 Introduce AbstractFirUseSiteScope and store common J/K code there 2019-10-17 13:39:33 +03:00
Mikhail Glukhikh
fb22a31976 JavaClassUseSiteScope is made not-provider based
Before this commit, Java use-site scope was provider based for some reason.
In fact, provider was not used in this scope anyway,
so this can be safely removed
2019-10-17 13:39:33 +03:00
Mikhail Glukhikh
79c0a69219 Add new FIR tests related to KT-31508 problems, replace failing MM testJava...Signature 2019-10-17 13:39:32 +03:00
pyos
27094d0371 JVM_IR: fix synthetic accessor generation (again)
Turns out private inline functions *can* be called from other classes.
2019-10-17 12:38:19 +02:00
Toshiaki Kameyama
89180e2650 Redundant companion reference: fix false positive with Java synthetic property
#KT-33771 Fixed
2019-10-17 17:17:44 +07:00
Toshiaki Kameyama
d72e55d1b7 Add "Make private and overrides member" quick fix for ACCIDENTAL_OVERRIDE
#KT-18536 Fixed
2019-10-17 17:08:03 +07:00
Vladimir Dolzhenko
30b98aaeb7 Keep attachments of cause exception in KotlinExceptionWithAttachments and provide elements in attachments in case of errors during kotlin idea resolution
Relates to EA-210942, EA-209622 etc
2019-10-17 10:22:32 +02:00
Nikolay Krasko
39f4a95278 Remove unregisterComponentByInstance usages that fails in 193 2019-10-17 11:19:13 +03:00
Nikolay Krasko
a743835011 193: Fix compilation because method replace in 193 2019-10-17 11:19:13 +03:00
Nikolay Krasko
8d355f7003 Advance 193 version to 193.4697-EAP-CANDIDATE-SNAPSHOT 2019-10-17 11:19:13 +03:00
Nikolay Krasko
db913e519f Avoid using specific version because they may differ in different platforms 2019-10-17 11:19:13 +03:00
Nikolay Krasko
da9a25fd21 Minor: remove useless overrides 2019-10-17 11:19:13 +03:00
Dmitry Gridin
92bfb2788e idea: cleanup "Remove redundant qualifier name" 2019-10-17 14:30:25 +07:00
Dmitry Gridin
696b832a9c RemoveRedundantQualifierInspection: fix false positive for enum/object
#KT-34113 Fixed
#KT-32965 Fixed
#KT-33991 Fixed
#KT-33597 Fixed
2019-10-17 14:30:25 +07:00
Toshiaki Kameyama
a4f805ccd0 "Redundant qualifier name": add tests for enum/object
Relates to #KT-34113
Relates to #KT-32965
Relates to #KT-33991
Relates to #KT-33597
2019-10-17 14:30:25 +07:00
Andrey Uskov
866ab51ce5 Work-around for importing intermediate android source sets
Fixed failure on import fully actualized intermediate source sets with K2Metadata compiler arguments (Android plugin expects compiler arguments of another type)
2019-10-17 10:26:36 +03:00
Andrey Uskov
aa6ff4b9da Fix creation of common source roots if android plugin is involved
#KT-34237 Fixed
2019-10-17 10:26:28 +03:00
Andrey Uskov
a60cbef5d2 Do not build metadata dependency tree for platform source sets 2019-10-17 10:26:24 +03:00
Andrey Uskov
74f4a1357f Do not create deep copy for MPP project is model is not a proxy 2019-10-17 10:26:22 +03:00
Andrey Uskov
f567df283e Improved performance non-MPP projects import
#KT-32960 Fixed
2019-10-17 10:26:20 +03:00
Stanislav Erokhin
84aff5f630 Add some changes to introduced extension points 2019-10-17 04:41:29 +03:00
Jim
267287118b Frontend plugins to upstream
Change-Id: Id9203c92d0a711e4f21565bd225a465bd41db476
2019-10-17 04:41:27 +03:00
Steven Schäfer
4878c7967a JVM: Handle inline class equality in when statement with declaration
#KT-34268 Fixed
2019-10-16 19:23:49 +02:00
Ilya Gorbunov
bbdbc2896b Workaround in FloatMathTest.powers to avoid failures with js-ir runtime
Include kotlin-stdlib-js-ir in local core libs build/test and
enable failing build on test failures.

Relates to: KT-24975
2019-10-16 17:48:47 +03:00
Alexander Udalov
65c09a5e57 Minor, use experimental unsigned types in CityHash
This fixes 233 experimental usage API warnings
2019-10-16 15:00:31 +02:00
Alexander Udalov
d0b241b681 Minor, fix typo in -include-runtime argument help
#KT-34240 Fixed
2019-10-16 15:00:03 +02:00
Mikhael Bogdanov
adae629258 Report diagnostic on virtual tailrec function
#KT-18541 Fixed
2019-10-16 13:02:31 +02:00
Mads Ager
8305baa5fe [JVM_IR] Avoid unbounded recursion for recursive suspend functions.
Additionally, deal with primitive types in AddContinuationLowering.
2019-10-16 13:50:52 +03:00
Georgy Bronnikov
ed6ca7d67e JVM_IR: fix for SingletonReferencesLowering
When replacing an enum entry reference with `this`, you need to take
`this` from the function's `dispatchReceiverParameter`, not the class's
`thisReceiver`. Otherwise the code generator fails to find the reference
among accessible variables.
2019-10-16 13:19:40 +03:00
Nikolay Krasko
fa44cab9dc Extend compatibility for 193 branch to upcoming 201.* release 2019-10-16 13:03:58 +03:00
Dmitry Gridin
40c3e436d1 ShortenReferences: add test with lots of FqName with root prefix 2019-10-16 16:35:43 +07:00
Dmitry Gridin
bf7c325f43 Completion: should prefer ShortenReferences by elements instead of text range 2019-10-16 15:59:47 +07:00
Dmitry Gridin
2d43d71727 CompletionUtils: cleanup code 2019-10-16 15:59:47 +07:00
Dmitry Gridin
8161403e69 ShortenReferences: shouldn't analyze root prefix elements & should get rid of them at end
Relates to #KT-33937
2019-10-16 15:59:47 +07:00
Dmitry Gridin
aa364ea14e KotlinIntroduceImportAliasHandler: fix PIEAE 2019-10-16 15:36:20 +07:00
Dmitry Gridin
d9faaddcca delayedRequestsWaitingSet: performDelayedRefactoringRequests should commit all documents before refactoring
#KT-34365 Fixed
2019-10-16 15:36:00 +07:00
Dmitry Gridin
72eee17bff delayedRequestsWaitingSet: cleanup code 2019-10-16 15:36:00 +07:00
Ivan Gavrilovic
4e807692e5 KT-34167: Warn when incremental AP does not follow the contract
Isolating incremental AP must report exactly one originating source file.
This commit logs a warning when this constraint is violated.

Test: AnnotationProcessorDependencyCollectorTest.testIsolatingWithoutOrigin
2019-10-16 16:33:00 +09:00
Ivan Gavrilovic
8f94a71de7 KT-33617: Handle non-hierarchical URIs for incremental annotation processing
JDK9 may decide to load .java files from jar when resolving a type, even
when .class file exists in the same jar. Further on, these files will be
parsed and analyzed, which triggers the listener used by incremental
annotation processing. This commit avoids analyzing those files, and
makes sure URI passed from the compiler are such that a File instance
can be created.

Test: KaptIncrementalWithIsolatingApt.testSourcesInCompileClasspathJars
2019-10-16 16:33:00 +09:00
Ilya Gorbunov
941980c154 Cleanup FE analysis flag allowKotlinPackage
It was used to allow custom contracts when compiling stdlib
with the Kotlin 1.2 compiler. Since 1.3 compiler is used now, this
flag is no longer necessary.
2019-10-15 19:08:57 +03:00
Anton Yalyshev
1e921647fe Bump FUS Collectors versions after last changes for proper data fetching 2019-10-15 16:15:10 +03:00
Yan Zhulanow
d31f234311 Pill: Add kotlin-scripting-js module to Pill 2019-10-15 22:06:45 +09:00
Yan Zhulanow
9c88a1f807 Debugger: Fix language detection in FUS 2019-10-15 22:06:45 +09:00
Georgy Bronnikov
f3cae210f8 JVM_IR: handle type parameters in constructors for @JvmOverloads stubs 2019-10-15 14:55:18 +03:00
Ilya Goncharov
7ceb2c79b8 [Gradle, JS] Exclude output directory from conformance test 2019-10-15 14:09:28 +03:00
Ilya Goncharov
8ae43c6c36 [Gradle, JS] Add kotlin-source-map-loader' ignores to exclude in tests
- node_modules
- .gradle
2019-10-15 11:38:11 +03:00
Vladimir Dolzhenko
eb9875b6f5 Added missed kotlin-reflect to nj2k testRuntime 2019-10-15 09:33:57 +02:00
Kirill Shmakov
b76d58de54 Handle case when property is missed 2019-10-15 09:48:15 +03:00
Kirill Shmakov
02cedfde21 Make build more stable 2019-10-14 19:31:03 +03:00
Dmitry Gridin
20eb3fb492 referenceUtil: fix matchesTarget for import alias
#KT-30012 Fixed
#KT-30432 Fixed
#KT-30736 Fixed
2019-10-14 21:45:12 +07:00
Dmitry Gridin
348d2376b1 referenceUtil: cleanup code 2019-10-14 21:45:12 +07:00
Dmitry Gridin
20784d50ff CallableBuilder: fix PIEAE
#EA-214253 Fix
2019-10-14 21:45:12 +07:00
Dmitry Gridin
0ac2303fad KotlinSuppressIntentionAction: fix PIEAE
#EA-214227 Fix
2019-10-14 21:45:12 +07:00
Dmitry Gridin
e3d9f05d28 KotlinSuppressIntentionAction: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
3832924bd7 KotlinMavenPluginPhaseInspection: fix potential PIEAE 2019-10-14 21:45:11 +07:00
Dmitry Gridin
1e81f9499a KotlinMavenPluginPhaseInspection: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
a652a0f6b3 AddReifiedToTypeParameterOfFunctionFix: fix PIEAE 2019-10-14 21:45:11 +07:00
Dmitry Gridin
6898d437cf AddConstModifierFix: fix PIEAE
#EA-214417 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
bce2202ea3 LetImplementInterfaceFix: fix PIEAE
#EA-214415 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
859537a38d LetImplementInterfaceFix: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
2eb035aff2 generateUtil: fix PIEAE
#EA-142347 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
1a8796c79a LightClassDataHolder: shouldn't catch ControlFlowException 2019-10-14 21:45:10 +07:00
Dmitry Gridin
7c1f2e8735 LightClassDataHolder: cleanup code 2019-10-14 21:45:10 +07:00
Dmitry Gridin
87ac31d957 UsageReplacementStrategy: shouldn't catch ControlFlowException 2019-10-14 21:45:10 +07:00
Dmitry Gridin
585222b4bb ScriptDefinitionsManager: shouldn't catch ControlFlowException
#EA-209928 Fixed
2019-10-14 21:45:10 +07:00
Dmitry Gridin
ee8e9a76f9 KtScratchExecutionSession: shouldn't catch ControlFlowException
#EA-210849 Fixed
2019-10-14 21:45:10 +07:00
Nikolay Krasko
79cb10a755 Patch initializing EmptySubstitutor service and fix null references
There's a cycle in service initialization and PsiSubstitutor 'clinit'
2019-10-14 16:55:25 +03:00
Vladimir Dolzhenko
c20bdd3c30 Clean up after reusing allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 15:49:45 +02:00
pyos
d3992826e4 JVM_IR: discard parameter annotations in anonymous object constructors 2019-10-14 14:54:44 +02:00
Mark Punzalan
78465e280f Exclude additional generated testData/out-min dir in js/js.translator.
This was causing re-indexing in IntelliJ after every time the JS tests
are run.
2019-10-14 14:51:27 +03:00
Egor Ushakov
ea7f6dbd33 EA-208866 - IAE: SafeUtilKt.safeSourceName - fixed in platform 2019-10-14 12:55:18 +03:00
Nicolay Mitropolsky
f6e0e5b80d Uast: a workaround for getting parent for KotlinUAnonymousClass
when it is used in field initialisation
2019-10-14 11:30:20 +03:00
Ilya Goncharov
cb31b42930 [Gradle, JS] Update npm versions 2019-10-14 11:20:36 +03:00
Vladimir Dolzhenko
8bba596c4e Reuse allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 10:13:30 +02:00
Mikhail Glukhikh
88bc6b992f Move .gitattributes for generated files from fir:resolve to fir:tree 2019-10-14 11:12:19 +03:00
Ilya Goncharov
1b929cd93e [Gradle, JS] Add args instead of full override 2019-10-14 11:09:09 +03:00
Ilya Goncharov
ee49c96650 [Gradle, JS] Set cli args for yarn install 2019-10-14 11:09:09 +03:00
Vladimir Dolzhenko
7b0646d2a5 Reuse allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 09:57:04 +02:00
Dmitry Gridin
a24e229d7a CreateExpectedFix: should generate expect declaration in selected module
#KT-33933 Fixed
2019-10-14 14:42:29 +07:00
Dmitry Gridin
ac3009082f QuickFixMultiModuleTest: support hierarchy MPP 2019-10-14 14:42:29 +07:00
Nikolay Krasko
728ccdee63 Don't publish computed value to other threads till post compute is finished (KT-28940)
This fixes a race condition with counting supertypes (the only client
of createLazyValueWithPostCompute left at the moment).

 #KT-28940 Fixed
2019-10-13 18:21:38 +03:00
Nikolay Krasko
4f488ddd16 Remove lazy values with dummy post compute lambdas 2019-10-13 18:21:38 +03:00
Ivan Gavrilovic
fbde7e47e9 KT-33503: Avoid analyzing module-info.class in KAPT classpath
When analyzing classpath changes for incremental KAPT, avoid
analyzing module-info.class files.

Test: ClasspathAnalyzerTest
2019-10-13 15:14:40 +09:00
Ilya Kirillov
1ec620b753 New J2K: fix SOE in inference processing for star-projection as type argument
#KT-33942 fixed
#KT-33941 fixed
2019-10-12 15:28:03 +03:00
Ilya Kirillov
b350515237 New J2K: make post-processing aware of other files which are being converted
Before post-processing was able to handle only one converting file at once
So, some conversions (like (field, getter, setter) to Kotlin property)
was not able to work when converting class hierarchy was split into
multiple files.
Also, inferring nullability for a set of files was broken

#KT-19569 fixed
#KT-34266 fixed
#KT-32518 fixed
2019-10-12 12:50:34 +03:00
Ilya Kirillov
999918d499 New J2K: add multi-file conversion tests from old j2k 2019-10-12 12:50:34 +03:00
Ilya Kirillov
f951ed9dba New J2K: introduce external code processing for new J2K
It will update usages from files not in conversion scope to a valid ones:
1. When converting (field, getter, setter) triple from Java to a Kotlin property,
   it will:
      1. Update every usage of getter/setter in Java/Kotlin code to a usage of actual property
      2. If property is used in Java directly then will add @JvmField to it
2. When converting static method or static field without getter and setter, which has Java usages then add @JvmStatic to it

#KT-34164 fixed
2019-10-12 12:50:33 +03:00
Ilya Kirillov
7535c2f249 New J2K: fix expose internal/private type errors 2019-10-12 12:50:33 +03:00
Ilya Kirillov
d0f0b9e355 New J2K: do not allow field and method declarations to be internal
For internal members new names are generated,
So, references to them from Java will be broken
2019-10-12 12:50:32 +03:00
Alexey Trilis
b30537de0e Generate Kotlin/JS stdlib dependencies via dukat 2019-10-12 01:39:25 +02:00
Mikhail Zarechenskiy
83bb07e5ac Revert "Fix performance issue for case when there are a lot of warnings in file"
This reverts commit 3d8e5c4f8e.

 Temporarily reverting this commit due to new flaky tests
2019-10-12 00:44:00 +03:00
Sergey Igushkin
c13f55f0ad Cache PropertiesProvider, read the local.properties file lazily
Issue #KT-33980 Fixed
2019-10-11 21:32:20 +03:00
Sergey Igushkin
d0604ffde8 Fix requiresVisibilityOf in the Gradle plugin (KT-34312)
* Fix adding new items (which was untested, as the logic was only tested
 by unit tests)

* Exclude the source set's dependsOn transitive closure from the
requiresVisibilityOf checks (i.e. these source sets are considered
visible)

* Fix minor issues in the `UnsatisfiedSourceSetVisibilityException`
message

* Add `requiresVisibilityOf` to integration tests

Issue #KT-34312 Fixed
2019-10-11 21:32:08 +03:00
Kirill Shmakov
d7a48e7229 Add Native Debug plugin advertising 2019-10-11 19:21:15 +03:00
Mikhail Zarechenskiy
3d8e5c4f8e Fix performance issue for case when there are a lot of warnings in file
There was a problem with `reportDiagnosticOnce` method which was
 called, for example, to report diagnostics about experimentalities. It
 was crucial for code as in the issue (KT-34204).

 The whole complexity was "count of experimental diagnostics" multiply
 "count of all diagnostics" multiply very large constant. Almost on
 each `reportDiagnosticOnce` method `readonlyView()` was called which
 in turn called computation of cache. During cache computation we were
 iterating through the all diagnostics and also were using
 KotlinSuppressCache, which is not very fast.

 #KT-34204 Fixed
2019-10-11 18:47:54 +03:00
Mikhail Zarechenskiy
71cb5e07db Minor, don't recreate Set with the same values 2019-10-11 18:47:54 +03:00
Ilya Chernikov
1f46e60153 Implement samWithReceiver support for scripts when ...
it configured from script compilation configuration
#KT-34294 fixed
2019-10-11 17:43:50 +02:00
Ilya Chernikov
2568804eaa Instruct platform code to use NIO2 always
since we're not always use jna (means that we can get warnings about missing jna libs)
and according to the IDEA team, NIO2 works well enough to rely on it
2019-10-11 17:43:49 +02:00
Ilya Chernikov
d51291b187 [minor] Fix file pattern matching test and converting paths to universal separator on calling the walking function 2019-10-11 17:43:48 +02:00
Ilya Matveev
b7f9694f3a Fat frameworks: Run tests only on MacOS 2019-10-11 18:28:19 +03:00
Ilya Matveev
919c09d849 Fat frameworks: Support for watchOS and tvOS
Issue #KT-34259 fixed
2019-10-11 18:28:18 +03:00
Ilya Matveev
37e828d4aa Gradle, native: Disable watchOS x64
Currently a 64-bit simulator for watchOS is not available so
we disable this target.
2019-10-11 18:28:18 +03:00
Ilya Matveev
02504767aa Fat frameworks: Add tests 2019-10-11 18:28:18 +03:00
Ilya Matveev
57b111cbe8 Fat frameworks: Don't add simulators into CFBundleSupportedPlatforms
Issue #KT-32223 fixed
2019-10-11 18:28:18 +03:00
Ilya Goncharov
d978f9671e [Gradle, JS] Not consider mocha default arguments
#KT-33747 fixed
2019-10-11 17:51:02 +03:00
Ilya Goncharov
1fad109fc1 [Gradle, JS] Deprecate useNodeJs for compatibility 2019-10-11 17:51:02 +03:00
Ilya Goncharov
5957bda40c [Gradle, JS] Remove redundant NodeJs runner 2019-10-11 17:51:02 +03:00
Ilya Goncharov
7cde993b43 [Gradle, JS] Detect adapter automatically, not depends on JasmineLike 2019-10-11 17:51:02 +03:00
Ilya Goncharov
55fb9be7f6 [Gradle, JS] Remove copypaste for karma and nodejs test adapters 2019-10-11 17:51:02 +03:00
Ilya Goncharov
cb096db6be [Gradle, JS] useMocha by default 2019-10-11 17:51:02 +03:00
Ilya Goncharov
5c3c196f8e [Gradle, JS] Return result of testing function
- It is useful for async testing (Promise returning)
2019-10-11 17:51:02 +03:00
Ilya Goncharov
3b29112885 [Gradle, JS] Remove redundant related with JS test run 2019-10-11 17:51:02 +03:00
Ilya Goncharov
287351a4c2 [Gradle, JS] Only one sender of team city stdOut messages
- NodeJS and Browser tests should use one code to send TeamCity messages
2019-10-11 17:51:02 +03:00
Ilya Goncharov
a4c761aa33 Use team city messages for mocha test output 2019-10-11 17:51:02 +03:00
Ilya Goncharov
07e4b1f3de Migrate filtering adapter on mocha's initial adapter 2019-10-11 17:51:02 +03:00
Ilya Matveev
9ab2b928bc Gradle, native: Add a DSL shortcut for iOS, watchsOS and tvOS
This patch adds a group of shortcut DSL methods allowing a user to
create simulator and device targets for Apple platforms along with
corresponding common source set(s) in one command. iOS, tvOS and
watchOS targets are supported.

Issue #KT-33856 fixed
2019-10-11 17:40:57 +03:00
Ilya Matveev
912690517f Update K/N version: 1.3.60-eap-12915 2019-10-11 17:40:56 +03:00
Alexander Gorshenev
f18a3f7fa9 Several more librry resolver tweaks.
Made library builder a member function.
Moved resolverByName() back to Native for now
2019-10-11 17:02:06 +03:00
Alexander Gorshenev
55805ddeb8 JS search path resolver with attributes.
Warn on inclusion of klibs with the same name in manifest
2019-10-11 17:02:06 +03:00
pyos
bc4be53569 JVM: generate $assertionsDisabled before inlining the node
This fixes the problem where compiling a class initializer that contains
a call to an `assert`ing function in a separate module causes the
assertion to always be enabled (i.e. the attached test used to fail in
CompileKotlinAgainstInlineKotlin mode).
2019-10-11 14:54:52 +03:00
Leonid Startsev
d8ad0ec43a Do not add synthetic deserialization constructor if .deserialize method is customized
Otherwise, there was an added descriptor without generated IR on Native
2019-10-11 14:24:51 +03:00
Leonid Startsev
1ed4930a2e Fix failing tests after 395d595b 2019-10-11 14:24:51 +03:00
Nikolay Krasko
93c91862f1 Fix debugger tests compilation in 193 after the big refactoring 2019-10-11 14:06:47 +03:00
Anton Bannykh
82e8bcfca9 Proto: update the workaround which reduces memory allocations 2019-10-11 13:58:22 +03:00
Georgy Bronnikov
1abdcf3f57 JVM_IR: support function references with default parameters 2019-10-11 13:30:30 +03:00
Natalia Selezneva
1a7f1dff10 Simplify scratch test without runtime to avoid exception form resolver
Create an issue that caused failure of the original test
^KT-34233
2019-10-11 12:33:17 +03:00
Natalia Selezneva
768200266a Add idea-android module to dependencies of scripting-support because it is needed for tests 2019-10-11 12:31:42 +03:00
Ilya Goncharov
18b287def5 Fix license information for js modules 2019-10-11 12:23:20 +03:00
Dmitriy Novozhilov
29cda7cb24 [FIR] Always use LF line endings in generated fir tree 2019-10-11 10:27:23 +03:00
Dmitriy Novozhilov
8e4e7c4a11 [FIR] Configure IC for fir tree generation task 2019-10-11 10:27:23 +03:00
Ilya Chernikov
9bf46cf435 Fix filename pattern building under Windows 2019-10-11 08:13:05 +02:00
Dmitriy Novozhilov
dc1874af3c [FIR] Add empty line at the end of generated fir tree files 2019-10-10 20:45:21 +03:00
Vladimir Dolzhenko
e9894fb35a Fixed errors reporting in tearDown in performance tests 2019-10-10 18:01:07 +02:00
Ilya Chernikov
8b750bfdc7 Add a property for resolving via classloader in JSR-223 2019-10-10 17:43:31 +02:00
Ilya Chernikov
54caf4bf16 Add resolving from classloader to REPL pipeline 2019-10-10 17:43:30 +02:00
Ilya Chernikov
2219b950f1 Implement resolve top-level functions and props from classloader
#KT-33892 fixed
2019-10-10 17:43:29 +02:00
Ilya Chernikov
7b93970ce2 Use default scripting host configuration if not provided 2019-10-10 17:43:27 +02:00
Dmitriy Novozhilov
0c27b863b0 [FIR] Add Readme for tree generator 2019-10-10 17:53:31 +03:00
Dmitriy Novozhilov
b8a8a5575b [FIR] Move default visitors from separate sourceset 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
a8192dba90 [FIR] Remove old visitor generator and configure gradle task for tree generator 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
cb981919f9 [FIR] Replace FIR tree with generated implementation 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
d6d4b3329b [FIR] Add FIR tree generator 2019-10-10 17:53:29 +03:00
pyos
807050b159 JVM_IR: generate SMAPs for classes local to inline lambdas...
...if they are declared inside inline functions.
2019-10-10 14:54:13 +02:00
pyos
301e3d27fd JVM_IR: "fix" reified type parameter scope check
where "fix" means "work around a bug that is much harder to fix". When
lambdas are extracted into the nearest class, captured type parameters
are not transformed into type parameters of the new method; because of
this, to check whether a reified type parameter is captured by a method
we need to check the outermost named function, not the current function.
2019-10-10 14:54:13 +02:00
Georgy Bronnikov
c70b2e3e4b JVM_IR: specify correct type for defaultConstructorMarker arguments 2019-10-10 14:07:43 +03:00
Roman Artemev
6f2768e774 [JS SCRIPT] Use new dependency resolver in script/js subsytem 2019-10-10 12:52:06 +03:00
Roman Artemev
c0f279811e [JS SCRIPT] refactor js script infrastructure
- Implement proper script compiler proxy to correctly handle script and its closed-world dependencies
 - Clean up zoo of JsScriptCompilers
2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
50c08b25d3 [SCRIPTING] create extension for scripting in JS and extract common code with JVM part 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
c6c3d2de9e [JS SCRIPTING] create tests for repl 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
62885ba497 [JS SCRIPTING] create compilers for scripting 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
9b4d92cc07 [JS SCRIPTING] create evaluators for repl and scripting 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
24cfd0e88c [IR JS BE] update NameTables for working with repl 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
184ae2fa43 [IR JS BE] create lowering for scripts 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
240abdb750 [JS IR BE] update current lowerings for IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
d79279d8a5 [JS SCRIPTING] create CoreCompiler for scripting 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
cf5a1615ea [IR] add JsTextTest for IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
209a20153e [Psi2IR] support IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
14510c1da3 [IR] create IrScript, infrastructure for it and update visitors 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
f13e05de7d [JS SCRIPTING] moved the javascript engines to a separate module 2019-10-10 12:52:05 +03:00
Ilya Goncharov
bf0b4f6878 Commonization of condition for linking node packages 2019-10-10 11:58:18 +03:00
Ilya Goncharov
bcbc408892 Remove NpmSimpleLinker
- Now only Yarn is responsible to link modules
2019-10-10 11:58:18 +03:00
Mads Ager
92cf521e11 [IR] Deal with forward references in default argument lambdas.
Rely on the frontend weeding out cases that are not supported.

In psi2ir, introduce all the parameters before processing default
values.

Change the DefaultArgumentStubGenerator to generate code that
matches the behavior of the current backend.
2019-10-10 09:00:51 +02:00
Abduqodiri Qurbonzoda
834eeb567b Alter componentN documentation 2019-10-10 05:08:44 +03:00
Abduqodiri Qurbonzoda
e54b405fe4 Fix Iterable, Sequence and String index overflow in windowed 2019-10-09 19:48:39 +03:00
Pavel Kirpichenkov
42740c8b97 Fix capturing of outer type parameters for classes declared inside init block 2019-10-09 16:01:46 +03:00
Vladimir Dolzhenko
5e1efead9a Fixed errors reporting in tearDown in performance tests 2019-10-09 13:39:13 +02:00
Leonid Startsev
395d595b22 Supply JVM and JS platforms when compile from CLI
To be able to check descriptor's platform in frontend during plugin processing.

This is needed for serialization plugin because some synthesized descriptors (annotation interface implementation) must be JVM-only (or the Native compilation fails).
2019-10-09 14:18:54 +03:00
Kristoffer Andersen
9d1d6a7b1f JVM IR: Do not generate DefaultImpls if it's empty. This revealed that InterfaceDelegationLowering was relying on the presence of DefaultImpls even when empty. Hence, simply dropping it from InterfaceLowering was not trivial. Moved default delegation in DefaultImpls to SuperType.DefaultImpls to InterfaceLowering. Clean up logic considerably, and document inter-phase dependencies. 2019-10-09 13:03:21 +02:00
Kristoffer Andersen
cc6252098f Add a test to reveal flaw in call delegation with default implementations in interfaces. 2019-10-09 13:03:21 +02:00
Kristoffer Andersen
5cefd4e443 JVM IR: Implement -Xjvm-default=enable 2019-10-09 13:03:21 +02:00
Ilya Goncharov
48e2e1f0c1 Remain only license files 2019-10-09 13:52:51 +03:00
Roman Artemev
e738534bef [KLIB] Promote Konan ABI Version 2019-10-09 13:23:19 +03:00
Roman Artemev
d5176cbf5d [IR SERIALIZATION] Get rid of UniqId proto message
- encode locality flag in major bit of uniqid (1 - global, 0 - local)
2019-10-09 13:23:18 +03:00
Roman Artemev
fcae5873d0 [IR SERIALIZATION] Get rid of Annotations message 2019-10-09 13:23:18 +03:00
Roman Artemev
aeafaf78f1 [IR SERIALIZATION] Replace DescriptorReference boolean fields with single flag in proto 2019-10-09 13:23:13 +03:00
Roman Artemev
105fc4b0ca [IR SERIALIZATION] Get rid of FqName 2019-10-09 13:06:01 +03:00
Roman Artemev
9fa89bf7e2 [IR SERIALIZATION] Get rid of IrDataIndex 2019-10-09 13:06:01 +03:00
Ilya Goncharov
8c2ae4f91a Migrate on copyfiles 2019-10-09 12:57:26 +03:00
Ilya Goncharov
896271cd87 Add similarity with kotlin-test-js-runner 2019-10-09 12:57:26 +03:00
Natalia Selezneva
1bb6a7cc91 Remove fir tests from idea <= 183
Broken at 17dcdb59de
2019-10-09 11:17:13 +03:00
Pavel Kirpichenkov
9bcee2cc74 Minor: fix typo in diagnostic message 2019-10-09 10:53:12 +03:00
Vladimir Dolzhenko
55548d9199 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193, part 3 2019-10-09 07:34:25 +02:00
nikita.movshin
b3392c792b Add changelog for 1.3.50 2019-10-08 20:36:38 +03:00
Abduqodiri Qurbonzoda
b4d580fa91 JS: document array destructuring behavior (KT-17544) 2019-10-08 19:24:31 +03:00
Mads Ager
f9d117970a [JVM_IR] Map suspend lambdas to original function for inlining. 2019-10-08 19:21:37 +03:00
Ilya Goncharov
8ef28446cc Remove webpack protocol for processing stacktrace 2019-10-08 18:51:40 +03:00
Ilya Goncharov
f4ba132327 Simplify progress procentage 2019-10-08 18:51:40 +03:00
Ilya Goncharov
7e5c51e6aa Windows source-map-loading with absolute paths 2019-10-08 18:51:40 +03:00
Alexey Kudravtsev
9c1e59c720 Use ReentrantLock instead of ReadWriteLock as a more cheaper alternative more suitable to usage pattern 2019-10-08 18:20:05 +03:00
pyos
b6a1154672 Add a test for non-null assertions in local classes/functions 2019-10-08 17:19:41 +02:00
pyos
06c00f4d9e Unmute some JVM_IR inlining tests 2019-10-08 17:19:41 +02:00
pyos
a0edf2934b JVM_IR: implement isCallInsideSameModuleAsDeclared 2019-10-08 17:19:41 +02:00
pyos
f6fe273774 JVM_IR: don't reset callSiteMarker to null after generating lambdas 2019-10-08 17:19:41 +02:00
pyos
cea69e0706 JVM_IR: do not generate redundant load+stores before inline calls 2019-10-08 17:19:41 +02:00
pyos
59408242db JVM_IR: ignore captured parameters in lambda invokeMethodDescriptor 2019-10-08 17:19:41 +02:00
pyos
a20d212908 JVM_IR: take lambda arguments from signature, not call site 2019-10-08 17:19:41 +02:00
pyos
4ea4bc1c2b JVM_IR: pass callee after fake override resolution to source inliner
Fixes NPE in:

    open class A {
        inline fun f() = 1
    }

    class B : A() {
        fun g() = f()
    }
2019-10-08 17:19:41 +02:00
pyos
07bde889b4 JVM_IR: generate more correct names for regenerated objects
and fake lambda types, too. (But those only matter for debugging.)

Also, share object name generators between methods with the same name to
avoid rewriting objects from one with objects from the other.
2019-10-08 17:19:41 +02:00
pyos
58775275e7 JVM_IR: omit nullability assertions in anonymous object constructors 2019-10-08 17:19:41 +02:00
Ilya Chernikov
37fed8bbc9 Add jvmCompilerIntegrationTest task as a subtask of compilerTest:
add embeddable compiler and client tests to it
2019-10-08 17:05:34 +02:00
Ilya Chernikov
1a8bcee86c Restore embeddable compiler smoke test
also move sources and testdata to the appropriate place
2019-10-08 17:05:33 +02:00
Ilya Chernikov
cd4cce3f9f Refactor embeddable compiler client tests:
- move from the legacy location to the project dir
- move testdata from resources to the separate folder (fixes global compileTestKotlin build)
- fix classpaths handling
2019-10-08 17:05:31 +02:00
Mikhail Glukhikh
07e067102b FIR body resolve: use one scope session per module
Gives significant (~5%) performance boost mainly due to use-site scope caching
2019-10-08 17:59:44 +03:00
Alexander Gorshenev
c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
47fba2ee4b A couple of fixes for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
e5dbec4523 Commonized FileRegistry with SourceFileMap for klib metadata 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
b7a0546634 The friend module identification has regressed recently 2019-10-08 16:56:29 +03:00
Svyatoslav Kuzmich
18d9e9b2b5 [JS] Make JsExport experimental
- JsExport was meant to be experimental from the beginning but
annotation was missing
- Add missing @SinceKotlin
2019-10-08 16:33:17 +03:00
Toshiaki Kameyama
4da7d11364 KT-30643 J2K: wrong position of TYPE_USE annotation (#2543)
New J2K: fix wrong position of TYPE_USE annotation

#KT-30643 Fixed
2019-10-08 16:21:27 +03:00
Mikhail Glukhikh
58f2348647 FIR buildJavaUseSiteScope: fix visited symbols handling 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
1e8003e9a8 Use use-site session in buildJavaUseSiteScope 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
69905ab325 Derive FirClassDeclaredMemberScopeProvider from FirSessionComponent 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
75a3d2fb97 FirClassDeclaredMemberScope: keep cache in provider but not in ScopeSession 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
dfa494a21e FIR: remove duplicate of 'wrapSubstitutionScopeIfNeed' 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
a0ed03a121 FIR: apply overload conflict resolver even for variable (due to receivers) 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
4cd8b78779 FIR: eliminate most usages of FirSession.service() and getService() 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
708d914224 FIR: don't recreate tower resolver / conflict resolver / call completer 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
9801e06eac Use .firSymbolProvider instead of service, deprecate FirSession.service 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
3fee1445b9 Set more precise type in FirQualifiedNameResolver 2019-10-08 16:19:54 +03:00
pyos
432ba62143 JVM_IR: omit annotations on outer this parameters 2019-10-08 14:41:05 +02:00
victor.petukhov
94469827ba Use new -Xinline-classes compiler flag in the corresponding IDEA intention 2019-10-08 15:17:34 +03:00
Natalia Selezneva
17dcdb59de Configuration: move scratch tests to separate module 2019-10-08 15:02:32 +03:00
Natalia Selezneva
f2f97a9991 Troubleshooting tests: check that REPL process is stopped before continue test 2019-10-08 15:02:06 +03:00
Alexander Udalov
0c939d2f86 Use correct class file version when copying anonymous objects in inliner
Generally, using state.classFileVersion would be enough because we
report an error when inlining bytecode into a class file with a lower
target version (see INLINE_FROM_HIGHER_PLATFORM). However, we take maxOf
with the original version of the class file, _just in case_ the user has
suppressed this error (for example, to workaround some other corner case
in the compiler).

 #KT-30744 Fixed
2019-10-08 13:44:40 +02:00
Louis CAD
45ab07654e Use receiver syntax for lambda execution (#2508) 2019-10-08 14:34:55 +03:00
Dmitriy Dolovov
ddc5a62e4a [Commonizer] Annotations 2019-10-08 18:27:43 +07:00
Dmitriy Dolovov
72869e848d [Commonizer] Kotlin types 2019-10-08 18:27:36 +07:00
Dmitriy Dolovov
310166443a [Commonizer] Rename Commonizer IR (CIR) entities 2019-10-08 18:27:29 +07:00
Dmitriy Dolovov
2bc0a3c9c0 Fix KNPE after calling completion in native targeted filesIssue KT-34158 Fixed 2019-10-08 18:27:23 +07:00
Vladimir Dolzhenko
cd32c06df8 Don't grab ref to DeclarationDescriptor into LookupElement, KT-33898 2019-10-08 12:48:33 +02:00
Yan Zhulanow
a4c8ccee06 kapt: Fix compilation in 'compile' running mode (KT-33800) 2019-10-08 19:13:57 +09:00
Yan Zhulanow
66758472c7 Fix EA-209316: Allow null JDI values in captured value data 2019-10-08 19:13:56 +09:00
Yan Zhulanow
d153aa87a8 Fix EA-126019: Handle 'null' PsiType as nullable Any in "Create" actions 2019-10-08 19:13:56 +09:00
Yan Zhulanow
472ec72eb9 Refactor debugger tests
1. Move tests to their own module
2. Avoid sharing the 'tinyApp' project between tests
3. Clean up option directive handling
2019-10-08 19:13:56 +09:00
Yan Zhulanow
d8d81c51d7 Move debugger test data to the new location 2019-10-08 19:13:55 +09:00
Yan Zhulanow
b4cc5703de Minor: Reformat several IDEA debugger tests 2019-10-08 19:13:53 +09:00
Yan Zhulanow
6b2b66e8e3 Run configurations: Fix compatibility with 2018.3 2019-10-08 18:17:07 +09:00
Yan Zhulanow
44b7a5cc36 Make KotlinFacetSettingsProvider.getInstance() nullable
A module may not have a KotlinFacet.
It isn't correct to throw an exception in that case.
2019-10-08 18:17:06 +09:00
Yan Zhulanow
f408c249f1 Implement class/method run configurations for MPP projects 2019-10-08 18:17:06 +09:00
Yan Zhulanow
0a8f15c745 Generify Gradle importing tests so they can be used in the Ultimate repo 2019-10-08 18:17:06 +09:00
Yan Zhulanow
82c88f9cc4 Disable alternative locations for new MPP as alternative locations aren't supported in Gradle 2019-10-08 18:17:05 +09:00
Yan Zhulanow
8f4063b36c Implement test icon provider for 'native' platform 2019-10-08 18:17:05 +09:00
Yan Zhulanow
c19d62af73 Pill: Disable Pill for benchmarks module 2019-10-08 18:17:04 +09:00
Yan Zhulanow
339ba499fb Pill: Add IDEA Ultimate run configuration 2019-10-08 18:17:04 +09:00
Nikolay Krasko
8cda36ef15 Fix IdeLightClassTestGenerated tests for idea <= 191 2019-10-08 01:04:54 +03:00
Steven Schäfer
e25a09f2f9 JVM IR: Fix local delegated properties with inline class types 2019-10-07 17:12:30 +02:00
Vyacheslav Gerasimov
24a8e1cd9c Build: Fix maven dependencies for compiler daemon and util-klib-metadata artifacts 2019-10-07 15:18:38 +02:00
pyos
cd47c11efd Generate unique parameter names in LocalDeclarationsLowering 2019-10-07 15:14:48 +02:00
Mads Ager
3b2843fe7a Introduce local variable type checker.
CheckLocalVariablesTableTests will now check the validity of
the locals table against types of locals computed based on the
bytecode.

These checks and the new destructuringInFor test act as a
regression test for the changes in
https://github.com/JetBrains/kotlin/pull/2613

These checks also caught a similar issue for destructuring
lambda parameters, where the local is introduced before the
value has been written to the local slot. This change also
fixes that.

Finally, this change fixes the asmLike tests to correctly
look up the name of parameters in the locals table.
2019-10-07 15:06:44 +02:00
Mikhael Bogdanov
13b69b730a Regenerate JS tests 2019-10-07 14:53:54 +02:00
Nikolay Krasko
080407e8e6 Separate versions for 192 and 193 plugins (KT-34191)
#KT-34191 Fixed
2019-10-07 15:00:05 +03:00
Steven Schäfer
3659b517bb Minor: Fix some test cases 2019-10-07 12:54:11 +02:00
pyos
6e9ee2a46c JVM_IR: fix const reads from other files in same module 2019-10-07 12:28:55 +02:00
Toshiaki Kameyama
eda4206428 New J2K: convert Integer.MAX_VALUE to Int.MAX_VALUE
#KT-7940 Fixed
2019-10-06 01:09:33 +03:00
Steven Schäfer
0b76f60b63 JVM IR: Handle NonInlinedConst 2019-10-05 10:52:59 +02:00
Jiaxiang Chen
e40636f6ab re-generate for debug information tests 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
74e4e8b18e enable test generator to generate tests using JUnit 4 infrastructure 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
2c78f1fe85 debug information test: instantiate a single thread for all tests under same test class 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
0a2812f83b Add a JVM backend debug information test, this commit is for verifying
line numbers for stepping.

Running JVM instance and read stepping events from it to verify with the
test data.
2019-10-05 10:41:11 +02:00
Anton Yalyshev
f17e9ba9fe Return older android.tools.build version, as we have problems with newer one 2019-10-04 20:43:44 +03:00
Vyacheslav Gerasimov
daa25dd56a 193: Fix AbstractResolveByStubTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
a5d668a093 193: Fix AbstractInlineTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
c07833f13a 193: Fix AbstractNameSuggestionProviderTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
04ee38c913 193: Fix AbstractParameterInfoTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
1392e7574c 193: Fix AbstractKotlinGotoTest fixture configuration 2019-10-04 20:23:01 +03:00
Vyacheslav Gerasimov
98f8e0c800 193: Fix code fragment tests fixture configuration 2019-10-04 20:23:01 +03:00
Mikhail Glukhikh
f7d12efc24 Memoize absent classifier names in FIR star importing scopes 2019-10-04 19:05:15 +03:00
Mikhail Glukhikh
6d8aa69878 FIR: rename CallResolver to FirTowerResolver 2019-10-04 19:02:52 +03:00
Mikhail Glukhikh
16de3257d5 FIR abstract importing scope: return NONE when we have no top-level callables 2019-10-04 18:59:12 +03:00
Mikhail Glukhikh
7ba40ac963 Memoize absent function/property names in FirSuperTypeScope 2019-10-04 18:59:12 +03:00
Mikhail Glukhikh
840ecf1a77 Don't enter twice top-level scopes w/out particular name in FIR tower resolver 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
e276e8d9f3 Don't enter twice local scopes w/out particular name in FIR tower resolver 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
e48428d39d FIR ScopeSession: use HashMap instead of LinkedHashMap 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
813e35643c FIR resolve: fix constructor handling in qualifier scope
Constructors aren't more visited twice in regular scopes
2019-10-04 18:59:10 +03:00
Mikhail Glukhikh
26e8202771 FIR: add 'isInner' parameter to constructors
This is helpful because inner class constructors are resolved in a bit
different way (like non-static vs static)
2019-10-04 18:59:10 +03:00
Anton Bannykh
aad9cbbf01 [JS IR BE] Fix tests failing due to reduced runtime 2019-10-04 17:30:45 +03:00
Ilya Goncharov
b2fb81e9cc Temp ignore tests on missing source file
#KT-32319 fixed
2019-10-04 17:12:15 +03:00
Ilya Goncharov
6688df8f6a Fix webpack delimiter and add test on short path in stack trace 2019-10-04 17:10:13 +03:00
Ilya Goncharov
f7ba1c56e2 Source-map-loader resolves relative paths into absolute even
- Now event sources with content in source map should be resolved with absolute path
2019-10-04 17:10:13 +03:00
Ilya Goncharov
f3db846bce Add tests for source-map-loader 2019-10-04 17:10:13 +03:00
Ilya Goncharov
e8efe5407d Add patched kotlin-source-map-loader 2019-10-04 17:10:13 +03:00
Vyacheslav Gerasimov
dad9958adf 193: Fix test fixture configuration
Path to test data file should be relative to test data directory
2019-10-04 17:04:54 +03:00
Vyacheslav Gerasimov
3f1d3dab14 193: Request StubComputationTracker as component from project
Fixes assert:
com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: org.jetbrains.kotlin.asJava.builder.StubComputationTracker requested as a service, but it is a component - convert it to a service or change call to project.getComponent()
2019-10-04 17:04:54 +03:00
Anton Yalyshev
fa9125df7d Set JVM 1.8 for test source set as well #KT-34154 Fixed 2019-10-04 16:19:59 +03:00
Ilya Goncharov
d2c2128aad Fix test logging for Windows 2019-10-04 15:19:50 +03:00
Ilya Kirillov
f950a0246c New J2K: handle correctly short names which are imported by default in kotlin (like List or Result)
Kotlin default import inserter was unable to correctly insert such imports

#KT-34165 fixed
2019-10-04 15:17:35 +03:00
Ilya Kirillov
81341e3fd3 New J2K: add hack for incorrect comment parsing in J2K (KT-16845)
#KT-33825 fixed
2019-10-04 15:17:35 +03:00
Alexey Kudravtsev
008b916755 avoid unnecessary usage of private API class HighlightSession 2019-10-04 15:14:39 +03:00
pyos
354e5d86ee JVM_IR: use correct descriptor type in JvmStaticAnnotationLowering 2019-10-04 15:06:29 +03:00
Ilya Goncharov
1f5a760ac8 Add typings field for DtsResolver
#KT-33549 fixed
2019-10-04 11:57:38 +03:00
Pavel Kirpichenkov
b7e5d9faae Update annotation rendering in diagnostics
Disable annotation rendering in default type and descriptor renderers.
Preserve annotations in Android and Serialization plugins.
Update error texts in ide tests.
Nullability annotations in Java descriptors are rendered with context-dependent renderer.

#KT-20258 Fixed
2019-10-04 11:18:45 +03:00
Kirill Shmakov
2a99687a95 Advance 193 bunch to 193.4099 2019-10-04 10:47:12 +03:00
Igor Yakovlev
f1f4bc6c2a Fix IdeRegression.testImplementingMutableSet test data 2019-10-04 09:55:39 +03:00
Ilya Goncharov
58e9b756f1 Add tests for processing karma stack traces 2019-10-03 17:20:48 +03:00
Georgy Bronnikov
4b5877f3b5 JVM_IR, codegen: handle names for classes within local classes 2019-10-03 17:11:48 +03:00
Kirill Shmakov
cd251458bd Merge pull request #2647 from JetBrains/kishmakov/gd/review
Advance 193 bunch
2019-10-03 16:40:34 +03:00
Natalia Selezneva
5da75897e4 Minor: regenerate IdeLightClassTestGenerated 2019-10-03 13:52:57 +03:00
Ilya Chernikov
b8258bfc71 Drop TestCaseWithTempDir usage from scripting compiler plugin tests
fighting with flaky tests
2019-10-03 12:24:50 +02:00
Ilya Chernikov
cb5622fc8b [minor] Fix URL conversion to the file
possibly fixes the exception from https://stackoverflow.com/questions/57727150/kotlin-script-engine-with-spring-boot-self-running-war
2019-10-03 12:24:50 +02:00
Ilya Chernikov
3fec15202f [minor] fix source root creation from imported scripts:
make the usages of KotlinSourceRoot consistent everywhere
2019-10-03 12:24:50 +02:00
Svyatoslav Kuzmich
5d7f18b1b9 [JS] Support wrapped and dynamic types in typeOf 2019-10-03 13:12:46 +03:00
Nikolay Krasko
030aaee117 Mute completion tests (KT-32919) 2019-10-03 12:24:46 +03:00
Dmitry Gridin
eaa07dac17 CreateExpect: shouldn't generate expect declaration from actual function with private, lateinit or const
#KT-33930 Fixed
2019-10-03 16:00:07 +07:00
Dmitry Gridin
9da6dcf840 DescriptorRenderer: shouldn't render private modifier by default
#KT-31587 Fixed
2019-10-03 16:00:06 +07:00
Dmitry Gridin
847295bf1c CreateExpect: shouldn't generate expect declaration from actual function with default implementation from interface
#KT-32737 Fixed
2019-10-03 16:00:06 +07:00
Nikolay Krasko
e9f8693a73 as34: Mute several inspection/intention tests in as34 (KT-32856) 2019-10-03 11:56:01 +03:00
Mikhail Glukhikh
7e87357ed0 FIR2IR: fix top-level parent settings thus fixing Cli.testFirHello 2019-10-03 11:47:22 +03:00
Dmitry Gridin
1b7b546249 Tests: fix some tests in quickfix 2019-10-03 15:23:05 +07:00
Mikhail Glukhikh
f74b3e6ece SymbolBasedClassifierType: fix exception in case with not found class
This can arise with non-transitive dependencies
#KT-33932 Fixed
2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
6b8f4b4b4e SymbolBasedClass: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
ac1b957f8d Symbol based types: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
4bb5fbaa4d JavacWrapper: add output directory to classpath to see Kotlin files
Without this commit, Java cannot see Kotlin in some cases

Controversial: probably javac should be able to find Kotlin files
inside its existing tabs without this directory in classpath
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
b75e630932 JavacWrapper: minor renames to make code clearer 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
0c662a5a34 JavacWrapper: remove code duplication around getVisibility 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
298a30d245 Minor: run javac-mode compileJava after destroying of generation state
Not very important but seems more logical
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
bbd8fb8b23 JavacWrapper: add support for JvmPackageName annotation
This fixes previously added testWithStdLib/streams.kt test
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
e8cf0b5d4f Add test for kotlin.streams function usage in Kotlin code
NB: does not pass in javac mode due to lack of JvmPackageName support
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
f6ff580852 Cleanup code: JavacWrapper 2019-10-03 11:16:23 +03:00
Mikhail Glukhikh
2bec60a3dd Fix potential NPE in JavacWrapper 2019-10-03 11:16:23 +03:00
Igor Yakovlev
d252e795be Remove unnecessary fallback LigthClasses from UL 2019-10-02 20:18:24 +03:00
Igor Yakovlev
d5e4227a1d Revert commit and additional workaround to diagnostics problem
Another workaround of testClassObjectCopiedFieldObject test fix

Revert "Fix testClassObjectCopiedFieldObject test"

This reverts commit 8def1f07aa.
2019-10-02 20:18:24 +03:00
Igor Yakovlev
32a8fe1ca9 Fix IdeRegression.testImplementingMutableSet test data 2019-10-02 20:18:24 +03:00
Dmitry Petrov
107ab06042 Minor: make diagnostic tests usable with IDEA & JPS 2019-10-02 17:14:48 +04:00
Dmitry Petrov
a633a33627 KT-14513 Don't generate delegated property metadata when unused
If the delegated property operators involved are inline, and delegated
property metadata parameter is not used (which is often the case, e.g.,
'lazy'), we can skip those properties in metadata generation.

NOT implemented: special case when only 'kProperty.name' is used by the
corresponding delegated property operators.

Also a sneak fix for KT-34060.
2019-10-02 17:14:48 +04:00
Dmitry Petrov
92ba298e68 KT-14513 DELEGATED_PROPERTIES -> DELEGATED_PROPERTIES_WITH_METADATA 2019-10-02 17:14:48 +04:00
Dmitry Savvinov
3989f351ff Use modules instead of files for MPP diagnostic
Using files turned to be a bad idea, because people often
use the same name for files with expects and with corresponding actuals.

This commits disambiguiates ambiguous message for
AMBIGUOUS_ACTUALS/AMBGIUOUS_EXPECTS diagnostics by using modules instead
of files

^KT-32582 Fixed
2019-10-02 16:52:40 +03:00
Dmitry Savvinov
45737e51fb Minor: let 'Renderer'-helper return more specific type
This allows to easily re-use other renderers from 'Renderer'-block
(previously, one had to declare 'ContextDependentRenderer' just to get
hold of 'RenderingContext' just to call 'render(O, RenderingContext)'
from DiagnosticParameterRenderer, which would be unused anyways)

This commit introduces more specific subtype,
'ContextIndependentParameterRenderer', which exposes 'render(O)' method
for easy re-use.

Several (ab)uses of 'ContextDependentRenderer' have been removed
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
8bfd30fc69 Minor: reformat IdeRenderers.kt 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
249e5da53b Add internal action to toggle analysis mode
^KT-32562 Fixed
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
f7eb294b80 Configure facets depending on MPP version in tests setup 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
182f5fafad Take dependsOn-graph from corresponding property for MPP.M3 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
958a7d9315 Refactor MPP versioning
- Use 'null' as indicator of non-MPP version. Consequently, remove
useless 'isMpp' method, and lift all methods to extensions (to be able
to call them on nullable 'facetSettings.mppVersion')

- Change semantics of extensions to check for exact equality rather than
for "at least specified version"

- Deprecate old MPP-versioning in favour of 'facetSettings.mppVersion'
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
dbd352e2ba Minor: simplify condition in KotlinFacetSettings 2019-10-02 16:52:39 +03:00
Georgy Bronnikov
e38ff8753e JVM_IR: support type parameters in @JvmOverload functions 2019-10-02 16:19:06 +03:00
Nikolay Krasko
7467c80970 Fix bunch rule 2019-10-02 15:58:44 +03:00
Nikolay Krasko
343502125b Rename ResolveInWriteActionManager -> ResolveInDispatchThreadManager 2019-10-02 15:58:44 +03:00
pyos
ea56a5e8b1 Unmute some JVM_IR inlining tests 2019-10-02 14:48:05 +02:00
pyos
6163a8cf56 IR: keep source container when making functions static 2019-10-02 14:48:05 +02:00
pyos
35a0fc40a6 Don't create redundant copies in DefaultArgumentStubGenerator 2019-10-02 14:48:05 +02:00
pyos
8bf5afbba2 JVM_IR: lift pre-super() computations out of anonymous objects 2019-10-02 14:48:05 +02:00
pyos
fa54b2cb81 JVM_IR: improve scope detection in accessor generation.
* Sometimes, there's a class after the last function in the scope
   stack: that's the local type's (non-inline) primary constructor.

 * In an inline (but not crossinline) lambda, accessors are needed
   if and only if they would be needed in the function that the
   lambda is defined in.
2019-10-02 14:48:05 +02:00
Toshiaki Kameyama
d86e87d35e Add quickfix to change object to class
#KT-33586 Fixed
2019-10-02 19:42:30 +07:00
Toshiaki Kameyama
6a329210cb Convert to anonymous object: fix wrong replacement when SAM is nested interface
#KT-33660 Fixed
2019-10-02 19:09:55 +07:00
Georgy Bronnikov
2e3428bbe7 JVM_IR: incorporate validation into jvmPhases 2019-10-02 14:56:54 +03:00
Mark Punzalan
05527fbc9a Fix all IR element duplication warnings/errors in JVM IR. 2019-10-02 14:56:54 +03:00
Toshiaki Kameyama
ac7e955d3e Change parameter type quick fix: don't use qualified name
#KT-32012 Fixed
2019-10-02 18:41:54 +07:00
Kirill Shmakov
1310796a16 Advance 193 bunch
Affected method was removed in f516dc4160
2019-10-02 13:47:10 +03:00
Roman Golyshev
c463fad3b7 KT-34000: Allow autoimport to suggest fixes in qualified expressions
- it is required to be able to autoimport extensions from objects,
not only from the top level
- use `substituteExtensionIfCallable` to handle generics for extension methods
- move finding expression receivers to the separate method, add `Receivers` value class to hold found receivers
- change `CallableDescriptor.isValidByReceiversFor` to return false
if explicit receiver is not required for the descriptor
- ^KT-34000 Fixed
2019-10-02 13:46:47 +03:00
Toshiaki Kameyama
b2d2165342 Add "Remove redundant label" quick fix for REDUNDANT_LABEL_WARNING
#KT-26431 Fixed
2019-10-02 16:40:13 +07:00
Denis Zharkov
18df5d9db0 Support mixed positioned/named arguments in AddNameToArgumentIntention
^KT-7745 Fixed
2019-10-02 11:13:15 +03:00
Denis Zharkov
e54d2c7c32 Support named arguments in their own position
^KT-7745 In Proggress
2019-10-02 11:13:15 +03:00
Natalia Selezneva
bd6481b9e8 Add support for settings.gradle.kts configuring kotlin in project (KT-34114)
^KT-34114 Fixed
2019-10-02 10:30:42 +03:00
Natalia Selezneva
fac49df177 Invoke in CompilerSettingsListeners in invokeLater
script templates that are loaded from compiler settings are subscribed on this topic.
When ScriptTemplatesFromCompilerSettingsProvider invokes KotlinCompilerSettings.getInstance, deadlock may happen if those settings aren't initialized yet.

^KT-25373
2019-10-02 10:25:18 +03:00
Steven Schäfer
217f681b6e JVM IR: Use WrappedClassDescriptor in class builder. 2019-10-02 08:29:22 +02:00
Georgy Bronnikov
be002fc417 JVM_IR: do not copy bodies when creating static functions 2019-10-01 20:52:57 +03:00
Georgy Bronnikov
4920d71d70 JVM_IR: set dispatchReceiverParameter of imported JvmStatic object methods to null 2019-10-01 20:52:56 +03:00
Mikhail Glukhikh
c7904b273f FIR: fix FirArraySetCall.acceptChildren thus fixing visitConsistencyTest 2019-10-01 18:23:06 +03:00
Ilya Goncharov
7e47be9765 Add kotlin js test runner as required dependency for Karma
#KT-34123 fixed
2019-10-01 17:49:09 +03:00
Alexander Gorshenev
e53260e27c Bumped klib ABI version 2019-10-01 17:38:57 +03:00
Alexander Gorshenev
147681f335 Fixed native PackageAccessTracker 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
df6dcd646f Fix ClassCastException in KLIB reader 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
5985c0c02b KLIB API constants clean-up 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
781c73335d Use cache everywhere where K/N KLIBs are read in IDE 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
185b10fa06 Rename module capability: "KotlinLibrary" -> "KotlinNativeLibrary" 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
0196ce7c2f IDE plugin: Add missed dependency 'util-klib-metadata' 2019-10-01 17:38:57 +03:00
Alexander Gorshenev
c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Vyacheslav Gerasimov
f38123e78c 193: Update to 193.3793.14-EAP-SNAPSHOT 2019-10-01 17:23:47 +03:00
Georgy Bronnikov
7e9cfbc91a IR: use toLowerCaseAsciiOnly 2019-10-01 16:43:23 +03:00
Igor Yakovlev
a68090db5a Fix 191 branch build 2019-10-01 16:27:16 +03:00
Mark Punzalan
a01c53fb74 Use getPropertyGetter() in ForLoopsLowering to retrieve property
getters instead of directly retrieving the property first.

When the IR backend is used to compile the standard library, the
progression classes (in sources) are lowered, and therefore do not have
properties anymore (only fields and functions).
2019-10-01 13:34:59 +02:00
Igor Yakovlev
a19c5f944e Mute tests with new tickets to resolve it later
Muted test with next tickets:
https://youtrack.jetbrains.com/issue/KT-34105
https://youtrack.jetbrains.com/issue/KT-34106
https://youtrack.jetbrains.com/issue/KT-34107
2019-10-01 13:53:21 +03:00
Igor Yakovlev
8def1f07aa Fix testClassObjectCopiedFieldObject test
Fix of the test
PsiCheckerTestGenerated$DuplicateJvmSignature$Fields.testClassObjectCopiedFieldObject
additionally fixed the bug with blinking this test example in IDEA with UL classes enabled.

The story:
Extra diagnostics could be requested for any KtClassOrObject but for _nested_  classes result may depend on outer class members signature collecting. So the the order of outer/nested diagnostic reporting takes matter.
So for nested classes/objects we have to gen members of outer classes.
2019-10-01 13:53:21 +03:00
Igor Yakovlev
de5fb347e7 Fix SyntheticPropertyUsages tests
testJavaGetterToOrdinaryMethod_JavaGetterToOrdinaryMethod
testSyntheticPropertyUsages1_RenameGetMethod

from 192 disabled to call findReferences(elem), so overload does not worked
2019-10-01 13:53:21 +03:00
Igor Yakovlev
ca9e760379 Remove redundant analyzeWithAllCompilerChecks from NoArg plugin test 2019-10-01 13:53:20 +03:00
Igor Yakovlev
cef6b71897 Fix ultraLightClass method argument types erasure
Fix IdeRegression.testImplementingMap test
2019-10-01 13:53:20 +03:00
Igor Yakovlev
c5fc55b84c Fix exception when Enum.valueOf got an invalid argument value
#Fixed KT-30515
2019-10-01 13:53:20 +03:00
Mark Punzalan
9daea89221 Avoid duplicate IR elements in ForLoopsLowering (accidentally introduced
in #2620).
2019-10-01 12:40:50 +02:00
Vladimir Dolzhenko
3b563eaca1 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193, part 2 2019-10-01 11:39:17 +02:00
Andrey Uskov
d7a2de59ac Import: support mixing of TaskProviders and Tasks in task executors
#KT-34101 Fixed
2019-10-01 08:30:12 +03:00
Andrey Uskov
6d9be0ab5d Fix MPP import tests 2019-10-01 08:30:09 +03:00
Andrey Uskov
c0f2be478f Fix calculation of target platform for common test modules for NMPP
#KT-34070 Fixed
2019-10-01 08:30:07 +03:00
Anton Yalyshev
9af6efcb24 Return old-style DSL for Gradle versions < 5.0 2019-10-01 07:18:00 +02:00
Ilya Gorbunov
2106274fa3 Minor: fix Charset type reference in kdoc
#KT-34086 Fixed
2019-10-01 03:01:11 +03:00
Shagen Ogandzhanian
3181d02d11 Update dukat dependency to 0.0.19 2019-09-30 23:30:50 +02:00
Georgy Bronnikov
53b7766910 IR: call toLowerCase() with root locale
Preventing complexities with Turkish Iı vs. İi.
2019-09-30 22:55:19 +03:00
Denis Zharkov
f91db5f0b8 Restore correct overloads ambiguity accidentally removed in 1.3.60
This problem is only relevant when isTypeRefinementEnabled == true (HMPP projects)

Ambiguity accidentally was removed after 471134d
There, for areCallableDescriptorsEquivalent we stopped assuming
as impossible a situation of having identity-different descriptors
in the same containing declaraton that still might be considered equal

So, before 471134d we were comparing
"fun foo(x: String)" with "[substituted] fun foo(x: String)"
and areCallableDescriptorsEquivalent returned false for such case.
Thus, both overrides were left in the resulting set.

After 471134d, those two descriptors
becamed considered as equal thus having a possibility to remove any of them.

The problem is that "areCallableDescriptorsEquivalent" has kind of
unclear contract. Effectively it checks whether two descriptors match
to the same declaration.

But some of the usages expect that it also makes sure that descriptors
have the same substitution (see org.jetbrains.kotlin.resolve.calls.smartcasts.IdentifierInfo.Variable#equals)

So, the straight solution is using original descriptors for the cases
where we need to make sure that descriptors relates to actually different
declarations

^KT-34027 Fixed
2019-09-30 20:09:42 +03:00
Denis Zharkov
67410f7a57 Parametrize behavior of DescriptorEquivalenceForOverrides::areCallableDescriptorsEquivalent
The changes introduced 471134d31e are only needed
for the case of HMPP project while for other cases it might break the behavior
a bit like in KT-34027

See org.jetbrains.kotlin.resolve.calls.results.OverloadingConflictResolver#filterOutEquivalentCalls

Before 471134d we were comparing
"fun foo(x: String)" with "[substituted] fun foo(x: String)"
and areCallableDescriptorsEquivalent returned false for such case.
Thus, both overrides were left in the resulting set.

After 471134d, those two descriptors
becamed considered as equal thus having a possibility to remove any of them.

The problem is that "areCallableDescriptorsEquivalent" has kind of
unclear contract. Effectively it checks whether two descriptors match
to the same declaration

But straightforward fixing of this exact call-site (using original descriptors)
doesn't help: behavior might change in a very subtle way (see org.jetbrains.kotlin.spec.checkers.DiagnosticsTestSpecGenerated.NotLinked.Dfa.Pos#test72)

So, the main idea is changing the contract for areCallableDescriptorsEquivalent
only when project is HMPP one.

^KT-34027 In Progress
2019-09-30 20:09:42 +03:00
Ilmir Usmanov
08794d17a0 Do not box function argument if it is used in EXACTLY_ONCE lambda
Since we cannot change type of parameter, we cannot replace it with
box type.
 #KT-29510 Fixed
 #KT-29614 Fixed
 #KT-29385 Fixed
2019-09-30 17:42:17 +03:00
Ilya Goncharov
c5ba19451f Fix leading zero for percents less than 10
- To avoid status text jumping
2019-09-30 16:53:25 +03:00
Ilya Goncharov
305b6091cd Consider, that ':' can be in file path (Windows case)
#KT-31478 fixed
2019-09-30 16:53:24 +03:00
Ilya Goncharov
923ecaf6b9 Fix js quoted strings for Windows 2019-09-30 16:50:42 +03:00
Ilya Goncharov
842cbf51c9 Assign of revertMethods instead of copying 2019-09-30 16:50:42 +03:00
Ilya Goncharov
9a5f937f2d Fix progress percentage 2019-09-30 16:50:42 +03:00
Ilya Goncharov
71963de70c Move revertible methods to finally 2019-09-30 16:50:42 +03:00
Ilya Goncharov
7680c21fb6 Print parsed stack trace 2019-09-30 16:50:42 +03:00
Ilya Goncharov
e911e0acbb Only parsed stacktrace consider
- NodeJs and Karma testing logging, exception handling and source maps works consistently
2019-09-30 16:50:42 +03:00
Ilya Goncharov
2ac24efc8b Process stack trace for karma 2019-09-30 16:50:42 +03:00
Ilya Goncharov
7010c03706 Move Karma Kotlin reporter to kotlin-test-js-runner 2019-09-30 16:50:42 +03:00
Ilya Goncharov
fa4f39f5eb Use own format error for source maps processing in karma reporter 2019-09-30 16:50:42 +03:00
Ilya Goncharov
9f64c426e5 Parse stack trace for extract original sources 2019-09-30 16:50:41 +03:00
Ilya Goncharov
a5c8882ccb Format error for teamcity log reporter
- formatError contains source map processing
2019-09-30 16:50:41 +03:00
Ilya Goncharov
efe8c2fa7c Remove redundant karma-source-map-support 2019-09-30 16:50:41 +03:00
Ilya Goncharov
36d9fe5a3a Add process stack trace for failing tests 2019-09-30 16:50:41 +03:00
Ilya Goncharov
3ca3842c3f Fix format 2019-09-30 16:50:41 +03:00
Ilya Goncharov
fb97375f86 Remove redundant debug flag for karma start 2019-09-30 16:50:41 +03:00
Ilya Goncharov
b22e56e1ba Fix IE karma alias 2019-09-30 16:50:41 +03:00
Ilya Goncharov
bbe51469ee Add devtool property for webpack
- Use inline-source-map for karma-webpack
2019-09-30 16:50:41 +03:00
Sergey Rostov
4c579f5286 build.gradle.kts: collect statistics about auto reload, fix 183 as as34 2019-09-30 14:08:43 +03:00
Nikolay Krasko
552408e887 Minor: update test data for quick doc with deprecated annotation 2019-09-30 13:38:27 +03:00
Nikolay Krasko
2ec231f381 Minor: fix CompletionMultiFileHandlerTest test 2019-09-30 13:38:27 +03:00
Nikolay Krasko
751a18e64b Minor: update test data PartialBodyResolveTestGenerated 2019-09-30 13:38:26 +03:00
Natalia Selezneva
064689b6b7 Merge pull request #2467 from t-kameyama/KT-14756
KT-14756 Move statement down breaks code in argument list
2019-09-30 13:19:07 +03:00
Mikhail Zarechenskiy
932d84d568 Fix performance regression in NI by fixing totally incorrect hashCode
The actual problem was introduced in 4f1e85b468, note how `hashCode` is implemented:
```
var currentHashCode = cachedHashCode
if (currentHashCode == 0) return currentHashCode
...
```
It's a silly bug, there should be check `if (currentHashCode != 0) ...` because `0` is used a marker for "uncomputed value".

Now, in the commit 0219b86d06 I added map with `KotlinType` as a key and because of constant `hash` for `KotlinType`, we basically got `List` instead of `Map`, which caused this performance regression

 #KT-34063 Fixed
2019-09-30 10:22:30 +03:00
Mikhail Zarechenskiy
957af741cd [NI] Don't forget marker interface for type variables 2019-09-30 10:22:30 +03:00
Natalia Selezneva
66a6713577 Tests: extract scripts testdata for light classes in ide to separate test
For compiled scripts there is AbstractIdeCompiledLightClassTest
For now there is a difference in light classes constructed from source and from compiled class (missing baseClass and constructor parameter for script class)
But it doesn't affect users because calling script class from Java isn't supported yet

testData for AbstractIdeLightClassTest and AbstractIdeLightClassForScriptTest can be merged when the difference will be fixed
2019-09-30 09:47:20 +03:00
Sergey Rostov
46f8feaf98 build.gradle.kts: collect statistics about auto reload 2019-09-30 09:44:52 +03:00
Alexey Tsvetkov
6c90279694 Ensure all output roots exist after Kotlin is compiled in JPS 2019-09-30 09:03:49 +03:00
Nikolay Krasko
1804619076 Fix AmbiguousCalls test in 192 2019-09-30 00:53:03 +03:00
Nikolay Krasko
7e691a0864 Store project to avoid creating psi factory from invalid element
Fix ConvertLineCommentToBlockCommentIntention tests
2019-09-30 00:53:03 +03:00
Nikolay Krasko
057c16bf10 Allow to mute and assert special failure for generated tests 2019-09-30 00:53:03 +03:00
Nikolay Krasko
319cabcc88 Remove deprecated InjectorUtils#putInjectedFileUserData in injection (KT-33775)
#KT-33775 Fixed
2019-09-30 00:53:03 +03:00
Ilya Kirillov
f70654d16b Fix CreateTypeParameter quick fix tests
Partially reset 21429f0b94
2019-09-29 20:43:19 +03:00
Ilya Kirillov
04515eda3d Fix nj2k module compilation for 191 & 183 branches 2019-09-29 18:45:48 +03:00
Ilya Kirillov
2ace905429 Fix IndexOutOfBoundsException (EA-211554) in SerializationPluginDeclarationChecker 2019-09-29 12:27:44 +03:00
Ilya Kirillov
41fd9fff76 Minor: reformat CreateTypeParameterUnmatchedTypeArgumentActionFactory 2019-09-29 12:27:44 +03:00
Ilya Kirillov
21429f0b94 Do not try to add type parameter to non-writable declaration (EA-209570) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
a24da280ca Call update for ScratchAction in EDT thread (EA-210180) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
7831237aaa Minor: reformat KotlinRunConfigurationProducer 2019-09-29 12:27:43 +03:00
Ilya Kirillov
016132c762 Fix NPE in KotlinRunConfiguration & do not throw exception on unknown container type (EA-209426) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
9deb7dc8d6 New J2K: do not require module to be present on converting
It may not be present when performing conversion inside repl
2019-09-29 12:13:41 +03:00
Ilya Kirillov
f77825b85a New J2K: remove RedundantCompanionReferenceInspectionBasedProcessing as it already applied on shortening references 2019-09-29 11:39:39 +03:00
Ilya Kirillov
95f69a9b58 New J2K: do not print debug info in inference tests 2019-09-29 11:39:39 +03:00
Ilya Kirillov
aaf05d5eb2 New J2K: reduce count of post-processing groups 2019-09-29 11:39:38 +03:00
Ilya Kirillov
208c4d6fc7 New J2K: move visitor generator out of src folder 2019-09-29 11:39:38 +03:00
Ilya Kirillov
41935bdd34 New J2K: separate logic in code builder to different classes 2019-09-29 11:39:37 +03:00
Ilya Kirillov
043a669812 New J2K: do not print qualified names if corresponding qualifier can unambiguously resolved
This speeds up shortening qualified references phase
2019-09-29 11:39:37 +03:00
Ilya Kirillov
678cc35008 New J2K: reuse already calculated type arguments in inference post-processing 2019-09-29 11:39:36 +03:00
Ilya Kirillov
c000f33955 New J2K: make initial generating code formatting better 2019-09-29 11:39:36 +03:00
Ilya Kirillov
f3b53a9532 New J2K: rework Java code formatting collecting
#KT-33687 fixed
2019-09-29 11:39:35 +03:00
Ilya Kirillov
37ee81dfa1 New J2K: use Java classes for instance checking instead of Kotlin ones 2019-09-29 11:39:35 +03:00
Ilya Kirillov
392a75e6b8 New J2K: use KotlinExceptionWithAttachments to report tree building errors
Also, try not to throw exceptions when possible
2019-09-29 11:39:34 +03:00
Vladimir Dolzhenko
3e2dac6586 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193 2019-09-29 09:45:42 +02:00
Vladimir Dolzhenko
7c80c6ba63 Fix performanceTests for 193 2019-09-29 09:38:27 +02:00
Ilya Gorbunov
885d99068c Test reading files with incorrectly reported length
#KT-33864
2019-09-28 19:23:26 +03:00
Ilya Gorbunov
c9dd8344d1 Do not use file length estimate in File.readText
This handles the situation when reported file length is less than actual.

#KT-33864
2019-09-28 19:20:54 +03:00
Ilya Gorbunov
fe31509044 Support File.readBytes when reported file length is less than actual
After reading 'length' bytes from a file, check if there's extra content
available and read it into a resizable buffer, then append it after
the first 'length' bytes.

#KT-33864
2019-09-28 19:20:54 +03:00
Ilya Chernikov
3220101c7b [minor] fix Gradle test broken on the build refactoring 2019-09-28 17:50:45 +02:00
Ilya Chernikov
4d19299e95 [minor] Fix scripting classpath test on windows 2019-09-27 19:44:49 +02:00
Anton Yalyshev
6fa7da57a4 It's better to get plugin version once but not in cycle 2019-09-27 20:06:53 +03:00
Anton Yalyshev
db189fa218 Remove Maven and JPS targets collectors that are unused now 2019-09-27 20:06:53 +03:00
Anton Yalyshev
d4266e1be6 Bunches for ProjectConfigurationCollector 2019-09-27 20:06:53 +03:00
Anton Yalyshev
21b7d873e7 Move build system and targets statistics collection from StartupActivity to FUS State Collector 2019-09-27 20:06:53 +03:00
Anton Bannykh
ead8379c50 JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed) 2019-09-27 19:12:03 +03:00
Andrey Uskov
6a808ce842 Fix import tests compilation in bunch 183 2019-09-27 17:28:07 +03:00
Dmitriy Novozhilov
439e8faf94 [NI] Remove outdated intention test according to fixed consistency of OI and NI 2019-09-27 17:20:47 +03:00
Anton Bannykh
b4917ec816 JS: remove unconditional as SimpleType cast
This is a workround for a bug introduced in the typeOf
support
2019-09-27 16:55:10 +03:00
Toshiaki Kameyama
82f75c707e "Convert to range check" inspection: apply ReplaceRangeToWithUntilInspection after convertion
#KT-33880 Fixed
2019-09-27 20:33:48 +07:00
Toshiaki Kameyama
54df0aad16 Reformat ConvertTwoComparisonsToRangeCheckIntention 2019-09-27 20:33:48 +07:00
Georgy Bronnikov
6c2eb3dd16 Change expected test output 2019-09-27 16:32:15 +03:00
Anton Yalyshev
6c06c4e3fc Group Id and Version fields generation doesn't need 193 bunches. It works well with previos versions. 2019-09-27 14:58:19 +03:00
Anton Yalyshev
18cfa42930 Bump Gradle to 5.5.1 cause it contains several major fixes for 5.5 2019-09-27 14:58:19 +03:00
Anton Yalyshev
a53f66ca4e Gradle 5.5 Daemon requires -Xmx256m 2019-09-27 14:58:19 +03:00
Anton Yalyshev
ee7b583a82 Bump Gradle and Android build tools version in New Kotlin Project Templates #KT-27587 Fixed 2019-09-27 14:58:18 +03:00
Anton Yalyshev
626087a46e Use type-safe model accessors for Gradle plugin #KT-31766 Fixed 2019-09-27 14:58:18 +03:00
Anton Yalyshev
721aa81ca5 Relying on platform stepping goes better only from 2019.3 2019-09-27 14:58:18 +03:00
Anton Yalyshev
a66078f2cd Let New Gradle project or module wizard rely on platform stepping to avoid inconsistency #KT-33927 Fixed #KT-30685 Fixed #KT-28404 Fixed 2019-09-27 14:58:18 +03:00
Mark Punzalan
c16b59191b Do not cache "last" value (i.e., size/length) in lowered for-loop
iteration over CharSequences.

CharSequences may be mutable (e.g., StringBuilder) and therefore its
contents and length can change within the loop.
2019-09-27 13:44:40 +02:00
Ilya Matveev
3da3e1cae9 IDE: Add native extensions to KotlinCompilation 2019-09-27 18:06:58 +07:00
Ilya Matveev
95cbb4e8b4 IDE: Add a flag to disable native libraries propagation 2019-09-27 18:06:58 +07:00
Ilya Matveev
becdd7a5e6 Add a test for native dependency propagation 2019-09-27 18:06:57 +07:00
Ilya Matveev
701e92ace2 IDE: Propagate platform libraries to common modules for some native targets
Some native platforms (e.g. ios_arm64 and ios_x64) have almost
identical platform libraries. For such platforms we can workaround
a lack of the commonizer and resolve common sources against
libraries of one of these platforms. This patch enables this
workaround by propagating dependencies to common modules.

Issue #KT-33999 fixed
2019-09-27 18:06:56 +07:00
Ilya Matveev
6b10336497 Common iOS: Store konanTarget in KotlinNativeCompilation 2019-09-27 18:06:56 +07:00
Dmitry Gridin
c185cecb40 Completion: fix shortening of fully qualified name for case of conflicts between property and function
#KT-31902 Fixed
#KT-33937 Fixed
2019-09-27 17:52:11 +07:00
Dmitry Gridin
589094377e QualifiedExpressionResolver: change root prefix from _Qfadj4tPV to _root_ide_package_ 2019-09-27 17:52:11 +07:00
Alexander Podkhalyuzin
9a2da67919 ShortenReferences: cleanup code & add tests for property-function conflicts 2019-09-27 17:52:11 +07:00
Natalia Selezneva
917a7f572d Check that project is open before starting highlighting
This may be false when user opens Kotlin Scripting Settings, so default project is passed to ScriptDefinitionsManager
^KT-30206 Fixed
2019-09-27 12:59:43 +03:00
Natalia Selezneva
5ab119ecfb Do no try to find script definitions for default project
This may happen when user opens Kotlin Scripting Settings
^KT-32401 Fixed
2019-09-27 12:58:36 +03:00
Ilya Chernikov
1e80c03d41 Fix Extensions/Components API usage in core environment for 193+
for it the com.intellij.core.JavaCoreApplicationEnvironment has to be
copied to the compiler (named now KotlinCoreApplicationEnvironment)
and modified accordingly
2019-09-27 11:51:25 +02:00
nicolay.mitropolsky
995dda3785 Uast: support for String-identifiers 2019-09-27 12:22:07 +03:00
Andrey Uskov
a4a03aeb5c Fix compilation of KotlinMPPGradleModelBuilder 2019-09-27 12:14:43 +03:00
Andrey Uskov
ca75aeb534 Update kotlin gradle plugin version in HMPP tests 2019-09-27 12:00:08 +03:00
Andrey Uskov
ed750f4d10 Do not import orphan source sets 2019-09-27 12:00:05 +03:00
Andrey Uskov
03b58d9941 Point to module names instead of source set names in dependsOn of Facet 2019-09-27 12:00:02 +03:00
Andrey Uskov
715fad849d Importing test tasks and targets is implemented 2019-09-27 11:59:58 +03:00
Vladimir Dolzhenko
e2f9eaa483 Use async profiler for perfTests if it presents in env variable; Add kt project copy-n-paste perfTests 2019-09-27 10:33:49 +02:00
Natalia Selezneva
de369e6527 Revert "Fix testdata for IdeLightClassTestGenerated.Script after scripting API refactoring"
This reverts commit a3f4effe
2019-09-27 10:52:16 +03:00
Mikhail Glukhikh
4718ae4186 FIR: don't perform argument check for callable references
This fixes failing FIR2IR test
2019-09-27 09:23:34 +03:00
Mikhail Glukhikh
da7d5d5702 FIR: provide receiver for accessor of extension property 2019-09-27 09:22:52 +03:00
Mikhail Glukhikh
0d4ca06372 Fix FirCallableReferenceAccessImpl.transformChildren 2019-09-27 09:21:53 +03:00
Mikhail Glukhikh
11fb121458 FirProvider: search for fake overridden symbol containing file correctly 2019-09-27 09:21:02 +03:00
Mikhail Glukhikh
0438ab96e1 FIR: add a test with current top resolve problems 2019-09-27 09:20:31 +03:00
Toshiaki Kameyama
40dd229021 Join with assignment: place the result at the assignment
#KT-21172 Fixed
2019-09-27 09:16:52 +03:00
Toshiaki Kameyama
8078c5da40 Reformat JoinDeclarationAndAssignmentIntention 2019-09-27 09:16:51 +03:00
Mikhail Glukhikh
d45e83b27d Introduce subject to when: don't perform analysis in if transformation
Otherwise we get an exception about non-analysable file
Related to KT-18772
2019-09-27 09:16:50 +03:00
Toshiaki Kameyama
fdf9acfb6a Introduce subject to when: suggest for qualified, not for obj / constant
#KT-18772 Fixed
2019-09-27 08:26:52 +03:00
Dmitriy Dolovov
2cde0a800a [Commonizer] Fine-grained use of KotlinBuiltIns 2019-09-27 09:18:36 +07:00
Dmitriy Dolovov
14fa3d30d5 Turn on running Kotlin/Native-specific tests 2019-09-27 09:18:27 +07:00
Dmitriy Dolovov
25e5442a13 [Commonizer] Clean-up in facade API 2019-09-27 09:18:15 +07:00
Dmitriy Dolovov
acd146363e [Commonizer] Classifiers tests 2019-09-27 09:18:06 +07:00
Dmitriy Dolovov
1a49d88578 [Commonizer] Classifiers 2019-09-27 09:17:56 +07:00
Dmitriy Dolovov
e6b17e4bb5 [Commonizer] Internal improvements, p.2 2019-09-27 09:17:48 +07:00
Dmitriy Dolovov
81eef5152e [Commonizer] Type parameters, type parameter tests 2019-09-27 09:17:38 +07:00
Dmitriy Dolovov
7fff5407be [Commonizer] Internal improvements 2019-09-27 09:17:13 +07:00
Dmitriy Dolovov
a5e9671df2 [Commonizer] Function descriptors, function descriptor tests 2019-09-27 09:17:07 +07:00
Dmitriy Dolovov
6a20a14f6e [Commonizer] Property descriptor tests 2019-09-27 09:16:57 +07:00
Dmitriy Dolovov
7fee9d2f5a [Commonizer] Property descriptors 2019-09-27 09:16:45 +07:00
Roman Golyshev
0239229dfc KT-33903: consider imports from objects when removing descriptors duplicates
- `ImportedFromObjectCallableDescriptor` and descriptors in general do
not have consistent `equals`,  which leads to duplication in completion
when multiple functions from objects are imported, or when function is
visible in some scope both implicitly and by import (see KT33903_1.kt)
- ^KT-33903 Fixed
2019-09-26 18:23:04 +03:00
Alexander Podkhalyuzin
cdebd6bc05 Fixed testdata as Enter shouldn't override completion 2019-09-26 16:25:50 +03:00
Alexander Podkhalyuzin
66bed85176 Fixed testdata for new inference 2019-09-26 16:25:50 +03:00
Alexander Podkhalyuzin
d018489621 Fixed testdata
JS stdlib contains more classes now, so we need to filter them out
2019-09-26 16:25:50 +03:00
Dmitry Gridin
57d25fc5f5 Create actual: add type accessibility checker
#KT-28740 Fixed
2019-09-26 20:21:54 +07:00
Dmitry Gridin
fcaa897b9f Tests: extract addMissingActualMembers from multiModuleQuickFix/other 2019-09-26 20:21:54 +07:00
Dmitry Gridin
a552f06526 Create expect/actual: improve error hint message
#KT-33754 Fixed
2019-09-26 20:21:54 +07:00
Dmitry Gridin
773e4764b1 TypeAccessibilityCheckerImpl: fix incorrectTypes for KtNamedDeclaration 2019-09-26 20:21:54 +07:00
Natalia Selezneva
a3f4effe3e Fix testdata for IdeLightClassTestGenerated.Script after scripting API refactoring
Generated script class no longer has a supertype
2019-09-26 14:24:47 +03:00
Ilya Chernikov
3430a21fa1 Add test to the scripting fixes for maven plugin
tests KT-34011 and KT-34006 fixes
2019-09-26 11:46:55 +02:00
Ilya Chernikov
517e5e8954 Fix loading scripting plugin from the current classloader
previous code was completely wrong - wrong package and wrong procedure
#KT-34011 fixed
2019-09-26 11:46:55 +02:00
Ilya Chernikov
a1118ce209 Do not skip maven compilation if sources contain .kts files but no .kt files
#KT-34006 fixed
2019-09-26 11:46:55 +02:00
Ilya Chernikov
c53a805696 [minor} Refactor scripting host tests:
- move definitions into one place
- reduce script/repl compilation classpath - spedd-ups tests (~10%)
2019-09-26 07:16:24 +02:00
Ilya Chernikov
0a1aff4f80 Do not add updated script classpath to the compilation configuration
it is added via the updateClasspath call with proper duplicates control
2019-09-26 07:16:24 +02:00
Ilya Chernikov
256d3a79e4 [minor] refactor and extend script dependencies resolving tests 2019-09-26 07:16:23 +02:00
Ilya Chernikov
bda2e46697 [minor] Fix classpath from class calculation utility for classes dir 2019-09-26 07:16:23 +02:00
Svyatoslav Kuzmich
7592048437 [JS] Support typeOf 2019-09-25 18:12:55 +03:00
Vyacheslav Gerasimov
c1e1dbd83e Build: Fix usages of "java.home" for tools.jar dependency
#KT-33984
2019-09-25 17:54:18 +03:00
Abduqodiri Qurbonzoda
eae6fbad3a Document String.contentEquals overloads difference 2019-09-25 17:43:45 +03:00
Vyacheslav Gerasimov
71416f9dbf Build: Make internalKotlinRepo url independent from bootstrap 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
60dc52f364 Build: Use cacheRedirector flag for bootstrap 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
9e495f8810 Build: Use bootstraps from kotlin-bootstrap repository 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
1b5417e422 Minor: Build use cache-redirector for bootstrap repos 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
ed59741e14 Minor: Reformat 'buildSrc/src/main/kotlin/Bootstrap.kt' 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
b7ebe17fe0 Build: Add kotlin-bootstrap repository to bootstrap options 2019-09-25 15:58:49 +03:00
Natalia Selezneva
dd85dcc1c7 193: Do not modify registry property since the default changed in 193
Review in IDEA: IDEA-CR-51492
2019-09-25 15:54:04 +03:00
Natalia Selezneva
153339bc26 193: Remove Gradle Kotlin DSL template because they are provided by Gradle Plugin (since 193)
^IDEA-219018
2019-09-25 15:54:04 +03:00
Vladimir Dolzhenko
750a677366 Register manually IDEKotlinBinaryClassCache for AbstractLoadJavaClsStubTest.kt 2019-09-25 14:49:17 +02:00
Sergey Igushkin
ece7a3e70e Add extensions with explicit Class<*> instance for Kotlin DSL, KT-31077 2019-09-25 15:46:07 +03:00
Sergey Igushkin
3abb1b3f40 Fix lint task in Android projects depending on MPP, KT-27170 2019-09-25 15:46:06 +03:00
Sergey Igushkin
032686ebe0 Fix kapt class structure configuration not resolving MPP deps, KT-33105 2019-09-25 15:46:06 +03:00
Sergey Igushkin
3deff3b347 Fix Kapt configuration not resolving MPP deps to JVM variants, KT-31641 2019-09-25 15:46:06 +03:00
Sergey Igushkin
f2d2fb9e6b Fix Kapt-generated sources not compiled by jvm.withJava(), KT-32804
Given that the Kapt subplugin creates new tasks, it is impossible
to run it in the context of lazy task configuration. Disable lazy
task configuration for Kotlin/JVM by always accessing the task
instance until subplugins are refactored to be able to properly
work with task configuration avoidance.
2019-09-25 15:46:05 +03:00
Sergey Igushkin
0456220f7a Fix issues found in KOTLIN-CR-3233 2019-09-25 15:46:05 +03:00
Sergey Igushkin
f0ef5a90b3 Add an integration test for the test runs API
Issue #KT-32679
2019-09-25 15:46:05 +03:00
Sergey Igushkin
d1016f0221 Reimplement friend task/friend paths using associated compilations
Replace the old ad-hoc task matching mechanism used for connecting the
compilation tasks that need to share internal visibility with an
implementation based on the associate compilations and compilation
outputs rather than `destinationDir`s of the tasks.

The only place that still requires ad-hoc friend paths is the Android
instrumented tests compiling against the JAR of the main variant, not
its classes dirs. Support that with `friendArtifacts`.

Issue #KT-17630 Fixed
Issue #KT-20760 Fixed
2019-09-25 15:46:05 +03:00
Sergey Igushkin
c4d9c4cee4 Group associated compilations into modules with a single module name
As associated compilations will see internals of each other, they now
need to share the module name for the compiler to be able to correctly
generate calls to the internals.

Move `moduleName` to `KotlinCompilation`.

Group associate compilations into modules in a DSU-like way, use a
single module name for all of the compilations grouped into a module.
2019-09-25 15:46:04 +03:00
Sergey Igushkin
94fd5c2884 Implement source sets visibility inference via associate compilations
Add non-public API for the IDE to query additional visible source sets
for each source set.
Implement visibility inference via associate compilation links.
Implement visibility requirements for source sets and requirements
satisfaction checks in Gradle build.
2019-09-25 15:46:04 +03:00
Sergey Igushkin
8c1c687e92 Implement associate compilations, KT-34009
Partial implementation of the associate compilations proposal. A
compilation can now contain links to other compilation that it compiles
against. This links will replace ad-hoc inter-compilation dependencies.

Issue #KT-34009 Fixed
2019-09-25 15:46:04 +03:00
Sergey Igushkin
bb6f406be4 Partial cleanup & refactoring of the Android plugin
The `KotlinAndroidPlugin` used to support two different sets of APIs of
the Android Gradle plugin and used `AbstractAndroidProjectHandler` to
wrap those APIs. Now that there's only one implementation, it
doesn't need the generic `V` (variant data), and some cleanup is needed.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
0e59553d12 Add Kotlin & Java destination dirs as output of Android compilation
The compilation outputs of Android compilations accidentally were left
empty. The `destinationDir`s of the Kotlin & Java tasks should be
registered in the `output.classesDirs`.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
9836a1ca4a Make compilationsBySourceSets safe to use during evaluation
This function used to only calculate the mapping once and store it for
the project, so it was unsafe to use early. Fix that by evaluating the
value each time and then freezing it at the point of either task graph
being ready, or any task being executed.

Also, store the map in the project's `ext` rather than in a static weak
hash map, which is safer wrt memory leaks.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
5dd4e0ed42 Track the compilation outputs as inputs of Gradle JS test tasks, KT-33313
Issue #KT-33313 Fixed
2019-09-25 15:46:02 +03:00
Sergey Igushkin
3011a3cf81 Create objects via Gradle ObjectFactory to allow access from Groovy 2019-09-25 15:46:02 +03:00
Sergey Igushkin
fe50029beb Adjust task output detection for Gradle 4.9 2019-09-25 15:46:02 +03:00
Sergey Igushkin
43c3122a13 Drop Gradle versions older than 4.9
* Replace `TaskHolder` with `TaskProvider`, remove `TaskHolder`
* Migrate Gradle integration tests to Gradle 4.9+
2019-09-25 15:46:01 +03:00
Sergey Igushkin
9f0c5675bd Introduce execution & test run API, KT-32679
* KotlinExecution
* KotlinExecutionSource
* KotlinTestRun
* Aggregating executions and execution sources
* KotlinTargetWithTests

* Add a `testableTargets` extension
* Make some Kotlin/Native targets testable (this requires
  having a separate preset type for them)
* Implement test runs encapsulating the tests for all
  existing testable targets by refactoring their
  TargetConfigurator classes

Issue #KT-32679 Fixed
2019-09-25 15:46:01 +03:00
Pavel Kirpichenkov
6c8e829f19 Update diagnostics for trailing lambdas, add quickfix
Alternative message for errors, caused by unexpected lambda expression arguments on a new line.
Both diagnostic are reported, if multiple lambda expressions were passed to the call.
For other errors trailing lambda diagnostic overrides the original one.

Quickfix for erroneous trailing lambdas on a new line after call.
Fix separates lambda expression from previous call with semicolon.
All trailing lambda arguments become standalone lambda expressions.
2019-09-25 15:38:17 +03:00
Nikolay Krasko
f00d609459 Fix KotlinConfidenceTest tests 2019-09-25 14:06:36 +03:00
Ivan Gavrilovic
f89885224e Add tests for running incremental KAPT on JDK9
Add test for aggregating incremental annotation processors and JDK9.
This makes sure the implementation is not using any types that have
been removed in JDK 9.
2019-09-25 19:21:10 +09:00
Ivan Gavrilovic
4da6675640 Do not depend on BaseFileObject type for incremental KAPT
This class does not exist in JDK9, so running incremental KAPT on
JDK9 fails. Because it is used only to get the name of the file,
this has been replaced with usage of the public JavaFileObject API.
2019-09-25 19:21:10 +09:00
Ivan Gavrilovic
aaa00b0f6f KT-33889: Do not use private non-API methods from JavacProcessingEnvironment
Avoid using JavacProcessingEnvironment.validImportStringToPattern method
because it has been removed in JDK9. This commit changes how we compute
pattern to match the class names, and it create instances of Pattern
manually by following spec for Processor.getSupportedAnnotationTypes().
Support for module prefix is not added yet.
2019-09-25 19:21:10 +09:00
LepilkinaElena
594f4a6f56 New flag for KotlinNativeCompilation to enable endorsed libraries (#2618) 2019-09-25 10:28:09 +03:00
Alex Chmyr
b8cce67d2e KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field 2019-09-25 10:08:42 +03:00
Toshiaki Kameyama
748e458ad7 "Override members": add semicolon between enum entry and function
#KT-31139 Fixed
2019-09-25 12:34:49 +07:00
Toshiaki Kameyama
7fcca71b4b Replace with dot call quickfix: don't break formatting
#KT-25697 Fixed
2019-09-25 12:06:51 +07:00
Toshiaki Kameyama
7b56733bda Reforma ReplaceCallFix 2019-09-25 12:06:51 +07:00
Mikhail Zarechenskiy
78affdd2b4 Fix old testdata: add missing operator modifier
This testdata was written when there was no "operator" modifier.

 After a83225218f rules for operators become stricter and now functions without operators are not considered as such
2019-09-25 01:52:55 +03:00
Vladimir Dolzhenko
a98c610958 Fix KotlinCodeStyleSettings and IDEKotlinBinaryClassCache.kt 191 compilation 2019-09-24 22:01:05 +02:00
Vladimir Dolzhenko
c961de7289 Fix kotlinRefactoringUtil.kt.193 compilation 2019-09-24 21:03:35 +02:00
Mads Ager
b00858a886 Start local var scope for destructuring variables after init.
If the scope for a local variable is started before a value
has been written, another value from a previous use of the local
slot can be present. That value could have a different type which
would lead to weird debugging situations and also leads to other
tools (such as D8) rejecting the locals information as it is
invalid.

Fixes KT-33959.
2019-09-24 18:32:19 +03:00
Vyacheslav Gerasimov
d54bc3a4bb 193: Fix tests compilation for 193 platform 2019-09-24 18:22:35 +03:00
Vladimir Dolzhenko
a8c72b7e84 Do not resolve services in static initializers in IDEKotlinBinaryClassCache, KT-33973 2019-09-24 16:47:49 +02:00
Vladimir Dolzhenko
6f739db3b1 Fixed KotlinCodeInsightWorkspaceSettings plugin service description for 193 2019-09-24 16:42:58 +02:00
Ilya Kirillov
cb569f8493 Do not use resolving to understand which method we use in "replace get or set inspection" 2019-09-24 17:21:49 +03:00
Ilya Kirillov
4e27d2e658 New J2K: do not use global write action for some post-processings which may use resolving while applying
Also, modify that post-processings & inspections to explicitly use write action
when modifying PSI elements

#KT-33875 fixed
2019-09-24 17:21:49 +03:00
Ilya Kirillov
74ba5b210a New J2K: do not analyze code for post-processings in edt thread 2019-09-24 17:21:48 +03:00
Ilya Kirillov
e6f2e0041c New J2K: get rid of generalInspectionPostProcessing 2019-09-24 17:21:47 +03:00
Ilya Kirillov
a4cf7a912b Split some non applicability based inspections into isApplicable and apply
This is needed to fit new nj2k post-processing structure
2019-09-24 17:21:47 +03:00
Ilya Kirillov
3724e2bb02 New J2K: convert all custom post-processing to applicability based ones 2019-09-24 17:21:46 +03:00
Ilya Kirillov
509fcb17c7 New J2K: consider empty/singleton children list when comparing trees in default arguments conversion 2019-09-24 17:13:13 +03:00
Ilya Kirillov
704b3bd2e6 New J2K: always print real fqNames for static calls
As fqNames of some symbols may change during conversion
E.g, when moving Java static method to Kotlin companion object

#KT-19607 fixed
#KT-32903 fixed
#KT-33743 fixed
#KT-33556 fixed
2019-09-24 17:13:12 +03:00
Ilya Kirillov
f9fac0acf5 New J2K: do not save import statements in files as we print fqNames for calls
This may cause conflicts on shortening fq references post-processing step
2019-09-24 17:13:11 +03:00
Dmitry Savvinov
e3b7b41544 Minor: rename globalFacade -> facadeForModules 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
937d041bc3 Minor: rename file ResolverForProjectImpl.kt -> AbstractResolverForProject 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
bef33e971f Make ResolverForProject own BuiltInsCache
Previously, BuiltInsCache was a separate abstraction with its own
lifecycle. In particular, it had a CachedValue inside, which uses
SoftReference to hold the computed data. This is bad, because this might
lead to disalignment of lifetimes with respective ResolverForProject,
leading to potential exceptions in analysis, see KT-33504 for details.

This commit fixes it by making root ResolverForProject own BuiltInsCache
and removing any logic about invalidation from BuiltInsCache. So, now,
BuiltInsCache is disposed iff corresponding ResolverForProject is
disposed

^KT-33504 Fixed
2019-09-24 17:05:05 +03:00
Dmitry Savvinov
bfacc1a3c5 Introduce AbstractResolverForProject
Previously, ResolverForProjectImpl had multiple callbacks in
constructor. Some of those callbacks were used only to overcome module
visibility and provide an ability to inject IDE-specific logic into
compiler (ResolverForProject is in the 'compiler'-module)

This commit introduces abstract class which implements
environment-independent logic (previously, this logic had been stored in
ResolverForProjectImpl) with several abstract met hods (previously,
callbacks). Then, we provide few concrete implementations of
AbstractResolverForProject with clear semantics:

- IdeaResolverForProject: resolver used in IDE, where we have indices,
  oracles, multiple modules, etc.
- ResolverForSingleModuleProject: resolver for project with only one
  module, commonly used for CLI compiler/tests
- one anonymous implementation for MultimoduleTests

This refactoring achieves several things:
- now it is easier to see what kinds of ResolverForProject you might see
  in some particular environment (previously, one had to inspect all
  call-sites of constructor)
- we can easily add IDE-specific logic in IdeaResolverForProject without
  adding noisy callbacks (which most probably wouldn't have any other
  non-trivial implementations)
2019-09-24 17:05:05 +03:00
Dmitry Savvinov
48719c4050 Minor: extract ResolverForProjectImpl into separate file 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
1e288c03c3 Minor: fix typos in KDoc 2019-09-24 17:05:04 +03:00
Dmitry Savvinov
4f700f5df3 Minor: drop unused parameter from createFacadeForScriptDependencies 2019-09-24 17:05:04 +03:00
Andrey Uskov
8ff4a92562 Fix serialization of data nodes tree
#KT-33987 Fixed
2019-09-24 16:27:13 +03:00
Ilya Kirillov
41f7519244 Fix old j2k test data to actual one 2019-09-24 16:22:24 +03:00
Vladimir Dolzhenko
8b0aeb9a55 Do not resolve services in non-default ctors 2019-09-24 15:15:37 +02:00
Toshiaki Kameyama
0e1e1e350f "Convert lambda to reference": do not remove required backticks
#KT-15700 Fixed
2019-09-24 19:45:53 +07:00
Toshiaki Kameyama
44edd94fea "Create member function" quick fix: do not add redundant semicolons after enum entry
#KT-14899 Fixed
2019-09-24 19:40:31 +07:00
Toshiaki Kameyama
0497f0cba4 "Create enum constant" quick fix: add before semicolon
#KT-33718 Fixed
2019-09-24 19:31:52 +07:00
Toshiaki Kameyama
30c41e6720 "Create type parameter from usage": don't suggest for not extension property
#KT-33300 Fixed
2019-09-24 19:28:40 +07:00
Toshiaki Kameyama
68609401c4 Reformat CreateTypeParameterByUnresolvedRefActionFactory 2019-09-24 19:28:40 +07:00
Toshiaki Kameyama
5b666ff33f "Create type parameter from usage": don't remove backticks if necessary
#KT-33299 Fixed
2019-09-24 19:24:02 +07:00
Ilya Goncharov
bfc698a521 Add comment for log-reporter and its necessity 2019-09-24 14:36:11 +03:00
Ilya Goncharov
09e2ebe60a Both js targets use one TC service message classes 2019-09-24 14:36:11 +03:00
Ilya Goncharov
7d4b43f819 Remove annoying spaces in karma-teamcity-reporter 2019-09-24 14:36:10 +03:00
Ilya Goncharov
b4e3cf1d7a Move teamcity reporting only to nodejs 2019-09-24 14:36:10 +03:00
Ilya Goncharov
46e82468e4 Provide logging through kotlin-test=js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov
f0e72c4d71 Remove mangling for kotlin-test-js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov
e59d1a0ef1 Use terser instead of uglify 2019-09-24 14:36:10 +03:00
Toshiaki Kameyama
784ba69b7a "Cleanup code": remove 'final' keyword for overridden function with non-canonical modifiers order
#KT-33060 Fixed
2019-09-24 18:28:00 +07:00
Steven Schäfer
f49d5da929 JVM IR: Fix enum constructor visibility 2019-09-24 13:28:08 +03:00
Kristoffer Andersen
52dc469657 JVM IR: Generate synthetic methods for type aliases with annotations 2019-09-24 12:21:42 +02:00
romanart
acd1cc5a57 [KLIB] Normalize path string to keep file order on Windows OS 2019-09-24 12:41:48 +03:00
Dmitry Gridin
1ee827bfc8 Import quick fix: support provideDelegate
#KT-28049 Fixed
2019-09-24 16:27:10 +07:00
Toshiaki Kameyama
79199260b9 Import quick fix: suggest for operator extension function called from name reference
#KT-28049 Fixed
2019-09-24 16:27:09 +07:00
Toshiaki Kameyama
998adfb098 Move variable declaration into when: don't report when property has 'break' or 'continue'
#KT-31999
2019-09-24 12:11:41 +03:00
Toshiaki Kameyama
877e583a96 Move variable declaration into when: don't report when property has 'return' or 'throw'
#KT-31999 Fixed
2019-09-24 12:11:41 +03:00
Toshiaki Kameyama
d9d04fc556 "Create enum constant" quick fix: do not add redundant empty line
#KT-32981 Fixed
2019-09-24 13:23:06 +07:00
Dmitry Gridin
5dddc464a5 Completion: add tests for case with overloaded function with lambda with receiver parameter
Relates to #KT-31073
2019-09-23 23:20:26 +07:00
Dmitry Gridin
e3ce799993 Refactoring: change signature should affected expect/actual
#KT-33972 Fixed
2019-09-23 23:01:47 +07:00
Dmitry Gridin
484dda478e AbstractIntentionTest: should check startInWriteAction flag 2019-09-23 23:01:46 +07:00
Dmitry Gridin
667e9a33e8 AbstractIntentionTest: cleanup code 2019-09-23 23:01:46 +07:00
Dmitry Gridin
cbdda6f9a8 KotlinChangeSignatureData: cleanup code 2019-09-23 23:01:46 +07:00
Nikolay Krasko
7271e65851 Don't store hard references to psi elements in transferable data (KT-33802)
This leads to project leaked errors in tests.
2019-09-23 18:58:11 +03:00
Igor Yakovlev
f8bd3518dc UL method and parameter Move&Rename refactoring 2019-09-23 17:30:15 +03:00
Igor Yakovlev
fc70fd05fc Enable kotlin.collections support for UL classes
Removed restriction for classes derived from Kotlin collections
Added type erasure for java collection overrided methods
2019-09-23 17:30:15 +03:00
Igor Yakovlev
286702a99c Format code for NoArgPlugin 2019-09-23 17:07:33 +03:00
Igor Yakovlev
1deba19e1c Refactoring NoArg compiler plugin
Remove NoArgClassKey relation betwen AbstractNoArgDeclarationChecker and NoArgExpressionCodegenExtension
Separate NoArgExpressionCodegenExtension to Ide and Cli versions
2019-09-23 17:07:33 +03:00
Vladimir Dolzhenko
027c60080b Added KotlinCodeInsightWorkspaceSettings in place of sharing kotlin settings with java CodeInsightSettings 2019-09-23 16:05:11 +02:00
Nikolay Krasko
6b5a73ffa9 Enable resolve in dispatch thread check for copy-paste tests 2019-09-23 16:54:35 +03:00
Nikolay Krasko
ee4ab967a4 Force resolve check for dispatch thread instead of isWriteAccessAllowed
isWriteAccessAllowed = dispatch thread + write lock
2019-09-23 16:54:35 +03:00
Nikolay Krasko
9f81de293f Minor: add intention name to test failure 2019-09-23 16:54:35 +03:00
Ilya Matveev
fabd336856 Update K/N: 1.3.60-dev-12485 2019-09-23 18:45:17 +07:00
Vladimir Dolzhenko
17e2359a41 Added copy-paste performance tests 2019-09-23 12:48:59 +02:00
Natalia Selezneva
63e5d4fe95 Tests: rewrite some AbstractScriptConfigurationTest to the new script infrastructure 2019-09-23 12:06:25 +03:00
Natalia Selezneva
eca7bbdb8c Scripts: Check if file is in all script dependencies class files scope instead of searching for module info
^KT-32799 Fixed
^KT-16760 Add test
2019-09-23 12:06:25 +03:00
Toshiaki Kameyama
245b2aecb3 "Replace guard clause with kotlin's function call" inspection : decrease severity to INFORMATION
#KT-33235 Fixed
2019-09-23 11:36:14 +03:00
Ivan Gavrilovic
573e7f2eee Run JDK11 tests for KAPT only if JDK11 is available
Otherwise, just skip running them.
2019-09-23 17:32:37 +09:00
Ivan Gavrilovic
6e7f046471 Fix gradle integeration tests
Fix test failure on Windows, where backslash was not escaped
in a build file. Also, remove obsolete test for Gradle 4.2,
because 4.3 is the minimum supported version.
2019-09-23 17:32:36 +09:00
Toshiaki Kameyama
92dcb54207 "Redundant overriding method" inspection: do not report when overriding package private method
#KT-33153 Fixed
2019-09-23 12:35:56 +07:00
Alexander Udalov
25799447a6 Minor, use slightly less internal argument to enable inline classes 2019-09-21 02:03:31 +02:00
Steven Schäfer
e4609a9968 JVM IR: Cache inline class replacements at the module level 2019-09-20 23:41:39 +02:00
Steven Schäfer
f40f9611c3 JVM IR: Fix spread operator on unsigned array type 2019-09-20 18:17:31 +02:00
Mikhail Zarechenskiy
1a50a3cbb1 [NI] Avoid computing few things for simple calls without type variables 2019-09-20 17:56:07 +03:00
Mikhail Zarechenskiy
7bd65c0bcd [NI] Avoid collecting possible types for call expressions 2019-09-20 17:56:07 +03:00
Mikhail Zarechenskiy
a83225218f [NI] Fix checks for infix/operator conventions 2019-09-20 17:56:06 +03:00
Pavel Kirpichenkov
f45a49b122 Remove uncapturing in type mismatch diagnostics
#KT-32587 Fixed
2019-09-20 17:05:03 +03:00
Ilya Matveev
5c904250be Gradle, native: Update a K/N version in tests
Earlier, K/N 1.1 was used when testing the kotlin.native.version
property. But this version doesn't support the -no-endorsed-libs
flag add recently. This patch updates K/N version in tests.
2019-09-20 16:54:30 +07:00
Ilya Goncharov
31aa4e4738 Rename kotlin-test-nodejs-runner to kotlin-test-js-runner 2019-09-20 10:56:18 +03:00
Ilya Goncharov
10c36ae5c5 Change naming from commin cli.ts to concrete platform nodejs.ts 2019-09-20 10:56:17 +03:00
Ilya Goncharov
c2b5df83f6 Add filtering feature to karma testing
- Now karma use generated adapter.js as input, in which right runner and
also all real input files are required

#KT-32216 fixed
2019-09-20 10:56:15 +03:00
Ilya Goncharov
09a602d8ad Move common logic of js test running on upper level (js) 2019-09-20 10:49:57 +03:00
Ilya Goncharov
e750bd302d Add karma input for kotlin-test-nodejs-runner
- To set custom adapter for kotlin-test, it is necessary to inject adapting
code to webpack's input, so then it is executed inside browser and set
custom adapter
This code will be injected to webpack's input
2019-09-20 10:49:56 +03:00
Ilya Goncharov
e242856124 Enable cli description to have free args title 2019-09-20 10:49:56 +03:00
Ilya Goncharov
80ea91f574 Extract Adapter getting to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov
b44249255c Extract default cli parser to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov
f0af4756a9 Fix accuracy for regex filtering for nodejs testing 2019-09-20 10:49:56 +03:00
Ilya Goncharov
e2aecee925 Fix exact test filtering for nodejs 2019-09-20 10:49:56 +03:00
Natalia Selezneva
a62863128c Fix exception from ProjectResolutionFacade when switching some definition off in settings
Fix AbstractScriptDefinitionsOrderTest
Remove updating script dependencies in test because in affects cache behavior: script will be already up to date when highlighting is called for the second time
2019-09-20 10:35:52 +03:00
Natalia Selezneva
3ad7f516be Add caret to test to check exception in ProjectResolutionFacade that can happen during resolving of symbol from script dependencies 2019-09-20 10:35:52 +03:00
Natalia Selezneva
5872a47c0e Scripts: rehighlighting should be called for opened scripts after changing script definitions
In case when script dependencies were absent for script, highlighting was called only when the script changed
2019-09-20 10:35:52 +03:00
Natalia Selezneva
3ac099fc9a Fix freeze during script definitions update (KT-32513)
loadScriptDefinitions is a long running operation, so it shouldn't be called under write lock.
This may cause a freeze when someone else wants to get definitions from the same loader during loading process

^KT-32513 Fixed
2019-09-20 10:35:44 +03:00
Ilya Matveev
1b64583855 Gradle, native: Embed bitcode for watchOS and tvOS 2019-09-20 12:52:48 +07:00
Abduqodiri Qurbonzoda
2819ab4ae9 Avoid division in string-to-unsigned conversions (KT-26309) 2019-09-20 01:08:33 +03:00
Abduqodiri Qurbonzoda
d66f07a84e CollectionsKt.windowed throws IllegalArgumentException 2019-09-20 00:50:54 +03:00
Alexander Udalov
a7b984bcbf JVM IR: fix generation of generic multi-file delegates 2019-09-19 22:23:16 +02:00
Alexander Udalov
acbe5c4e21 JVM IR: fix IOOBE from remapTypeParameters for synthetic property annotations method 2019-09-19 22:23:16 +02:00
Igor Yakovlev
c972bf5882 Add [JPS] IDEA (No ProcessCanceledException) configuration 2019-09-19 19:56:35 +03:00
Ilmir Usmanov
f1d31c8221 JVM_IR: Minor. Unmute tests
Rename FAKE_CONTINUATION -> fakeContinuation
2019-09-19 19:28:11 +03:00
Ilmir Usmanov
06d0e8a521 JVM_IR: Support suspend functions with extension receivers 2019-09-19 19:28:10 +03:00
Ilmir Usmanov
2bfd17d8fb JVM_IR: Minor. Unmute test. 2019-09-19 19:28:08 +03:00
Ilmir Usmanov
63f6d515bc JVM_IR: Generate correct invoke of numbered suspend lambda
Instead of continuation type as last parameter's type, generate Object
type.
2019-09-19 19:28:05 +03:00
Ilmir Usmanov
587fcafc85 JVM_IR: Support continuation crossing inline lambda boundaries
I.E. generate fake continuation markers.
2019-09-19 19:28:03 +03:00
Ivan Gavrilovic
0cdfe89a26 KT-33052: Fix KAPT stub generation for enums on JDK11
When using JDK11, generating stubs for enums is broken.
This commit handles the faulty generation by JDK11 by
fully printing enums in custom implementation of tree
printing.

Test: added JDK11 tests for KAPT stub  generation
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
58efa34a33 KT-31291: KAPT - make sure ASM version is not inlined
Switch to Java reflection when getting the ASM version used
to analyze classes. Using Kotlin reflection resulted in the constant
being inlined.

Fixes KT-31291
Fixes KT-33493
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
60fa632d02 KT-33515: Remove Kotlin sources generated by KAPT
When KAPT is unable to run incrementally make sure to
clean directory that contains generated Kotlin sources.
This location is specified using '-Akapt.kotlin.generated'
option.
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
434fb75eb7 Incremental KAPT: when unable to process incremental changes, run non-incrementally
When analyzing incremental changes in the KAPT task, incremental compilation
can handle directory changes, Java source file changes, jar/.class file changes,
and changes to the ABI structure of the classpath. Anything else should cause
a full recompilation.

Test: KaptIncrementalWithIsolatingApt.testNonIncrementalWithUnrecognizedInputs
2019-09-20 00:04:27 +09:00
Ilya Goncharov
b59fba6707 Fix mocha run
#KT-33579 fixed
2019-09-19 15:42:49 +03:00
Nicolay Mitropolsky
9d01c87c51 KotlinElementActionsFactory: cleanup JvmElementActionsFactory API (KT-33779) 2019-09-19 10:45:12 +03:00
Vladimir Dolzhenko
3bcbcbfd47 Fix read action in 'processLightClassLocalImplementations' (EA-210464) 2019-09-18 10:44:43 -07:00
Vladimir Dolzhenko
81c9edfff4 Get rid of implicit resolve within statsInfo for KotlinAddImportAction (EA-210670) 2019-09-18 10:43:38 -07:00
Vladimir Dolzhenko
3a1d649b30 Don't trigger refresh of vfs in 'getOutsiderFileOrigin' (EA-209420) 2019-09-18 10:23:34 -07:00
Mads Ager
507857d452 [IR] Support Collection<*>.indices in for loop lowering.
Unmute a couple of tests that are working as intended.
2019-09-18 19:00:17 +02:00
Steven Schäfer
76ab631214 psi2ir: Optimize generated data class members
- Access underlying fields directly, instead of using accessors. This is
  safe since data classes are always final.
- Don't generate a temporary variable in hashCode to use as the
  accumulator.

Both optimizations are effectively present in the current JVM backend
and with these changes the generated code is much closer to what the
current backend generates.
2019-09-18 18:56:42 +02:00
Steven Schäfer
7ccf314808 Minor: Remove dead conditional in psi2ir 2019-09-18 18:56:42 +02:00
Steven Schäfer
ce3ef4e4d0 Add more tests for inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
1833a69c87 JVM: Optimize inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
eda4953cb3 JVM IR: Optimize inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
d8646e29b7 Add additional Result api test 2019-09-18 18:52:58 +02:00
Steven Schäfer
49efa5fbc4 Split up Result API boxing tests 2019-09-18 18:52:58 +02:00
Steven Schäfer
2e53e36fd5 JVM: Do not use equals-impl0 methods generated by older compiler versions 2019-09-18 18:52:58 +02:00
Steven Schäfer
b85b2d9af8 Add more tests for inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
cdc5e1347b JVM: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
f53b28e8a3 JVM: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer
2c7da67600 JVM IR: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
b85a475358 JVM IR: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer
e4456127e4 JVM IR: Don't use JS IR specific inlineClasses.kt 2019-09-18 18:52:58 +02:00
Steven Schäfer
475079611d JVM IR: Avoid parameter null-checks in inline class impl methods 2019-09-18 18:52:58 +02:00
Steven Schäfer
cdd3f82396 JVM IR: Use correct scope owner in JvmInlineClassLowering 2019-09-18 18:52:58 +02:00
Vladimir Dolzhenko
2afbeaa353 Drop resolve on 'collectTransferableData' and reworked MoveDeclarations QuickFix (EA-210670) 2019-09-18 09:01:09 -07:00
Alexander Udalov
6ef434a711 JVM IR: add -Xir-check-local-names to check names for consistency
Since KotlinTypeMapper is no longer used in the JVM IR backend, we need
not run CodegenBinding.initTrace and check that names of local entities
are exactly equal to local names computed by that algorithm.

However, it's still useful as an opt-in flag, to discover issues where
unwanted elements take part in the naming (such as temporary IR
variables, see for example cb2e68fece). So we introduce a new command
line argument -Xir-check-local-names which, when the IR backend is used
(via -Xuse-ir), launches the name computation algorithm from the old
backend and then compares that the names are exactly equal to the names
computed by the IR backend in InventNamesForLocalClasses.
2019-09-18 17:55:42 +02:00
Alexander Udalov
530c1411c3 Remove IR backend-specific code from KotlinTypeMapper
Add an assertion to check that we don't call mapType anymore in JVM IR.
2019-09-18 17:55:41 +02:00
Vladimir Dolzhenko
3d79e77df3 Add async profiler to perfTests 2019-09-18 08:49:28 -07:00
Ilya Chernikov
0f4176a88e [Pill] Fix pill after refactoring reflect 2019-09-18 14:44:30 +02:00
Alexander Udalov
aa77f6c245 Improve KParameter.toString for instance and extension receiver parameter
#KT-17860 Fixed
2019-09-18 14:05:43 +02:00
Alexander Udalov
59186b2617 Psi2ir: ignore unresolved class literals in annotations
Similarly to 38536638, skip annotation arguments that reference classes
which are not found in our compilation classpath.

This fix is especially needed because of the way _nested_ classes are
currently referenced in annotations. Since we don't generate all needed
InnerClasses attributes yet (KT-27936), we can't unambiguously resolve a
reference to a nested class in annotation arguments. This leads to an
ErrorValue loaded in the annotation descriptor. The old backend doesn't
care, since it doesn't look at that annotation or its arguments, but
psi2ir tries to convert all annotation arguments and it crashed with CCE
here, trying to cast IrErrorType to IrSimpleType.
2019-09-18 14:05:28 +02:00
Alexander Udalov
c69997491f JVM IR: generate file annotations on file facade classes 2019-09-18 14:05:28 +02:00
Kevin Bierhoff
565099d941 fix new test name 2019-09-18 14:42:32 +03:00
Kevin Bierhoff
bc207ed8db fix for KT-29471
#KT-29471 Fixed
2019-09-18 14:42:09 +03:00
Nikolay Krasko
220a8f2872 Clear internal caches in PerModulePackageCacheService on dispose (KT-33802) 2019-09-18 11:30:02 +03:00
Nikolay Krasko
4387862d20 Remap android home directory to allow parallel test execution (KT-33870)
Using same directory for android (user home) leads to exception on Windows
because of file lock:

com.google.gson.JsonSyntaxException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at com.google.gson.Gson.fromJson(Gson.java:942)
at com.google.gson.Gson.fromJson(Gson.java:865)
at com.android.tools.analytics.AnalyticsSettings.loadSettingsData(AnalyticsSettings.kt:140)
at com.android.tools.analytics.AnalyticsSettings.initialize(AnalyticsSettings.kt:211)
at org.jetbrains.android.AndroidPlugin.initializeForNonStudio(AndroidPlugin.java:56)
at org.jetbrains.android.AndroidPlugin.initComponent(AndroidPlugin.java:30)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:503)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:411)
at com.intellij.idea.IdeaTestApplication.a(IdeaTestApplication.java:114)
at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:61)
at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:54)
at com.intellij.testFramework.LightPlatformTestCase.initApplication(LightPlatformTestCase.java:166)
at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:41)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$setUp$27(CodeInsightTestFixtureImpl.java:1142)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:63)
at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1141)
at com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.setUp(LightJavaCodeInsightFixtureTestCase.java:96)
at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase.setUp(KotlinLightCodeInsightFixtureTestCase.kt:66)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:388)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$3.run(EdtTestUtil.kt:67)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:433)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:61)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1295)
at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1333)
at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1576)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.Gson.fromJson(Gson.java:923)
... 41 more

#KT-33870 Fixed
2019-09-18 11:30:02 +03:00
Anton Yalyshev
dfde3b4076 Rename collector of debugger events 2019-09-18 10:06:45 +03:00
Anton Yalyshev
61eb9faecd Move status of evaluation from eventId to context for better data analytics 2019-09-18 10:06:45 +03:00
Denis Zharkov
2bdbed978b FIR: Support SAM constructors 2019-09-18 10:03:55 +07:00
Denis Zharkov
b3e96a1fcf FIR: Merge FirTopLevelDeclaredMemberScope into FirSelfImportingScope
It's strange that those scopes have similar semantics but belong
to different level (that might change semantics a bit)
2019-09-18 10:03:55 +07:00
Denis Zharkov
391346ae46 FIR: Pass BodyResolveComponents to ScopeTowerLevel 2019-09-18 10:03:28 +07:00
Denis Zharkov
fb4b6b8290 FIR: Move constructor processing from scopes to tower resolvers 2019-09-18 10:03:28 +07:00
Denis Zharkov
08a8a9fa61 FIR: Move SamResolver to BodyResolveComponents 2019-09-18 10:00:04 +07:00
Denis Zharkov
5ebde93eb9 FIR: Provide BodyResolveComponents instead of InferenceComponents to resolution
It seems to be more reasonable to store SamResolver, ScopeSession
and other per-transformer/per-thread components there
2019-09-18 10:00:04 +07:00
Denis Zharkov
5567620563 FIR: Support SAM conversion 2019-09-18 10:00:04 +07:00
Denis Zharkov
f501730d86 Minor. Reformat Arguments.kt in fir 2019-09-18 10:00:04 +07:00
Denis Zharkov
9d517d914b Minor. Get rid of redundant elvis operand in AbstractConeSubstitutor::substituteOrNull 2019-09-18 10:00:04 +07:00
Denis Zharkov
6e51bed30c FIR: Support lambda inference from platform types 2019-09-18 10:00:04 +07:00
Denis Zharkov
d787df3880 Minor. Reformat ConeKotlinType::isBuiltinFunctionalType 2019-09-18 10:00:04 +07:00
Mikhail Zarechenskiy
0431c21f9a [NI] Remove unneeded computation of possible types for return type
This call was needed at some point for smartcasts on qualified
 expressions but become obsolete (most likely after
 daa27016ca).

 Now `ComplexDataFlowBenchmark` has similar results for NI and OI
2019-09-18 00:19:21 +03:00
Mikhail Zarechenskiy
d47fc85868 [NI] Minor, small improvements around KotlinCall creation 2019-09-18 00:13:10 +03:00
Mikhail Zarechenskiy
971b02494c [NI] Minor, simplify code a bit for sub calls preparation 2019-09-18 00:13:10 +03:00
Mikhail Zarechenskiy
7e8784dca1 [NI] Simplify code that capture types from expression 2019-09-18 00:13:10 +03:00
Vyacheslav Gerasimov
6327f657a5 193: Add bunches for 193 platform 2019-09-17 21:16:13 +03:00
Vyacheslav Gerasimov
381f6d8226 193: Inline removed parents method in UastLightIdentifier 2019-09-17 21:16:13 +03:00
Vyacheslav Gerasimov
7fe25e922c 193: Fix nullability in KotlinImportOptimizer 2019-09-17 21:16:12 +03:00
Vyacheslav Gerasimov
c220ad4b00 Build: Add dsl constants for 193 platform 2019-09-17 21:16:12 +03:00
Svyatoslav Scherbina
df570ec2a2 Add CompilerOutputKind.DYNAMIC_CACHE and .STATIC_CACHE for Native BE 2019-09-17 20:28:01 +03:00
Ilmir Usmanov
0e3f0c98e5 JVM_IR: Support inline suspend lambdas 2019-09-17 19:19:27 +03:00
Dmitriy Novozhilov
61ae98df40 [FIR] Add default visitors and transformers with useful part of visited hierarchy 2019-09-17 18:09:18 +03:00
Dmitriy Novozhilov
e70c1d6959 [FIR] Remove default visited hierarchy 2019-09-17 18:09:18 +03:00
Nikolay Krasko
9b32bd7138 Do special insert even for custom trimIndent() function to avoid using resolve (KT-31810) 2019-09-17 17:16:30 +03:00
Toshiaki Kameyama
147f805c56 Paste inside indented .trimIndent() raw string: respect indentation (KT-31810)
#KT-31810 Fixed
2019-09-17 17:16:30 +03:00
Ilya Chernikov
d3b826c71d Improve class name generation for scripts and REPL snippets
- allow to override default name/scheme
- implement host/engine specific names for jsr223 to avoid classloading
  clashes (also fix "eval in eval" test)
2019-09-17 16:05:38 +02:00
Ilya Chernikov
6de05bb2c7 Drop hardcoded extraction of the snippet id from script name
rely on the userdate instead
2019-09-17 16:05:38 +02:00
Ilya Chernikov
dd953e0f66 Deduplicating classloaders and classpath entries on constructing script classloader 2019-09-17 16:05:37 +02:00
Simon Ogorodnik
df3fbaf417 Add various configuration parameters to Non Fir modularized tests 2019-09-17 16:10:37 +03:00
Simon Ogorodnik
f3a0632b9a [FIR] Fix dump html for each pass 2019-09-17 16:10:32 +03:00
Dmitry Petrov
0531bd4fe6 KT-29229 Intrinsify 'in' operator for unsigned integer ranges
Support mixed type case, e.g., '[UByte] in [UIntRange]'.
2019-09-17 15:50:47 +03:00
Ilya Chernikov
5426071102 Add dependency classloader to the evaluation classloader:
allows to use dependencies from classloader in the scenario with
evaluation in the isolated environment
2019-09-17 12:43:18 +02:00
Ilya Chernikov
61d517fb31 Implement script dependencies resolution directly from classloader
#KT-27956 fixed
2019-09-17 12:43:18 +02:00
Ilya Chernikov
f8db150a2b [minor] Drop some usages of kotlin reflection in scripting compiler plugin 2019-09-17 12:43:16 +02:00
Ilya Chernikov
689a5cbdf5 Add descriptors.runtime to the compiler...
move it into appropriate package and ensure that it gets relocated
properly in kotlin-reflect.jar
This change is needed to use the functionality that provides descriptors
from classloaders for scripts compilation.
2019-09-17 12:43:15 +02:00
Ilya Kirillov
8dce22c335 New J2K: use proper resolution facade when getting class reference in inference post-processing 2019-09-17 11:56:07 +03:00
Ilya Kirillov
cfd476ca7e New J2K: correctly convert main method with varargs argument
#KT-33756 fixed
2019-09-17 11:56:06 +03:00
Ilya Kirillov
5d6cf34045 New J2K: consider that type argument may be null in inference post-processing 2019-09-17 11:56:06 +03:00
Ilya Kirillov
934d491c1c New J2K: use Any? instead of star projection for raw supertypes
#KT-33863 fixed
2019-09-17 11:56:06 +03:00
Ilya Kirillov
c6e0356a59 Do not search for getter usages for every "may be const" quickfix invocation
It is a rather expensive operation which is critical for j2k

relates to #KT-33854
2019-09-17 11:56:05 +03:00
Ilya Kirillov
1b3c5f5d37 New J2K: use proper progress indicator for showing progress
#KT-33854 fixed
2019-09-17 11:56:05 +03:00
Ilya Kirillov
2916be6a53 Remove duplicating interface in J2K
#KT-33445 fixed
2019-09-17 11:56:05 +03:00
Ilya Kirillov
1cf348baba Do not commit document on non-kotlin files when trying to perform j2k conversion
#KT-33725 fixed
2019-09-17 11:56:04 +03:00
Mikhail Glukhikh
13b16cfe75 Refactoring: get rid of firSafeNullable, enhance getSymbolByLookupTag 2019-09-17 10:10:07 +03:00
Mikhail Glukhikh
0493432723 Remove some usages of FirBasedSymbol 2019-09-17 10:10:06 +03:00
Matthew Gharrity
a1f4a4572a Check cancelation in KotlinJavaPsiFacade.findPackage()
This may help with some UI freezes caused by KT-33394, although
it does not fix the underlying performance problem.
2019-09-16 10:58:58 -07:00
Pavel Kirpichenkov
0a1b3a8455 Clearify diagnostic messages that involve internal visibilities
KT-7354 Fixed

Visibility.displayText is deprecated with warning.
Diagnostics for java visibilities changed.
2019-09-16 19:00:43 +03:00
Nikolay Krasko
fc4865a440 Don't extend to comments when a comment is being moved (KT-23461) 2019-09-16 16:57:48 +03:00
Nikolay Krasko
11de99f9d7 Minor refactoring for KotlinExpressionMover (KT-23461)
Extract function, some better naming.
2019-09-16 16:57:48 +03:00
Toshiaki Kameyama
ed28a06285 Move statement: move expression over comments (KT-23461)
#KT-23461 Fixed
2019-09-16 16:57:48 +03:00
Mikhail Glukhikh
20c45a8382 FIR general refactoring: get rid of ConeSymbols 2019-09-16 16:55:42 +03:00
Ilmir Usmanov
c1c46daa01 Use en_US.UTF-8 locale instead of default locale to work around errors
in tr_TR.UTF-8 locale in coroutines-specific code.

 #KT-33821: Fixed
2019-09-16 16:50:05 +03:00
Ilmir Usmanov
1951ff8054 JVM_IR: Minor. Unmute tests 2019-09-16 16:49:24 +03:00
Ilmir Usmanov
a3284326af JVM_IR: Do not box/unbox result in continuations
Otherwise, it leads to CCE from kotlin/Result.
2019-09-16 16:49:22 +03:00
Ilmir Usmanov
402a77126f JVM_IR: Support inline suspend functions
Only no state-machine version for now.
2019-09-16 16:49:21 +03:00
Ilmir Usmanov
2ec3417e0e JVM_IR: Move suspend functions into view transformation to codegen phase
Support suspend functions with default arguments.
2019-09-16 16:49:18 +03:00
Toshiaki Kameyama
6b36833ee2 Highlight usages: highlight declaration/usage on call of function with lambda argument (KT-30824)
#KT-30824 Fixed
2019-09-16 16:26:02 +03:00
Nikolay Krasko
26bef2d109 Fix muted usage highlighter test by ignoring irrelevant highlighting
UsageHighlightingTestGenerated.testImplicitReturnExpressionsInLambdasNoHightlighting
2019-09-16 16:26:02 +03:00
Toshiaki Kameyama
7b8abc5457 Move statement: enable expression ended with semicolon (KT-8581)
#KT-8581 Fixed
2019-09-16 16:26:02 +03:00
Alexander Udalov
5259af157a JVM IR: workaround correspondingPropertySymbol absence after deep copy 2019-09-16 14:57:21 +02:00
Alexander Udalov
b782cf6bdb JVM IR: workaround KotlinTypeMapper usages in boxing optimization on inline classes 2019-09-16 14:57:21 +02:00
Alexander Udalov
c425bd0e0b JVM IR: do not use KotlinTypeMapper in BuilderFactoryForDuplicateSignatureDiagnostics 2019-09-16 14:57:21 +02:00
Alexander Udalov
3a0c41dca4 JVM IR: do not use KotlinTypeMapper indirectly in CallableReferenceLowering 2019-09-16 14:57:21 +02:00
Alexander Udalov
26874a6e1e JVM IR: do not use KotlinTypeMapper in MethodSignatureMapper 2019-09-16 14:57:20 +02:00
Alexander Udalov
ee976020bc JVM IR: add KotlinTypeMapperBase, do not use KotlinTypeMapper in metadata serialization 2019-09-16 14:57:20 +02:00
Alexander Udalov
bd8ea9412d JVM IR: implement MethodSignatureMapper.mapFunctionName directly 2019-09-16 14:57:20 +02:00
Alexander Udalov
36c242764f JVM IR: implement MethodSignatureMapper.mapSignature directly
As well as mapFieldSignature, mapReturnType, mapAsmMethod and smaller
methods. This removes yet another dependency on KotlinTypeMapper in the
IR backend.
2019-09-16 14:44:16 +02:00
Alexander Udalov
46ced326b8 JVM IR: minimize usages of some methods in MethodSignatureMapper
Also do not pass useless parameters such as OwnerKind which is always
IMPLEMENTATION in the IR backend
2019-09-16 14:44:16 +02:00
Alexander Udalov
4dc1d61c38 JVM IR: do not remove overridden symbols in BridgeLowering
This information might be needed in subsequent lowerings or codegen. For
example, it'll be needed in MethodSignatureMapper to determine that we
need to box primitive return type if one of overridden functions has a
non-primitive return type.

For invoke in lambda classes specifically though, we need to remove this
override from the specialized invoke because otherwise we'd call a boxed
version in the bridge (see 73d2ae961c). In this change, we still keep
the override on a bridge though just for the sake of IR consistency.
2019-09-16 14:44:16 +02:00
Alexander Udalov
45929f57b6 Minor, add test on name mangling of private multi-file part members 2019-09-16 14:44:16 +02:00
Vyacheslav Gerasimov
cb482571cb Build: Fix javadocJar task configuration
Add artifact outside of lazy configuration lambda, otherwise it is never
added
2019-09-16 15:26:56 +03:00
Leonid Startsev
cec37cf78a Add supertype type arguments to super() call in deserialization ctor
#KT-31619 fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/525
2019-09-16 15:03:17 +03:00
Leonid Startsev
0b669e72b0 Do not report error about 'initializer required for @Transient properties' on lateinit vars
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/553
2019-09-16 15:03:17 +03:00
Leonid Startsev
4e516d7c94 Fix IR validation warnings in serialization plugin
- Insert patchDeclarationParents after whole processing
- Copy IR nodes to avoid duplications
- Insert correct type for getter during serialization of properties from parent class
- Do not use irThrowIse because it is broken somewhere in Native backend
2019-09-16 15:03:17 +03:00
Ilya Matveev
d3f1cf1cdd Gradle, native: Don't ignore exit codes of K/N tests
Issue #KT-32872 fixed
2019-09-16 18:28:03 +07:00
Alexander Udalov
9d257a1ed8 JVM IR: generate call to checkNotNull in IrCheckNotNull since 1.4
#KT-22275
2019-09-16 12:33:01 +02:00
Ilya Goncharov
acc86be043 Extend karma-teamcity-reporter to log browser's output
#KT-32073 fixed
#KT-32281 fixed
2019-09-16 12:33:45 +03:00
Ilya Goncharov
8fbdb15626 Show suppressed output in case of karma launch failed 2019-09-16 12:31:59 +03:00
Ilya Goncharov
425582bb4b Use only custom karma reporter
- Ideally these changes should be on karma-teamcity-reporter
2019-09-16 12:31:59 +03:00
Ilya Goncharov
ddbae98841 Remove redundant marker of browser log starting 2019-09-16 12:31:58 +03:00
Ilya Goncharov
355f847ee0 Add parse of karma log to find browser's messages
- Log browser's message respects their log level
2019-09-16 12:31:58 +03:00
Ilya Goncharov
8c46fab6d8 Add own reporter that reports only browser log in specific format 2019-09-16 12:31:57 +03:00
Ilya Goncharov
9bb5022eb4 Move nested classes 2019-09-16 12:31:57 +03:00
Ilya Goncharov
6277267563 Make KarmaConfig as data class 2019-09-16 12:31:57 +03:00
Ilya Goncharov
8f7c5c13f8 Parse karma problem to fail task
#KT-31663 fixed
2019-09-16 12:31:55 +03:00
Ilya Goncharov
3d67b952f8 Parse browser output to log 2019-09-16 12:25:55 +03:00
Dmitriy Novozhilov
c8d087d744 [FIR] Tests. Save failed tests into testdata 2019-09-16 10:58:51 +03:00
LepilkinaElena
7cae9214d7 Disable endorsed libraries in plugin (#2536) 2019-09-16 09:43:22 +03:00
Ilya Matveev
3120eff6f5 Update K/N: 1.3.60-dev-12266 2019-09-16 12:45:06 +07:00
Ilya Matveev
45a413c892 Gradle, native: Minor fixes
Fix ReplaceWith for compilation.extraOpts
Simplify languageSettings access in compile tasks
Use checkedReplace in binary integration tests
2019-09-16 12:45:06 +07:00
Ilya Matveev
60ae03f08b Gradle, native: Don't use deprecated DefaultTask.newOutputFile()
This method is planned to be removed in Gradle 6.0, so we avoid
using it.
2019-09-16 12:45:05 +07:00
Ilya Matveev
dda25875d4 Gradle, native: Use language settings when link from sources
Take language settings into account when a final binary is
being built from sources.
2019-09-16 12:45:05 +07:00
Ilya Matveev
57635f7ba3 Update Kotlin/Native: 1.3.60-dev-12104 2019-09-16 12:45:05 +07:00
Ilya Matveev
7122a9d819 Gradle, native: Propagate compilation free args to link tasks
The free args DSL may be changed in 1.3.70 for all platforms. So it
was decided to preserve the old behaviour here to avoid making
similar changes in two releases in a row.
2019-09-16 12:45:04 +07:00
Ilya Matveev
20332ae231 Gradle, native: Pass --progressive to both compile and link tasks 2019-09-16 12:45:04 +07:00
Ilya Matveev
90358dee55 Gradle, native: Allow user to force old behaviour of link tasks
We leave an ability to build final native binaries directly from
sources instead of building them from a klib. Thus we allow
a user to workaround possible bugs related to building a final
binary from a klib (-Xinclude compiler flag).
2019-09-16 12:45:04 +07:00
Ilya Matveev
f07e0594e2 Gradle, native: Report passing binary-specific args to compilation
Earlier we propagated all free args specified for a compilation into
a link task. It was required because the link task actually compiled
the same source as the compile task but with another output kind.

But currently a link task produces a final binary from a klib instead
of sources. It means that such a propagation becomes incorrect. Now
options related to the compiler frontend like -Xexperimental must
be specified per compilation while options related to the compiler
backend (e.g. -opt, -g, -Xstatic-framework etc) - per binary.

This path shows a special warning if some of "binary-specific"
arguments are passed to a compilation.
2019-09-16 12:45:03 +07:00
Ilya Matveev
8d495c4b45 Gradle, native: Produce binaries from klibs and bump K/N version
Earlier all native binaries were produced directly from sources of
corresponding compilations. This patch changes this behavior. Now
a klibrary produced by a compilation is used to build a final
binary instead of sources. This allows us to avoid parsing the same
sources several times and reduces build time.

This patch also updates K/N version to 1.3.60-dev-11975, to get the
corresponding support from the compiler side.

Issue #KT-33076 Fixed
2019-09-16 12:45:03 +07:00
Ilya Matveev
3a935402a4 Gradle: Deprecate native extraOpts method in favor of common API 2019-09-16 12:45:02 +07:00
Abduqodiri Qurbonzoda
f01420332f Avoid division in string-to-number conversions (KT-26309) 2019-09-15 21:08:23 +03:00
Abduqodiri Qurbonzoda
11f3c4b03f Clarify the error message when File.copyTo fails (KT-27545) 2019-09-13 21:29:13 +03:00
Igor Yakovlev
27accbb089 Fix KotlinLintTestGenerated.testParcel + extensions registrations fixes 2019-09-13 19:40:31 +03:00
Vladimir Dolzhenko
c3265a8bf0 Decrease Light classes code generation in multithreaded cases by guarding KotlinClassInnerStuffCache, LightClassDataHolder.ForClass cache values calculation with lock 2019-09-13 15:10:09 +02:00
Vladimir Dolzhenko
d3d85d50ab Rewrite KotlinClassInnerStuffCache into Kt, p2 2019-09-13 15:09:02 +02:00
Vladimir Dolzhenko
6146b0eb53 Rewrite KotlinClassInnerStuffCache into Kt, p1 2019-09-13 15:08:40 +02:00
Roman Golyshev
b422485440 KT-30996: Use the last receiver to complete dsl methods
- change `detectReceiverTypes` return type to `List` instead of `Collection`
  - it reflects that receiver types are actually ordered
  - did not propagate signature changes to all possible places because it creates too much noise in git history
- ^KT-30996 Fixed
2019-09-13 15:52:52 +03:00
Ilya Chernikov
b2d2ba5811 Refactor test utils: don't add main-kts to the classpath...
by default on running scripting tests via the call to K2JVMCompiler
2019-09-13 13:19:26 +02:00
Ilya Chernikov
49003c9839 Do not embed script-runtime into main-kts:
it is unused in it and may interfere with mixed usages when
main-kts is used along with legacy/default scripts
2019-09-13 13:19:26 +02:00
Ilya Chernikov
a12ea37ae8 [minor] Fix non-fatal exception during the embeddable test 2019-09-13 13:19:26 +02:00
Ilya Chernikov
45f5c42a53 Add appropriate script extension to the source name, if not provided
#KT-31704 fixed
2019-09-13 13:19:26 +02:00
Ilya Chernikov
92778cc5b5 Set contextClassLoader for the script evaluation
#KT-31661
2019-09-13 13:19:26 +02:00
Ilya Chernikov
939d76fd2a Isolate script execution from compiler classloader
Since fix of KT-33554, the script execution classpath is set correctly
according to the compilation classpath, so isolation makes sense now.
2019-09-13 13:19:26 +02:00
Ilya Chernikov
771f5c13dd Fix imported script functionality in JSR-223/REPL:
- setup compilation properly to take imported scripts into account
- add compiled imported scripts into generated results
= calculate ScriptLightVirtualFile path as relative - simplifies imported scripts location
2019-09-13 13:19:26 +02:00
Ilya Chernikov
0fe137d75c Fix script arguments order for imports with implicit receivers
#KT-33572 fixed
2019-09-13 13:19:25 +02:00
Ilya Chernikov
8989bfa235 Fix main-kts jsr223 direct bindings processing
Before the jsr context was configured only when a dependency or import
annotation is encountered, so direct properties mapping didn't work
without using any of the annotations. (It was implemented like this
as a workaround due to the problem with handlers composability, that was
fixed some time ago.)
2019-09-13 13:19:25 +02:00
Ilya Chernikov
c5f9e0a399 Fix host configuration replacements 2019-09-13 13:19:25 +02:00
Ilya Chernikov
f350c24846 Implement more general "apply defaults" functionality for host configurations 2019-09-13 13:19:25 +02:00
Ilya Goncharov
e3187217ee Fix executable files for nodejs
- For windows NPM doesn't create symlinks, but cretae CMD files, so it is necessary to provide path to JS file explicitly

#KT-33710 fixed
2019-09-13 12:44:56 +03:00
Ilya Goncharov
2fe5feac94 Remove source map support runtime for webpack
- Browsers support source maps OOB
- source-map-support is necessary to install to make a sense, but now we only include it in bundle w/o installing
- Additional webpack's options like output.library doesn't works with multiple entries if last item is not bundled library

#KT-33288 fixed
2019-09-13 12:40:35 +03:00
Dmitriy Novozhilov
8614323f80 [FIR] Tests. Update some outdated testdata 2019-09-13 12:21:59 +03:00
Dmitriy Novozhilov
b76b4b0229 [FIR] Pass flow to local functions 2019-09-13 12:21:59 +03:00
Dmitriy Novozhilov
e1947e6884 [FIR] Don't create synthetic calls for when with only one branch 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
43a873a2ec [FIR] Make SimpleFlow (old implementation) implement abstract Flow 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
60343c721c [FIR] Make Flow and LogicSystem abstract
It's needed for simple changing of different Flow implementations
2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
c19da5846c [FIR] Fix processing inPlace lambdas as named arguments 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
3ff185d36c [FIR] Dummy fix of lambda functions inside init block
Init still works not well, but now they at least don't fail
2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
0e0e6da917 [FIR] Fix passing flow throw loops 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
f77a414e93 [FIR] Fix passing flow throw try expression 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
be58e95b2b [FIR] Replace Flow with DelegatingFlow 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
44571fbd8f [FIR] Minor. Extract methods used DataFlowInfo from DataFlowInferenceContext 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
65edf73bee [FIR] Add node for enter to body of when branch 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
531c2b9617 [FIR] Add supprot of InvocationKind.UNKNOWN for in-place lambdas 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
2f6f07bc7d [FIR] Remove callbacks from stacks in DFA 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
beaab19eb9 [FIR] Replace ControlFlowGraphNodeBuilder with extensions on ControlFlowGraphBuilder 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
15ff86fc50 [FIR] Refactor DataFlowVariables
Make inheritors of DataFlowVariable public, replace flags in DFV with types
2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
f9d45d2f2a [FIR] Some minor fixes in DFA after review 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
6b7aa21b8f [FIR] Minor. Remove useless creating data flow variables for value parameters 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
cb1322eaef [FIR] Add smartcasts on implicit receivers 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
f8459f8201 [FIR] Fix result type of const expressions with expected type 2019-09-13 10:42:17 +03:00
Dmitriy Novozhilov
546bbceeea [FIR] Reduce coping of flow and inline default value of it 2019-09-13 10:42:17 +03:00
Dmitriy Novozhilov
c2180b9361 [FIR] Move reporting of errors in modularized tests in separate log file 2019-09-13 10:42:17 +03:00
Igor Yakovlev
5dc29b9059 Fix build 183 - add missing functions 2019-09-12 18:42:56 +03:00
Simon Ogorodnik
375920da58 [FIR] Add gradle property for extending jvmArgs of modularized test 2019-09-12 18:06:47 +03:00
Igor Yakovlev
841ed45440 Fix build 183 - missing imports added 2019-09-12 17:53:31 +03:00
Dmitry Petrov
cb13dd3cdd Add psi2ir tests for 'break' and 'continue' inside 'when' 2019-09-12 15:11:01 +03:00
Dmitry Petrov
f3837e91e3 Add BE tests for 'break' and 'continue' inside 'when' 2019-09-12 15:11:01 +03:00
Dmitry Petrov
f06f6f4660 Allow 'break' and 'continue' inside 'when' in 1.4+ 2019-09-12 15:11:00 +03:00
Pavel Kirpichenkov
55cb9561c2 Provide better error messages for read-only delegate
Split error reporting into two parts for incorrect and missing candidates.
Missing function error is not reported on provideDelegate.
Update error factory and default message for error.
Update error texts in quick fix test data.

#KT-16526 Fixed
2019-09-12 14:58:21 +03:00
Dmitriy Novozhilov
68bcdaa6c3 Don't ask for member scope for ILT in IterableTypesDetection
EA-206183 fixed
2019-09-12 12:27:12 +03:00
Mikhail Zarechenskiy
7472c789c6 Add tests for obsolete issues
#KT-28001 Obsolete
 #KT-30236 Obsolete
2019-09-12 12:03:01 +03:00
Natalia Selezneva
89140be71d Minor: better error message 2019-09-12 09:56:42 +03:00
Natalia Selezneva
6d53636cc9 Minor: extract classes 2019-09-12 09:56:42 +03:00
Natalia Selezneva
8f2aaf62c2 Implement modification stamp for ScriptInitializer
This should influence ResolveElementCache to correctly update caches
because it rely on modifications stamps of the declaration
Before this change file.modificationStamp was used for script initializers in file, so they all became outdated after some change in file
2019-09-12 09:56:42 +03:00
Alexander Udalov
d6cb857c97 JVM IR: don't use descriptors to map suspend function types 2019-09-11 23:33:11 +02:00
Alexander Udalov
34d2d7374c Do not use KotlinTypeMapper in enum values/valueOf intrinsic
Remove KotlinTypeMapper from inlineIntrinsics.kt completely
2019-09-11 23:33:11 +02:00
Alexander Udalov
8cdec31990 Do not use KotlinTypeMapper in coroutine inline intrinsics 2019-09-11 23:33:11 +02:00
Alexander Udalov
d16bdded7f JVM IR: reuse JVM code for reified type parameter mappings instead of copy-paste 2019-09-11 23:33:11 +02:00
Alexander Udalov
d1df453edc Do not use KotlinTypeMapper in generateTypeOf inline intrinsic
Make ReifiedTypeInliner and related classes generic over the
KotlinTypeMarker subtype (KotlinType or IrType), add a typeSystem to get
arguments/nullability and other properties of types regardless of their
representation, but still fall back to KotlinType when generating the
actual bytecode of other intrinsics (as/is)
2019-09-11 23:33:11 +02:00
Alexander Udalov
ece09866f0 Simplify reified operations on type parameters in ExpressionCodegen
Move the "without propagation" logic to ReifiedTypeInliner since it's
only used from inline intrinsics.
2019-09-11 23:33:10 +02:00
Alexander Udalov
8efbcc5350 Do not use KotlinTypeMapper when generating JVM assert inline intrinsics 2019-09-11 23:33:10 +02:00
Andrey Uskov
15bfb7498c Minor. Fix target platforms formatting in FacetSettings
#KT-33813 Fixed
2019-09-11 22:57:11 +03:00
Nikolay Krasko
a5b21308fd Minor refactoring for TypeHints properties (KT-22433) 2019-09-11 17:42:05 +03:00
Toshiaki Kameyama
36de8f1aa9 Type hints: don't show for incomplete expressions followed by Unit type expressions (KT-22433)
#KT-22433 Fixed
2019-09-11 17:42:04 +03:00
Toshiaki Kameyama
6e852837f7 Folding: fold "when" expression (KT-6314)
#KT-6314 Fixed
2019-09-11 17:42:04 +03:00
Igor Yakovlev
cfcecaaeab LightClassApplicabilityCheckExtensions refactoring and IdeSerializationPluginApplicabilityExtension fix 2019-09-11 17:05:13 +03:00
Igor Yakovlev
2b7dee6f8d Add CodegenApplicabilityCheckerExtension and use it to fallback to Heavy LigthClasses
+ Fixed #KT-33584
2019-09-11 15:29:12 +03:00
Nikolay Krasko
f3b7d2fca9 Fix exception of getting parent for the root package (EA-210820) 2019-09-11 12:51:55 +03:00
Nikolay Krasko
d3f03cc607 Remove deprecated usage of BulkFileListener.Adapter 2019-09-11 12:40:26 +03:00
Nikolay Krasko
7f8774f68e Fix NPE in KotlinIndicesHelper (EA-209799) 2019-09-11 12:40:26 +03:00
Nikolay Krasko
90511c734d Fix NPE in JavaToKotlinAction (EA-210821) 2019-09-11 12:40:26 +03:00
Alexander Udalov
77399a175e Cleanup compiler warnings in compiler tests 2019-09-11 10:47:34 +02:00
Mads Ager
90a37617a4 [JVM_IR, IR] Remove more needless temporary variables.
Avoid using a separate origin for temporary variables introduced
for for loops. That doesn't add anything and gives one more case
for optimizations to deal with.

Extend the JVM specific optimizations to remove temporary
variables to deal with more cases encountered in for loops
lowering.
2019-09-11 10:07:45 +02:00
Roman Artemev
e5a1040dbd [KLIB] Fix references to private top-level typealias via type abbreviation 2019-09-10 19:59:01 +03:00
Dmitriy Novozhilov
40ebe4063c [FIR] Refactor collecting statistics in modularized tests
Also add printing statistics of best pass at the end of build log
2019-09-10 18:34:03 +03:00
Dmitriy Novozhilov
6a75a9072c [FIR] Remove redundant resolution stage from resolution of synthetic function calls 2019-09-10 18:34:02 +03:00
Dmitriy Novozhilov
ef5ac7df93 [FIR] Don't create member function for each when and try expression
Use one function (per session) instead
2019-09-10 18:34:02 +03:00
Yan Zhulanow
996d9a5d90 Pill: Enable Pill for FIR visualizer modules 2019-09-10 21:38:38 +09:00
Vladimir Dolzhenko
d1285d9dbf Fix performanceTests for 192; Add perfCounters 2019-09-10 14:02:56 +02:00
Igor Yakovlev
8fa67f0478 Add correct modification tracking on UltraLight classes
Fixed #KT-32820
2019-09-10 14:38:10 +03:00
Ilya Kirillov
b2002d56bd New J2K: move type calculation to expression node 2019-09-10 14:09:31 +03:00
Ilya Kirillov
be94eb5405 New J2K: remove extra interfaces in AST structure & split AST definitions to proper files 2019-09-10 14:09:30 +03:00
Ilya Kirillov
fd85c2bb43 New J2K: use mutable lists for storing comments 2019-09-10 14:09:30 +03:00
Ilya Kirillov
5d99419e9c New J2K: check call name before resolving in post-processing 2019-09-10 14:09:29 +03:00
Ilya Kirillov
dca0dc1933 New J2K: do not recalculate types for binary & unary expressions and rewrite assignment expressions conversion
#KT-33679 fixed
2019-09-10 14:09:29 +03:00
Ilya Kirillov
c93d810685 New J2K: introduce TypeFactory for creating J2K types 2019-09-10 14:09:28 +03:00
Ilya Kirillov
047bb07727 New J2K: store reference to conversionContext & symbolProvider in conversion 2019-09-10 14:09:27 +03:00
Ilya Kirillov
eb690f451e New J2K: do not recreate typeElement on updating type 2019-09-10 14:09:26 +03:00
Ilya Kirillov
f61bb5aa39 New J2K: implement mutability inference in post-processing
#KT-24293 fixed
#KT-19603 fixed
2019-09-10 14:09:26 +03:00
Ilya Kirillov
c28515be59 New J2K: use nullable type for unknown for public declarations & prepare for mutability inference
#KT-32518 fixed
2019-09-10 14:09:25 +03:00
Simon Ogorodnik
0040490daf [FIR] Fix FIR modularized tests after switch to 192 2019-09-10 12:33:00 +03:00
Ilya Goncharov
fc4bcfb536 Add test on yarn downloading non-default version
- Previously we skipped yarn setup, if yarn folder exists, not paying attention on what concrete yarn version installed
2019-09-10 10:44:30 +03:00
Ilya Goncharov
8a6ee66f81 Yarn manipulation in build script
- Remove yarn folder in task inside build script to not import GradleUserHomeLookup
- Check yarn folder existence in task inside build script
2019-09-10 10:44:30 +03:00
Ilya Goncharov
48c06aeeba Add test for yarn setup by kotlinYarnSetup task 2019-09-10 10:44:30 +03:00
Ilya Goncharov
f609e21c82 Remove asserts, that failed build
- TeamCity cannot run browser tests yet, so disable such assertions related with browser tests checking

#KT-32075 fixed
2019-09-10 10:39:11 +03:00
Ilya Goncharov
49391e64d6 Add testing for karma use puppeteer for downloading chrome 2019-09-10 10:35:31 +03:00
Ilya Goncharov
18f2ba889e Make envJsCollector as map 2019-09-10 10:35:30 +03:00
Ilya Goncharov
3bfb980a39 Collect env variables to separate collector 2019-09-10 10:35:30 +03:00
Ilya Goncharov
613391d00b Add puppeteer for Chrome browsers 2019-09-10 10:35:30 +03:00
Ilya Goncharov
df646233ef Fix KarmaConfig file name 2019-09-10 10:35:30 +03:00
Vasily Levchenko
89d49479ab [util-io][properties] close file stream after save property operation ends.
(cherry picked from commit f0ae971f9304ecd7a2ba134ab77b511a0569ed5f)
2019-09-09 21:14:19 +03:00
Sebastian Schuberth
cc40387788 YarnSetupTask: Remove a too coarse "onlyIf" in the "init" block
"installationDir" is the non-version specific top-level Yarn
installation directory simply called "yarn". Checking for its existence
is not sufficient to be able to skip the task, as another version than
the requested one could be installed below the "yarn" directory.

Instead of taking the version into account in this check, simply remove
it as the version-specific installation directory at "env.home" is
already marked as an "OutputDirectory", so Gradle itself already takes
care of skipping task execution if the output files were created before.
2019-09-09 17:03:17 +03:00
Mikhail Zarechenskiy
85ff979bd4 Use PARTIAL mode in analyzer to provide lambda return value hints
It only uses `isUsedAsResultOfLambda` (so, CFA) and don't have to
 resolve bodies fully
2019-09-09 15:22:41 +03:00
Nikolay Krasko
d253cd5032 Ignore external annotations in AbstractResolveByStubTest (KT-33732)
In IDE with have descriptors with additional annotations obtained from
external annotations manager. They are probably only java overrides so
shouldn't be present in stubs, thus must be ignored in this test.

Tests with enums started to fail after upgrading to 192 platform because
of additional NotNull annotation on `getDeclaringClass()` method.

 #KT-33732 Fixed
2019-09-09 14:35:58 +03:00
Nikolay Krasko
80b5c76d98 Minor: fix warnings in AbstractResolveByStubTest 2019-09-09 14:35:58 +03:00
Kristoffer Andersen
e7d0909979 JVM_IR: Fix null-constant comparison with primitive types. 2019-09-09 10:23:11 +02:00
Mikhail Zarechenskiy
e21da3a61a Avoid resolving array-set method several times
While origin problem was in NI, it's also nice to have this change in OI
 in order to slightly improve performance

 #KT-33125 Fixed
2019-09-09 11:04:18 +03:00
Mikhail Zarechenskiy
f8449bf15a [NI] Clear partially resolved calls after resolve of top-level call
#KT-32433 Fixed
2019-09-09 11:04:17 +03:00
Mikhail Zarechenskiy
f305475e3f Make "nothing to inline" diagnostic shorter
#KT-33421 Fixed
2019-09-09 11:04:17 +03:00
Mikhail Zarechenskiy
dc25f7b7ac [NI] Minor, remove unneeded computation of constant evaluator 2019-09-09 11:04:16 +03:00
Denis Zharkov
3569eaabcf Rename FirJavaElementFinder.kt.as34 to FirJavaElementFinder.kt.183 2019-09-09 10:14:19 +03:00
Steven Schäfer
62a1ea643a Add additional tests for bound receivers in callable references 2019-09-06 15:11:59 +02:00
Steven Schäfer
d89d68e3df JVM IR: Cache SAM wrappers in top-level classes and use proper naming scheme 2019-09-06 15:11:59 +02:00
Steven Schäfer
2be4abe9a6 Refactoring: Consistently use Symbols in JvmSymbols 2019-09-06 15:11:59 +02:00
Steven Schäfer
c77fa1ecd6 JVM IR: Fixes in SAM lowering 2019-09-06 15:11:59 +02:00
Denis Zharkov
829102b3e3 FIR: Fix exception in inference
Default SimpleTypeMarker::withNullability from ConeTypeContext
doesn't take into account inference-related type kinds like type variables

These cases are properly handled in
org.jetbrains.kotlin.fir.resolve.ResolveUtilsKt#withNullability

Original exception trace:
	at org.jetbrains.kotlin.fir.types.ConeTypeContext$DefaultImpls.withNullability(ConeTypeContext.kt:142)
	at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.withNullability(ConeInferenceContext.kt)
	at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.withNullability(FirBodyResolveTransformer.kt:943)
	at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.makeSimpleTypeDefinitelyNotNullOrNotNull(ConeInferenceContext.kt:195)
	at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.makeSimpleTypeDefinitelyNotNullOrNotNull(FirBodyResolveTransformer.kt:943)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.makeSimpleTypeDefinitelyNotNullOrNotNull(NewConstraintSystemImpl.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.makeSimpleTypeDefinitelyNotNullOrNotNull(ConstraintInjector.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.simplifyLowerConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:163)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.internalAddSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:71)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.addSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:50)
	at org.jetbrains.kotlin.types.AbstractTypeChecker.completeIsSubTypeOf(AbstractTypeChecker.kt:193)
	at org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf(AbstractTypeChecker.kt:164)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.runIsSubtypeOf(ConstraintInjector.kt:153)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addSubTypeConstraintAndIncorporateIt(ConstraintInjector.kt:77)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addInitialSubtypeConstraint(ConstraintInjector.kt:55)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.addSubtypeConstraint(NewConstraintSystemImpl.kt:84)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt:61)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.runTransaction(NewConstraintSystemImpl.kt:130)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt.addSubtypeConstraintIfCompatible(ConstraintSystemBuilder.kt:60)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.checkApplicabilityForArgumentType(Arguments.kt:170)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolvePlainArgumentType(Arguments.kt:158)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveSubCallArgument(Arguments.kt:123)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgumentExpression(Arguments.kt:42)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgument(Arguments.kt:196)
	at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments.check(ResolverParts.kt:145)
	at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments$check$1.invokeSuspend(ResolverParts.kt)
2019-09-06 13:45:28 +03:00
Denis Zharkov
8c52ff31b3 Add bunch for AS34: FirJavaElementFinder 2019-09-06 13:45:28 +03:00
Denis Zharkov
3f0887dc0c FIR: Do not try building light classes for invalid names 2019-09-06 13:45:28 +03:00
Denis Zharkov
106b6c901d FIR: Get rid of FirRegularClass::setCallbackOnSupertypesComputed 2019-09-06 13:45:28 +03:00
Denis Zharkov
122c229a8b FIR: Add possibility to run SupertypeResolverTransformer ad-hoc 2019-09-06 13:45:28 +03:00
Denis Zharkov
d9d6c38c2b FIR: Introduce FirClassLikeDeclaration::supertypesComputationStatus 2019-09-06 13:44:32 +03:00
Denis Zharkov
6058f9d286 FIR: Avoid recursions while building Java enhancement scopes 2019-09-06 13:44:32 +03:00
Denis Zharkov
7f5c4d90fd FIR: make "collectSuperTypes" recursion-resistant 2019-09-06 13:44:32 +03:00
Denis Zharkov
1f23184db9 FIR: Get rid of code duplication in SupertypesUtils.kt 2019-09-06 13:44:32 +03:00
Denis Zharkov
bf610323cf Support basic light-classes basic with FIR for CLI 2019-09-06 13:44:32 +03:00
Steven Schäfer
e7410348a7 JVM IR: Fix visibility for @InlineOnly functions 2019-09-06 12:12:58 +02:00
Steven Schäfer
ee45933e33 JVM IR: Create local classes in PropertyReferenceLowering
In particular, we should not cache classes or instances for property
references, since they may be used inside of inline funtions. This also
allows us to mark the $$delegatedProperties array as package private.
2019-09-06 12:12:58 +02:00
Steven Schäfer
626f4c94f6 Handle special case visibility rules in LocalDeclarationsLowering 2019-09-06 12:12:58 +02:00
Roman Golyshev
9a938b07ba KT-17689: Fix TypeAliasQualifier to provide enum entries descriptors
- this adds enum entries to the completion on the typealiases
- we cannot use `unsubstitutedInnerClassesScope` instead of `EnumEntriesScope` because it allows to complete things that are not allowed to be resolved by the Kotlin compiler; see `EnumEntriesScope` doc for details
- ^KT-17689 Fixed
2019-09-06 12:11:23 +03:00
Roman Golyshev
f419d2eb30 KT-33585: Add synchronization between scratch editor and preview
- fix problem with not working shortcuts in the preview window by passing more params into view editor creation
2019-09-06 12:03:35 +03:00
Roman Golyshev
d12d9d86bc KT-33585: Refactor KtsScratchFileEditorWithPreview and its output handlers
- now `PreviewOutputBlocksManager` is injected into `PreviewEditorScratchOutputHandler`, so `KtsScratchFileEditorWithPreview` can use it too
2019-09-06 11:36:37 +03:00
Nikolay Krasko
edb700b898 Switch to 192 platform 2019-09-06 11:28:25 +03:00
Dmitry Gridin
650a6e5cc4 MakeOverriddenMemberOpenFix: should update actual members
#KT-32586 Fixed
2019-09-06 15:25:01 +07:00
Dmitry Gridin
58d303afcc MakeOverriddenMemberOpenFix: cleanup code 2019-09-06 15:25:01 +07:00
Natalia Selezneva
3f451d7eaf Switch off SAM adapter conversion for constructors in completion
It is very slow in completion for build.gradle.kts because it creates SAM adapters for constructors of all imported classes
Note that those SamAdapters weren't shown in completion in any case because they were filtered by name filter (SamAdapters for constructors have <init> name)
2019-09-06 10:53:16 +03:00
Natalia Selezneva
f7b8c7f76e Check that project isn't disposed showing notification for scripts
EA-209612 - (Scripting, Notification) assert: ComponentManagerImpl.lambda$throwAlreadyDisposed$
2019-09-06 10:53:15 +03:00
Natalia Selezneva
fb01f7be5e Rename ScriptDependenciesManager to ScriptConfigurationManager 2019-09-06 10:52:59 +03:00
Natalia Selezneva
fa6b5b567b Fix org.jetbrains.kotlin.idea.script.ScriptConfigurationHighlightingTestGenerated.Highlighting.testThrowingResolver 2019-09-06 10:52:30 +03:00
Natalia Selezneva
961e8c2c74 Refactor the mechanism how script configurations are updated
Introduce file attributes cache, which is only applicable when no dependencies are cached in memory cache
Refactor ScriptDependenciesCache to memory cache that is able to get configuration from cache and checks if it is up to date
Move all public methods to ScriptDependenciesManager
Introduce ScriptClassRootsManager that checks if root change event should be called after script configuration update
2019-09-06 10:52:17 +03:00
Natalia Selezneva
dc46f73ecf Rewrite scripting related API to PsiFile instead of VirtualFile
There were several places where we converted virtualFile to PsiFile. This operation need a read access and may throw ProcessCanceledException,
so we want to minimize its usages in IDE
2019-09-06 10:51:26 +03:00
Sergey Rostov
5b48dcca4f ResultWithDiagnostics: remove unused equals and hashCode
They are overridden by sealed data classes
2019-09-06 09:33:33 +03:00
Mikhail Glukhikh
91f39a0ecf FIR [optimization]: eliminate some unnecessary ScopeSessions 2019-09-06 09:29:19 +03:00
Georgy Bronnikov
7ede26e8f4 IrCompileKotlinAgainstInlineKotlin tests 2019-09-06 09:19:57 +03:00
Nikolay Krasko
0807987ef7 Update 192 to release version 2019-09-05 19:39:04 +03:00
Nikolay Krasko
655e77b0dd Update lz4 for 192 in :compiler:incremental-compilation 2019-09-05 19:39:03 +03:00
Ilya Ryzhenkov
7968ecef1c Initial import of benchmarks from https://github.com/dzharkov/kotlin-compiler-benchmarks 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov
1bd5b68b4a Build: Instrument only java tasks for main & test source sets 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov
50eb98194a Build: Move dependencies.properties to the root build directory 2019-09-05 17:21:48 +03:00
pyos
20626e4aaf Make ReturnableBlockLowering common
and remove special handling in JVM_IR codegen.
2019-09-05 15:48:26 +02:00
Sascha Peilicke
ae8c93de6a Support symlinked JAVA_HOME
When testing for the JAVA_HOME environment variable, expand potential
symlinks first. This is almost guaranteed to be the case on all modern
Linux distributions putting the JDK / JRE behind update-alternatives to
be able to select the *current* version [0], e.g. on Fedora:

  $ ls -l $JAVA_HOME
  lrwxrwxrwx. ... /usr/lib/jvm/java -> /etc/alternatives/java_sdk

[0] https://linux.die.net/man/8/update-alternatives
2019-09-05 16:36:08 +03:00
Mikhail Glukhikh
98f72e58bd FIR deserializer: use class type parameters in constructor directly
This allows calls like Pair(...) to be resolved correctly
2019-09-05 16:26:15 +03:00
Mikhail Glukhikh
6a7ebe8928 FIR substitution: do not create fake overrides if types aren't changed 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
5386cfe254 FIR2IR: support fake overridden properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
687db20029 FIR: support fake overrides for properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
5741ff5d86 FIR: split default importing scopes into low/high priority ones
This fixes resolve of StringBuilder(), AssertionError(), etc.
2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
044dfd14ce FIR: more accurate type checking in typeFromCallee 2019-09-05 16:26:06 +03:00
Ilya Goncharov
c27ed0cfd3 Update ReadMe for gradle-plugin-integration-tests 2019-09-05 14:37:00 +03:00
Nikolay Krasko
5deaca9ace Fix building tests for fir:lightTree in 192 branch 2019-09-05 14:35:17 +03:00
Nikolay Krasko
7bdde7cad3 Disable HierarchicalMultiplatformProjectImportingTest in Android Studio (KT-33067) 2019-09-05 14:35:17 +03:00
Andrey Uskov
48d666daea Make platforms order reproducible in iml-files
#KT-33316 Fixed
2019-09-05 14:14:33 +03:00
Dmitry Gridin
a843c23f20 Completion: add root prefix support
#KT-10340 Fixed
2019-09-05 18:01:23 +07:00
Dmitry Gridin
7a4c3e4d6a BaseDeclarationInsertHandler: fix startOffset 2019-09-05 18:01:23 +07:00
Dmitry Gridin
c4a1101600 KtSimpleNameReference: add root prefix support to bindToFqName function 2019-09-05 18:01:23 +07:00
Dmitry Gridin
2e781a7a27 KtSimpleNameReference: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
dd2bd320ba ShortenReferences: add root prefix support
#KT-9204 Fixed
2019-09-05 18:01:22 +07:00
Dmitry Gridin
0c81173b71 idea-core.Utils: add extension to FqName to support root prefix 2019-09-05 18:01:22 +07:00
Dmitry Gridin
953aaadee1 idea-core.Utils: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
14ad6284d9 QualifiedExpressionResolver: add root prefix resolve for IDE analysis 2019-09-05 18:01:22 +07:00
Dmitry Gridin
68d20dae66 QualifierExpressionResolver: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
4224d109e2 AnalysisFlags: add flag ideMode for IDE specific analysis 2019-09-05 18:01:22 +07:00
Andrey Uskov
106452b5f0 Add list of modules available via dependsOn in FacetSettings 2019-09-05 13:58:58 +03:00
Andrey Uskov
4642127c28 Introduce versioning of multiplatform in KotlinFacetSettings 2019-09-05 13:58:51 +03:00
Mads Ager
75f9532959 [IR] Avoid duplicate IR elements in for loops lowering. 2019-09-05 11:33:26 +02:00
Sebastian Schuberth
4ce6a54236 YarnSetupTask: Fix setup() to be a Gradle TaskAction 2019-09-05 11:30:22 +03:00
Roman Artemev
0040298eac Fix master
- improve assertion message
 - compare correct file paths
 - fix C JS BE testData
2019-09-04 14:37:14 +03:00
Roman Golyshev
870dbd158c KT-28910: Add tooltips for toolbar checkboxes in .kts scratch editor
- make `ScratchFileAutoRunner.AUTO_RUN_DELAY_IN_SECONDS` public
- remove `Show preview only` mode button from the toolbar
- ^KT-28910 Fixed
2019-09-04 10:56:41 +03:00
Roman Golyshev
f0f2fd5684 KT-28910: Extract labels from scratch editor to KotlinBundle messages 2019-09-04 10:56:41 +03:00
Ilya Chernikov
72b68ee683 Fix proguarding of jline library in compiler
#KT-32234 fixed
#KT-32259 fixed
2019-09-04 09:35:04 +02:00
Mads Ager
3f28b71509 [IR] Fix issue getting the length property from CharSequence bounded type parameter
Use the class of the subtype of CharSequence when available. When
it is not (for type parameters bounded by CharSequence) call the
CharSequence getter and 'get' method. Using the most specific type
posible fixes the forInStringSpecialized test that expects the
use of INVOKEVIRTUAL and not INVOKEINTERFACE.

Add tests for the type parameter use.
2019-09-03 20:18:03 +02:00
Alexander Udalov
eb5e91d6bb Do not use typeMapper to count number of coroutine parameters in MethodInliner 2019-09-03 19:33:55 +02:00
Alexander Udalov
2648fb2ddd Do not use typeMapper.mapAsmMethod for erased invoke in MethodInliner
Return type of erased `invoke` is always java/lang/Object anyway
2019-09-03 19:33:54 +02:00
Alexander Udalov
4953f67563 JVM IR: do not use KotlinTypeMapper indirectly via InlineCodegen
Move JVM signature and method owner computation out of InlineCodegen's
constructor to the call sites.
2019-09-03 19:33:54 +02:00
Alexander Udalov
ad8b7ff645 Minor, extract PsiInlineCodegen to a separate file 2019-09-03 19:33:54 +02:00
Alexander Udalov
bf5ca2ed84 Cleanup compiler warnings in IR-related modules 2019-09-03 19:32:57 +02:00
Alexander Udalov
406462d422 Regenerate FIR tree visitors and transformers 2019-09-03 16:37:53 +02:00
Sergey Bogolepov
ac3864543c Add Family.TVOS, Family.WATCHOS and KonanTarget.ANDROID_X86, KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_ARM32. 2019-09-03 18:54:30 +07:00
Igor Chevdar
5bd88f3191 [IR] ForLoopsLowering: fixed problems with type parameters 2019-09-03 14:40:06 +03:00
Roman Artemev
21c7c89dbc [JS KLIB IC] Support incremental klib generation for JS IR
Note: the following test do not work yet because of IrField FO issue
testSecondaryConstructorAdded
testCompanionObjectInheritedMemberChanged
2019-09-03 14:21:32 +03:00
Roman Artemev
d6facf2976 [JS KLIB IC] Fix test runner 2019-09-03 14:21:32 +03:00
Roman Artemev
3753b75609 [JS KLIB IC] Implement incremental cache for IR 2019-09-03 14:21:32 +03:00
Roman Artemev
7840cf70f0 [IC] Add missed runtime dependency 2019-09-03 14:21:32 +03:00
Roman Artemev
104a50f786 [KLIB] Update ABI version 2019-09-03 14:21:32 +03:00
Roman Artemev
6bea403338 [KLIB] Fix ir serializer output format 2019-09-03 14:21:32 +03:00
Roman Artemev
c8c9328973 [KLIB] Switch to monolithic layout 2019-09-03 14:21:32 +03:00
Roman Artemev
c8a3374829 [KLIB] Do not store Date in klib manifest 2019-09-03 14:21:31 +03:00
Roman Artemev
1cdff7810e [Psi2Ir] Fix Lazy Fake override field
- add comment about problem with DeserializedPropertyDescriptor
2019-09-03 14:21:31 +03:00
Roman Artemev
f2a5ab8c16 [IR SERIALIZATION] Fix zipped layout 2019-09-03 14:21:31 +03:00
Roman Artemev
90504c797a [IR SERIALIZATION] Add tests about klib linkage 2019-09-03 14:21:31 +03:00
Roman Artemev
1e547dd1cd [IR SERIALIZATION] Add more informative error message 2019-09-03 14:21:31 +03:00
Roman Artemev
31f3e668d2 [IR SERIALIZATION] Cleanup mangler interface 2019-09-03 14:21:31 +03:00
Roman Artemev
2e0ab8ba3f [IR SERIALIZATION] Fix ONLY_DECLARATION_HEADERS mode 2019-09-03 14:21:31 +03:00
Roman Artemev
0c7454c918 [IR SERIALIZATION] Fix forward Declarations in deserializaer 2019-09-03 14:21:31 +03:00
Roman Artemev
2bd3d90fe0 [IR SERIALIZATION] Link depend modules lazily 2019-09-03 14:21:31 +03:00
Roman Artemev
aa8b58e396 [IR SERIALIZATION] Get rid of UniqIdKey 2019-09-03 14:21:31 +03:00
Roman Artemev
aa313903cc [IR SERIALIZATION] Support both Per-File and Monolitic klib layout 2019-09-03 14:21:30 +03:00
Roman Artemev
125982841a [IR SERIALIZATION] Fix clashes 2019-09-03 14:21:30 +03:00
Roman Artemev
55f06ecff5 [IR SERIALIZATION] Fix rebase 2019-09-03 14:21:30 +03:00
Roman Artemev
16be3b6d6e [IR SERIALIZATION] Add deserializaFullModule API 2019-09-03 14:21:30 +03:00
Roman Artemev
d9affc5abb [IR SERIALIZATION] Raname IrIrSeriazlizedIrFile -> SerializedIrFile 2019-09-03 14:21:30 +03:00
Roman Artemev
f6339bcf93 [IR SERIALIZATION] Handle UniqId clashes 2019-09-03 14:21:30 +03:00
Roman Artemev
5e14b94a88 [IR SERIALIZATION] Do not track non-metadata descriptors in descriptor table 2019-09-03 14:21:30 +03:00
Roman Artemev
df5f6a2a12 [IR SERIALIZATION] Refactored uniqId allocation
- split DeclarationTable into local and global one
 - minimize usages of kotlin mangler
 - clean up interfaces
2019-09-03 14:21:30 +03:00
Roman Artemev
19b5d57f0e [IR PROTO] Delete unused proto.java files 2019-09-03 14:21:30 +03:00
Roman Artemev
b7b951c8c8 [IR] Refactoring 2019-09-03 14:21:30 +03:00
Roman Artemev
ea42eb6a5c [IR] Fix rebase 2019-09-03 14:21:29 +03:00
Roman Artemev
d50eb5ce52 [IR SERIALIZATION] Make [de]serialization processes incremental
- Use local uniqID local indexation file-local
 - Rethink the way declaration is looked for
 - Store in public file index only publicly accessible symbols
 - refactor API
 - code clean up
2019-09-03 14:21:29 +03:00
Roman Artemev
96a2cc1f17 [JS IR] Clean up Declaration Table code 2019-09-03 14:21:29 +03:00
Roman Artemev
f14107bf65 [IR] Sort dependencies a bit early 2019-09-03 14:21:29 +03:00
Roman Artemev
1465121266 [IR] Split declaration & descriptor tables 2019-09-03 14:21:29 +03:00
Roman Artemev
a7714a5589 [JS IR BE] Split IrModule/IrFile serializers 2019-09-03 14:21:29 +03:00
Roman Artemev
15a49cf2aa [IR BE] Rename IrModuleSerializer -> IrFileSerializer 2019-09-03 14:21:29 +03:00
Roman Artemev
94a03c9cb4 [IC KLIB] Serialization infrastructure refactoring
- remove IrModule header
 - put IrDeclaration and its body into separate files
 - use only one type of IrData index
 - separate deserialization of declarations and its bodies
 - introduce FqName message
2019-09-03 14:21:29 +03:00
Roman Artemev
5a45960c04 [IR] Do not interact with file system during Ir Serialization
- make `IrModuleSerializer` produce ByteArrays with serialized data
 - isolate file system access on Klib writer
2019-09-03 14:21:28 +03:00
Mads Ager
85b1e0165b [IR] For loop lowering for CharacterSequence.indices. 2019-09-03 13:18:21 +02:00
Nikolay Krasko
63f43d9b2e Revert "Use lazySync instead of lazyPub to avoid raise on creation LightClasses"
The commit causes deadlock in 183 branch in KotlinLintTestGenerated test.

This reverts commit d6c54b84
2019-09-03 12:42:56 +03:00
Dmitry Gridin
d0c02a1a34 PackageDirectoryMismatchInspection: fix exception from empty script file
#KT-33437 Fixed
2019-09-03 16:20:40 +07:00
Steven Schäfer
102a3d60e0 IR: Consistently copyAttributes in DeepCopyIrTreeWithSymbols
This was missing for IrFunctionReferences, which caused problems when
copying default parameters before CallableReferenceLowering in the
JVM_IR backend.
2019-09-02 19:55:36 +02:00
Darya Razumova
5fc6fa8619 Unregistered bunch directives and files test 2019-09-02 18:31:06 +03:00
Darya Razumova
412c562572 Updated switch usage in README 2019-09-02 18:31:06 +03:00
Nikolay Krasko
4dc4acd25f Move CoroutineNonBlockingContextChecker to common code 2019-09-02 18:31:06 +03:00
Igor Yakovlev
79a603768a UltraLight implementation for local and anonymous declarations 2019-09-02 17:42:50 +03:00
Vladimir Dolzhenko
d6c54b845b Use lazySync instead of lazyPub to avoid raise on creation LightClasses 2019-09-02 15:30:08 +02:00
Nikolay Krasko
b856d60575 Add required plugins for Android Studio 3.6 to runtime 2019-09-02 15:14:32 +03:00
Nikolay Krasko
a6fb2bd7a7 Update to AS 3.6.0.9 2019-09-02 15:14:32 +03:00
Yanis Batura
a65967a164 Mention the master branch as the target of pull requests in contributing.md. (#2533)
Also, improve grammar a bit in the same guide.
2019-09-02 14:54:31 +03:00
Mikhail Glukhikh
7eac7d96dc Fix NJ2K test related to KT-30136 2019-09-02 12:57:53 +03:00
Dmitriy Novozhilov
5b118b65fc [FIR] Tests. Update testdata broken in 9508fc60 2019-09-02 11:13:27 +03:00
Dmitriy Novozhilov
54eb4cf928 [FIR] Add synthetic else branch to when if it's missing to LightTreeFirBuilder 2019-09-02 11:12:35 +03:00
Dmitriy Novozhilov
5c29af4b53 [FIR] Tests. Update some outdated FIR testdata 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
f494e0008c [FIR] Minor. Add kdoc to FirDataFlowAnalyzer 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
286a322b55 [FIR] Remove DummyFirDataFlowAnalyzer 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
92acd30bd6 [FIR] Refactor Condition classes 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
84787013dd [FIR] Fix CFG form for boolean operators 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
63bd920f16 [FIR] Tests. Make cfg graphs more strict 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
a87891bec9 [FIR] Some control flow graph building fixes
- fix edges for `continue` and labeled return
- fix deadness for init block and properties
2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
9508fc60c9 [FIR] Remove FirUncheckedNotNullCastImpl from FIR 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
c2602fda1f [FIR] Transform all qualified access nodes with smartcasts 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
c1a8344b45 [FIR] Add forgotten nullability for receivers of safe calls 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
fd84202c08 [FIR] Add fir node for qualified access with smartcast 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
04b6c48ae7 [FIR] Disable smartcasts to Nothing? 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
b58a03458e [FIR] Tests. Improve style of control flow graphs
Add borders to control flow graphs of different functions
Highlight enter and exit nodes of each graph
2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
7851657b98 [FIR] Store fir in DataFlowVariable 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
163c5d699f [FIR] Pass flow to right operand of && expression 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
59205cac13 [FIR] Tests. Add orthogonal edge routing for cfg dumps 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
b2e95eebab [FIR] Add processing of loops with constant boolean value in condition 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
a60115c452 [FIR] Fix propagating deadness for loops and when expressions 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
006cb536e0 [FIR] Add detecting dead edges for boolean operators with consts 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
fd1347f2b7 [FIR] Tests. Add instruction for configuring tool for cfg dump viewing 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
b7e1e7704e [FIR] Tests. Change extension for testdata with cgf from .cfg.dot to .dot
Also remove cfg dumps in made with old renderer
2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
7e43a0d9ef [FIR] Add boolean constant folding for DFA 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
78f7211587 [FIR] Add test for smartcast with return in elvis 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
98b3901f9c [FIR] Fix bug in building cfg for || 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
fc43c8a74b [FIR] Add inlining of control flow graphs of in-place anonymous functions 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
e72d8e675a [FIR] Add invocation kind to anonymous functions 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
e937e4b261 [FIR] Add bound smartcasts 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
e6c04c0454 [FIR] hold one-to-one mapping for data flow variable and Fir 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
bda8c7ee1c [FIR] Fix smartcasts on when subject 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
200c13baf5 [FIR] Add tests for smartcasts 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
7a81c37f5c [FIR] Fix building cfg for binary or 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
2d3e9fe539 [FIR] Add creating simple type for type parameters symbols 2019-09-02 10:43:07 +03:00
Mikhail Glukhikh
b1731749c0 Add failing test for smart-cast branch 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
b4a4d4d709 [FIR] Add renderer to .dot for control flow graph tests 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
2e501e0f97 [FIR] Implement Data Flow Analysis 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
216b9ad933 [FIR] Add logic system for data flow analysis 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
6e0f4f140f [FIR] Minor. Add set of type operations to FirOperation 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
6b4e95ec52 [FIR] Add tests for control flow graph building 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
fc982cc7e8 [FIR] Add data flow analyzer that delegates to CFG builder 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
9f0781c9de [FIR] Add references to control flow graph to FirFunction and FirProperty
Also add updating CFG references anfter data flow analyzer builds graph
That graph is needed for further control flow analysis
2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
56ac1201b6 [FIR] Add abstract data flow analyzer with callbacks for body resolve transformer 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
dcfc75a58f [FIR] Add control flow graph and infrastructure for building it
For some of language constructions cfg is dummy (e.g. for finally blocks
  or anonymous initializers)
2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
198599f3c7 [FIR] Add builtins types to FirSession 2019-09-02 10:43:05 +03:00
Dmitriy Novozhilov
7d4c635e85 [FIR] Minor. Add util functions for checks that type is builtin 2019-09-02 10:43:05 +03:00
Dmitriy Novozhilov
38fa0122e8 [FIR] Add synthetic else branch to when if it's missing
This change is needed for correct work of data flow, because for
  non-exhaustive when there is a else branch in terms of control flow
  graph.

This change leads to some errors when when is actually exhaustive, but
  we still add else branch. Those errors will be gone when exhaustive
  checker will be introduced
2019-09-02 10:43:05 +03:00
Anton Yalyshev
e904e638e9 LookupCancelWatcher bunches update 2019-09-01 08:22:40 +03:00
Anton Yalyshev
7b769b74a1 Add bunches for AS ans 183 2019-09-01 08:22:39 +03:00
Anton Yalyshev
a962dd7155 Add a bunch for as33 2019-09-01 08:22:38 +03:00
Anton Yalyshev
fa1a558b76 Exclude logging in case of non-kotlin files 2019-09-01 08:22:37 +03:00
Anton Yalyshev
cd78f3d9d7 Add finish_reason and invocation_count to context 2019-09-01 08:22:36 +03:00
Anton Yalyshev
3926b91bb1 Add window appearance time. Fix final context data structure. 2019-09-01 08:22:34 +03:00
Anton Yalyshev
7afa75e802 Set event context structure 2019-09-01 08:22:33 +03:00
Anton Yalyshev
e99395e548 Register FUS collector for Code Completion 2019-09-01 08:22:03 +03:00
Alexander Podkhalyuzin
ac7c89b3b5 Completions stats physical part, collector part left
#KT-33090 Comment
2019-09-01 08:19:35 +03:00
Nikolay Krasko
edd2cedfd3 Disable GradleConfiguratorPlatformSpecificTest in AS 3.6 2019-08-30 22:26:00 +03:00
Nikolay Krasko
5fa2b62de4 Fix test failures in AS 3.6 because of InjectedLanguageManager (KT-33606)
Advance android studio to 3.6 Canary 8 where problem with
InjectedLanguageManager is already fixed.
2019-08-30 22:26:00 +03:00
Nikolay Krasko
c0270ef47b More plugins registration for Android Studio 3.6 2019-08-30 22:26:00 +03:00
Nikolay Krasko
e28802fbfa Fix test failure because of duplicates file templates in classpath
There're two ways for getting templates in test runtime. One is from
sources resource files, the second one is from compiled jar.

Remove the first entry manually.

A better fix is to extract tests to separate module. This will leave
only jar in the test runtime classpath.
2019-08-30 22:25:59 +03:00
Igor Yakovlev
0eea2479fc Added possibility to override Path Chooser for MoveKotlinNestedClassesToUpperLevelModel 2019-08-30 20:59:53 +03:00
Simon Ogorodnik
99972a08a1 [FIR] Fix table rendering 2019-08-30 16:51:25 +03:00
Simon Ogorodnik
438c90b477 Silence fir bench output for diagnostic smoke tests 2019-08-30 16:32:48 +03:00
Simon Ogorodnik
312e93859b Add more info to fir bench report & format as table
Properly measure raw fir builder time in fir benchmark
2019-08-30 16:32:48 +03:00
Vladimir Krivosheev
dca88db16a remove unused org.jetbrains.kotlin.idea.inspections.gradle.KotlinPlatformGradleDetector EP
Not required after cc85ac44b3

Leads to warning in IDEA 2019.3
2019-08-30 16:15:27 +03:00
Igor Yakovlev
02a6a1ea49 Fix ExtractDeclarationFromCurrentFileIntention assertion
Refactorings should be invoked inside transaction 'exception occurs when extracting sealed class from file with the same name assertion failed when refactoring tries to use MoveKotlinTopLevelDeclarationsDialog
+ move refactorings
+ small improvement of applicability range calculation

Fixed #KT-33357
2019-08-30 14:31:34 +03:00
Svyatoslav Kuzmich
9594e9b3b1 [JS IR BE] Initial export generation 2019-08-30 13:15:37 +03:00
Svyatoslav Kuzmich
6670180782 [JS IR BE] Use internal visibility for generated helper methods 2019-08-30 13:15:37 +03:00
Vasily Levchenko
22c53e14e6 [IR][inliner] fixed occasional endless recursion in InlinerExpressionLocationHint::toString 2019-08-30 12:23:18 +03:00
Nikolay Krasko
8218ca5bae More 182 branch mentioning remove
#KT-33536 Fixed
2019-08-30 12:14:58 +03:00
Nikolay Krasko
8ae4293a0f Remove 181 branch from build scripts
#KT-33536 Fixed
2019-08-30 12:14:54 +03:00
Nikolay Krasko
0ae9240e5f Remove 182 and AS33 from build scripts
#KT-33536 Fixed
2019-08-30 12:14:50 +03:00
Nikolay Krasko
51cfafc619 Minor: advance comment
#KT-33536 Fixed
2019-08-30 12:14:46 +03:00
Nikolay Krasko
3989f5244f Minor: Fix comment about absent method
#KT-33536 Fixed
2019-08-30 12:14:42 +03:00
Nikolay Krasko
d04749dd3f Remove other specific code after removing 182
#KT-33536 Fixed
2019-08-30 12:14:38 +03:00
Nikolay Krasko
63f0eae7e2 Remove CodeStyleSettingsProviderCompat.java after removing 182
#KT-33536 Fixed
2019-08-30 12:14:34 +03:00
Nikolay Krasko
d1aca83dd5 Remove getInvalidIcon default implementation after removing 182
#KT-33536 Fixed
2019-08-30 12:14:30 +03:00
Nikolay Krasko
edb83f4ed9 Remove IconExtensionChooser and png icons after removing 182
#KT-33536 Fixed
2019-08-30 12:14:25 +03:00
Nikolay Krasko
888a93115f Use function icon from the platform after removing 182
#KT-33536 Fixed
2019-08-30 12:14:21 +03:00
Nikolay Krasko
169aa6348c Remove runConfigurationsCompat.kt after removing 182
#KT-33536 Fixed
2019-08-30 12:14:16 +03:00
Nikolay Krasko
ddcadc8138 Remove default implementations after removing 182
#KT-33536 Fixed
2019-08-30 12:14:12 +03:00
Nikolay Krasko
081ffe7d19 Remove ScriptModificationListener compat after removing 182
#KT-33536 Fixed
2019-08-30 12:14:07 +03:00
Nikolay Krasko
23f488498f Remove EditorFactoryListenerWrapper compat after removing 182
#KT-33536 Fixed
2019-08-30 12:14:01 +03:00
Nikolay Krasko
9abdddf09a Remove psiFile extension after removing 182
#KT-33536 Fixed
2019-08-30 12:13:56 +03:00
Nikolay Krasko
372c6377e8 Remove AstLoadingUtil after removing 182
#KT-33536 Fixed
2019-08-30 12:13:50 +03:00
Nikolay Krasko
4d0fc1dc22 Remove 182 support
#KT-33536 Fixed
2019-08-30 12:13:44 +03:00
Nikolay Krasko
1c4ee6bd79 Remove as33 support
#KT-33536 Fixed
2019-08-30 12:13:09 +03:00
Toshiaki Kameyama
0ec18b4a33 Explicit this inspection: fix false negative with local variable
#KT-30136 Fixed
2019-08-30 12:07:13 +03:00
Ivan Cilcic
eb469b924f Add frontend visualizer module auto test in gradle 2019-08-30 11:54:27 +03:00
Ivan Cilcic
24cce75899 Add FIR_IGNORE directive to test files that must be skipped 2019-08-30 11:54:21 +03:00
Ivan Cilcic
350bd33769 Move FirRenderer class inside FirVisualizer to avoid ambiguity with existed FirRenderer 2019-08-30 11:50:35 +03:00
Ivan Cilcic
262f57d938 Add more tests in uncommonCases folder
1) dataClass.kt - test with data class
2) receiver.kt - test with Int extension receiver
3) delegation.kt - test with implementation by delegation
2019-08-30 11:50:35 +03:00
Ivan Cilcic
b8ef09a157 Repalce work with stack variable to work with extension functions 2019-08-30 11:50:34 +03:00
Ivan Cilcic
fd461a5147 Fix current package removing from properties 2019-08-30 11:50:34 +03:00
Ivan Cilcic
f0e7dcc4f6 Fix superTypes test by adding parameter to primary constructor 2019-08-30 11:50:34 +03:00
Ivan Cilcic
f0c7aadb20 Exctract common code from psi and fir visualizer classes 2019-08-30 11:50:33 +03:00
Ivan Cilcic
d504774527 Create fir renderer class 2019-08-30 11:50:33 +03:00
Ivan Cilcic
7a45155eb3 Create tests for fir visualizer 2019-08-30 11:50:33 +03:00
Ivan Cilcic
2179f97006 Create fir visualizer abstract test class and extract common code with psi tests 2019-08-30 11:50:32 +03:00
Ivan Cilcic
fe328f8c7a Add some additional information to psi renderer
1) Trim unused spaces in annotations
2) Rewrote fq name rendering
3) Added annotations to for loop variable
4) Added type arguments render along to type parameters in functions
2019-08-30 11:50:32 +03:00
Ivan Cilcic
8fb2383845 Move psi visualizer test to separate "psi" package 2019-08-30 11:50:32 +03:00
Ivan Cilcic
aebe8c36f5 Add test methods and data for uncommon cases
Uncommon means mostly that aren't present in raw fir builder data
2019-08-30 11:50:31 +03:00
Ivan Cilcic
8047aa22a4 Add test methods and data base on raw fir builder test data 2019-08-30 11:50:31 +03:00
Ivan Cilcic
fd8205e317 Add removing current file package name from fq name 2019-08-30 11:50:31 +03:00
Ivan Cilcic
d2e47aea01 Change render to separate package names with slash symbol 2019-08-30 11:50:30 +03:00
Ivan Cilcic
08c9fa5259 Rewrite Annotator to be able to put several annotations in one position 2019-08-30 11:50:30 +03:00
Ivan Cilcic
1c2ffa65ca Revert commit with changes in DescriptorRenderer 2019-08-30 11:50:30 +03:00
Ivan Cilcic
3a12bac910 Wrote separate descriptor renderer
It was easier to write my own renderer than change current one
2019-08-30 11:50:29 +03:00
Ivan Cilcic
b57c34fd4d Remove rendering from super and this expressions and from package directive 2019-08-30 11:50:29 +03:00
Ivan Cilcic
d0e1234434 Add separate method to render special functions
Specials functions are elvis (?:) and exclexcl (!!)
2019-08-30 11:50:29 +03:00
Ivan Cilcic
e94417e27b Remove unnecessary data from render result 2019-08-30 11:50:28 +03:00
Ivan Cilcic
feec5b1a7c Make annotation process a little clearer 2019-08-30 11:50:28 +03:00
Ivan Cilcic
e23e662ba7 Remove names from value parameters list 2019-08-30 11:50:28 +03:00
Ivan Cilcic
6fa7435cd4 Add additional options to DescriptorRender
1) renderContextNearLocalVariable - if true renderer add fq name for local variables after "@" symbol
2) fullContextForLocalVariable - if true then renderer add all fq names for local variables, else only last one
3) useBaseClassAsReceiver - if true then renderer uses dispatch receiver as extension receiver if the last is null
2019-08-30 11:50:27 +03:00
Ivan Cilcic
1879fd19eb Create simple renderer for old frontend
It uses DescriptorRendererImpl that isn't quite good.
2019-08-30 11:50:27 +03:00
Ivan Cilcic
e69e6a1eeb Create simple text annotator based on binary search
Co-authored-by: Simon Ogorodnik <simon.ogorodnik@jetbrains.com>
2019-08-30 11:50:27 +03:00
Ivan Cilcic
77c330d94e Make a structure for frontend visualizer
Created visualizer module in compiler. It will contain basic tests for renderer. Additionally added three different modules in visualizer:
1) psi - will contain renderer for old frontend
2) fir - renderer for new frontend
3) common - will contain common code for both renderers
2019-08-30 11:50:26 +03:00
Mikhail Glukhikh
e895a0b8a0 FIR resolve: integrate implicit receivers into ImplicitReceiverStack
It can work both by order & by name
2019-08-30 11:47:34 +03:00
Mikhail Glukhikh
f2c77c45e9 FIR: simplify rendering of dispatch & extension receivers 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
dfacc2d68f FIR builder test: remove always-false check 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
e36a75250b FIR: visit/transform dispatch & extension receivers only once 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
5defe22651 FIR [MapArguments]: transform only arguments but not all children 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
8bb539ce19 FIR resolve: integrate receiverExpression inside ReceiverValue 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
0962755fde FIR2IR: drop field receiver consistency check (due to delegate field case) 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
75c4c88d0a FIR: set receivers for invoke case more precisely 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
62bb127fc9 FIR: add K/J test with getValue() / value fake cycle 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
f0f4ddecc0 FIR: set dispatch receiver for field symbols 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
bd5e1aeef5 FIR2IR: change backing field visibility to private 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
271c15114c FIR: add test with problematic cases 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
652fd7ee73 FIR: fix dispatch receivers for objects 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
29b406c731 FIR: set dispatch receiver for backing field access 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
13d14df8ae FIR: set dispatch receiver for data class generated functions 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
0d5cfa97a5 FIR2IR: read & set dispatch & extension receivers
NB: this commit includes receiver-based assertions yet failing for some tests
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
b531e535b6 FIR call resolve: set values of dispatch & extension receivers 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
67a7243361 FIR (rename): candidateOwner -> boundSymbol 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
8633a33108 FIR: add new qualified access implementation (FirThisReceiverExpression) 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
c63919f224 FIR tree: add dispatch & extension receivers 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
da22898a19 FIR2IR: set 'SetField' type to Unit, convert explicit 'this' references 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
6604539154 FIR: set bound symbol for explicit this references 2019-08-30 11:47:30 +03:00
victor.petukhov
aa79064a96 Remove deprecated spec tests map generators 2019-08-30 11:39:09 +03:00
Dmitriy Novozhilov
e4938c6c36 [FIR] Remove status map from intersection type 2019-08-30 11:10:31 +03:00
Dmitriy Novozhilov
ef4ef08b1d [FIR] Add default upper bound for java type parameters 2019-08-30 11:10:31 +03:00
Mads Ager
8ed1317839 [IR] For loop lowering for iteration over CharacterSequences.
Change-Id: I7aeadfffc80f791ec19a3607e219c1dc4de028db
2019-08-30 09:35:59 +02:00
Sergey Rostov
26fbe3f07b JPS Build: remove outdated note about updating bootstrap 2019-08-30 09:05:58 +03:00
Igor Yakovlev
63892891db Add internal move refactoring testing action
This action doing further steps in infinite loop (breaks after user request):
1) Generate random move refactoring model
2) Run this model (if it is correct)
3) Recompile the project
4) If compilation was not succeeded write model parameters into output file
5) Delete all new files and directories and make "git reset"
2019-08-29 18:23:21 +03:00
Igor Yakovlev
3951fde081 Save 'Search for references' checkbox state on move of kotlin file
Fixed #KT-24929
2019-08-29 18:16:21 +03:00
Igor Yakovlev
eca2707dbf Refactor of Move Refactoring
The main purpose of this commit - to make this refactoring logic can be covered as much as possible.
To make this possible we should to extract all possible UI code from business logic (and vice versa).
Additional fixes was applied during refactoring process.

There is come major steps made in this commit:
1) Extract business logic to separate models
2) Fixes of business models logic
3) Add "Delete empty source file" checkbox instead of modal message box
4) Improve error messaging in move refactoring dialogs
5) Inject interface into move handler that makes UI dialogs could be overrided
6) Inject flag into move handler that makes UI conflicts dialog could be overrided
2019-08-29 18:16:20 +03:00
Vasily Levchenko
d6c5fbace0 [IR][inliner] prevent of parameters location information loss 2019-08-29 16:53:56 +03:00
Vladimir Dolzhenko
a2fcefd456 Added fallback for LightClasses getOwnFields, getOwnMethods if dummy resolve failed (KT-27243, KT-33561) 2019-08-29 15:46:57 +02:00
Ilya Kirillov
78b0d5750b New J2K: consider literal expressions in data class conversion & fix names conflict
#KT-32253 fixed
2019-08-29 11:31:55 +03:00
Ilya Kirillov
405a3beeab New J2K: move helper functions to corresponding files & use better names for tree nodes files 2019-08-29 11:31:54 +03:00
Ilya Kirillov
64ecbd1418 New J2K: use internal getStrictParentOfType instead of custom one 2019-08-29 11:31:54 +03:00
Ilya Kirillov
2f5fa49c52 New J2K: remove unused abstractions for conversions running 2019-08-29 11:31:54 +03:00
Ilya Kirillov
131df66087 New J2K: check if method reference has functional type on PsiType instead of JKType
As it may reference to uninitialized universe symbol

#KT-33434 fixed
2019-08-29 11:31:53 +03:00
Ilya Kirillov
ca0cc13097 New J2K: retrieve constructor call return type correctly
#KT-33431 fixed
2019-08-29 11:31:53 +03:00
Ilya Kirillov
982e7fdd86 New J2K: do not shorten class references for some Java primitive class wrappers classes
It may cause unresolved call errors

#KT-33500 fixed
2019-08-29 11:31:53 +03:00
Steven Schäfer
fd2ad89799 JVM IR: Write ACC_DEPRECATED flags 2019-08-28 19:41:12 +02:00
Steven Schäfer
a90ac2438d Set correct field visibility in psi2ir 2019-08-28 19:41:11 +02:00
Mads Ager
6c7a904663 Psi2Ir: Mark accessors with no bodies as default accessors.
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Ilya Chernikov
fda37eaaae [minor] Rearrange test utils for easier reuse 2019-08-28 17:59:12 +02:00
Ilya Chernikov
947867286c [minor] Fix potential problems with sequence, add a todo 2019-08-28 17:59:12 +02:00
Ilya Chernikov
c9b25cad01 Fix classpath handling when evaluating legacy scripts from kotlinc
#KT-33554 fixed
2019-08-28 17:59:12 +02:00
Ilya Chernikov
31c56d7794 Set java.class.path property in runner and loader
#KT-24991 fixed
2019-08-28 17:59:12 +02:00
Ilya Chernikov
08720a3dc6 Set thread context classloader in the kotlin runner
#KT-26624 fixed
2019-08-28 17:59:11 +02:00
Ilya Chernikov
d3f32c0d8a Set thread context classloader in preloader
#KT-33529 fixed
2019-08-28 17:59:11 +02:00
Igor Yakovlev
7b2f39530a Fix invalid testdata for ConvertToScopeIntention applicability 2019-08-28 16:31:49 +03:00
Vyacheslav Gerasimov
cf39803074 Pass cacheRedirectorEnabled flag to performance test gradle import
#KT-33582
2019-08-28 16:14:05 +03:00
Dmitry Gridin
b04fbbd43b Fix testUnusedSymbol_class_inspectionData_Inspections_test test 2019-08-28 19:11:42 +07:00
Igor Yakovlev
1e72116a9c Fix test data for intention tests
The ExtractDeclarationFromCurrentFileIntention applicability range was changed by commit 3b35c2d24 so the test data of several test comes invalid
2019-08-28 13:07:33 +03:00
Dmitry Gridin
55f4610926 Tests: fix invalidBundleOrProperty test for 183
#KT-32860 Fixed
2019-08-28 17:03:13 +07:00
Toshiaki Kameyama
d4e4a4c3e7 To ordinary string literal: remove 'trimIndent()' if string is single line
#KT-32616 Fixed
2019-08-27 22:21:49 +03:00
Alexander Udalov
fbe66c3496 JVM IR: fix another naming inconsistency with old backend
This fixes slice rewrite stacktraces from RecordNamesForKotlinTypeMapper
which are printed out when running some JVM IR tests (even though
they're ignored), e.g. localClassSimpleName.kt
2019-08-27 19:27:46 +02:00
Alexander Udalov
fec8dbf6df JVM IR: do not use AsmUtil.putJavaLangClassInstance
To get rid of the last external usage of IrTypeMapper.kotlinTypeMapper
2019-08-27 19:27:46 +02:00
Alexander Udalov
23eb6daae9 JVM IR: remove MethodSignatureMapper.mapImplementationOwner 2019-08-27 19:27:46 +02:00
Alexander Udalov
aea9642ea0 JVM IR: implement MethodSignatureMapper.mapToCallableMethod directly
Instead of calling enormously complicated
KotlinTypeMapper.mapToCallableMethod, where most of special cases are
handled in the IR backend via lowerings.
2019-08-27 19:27:46 +02:00
Alexander Udalov
e0823e20c7 JVM IR: do not use AsmUtil.genToString
AsmUtil.genToString requires an instance of KotlinTypeMapper and calls
KotlinTypeMapper.mapToCallableMethod inside, which (in subsequent
commits) we're getting rid of in the IR backend
2019-08-27 19:27:46 +02:00
Alexander Udalov
bf40b72451 JVM IR: remove unneeded usages of MethodSignatureMapper.mapToCallableMethod 2019-08-27 19:27:46 +02:00
Alexander Udalov
0f1a15daf1 JVM IR: add lowering to remove calls to KFunction{n}.invoke 2019-08-27 19:27:46 +02:00
Alexander Udalov
2b4424b564 JVM IR: replace function accesses in multi-file parts
Any access to a function from a multi-file part needs to be replaced
with the access to the corresponding public method (if it exists) from
the facade class. Note that this has no immediate effect because we use
KotlinTypeMapper for mapping calls, and it understands that a call to a
function from the part must actually be generated into a call to the
function from the facade in the bytecode. This commit merely changes the
IR to better reflect what's generated in the final bytecode, and to be
able to use simplified IR-based method signature mapping instead of the
legacy KotlinTypeMapper in the future.
2019-08-27 19:27:45 +02:00
Zalim Bashorov
21b2487290 Minor: add an additional message for further investigation EA-141821 2019-08-27 18:19:18 +03:00
Simon Ogorodnik
b78ba71224 [FIR] Set mem-limit 8g 2019-08-27 17:24:56 +03:00
Simon Ogorodnik
6a9fb46985 [FIR] Make fir modularized test depends on dist 2019-08-27 17:24:45 +03:00
Simon Ogorodnik
5ef4a01a45 [FIR] Fix module qualified names 2019-08-27 17:24:35 +03:00
Simon Ogorodnik
9338a3c086 [FIR] Filter out common modules 2019-08-27 17:23:40 +03:00
Simon Ogorodnik
b99d9e0e0b [FIR] Disambiguate module names 2019-08-27 17:23:03 +03:00
Simon Ogorodnik
9530389583 [FIR] Group multiple pass logs into one 2019-08-27 17:23:01 +03:00
Simon Ogorodnik
4c246faddb [FIR] Fix redeclaration 2019-08-27 17:23:00 +03:00
Simon Ogorodnik
8c31a0be07 [FIR] Add filter param 2019-08-27 17:22:59 +03:00
Simon Ogorodnik
2ca1e5c8c7 [FIR] Pass properties to test 2019-08-27 17:22:58 +03:00
Simon Ogorodnik
96627fc1ae [FIR] Add parameters to modularized tests 2019-08-27 17:22:57 +03:00
Dmitry Gridin
e9b2e74b15 escapeXML: fix bunch for 183 2019-08-27 18:06:06 +07:00
Dmitry Gridin
ea02d0c632 ExpectActualUtils: repairSuperTypeList should consider type parameters 2019-08-27 17:26:11 +07:00
Dmitry Gridin
03141be11e ExpectActualUtils: update repairAnnotationEntries for more cases with annotations 2019-08-27 17:26:11 +07:00
Dmitry Gridin
ba0ba3422d CreateExpectedFix: rename isCorrectAndHaveNonPrivate to isCorrectAndHaveNonPrivateModifier 2019-08-27 17:26:10 +07:00
Dmitry Gridin
3c6da0bfe6 TypeAccessibilityChecker: rename existingFqNames to existingTypeNames and add comments 2019-08-27 17:26:10 +07:00
Dmitry Gridin
531f695404 CreateExpectedFix: remove recursive call from findAndApplyExistingClasses 2019-08-27 17:26:10 +07:00
Dmitry Gridin
35d64f85f8 TypeAccessibilityCheckerImpl: explicitParameters change return type to Sequence 2019-08-27 17:26:10 +07:00
Dmitry Gridin
aa135bc505 TypeAccessibilityCheckerImpl: move visibility check for KtNamedDeclaration to outside 2019-08-27 17:26:10 +07:00
Dmitry Gridin
eaa28fd4ed CreateExpect: fix build for a33 2019-08-27 17:26:10 +07:00
Dmitry Gridin
27d7ee8518 TypeAccessibilityChecker: move to idea-analysis module 2019-08-27 17:26:10 +07:00
Dmitry Gridin
56a7445660 CreateExpect: should prefer type aliases
#KT-32571 Fixed
2019-08-27 17:26:10 +07:00
Dmitry Gridin
5928a36fa2 CreateExpect: should save receiver annotations
#KT-32694 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin
42ef9d634a ExpectActualUtils: merge generateFunction with generateProperty to generateCallable & remove old checker 2019-08-27 17:26:09 +07:00
Dmitry Gridin
90b82c96eb TypeAccessibilityChecker: fix incorrectTypes for descriptor 2019-08-27 17:26:09 +07:00
Dmitry Gridin
1c98cb763e addRemoveModifier: shouldn't add extra new line
#KT-26635 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin
0458a22f78 TypeAccessibilityChecker: fix case with unresolved type params 2019-08-27 17:26:09 +07:00
Dmitry Gridin
4ed56908af CreateExpect: add actual modifier to original class if needed 2019-08-27 17:26:09 +07:00
Dmitry Gridin
73ae993d81 TypeAccessibilityChecker: add more tests 2019-08-27 17:26:09 +07:00
Dmitry Gridin
84d167b7bd TypeAccessibilityChecker: add logs for tests 2019-08-27 17:26:08 +07:00
Dmitry Gridin
7c850e44d2 CreateExpectedFix: add escaping for error text 2019-08-27 17:26:08 +07:00
Dmitry Gridin
3617f3d247 TypeAccessibilityChecker: fix callable with upper bound 2019-08-27 17:26:08 +07:00
Dmitry Gridin
46fefde09c ExpectActualUtils: introduce TypeAccessibilityChecker
#KT-28537 Fixed
#KT-28538 Fixed
#KT-28549 Fixed
#KT-28620 Fixed
#KT-31433 Fixed
#KT-31475 Fixed
#KT-32642 Fixed
#KT-32768 Fixed
#KT-33150 Fixed
2019-08-27 17:26:08 +07:00
Dmitry Gridin
d1b33485a4 ExpectActualUtils: rename checkTypeInSequence to incorrectTypesInSequence & change return type 2019-08-27 17:26:08 +07:00
Dmitry Gridin
18f0bbe8f1 QuickFixMultiModule: change tests structure 2019-08-27 17:26:08 +07:00
Dmitry Gridin
02fd137cec SimpleTestClassModel: add deep field 2019-08-27 17:26:08 +07:00
Dmitry Gridin
65ce4aed1a TestGenerationDSL: cleanup code 2019-08-27 17:26:07 +07:00
Dmitry Gridin
bddf768d59 CreateExpect: fix case with parameters in constructor without var/val 2019-08-27 17:26:07 +07:00
Dmitry Gridin
1b718761b2 AbstractQuickFixMultiModuleTest: support multiline errors SHOULD_FAIL_WITH 2019-08-27 17:26:07 +07:00
Dmitry Gridin
3f7c983f04 CreateExpectFix: fix selection for primary constructor 2019-08-27 17:26:07 +07:00
Dmitry Gridin
4a049b9b01 GenerateTests: cleanup code 2019-08-27 17:26:07 +07:00
Dmitry Gridin
1748906d9a ExpectActualUtils: should add annotations 2019-08-27 17:22:16 +07:00
Dmitry Gridin
5e60ea2272 ExpectActualUtils: should remove override 2019-08-27 17:22:16 +07:00
Dmitry Gridin
7561905676 ExpectActualUtils: add type accessibility check for supertypes 2019-08-27 17:22:15 +07:00
Dmitry Gridin
8e9952e203 multiplatformUtil: implement Module.toDescriptor() 2019-08-27 17:22:15 +07:00
Dmitry Gridin
755f7e8739 elementRenderingUtils: override visitor for KtTypeReference, KtParameterList, KtParameter 2019-08-27 17:22:15 +07:00
Dmitry Gridin
c17e19b004 elementRenderingUtils: cleanup code 2019-08-27 17:22:15 +07:00
Dmitry Gridin
2b32c9d2f9 ExpectActualUtils: add type arguments accessibility check for constructors 2019-08-27 17:22:15 +07:00
Dmitry Gridin
e59571c482 ExpectActualUtils: add type arguments accessibility check for top level classes 2019-08-27 17:22:15 +07:00
Dmitry Gridin
bad9459978 ExpectActualUtils: add type arguments accessibility check 2019-08-27 17:22:15 +07:00
Dmitry Gridin
5884c65857 ExpectActualUtils: add type accessibility check 2019-08-27 17:22:15 +07:00
Dmitry Gridin
dffb44c11c Create actual/expect quick fix should render super type correctly 2019-08-27 17:22:15 +07:00
Dmitry Gridin
a21375508d ExpectActualUtils: drop missedDeclarations parameter from generateClassOrObject function 2019-08-27 17:22:14 +07:00
Alexander Udalov
22f8b9f475 Remove codegen tests on inline classes based on type parameters
According to KT-23819, such inline classes are prohibited. These tests
can be restored (and fixed if needed) as soon as we allow this back
2019-08-27 11:01:08 +02:00
Steven Schäfer
6bf16a96e1 Add more tests for type operators on the jvm 2019-08-27 10:44:23 +02:00
Steven Schäfer
b6ea135e70 Add a TypeOperatorLowering for JVM_IR 2019-08-27 10:44:23 +02:00
Alexander Udalov
39ba462540 JVM IR: remove unneeded part of a hack for inlining $default methods
Every non-intrinsic IrFunction now has a class container in JVM IR, so
this logic is no longer necessary
2019-08-26 19:41:26 +02:00
Alexander Udalov
34400add22 Minor, add IrCallableMethod.toString 2019-08-26 19:41:25 +02:00
Alexander Udalov
dd74794f97 Minor, add message to exception thrown in parentAsClass 2019-08-26 19:41:25 +02:00
Toshiaki Kameyama
a3c3ab08fd Override/Implement members: place members in the same order as super class members 2019-08-26 13:18:31 +07:00
Roman Golyshev
a38651c1ec KT-32366: Add missing 182 bunch file for the foldingTestUtils.kt 2019-08-23 22:59:45 +03:00
Igor Yakovlev
5a511dd635 Refactor and fix of the run/apply/let/also intention converter
1) Optimize and refactored code
2) Added support for correct renaming of target identifier to this/it
3) Added support of cases with difficult application targets (like: var x = 1 + 2)
4) Show error hint when refactoring failed for some reason
5) Improved intention applicability checking to eliminate false-positive cases
6) Fixed EA-209577
2019-08-23 19:37:00 +03:00
Ilmir Usmanov
ef5fcb4e9e Fix test data 2019-08-23 19:09:28 +03:00
Roman Golyshev
37e3c41b57 KT-32366: Add sync scroll for source and preview editor
- ^KT-32366 Fixed
2019-08-23 18:22:27 +03:00
Roman Golyshev
e488e920d8 KT-32366: Add tests for right preview window
- also, fix missing test generation in `GenerateTests` bunch files (which was introduced in e54b43ba)
2019-08-23 18:22:26 +03:00
Roman Golyshev
bddf87337c KT-32366: Add printing scratch output to preview window
- printing is done with `PreviewEditorScratchOutputHandler`
- `KtsScratchFileEditorWithPreview` redirects output depending on the layout selection
2019-08-23 18:22:26 +03:00
Roman Golyshev
e321ee1396 KT-32366: Inject toolWindowHandler from InlayScratchOutputHandler
- `toolWindowHandler` would be shared between different scratch editors, so we need `ScratchToolWindowHandlerKeeper` to provide proper mechanism for its acquiring and releasing
- fix problem when scratch output panel is never released after first scratch opening by properly unregistering `toolWindow` with `ToolWindowManager`
2019-08-23 18:22:26 +03:00
Roman Golyshev
d0cd4967a7 KT-32366: Extract text styling variables to outputStylingUtils 2019-08-23 18:22:25 +03:00
Roman Golyshev
358ec2b8bd KT-32366: Refactor tests to allow testing of preview window
- add directive `PREVIEW_ENABLED` into scratch file settings
2019-08-23 18:22:25 +03:00
Roman Golyshev
dd1ace37d2 KT-32366: Add TextEditorWithPreview.setLayout method
- it is done to be able to trace when layout is changed
- all actions use this method too
2019-08-23 18:22:24 +03:00
Roman Golyshev
1d6de45db6 KT-32366: Use TextEditorWithPreview as editor for scratch files
- get rid of `ScratchFileHook` completely
- use `KtsScratchFileEditorProvider` to encapsulate details about scratch file presentation
- remove obsolete functions from `scratchUtils`
2019-08-23 18:22:24 +03:00
Roman Golyshev
37c6102a03 KT-32366: Change base of AbstractScratchLineMarkersTest
- with `FileEditorManagerTestCase` it is possible to work with actual TextEditors instead of wrappers during tests, so it will be possible to use `TextEditorWithPreview` via `TextEditorProvider` service
2019-08-23 18:22:24 +03:00
Roman Golyshev
1177566386 KT-32366: Get rid of ScratchTopPanel in tests
- make `ScratchFile.file` public
- remove obsolete functions from `ScratchTopPanel` and `scratchUtils`
2019-08-23 18:22:24 +03:00
Roman Golyshev
962260941b KT-32366: Add TextEditorWithPreview class from the platform
- this class was updated recently (here: https://github.com/JetBrains/intellij-community/pull/1167) to allow its customization; however, those changes from platform are not available for kotlin plugin yet
2019-08-23 18:22:23 +03:00
Roman Golyshev
54dde777ac KT-32366: Get replace editor with virtual file in ScratchFile
- remove `getOutputHandler` method from `KtScratchFileLanguageProvider`
- now `InlayScratchOutputHandler` is a class, it has reference to the target editor and is (temporarily) attached to the editor
2019-08-23 18:22:23 +03:00
Roman Golyshev
1fc88fc47f KT-32366: Refactor ScratchPanelListener to ScratchFileListener
- it is done to move logical dependency from the UI element (`ScratchTopPanel`) to the model element (`ScratchFile`)
2019-08-23 18:22:23 +03:00
Roman Golyshev
ea3d070c98 KT-32366: Refactor ScratchFileHook to make ScratchFile creation clear
- basically just move functions from `ScratchTopPanel` to `ScratchFileHook`
2019-08-23 18:22:22 +03:00
Roman Golyshev
70e6f738eb KT-32366: Refactor scratchUtils to use mostly ScratchFile
- it is done to remove dependency from the UI component `ScratchTopPanel`
- occasional use of `ScratchTopPanel` is still left (for tests mostly)
2019-08-23 18:22:22 +03:00
Roman Golyshev
6c35c40bb9 KT-32366: Refactor ScratchTopPanel to actions instead of custom UI
- migrate module to the `ScratchPanel` class because it is information that matters to him most of all
- move logic for showing\hiding checkboxes to the related actions
2019-08-23 18:22:22 +03:00
Mikhail Glukhikh
23f662cfe2 FIR: optimize creation of scope by implicit receiver 2019-08-23 17:15:09 +03:00
Mikhail Glukhikh
9c3821ddba FIR: add comments & tests for tower resolver, block some receiver pairs 2019-08-23 17:15:09 +03:00
Mikhail Glukhikh
c9a600c5ce FIR: handle imported members from objects more correctly 2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
a4d89b9829 FIR: handle situations with multiple implicit receivers 2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
5d6a526eec FIR: more accurate handling of dispatch receiver values
This commit fixes resolve priorities (see changed test data),
e.g. top-levels now have less priority than implicit receiver members
2019-08-23 17:15:08 +03:00
Nikolay Igotti
fcb0b1b5eb Add new native targets. (#2538) 2019-08-23 16:11:40 +03:00
Toshiaki Kameyama
64d4cca589 Redundant override: do not report when class has derived property
#KT-32479 Fixed
2019-08-23 14:57:20 +07:00
Toshiaki Kameyama
729ed1a44e Pull Members Up: fix invalid code format on function with comment and another indent
#KT-32426 Fixed
2019-08-23 14:25:49 +07:00
Toshiaki Kameyama
7c2f6ecba7 Redundant curly braces in string template: remove braces for 'this'
#KT-32972 Fixed
2019-08-23 14:19:41 +07:00
Dereck Bridie
8f2a73b734 KT-28471: "Add initializer" quickfix initializes non-null variable with null 2019-08-23 14:15:08 +07:00
Toshiaki Kameyama
c0f896c96a flatMap call could be simplified to flatten(): Fix false positive with Array
#KT-33204 Fixed
2019-08-23 14:12:17 +07:00
Ilya Gorbunov
7ff01b02a9 Make ExperimentalTime annotation documented 2019-08-22 21:29:18 +03:00
Ilya Gorbunov
2c79b1f89e Minor: fix incorrect reference in kdoc 2019-08-22 21:29:18 +03:00
Vyacheslav Gerasimov
daa0d58f4d Build: Update list of proxied repositories 2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
1cdc68901a Build: Use kotlinx-metadata-jvm from jcenter instead of bintray 2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
96c9efeabb Build: Fix findNonCachedRepositories test
Previously incorrectly scanned buildscript block of script
2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
669b6d164c Build: Use cache redirector for buildscript block of :kotlin-reflect 2019-08-22 20:39:28 +03:00
Alexander Udalov
d59f2bcc80 Fix KotlinReflectionInternalError on invoking callBy with defaults in supertypes
There are two parts in this change:

1) Previously, we looked up $default methods with the incorrect
   signature in supertypes. For example in defaultInSuperClass.kt, we'd
   try to find a method foo$default with the signature `(B, String,
   String, int, Object)` in the class A. Now we're modifying the array
   of parameter types on each step if we're looking for a static
   $default method, by assigning its first element to be the containing
   class. This fixes cases when defaults come from a superclass.
2) For interfaces, $default methods are actually located in the
   corresponding DefaultImpls class. Now we look up that class and
   search for the $default method there. Note that this is needed
   because of KT-33430. This fixes cases when defaults come from a
   superinterface.

 #KT-13936 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov
cb2e68fece JVM IR: skip temporary variables in InventNamesForLocalClasses 2019-08-22 18:04:00 +02:00
Alexander Udalov
312205f376 Prohibit synchronized methods on interface members
#KT-9310 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov
815ff3c860 JVM IR: don't generate ACC_FINAL on DefaultImpls methods
To replicate behavior of old backend
2019-08-22 18:04:00 +02:00
Mikhail Glukhikh
6f785ec881 FIR2IR: fix library annotation call generation 2019-08-22 18:55:10 +03:00
Mikhail Glukhikh
27ccff12c1 FIR: add resolve for delegated super-type
This commit fixes FIR modularized resolve test on whole Kotlin project
(without it we had empty super-type set with delegated super-types)
2019-08-22 18:53:15 +03:00
Igor Yakovlev
a9bc3c19d6 Fix invalid generated Move tests 2019-08-22 17:53:28 +03:00
Ilmir Usmanov
f9506db20a Ignore sources which are not LOADs in refinedIntTypeAnalysis
#KT-33414 Fixed
2019-08-22 16:08:08 +03:00
Dmitriy Novozhilov
4697822b5a [FIR] Fix setting return type for when and try with non applicable candidates 2019-08-22 16:02:56 +03:00
Svyatoslav Kuzmich
6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich
812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00
Svyatoslav Kuzmich
1891fa1bf1 [JS IR BE] Commonize JS lowerings 2019-08-22 15:59:41 +03:00
Ivan Gavrilovic
7bc739359b Use JDK_8 when stopping Gradle daemons with version below 5.0
Gradle started supporting running on JDK11 only with Gradle 5.0.
This commit sets JAVA_HOME to JDK8 whenever stopping daemon with
version below 5.0
2019-08-22 15:47:45 +03:00
Ivan Gavrilovic
d13e26d67e Add a check that processors from KAPT classpath are not run
This commit adds check that javaslang.match.PatternsProcessor,
which is in kotlin-compiler-embeddable jar, is not run when using
JDK9+.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic
27a9aa5e2b KT-33056: Fix how parent class loader for KAPT processors is found
When instantiating annotation processors, the class loader where they
are defined needs to have the correct parent class loader set up. In
order to find the parent class loader, we need to find the most specific
class loader that contains javac compiler classes (and does not contain
e.g. KAPT classes). This commit changes how that search is done, and it
simply returns the class loader in which the com.sun.tools.javac.util.Context
is defined, as the is the class we need on the annotation processor
classpath.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic
f3acd8d10c KT-33028, KT-33050: Fix how kapt invokes javac on JDK 9+
This commit fixes KT-33028 by not setting empty boot classpath when
running on JDK9+. When compiling with -source 8 and below, this allows
classes from java.base module to be available in the boot classpath.

This commit also fixes KT-33050 by passing the source level of Java compile
task in the KAPT javac options. This is important as some annotation processors
are using ProcessingEnvironment.getSourceVersion() in order to decide what
code to generate.

Test: Kapt3IT test added for worker and non-worker invocations
2019-08-22 15:45:40 +03:00
Dmitriy Novozhilov
5846db4eab [FIR] Add symbol to FirFunction and all it's inheritors 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
e3e1f3c2aa [FIR] Fix transforming value parameters of anonymous functions 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
d841090866 [FIR] Don't analyze properties with implicit types twice
Test `cast.kt` now don't work absolutely correct and implicit type of
  value parameter in lambda is't replaced with error type, but it's
  minor bug
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
f1e56c4b3e [FIR] Force resolving all declaration while resolving of body with implicit type 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
e374242adf [FIR] Fix propagating expected type for binary operator calls 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
ba7a137e74 [FIR] Add fir node for binary && and || 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
908b6ade1d [FIR] Fix incorrect do-while loop transforming order and IR generating 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
42f171a8d2 [IR] Minor. Extract irBuiltins from IrGeneratorContext to separate interface
It's necessary to using some util functions on IrGeneratorContext in IrToFir
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
b274c7567e [FIR] Minor. Add transformResult to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
a022f85776 [FIR] Minor. Add @BaseTransformedType to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
f877fe40b3 [FIR] Fix expected type in invoke completion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
57a2665b00 [FIR] Update tests for previous commit 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e48959350c [FIR] Infer type of when expressions and try expressions like it is function call 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
741ff958e8 [FIR] Add util function for extracting return arguments from block 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
fe3824d796 [FIR] Introduce FirResolvable
FirResolvable is an interface representates fir node wit calleeReference
It will be useful for infer `try` and `when` expressions as function call
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
beeba23cf0 [FIR] Minor. Wrap withScopeCleanup with try-finally 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e944119f71 [FIR] Don't use implicit type as expected type of anonymous function 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
7861396246 [FIR] Add util function for creating functional cone type 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
637fb55a7b [FIR] Add implementation of intersection types to Fir type system 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
1708a34eb8 [FIR] Fix incorrect findCommonIntegerLiteralTypesSuperType dummy implementation 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
3e44bc805f [FIR] Return error type from common super type if it present 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
6e2958880b [FIR] Add forgotten replacing arguments in abbreviated type expansion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
317e3edba8 [FIR] Add default upper bound to type parameter in fir deserializer 2019-08-22 10:55:07 +03:00
Ilya Chernikov
2fe01f9086 Refactor publishing plugin to lazy tasks API 2019-08-21 20:20:09 +02:00
Ilya Chernikov
315a9d66a0 Refactor more tasks to lazy API 2019-08-21 20:20:08 +02:00
Ilya Chernikov
2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Ilya Chernikov
0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Ilya Chernikov
f74c4fa538 Switch all common tasks in the root build script to lazy creation 2019-08-21 20:17:53 +02:00
Ilya Chernikov
5208318f34 Fix dependency resolution during gradle project configuration 2019-08-21 20:17:53 +02:00
Sergey Igushkin
50e758cbb7 Remove the @Inclubating annotation from UnstableApiUsage inspection
Also remove `@Suppress("UnstableApiUsage)"` where it was relevant
2019-08-21 19:42:34 +03:00
Sergey Igushkin
ffd0b438da Don't create the Kapt generate stubs output dir in lazy initializer
Creating a directory in the property getter interferes with Gradle cache
 outputs snapshotting, resulting in build cache being disabled for the
 task with the following info message:

 Caching disabled for task ':app:kaptGenerateStubsKotlin': Gradle does
 not know how file 'build/tmp/kapt3/incrementalData/main' was created
 (output property 'destinationDir'). Task output caching requires exclusive
 access to output paths to guarantee correctness.

 As Gradle automatically creates any @OutputDirectory, we don't need
 to create it at the task initialization phase.
2019-08-21 19:42:34 +03:00
Sergey Igushkin
cbb8bf2deb Extract members from Kotlin tasks, don't iterate over them (KT-31713)
Refactor: move some properties from the Kotlin tasks to the
new task data model, so they can be accessed without forcing the
tasks to instantiate.

Don't iterate over Kotlin tasks of all projects in the IC-related code;
instead, inspect the model.

Issue #KT-31713 Fixed
2019-08-21 19:42:34 +03:00
Mikhail Zarechenskiy
80fa591f10 Fix failing test because of slightly different diagnostics for LV=1.2
There are no `DEBUG_INFO_MISSING_UNRESOLVED` diagnostics for this test
 if one runs it under LV=1.2. These diagnostics are not crucial
 for the test (especially for version 1.2), so use it only with
 the latest stable version

 Plus, reuse test-data to check behavior in new inference
2019-08-21 18:41:13 +03:00
Alexander Udalov
5e3a11db8e JVM IR: remove property accessor name hack in InterfaceDelegationLowering
#KT-28434 Fixed
2019-08-21 15:14:04 +02:00
Alexander Udalov
14a6a06166 JVM IR: do not use GenerationState.typeMapper
The only remaining usages are in IrTypeMapper, MethodSignatureMapper and
in InterfaceDelegationLowering.generateDelegationToDefaultImpl
2019-08-21 15:14:03 +02:00
Alexander Udalov
f64afbf152 JVM IR: reduce usages of IrTypeMapper.kotlinTypeMapper 2019-08-21 15:13:49 +02:00
Alexander Udalov
0c6ab69b52 JVM IR: do not use descriptors in IrTypeMapper.writeFormalTypeParameters 2019-08-21 15:13:49 +02:00
Alexander Udalov
598c6009f2 JVM IR: extract method signature mapping to MethodSignatureMapper 2019-08-21 15:13:47 +02:00
Alexander Udalov
6191fc10f0 JVM IR: introduce IrCallableMethod as a simpler replacement for CallableMethod 2019-08-21 15:10:57 +02:00
Vladimir Dolzhenko
6969717201 Fix performanceTests compilation errors 2019-08-21 10:17:24 +02:00
Burak Eregar
d1cbee44f1 Move refactoring: suggest file name starting with an uppercase letter
Fixed #KT-30342
2019-08-21 00:58:59 +03:00
Ilya Chernikov
8219d9853c Implement configuration for describing only published runtime dependencies...
and fix runtime dependencies for published scripting artifacts
2019-08-20 21:17:56 +02:00
Vladimir Dolzhenko
3d3e86b5fa Added gradle.kts and annotator gradle.kts autocompletion performance benchmark 2019-08-20 15:25:50 +02:00
Alexander Udalov
7c4ed9c29e JVM IR: remove unused code, minor cleanup 2019-08-20 14:16:30 +02:00
Dmitry Gridin
23e79bb32b ScriptDefinitionsManager: safeGetDefinitions shouldn't catch ControlFlowException
#EA-210332 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
ef4bac1b46 REPL: fix IllegalArgumentException
Reproduce: select `Pause Output`
#EA-209571 Fixed
#EA-210364 Fixed
#KT-33329 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
f81fb40164 HistoryUpdater: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
df438377e8 ReplOutputProcessor: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
ab4001a698 KotlinCopyPasteReferenceProcessor: fix KNPE
#EA-210304 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
693f42f33e KotlinCopyPasteReferenceProcessor: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
bd5476082b extractionModel: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
fcff9a43b4 extractionModel: fix NPE
#EA-210243 Fixed
2019-08-20 17:08:46 +07:00
Dmitry Gridin
f87e86d4b3 CallableBuilder: fix exception
#EA-134361 Fixed
2019-08-20 17:08:46 +07:00
Dmitry Gridin
76b97c3847 CallableBuilder: cleanup code 2019-08-20 17:08:46 +07:00
Dmitry Gridin
2b90735990 generateUtil: fix PIEAE
#EA-209598 Fixed
#EA-142347 Fixed
2019-08-20 17:08:41 +07:00
Dmitry Gridin
b570f99aae generateUtil: cleanup code 2019-08-20 17:04:00 +07:00
Dmitry Gridin
cf3b92d80e CreateTypeParameterFromUsageFix: fix KNPE for type alias
#KT-33302 Fixed
#EA-120181 Fixed
2019-08-20 17:04:00 +07:00
Dmitry Gridin
932765744a CreateTypeParameterFromUsageFix: cleanup code 2019-08-20 17:03:59 +07:00
Igor Chevdar
8d2ccb7bcd [IR] Taught inliner to work with inline suspend lambdas 2019-08-20 12:52:54 +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
Toshiaki Kameyama
399db0d3c7 Move statement: fix comma placement for argument/parameter
#KT-14756 Fixed
2019-07-18 18:44:40 +09:00
27918 changed files with 822324 additions and 345262 deletions

11
.bunch
View File

@@ -1,8 +1,7 @@
191
193
201
192
183
182_183
as33_182_183
as34_183
as35
191_192
as35_191_192
as36_192
as40

9
.gitignore vendored
View File

@@ -1,8 +1,9 @@
.DS_Store
.idea/shelf
/android.tests.dependencies
/confluence/target
/dependencies/repo
/android.tests.dependencies
/dependencies/android.tests.dependencies
/dist
/local
/gh-pages
@@ -17,6 +18,7 @@ workspace.xml
/jps-plugin/testData/kannotator
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
/js/js.translator/testData/out-pir/
.gradle/
build/
!**/src/**/build
@@ -26,6 +28,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
@@ -47,8 +50,10 @@ build/
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
.idea/jarRepositories.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
libraries/tools/kotlin-test-js-runner/lib/
libraries/tools/kotlin-source-map-loader/lib/
local.properties

View File

@@ -1,8 +0,0 @@
<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,6 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="4u7">
<words>
<w>bintray</w>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>

View File

@@ -1,6 +1,11 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>commonization</w>
<w>commonize</w>
<w>commonized</w>
<w>commonizer</w>
<w>commonizers</w>
<w>konan</w>
</words>
</dictionary>

7
.idea/dictionaries/sergey_igushkin.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="sergey.igushkin">
<words>
<w>klib</w>
</words>
</dictionary>
</component>

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

@@ -0,0 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="skuzmich">
<words>
<w>anyref</w>
<w>ushr</w>
<w>wasm</w>
</words>
</dictionary>
</component>

View File

@@ -6,9 +6,13 @@
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>inlined</w>
<w>kapt</w>
<w>kotlinc</w>
<w>mutators</w>
<w>parceler</w>
<w>repl</w>
<w>testdata</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>

View File

@@ -99,21 +99,8 @@
<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.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.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
<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.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
<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>
@@ -267,7 +254,7 @@
<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="sinceBuildString" value="183.3284" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -436,6 +423,21 @@
<inspection_tool class="UnnecessaryLabelOnContinueStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessaryQualifierForThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryUnboxing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnstableApiUsage" enabled="true" level="WARNING" enabled_by_default="true">
<option name="unstableApiAnnotations">
<set>
<option value="com.google.common.annotations.Beta" />
<option value="io.reactivex.annotations.Beta" />
<option value="io.reactivex.annotations.Experimental" />
<option value="org.apache.http.annotation.Beta" />
<option value="org.jetbrains.annotations.ApiStatus.Experimental" />
<option value="org.jetbrains.annotations.ApiStatus.Internal" />
<option value="org.jetbrains.annotations.ApiStatus.ScheduledForRemoval" />
<option value="rx.annotations.Beta" />
<option value="rx.annotations.Experimental" />
</set>
</option>
</inspection_tool>
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />

39
.idea/misc.xml generated
View File

@@ -12,46 +12,19 @@
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="FacetAutodetectingManager">
<autodetection-disabled>
<facet-type id="Python">
<modules>
<module name="Jet" />
</modules>
</facet-type>
</autodetection-disabled>
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="IdProvider" IDEtalkID="71A301FF1940049D6D82F12C40F1E1D5" />
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<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">
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
@@ -61,12 +34,14 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="javax.validation.constraints.NotNull" />
@@ -76,6 +51,8 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
</list>
</value>
</option>

View File

@@ -12,6 +12,7 @@
<list>
<option value=":compiler:generateTests" />
<option value=":compiler:tests-java8:generateTests" />
<option value=":compiler:tests-against-klib:generateTests" />
<option value=":js:js.tests:generateTests" />
<option value=":core:descriptors.runtime:generateTests" />
</list>

8
.idea/vcs.xml generated
View File

@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrazieCommit" enabled="true" level="TYPO" enabled_by_default="true" />
<inspection_tool class="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="IssueNavigationConfiguration">
<option name="links">
<list>

View File

@@ -1,5 +1,883 @@
# CHANGELOG
## 1.3.61
### Compiler
- [`KT-35004`](https://youtrack.jetbrains.com/issue/KT-35004) "AssertionError: Unsigned type expected" in `when` range check in extension on unsigned type
### IDE
- [`KT-34923`](https://youtrack.jetbrains.com/issue/KT-34923) [Regression] KtUltraLightMethod.hasModifierProperty("native") returns false for external Kotlin functions
### Libraries
- [`KT-21445`](https://youtrack.jetbrains.com/issue/KT-21445) W3C DOM Touch events and interfaces are incomplete / missing
### Tools. Compiler Plugins
- [`KT-34991`](https://youtrack.jetbrains.com/issue/KT-34991) kotlinx.serialization: False warning "Explicit @Serializable annotation on enum class is required when @SerialName or @SerialInfo annotations are used on its members"
### Tools. J2K
- [`KT-34987`](https://youtrack.jetbrains.com/issue/KT-34987) New J2K converter: @NotNull annotations are not removed after converting java code to kotlin
- [`KT-35074`](https://youtrack.jetbrains.com/issue/KT-35074) J2K: No auto conversion in 'for' loop with multiple init variables
## 1.3.60
### Android
- [`KT-27170`](https://youtrack.jetbrains.com/issue/KT-27170) Android lint tasks fails in Gradle with MPP dependency
### Compiler
#### New Features
- [`KT-31230`](https://youtrack.jetbrains.com/issue/KT-31230) Refine rules for allowed Array-based class literals on different platforms: allow `Array::class` everywhere, disallow `Array<...>::class` on non-JVM
- [`KT-33413`](https://youtrack.jetbrains.com/issue/KT-33413) Allow 'break' and 'continue' in 'when' statement to point to innermost surrounding loop
#### Performance Improvements
- [`KT-14513`](https://youtrack.jetbrains.com/issue/KT-14513) Suboptimal compilation of lazy delegated properties with inline getValue
- [`KT-28507`](https://youtrack.jetbrains.com/issue/KT-28507) Extra InlineMarker.mark invocation in generated suspending function bytecode
- [`KT-29229`](https://youtrack.jetbrains.com/issue/KT-29229) Intrinsify 'in' operator for unsigned integer ranges
#### Fixes
- [`KT-7354`](https://youtrack.jetbrains.com/issue/KT-7354) Confusing error message when trying to access package local java class
- [`KT-9310`](https://youtrack.jetbrains.com/issue/KT-9310) Don't make interface and DefaultImpls methods synchronized
- [`KT-11430`](https://youtrack.jetbrains.com/issue/KT-11430) Improve diagnostics for dangling lambdas
- [`KT-16526`](https://youtrack.jetbrains.com/issue/KT-16526) Provide better error explanation when one tries to delegate var to read-only delegate
- [`KT-20258`](https://youtrack.jetbrains.com/issue/KT-20258) Improve annotation rendering in diagnostic messages
- [`KT-22275`](https://youtrack.jetbrains.com/issue/KT-22275) Unify exceptions from null checks
- [`KT-27503`](https://youtrack.jetbrains.com/issue/KT-27503) Private functions uses from inside of suspendCoroutine go though accessor
- [`KT-28938`](https://youtrack.jetbrains.com/issue/KT-28938) Coroutines tail-call optimization does not work for generic returns that had instantiated to Unit
- [`KT-29385`](https://youtrack.jetbrains.com/issue/KT-29385) "AnalyzerException: Expected an object reference, but found I" for EXACTLY_ONCE non-inline contract with captured class constructor parameter
- [`KT-29510`](https://youtrack.jetbrains.com/issue/KT-29510) "RuntimeException: Trying to access skipped parameter" with EXACTLY_ONCE contract and nested call of crossinline lambda
- [`KT-29614`](https://youtrack.jetbrains.com/issue/KT-29614) java.lang.VerifyError: Bad type on operand stack - in inlining, crossinline in constructor with EXACTLY_ONCE contract
- [`KT-30275`](https://youtrack.jetbrains.com/issue/KT-30275) Get rid of session in FirElement
- [`KT-30744`](https://youtrack.jetbrains.com/issue/KT-30744) Invoking Interface Static Method from Extension method generates incorrect jvm bytecode
- [`KT-30785`](https://youtrack.jetbrains.com/issue/KT-30785) Equality comparison of inline classes results in boxing
- [`KT-32217`](https://youtrack.jetbrains.com/issue/KT-32217) FIR: support delegated properties resolve
- [`KT-32433`](https://youtrack.jetbrains.com/issue/KT-32433) NI: UninferredParameterTypeConstructor with class property
- [`KT-32587`](https://youtrack.jetbrains.com/issue/KT-32587) NI: Type mismatch "String" vs "String" in IDE on generic .invoke on generic delegated property
- [`KT-32689`](https://youtrack.jetbrains.com/issue/KT-32689) Shuffled line numbers in suspend functions with elvis operator
- [`KT-32851`](https://youtrack.jetbrains.com/issue/KT-32851) Constraint for callable reference argument doesn't take into account use-site variance
- [`KT-32864`](https://youtrack.jetbrains.com/issue/KT-32864) The line number of assertFailsWith in suspending function is lost
- [`KT-33125`](https://youtrack.jetbrains.com/issue/KT-33125) NI: "Rewrite at slice INDEXED_LVALUE_SET" with Mutable Map set index operator inside "@kotlin.BuilderInference" block
- [`KT-33414`](https://youtrack.jetbrains.com/issue/KT-33414) 'java.lang.AssertionError: int type expected, but null was found in basic frames' in kotlin-io while building library train
- [`KT-33421`](https://youtrack.jetbrains.com/issue/KT-33421) Please make NOTHING_TO_INLINE warning shorter
- [`KT-33504`](https://youtrack.jetbrains.com/issue/KT-33504) EA-209823 - ISE: ProjectResolutionFacade$computeModuleResolverProvider$resolverForProject$$.invoke: Can't find builtIns by key CacheKeyBySdk
- [`KT-33572`](https://youtrack.jetbrains.com/issue/KT-33572) Scripting import with implicit receiver doesn't work
- [`KT-33821`](https://youtrack.jetbrains.com/issue/KT-33821) Compiler should not rely on the default locale when generating boxing for suspend functions
- [`KT-18541`](https://youtrack.jetbrains.com/issue/KT-18541) Prohibit "tailrec" modifier on open functions
- [`KT-19844`](https://youtrack.jetbrains.com/issue/KT-19844) Do not render type annotations on symbols rendered in diagnostic messages
- [`KT-24913`](https://youtrack.jetbrains.com/issue/KT-24913) KotlinFrontEndException with local class in init of generic class
- [`KT-28940`](https://youtrack.jetbrains.com/issue/KT-28940) Concurrency issue for lazy values with the post-computation phase
- [`KT-31540`](https://youtrack.jetbrains.com/issue/KT-31540) Change initialization order of default values for tail recursive optimized functions
### Docs & Examples
- [`KT-26212`](https://youtrack.jetbrains.com/issue/KT-26212) Update docs to explicitly mention that union is opposite of intersect
- [`KT-34086`](https://youtrack.jetbrains.com/issue/KT-34086) Website, stdlib api docs: unresolved link jvm/stdlib/kotlin.text/-charsets/Charset
### IDE
#### Fixes
- [`KT-8581`](https://youtrack.jetbrains.com/issue/KT-8581) 'Move Statement' doesn't work for statement finished by semicolon
- [`KT-9204`](https://youtrack.jetbrains.com/issue/KT-9204) Shorten references and some other IDE features have problem when package name clash with class name
- [`KT-17993`](https://youtrack.jetbrains.com/issue/KT-17993) Annotations are colored the same as language keywords
- [`KT-21037`](https://youtrack.jetbrains.com/issue/KT-21037) LazyLightClassMemberMatchingError$WrongMatch “Matched :BAR MemberIndex(index=0) to :BAR MemberIndex(index=1) in KtLightClassImpl” after duplicating values inside enum class
- [`KT-23305`](https://youtrack.jetbrains.com/issue/KT-23305) We should be able to see platform-specific errors in common module
- [`KT-23461`](https://youtrack.jetbrains.com/issue/KT-23461) `Move statement up/down` attaches a comment block to the function being moved
- [`KT-26960`](https://youtrack.jetbrains.com/issue/KT-26960) IDE doesn't report `actual` without `expect` placed into a custom platform-agnostic source set
- [`KT-27243`](https://youtrack.jetbrains.com/issue/KT-27243) LazyLightClassMemberMatchingError when overriding hidden member
- [`KT-28404`](https://youtrack.jetbrains.com/issue/KT-28404) Gradle configuration page is missing from a New Project Wizard creation flow for multiplatform templates
- [`KT-30824`](https://youtrack.jetbrains.com/issue/KT-30824) No highlighting of declaration/usage of function with functional-type (lambda) parameter on its usage
- [`KT-31117`](https://youtrack.jetbrains.com/issue/KT-31117) AssertionError at `CompletionBindingContextProvider._getBindingContext` when typing any character within string with injected Kotlin
- [`KT-31139`](https://youtrack.jetbrains.com/issue/KT-31139) "Override members" on enum inserts semicolon before enum body
- [`KT-31810`](https://youtrack.jetbrains.com/issue/KT-31810) Paste inside indented `.trimIndent()` raw string doesn't respect indentation
- [`KT-32401`](https://youtrack.jetbrains.com/issue/KT-32401) Exceptions while running IDEA in headless mode for building searchable options
- [`KT-32543`](https://youtrack.jetbrains.com/issue/KT-32543) UltraLight support for Kotlin collections.
- [`KT-32544`](https://youtrack.jetbrains.com/issue/KT-32544) Support UltraLight classes for local/anonymous/enum classes
- [`KT-32799`](https://youtrack.jetbrains.com/issue/KT-32799) 2019.2 RC (192.5728.74) Kotlin plugin exception during build searchable options (Directory index may not be queried for default project)
- [`KT-33008`](https://youtrack.jetbrains.com/issue/KT-33008) IDEA does not report in MPP: Upper bound of a type parameter cannot be an array
- [`KT-33316`](https://youtrack.jetbrains.com/issue/KT-33316) Kotlin Facet: make sure the order of allPlatforms value is fixed
- [`KT-33561`](https://youtrack.jetbrains.com/issue/KT-33561) LazyLightClassMemberMatchingError when overloading synthetic member
- [`KT-33584`](https://youtrack.jetbrains.com/issue/KT-33584) Make kotlin light classes return no-arg constructor when no-arg (or jpa) compiler plugin is enabled
- [`KT-33775`](https://youtrack.jetbrains.com/issue/KT-33775) please remove usages of org.intellij.plugins.intelliLang.inject.InjectorUtils#putInjectedFileUserData(com.intellij.lang.injection.MultiHostRegistrar, com.intellij.openapi.util.Key<T>, T) deprecated eons ago
- [`KT-33813`](https://youtrack.jetbrains.com/issue/KT-33813) Poor formatting of 'Selected target platforms' and 'Depends on' in facet settings
- [`KT-33937`](https://youtrack.jetbrains.com/issue/KT-33937) delay() completion from kotlinx.coroutines causes happening of root package in code
- [`KT-33973`](https://youtrack.jetbrains.com/issue/KT-33973) Kotlin objects could abuse idea plugin functionality
- [`KT-34000`](https://youtrack.jetbrains.com/issue/KT-34000) Import quickfix does not work for extension methods from objects
- [`KT-34070`](https://youtrack.jetbrains.com/issue/KT-34070) "No target platforms selected" message for commonTest facet at mobile shared library project
- [`KT-34191`](https://youtrack.jetbrains.com/issue/KT-34191) Since-build .. until-build compatibility ranges are the same for 192 and 193 IDE plugins
- [`KT-21153`](https://youtrack.jetbrains.com/issue/KT-21153) IDE: string template + annotation usage: ISE: "Couldn't get delegate" at LightClassDataHolderKt.findDelegate()
- [`KT-33352`](https://youtrack.jetbrains.com/issue/KT-33352) "KotlinExceptionWithAttachments: Couldn't get delegate for class" on nested class/object
- [`KT-34042`](https://youtrack.jetbrains.com/issue/KT-34042) "Error loading Kotlin facets. Kotlin facets are not allowed in Kotlin/Native Module" in 192 IDEA
- [`KT-34237`](https://youtrack.jetbrains.com/issue/KT-34237) MPP with Android target: `common*` source sets are not shown as source roots in IDE
- [`KT-33626`](https://youtrack.jetbrains.com/issue/KT-33626) Deadlock with Kotlin LockBasedStorageManager in IDEA commit dialog
- [`KT-34402`](https://youtrack.jetbrains.com/issue/KT-34402) Unresolved reference to Kotlin.test library in CommonTest in Multiplatform project without JVM target
- [`KT-34639`](https://youtrack.jetbrains.com/issue/KT-34639) Multiplatform project with the only (Android) target is incorrectly imported into IDE
### IDE. Completion
- [`KT-10340`](https://youtrack.jetbrains.com/issue/KT-10340) Import completion unable to shorten fq-names when there is a conflict between package name and local identifier
- [`KT-17689`](https://youtrack.jetbrains.com/issue/KT-17689) Code completion for enum typealias doesn't show members
- [`KT-28998`](https://youtrack.jetbrains.com/issue/KT-28998) Slow completion for build.gradle.kts (Kotlin Gradle DSL script)
- [`KT-30996`](https://youtrack.jetbrains.com/issue/KT-30996) DSL extension methods which are not applicable are offered for completion
- [`KT-31902`](https://youtrack.jetbrains.com/issue/KT-31902) Fully qualified name is used for `delay` instead of import and just method name
- [`KT-33903`](https://youtrack.jetbrains.com/issue/KT-33903) Duplicating completion for imported extensions from companion objects
### IDE. Debugger
- [`KT-10984`](https://youtrack.jetbrains.com/issue/KT-10984) Disallow placing line breakpoints without executable code (changed)
- [`KT-22116`](https://youtrack.jetbrains.com/issue/KT-22116) Support function breakpoints
- [`KT-24408`](https://youtrack.jetbrains.com/issue/KT-24408) @InlineOnly: Misleading status for breakpoints in inline functions
- [`KT-27645`](https://youtrack.jetbrains.com/issue/KT-27645) Debugger breakpoints do not work in suspend function executed in SpringBoot controller (MVC and WebFlux)
- [`KT-32687`](https://youtrack.jetbrains.com/issue/KT-32687) Disallow breakpoints for @InlineOnly function bodies
- [`KT-32813`](https://youtrack.jetbrains.com/issue/KT-32813) Exception on invoking "Smart Step Into"
- [`KT-32830`](https://youtrack.jetbrains.com/issue/KT-32830) NPE on changing class property in Evaluate Expression window
- [`KT-33064`](https://youtrack.jetbrains.com/issue/KT-33064) “Read access is allowed from event dispatch thread or inside read-action only” from KotlinLineBreakpointType.createLineSourcePosition on adding new line before the current one while stopping on breakpoint
- [`KT-11395`](https://youtrack.jetbrains.com/issue/KT-11395) Breakpoint inside lambda argument of InlineOnly function doesn't work
### IDE. Folding
- [`KT-6314`](https://youtrack.jetbrains.com/issue/KT-6314) Folding of "when" construction
### IDE. Gradle
- [`KT-33038`](https://youtrack.jetbrains.com/issue/KT-33038) Package prefix is not imported in non-MPP project
- [`KT-33987`](https://youtrack.jetbrains.com/issue/KT-33987) Serialization exception during importing Kotlin project in IDEA 192
- [`KT-32960`](https://youtrack.jetbrains.com/issue/KT-32960) KotlinMPPGradleModelBuilder takes a long time to process when syncing non-MPP project with IDE
- [`KT-34424`](https://youtrack.jetbrains.com/issue/KT-34424) With Kotlin plugin in Gradle project without Native the IDE fails to start Gradle task: "Kotlin/Native properties file is absent at null/konan/konan.properties"
- [`KT-34256`](https://youtrack.jetbrains.com/issue/KT-34256) Fail to use multiplatform modules with dependsOn with android plugin
- [`KT-34663`](https://youtrack.jetbrains.com/issue/KT-34663) Low performance of MPP 1.2 during import with module-per-source-set enabled
### IDE. Gradle. Script
- [`KT-31766`](https://youtrack.jetbrains.com/issue/KT-31766) Gradle Kotlin DSL new project template: use type-safe model accessors
- [`KT-34463`](https://youtrack.jetbrains.com/issue/KT-34463) New Gradle-based project template misses pluginManagement{} block in EAP branch
- [`KT-31767`](https://youtrack.jetbrains.com/issue/KT-31767) Gradle Kotlin DSL new project template: use settings.gradle.kts
### IDE. Inspections and Intentions
#### New Features
- [`KT-26431`](https://youtrack.jetbrains.com/issue/KT-26431) Quickfix to remove redundant label
- [`KT-28049`](https://youtrack.jetbrains.com/issue/KT-28049) Suggest import quickfix for operator extension functions
- [`KT-29622`](https://youtrack.jetbrains.com/issue/KT-29622) "Move to separate file" intention should also work for sealed class
- [`KT-33178`](https://youtrack.jetbrains.com/issue/KT-33178) Use a new compiler flag -Xinline-classes during enabling the feature via IDEA intention
- [`KT-33586`](https://youtrack.jetbrains.com/issue/KT-33586) "Constructors are not allowed for objects" diagnostic needs quickfix to change object to class
#### Fixes
- [`KT-12291`](https://youtrack.jetbrains.com/issue/KT-12291) Override/Implement Members: better member positioning inside the class
- [`KT-14899`](https://youtrack.jetbrains.com/issue/KT-14899) Quickfix "Create member function" inserts too many semicolons when applied to Enum
- [`KT-15700`](https://youtrack.jetbrains.com/issue/KT-15700) "Convert lambda to reference" does not work with backtick-escaped references
- [`KT-18772`](https://youtrack.jetbrains.com/issue/KT-18772) "Introduce subject to when": don't choose an object or a constant as the subject
- [`KT-21172`](https://youtrack.jetbrains.com/issue/KT-21172) Join declaration and assignment should place the result at the assignment, not at declaration
- [`KT-25697`](https://youtrack.jetbrains.com/issue/KT-25697) `Replace with dot call` quickfix breaks formatting
- [`KT-26635`](https://youtrack.jetbrains.com/issue/KT-26635) An empty line is added after `actual` modifier on "Create actual annotation class..." quick fix applied to annotation if it is annotated with comment
- [`KT-27270`](https://youtrack.jetbrains.com/issue/KT-27270) "Add jar to classpath" quick fix modifies build.gradle of MPP project in a way that fails to be imported
- [`KT-28471`](https://youtrack.jetbrains.com/issue/KT-28471) "Add initializer" quickfix initializes non-null variable with null
- [`KT-28538`](https://youtrack.jetbrains.com/issue/KT-28538) `create expected ...` quick fix illegally creates `expect` member with a usage of a platform-specific type
- [`KT-28549`](https://youtrack.jetbrains.com/issue/KT-28549) Create actual/expect quick fix for class/object doesn't add import for an inherited member
- [`KT-28620`](https://youtrack.jetbrains.com/issue/KT-28620) `Create expect/actual ...` quick fix could save @Test annotation on generation
- [`KT-28740`](https://youtrack.jetbrains.com/issue/KT-28740) AE “2 declarations in var bar: [ERROR : No type, no body]” after applying “Create actual class” quick fix for class with property which has not specified type
- [`KT-28947`](https://youtrack.jetbrains.com/issue/KT-28947) Backing field has created after applying “Create expected class in common module...” intention
- [`KT-30136`](https://youtrack.jetbrains.com/issue/KT-30136) False negative "Redundant explicit 'this'" with local variable
- [`KT-30794`](https://youtrack.jetbrains.com/issue/KT-30794) Quickfix for unchecked cast produces invalid code
- [`KT-31133`](https://youtrack.jetbrains.com/issue/KT-31133) Liveness analysis on enum does not take into account calls to 'values'
- [`KT-31433`](https://youtrack.jetbrains.com/issue/KT-31433) Incorrect "Create expected class..." for class with supertype
- [`KT-31475`](https://youtrack.jetbrains.com/issue/KT-31475) "Create expect..." should delete 'override' modifier
- [`KT-31587`](https://youtrack.jetbrains.com/issue/KT-31587) Redundant `private` modifier before primary constructor after create `actual` class
- [`KT-31921`](https://youtrack.jetbrains.com/issue/KT-31921) "Create expected ..."/"Create actual..." quick fix: `val` and `vararg` modifiers are misordered in the generated `expect`/`actual` declaration
- [`KT-31999`](https://youtrack.jetbrains.com/issue/KT-31999) "Variable declaration could be moved into `when`" inspection suggests to inline expression containing return (throw) statement
- [`KT-32012`](https://youtrack.jetbrains.com/issue/KT-32012) Change parameter type quick fix: Don't use qualified name
- [`KT-32468`](https://youtrack.jetbrains.com/issue/KT-32468) False positive SimplifiableCall "filter call could be simplified to filterIsInstance" with expression body function and explicit return type
- [`KT-32479`](https://youtrack.jetbrains.com/issue/KT-32479) False positive "Redundant overriding method" with derived property and base function starting with `get`, `set` or `is` (Accidental override)
- [`KT-32571`](https://youtrack.jetbrains.com/issue/KT-32571) "Create expect" quick fix incorrectly treats multiplatform stdlib typealiased types as platform-specific ones
- [`KT-32580`](https://youtrack.jetbrains.com/issue/KT-32580) "Remove braces" QF for single-expression function with inferred lambda return type: "ClassCastException: class kotlin.reflect.jvm.internal.KClassImpl cannot be cast to class kotlin.jvm.internal.ClassBasedDeclarationContainer"
- [`KT-32582`](https://youtrack.jetbrains.com/issue/KT-32582) Ambiguous message for [AMBIGUOUS_ACTUALS] error (master)
- [`KT-32586`](https://youtrack.jetbrains.com/issue/KT-32586) "Make member open" quick fix doesn't update all the related actualisations of an expected member
- [`KT-32616`](https://youtrack.jetbrains.com/issue/KT-32616) "To ordinary string literal" doesn't remove indents, newlines and `trimIndent`
- [`KT-32642`](https://youtrack.jetbrains.com/issue/KT-32642) "Create expect" quick fix doesn't warn about a platform-specific annotation applied to the generated member
- [`KT-32650`](https://youtrack.jetbrains.com/issue/KT-32650) "Replace 'if' with 'when'" removes braces from 'if' statement
- [`KT-32694`](https://youtrack.jetbrains.com/issue/KT-32694) "Create expect"/"create actual" quick fix doesn't transfer use-site annotations
- [`KT-32737`](https://youtrack.jetbrains.com/issue/KT-32737) "Create expect" quick fix adds `actual` modifier to an interface function with default implementation without a warning
- [`KT-32768`](https://youtrack.jetbrains.com/issue/KT-32768) "Create expect" quick fix doesn't warn about a local supertype of an `actual` class while generating an expected declaration
- [`KT-32829`](https://youtrack.jetbrains.com/issue/KT-32829) "Add .jar to the classpath" quick fix creates "compile"/"testCompile" dependencies in build.gradle
- [`KT-32972`](https://youtrack.jetbrains.com/issue/KT-32972) No "remove braces" inspection for ${this}
- [`KT-32981`](https://youtrack.jetbrains.com/issue/KT-32981) "Create enum constant" quick fix adds redundant empty line
- [`KT-33060`](https://youtrack.jetbrains.com/issue/KT-33060) "Cleanup code" does not remove 'final' keyword for overridden function with non-canonical modifiers order
- [`KT-33115`](https://youtrack.jetbrains.com/issue/KT-33115) "Replace overloaded operator with function call" intention should not be shown on incomplete expressions
- [`KT-33150`](https://youtrack.jetbrains.com/issue/KT-33150) Don't suggest create expect function from function with `private` modifier
- [`KT-33153`](https://youtrack.jetbrains.com/issue/KT-33153) False positive "Redundant overriding method" when overriding package private method
- [`KT-33204`](https://youtrack.jetbrains.com/issue/KT-33204) False positive "flatMap call could be simplified to flatten()" with Array
- [`KT-33299`](https://youtrack.jetbrains.com/issue/KT-33299) "Create type parameter from usage" should work with backticks
- [`KT-33300`](https://youtrack.jetbrains.com/issue/KT-33300) "Create type parameter from usage" suggests for top level property
- [`KT-33302`](https://youtrack.jetbrains.com/issue/KT-33302) KNPE after "Create type parameter from usage" with typealias
- [`KT-33357`](https://youtrack.jetbrains.com/issue/KT-33357) 'java.lang.Throwable: Assertion failed: Refactorings should be invoked inside transaction 'exception occurs when extracting sealed class from file with the same name
- [`KT-33362`](https://youtrack.jetbrains.com/issue/KT-33362) Inspection "Extract class from current file" is not available for 'sealed' keyword
- [`KT-33437`](https://youtrack.jetbrains.com/issue/KT-33437) “Argument rangeInElement (0,1) endOffset must not exceed descriptor text range (0, 0) length (0).” on creating Kotlin Script files inside package
- [`KT-33612`](https://youtrack.jetbrains.com/issue/KT-33612) "Replace with safe call" quick fix moves code to another line
- [`KT-33660`](https://youtrack.jetbrains.com/issue/KT-33660) "Convert to anonymous object" with nested SAM interface inserts `object` keyword in the wrong place
- [`KT-33718`](https://youtrack.jetbrains.com/issue/KT-33718) "Create enum constant" quick fix adds after semicolon
- [`KT-33754`](https://youtrack.jetbrains.com/issue/KT-33754) Improve error hint message for "Create expect/actual..."
- [`KT-33880`](https://youtrack.jetbrains.com/issue/KT-33880) "Convert to range check" produces code that is subject to ReplaceRangeToWithUntil for range with exclusive upper bound
- [`KT-33930`](https://youtrack.jetbrains.com/issue/KT-33930) Don't suggest "create expect" quick fix on `lateinit` and `const` top-level properties
- [`KT-33981`](https://youtrack.jetbrains.com/issue/KT-33981) “KotlinCodeInsightWorkspaceSettings is registered as application service, but requested as project one” on opening QF menu for some fixes in IJ193
- [`KT-32965`](https://youtrack.jetbrains.com/issue/KT-32965) False positive "Redundant qualifier name" with nested enum member call
- [`KT-33597`](https://youtrack.jetbrains.com/issue/KT-33597) False positive "Redundant qualifier name" with class property initialized with same-named object property
- [`KT-33991`](https://youtrack.jetbrains.com/issue/KT-33991) False positive "Redundant qualifier name" with enum member function call
- [`KT-34113`](https://youtrack.jetbrains.com/issue/KT-34113) False positive "Redundant qualifier name" with Enum.values() from a different Enum
### IDE. KDoc
- [`KT-20777`](https://youtrack.jetbrains.com/issue/KT-20777) KDoc: Type parameters are not shown in sample code
### IDE. Multiplatform
- [`KT-26333`](https://youtrack.jetbrains.com/issue/KT-26333) IDE incorrectly requires `actual` implementations to be present in all the project source sets
- [`KT-28537`](https://youtrack.jetbrains.com/issue/KT-28537) Platform-specific type taken from a dependency module isn't reported in `common` code
- [`KT-32562`](https://youtrack.jetbrains.com/issue/KT-32562) Provide a registry key to enable/disable hierarchical multiplatform mechanism in IDE
### IDE. Navigation
- [`KT-28075`](https://youtrack.jetbrains.com/issue/KT-28075) Duplicate "implements" gutter icons on some interfaces
- [`KT-30052`](https://youtrack.jetbrains.com/issue/KT-30052) Duplicated "is subclassed" editor gutter icons
- [`KT-33182`](https://youtrack.jetbrains.com/issue/KT-33182) com.intellij.idea.IdeStarter#main has four (!) icons, should be two
### IDE. REPL
- [`KT-33329`](https://youtrack.jetbrains.com/issue/KT-33329) IllegalArgumentException in REPL
### IDE. Refactorings
- [`KT-24929`](https://youtrack.jetbrains.com/issue/KT-24929) 'Search for references' checkbox state isn't saved on move of kotlin file
- [`KT-30342`](https://youtrack.jetbrains.com/issue/KT-30342) Move refactoring: suggest file name starting with an uppercase letter
- [`KT-32426`](https://youtrack.jetbrains.com/issue/KT-32426) Invalid code format after "Pull Members Up" on function with comment and another indent
- [`KT-32496`](https://youtrack.jetbrains.com/issue/KT-32496) "Problems Detected" dialog message about conflicting declarations on moving file to another package is absolutely unreadable
- [`KT-33059`](https://youtrack.jetbrains.com/issue/KT-33059) Exception [Assertion failed: Write access is allowed inside write-action only] in case of Move class to nonexistent folder
- [`KT-33972`](https://youtrack.jetbrains.com/issue/KT-33972) Change signature should affect all hierarchy
### IDE. Run Configurations
- [`KT-34366`](https://youtrack.jetbrains.com/issue/KT-34366) Implement gutters for running tests (multi-platform projects)
### IDE. Scratch
- [`KT-23986`](https://youtrack.jetbrains.com/issue/KT-23986) No access to stdout output in Kotlin scratch
- [`KT-23989`](https://youtrack.jetbrains.com/issue/KT-23989) Scratch: allow copy of a scratch output
- [`KT-28910`](https://youtrack.jetbrains.com/issue/KT-28910) Add hint for Make before Run checkbox
- [`KT-29407`](https://youtrack.jetbrains.com/issue/KT-29407) strange output for long strings
- [`KT-31295`](https://youtrack.jetbrains.com/issue/KT-31295) Kotlin worksheet in projects, not as scratch files
- [`KT-32366`](https://youtrack.jetbrains.com/issue/KT-32366) Sidebar as alternative output layout
- [`KT-33585`](https://youtrack.jetbrains.com/issue/KT-33585) Synchronized highlighting of the main editor and side panel
### IDE. Script
- [`KT-30206`](https://youtrack.jetbrains.com/issue/KT-30206) Settings / ... / Kotlin Scripting with no project opened causes ISE: "project.baseDir must not be null" at ScriptTemplatesFromDependenciesProvider.loadScriptDefinitions()
- [`KT-32513`](https://youtrack.jetbrains.com/issue/KT-32513) Intellij hangs in ApplicationUtilsKt.runWriteAction through ScriptDependenciesLoader$submitMakeRootsChange$doNotifyRootsChanged$1.run
### IDE. Wizards
- [`KT-27587`](https://youtrack.jetbrains.com/issue/KT-27587) Bump Android build tools version at `Multiplatform (Android/iOS)` template of the New Project Wizard
- [`KT-33927`](https://youtrack.jetbrains.com/issue/KT-33927) MPP, Kotlin New project wizard: broken project generation
- [`KT-34108`](https://youtrack.jetbrains.com/issue/KT-34108) Gradle Kotlin DSL: generated project with `tasks` element fails on configuration stage with Gradle 4.10
- [`KT-34154`](https://youtrack.jetbrains.com/issue/KT-34154) New Project wizard: build.gradle.kts: type-safe code sets JVM 1.8 for main, but JVM 1.6 for test
- [`KT-34229`](https://youtrack.jetbrains.com/issue/KT-34229) New Project wizard: IDEA 193+: Mobile Android/iOS: creating another project of this type tries to write into previous one
### JavaScript
- [`KT-12935`](https://youtrack.jetbrains.com/issue/KT-12935) Generated source maps for JS mention nonexistent dummy.kt
- [`KT-26701`](https://youtrack.jetbrains.com/issue/KT-26701) JS, rollup.js: Application can't depend on a library if both sourcemaps reference "dummy.kt"
### Libraries
- [`KT-26309`](https://youtrack.jetbrains.com/issue/KT-26309) Avoid division in string-to-number conversions
- [`KT-27545`](https://youtrack.jetbrains.com/issue/KT-27545) File.copyTo: unclear error message when it fails to delete the destination
- [`KT-28804`](https://youtrack.jetbrains.com/issue/KT-28804) Wrong parameter name in kotlin.text.contentEquals
- [`KT-32024`](https://youtrack.jetbrains.com/issue/KT-32024) Modify `Iterable<T>.take(n)` implementation not to call `.next()` more than necessary
- [`KT-32532`](https://youtrack.jetbrains.com/issue/KT-32532) MutableList<T>.removeAll is lacking documentation
- [`KT-32728`](https://youtrack.jetbrains.com/issue/KT-32728) CollectionsKt.windowed throws IllegalArgumentException (Illegal Capacity: -1) when size param is Integer.MAX_VALUE due to overflow operation
- [`KT-33864`](https://youtrack.jetbrains.com/issue/KT-33864) Read from pseudo-file system is empty
### Reflection
- [`KT-13936`](https://youtrack.jetbrains.com/issue/KT-13936) KotlinReflectionInternalError on invoking callBy on overridden member with inherited default argument value
- [`KT-17860`](https://youtrack.jetbrains.com/issue/KT-17860) Improve KParameter.toString for receiver parameters
### Tools
- [`KT-17045`](https://youtrack.jetbrains.com/issue/KT-17045) Drop MaxPermSize support from compiler daemon
- [`KT-32259`](https://youtrack.jetbrains.com/issue/KT-32259) `org.jetbrains.annotations` module exported from embeddable compiler, causes problems in Java modular builds
### Tools. Android Extensions
- [`KT-32096`](https://youtrack.jetbrains.com/issue/KT-32096) IDE plugin doesn't recognize that Parcelize is no longer experimental
### Tools. CLI
- [`KT-24991`](https://youtrack.jetbrains.com/issue/KT-24991) CLI: Empty classpath in `kotlin` script except for `kotlin-runner.jar`
- [`KT-26624`](https://youtrack.jetbrains.com/issue/KT-26624) Set Thread.contextClassLoader when running programs with 'kotlin' launcher script or scripts with 'kotlinc -script'
- [`KT-24966`](https://youtrack.jetbrains.com/issue/KT-24966) Classloader problems when running basic kafka example with `kotlin` and `kotlinc`
### Tools. Compiler Plugins
- [`KT-29471`](https://youtrack.jetbrains.com/issue/KT-29471) output from jvm-api-gen plugin on classpath crashes downstream kotlinc-jvm: inline method with inner class
- [`KT-33630`](https://youtrack.jetbrains.com/issue/KT-33630) cannot use @kotlinx.serialization.Transient and lateinit together on 1.3.50
### Tools. Daemon
- [`KT-32992`](https://youtrack.jetbrains.com/issue/KT-32992) Enable assertions in Kotlin Compile Daemon
- [`KT-33027`](https://youtrack.jetbrains.com/issue/KT-33027) Compilation with daemon fails, because IncrementalModuleInfo#serialVersionUID does not match
### Tools. Gradle
#### New Features
- [`KT-20760`](https://youtrack.jetbrains.com/issue/KT-20760) Kotlin Gradle Plugin doesn't allow for configuring friend paths through API
- [`KT-34009`](https://youtrack.jetbrains.com/issue/KT-34009) Associate compilations in the targetcompilation project model
#### Performance Improvements
- [`KT-31666`](https://youtrack.jetbrains.com/issue/KT-31666) Kotlin plugin configures all tasks in a project when `kotlin.incremental` is enabled
#### Fixes
- [`KT-17630`](https://youtrack.jetbrains.com/issue/KT-17630) User test Gradle source set code cannot reach out internal members from the production code
- [`KT-22213`](https://youtrack.jetbrains.com/issue/KT-22213) Android Extensions experimental mode doesn't work with Gradle Kotlin DSL
- [`KT-31077`](https://youtrack.jetbrains.com/issue/KT-31077) android.kotlinOptions block is lacking its type
- [`KT-31641`](https://youtrack.jetbrains.com/issue/KT-31641) Kapt configurations miss attributes to resolve MPP dependencies: Cannot choose between the following variants ...
- [`KT-31713`](https://youtrack.jetbrains.com/issue/KT-31713) ConcurrentModificationException: Realize Pending during execution phase
- [`KT-32678`](https://youtrack.jetbrains.com/issue/KT-32678) Bugfixes in HMPP source set visibility
- [`KT-32679`](https://youtrack.jetbrains.com/issue/KT-32679) Testing & test tasks API in the targetcompilation model
- [`KT-32804`](https://youtrack.jetbrains.com/issue/KT-32804) Kapt-generated Java sources in jvm+withJava MPP module are not compiled and bundled
- [`KT-32853`](https://youtrack.jetbrains.com/issue/KT-32853) ConcurrentModificationException when compiling with Gradle.
- [`KT-32872`](https://youtrack.jetbrains.com/issue/KT-32872) Gradle test runner for Native does not show failed build if process quit without starting printing results.
- [`KT-33105`](https://youtrack.jetbrains.com/issue/KT-33105) kapt+withJava in multiplatform module depending on other multiplatform fails on 1.3.50-eap-54
- [`KT-33469`](https://youtrack.jetbrains.com/issue/KT-33469) Drop support for Gradle versions older than 4.3 in the Kotlin Gradle plugin
- [`KT-33470`](https://youtrack.jetbrains.com/issue/KT-33470) Drop support for Gradle versions older than 4.9 in the Kotlin Gradle plugin
- [`KT-33980`](https://youtrack.jetbrains.com/issue/KT-33980) Read the granular source sets metadata flag value once and cache it for the current Gradle build
- [`KT-34312`](https://youtrack.jetbrains.com/issue/KT-34312) UnsupportedOperationException on `requiresVisibilityOf` in the Kotlin Gradle plugin
### Tools. Gradle. JS
#### New Features
- [`KT-31478`](https://youtrack.jetbrains.com/issue/KT-31478) Gradle, JS tests, Karma: Support sourcemaps in Gradle stacktraces
- [`KT-32073`](https://youtrack.jetbrains.com/issue/KT-32073) Gradle, JS, karma: parse errors and warnings from karma output
- [`KT-32075`](https://youtrack.jetbrains.com/issue/KT-32075) Gradle, JS, karma: download chrome headless using puppeteer
#### Fixes
- [`KT-31663`](https://youtrack.jetbrains.com/issue/KT-31663) Gradle/JS: with not installed browser specified for browser test the response is "Successful, 0 tests found"
- [`KT-32216`](https://youtrack.jetbrains.com/issue/KT-32216) Gradle, JS, tests: filter doesn't work
- [`KT-32224`](https://youtrack.jetbrains.com/issue/KT-32224) In Gradle Kotlin/JS projects, the `browserWebpack` task does not rerun when the `main` compilation's outputs change
- [`KT-32281`](https://youtrack.jetbrains.com/issue/KT-32281) Gradle, JS, karma: Headless chrome output is not captured
- [`KT-33288`](https://youtrack.jetbrains.com/issue/KT-33288) JS: Incorrect bundle with webpack output.library and source maps
- [`KT-33313`](https://youtrack.jetbrains.com/issue/KT-33313) When a Kotlin/JS test task runs using a custom compilation, it doesn't track the compilation outputs in its up-to-date checks
- [`KT-33547`](https://youtrack.jetbrains.com/issue/KT-33547) Template JS Client and JVM Server works wrong on 1.3.50 Kotlin
- [`KT-33549`](https://youtrack.jetbrains.com/issue/KT-33549) Gradle Kotlin/JS external declarations: search for `typings` key inside `package.json`
- [`KT-33579`](https://youtrack.jetbrains.com/issue/KT-33579) Js tests with mocha cannot be run
- [`KT-33710`](https://youtrack.jetbrains.com/issue/KT-33710) Task "generateExternals" for automatic Dukat execution does not work
- [`KT-33716`](https://youtrack.jetbrains.com/issue/KT-33716) Gradle, Yarn: yarn is not downloading via YarnSetupTask
- [`KT-34101`](https://youtrack.jetbrains.com/issue/KT-34101) CCE class org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest_Decorated cannot be cast to class org.gradle.api.provider.Provider on importing Gradle project with JS
- [`KT-34123`](https://youtrack.jetbrains.com/issue/KT-34123) "Cannot find node module "kotlin-test-js-runner/kotlin-test-karma-runner.js"" in `JS Client and JVM Server` new project wizard template
- [`KT-32319`](https://youtrack.jetbrains.com/issue/KT-32319) Gradle, js, webpack: source-map-loader failed to load source contents from relative urls
- [`KT-33417`](https://youtrack.jetbrains.com/issue/KT-33417) NodeTest failed with error "Failed to create MD5 hash" after NodeRun is executed
- [`KT-33747`](https://youtrack.jetbrains.com/issue/KT-33747) Exception doesn't fail the test in kotlin js node runner
- [`KT-33828`](https://youtrack.jetbrains.com/issue/KT-33828) jsPackageJson task fails after changing artifact origin repository
- [`KT-34460`](https://youtrack.jetbrains.com/issue/KT-34460) NPM packages clash if declared in dependencies and devDependencies both
- [`KT-34555`](https://youtrack.jetbrains.com/issue/KT-34555) [Kotlin/JS] Unsafe webpack config merge
### Tools. Gradle. Native
- [`KT-33076`](https://youtrack.jetbrains.com/issue/KT-33076) MPP Gradle plugin: Produce final native binaries from compilation output instead of sources
- [`KT-33645`](https://youtrack.jetbrains.com/issue/KT-33645) Kotlin/Native: Compilation failure if a library passed by the -Xinclude option contains a constructor annotated with @OverrideInit
- [`KT-34259`](https://youtrack.jetbrains.com/issue/KT-34259) MPP Gradle plugin: Support fat frameworks for watchOS and tvOS
- [`KT-34329`](https://youtrack.jetbrains.com/issue/KT-34329) Support watchOS and tvOS in CocoaPods Gradle plugin
### Tools. J2K
#### New Features
- [`KT-7940`](https://youtrack.jetbrains.com/issue/KT-7940) J2K: convert Integer.MAX_VALUE to Int.MAX_VALUE
- [`KT-22412`](https://youtrack.jetbrains.com/issue/KT-22412) J2K: Intention to replace if(...) throw IAE with require
- [`KT-22680`](https://youtrack.jetbrains.com/issue/KT-22680) Request: when converting Java->Kotlin, try to avoid creating functions for constant fields (`static final`)
#### Performance Improvements
- [`KT-33725`](https://youtrack.jetbrains.com/issue/KT-33725) Java->Kotlin converter on paste performs expensive reparse in unrelated contexts
- [`KT-33854`](https://youtrack.jetbrains.com/issue/KT-33854) J2K conversion of Interface freezes UI for more than 10 seconds without progress dialog
- [`KT-33875`](https://youtrack.jetbrains.com/issue/KT-33875) [NewJ2K] InspectionLikeProcessingGroup pipeline rework: query isApplicable in parallel for all element first, apply relevant after in EDT
#### Fixes
- [`KT-19603`](https://youtrack.jetbrains.com/issue/KT-19603) A mutable container property updated from another class converts to red code
- [`KT-19607`](https://youtrack.jetbrains.com/issue/KT-19607) Static member qualified by child class converted to red code
- [`KT-20035`](https://youtrack.jetbrains.com/issue/KT-20035) Automatic conversion from Java 1.8 to Kotlin 1.1.4 using Idea 2017.2.2: null!!
- [`KT-21504`](https://youtrack.jetbrains.com/issue/KT-21504) J2K: Convert Long.parseLong(s) to s.toLong()
- [`KT-24293`](https://youtrack.jetbrains.com/issue/KT-24293) Bug: conversion of Java "List" into Kotlin doesn't produce "MutableList"
- [`KT-32253`](https://youtrack.jetbrains.com/issue/KT-32253) Converting Java class with field initialized by constructor parameter used to initialize a different field or named as a different field produces red code
- [`KT-32696`](https://youtrack.jetbrains.com/issue/KT-32696) New J2K: java List is wrongly converted when pasting it to Kotlin file
- [`KT-32903`](https://youtrack.jetbrains.com/issue/KT-32903) J2K: Static import is converted to unresolved reference
- [`KT-33235`](https://youtrack.jetbrains.com/issue/KT-33235) Remove "Replace guard clause with kotlin's function call" inspection and tranform it to J2K post-processing
- [`KT-33434`](https://youtrack.jetbrains.com/issue/KT-33434) UninitializedPropertyAccessException occurs after J2K convertion of package with custom functional interface and it's usage
- [`KT-33445`](https://youtrack.jetbrains.com/issue/KT-33445) Two definitions of org.jetbrains.kotlin.idea.j2k.J2kPostProcessing in Kotlin 1.3.50-rc
- [`KT-33500`](https://youtrack.jetbrains.com/issue/KT-33500) Unresolved reference after J2K convertion of isNaN/isFinite
- [`KT-33556`](https://youtrack.jetbrains.com/issue/KT-33556) J2K converter fails on statically imported global overloaded functions
- [`KT-33679`](https://youtrack.jetbrains.com/issue/KT-33679) Result of assignment with operation differs in kotlin after J2K conversion
- [`KT-33687`](https://youtrack.jetbrains.com/issue/KT-33687) Extra empty lines are added after comment after J2K conversion
- [`KT-33743`](https://youtrack.jetbrains.com/issue/KT-33743) Reference to static field outside its class is unresolved after J2K conversion
- [`KT-33756`](https://youtrack.jetbrains.com/issue/KT-33756) J2K: main method with varargs is converted to non-runnable main kotlin method
- [`KT-33863`](https://youtrack.jetbrains.com/issue/KT-33863) java.lang.IllegalStateException: argument must not be null exception occurs on J2K conversion of Generic class usage without type parameter
- [`KT-19355`](https://youtrack.jetbrains.com/issue/KT-19355) "Variable expected" error after J2K for increment/decrement of an object field
- [`KT-19569`](https://youtrack.jetbrains.com/issue/KT-19569) Java wrappers for primitives are converted to nullable types with nullability errors in Kotlin
- [`KT-30643`](https://youtrack.jetbrains.com/issue/KT-30643) J2K: wrong position of TYPE_USE annotation
- [`KT-32518`](https://youtrack.jetbrains.com/issue/KT-32518) Nullability information is lost after J2K convertion of constructor with null parameter
- [`KT-33941`](https://youtrack.jetbrains.com/issue/KT-33941) J2K: Overload resolution ambiguity with assertThat and `StackOverflowError` in IDEA
- [`KT-33942`](https://youtrack.jetbrains.com/issue/KT-33942) New J2K: `StackOverflowError` from `org.jetbrains.kotlin.nj2k.inference.common.BoundTypeCalculatorImpl.boundTypeUnenhanced`
- [`KT-34164`](https://youtrack.jetbrains.com/issue/KT-34164) J2K: on converting static method references in other .java sources are not corrected
- [`KT-34165`](https://youtrack.jetbrains.com/issue/KT-34165) J2K: imports are lost in conversion, references resolve to different same-named classes
- [`KT-34266`](https://youtrack.jetbrains.com/issue/KT-34266) Multiple errors after converting Java class implementing an interface from another file
### Tools. JPS
- [`KT-33808`](https://youtrack.jetbrains.com/issue/KT-33808) JPS compilation is not incremental in IDEA 2019.3
### Tools. Maven
- [`KT-34006`](https://youtrack.jetbrains.com/issue/KT-34006) Maven plugin do not consider .kts files as Kotlin sources
- [`KT-34011`](https://youtrack.jetbrains.com/issue/KT-34011) Kotlin scripting plugin is not loaded by default from kotlin maven plugin
### Tools. REPL
- [`KT-27956`](https://youtrack.jetbrains.com/issue/KT-27956) REPL/Script: extract classes and names right from ClassLoader
### Tools. Scripts
- [`KT-31661`](https://youtrack.jetbrains.com/issue/KT-31661) ClassNotFoundException in runtime for 'kotlinc -script' while compilation is fine
- [`KT-31704`](https://youtrack.jetbrains.com/issue/KT-31704) [kotlin-scripting] passing `name` to String.toScriptSource make script compilation failed
- [`KT-32234`](https://youtrack.jetbrains.com/issue/KT-32234) "Unable to derive module descriptor" when using Kotlin compiler (embeddable) in Java 9+ modular builds
- [`KT-33529`](https://youtrack.jetbrains.com/issue/KT-33529) NCDF running kotlin script from command line
- [`KT-33554`](https://youtrack.jetbrains.com/issue/KT-33554) Classpath not passed properly when evaluating standard script with `kotlinc`
- [`KT-33892`](https://youtrack.jetbrains.com/issue/KT-33892) REPL/Script: Implement mechanism for resolve top-level functions and properties from classloader
- [`KT-34294`](https://youtrack.jetbrains.com/issue/KT-34294) SamWithReceiver cannot be used with new scripting API
### Tools. kapt
- [`KT-31291`](https://youtrack.jetbrains.com/issue/KT-31291) Incremental Kapt: IllegalArgumentException from `org.jetbrains.org.objectweb.asm.ClassVisitor.<init>`
- [`KT-33028`](https://youtrack.jetbrains.com/issue/KT-33028) Kapt error "Unable to find package java.lang in classpath or bootclasspath" on JDK 11 with `-source 8`
- [`KT-33050`](https://youtrack.jetbrains.com/issue/KT-33050) kapt does not honor source/target compatibility of enclosing project
- [`KT-33052`](https://youtrack.jetbrains.com/issue/KT-33052) Kapt generates invalid java stubs for enum members with class bodies on JDK 11
- [`KT-33056`](https://youtrack.jetbrains.com/issue/KT-33056) Incremental kapt is disabled due to `javaslang.match.PatternsProcessor` processor on classpath when Worker API is enabled
- [`KT-33493`](https://youtrack.jetbrains.com/issue/KT-33493) 1.3.50, org.jetbrains.org.objectweb.asm.ClassVisitor.<init>
- [`KT-33515`](https://youtrack.jetbrains.com/issue/KT-33515) Incremental kapt fails when I remove an annotated file
- [`KT-33889`](https://youtrack.jetbrains.com/issue/KT-33889) Incremental KAPT: NoSuchMethodError: 'java.util.regex.Pattern com.sun.tools.javac.processing.JavacProcessingEnvironment.validImportStringToPattern(java.lang.String)'
- [`KT-33503`](https://youtrack.jetbrains.com/issue/KT-33503) Kapt, Spring Boot: "Could not resolve all files for configuration ':_classStructurekaptKotlin'"
- [`KT-33800`](https://youtrack.jetbrains.com/issue/KT-33800) KAPT aptMode=compile fails to compile certain legitimate code
## 1.3.50
### Compiler
- [`KT-12787`](https://youtrack.jetbrains.com/issue/KT-12787) Debugger: Generate line number at end of function (to set a breakpoint on the last line of the block)
- [`KT-23675`](https://youtrack.jetbrains.com/issue/KT-23675) "Parameter specified as non-null is null: method org.jetbrains.kotlin.codegen.FrameMapBase.getIndex, parameter descriptor" when classes are defined inside an anonymous extension function and access a field of the extension function's `this` instance
- [`KT-24596`](https://youtrack.jetbrains.com/issue/KT-24596) Refactor / Inline const property does not insert its value into usage in annotation
- [`KT-25497`](https://youtrack.jetbrains.com/issue/KT-25497) kotlinx.serialization - throws Backend Internal error exception during code generation of sealed classes
- [`KT-28927`](https://youtrack.jetbrains.com/issue/KT-28927) "IllegalStateException: Arrays of class literals are not supported yet" in AnnotationDeserializer.resolveArrayElementType
- [`KT-31070`](https://youtrack.jetbrains.com/issue/KT-31070) IndexOutOfBoundsException in Analyzer with @JvmOverloads constructor with 34+ parameters
- [`KT-31265`](https://youtrack.jetbrains.com/issue/KT-31265) FIR: experimental compiler
- [`KT-31535`](https://youtrack.jetbrains.com/issue/KT-31535) False positives from compiler warning IMPLICIT_NOTHING_AS_TYPE_PARAMETER
- [`KT-31969`](https://youtrack.jetbrains.com/issue/KT-31969) NI: false positive USELESS_ELVIS with multiple elvis calls
- [`KT-32044`](https://youtrack.jetbrains.com/issue/KT-32044) For loop over full UByte range terminates at UInt bound.
- [`KT-25432`](https://youtrack.jetbrains.com/issue/KT-25432) No smartcast on qualifier expression of captured type
- [`KT-30796`](https://youtrack.jetbrains.com/issue/KT-30796) psi2ir generates IrErrorType for elvis with generic type having nullable upper-bound when expected type is not nullable
- [`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-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-31734`](https://youtrack.jetbrains.com/issue/KT-31734) Empty parameter list required on Annotations of function types
- [`KT-32434`](https://youtrack.jetbrains.com/issue/KT-32434) New type inference fails for Caffeine Cache
- [`KT-32452`](https://youtrack.jetbrains.com/issue/KT-32452) Kotlin 1.3.40 - problem in IDE with new type inference and suspending method reference
- [`KT-32407`](https://youtrack.jetbrains.com/issue/KT-32407) NI: "use property access syntax" intention causes freezes in editor
- [`KT-33127`](https://youtrack.jetbrains.com/issue/KT-33127) Script result value is not calculated properly for the last expression
- [`KT-33157`](https://youtrack.jetbrains.com/issue/KT-33157) Inline class with generic method is considered bad class by javac
### Docs & Examples
- [`KT-16602`](https://youtrack.jetbrains.com/issue/KT-16602) Provide examples of sorting API usage
- [`KT-32353`](https://youtrack.jetbrains.com/issue/KT-32353) Document order of array elements initialization
### IDE
#### New Features
- [`KT-28098`](https://youtrack.jetbrains.com/issue/KT-28098) Insert space after automatically closed right brace of nested lambda to follow code style
#### Fixes
- [`KT-16476`](https://youtrack.jetbrains.com/issue/KT-16476) Extend selection (Select Word) doesn't select just KDoc if cursor is just before the KDoc
- [`KT-21374`](https://youtrack.jetbrains.com/issue/KT-21374) Imports optimized tooltip is displayed, even if no changes were made
- [`KT-21422`](https://youtrack.jetbrains.com/issue/KT-21422) IDE can't import class from root package
- [`KT-27344`](https://youtrack.jetbrains.com/issue/KT-27344) MPP: jvmWithJava: no IDE module dependency is created between Kotlin test and Java main on import; Gradle build is successful
- [`KT-29667`](https://youtrack.jetbrains.com/issue/KT-29667) Kotlin update settings has wrong looking text boxes for versions
- [`KT-30133`](https://youtrack.jetbrains.com/issue/KT-30133) Update copyright creates duplicates for build.gradle.kts files
- [`KT-30782`](https://youtrack.jetbrains.com/issue/KT-30782) 'Show Method Separators' does not separate expression body Kotlin functions
- [`KT-31022`](https://youtrack.jetbrains.com/issue/KT-31022) `Quick definition` does not show Kotlin code in Java files
- [`KT-31499`](https://youtrack.jetbrains.com/issue/KT-31499) "Extend selection" selects escaped identifier name together with backticks
- [`KT-31595`](https://youtrack.jetbrains.com/issue/KT-31595) "Complete current statement" for method call closes brace at wrong place
- [`KT-31637`](https://youtrack.jetbrains.com/issue/KT-31637) NPE in IDE when organizing imports
- [`KT-31786`](https://youtrack.jetbrains.com/issue/KT-31786) KNPE at copy attempt due to kdoc reference
- [`KT-32276`](https://youtrack.jetbrains.com/issue/KT-32276) Fix flaky test for ultra light classes
- [`KT-32364`](https://youtrack.jetbrains.com/issue/KT-32364) Remove deprecated usages of OUT_OF_CODE_BLOCK_MODIFICATION_COUNT and write a replacement for Kotlin language
- [`KT-32370`](https://youtrack.jetbrains.com/issue/KT-32370) Lambdas should have implicit `return` in Kotlin Uast
- [`KT-12096`](https://youtrack.jetbrains.com/issue/KT-12096) Spring: rename of Kotlin bean defined in `@Bean` annotation fails
- [`KT-28193`](https://youtrack.jetbrains.com/issue/KT-28193) Exception: Mirror element should never be calculated for light classes generated from a single file
- [`KT-28822`](https://youtrack.jetbrains.com/issue/KT-28822) Dependencies in Kotlin MPP project could be wrongly resolved if project was not build before import
- [`KT-29267`](https://youtrack.jetbrains.com/issue/KT-29267) Enable ultra-light classes by default
- [`KT-31129`](https://youtrack.jetbrains.com/issue/KT-31129) Call only Kotlin-specific reference contributors for getting Kotlin references from PSI
- [`KT-32082`](https://youtrack.jetbrains.com/issue/KT-32082) Kotlin facet: 1.3.40 plugin does not properly read target platform settings of 1.3.50 plugin
- [`KT-32969`](https://youtrack.jetbrains.com/issue/KT-32969) Data class extending abstract class with final `toString`, `equals` or `hashCode` causes exception
- [`KT-33245`](https://youtrack.jetbrains.com/issue/KT-33245) IllegalArgumentException exception occurs on Tools->Configure Koltin in Project action in Android Studio
### IDE. Completion
- [`KT-9792`](https://youtrack.jetbrains.com/issue/KT-9792) Don't propose the same name for arguments of lambda on completion of function call with lambda template
- [`KT-29572`](https://youtrack.jetbrains.com/issue/KT-29572) Smart completing anonymous object uses incorrect code style
- [`KT-25264`](https://youtrack.jetbrains.com/issue/KT-25264) Freeze in Kotlin file on completion
- [`KT-32519`](https://youtrack.jetbrains.com/issue/KT-32519) Keyword completion: support fixing layout and typo tolerance
### IDE. Debugger
#### New Features
- [`KT-30740`](https://youtrack.jetbrains.com/issue/KT-30740) Display more information about variables when breakpoint is set inside lambda expression
#### Fixes
- [`KT-8579`](https://youtrack.jetbrains.com/issue/KT-8579) Debugger: Evaluate expression fails at typed arrays
- [`KT-10183`](https://youtrack.jetbrains.com/issue/KT-10183) Debugger: receiver properties are not shown inline in extension function
- [`KT-11663`](https://youtrack.jetbrains.com/issue/KT-11663) Assignment is not possible in Evaluate expression
- [`KT-11706`](https://youtrack.jetbrains.com/issue/KT-11706) Attempts to evaluate java method calls on 'Array' instance in debugger fail with NoSuchMethodError
- [`KT-11888`](https://youtrack.jetbrains.com/issue/KT-11888) Evaluate Expression for expression with synchronized
- [`KT-11938`](https://youtrack.jetbrains.com/issue/KT-11938) Empty condition is marked as error
- [`KT-13188`](https://youtrack.jetbrains.com/issue/KT-13188) Cannot evaluate expression with local extension function
- [`KT-14421`](https://youtrack.jetbrains.com/issue/KT-14421) Debugger: breakpoint set on trivial if/while is not hit
- [`KT-15259`](https://youtrack.jetbrains.com/issue/KT-15259) Debug: closing brace of object definition is considered executable; ISE: "Don't call this method for local declarations: OBJECT_DECLARATION" at LazyDeclarationResolver.getMemberScopeDeclaredIn()
- [`KT-19084`](https://youtrack.jetbrains.com/issue/KT-19084) Breakpoints on Debugger altering Result
- [`KT-19556`](https://youtrack.jetbrains.com/issue/KT-19556) Kotlin exception while debugging IJ plugin code
- [`KT-19980`](https://youtrack.jetbrains.com/issue/KT-19980) Debug: evaluation fails for setter of member extention property
- [`KT-20560`](https://youtrack.jetbrains.com/issue/KT-20560) Evaluate expression doesn't work for super method call
- [`KT-23526`](https://youtrack.jetbrains.com/issue/KT-23526) In *.kts scripts, debugger ignores breakpoints in top-level statements and members
- [`KT-24914`](https://youtrack.jetbrains.com/issue/KT-24914) AS: Uninitialized yet lazy properties called on first debug point reach
- [`KT-26742`](https://youtrack.jetbrains.com/issue/KT-26742) Debugger can't evaluate expected top-level function from common code
- [`KT-30120`](https://youtrack.jetbrains.com/issue/KT-30120) False positive "Unused equals expression" in evaluate expression window
- [`KT-30730`](https://youtrack.jetbrains.com/issue/KT-30730) Missing tooltip for "Kotlin variables view" button
- [`KT-30919`](https://youtrack.jetbrains.com/issue/KT-30919) Debugger's "Kotlin View" doesn't show variables inside lambdas
- [`KT-30976`](https://youtrack.jetbrains.com/issue/KT-30976) Debugger: No access to receiver evaluating named parameters during call to extension function
- [`KT-31418`](https://youtrack.jetbrains.com/issue/KT-31418) java.lang.ClassCastException : java.lang.annotation.Annotation[] cannot be cast to byte[]
- [`KT-31510`](https://youtrack.jetbrains.com/issue/KT-31510) isDumb should be used only under read action: KotlinEvaluator
- [`KT-31702`](https://youtrack.jetbrains.com/issue/KT-31702) Debugger can't stop on breakpoint on `Unit` expression from coroutine context
- [`KT-31709`](https://youtrack.jetbrains.com/issue/KT-31709) Evaluate: "IllegalArgumentException: Parameter specified as non-null is null: method org.jetbrains.kotlin.codegen.FrameMapBase.getIndex, parameter descriptor" with nested lambda member access
- [`KT-24829`](https://youtrack.jetbrains.com/issue/KT-24829) Access to coroutineContext in 'Evaluate expression'
### IDE. Gradle
- [`KT-19693`](https://youtrack.jetbrains.com/issue/KT-19693) Import package prefix from Gradle
- [`KT-30667`](https://youtrack.jetbrains.com/issue/KT-30667) Dependencies of a module on a multiplatform one with a JVM target and `withJava()` configured, are incorrectly resolved in IDE
- [`KT-32300`](https://youtrack.jetbrains.com/issue/KT-32300) Add possibility to distinguish kotlin source root from java source root
- [`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
### IDE. Gradle. Script
- [`KT-31779`](https://youtrack.jetbrains.com/issue/KT-31779) "Highlighting in scripts is not available"
- [`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-30974`](https://youtrack.jetbrains.com/issue/KT-30974) Script dependencies resolution failed error while trying to use Kotlin for Gradle
- [`KT-31440`](https://youtrack.jetbrains.com/issue/KT-31440) Add link to Gradle Kotlin DSL logs when script dependencies resolution process fails
- [`KT-32483`](https://youtrack.jetbrains.com/issue/KT-32483) CNFE org.gradle.kotlin.dsl.KotlinBuildScript on creating new Gradle Kotlin project from wizard
- [`KT-21501`](https://youtrack.jetbrains.com/issue/KT-21501) build.gradle.kts displays failures if not using java sdk for module
### IDE. Inspections and Intentions
#### New Features
- [`KT-8958`](https://youtrack.jetbrains.com/issue/KT-8958) ReplaceWith intention message could be more helpful in case of generic substitution
- [`KT-12515`](https://youtrack.jetbrains.com/issue/KT-12515) Quickfix "by Delegates.notNull()" as replacement for "lateinit" for primitive type
- [`KT-14344`](https://youtrack.jetbrains.com/issue/KT-14344) Suggest to replace manual range with explicit `indices` call or iteration over collection
- [`KT-17916`](https://youtrack.jetbrains.com/issue/KT-17916) Import popup does not indicate deprecated classes
- [`KT-23501`](https://youtrack.jetbrains.com/issue/KT-23501) Add intention for converting ordinary properties to 'lazy' and vise versa
- [`KT-25006`](https://youtrack.jetbrains.com/issue/KT-25006) Add inspection "'equals()' between objects of inconvertible primitive / enum / string types"
- [`KT-27353`](https://youtrack.jetbrains.com/issue/KT-27353) Quickfix to add a constructor parameter from parent class to child class
- [`KT-30124`](https://youtrack.jetbrains.com/issue/KT-30124) Add inspection to replace java.util.Arrays.equals with contentEquals
- [`KT-30640`](https://youtrack.jetbrains.com/issue/KT-30640) Add inspection for check/require/checkNotNull/requireNotNull
- [`KT-30775`](https://youtrack.jetbrains.com/issue/KT-30775) Inspection for the case when one lateinit var overrides another lateinit var
- [`KT-31476`](https://youtrack.jetbrains.com/issue/KT-31476) Improve "Create expect..." quickfix
- [`KT-31533`](https://youtrack.jetbrains.com/issue/KT-31533) Make "Add operator modifier" an inspection instead of intention
- [`KT-31795`](https://youtrack.jetbrains.com/issue/KT-31795) Inspection: simplify property setter with custom visibility
- [`KT-31924`](https://youtrack.jetbrains.com/issue/KT-31924) Make "add import" intention more flexible based on caret position
- [`KT-30970`](https://youtrack.jetbrains.com/issue/KT-30970) No warning for empty `if` operator and `also`method
#### Fixes
- [`KT-12567`](https://youtrack.jetbrains.com/issue/KT-12567) "Introduce 'when' subject" intention does not work for "this" in extension function
- [`KT-14369`](https://youtrack.jetbrains.com/issue/KT-14369) "Replace elvis expression with 'if" intention produces boilerplate code for 'return' in RHS
- [`KT-16067`](https://youtrack.jetbrains.com/issue/KT-16067) "Replace 'if' expression with elvis expression" suggests replacing an idiomatic code with non-idiomatic
- [`KT-19643`](https://youtrack.jetbrains.com/issue/KT-19643) Tune or disable the FoldInitializerAndIfToElvis inspection
- [`KT-24439`](https://youtrack.jetbrains.com/issue/KT-24439) No method imports suggested
- [`KT-25786`](https://youtrack.jetbrains.com/issue/KT-25786) False positive "Not-null extension receiver of inline function can be made nullable" with `operator fun invoke`
- [`KT-25905`](https://youtrack.jetbrains.com/issue/KT-25905) False positive for 'LeakingThis' on a method call in enum class body
- [`KT-27074`](https://youtrack.jetbrains.com/issue/KT-27074) False positive "Foldable if-then" with Result type
- [`KT-27550`](https://youtrack.jetbrains.com/issue/KT-27550) "Redundant explicit this" false positive with subclass and extension lambda
- [`KT-27563`](https://youtrack.jetbrains.com/issue/KT-27563) Generate toString in common code shouldn't use java.util.Arrays
- [`KT-27822`](https://youtrack.jetbrains.com/issue/KT-27822) Don't suggest `might be const` on `actual` member declaration
- [`KT-28595`](https://youtrack.jetbrains.com/issue/KT-28595) "Assignment should be lifted out of 'if'" false negative for different but compatible derived types
- [`KT-29192`](https://youtrack.jetbrains.com/issue/KT-29192) "Convert property to function" with explicit generic type loses getter body
- [`KT-29716`](https://youtrack.jetbrains.com/issue/KT-29716) With both explicit and implicit package prefixes "Package name does not match containing directory" inspection suggests not usable quick fix
- [`KT-29731`](https://youtrack.jetbrains.com/issue/KT-29731) Don't suggest `Add val/var to parameter` at expect class constructor
- [`KT-30191`](https://youtrack.jetbrains.com/issue/KT-30191) "Lift out of if" intention isn't suggested for assignment of null
- [`KT-30197`](https://youtrack.jetbrains.com/issue/KT-30197) ReplaceWith for deprecated function adds class literal/callable reference argument above unless it is used in substitution
- [`KT-30627`](https://youtrack.jetbrains.com/issue/KT-30627) "Use property access syntax" produces red code if setter argument is a lambda with implicit SAM conversion
- [`KT-30804`](https://youtrack.jetbrains.com/issue/KT-30804) Property declaration goes to annotation comment when removing only modifier using RemoveModifierFix
- [`KT-30975`](https://youtrack.jetbrains.com/issue/KT-30975) ''when' has only 'else' branch and should be simplified' inspection removes subject variable definition used in else branch
- [`KT-31033`](https://youtrack.jetbrains.com/issue/KT-31033) "Create expect ..." quick fix incorrectly works for a secondary constructor in a multiplatform project
- [`KT-31272`](https://youtrack.jetbrains.com/issue/KT-31272) Expand "create expected ..." quick fix highlighting also to a primary constructor
- [`KT-31278`](https://youtrack.jetbrains.com/issue/KT-31278) Inappropriate "Remove redundant .let call" inspection
- [`KT-31341`](https://youtrack.jetbrains.com/issue/KT-31341) Incorrect quickfix "Replace with Kotlin analog" for conversion to an extension, where the first argument is an expression with an operation
- [`KT-31359`](https://youtrack.jetbrains.com/issue/KT-31359) "Invalid property key" inspection false positive for a bundle with several properties files
- [`KT-31362`](https://youtrack.jetbrains.com/issue/KT-31362) 'Move variable declaration into `when`' quickfix comments left brace with EOL comment
- [`KT-31443`](https://youtrack.jetbrains.com/issue/KT-31443) Remove braces intention places caret in a wrong place
- [`KT-31446`](https://youtrack.jetbrains.com/issue/KT-31446) Incorrect quick fix “Create expected class" for inline class with parameter with actual
- [`KT-31518`](https://youtrack.jetbrains.com/issue/KT-31518) Incorrect "Create expect function" for primary constructor
- [`KT-31673`](https://youtrack.jetbrains.com/issue/KT-31673) Only `when` keyword should be highlighted in WhenWithOnlyElseInspection
- [`KT-31716`](https://youtrack.jetbrains.com/issue/KT-31716) Decrease severity of PackageDirectoryMismatchInspection to INFO
- [`KT-31717`](https://youtrack.jetbrains.com/issue/KT-31717) Decrease severity of RemoveCurlyBracesFromTemplateInspection
- [`KT-31816`](https://youtrack.jetbrains.com/issue/KT-31816) "Package directive doesn't match file location" for root package is invisible in editor
- [`KT-31954`](https://youtrack.jetbrains.com/issue/KT-31954) MoveVariableDeclarationIntoWhen should move the caret to the subject expression
- [`KT-32001`](https://youtrack.jetbrains.com/issue/KT-32001) Wrong quickfixes for TOO_MANY_ARGUMENTS
- [`KT-32010`](https://youtrack.jetbrains.com/issue/KT-32010) Convert ReplaceSingleLineLetIntention to inspections
- [`KT-32046`](https://youtrack.jetbrains.com/issue/KT-32046) False negative "Redundant qualifier name" with class literal
- [`KT-32112`](https://youtrack.jetbrains.com/issue/KT-32112) False positive "Redundant qualifier name"
- [`KT-32318`](https://youtrack.jetbrains.com/issue/KT-32318) "Remove argument name" intention does not remove square braces for annotation vararg argument
- [`KT-32320`](https://youtrack.jetbrains.com/issue/KT-32320) False negative "Redundant qualifier name" with local object
- [`KT-32347`](https://youtrack.jetbrains.com/issue/KT-32347) Duplicative "Remove redundant 'public' modifier" suggestion for getter
- [`KT-32365`](https://youtrack.jetbrains.com/issue/KT-32365) "Convert to sealed class" intention should not be suggested when no "class" keyword
- [`KT-32419`](https://youtrack.jetbrains.com/issue/KT-32419) Spurious 'while' has empty body warning when body has explanatory comment
- [`KT-32506`](https://youtrack.jetbrains.com/issue/KT-32506) False negative "Remove redundant qualifier name" with `java.util.ArrayList<Int>()`
- [`KT-32454`](https://youtrack.jetbrains.com/issue/KT-32454) "Replace Java static method with Kotlin analog": invalid quick fix on 'abs()' function
- [`KT-26242`](https://youtrack.jetbrains.com/issue/KT-26242) "Create test" intention does nothing in common module
- [`KT-27208`](https://youtrack.jetbrains.com/issue/KT-27208) IDEA reports about the need to declare abstract or implement abstract method, but this method is @JvmStatic in an interface companion
- [`KT-27555`](https://youtrack.jetbrains.com/issue/KT-27555) `Create actual ...` quick fix does nothing if the corresponding source set directory isn't created yet
- [`KT-28121`](https://youtrack.jetbrains.com/issue/KT-28121) IDE: Warn on java files under "src/main/kotlin" or "src/test/kotlin" source roots
- [`KT-28295`](https://youtrack.jetbrains.com/issue/KT-28295) Use `languageSettings` for a quick fix to enable experimental features in multiplatform projects
- [`KT-28529`](https://youtrack.jetbrains.com/issue/KT-28529) Don't suggest `commonMain` source set as a target of `create expected ...` quick fix for a member of `*Test` source set
- [`KT-28746`](https://youtrack.jetbrains.com/issue/KT-28746) “Create actual class” quick fix creates invalid file when is called from files located in package directory but don't have package name
- [`KT-30622`](https://youtrack.jetbrains.com/issue/KT-30622) Add names to call arguments starting from given argument
- [`KT-31404`](https://youtrack.jetbrains.com/issue/KT-31404) Redundant 'requireNotNull' or 'checkNotNull' inspection: don't remove first argument
- [`KT-32705`](https://youtrack.jetbrains.com/issue/KT-32705) "Create expect" quick fix adds `actual` modifier to a `const`/`lateinit` declaration without a warning
- [`KT-32967`](https://youtrack.jetbrains.com/issue/KT-32967) Warning about incorrectly placed Java source file isn't automatically dismissed on move of the file to the proper source root
### 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. KDoc
- [`KT-30985`](https://youtrack.jetbrains.com/issue/KT-30985) Missing line break in quick doc for enum constant
### IDE. Multiplatform
- [`KT-29757`](https://youtrack.jetbrains.com/issue/KT-29757) IDE fails to import transitive dependency of a JVM module to a multiplatform one
### IDE. Navigation
- [`KT-10215`](https://youtrack.jetbrains.com/issue/KT-10215) Kotlin classes are listed after Java classes in the navigation bar
### IDE. Refactorings
- [`KT-29720`](https://youtrack.jetbrains.com/issue/KT-29720) Refactor / Move does not update package statement with implicit prefix
- [`KT-30762`](https://youtrack.jetbrains.com/issue/KT-30762) Inline method produces invalid code for suspend functions with receiver
- [`KT-30748`](https://youtrack.jetbrains.com/issue/KT-30748) 100+ Seconds UI Freeze on performing a Move Refactoring on a file with a lot of usages (KotlinOptimizeImports in thread dump)
### IDE. Scratch
- [`KT-23604`](https://youtrack.jetbrains.com/issue/KT-23604) Scratch: end of line is wrongly indented with the end of scratch line output
- [`KT-27963`](https://youtrack.jetbrains.com/issue/KT-27963) Make REPL mode in Scratch files incremental
- [`KT-29534`](https://youtrack.jetbrains.com/issue/KT-29534) Line output jumps to the next line together with cursor
- [`KT-32791`](https://youtrack.jetbrains.com/issue/KT-32791) "Access is allowed from event dispatch thread only" while working with a scratch file
### IDE. Script
- [`KT-25187`](https://youtrack.jetbrains.com/issue/KT-25187) Kotlin script in src: warning: classpath entry points to a non-existent location on JDK 9+
- [`KT-31152`](https://youtrack.jetbrains.com/issue/KT-31152) Errors in IDE when different Java Sdk are set as Project SDK and as Gradle JVM
- [`KT-31521`](https://youtrack.jetbrains.com/issue/KT-31521) CNFE „org.jetbrains.kotlin.idea.caches.project.ScriptBinariesScopeCache“ on creating new Gradle based project
- [`KT-31826`](https://youtrack.jetbrains.com/issue/KT-31826) Gradle clean task causes IDEA to lose kotlin scripting configuration
- [`KT-31837`](https://youtrack.jetbrains.com/issue/KT-31837) TargetPlatform for scripts should depends on scriptDefinition.additionalArguments
- [`KT-30690`](https://youtrack.jetbrains.com/issue/KT-30690) Highlighting for scripts in diff view doesn't work for left part
- [`KT-32061`](https://youtrack.jetbrains.com/issue/KT-32061) Check classpath jars before applying script compilation result from file attributes
- [`KT-32554`](https://youtrack.jetbrains.com/issue/KT-32554) Freezes in ScriptDependenciesUpdater
### IDE. Tests Support
- [`KT-30814`](https://youtrack.jetbrains.com/issue/KT-30814) MPP, 191 platform: with Gradle test runner run configuration for platform test is created without tasks
### IDE. Wizards
- [`KT-32105`](https://youtrack.jetbrains.com/issue/KT-32105) MPP project wizard: add option for Kotlin Gradle DSL
### JS. Tools
- [`KT-31527`](https://youtrack.jetbrains.com/issue/KT-31527) Keep generating empty `jsTest` task
- [`KT-31565`](https://youtrack.jetbrains.com/issue/KT-31565) Gradle/JS: `npmResolve` is never UP-TO-DATE
- [`KT-32326`](https://youtrack.jetbrains.com/issue/KT-32326) Gradle, test runner: support postponing test running error reporting at the end of the build
- [`KT-32393`](https://youtrack.jetbrains.com/issue/KT-32393) Gradle, JS: Resolve projects lazily
- [`KT-31560`](https://youtrack.jetbrains.com/issue/KT-31560) Gradle: provide descriptions for JS tasks
- [`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-31694`](https://youtrack.jetbrains.com/issue/KT-31694) Gradle, NPM, windows: creating symlink requires administrator privilege
### Libraries
- [`KT-29372`](https://youtrack.jetbrains.com/issue/KT-29372) measureTime that returns both the result of block and elapsed time
- [`KT-32083`](https://youtrack.jetbrains.com/issue/KT-32083) Incorrect ReplaceWith annotation on kotlin.js.pow
- [`KT-12749`](https://youtrack.jetbrains.com/issue/KT-12749) Provide Int.bitCount, Long.bitCount etc.
- [`KT-32359`](https://youtrack.jetbrains.com/issue/KT-32359) Common Array.fill
- [`KT-33225`](https://youtrack.jetbrains.com/issue/KT-33225) JS: Incorrect conversion of infinite Double to Long
### Reflection
- [`KT-22923`](https://youtrack.jetbrains.com/issue/KT-22923) Reflection getMemberProperties fails: kotlin.reflect.jvm.internal.KotlinReflectionInternalError
- [`KT-31318`](https://youtrack.jetbrains.com/issue/KT-31318) "KotlinReflectionInternalError: Method is not supported" on accessing array class annotation parameter
### Tools. Daemon
- [`KT-31550`](https://youtrack.jetbrains.com/issue/KT-31550) NSME org.jetbrains.kotlin.com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem.clearHandlersCache()V on compileKotlin task with plugin from master
- [`KT-32490`](https://youtrack.jetbrains.com/issue/KT-32490) Compiler daemon tests fail on windows due to directory name being too long
- [`KT-32950`](https://youtrack.jetbrains.com/issue/KT-32950) Daemon should inherit "-XX:MaxMetaspaceSize" of client VM
- [`KT-32992`](https://youtrack.jetbrains.com/issue/KT-32992) Enable assertions in Kotlin Compile Daemon
- [`KT-33027`](https://youtrack.jetbrains.com/issue/KT-33027) Compilation with daemon fails, because IncrementalModuleInfo#serialVersionUID does not match
### Tools. CLI
- [`KT-33177`](https://youtrack.jetbrains.com/issue/KT-33177) Introduce compiler flags -Xinline-classes and -Xpolymorphic-signature as a higher priority than -XXLanguage
### Tools. Compiler Plugins
- [`KT-28824`](https://youtrack.jetbrains.com/issue/KT-28824) Add jvm-abi-gen-embeddable for use with embeddable compiler
- [`KT-31279`](https://youtrack.jetbrains.com/issue/KT-31279) JPS build with compiler plugin and "Keep compiler alive = No" fails with CCE: "Cannot cast NoArgComponentRegistrar to ComponentRegistrar" at ServiceLoaderLite.loadImplementations()
- [`KT-32346`](https://youtrack.jetbrains.com/issue/KT-32346) kotlinx.serialization: Performance problems with completion/intellisense
### Tools. Gradle
#### New Features
- [`KT-26655`](https://youtrack.jetbrains.com/issue/KT-26655) Precise metadata publishing and consumption for new MPP
- [`KT-31018`](https://youtrack.jetbrains.com/issue/KT-31018) Gradle, JS: yarn
- [`KT-31703`](https://youtrack.jetbrains.com/issue/KT-31703) Gradle, JS: automatically download d.ts and generate kotlin/js external declarations using dukat
- [`KT-31890`](https://youtrack.jetbrains.com/issue/KT-31890) Gradle, JS, webpack: provide property with full bundle file path
- [`KT-32015`](https://youtrack.jetbrains.com/issue/KT-32015) Gradle, JS: resolve configuration only while executing tasks of specific projects
- [`KT-32136`](https://youtrack.jetbrains.com/issue/KT-32136) Gradle, test runner: handle case when test runtime exits abnormally
- [`KT-26256`](https://youtrack.jetbrains.com/issue/KT-26256) In new MPP, support Java compilation in JVM targets
- [`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
- [`KT-31697`](https://youtrack.jetbrains.com/issue/KT-31697) Gradle, NPM: report about clashes in packages_imported
#### Performance Improvements
- [`KT-29538`](https://youtrack.jetbrains.com/issue/KT-29538) AndroidSubPlugin#getCommonResDirectories is very slow
#### Fixes
- [`KT-29343`](https://youtrack.jetbrains.com/issue/KT-29343) Kotlin MPP source set dependencies are not properly propagated to tests in Android projects
- [`KT-30691`](https://youtrack.jetbrains.com/issue/KT-30691) Gradle, JS tests: Parent operation with id 947 not available when all tests passed
- [`KT-31917`](https://youtrack.jetbrains.com/issue/KT-31917) Gradle, JS: transitive dependency between compilations in same project doesn't work
- [`KT-31985`](https://youtrack.jetbrains.com/issue/KT-31985) Gradle, JS: webpack not working on windows
- [`KT-32072`](https://youtrack.jetbrains.com/issue/KT-32072) Gradle, JS: browser() in DSL triggers project.evaluate()
- [`KT-32204`](https://youtrack.jetbrains.com/issue/KT-32204) In an MPP, a dependency that is added to a non-root source set is incorrectly analyzed for source sets visibility
- [`KT-32225`](https://youtrack.jetbrains.com/issue/KT-32225) In an MPP, if a dependency is added to a source set that does not take part in published compilations, it is not correctly analyzed in source set visibility inference
- [`KT-32564`](https://youtrack.jetbrains.com/issue/KT-32564) Provide a flag to enable/disable hierarchical multiplatform mechanism in Gradle
- [`KT-31023`](https://youtrack.jetbrains.com/issue/KT-31023) Update Gradle module metadata warning in MPP publishing
- [`KT-31696`](https://youtrack.jetbrains.com/issue/KT-31696) Gradle, NPM: select one version between tools and all of compile configurations
- [`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-32210`](https://youtrack.jetbrains.com/issue/KT-32210) Kapt randomly fails with java.io.UTFDataFormatException
- [`KT-32706`](https://youtrack.jetbrains.com/issue/KT-32706) Gradle target "jsBrowserWebpack" should use output of JS compile task as input
- [`KT-32697`](https://youtrack.jetbrains.com/issue/KT-32697) [Tests] org.jetbrains.kotlin.gradle.SubpluginsIT
- [`KT-33246`](https://youtrack.jetbrains.com/issue/KT-33246) Kotlin JS & Native tests + Gradle 5.6: No value has been specified for property 'binaryResultsDirectory'
### Tools. Incremental Compile
- [`KT-31310`](https://youtrack.jetbrains.com/issue/KT-31310) Incremental build of Kotlin/JS project fails with KNPE at IncrementalJsCache.nonDirtyPackageParts()
### Tools. J2K
#### New Features
- [`KT-30776`](https://youtrack.jetbrains.com/issue/KT-30776) New J2K
- [`KT-31836`](https://youtrack.jetbrains.com/issue/KT-31836) Suggest user to configure Kotlin in the project when running new J2K file conversion
- [`KT-32512`](https://youtrack.jetbrains.com/issue/KT-32512) ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more cases for java.util.Arrays
#### Fixes
- [`KT-15791`](https://youtrack.jetbrains.com/issue/KT-15791) J2K converts class literals including redundant generic <*>
- [`KT-31234`](https://youtrack.jetbrains.com/issue/KT-31234) New J2K: Exception occurs on converting Java class to Kotlin
- [`KT-31250`](https://youtrack.jetbrains.com/issue/KT-31250) J2K: caret position of original file is preserved, adding spaces to resulting file
- [`KT-31251`](https://youtrack.jetbrains.com/issue/KT-31251) J2K: Java class with members is converted to Kotlin class with `final` constructor
- [`KT-31252`](https://youtrack.jetbrains.com/issue/KT-31252) J2K: resulted file is not formatted
- [`KT-31254`](https://youtrack.jetbrains.com/issue/KT-31254) J2K: resulted source uses full qualified references instead of imports
- [`KT-31255`](https://youtrack.jetbrains.com/issue/KT-31255) J2K: redundant modifiers in resulted source
- [`KT-31726`](https://youtrack.jetbrains.com/issue/KT-31726) New J2K converts annotation with array parameter to single value parameter
- [`KT-31809`](https://youtrack.jetbrains.com/issue/KT-31809) "Attempt to modify PSI for non-committed Document!" exception and broken kotlin file after new J2K conversion
- [`KT-31821`](https://youtrack.jetbrains.com/issue/KT-31821) J2K: IDEA Ultimate: local variable: CCE: "PsiLocalVariableImpl cannot be cast to class JvmAnnotatedElement" at JavaToJKTreeBuilder$DeclarationMapper.toJK()
- [`KT-32436`](https://youtrack.jetbrains.com/issue/KT-32436) NewJ2K generic field is not initialized after convertion
- [`KT-19327`](https://youtrack.jetbrains.com/issue/KT-19327) Java to Kotlin converter fails to convert code using Java 8 Stream API
- [`KT-21467`](https://youtrack.jetbrains.com/issue/KT-21467) Convert To Kotlin fails when using chained stream.flatmap methods
- [`KT-24677`](https://youtrack.jetbrains.com/issue/KT-24677) j2k creates nullable type for child function but keeps not null type for parent function
- [`KT-32572`](https://youtrack.jetbrains.com/issue/KT-32572) New J2K: Map with complex type as parameter is wrongly converted
- [`KT-32602`](https://youtrack.jetbrains.com/issue/KT-32602) J2K: no conversion of `String.length()` method call to property access of existing String property
- [`KT-32604`](https://youtrack.jetbrains.com/issue/KT-32604) kotlin.NotImplementedError exception occurs on converting Java call of toString method of data class to Kotlin
- [`KT-32609`](https://youtrack.jetbrains.com/issue/KT-32609) New J2K: Comparable class is wrongly converted to Kotlin if parameter of compareTo marked with @NotNull annotation
- [`KT-32693`](https://youtrack.jetbrains.com/issue/KT-32693) New J2K is throwing „Read access is allowed from event dispatch thread or inside read-action only“ on converting Java code inside Evaluate Expression window
- [`KT-32702`](https://youtrack.jetbrains.com/issue/KT-32702) New J2K: lambda with method reference is converted to lamdba with excessive parameter declaration
- [`KT-32835`](https://youtrack.jetbrains.com/issue/KT-32835) New J2K: NumberFormatException occurs on converting binary literals
- [`KT-32837`](https://youtrack.jetbrains.com/issue/KT-32837) J2K: NumberFormatException occurs on converting literals with underscore characters
- [`KT-22412`](https://youtrack.jetbrains.com/issue/KT-22412) J2K: Intention to replace if(...) throw IAE with require
- [`KT-33371`](https://youtrack.jetbrains.com/issue/KT-33371) Add an ability to switch between old and new J2K via settings window
- [`KT-32863`](https://youtrack.jetbrains.com/issue/KT-32863) New J2K: IllegalArgumentException occurs on Kotlin configuration in java project in Android Studio
### Tools. JPS
- [`KT-27181`](https://youtrack.jetbrains.com/issue/KT-27181) Compiler arguments are listed twice on JPS build of Gradle-based project
- [`KT-13563`](https://youtrack.jetbrains.com/issue/KT-13563) Kotlin jps-plugin should allow to instrument bytecode from Intellij IDEA.
### Tools. REPL
- [`KT-15125`](https://youtrack.jetbrains.com/issue/KT-15125) Support JSR 223 bindings directly via script variables
- [`KT-32085`](https://youtrack.jetbrains.com/issue/KT-32085) Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"
### Tools. Scripts
- [`KT-28137`](https://youtrack.jetbrains.com/issue/KT-28137) Implement result/return value for the regular (non-REPL) scripts
### Tools. kapt
- [`KT-30578`](https://youtrack.jetbrains.com/issue/KT-30578) `build/generated/source/kaptKotlin` is added as source directory to `main` instead of `jvmMain` when jvm { withJava() } is configured in a multiplatform project
- [`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-31127`](https://youtrack.jetbrains.com/issue/KT-31127) Kotlin-generating processor which uses Filer API breaks JavaCompile task
- [`KT-31378`](https://youtrack.jetbrains.com/issue/KT-31378) v1.3.31: NoSuchElementException in kapt when kapt.incremental.apt=true
- [`KT-32535`](https://youtrack.jetbrains.com/issue/KT-32535) Kapt aptMode=compile don't include files generated at `kapt.kotlin.generated` as sources to compile
- [`KT-31471`](https://youtrack.jetbrains.com/issue/KT-31471) KAPT prints "IncrementalProcessor" instead of processor name in verbose mode
## 1.3.41
### Compiler

View File

@@ -98,13 +98,13 @@ Development for some particular platform is possible after 'switching' that can
```sh
cd kotlin-project-dir
# switching to IntelliJ Idea 2018.2
bunch switch . 182
# switching to IntelliJ Idea 2019.1
bunch switch 191
```
## <a name="working-in-idea"></a> Working with the project in IntelliJ IDEA
Working with the Kotlin project requires at least IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
Working with the Kotlin project requires at least IntelliJ IDEA 2019.1. You can download IntelliJ IDEA 2019.1 [here](https://www.jetbrains.com/idea/download).
After cloning the project, to import the project in Intellij choose the project directory in the Open project dialog. Then, after project opened, Select
`File` -> `New...` -> `Module from Existing Sources` in the menu, and select `build.gradle.kts` file in the project's root folder.
@@ -113,7 +113,7 @@ In the import dialog, select `use default gradle wrapper`.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings after importing the project.
At this time, you can use the latest released 1.2.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
At this time, you can use the latest released 1.3.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
### Compiling and running

View File

@@ -0,0 +1,82 @@
import kotlinx.benchmark.gradle.benchmark
val benchmarks_version = "0.2.0-dev-7"
buildscript {
val benchmarks_version = "0.2.0-dev-7"
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
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")
}
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
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,214 @@
/*
* 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 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 firProvider = session.firProvider as FirProviderImpl
val builder = RawFirBuilder(session, firProvider.kotlinScopeProvider, stubMode = false)
val totalTransformer = FirTotalResolveTransformer()
val firFile = builder.buildFirFile(file).also(firProvider::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,47 @@
/*
* 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 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,50 @@
/*
* Copyright 2010-2020 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 ManyImplicitReceiversBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "50")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText(): String {
return buildString {
appendln("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
for (i in 1..size) {
appendln("interface A$i {")
appendln(" fun foo$i()")
appendln("}")
appendln()
}
appendln()
append("fun test(")
append((1..size).joinToString(", ") { "a$it: A$it" })
appendln(" {")
for (i in 1..size) {
appendln("with(a$i) {")
}
for (i in 1..size) {
appendln("foo$i()")
}
for (i in 1..size) {
appendln("}")
}
appendln("}")
}
}
}

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

@@ -13,6 +13,7 @@ dependencies {
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(project(":kotlin-util-klib-metadata"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
@@ -22,8 +23,9 @@ dependencies {
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(kotlinStdlib())
testCompileOnly(intellijDep()) { includeJars("openapi") }
Platform[193].orLower {
testCompileOnly(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testRuntime(project(":kotlin-reflect"))
}

View File

@@ -18,6 +18,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.IrTranslationResultValue
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
@@ -28,6 +29,7 @@ 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.SerializerExtensionProtocol
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import java.io.DataInput
@@ -36,10 +38,12 @@ import java.io.File
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
pathConverter: FileToPathConverter,
serializerProtocol: SerializerExtensionProtocol
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val IR_TRANSLATION_RESULT_MAP = "ir-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"
@@ -47,9 +51,12 @@ open class IncrementalJsCache(
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
private val protoData = ProtoDataProvider(serializerProtocol)
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, pathConverter))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile, pathConverter, protoData))
private val irTranslationResults = registerMap(IrTranslationResultMap(IR_TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val packageMetadata = registerMap(PackageMetadataMap(PACKAGE_META_FILE.storageFile))
@@ -76,6 +83,17 @@ open class IncrementalJsCache(
dirtySources.addAll(removedAndCompiledSources)
}
fun compare(translatedFiles: Map<File, TranslationResultValue>, changesCollector: ChangesCollector) {
for ((srcFile, data) in translatedFiles) {
val oldProtoMap = translationResults[srcFile]?.metadata?.let { protoData(srcFile, it) } ?: emptyMap()
val newProtoMap = protoData(srcFile, data.metadata)
for (classId in oldProtoMap.keys + newProtoMap.keys) {
changesCollector.collectProtoChanges(oldProtoMap[classId], newProtoMap[classId])
}
}
}
fun compareAndUpdate(incrementalResults: IncrementalResultsConsumerImpl, changesCollector: ChangesCollector) {
val translatedFiles = incrementalResults.packageParts
@@ -83,8 +101,8 @@ open class IncrementalJsCache(
dirtySources.remove(srcFile)
val (binaryMetadata, binaryAst, inlineData) = data
val oldProtoMap = translationResults[srcFile]?.metadata?.let { getProtoData(srcFile, it) } ?: emptyMap()
val newProtoMap = getProtoData(srcFile, binaryMetadata)
val oldProtoMap = translationResults[srcFile]?.metadata?.let { protoData(srcFile, it) } ?: emptyMap()
val newProtoMap = protoData(srcFile, binaryMetadata)
for ((classId, protoData) in newProtoMap) {
registerOutputForFile(srcFile, classId.asSingleFqName())
@@ -108,6 +126,11 @@ open class IncrementalJsCache(
for ((packageName, metadata) in incrementalResults.packageMetadata) {
packageMetadata.put(packageName, metadata)
}
for ((srcFile, irData) in incrementalResults.irFileData) {
val (fileData, types, signatures, strings, declarations, bodies, fqn) = irData
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn)
}
}
private fun registerOutputForFile(srcFile: File, name: FqName) {
@@ -118,6 +141,7 @@ open class IncrementalJsCache(
override fun clearCacheForRemovedClasses(changesCollector: ChangesCollector) {
dirtySources.forEach {
translationResults.remove(it, changesCollector)
irTranslationResults.remove(it)
inlineFunctions.remove(it)
}
removeAllFromClassStorage(dirtyOutputClassesMap.getDirtyOutputClasses(), changesCollector)
@@ -140,6 +164,16 @@ open class IncrementalJsCache(
put(fqNameString, packageMetadata[fqNameString]!!)
}
}
fun nonDirtyIrParts(): Map<File, IrTranslationResultValue> =
hashMapOf<File, IrTranslationResultValue>().apply {
for (file in irTranslationResults.keys()) {
if (file !in dirtySources) {
put(file, irTranslationResults[file]!!)
}
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -173,7 +207,8 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
private val pathConverter: FileToPathConverter,
private val protoData: ProtoDataProvider
) :
BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
@@ -193,7 +228,7 @@ private class TranslationResultMap(
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
val protoMap = protoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
@@ -202,6 +237,104 @@ private class TranslationResultMap(
}
}
private object IrTranslationResultValueExternalizer : DataExternalizer<IrTranslationResultValue> {
override fun save(output: DataOutput, value: IrTranslationResultValue) {
output.writeArray(value.fileData)
output.writeArray(value.types)
output.writeArray(value.signatures)
output.writeArray(value.strings)
output.writeArray(value.declarations)
output.writeArray(value.bodies)
output.writeArray(value.fqn)
}
private fun DataOutput.writeArray(array: ByteArray) {
writeInt(array.size)
write(array)
}
private fun DataInput.readArray(): ByteArray {
val dataSize = readInt()
val filedata = ByteArray(dataSize)
readFully(filedata)
return filedata
}
override fun read(input: DataInput): IrTranslationResultValue {
val fileData = input.readArray()
val types = input.readArray()
val signatures = input.readArray()
val strings = input.readArray()
val declarations = input.readArray()
val bodies = input.readArray()
val fqn = input.readArray()
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn)
}
}
private class IrTranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<IrTranslationResultValue>(storageFile, IrTranslationResultValueExternalizer) {
override fun dumpValue(value: IrTranslationResultValue): String =
"Filedata: ${value.fileData.md5()}, " +
"Types: ${value.types.md5()}, " +
"Signatures: ${value.signatures.md5()}, " +
"Strings: ${value.strings.md5()}, " +
"Declarations: ${value.declarations.md5()}, " +
"Bodies: ${value.bodies.md5()}"
fun put(
sourceFile: File,
newFiledata: ByteArray,
newTypes: ByteArray,
newSignatures: ByteArray,
newStrings: ByteArray,
newDeclarations: ByteArray,
newBodies: ByteArray,
fqn: ByteArray
) {
storage[pathConverter.toPath(sourceFile)] =
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn)
}
operator fun get(sourceFile: File): IrTranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun remove(sourceFile: File) {
val path = pathConverter.toPath(sourceFile)
storage.remove(path)
}
}
private class ProtoDataProvider(private val serializerProtocol: SerializerExtensionProtocol) {
operator fun invoke(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, serializerProtocol.extensionRegistry)
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
proto.class_List.forEach {
val classId = nameResolver.getClassId(it.fqName)
classes[classId] = ClassProtoData(it, nameResolver)
}
proto.`package`.apply {
val packageNameId = getExtensionOrNull(serializerProtocol.packageFqName)
val packageFqName = packageNameId?.let { FqName(nameResolver.getPackageFqName(it)) } ?: FqName.ROOT
val packagePartClassId = ClassId(packageFqName, Name.identifier(sourceFile.nameWithoutExtension.capitalize() + "Kt"))
classes[packagePartClassId] = PackagePartProtoData(this, nameResolver, packageFqName)
}
return classes
}
}
// TODO: remove this method once AbstractJsProtoComparisonTest is fixed
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, JsSerializerProtocol.extensionRegistry)

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)
}

View File

@@ -28,9 +28,8 @@ import org.jetbrains.kotlin.modules.KotlinModuleXmlBuilder
import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.resolve.sam.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

View File

@@ -21,4 +21,7 @@ class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) :
override val packageMetadata: Map<String, ByteArray>
get() = cache.packageMetadata()
override val serializedIrFiles: Map<File, IrTranslationResultValue>
get() = cache.nonDirtyIrParts()
}

View File

@@ -30,9 +30,9 @@ import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
import java.util.*
data class Difference(
val isClassAffected: Boolean = false,
val areSubclassesAffected: Boolean = false,
val changedMembersNames: Set<String> = emptySet()
val isClassAffected: Boolean = false,
val areSubclassesAffected: Boolean = false,
val changedMembersNames: Set<String> = emptySet()
)
sealed class ProtoData
@@ -49,14 +49,17 @@ fun ProtoMapValue.toProtoData(packageFqName: FqName): ProtoData =
}
internal val MessageLite.isPrivate: Boolean
get() = Visibilities.isPrivate(ProtoEnumFlags.visibility(
get() = Visibilities.isPrivate(
ProtoEnumFlags.visibility(
when (this) {
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
is ProtoBuf.TypeAlias -> Flags.VISIBILITY.get(flags)
else -> error("Unknown message: $this")
}))
}
)
)
private fun MessageLite.name(nameResolver: NameResolver): String {
return when (this) {
@@ -79,9 +82,21 @@ abstract class DifferenceCalculator {
val result = hashSetOf<String>()
val oldMap =
oldList.groupBy { it.getHashCode({ compareObject.oldGetIndexOfString(it) }, { compareObject.oldGetIndexOfClassId(it) }) }
oldList.groupBy {
it.getHashCode(
compareObject::oldGetIndexOfString,
compareObject::oldGetIndexOfClassId,
compareObject::oldGetTypeById
)
}
val newMap =
newList.groupBy { it.getHashCode({ compareObject.newGetIndexOfString(it) }, { compareObject.newGetIndexOfClassId(it) }) }
newList.groupBy {
it.getHashCode(
compareObject::newGetIndexOfString,
compareObject::newGetIndexOfClassId,
compareObject::newGetTypeById
)
}
val hashes = oldMap.keys + newMap.keys
for (hash in hashes) {
@@ -100,8 +115,8 @@ abstract class DifferenceCalculator {
}
private fun calcDifferenceForEqualHashes(
oldList: List<MessageLite>,
newList: List<MessageLite>
oldList: List<MessageLite>,
newList: List<MessageLite>
): Collection<String> {
val result = hashSetOf<String>()
val newSet = HashSet(newList)
@@ -110,8 +125,7 @@ abstract class DifferenceCalculator {
val newMember = newSet.firstOrNull { compareObject.checkEquals(oldMember, it) }
if (newMember != null) {
newSet.remove(newMember)
}
else {
} else {
result.add(oldMember.name(compareObject.oldNameResolver))
}
}
@@ -124,20 +138,20 @@ abstract class DifferenceCalculator {
}
protected fun calcDifferenceForNames(
oldList: List<Int>,
newList: List<Int>
oldList: List<Int>,
newList: List<Int>
): Collection<String> {
val oldNames = oldList.map { compareObject.oldNameResolver.getString(it) }.toSet()
val newNames = newList.map { compareObject.newNameResolver.getString(it) }.toSet()
return oldNames.union(newNames) - oldNames.intersect(newNames)
}
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeTable: (Int) -> ProtoBuf.Type): Int {
return when (this) {
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes, typeTable)
else -> error("Unknown message: $this")
}
}
@@ -154,10 +168,15 @@ abstract class DifferenceCalculator {
}
class DifferenceCalculatorForClass(
private val oldData: ClassProtoData,
private val newData: ClassProtoData
private val oldData: ClassProtoData,
private val newData: ClassProtoData
) : DifferenceCalculator() {
override val compareObject = ProtoCompareGenerated(oldData.nameResolver, newData.nameResolver)
override val compareObject = ProtoCompareGenerated(
oldNameResolver = oldData.nameResolver,
newNameResolver = newData.nameResolver,
oldTypeTable = oldData.proto.typeTableOrNull,
newTypeTable = newData.proto.typeTableOrNull
)
override fun difference(): Difference {
val (oldProto, oldNameResolver) = oldData
@@ -220,11 +239,8 @@ class DifferenceCalculatorForClass(
// when (x as Base) { is Impl -> ... }
areSubclassesAffected = true
}
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
// TODO
}
ProtoBufClassKind.FLAGS,
@@ -238,7 +254,7 @@ class DifferenceCalculatorForClass(
}
ProtoBufClassKind.JVM_EXT_CLASS_MODULE_NAME,
ProtoBufClassKind.JS_EXT_CLASS_CONTAINING_FILE_ID -> {
// TODO
// TODO
}
ProtoBufClassKind.JVM_EXT_CLASS_LOCAL_VARIABLE_LIST -> {
// Not affected, local variables are not accessible outside of a file
@@ -250,9 +266,13 @@ class DifferenceCalculatorForClass(
ProtoBufClassKind.BUILT_INS_EXT_CLASS_ANNOTATION_LIST -> {
isClassAffected = true
}
ProtoCompareGenerated.ProtoBufClassKind.JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME -> {
ProtoBufClassKind.JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME -> {
// Not affected, this extension is not used in the compiler
}
ProtoBufClassKind.KLIB_EXT_CLASS_ANNOTATION_LIST -> {
isClassAffected = true
areSubclassesAffected = true
}
}
}
@@ -261,10 +281,15 @@ class DifferenceCalculatorForClass(
}
class DifferenceCalculatorForPackageFacade(
private val oldData: PackagePartProtoData,
private val newData: PackagePartProtoData
private val oldData: PackagePartProtoData,
private val newData: PackagePartProtoData
) : DifferenceCalculator() {
override val compareObject = ProtoCompareGenerated(oldData.nameResolver, newData.nameResolver)
override val compareObject = ProtoCompareGenerated(
oldNameResolver = oldData.nameResolver,
newNameResolver = newData.nameResolver,
oldTypeTable = oldData.proto.typeTableOrNull,
newTypeTable = newData.proto.typeTableOrNull
)
override fun difference(): Difference {
val oldProto = oldData.proto
@@ -289,10 +314,9 @@ class DifferenceCalculatorForPackageFacade(
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.VERSION_REQUIREMENT_TABLE,
ProtoBufPackageKind.JVM_EXT_PACKAGE_MODULE_NAME,
ProtoBufPackageKind.JS_EXT_PACKAGE_FQ_NAME-> {
ProtoBufPackageKind.JS_EXT_PACKAGE_FQ_NAME -> {
// TODO
}
ProtoBufPackageKind.JVM_EXT_PACKAGE_LOCAL_VARIABLE_LIST -> {
@@ -301,6 +325,9 @@ class DifferenceCalculatorForPackageFacade(
ProtoBufPackageKind.BUILT_INS_EXT_PACKAGE_FQ_NAME -> {
// Not affected
}
ProtoBufPackageKind.KLIB_EXT_PACKAGE_FQ_NAME -> {
// Not affected
}
}
}
@@ -310,3 +337,9 @@ class DifferenceCalculatorForPackageFacade(
private val ProtoBuf.Class.isSealed: Boolean
get() = ProtoBuf.Modality.SEALED == Flags.MODALITY.get(flags)
val ProtoBuf.Class.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null
val ProtoBuf.Package.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null

View File

@@ -24,11 +24,20 @@ import org.jetbrains.kotlin.utils.Printer
import java.io.File
abstract class BasicMap<K : Comparable<K>, V>(
storageFile: File,
internal val storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage = LazyStorage(storageFile, keyDescriptor, valueExternalizer)
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()

View File

@@ -0,0 +1,81 @@
/*
* 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>(
internal val storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage = LazyStorage(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

@@ -1,90 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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

@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.annotations.TestOnly
import java.io.File
import java.io.IOException
open class BasicMapsOwner(val cachesDir: File) {
private val maps = arrayListOf<BasicMap<*, *>>()
@@ -35,16 +36,35 @@ open class BasicMapsOwner(val cachesDir: File) {
}
open fun clean() {
maps.forEach { it.clean() }
forEachMapSafe("clean", BasicMap<*, *>::clean)
}
open fun close() {
maps.forEach { it.close() }
forEachMapSafe("close", BasicMap<*, *>::close)
}
open fun flush(memoryCachesOnly: Boolean) {
maps.forEach { it.flush(memoryCachesOnly) }
forEachMapSafe("flush") { it.flush(memoryCachesOnly) }
}
@TestOnly fun dump(): String = maps.joinToString("\n\n") { it.dump() }
private fun forEachMapSafe(actionName: String, action: (BasicMap<*, *>) -> Unit) {
val actionExceptions = LinkedHashMap<String, Exception>()
maps.forEach {
try {
action(it)
} catch (e: Exception) {
actionExceptions[it.storageFile.name] = e
}
}
if (actionExceptions.isNotEmpty()) {
val desc = "Could not $actionName incremental caches in $cachesDir: ${actionExceptions.keys.joinToString(", ")}"
val allIOExceptions = actionExceptions.all { it is IOException }
val ex = if (allIOExceptions) IOException(desc) else Exception(desc)
actionExceptions.forEach { (_, e) -> ex.addSuppressed(e) }
throw ex
}
}
@TestOnly
fun dump(): String = maps.joinToString("\n\n") { it.dump() }
}

View File

@@ -0,0 +1,107 @@
/*
* 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()
} finally {
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

@@ -1,108 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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

@@ -26,7 +26,7 @@ internal open class ClassOneToManyMap(
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
fun add(key: FqName, value: FqName) {
storage.append(key.asString(), value.asString())
storage.append(key.asString(), listOf(value.asString()))
}
operator fun get(key: FqName): Collection<FqName> =

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(), 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

@@ -1,55 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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

@@ -16,107 +16,14 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.DataOutput
import java.io.File
import java.io.IOException
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class LazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<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!!
}
interface LazyStorage<K, V> {
val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
fun append(key: K, value: String) {
append(key) { out -> IOUtil.writeUTF(out, value) }
}
fun append(key: K, value: Int) {
append(key) { out -> out.writeInt(value) }
}
@Synchronized
fun clean() {
try {
storage?.close()
}
catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
}
else {
existingStorage.force()
}
}
@Synchronized
fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
}
}
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,122 @@
/*
* 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.IOUtil
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.DataOutput
import java.io.File
import java.io.IOException
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class LazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<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!!
}
val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
fun append(key: K, value: String) {
append(key) { out -> IOUtil.writeUTF(out, value) }
}
fun append(key: K, value: Int) {
append(key) { out -> out.writeInt(value) }
}
@Synchronized
fun clean() {
try {
storage?.close()
}
catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
}
else {
existingStorage.force()
}
}
@Synchronized
fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
}
}

View File

@@ -1,29 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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

@@ -24,7 +24,7 @@ internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<I
override fun dumpValue(value: Collection<Int>): String = value.toString()
fun add(name: String, scope: String, fileId: Int) {
storage.append(LookupSymbolKey(name, scope), fileId)
storage.append(LookupSymbolKey(name, scope), listOf(fileId))
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]

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), 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

@@ -1,42 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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.PersistentHashMap
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: 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) { dataOutput -> valueExternalizer.save(dataOutput, 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

@@ -41,7 +41,7 @@ internal abstract class AbstractSourceToOutputMap<Name>(
}
fun add(sourceFile: File, className: Name) {
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), listOf(nameTransformer.asString(className)))
}
fun contains(sourceFile: File): Boolean =

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), 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

@@ -1,62 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.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

@@ -19,12 +19,16 @@ 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, // TODO rename as it is used for metadata-only test
private val isScopeExpansionEnabled: 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 SCOPE_EXPANDING_LOG = "build-with-scope-expansion.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 +42,8 @@ data class BuildLogFinder(
val names = dir.list() ?: arrayOf()
val files = names.filter { File(dir, it).isFile }.toSet()
val matchedName = when {
isScopeExpansionEnabled && SCOPE_EXPANDING_LOG in files -> SCOPE_EXPANDING_LOG
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

@@ -11,6 +11,8 @@ public final class DebugExtOptionsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
}
public static final int SKIP_IN_COMPARISON_FIELD_NUMBER = 50000;
/**
@@ -56,6 +58,28 @@ public final class DebugExtOptionsProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int TYPE_ID_IN_TABLE_FIELD_NUMBER = 50004;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> typeIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int SKIP_MESSAGE_IN_COMPARISON_FIELD_NUMBER = 50100;
/**
* <code>extend .google.protobuf.MessageOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.MessageOptions,
java.lang.Boolean> skipMessageInComparison = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
getDescriptor() {
@@ -73,8 +97,11 @@ public final class DebugExtOptionsProtoBuf {
"rotobuf.FieldOptions\030\321\206\003 \001(\010:<\n\023fq_name_" +
"id_in_table\022\035.google.protobuf.FieldOptio" +
"ns\030\322\206\003 \001(\010:;\n\022string_id_in_table\022\035.googl" +
"e.protobuf.FieldOptions\030\323\206\003 \001(\010B\031B\027Debug" +
"ExtOptionsProtoBuf"
"e.protobuf.FieldOptions\030\323\206\003 \001(\010:9\n\020type_" +
"id_in_table\022\035.google.protobuf.FieldOptio",
"ns\030\324\206\003 \001(\010:E\n\032skip_message_in_comparison" +
"\022\037.google.protobuf.MessageOptions\030\264\207\003 \001(" +
"\010B\031B\027DebugExtOptionsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -93,6 +120,8 @@ public final class DebugExtOptionsProtoBuf {
nameIdInTable.internalInit(descriptor.getExtensions().get(1));
fqNameIdInTable.internalInit(descriptor.getExtensions().get(2));
stringIdInTable.internalInit(descriptor.getExtensions().get(3));
typeIdInTable.internalInit(descriptor.getExtensions().get(4));
skipMessageInComparison.internalInit(descriptor.getExtensions().get(5));
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor();
}

View File

@@ -10100,6 +10100,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
boolean hasFlags();
@@ -10116,6 +10117,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
int getFlags();
@@ -10853,6 +10855,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public boolean hasFlags() {
@@ -10871,6 +10874,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public int getFlags() {
@@ -12242,6 +12246,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public boolean hasFlags() {
@@ -12260,6 +12265,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public int getFlags() {
@@ -12278,6 +12284,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public Builder setFlags(int value) {
@@ -12299,6 +12306,7 @@ public final class DebugProtoBuf {
*isExternal
*isExpect
*isInline
*isFun
* </pre>
*/
public Builder clearFlags() {
@@ -34302,192 +34310,194 @@ public final class DebugProtoBuf {
java.lang.String[] descriptorData = {
"\n&core/metadata/src/metadata.debug.proto" +
"\022\035org.jetbrains.kotlin.metadata\032)core/me" +
"tadata/src/ext_options.debug.proto\"\035\n\013St" +
"ringTable\022\016\n\006string\030\001 \003(\t\"\276\002\n\022QualifiedN" +
"ameTable\022W\n\016qualified_name\030\001 \003(\0132?.org.j" +
"etbrains.kotlin.metadata.QualifiedNameTa" +
"ble.QualifiedName\032\316\001\n\rQualifiedName\022!\n\025p" +
"arent_qualified_name\030\001 \001(\005:\002-1\022\022\n\nshort_" +
"name\030\002 \002(\005\022[\n\004kind\030\003 \001(\0162D.org.jetbrains" +
".kotlin.metadata.QualifiedNameTable.Qual",
"ifiedName.Kind:\007PACKAGE\")\n\004Kind\022\t\n\005CLASS" +
"\020\000\022\013\n\007PACKAGE\020\001\022\t\n\005LOCAL\020\002\"\226\006\n\nAnnotatio" +
"n\022\020\n\002id\030\001 \002(\005B\004\220\265\030\001\022D\n\010argument\030\002 \003(\01322." +
"org.jetbrains.kotlin.metadata.Annotation" +
".Argument\032\257\005\n\010Argument\022\025\n\007name_id\030\001 \002(\005B" +
"\004\210\265\030\001\022G\n\005value\030\002 \002(\01328.org.jetbrains.kot" +
"lin.metadata.Annotation.Argument.Value\032\302" +
"\004\n\005Value\022K\n\004type\030\001 \001(\0162=.org.jetbrains.k" +
"otlin.metadata.Annotation.Argument.Value" +
".Type\022\021\n\tint_value\030\002 \001(\022\022\023\n\013float_value\030",
"\003 \001(\002\022\024\n\014double_value\030\004 \001(\001\022\032\n\014string_va" +
"lue\030\005 \001(\005B\004\230\265\030\001\022\026\n\010class_id\030\006 \001(\005B\004\220\265\030\001\022" +
"\033\n\renum_value_id\030\007 \001(\005B\004\210\265\030\001\022=\n\nannotati" +
"on\030\010 \001(\0132).org.jetbrains.kotlin.metadata" +
".Annotation\022O\n\rarray_element\030\t \003(\01328.org" +
"tadata/src/ext_options.debug.proto\"#\n\013St" +
"ringTable\022\016\n\006string\030\001 \003(\t:\004\240\273\030\001\"\304\002\n\022Qual" +
"ifiedNameTable\022W\n\016qualified_name\030\001 \003(\0132?" +
".org.jetbrains.kotlin.metadata.Qualified" +
"NameTable.QualifiedName\032\316\001\n\rQualifiedNam" +
"e\022!\n\025parent_qualified_name\030\001 \001(\005:\002-1\022\022\n\n" +
"short_name\030\002 \002(\005\022[\n\004kind\030\003 \001(\0162D.org.jet" +
"brains.kotlin.metadata.QualifiedNameTabl",
"e.QualifiedName.Kind:\007PACKAGE\")\n\004Kind\022\t\n" +
"\005CLASS\020\000\022\013\n\007PACKAGE\020\001\022\t\n\005LOCAL\020\002:\004\240\273\030\001\"\226" +
"\006\n\nAnnotation\022\020\n\002id\030\001 \002(\005B\004\220\265\030\001\022D\n\010argum" +
"ent\030\002 \003(\01322.org.jetbrains.kotlin.metadat" +
"a.Annotation.Argument\032\257\005\n\010Argument\022\025\n\007na" +
"me_id\030\001 \002(\005B\004\210\265\030\001\022G\n\005value\030\002 \002(\01328.org.j" +
"etbrains.kotlin.metadata.Annotation.Argu" +
"ment.Value\032\302\004\n\005Value\022K\n\004type\030\001 \001(\0162=.org" +
".jetbrains.kotlin.metadata.Annotation.Ar" +
"gument.Value\022 \n\025array_dimension_count\030\013 " +
"\001(\005:\0010\022\020\n\005flags\030\n \001(\005:\0010\"\230\001\n\004Type\022\010\n\004BYT" +
"E\020\000\022\010\n\004CHAR\020\001\022\t\n\005SHORT\020\002\022\007\n\003INT\020\003\022\010\n\004LON" +
"G\020\004\022\t\n\005FLOAT\020\005\022\n\n\006DOUBLE\020\006\022\013\n\007BOOLEAN\020\007\022",
"\n\n\006STRING\020\010\022\t\n\005CLASS\020\t\022\010\n\004ENUM\020\n\022\016\n\nANNO" +
"TATION\020\013\022\t\n\005ARRAY\020\014\"\373\005\n\004Type\022>\n\010argument" +
"\030\002 \003(\0132,.org.jetbrains.kotlin.metadata.T" +
"ype.Argument\022\027\n\010nullable\030\003 \001(\010:\005false\022+\n" +
"\035flexible_type_capabilities_id\030\004 \001(\005B\004\230\265" +
"\030\001\022A\n\024flexible_upper_bound\030\005 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\037\n\027flexibl" +
"e_upper_bound_id\030\010 \001(\005\022\030\n\nclass_name\030\006 \001" +
"(\005B\004\220\265\030\001\022\026\n\016type_parameter\030\007 \001(\005\022!\n\023type" +
"_parameter_name\030\t \001(\005B\004\210\265\030\001\022\035\n\017type_alia",
"s_name\030\014 \001(\005B\004\220\265\030\001\0227\n\nouter_type\030\n \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\025\n\ro" +
"uter_type_id\030\013 \001(\005\022=\n\020abbreviated_type\030\r" +
"gument.Value.Type\022\021\n\tint_value\030\002 \001(\022\022\023\n\013",
"float_value\030\003 \001(\002\022\024\n\014double_value\030\004 \001(\001\022" +
"\032\n\014string_value\030\005 \001(\005B\004\230\265\030\001\022\026\n\010class_id\030" +
"\006 \001(\005B\004\220\265\030\001\022\033\n\renum_value_id\030\007 \001(\005B\004\210\265\030\001" +
"\022=\n\nannotation\030\010 \001(\0132).org.jetbrains.kot" +
"lin.metadata.Annotation\022O\n\rarray_element" +
"\030\t \003(\01328.org.jetbrains.kotlin.metadata.A" +
"nnotation.Argument.Value\022 \n\025array_dimens" +
"ion_count\030\013 \001(\005:\0010\022\020\n\005flags\030\n \001(\005:\0010\"\230\001\n" +
"\004Type\022\010\n\004BYTE\020\000\022\010\n\004CHAR\020\001\022\t\n\005SHORT\020\002\022\007\n\003" +
"INT\020\003\022\010\n\004LONG\020\004\022\t\n\005FLOAT\020\005\022\n\n\006DOUBLE\020\006\022\013",
"\n\007BOOLEAN\020\007\022\n\n\006STRING\020\010\022\t\n\005CLASS\020\t\022\010\n\004EN" +
"UM\020\n\022\016\n\nANNOTATION\020\013\022\t\n\005ARRAY\020\014\"\223\006\n\004Type" +
"\022>\n\010argument\030\002 \003(\0132,.org.jetbrains.kotli" +
"n.metadata.Type.Argument\022\027\n\010nullable\030\003 \001" +
"(\010:\005false\022+\n\035flexible_type_capabilities_" +
"id\030\004 \001(\005B\004\230\265\030\001\022A\n\024flexible_upper_bound\030\005" +
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
"e\022\033\n\023abbreviated_type_id\030\016 \001(\005\022\r\n\005flags\030" +
"\001 \001(\005\032\322\001\n\010Argument\022P\n\nprojection\030\001 \001(\01627" +
".org.jetbrains.kotlin.metadata.Type.Argu" +
"ment.Projection:\003INV\0221\n\004type\030\002 \001(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\017\n\007type_" +
"id\030\003 \001(\005\"0\n\nProjection\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022",
"\007\n\003INV\020\002\022\010\n\004STAR\020\003*\005\010d\020\310\001\"\230\002\n\rTypeParame" +
"ter\022\n\n\002id\030\001 \002(\005\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022\026\n\007r" +
"eified\030\003 \001(\010:\005false\022L\n\010variance\030\004 \001(\01625." +
"org.jetbrains.kotlin.metadata.TypeParame" +
"ter.Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\032\n\016u" +
"pper_bound_id\030\006 \003(\005B\002\020\001\"$\n\010Variance\022\006\n\002I" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\244\007\n\005Class\022\020" +
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022" +
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016",
"e\022%\n\027flexible_upper_bound_id\030\010 \001(\005B\004\240\265\030\001" +
"\022\030\n\nclass_name\030\006 \001(\005B\004\220\265\030\001\022\026\n\016type_param" +
"eter\030\007 \001(\005\022!\n\023type_parameter_name\030\t \001(\005B",
"\004\210\265\030\001\022\035\n\017type_alias_name\030\014 \001(\005B\004\220\265\030\001\0227\n\n" +
"outer_type\030\n \001(\0132#.org.jetbrains.kotlin." +
"metadata.Type\022\033\n\router_type_id\030\013 \001(\005B\004\240\265" +
"\030\001\022=\n\020abbreviated_type\030\r \001(\0132#.org.jetbr" +
"ains.kotlin.metadata.Type\022!\n\023abbreviated" +
"_type_id\030\016 \001(\005B\004\240\265\030\001\022\r\n\005flags\030\001 \001(\005\032\330\001\n\010" +
"Argument\022P\n\nprojection\030\001 \001(\01627.org.jetbr" +
"ains.kotlin.metadata.Type.Argument.Proje" +
"ction:\003INV\0221\n\004type\030\002 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\025\n\007type_id\030\003 \001(\005B\004",
"\240\265\030\001\"0\n\nProjection\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003I" +
"NV\020\002\022\010\n\004STAR\020\003*\005\010d\020\310\001\"\234\002\n\rTypeParameter\022" +
"\n\n\002id\030\001 \002(\005\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022\026\n\007reifi" +
"ed\030\003 \001(\010:\005false\022L\n\010variance\030\004 \001(\01625.org." +
"jetbrains.kotlin.metadata.TypeParameter." +
"Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\036\n\016upper" +
"_bound_id\030\006 \003(\005B\006\020\001\240\265\030\001\"$\n\010Variance\022\006\n\002I" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\250\007\n\005Class\022\020" +
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022",
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016" +
"type_parameter\030\005 \003(\0132,.org.jetbrains.kot" +
"lin.metadata.TypeParameter\0226\n\tsupertype\030" +
"\006 \003(\0132#.org.jetbrains.kotlin.metadata.Ty" +
"pe\022\030\n\014supertype_id\030\002 \003(\005B\002\020\001\022!\n\021nested_c" +
"lass_name\030\007 \003(\005B\006\020\001\210\265\030\001\022?\n\013constructor\030\010" +
" \003(\0132*.org.jetbrains.kotlin.metadata.Con" +
"structor\0229\n\010function\030\t \003(\0132\'.org.jetbrai" +
"ns.kotlin.metadata.Function\0229\n\010property\030" +
"\n \003(\0132\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\022<\n\ntype_alias\030\013 \003(\0132(.org.jetbrai",
"ns.kotlin.metadata.TypeAlias\022<\n\nenum_ent" +
"ry\030\r \003(\0132(.org.jetbrains.kotlin.metadata" +
".EnumEntry\022\'\n\027sealed_subclass_fq_name\030\020 " +
"\003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.org.je" +
"tbrains.kotlin.metadata.TypeTable\022\033\n\023ver" +
"sion_requirement\030\037 \003(\005\022Y\n\031version_requir" +
"ement_table\030 \001(\01326.org.jetbrains.kotlin" +
".metadata.VersionRequirementTable\"x\n\004Kin" +
"d\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_CLAS" +
"S\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLASS\020",
"\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*\006\010d\020" +
"\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'.org." +
"jetbrains.kotlin.metadata.Function\0229\n\010pr" +
"operty\030\004 \003(\0132\'.org.jetbrains.kotlin.meta" +
"data.Property\022<\n\ntype_alias\030\005 \003(\0132(.org." +
"jetbrains.kotlin.metadata.TypeAlias\022<\n\nt" +
"pe\022\034\n\014supertype_id\030\002 \003(\005B\006\020\001\240\265\030\001\022!\n\021nest" +
"ed_class_name\030\007 \003(\005B\006\020\001\210\265\030\001\022?\n\013construct" +
"or\030\010 \003(\0132*.org.jetbrains.kotlin.metadata" +
".Constructor\0229\n\010function\030\t \003(\0132\'.org.jet" +
"brains.kotlin.metadata.Function\0229\n\010prope" +
"rty\030\n \003(\0132\'.org.jetbrains.kotlin.metadat",
"a.Property\022<\n\ntype_alias\030\013 \003(\0132(.org.jet" +
"brains.kotlin.metadata.TypeAlias\022<\n\nenum" +
"_entry\030\r \003(\0132(.org.jetbrains.kotlin.meta" +
"data.EnumEntry\022\'\n\027sealed_subclass_fq_nam" +
"e\030\020 \003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.or" +
"g.jetbrains.kotlin.metadata.TypeTable\022\033\n" +
"\023version_requirement\030\037 \003(\005\022Y\n\031version_re" +
"quirement_table\030 \001(\01326.org.jetbrains.ko" +
"tlin.metadata.VersionRequirementTable\"x\n" +
"\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_",
"CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CL" +
"ASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*" +
"\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'." +
"org.jetbrains.kotlin.metadata.Function\0229" +
"\n\010property\030\004 \003(\0132\'.org.jetbrains.kotlin." +
"metadata.Property\022<\n\ntype_alias\030\005 \003(\0132(." +
"org.jetbrains.kotlin.metadata.TypeAlias\022" +
"<\n\ntype_table\030\036 \001(\0132(.org.jetbrains.kotl" +
"in.metadata.TypeTable\022Y\n\031version_require" +
"ment_table\030 \001(\01326.org.jetbrains.kotlin.",
"metadata.VersionRequirementTable*\005\010d\020\310\001\"" +
"`\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrai" +
"ns.kotlin.metadata.Type\022\032\n\016first_nullabl" +
"e\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructor\022\020\n\005fla" +
"gs\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002 \003(\0132-.o" +
"rg.jetbrains.kotlin.metadata.ValueParame" +
"ter\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224\001" +
"\"\246\004\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_f" +
"lags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013ret" +
"urn_type\030\003 \001(\0132#.org.jetbrains.kotlin.me",
"tadata.Type\022\034\n\016return_type_id\030\007 \001(\005B\004\240\265\030" +
"\001\022D\n\016type_parameter\030\004 \003(\0132,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\022:\n\rrecei" +
"ver_type\030\005 \001(\0132#.org.jetbrains.kotlin.me" +
"tadata.Type\022\036\n\020receiver_type_id\030\010 \001(\005B\004\240" +
"\265\030\001\022F\n\017value_parameter\030\006 \003(\0132-.org.jetbr" +
"ains.kotlin.metadata.ValueParameter\022<\n\nt" +
"ype_table\030\036 \001(\0132(.org.jetbrains.kotlin.m" +
"etadata.TypeTable\022Y\n\031version_requirement" +
"_table\030 \001(\01326.org.jetbrains.kotlin.meta" +
"data.VersionRequirementTable*\005\010d\020\310\001\"Z\n\tT",
"ypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrains.k" +
"otlin.metadata.Type\022\032\n\016first_nullable\030\002 " +
"\001(\005:\002-1\"\214\001\n\013Constructor\022\020\n\005flags\030\001 \001(\005:\001" +
"6\022F\n\017value_parameter\030\002 \003(\0132-.org.jetbrai" +
"ns.kotlin.metadata.ValueParameter\022\033\n\023ver" +
"sion_requirement\030\037 \003(\005*\006\010d\020\270\224\001\"\232\004\n\010Funct" +
"ion\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_flags\030\001 \001(\005" +
":\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013return_type\030\003" +
"etadata.TypeTable\022\033\n\023version_requirement" +
"\030\037 \003(\005\0229\n\010contract\030 \001(\0132\'.org.jetbrains",
".kotlin.metadata.Contract*\006\010d\020\270\224\001\"\345\003\n\010Pr" +
"operty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030" +
"\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013retur" +
"n_type\030\003 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\034\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022" +
"D\n\016type_parameter\030\004 \003(\0132,.org.jetbrains." +
"kotlin.metadata.TypeParameter\022:\n\rreceive" +
"r_type\030\005 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\036\n\020receiver_type_id\030\n \001(\005B\004\240\265\030" +
"\001\022M\n\026setter_value_parameter\030\006 \001(\0132-.org.",
"jetbrains.kotlin.metadata.ValueParameter" +
"\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_flags\030\010" +
" \001(\005\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224" +
"\001\"\357\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\0010\022\022" +
"\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\025\n\007type_id" +
"\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_element_type\030\004 \001(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022$" +
"\n\026vararg_element_type_id\030\006 \001(\005B\004\240\265\030\001*\005\010d" +
"\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004n",
"ame\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132" +
",.org.jetbrains.kotlin.metadata.TypePara" +
"meter\022<\n\017underlying_type\030\004 \001(\0132#.org.jet" +
"brains.kotlin.metadata.Type\022 \n\022underlyin" +
"g_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\rexpanded_type\030\006" +
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
"e\022\026\n\016return_type_id\030\007 \001(\005\022D\n\016type_parame",
"ter\030\004 \003(\0132,.org.jetbrains.kotlin.metadat" +
"a.TypeParameter\022:\n\rreceiver_type\030\005 \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\030\n\020r" +
"eceiver_type_id\030\010 \001(\005\022F\n\017value_parameter" +
"\030\006 \003(\0132-.org.jetbrains.kotlin.metadata.V" +
"alueParameter\022<\n\ntype_table\030\036 \001(\0132(.org." +
"jetbrains.kotlin.metadata.TypeTable\022\033\n\023v" +
"ersion_requirement\030\037 \003(\005\0229\n\010contract\030 \001" +
"(\0132\'.org.jetbrains.kotlin.metadata.Contr" +
"act*\006\010d\020\270\224\001\"\331\003\n\010Property\022\022\n\005flags\030\013 \001(\005:",
"\003518\022\027\n\told_flags\030\001 \001(\005:\0042054\022\022\n\004name\030\002 " +
"\002(\005B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jet" +
"brains.kotlin.metadata.Type\022\026\n\016return_ty" +
"pe_id\030\t \001(\005\022D\n\016type_parameter\030\004 \003(\0132,.or" +
"g.jetbrains.kotlin.metadata.TypeParamete" +
"r\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\030\n\020receiver_type_i" +
"d\030\n \001(\005\022M\n\026setter_value_parameter\030\006 \001(\0132" +
"-.org.jetbrains.kotlin.metadata.ValuePar" +
"ameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_f",
"lags\030\010 \001(\005\022\033\n\023version_requirement\030\037 \003(\005*" +
"\006\010d\020\270\224\001\"\343\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(" +
"\005:\0010\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\017\n\007t" +
"ype_id\030\005 \001(\005\022@\n\023vararg_element_type\030\004 \001(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022\036" +
"\n\026vararg_element_type_id\030\006 \001(\005*\005\010d\020\310\001\"\212\003" +
"\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 " +
"\002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132,.org." +
"jetbrains.kotlin.metadata.TypeParameter\022",
"<\n\017underlying_type\030\004 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\032\n\022underlying_type" +
"_id\030\005 \001(\005\022:\n\rexpanded_type\030\006 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\030\n\020expande" +
"d_type_id\030\007 \001(\005\022=\n\nannotation\030\010 \003(\0132).or" +
"g.jetbrains.kotlin.metadata.Annotation\022\033" +
"\n\023version_requirement\030\037 \003(\005*\005\010d\020\310\001\"&\n\tEn" +
"umEntry\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022V" +
"ersionRequirement\022\017\n\007version\030\001 \001(\005\022\024\n\014ve" +
"rsion_full\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.org.je",
"tbrains.kotlin.metadata.VersionRequireme" +
"nt.Level:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007m" +
"essage\030\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\016" +
"2=.org.jetbrains.kotlin.metadata.Version" +
"Requirement.VersionKind:\020LANGUAGE_VERSIO" +
"N\"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HI" +
"DDEN\020\002\"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSIO" +
"N\020\000\022\024\n\020COMPILER_VERSION\020\001\022\017\n\013API_VERSION" +
"\020\002\"a\n\027VersionRequirementTable\022F\n\013require" +
"ment\030\001 \003(\01321.org.jetbrains.kotlin.metada",
"ta.VersionRequirement\"\217\002\n\017PackageFragmen" +
"t\022;\n\007strings\030\001 \001(\0132*.org.jetbrains.kotli" +
"n.metadata.StringTable\022J\n\017qualified_name" +
"s\030\002 \001(\01321.org.jetbrains.kotlin.metadata." +
"QualifiedNameTable\0227\n\007package\030\003 \001(\0132&.or" +
"g.jetbrains.kotlin.metadata.Package\0223\n\005c" +
"lass\030\004 \003(\0132$.org.jetbrains.kotlin.metada" +
"ta.Class*\005\010d\020\310\001\"A\n\010Contract\0225\n\006effect\030\001 " +
"\003(\0132%.org.jetbrains.kotlin.metadata.Effe" +
"ct\"\306\003\n\006Effect\022E\n\013effect_type\030\001 \001(\01620.org",
".jetbrains.kotlin.metadata.Effect.Effect" +
"Type\022N\n\033effect_constructor_argument\030\002 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Expres" +
"sion\022S\n conclusion_of_conditional_effect" +
"\030\003 \001(\0132).org.jetbrains.kotlin.metadata.E" +
"xpression\022B\n\004kind\030\004 \001(\01624.org.jetbrains." +
"kotlin.metadata.Effect.InvocationKind\"C\n" +
"\nEffectType\022\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CAL" +
"LS\020\001\022\024\n\020RETURNS_NOT_NULL\020\002\"G\n\016Invocation" +
"Kind\022\020\n\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001",
"\022\021\n\rAT_LEAST_ONCE\020\002\"\237\003\n\nExpression\022\020\n\005fl" +
"ags\030\001 \001(\005:\0010\022!\n\031value_parameter_referenc" +
"e\030\002 \001(\005\022O\n\016constant_value\030\003 \001(\01627.org.je" +
"tbrains.kotlin.metadata.Expression.Const" +
"antValue\022=\n\020is_instance_type\030\004 \001(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\033\n\023is_in" +
"stance_type_id\030\005 \001(\005\022?\n\014and_argument\030\006 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Expre" +
"ssion\022>\n\013or_argument\030\007 \003(\0132).org.jetbrai" +
"ns.kotlin.metadata.Expression\".\n\rConstan",
"tValue\022\010\n\004TRUE\020\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n" +
"\010Modality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRA" +
"CT\020\002\022\n\n\006SEALED\020\003*b\n\nVisibility\022\014\n\010INTERN" +
"AL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBL" +
"IC\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\n" +
"MemberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_OVER" +
"RIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003B" +
"\017B\rDebugProtoBuf"
"e\022\036\n\020expanded_type_id\030\007 \001(\005B\004\240\265\030\001\022=\n\nann" +
"otation\030\010 \003(\0132).org.jetbrains.kotlin.met" +
"adata.Annotation\022\033\n\023version_requirement\030" +
"\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001 \001(\005B",
"\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionRequirement\022\017\n\007v" +
"ersion\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022M\n\005le" +
"vel\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.VersionRequirement.Level:\005ERROR\022\022\n\nerr" +
"or_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\022e\n\014" +
"version_kind\030\006 \001(\0162=.org.jetbrains.kotli" +
"n.metadata.VersionRequirement.VersionKin" +
"d:\020LANGUAGE_VERSION\"+\n\005Level\022\013\n\007WARNING\020" +
"\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"J\n\013VersionKind\022" +
"\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020COMPILER_VERSIO",
"N\020\001\022\017\n\013API_VERSION\020\002\"a\n\027VersionRequireme" +
"ntTable\022F\n\013requirement\030\001 \003(\01321.org.jetbr" +
"ains.kotlin.metadata.VersionRequirement\"" +
"\217\002\n\017PackageFragment\022;\n\007strings\030\001 \001(\0132*.o" +
"rg.jetbrains.kotlin.metadata.StringTable" +
"\022J\n\017qualified_names\030\002 \001(\01321.org.jetbrain" +
"s.kotlin.metadata.QualifiedNameTable\0227\n\007" +
"package\030\003 \001(\0132&.org.jetbrains.kotlin.met" +
"adata.Package\0223\n\005class\030\004 \003(\0132$.org.jetbr" +
"ains.kotlin.metadata.Class*\005\010d\020\310\001\"A\n\010Con",
"tract\0225\n\006effect\030\001 \003(\0132%.org.jetbrains.ko" +
"tlin.metadata.Effect\"\306\003\n\006Effect\022E\n\013effec" +
"t_type\030\001 \001(\01620.org.jetbrains.kotlin.meta" +
"data.Effect.EffectType\022N\n\033effect_constru" +
"ctor_argument\030\002 \003(\0132).org.jetbrains.kotl" +
"in.metadata.Expression\022S\n conclusion_of_" +
"conditional_effect\030\003 \001(\0132).org.jetbrains" +
".kotlin.metadata.Expression\022B\n\004kind\030\004 \001(" +
"\01624.org.jetbrains.kotlin.metadata.Effect" +
".InvocationKind\"C\n\nEffectType\022\024\n\020RETURNS",
"_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n\020RETURNS_NOT_NU" +
"LL\020\002\"G\n\016InvocationKind\022\020\n\014AT_MOST_ONCE\020\000" +
"\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_LEAST_ONCE\020\002\"\245\003" +
"\n\nExpression\022\020\n\005flags\030\001 \001(\005:\0010\022!\n\031value_" +
"parameter_reference\030\002 \001(\005\022O\n\016constant_va" +
"lue\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.Expression.ConstantValue\022=\n\020is_instanc" +
"e_type\030\004 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022!\n\023is_instance_type_id\030\005 \001(\005B\004" +
"\240\265\030\001\022?\n\014and_argument\030\006 \003(\0132).org.jetbrai",
"ns.kotlin.metadata.Expression\022>\n\013or_argu" +
"ment\030\007 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Expression\".\n\rConstantValue\022\010\n\004TRUE\020\000" +
"\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n\005FIN" +
"AL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003" +
"*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020" +
"\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_" +
"TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DE" +
"CLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGA" +
"TION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -34648,26 +34658,44 @@ public final class DebugProtoBuf {
new java.lang.String[] { "Flags", "ValueParameterReference", "ConstantValue", "IsInstanceType", "IsInstanceTypeId", "AndArgument", "OrArgument", });
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalUpdateFileDescriptor(descriptor, registry);
org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.getDescriptor();

View File

@@ -3,18 +3,16 @@ import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import proguard.gradle.ProGuardTask
import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
extra["defaultSnapshotVersion"] = "1.4-SNAPSHOT"
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.50-dev-526", onlySuccessBootstrap = false))
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap("1.4.0-dev-1818", cacheRedirectorEnabled))
repositories {
bootstrapKotlinRepo?.let(::maven)
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
} else {
@@ -30,6 +28,7 @@ buildscript {
dependencies {
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.12")
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:6.1.0")
@@ -37,8 +36,11 @@ buildscript {
}
}
if (kotlinBuildProperties.buildScanServer != null) {
apply(from = "gradle/buildScanUserData.gradle")
}
plugins {
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
@@ -53,10 +55,10 @@ pill {
)
}
buildScan {
setTermsOfServiceUrl("https://gradle.com/terms-of-service")
setTermsOfServiceAgree("yes")
}
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val includeStdlibJsIr by extra(
findProperty("include.stdlib.js.ir")?.let { it.toString().toBoolean() } ?: isTeamcityBuild
)
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
@@ -69,7 +71,7 @@ val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
val kotlinVersion by extra(findProperty("deployVersion")?.toString() ?: buildNumber)
val kotlinLanguageVersion by extra("1.3")
val kotlinLanguageVersion by extra("1.4")
allprojects {
group = "org.jetbrains.kotlin"
@@ -115,8 +117,13 @@ extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
val jdkNotFoundConst = "JDK NOT FOUND"
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
if (isTeamcityBuild) {
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
} else {
extra["JDK_16"] = jdkPath("1.6", "1.8")
extra["JDK_17"] = jdkPath("1.7", "1.8")
}
extra["JDK_18"] = jdkPath("1.8")
extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPath("10")
@@ -144,7 +151,7 @@ rootProject.apply {
from(rootProject.file("gradle/jps.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
IdeVersionConfigurator.setCurrentIde(project)
extra["versions.protobuf"] = "2.6.1"
extra["versions.javax.inject"] = "1"
@@ -166,15 +173,16 @@ extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
extra["versions.completion-ranking-kotlin"] = "0.1.2"
extra["versions.r8"] = "1.5.70"
// 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"
extra["versions.kotlin-native"] = "1.4-dev-14579"
}
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)
@@ -190,11 +198,11 @@ extra["IntellijCoreDependencies"] =
"jdom",
"jna",
"log4j",
"picocontainer",
if (Platform[201].orHigher()) null else "picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
).filterNotNull()
extra["compilerModules"] = arrayOf(
@@ -212,10 +220,13 @@ extra["compilerModules"] = arrayOf(
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:backend.wasm",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":compiler:ir.serialization.jvm",
":kotlin-util-io",
":kotlin-util-klib",
":kotlin-util-klib-metadata",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
@@ -229,12 +240,14 @@ extra["compilerModules"] = arrayOf(
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":native:frontend.native",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:descriptors.runtime",
":core:deserialization",
":core:util.runtime",
":core:type-system",
@@ -242,17 +255,19 @@ extra["compilerModules"] = arrayOf(
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:lightTree",
":compiler:fir:fir2ir",
":compiler:fir:java"
":compiler:fir:java",
":compiler:fir:jvm"
)
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 },
// Exclude JS IR from core libs because it depends on local compiler build, which
// in turn depends on local JVM stdlib. It slows down library testing.
":kotlin-stdlib-js-ir".takeIf { includeStdlibJsIr },
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
@@ -260,8 +275,9 @@ val coreLibProjects = listOfNotNull(
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
":kotlin-test:kotlin-test-js".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlin-reflect",
":kotlin-coroutines-experimental-compat"
)
val gradlePluginProjects = listOf(
@@ -324,6 +340,8 @@ allprojects {
maven(intellijRepo)
maven("https://dl.bintray.com/kotlin/ktor")
maven("https://kotlin.bintray.com/kotlin-dependencies")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies")
maven("https://dl.google.com/dl/android/maven2")
bootstrapKotlinRepo?.let(::maven)
internalKotlinRepo?.let(::maven)
}
@@ -332,10 +350,9 @@ allprojects {
val commonCompilerArgs = listOfNotNull(
"-Xuse-experimental=kotlin.Experimental",
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
"-progressive".takeIf { hasProperty("test.progressive.mode") }
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
@@ -364,11 +381,23 @@ allprojects {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
task("listArchives") { listConfigurationContents("archives") }
tasks.withType<AbstractArchiveTask> {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
task("listRuntimeJar") { listConfigurationContents("runtimeJar") }
tasks.withType<Test> {
outputs.cacheIf { false }
// https://youtrack.jetbrains.com/issue/KT-37089
}
task("listDistJar") { listConfigurationContents("distJar") }
tasks {
register("listArchives") { listConfigurationContents("archives") }
register("listRuntimeJar") { listConfigurationContents("runtimeJar") }
register("listDistJar") { listConfigurationContents("distJar") }
}
afterEvaluate {
if (javaHome != defaultJavaHome || jvmTarget != defaultJvmTarget) {
@@ -386,10 +415,12 @@ allprojects {
} 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") } }
tasks {
register("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
register("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
register("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
register("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
}
}
run configureCompilerClasspath@{
@@ -397,6 +428,9 @@ allprojects {
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
@@ -417,13 +451,13 @@ 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
}
}
@@ -443,29 +477,29 @@ val ideaPlugin by task<Task> {
}
tasks {
create("clean") {
register("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
}
}
create("cleanupArtifacts") {
register("cleanupArtifacts") {
doLast {
delete(artifactsDir)
}
}
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
create("coreLibs${taskName.capitalize()}") {
register("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
}
create("coreLibsTest") {
register("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlin-test:kotlin-test-js:kotlin-test-js-it".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
@@ -473,99 +507,141 @@ tasks {
}
}
create("gradlePluginTest") {
register("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn("$it:check")
}
}
create("gradlePluginIntegrationTest") {
register("gradlePluginIntegrationTest") {
dependsOn(":kotlin-gradle-plugin-integration-tests:check")
}
create("jvmCompilerTest") {
register("jvmCompilerTest") {
dependsOn("dist")
dependsOn(
":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests"
":compiler:tests-spec:remoteRunTests",
":compiler:tests-against-klib:test"
)
dependsOn(":plugins:jvm-abi-gen:test")
}
create("jsCompilerTest") {
register("jvmCompilerIntegrationTest") {
dependsOn(
":kotlin-compiler-embeddable:test",
":kotlin-compiler-client-embeddable:test"
)
}
register("jsCompilerTest") {
dependsOn(":js:js.tests:test")
dependsOn(":js:js.tests:runMocha")
}
create("firCompilerTest") {
register("wasmCompilerTest") {
// TODO: fix once
// dependsOn(":js:js.tests:wasmTest")
}
register("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
dependsOn(":compiler:fir:lightTree:test")
}
create("scriptingTest") {
register("firAllTest") {
dependsOn(
":compiler:fir:psi2fir:test",
":compiler:fir:lightTree:test",
":compiler:fir:resolve:test",
":compiler:fir:fir2ir:test",
":idea:firTest"
)
}
register("compilerFrontendVisualizerTest") {
dependsOn("compiler:visualizer:test")
}
register("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-common:test")
dependsOn(":kotlin-scripting-jvm:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-dependencies:test")
dependsOn(":kotlin-scripting-dependencies-maven:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
// see comments on the task in kotlin-scripting-jvm-host-test
// dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
}
create("compilerTest") {
register("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("wasmCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
dependsOn(":core:descriptors.runtime:test")
dependsOn("jvmCompilerIntegrationTest")
}
create("toolsTest") {
register("toolsTest") {
dependsOn(":tools:kotlinp:test")
}
create("examplesTest") {
register("examplesTest") {
dependsOn("dist")
(project(":examples").subprojects + project(":kotlin-gradle-subplugin-example")).forEach { p ->
dependsOn("${p.path}:check")
}
}
create("distTest") {
register("distTest") {
dependsOn("compilerTest")
dependsOn("toolsTest")
dependsOn("gradlePluginTest")
dependsOn("examplesTest")
}
create("specTest") {
register("specTest") {
dependsOn("dist")
dependsOn(":compiler:tests-spec:test")
}
create("androidCodegenTest") {
register("androidCodegenTest") {
dependsOn(":compiler:android-tests:test")
}
create("jps-tests") {
register("jps-tests") {
dependsOn("dist")
dependsOn(":jps-plugin:test")
}
create("idea-plugin-main-tests") {
register("konan-tests") {
dependsOn("dist")
dependsOn(
":native:kotlin-klib-commonizer:test"
)
}
register("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
}
create("idea-plugin-additional-tests") {
register("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-gradle:test",
@@ -576,19 +652,36 @@ tasks {
":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"
":idea:jvm-debugger:eval4j:test",
":idea:scripting-support:test"
)
}
create("idea-plugin-tests") {
register("idea-new-project-wizard-tests") {
dependsOn("dist")
dependsOn(
":libraries:tools:new-project-wizard:test",
":libraries:tools:new-project-wizard:new-project-wizard-cli:test"
)
}
register("idea-plugin-tests") {
dependsOn("dist")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
"idea-plugin-additional-tests",
"idea-new-project-wizard-tests"
)
}
create("android-ide-tests") {
register("idea-plugin-performance-tests") {
dependsOn("dist")
dependsOn(
":idea:performanceTests:performanceTest"
)
}
register("android-ide-tests") {
dependsOn("dist")
dependsOn(
":plugins:android-extensions-ide:test",
@@ -597,7 +690,7 @@ tasks {
)
}
create("plugins-tests") {
register("plugins-tests") {
dependsOn("dist")
dependsOn(
":kotlin-annotation-processing:test",
@@ -608,15 +701,17 @@ tasks {
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test"
":kotlinx-serialization-ide-plugin:test",
":idea:jvm-debugger:jvm-debugger-test:test"
)
}
create("ideaPluginTest") {
register("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"konan-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
@@ -624,13 +719,13 @@ tasks {
}
create("test") {
register("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
}
}
create("check") {
register("check") {
dependsOn("test")
}
}
@@ -709,17 +804,23 @@ configure<IdeaModel> {
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
"dist",
"tmp"
).toSet()
}
}
fun jdkPath(version: String): String {
fun jdkPathOrNull(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
}
fun jdkPath(version: String, vararg replacementVersions: String): String {
return jdkPathOrNull(version) ?: run {
replacementVersions.asSequence().map { jdkPathOrNull(it) }.find { it != null }
} ?: jdkNotFoundConst
}
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
val currentJavaHome = File(System.getProperty("java.home")!!).canonicalPath
@@ -769,49 +870,51 @@ fun Project.configureShadowJarSubstitutionInCompileClasspath() {
}
}
tasks.create("findShadowJarsInClasspath").doLast {
fun Collection<File>.printSorted(indent: String = " ") {
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) }
}
tasks.register("findShadowJarsInClasspath") {
doLast {
fun Collection<File>.printSorted(indent: String = " ") {
sortedBy { it.path }.forEach { println(indent + it.relativeTo(rootProject.projectDir)) }
}
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(fileFrom(task.outputFile))
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) }
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
}
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(fileFrom(task.outputFile))
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
}
}
}
}
}
shadowJars.removeAll(mainJars)
println("Shadow jars that might break incremental compilation:")
shadowJars.printSorted()
shadowJars.removeAll(mainJars)
println("Shadow jars that might break incremental compilation:")
shadowJars.printSorted()
fun Project.checkConfig(configName: String) {
val config = configurations.findByName(configName) ?: return
val shadowJarsInConfig = config.resolvedConfiguration.files.filter { it in shadowJars }
if (shadowJarsInConfig.isNotEmpty()) {
println()
println("Project $project contains shadow jars in configuration '$configName':")
shadowJarsInConfig.printSorted()
fun Project.checkConfig(configName: String) {
val config = configurations.findByName(configName) ?: return
val shadowJarsInConfig = config.resolvedConfiguration.files.filter { it in shadowJars }
if (shadowJarsInConfig.isNotEmpty()) {
println()
println("Project $project contains shadow jars in configuration '$configName':")
shadowJarsInConfig.printSorted()
}
}
}
for (project in rootProject.allprojects) {
project.sourceSetsOrNull?.forEach { sourceSet ->
project.checkConfig(sourceSet.compileClasspathConfigurationName)
for (project in rootProject.allprojects) {
project.sourceSetsOrNull?.forEach { sourceSet ->
project.checkConfig(sourceSet.compileClasspathConfigurationName)
}
}
}
}

View File

@@ -1,6 +1,3 @@
import java.util.Properties
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
buildscript {
@@ -12,8 +9,10 @@ buildscript {
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/kotlin.bintray.com/kotlin-dependencies")
} else {
jcenter()
maven("https://kotlin.bintray.com/kotlin-dependencies")
}
buildSrcKotlinRepo?.let {
@@ -22,6 +21,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.12")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$buildSrcKotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:$buildSrcKotlinVersion")
}
@@ -45,10 +45,6 @@ plugins {
gradlePlugin {
plugins {
register("pill-configurable") {
id = "pill-configurable"
implementationClass = "org.jetbrains.kotlin.pill.PillConfigurablePlugin"
}
register("jps-compatible") {
id = "jps-compatible"
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
@@ -66,26 +62,26 @@ rootProject.apply {
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val flags = LocalBuildProperties(project)
val isTeamcityBuild = flags.isTeamcityBuild
val intellijUltimateEnabled by extra(flags.intellijUltimateEnabled)
val isTeamcityBuild = kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(kotlinBuildProperties.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"
else
"releases"
extra["intellijReleaseType"] = when {
extra["versions.intellijSdk"]?.toString()?.contains("-EAP-") == true -> "snapshots"
extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true -> "nightly"
else -> "releases"
}
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build"
repositories {
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://kotlin.bintray.com/kotlin-dependencies")
gradlePluginPortal()
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
@@ -93,16 +89,18 @@ repositories {
}
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")
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.12")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
implementation("com.jakewharton.dex:dex-method-list:3.0.0")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
implementation("com.github.jengelman.gradle.plugins:shadow:${rootProject.extra["versions.shadow"]}")
implementation("org.jetbrains.intellij.deps:asm-all:7.0.1")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}
samWithReceiver {
@@ -126,30 +124,3 @@ allprojects {
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

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

@@ -104,15 +104,18 @@ val nodeJSPlugin by configurations.creating
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = rootProject.rootDir.parentFile.resolve("dependencies/repo")
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")))
val extension = if (androidStudioOs == "linux")
"tar.gz"
else
"zip"
@@ -141,7 +144,7 @@ dependencies {
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
@@ -218,7 +221,7 @@ tasks.named("build") {
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
tasks.register<Delete>("cleanLegacy") {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
@@ -370,10 +373,7 @@ fun writeIvyXml(
sourcesJar.forEach { jarFile ->
emptyElement("artifact") {
val sourcesArtifactName = jarFile.name
.substringBeforeLast("-")
.substringBeforeLast("-")
val sourcesArtifactName = jarFile.name.substringBefore("-$version")
attributes(
"name" to sourcesArtifactName,
"type" to "jar",

View File

@@ -11,68 +11,61 @@ pluginManagement {
}
}
buildscript {
repositories {
if (cacheRedirectorEnabled == 'true') {
maven { url "https://cache-redirector.jetbrains.com/kotlin.bintray.com/kotlin-dependencies" }
} else {
maven { url "https://kotlin.bintray.com/kotlin-dependencies" }
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.12")
}
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
def projectVersions = file("../gradle/versions.properties").text
BuildCacheKt.setupBuildCache(settings)
include "prepare-deps"
def flags = new LocalBuildProperties(settings as Settings)
def target_AppCode_Clion = buildProperties.includeCidrPlugins && !projectVersions.contains("versions.androidStudioRelease")
def target_AndroidStudio = buildProperties.includeCidrPlugins && projectVersions.contains("versions.androidStudioRelease")
def target_IdeaUltimate = buildProperties.includeUltimate
if (target_AppCode_Clion) {
logger.info("Including modules for AC and CL in buildSrc/settings.gradle")
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")
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
} else if (target_AndroidStudio) {
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")
include ":prepare-deps:cocoa-common-binaries"
include ":prepare-deps:lldb-framework"
include ":prepare-deps:lldb-frontend"
project(":prepare-deps:cocoa-common-binaries").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/cocoa-common-binaries")
project(":prepare-deps:lldb-framework").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-framework")
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
} else if (target_IdeaUltimate) {
logger.info("Including modules for IU 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")
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.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
}
}
logger.info("Not including extra modules in buildSrc/settings.gradle")
}

View File

@@ -2,18 +2,24 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.*
import java.net.URI
var Project.bootstrapKotlinVersion: String
get() = this.property("bootstrapKotlinVersion") as String
private set(value) { this.extra["bootstrapKotlinVersion"] = value }
private set(value) {
this.extra["bootstrapKotlinVersion"] = value
}
var Project.bootstrapKotlinRepo: String?
get() = this.property("bootstrapKotlinRepo") as String?
private set(value) { this.extra["bootstrapKotlinRepo"] = value }
private set(value) {
this.extra["bootstrapKotlinRepo"] = value
}
val Project.internalKotlinRepo: String?
get() = bootstrapKotlinRepo?.replace("artifacts/content/maven/", "artifacts/content/internal/repo")
get() = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:$bootstrapKotlinVersion," +
"branch:default:any/artifacts/content/internal/repo"
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
@@ -23,8 +29,16 @@ fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val teamCityProject = project.findProperty("bootstrap.teamcity.project") as String?
val bootstrapSource = when {
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(project.findProperty("bootstrap.local.version") as String?, project.findProperty("bootstrap.local.path") as String?)
teamCityVersion != null -> BootstrapOption.TeamCity(teamCityVersion, teamCityBuild, projectExtId = teamCityProject, onlySuccessBootstrap = false)
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(
project.findProperty("bootstrap.local.version") as String?,
project.findProperty("bootstrap.local.path") as String?
)
teamCityVersion != null -> BootstrapOption.TeamCity(
teamCityVersion,
teamCityBuild,
projectExtId = teamCityProject,
onlySuccessBootstrap = false
)
customVersion != null -> BootstrapOption.Custom(kotlinVersion = customVersion, repo = customRepo)
else -> defaultSource
}
@@ -40,15 +54,23 @@ sealed class BootstrapOption {
*
* If [repo] is not specified the default buildscript and project repositories are used
*/
open class Custom(val kotlinVersion: String, val repo: String?) : BootstrapOption() {
open class Custom(val kotlinVersion: String, val repo: String?, val cacheRedirector: Boolean = false) : BootstrapOption() {
override fun applyToProject(project: Project) {
project.bootstrapKotlinVersion = kotlinVersion
project.bootstrapKotlinRepo = repo
project.bootstrapKotlinRepo = if (cacheRedirector)
repo?.let { URI(it) }?.let { "https://cache-redirector.jetbrains.com/${it.host}/${it.path}" }
else
repo
}
}
/** Get bootstrap from kotlin-dev bintray repo, where bootstraps are published */
class BintrayDev(kotlinVersion: String) : Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-dev")
/** Get bootstrap from kotlin-dev bintray repo */
class BintrayDev(kotlinVersion: String, cacheRedirector: Boolean = false) :
Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-dev", cacheRedirector)
/** Get bootstrap from kotlin-bootstrap bintray repo, where bootstraps are published */
class BintrayBootstrap(kotlinVersion: String, cacheRedirector: Boolean = false) :
Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-bootstrap", cacheRedirector)
/** Get bootstrap from teamcity maven artifacts of the specified build configuration
*
@@ -57,10 +79,17 @@ sealed class BootstrapOption {
* [projectExtId] extId of a teamcity build configuration, by default "Kotlin_dev_Compiler",
* [onlySuccessBootstrap] allow artifacts only from success builds of the default branch tagged with 'bootstrap' tag
*/
class TeamCity(val kotlinVersion: String, val buildNumber: String? = null, val projectExtId: String? = null, val onlySuccessBootstrap: Boolean = true) : BootstrapOption() {
class TeamCity(
val kotlinVersion: String,
val buildNumber: String? = null,
val projectExtId: String? = null,
val onlySuccessBootstrap: Boolean = true,
val teamcityUrl: String = "https://teamcity.jetbrains.com"
) : BootstrapOption() {
override fun applyToProject(project: Project) {
val query = if (onlySuccessBootstrap) "status:SUCCESS,tag:bootstrap,pinned:true" else "branch:default:any"
project.bootstrapKotlinRepo = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinRepo = "$teamcityUrl/guestAuth/app/rest/builds/buildType:(id:${projectExtId
?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinVersion = kotlinVersion
}
}

View File

@@ -10,13 +10,13 @@ import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.*
import java.io.File
import java.util.concurrent.Callable
inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit) = tasks.creating(T::class, configuration)
inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit) = tasks.registering(T::class, configuration)
inline fun <reified T : Task> Project.eagerTask(noinline configuration: T.() -> Unit) = tasks.creating(T::class, configuration)
fun Project.callGroovy(name: String, vararg args: Any?): Any? {
return (property(name) as Closure<*>).call(*args)
@@ -67,3 +67,5 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
inline fun CopySourceSpec.from(crossinline filesProvider: () -> Any?): CopySourceSpec = from(Callable { filesProvider() })
fun Project.javaPluginConvention(): JavaPluginConvention = the()
fun Project.findJavaPluginConvention(): JavaPluginConvention? = convention.findByType() ?: convention.findPlugin()

View File

@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P181, P182, P183, P191, P192;
P183, P191, P192, P193, P201;
val version: Int = name.drop(1).toInt()
@@ -41,17 +41,14 @@ enum class Platform : CompatibilityPredicate {
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
IJ192(Platform.P192),
IJ193(Platform.P193),
IJ201(Platform.P201),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183),
AS35(Platform.P183),
AS36(Platform.P192);
AS36(Platform.P192),
AS40(Platform.P193);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -1,6 +1,7 @@
import org.gradle.api.Project
import org.gradle.api.tasks.JavaExec
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.task
/*
@@ -8,7 +9,8 @@ import org.gradle.kotlin.dsl.task
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> {
// creating class eagerly here: using register causes problems due to quite complicated relationships between these tasks
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = tasks.creating(JavaExec::class) {
configure()
passClasspathInJar()
}

View File

@@ -8,17 +8,12 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
import java.io.File
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -52,11 +47,11 @@ fun Project.removeArtifacts(configuration: Configuration, task: Task) {
}
fun Project.noDefaultJar() {
tasks.findByName("jar")?.let { defaultJarTask ->
defaultJarTask.enabled = false
defaultJarTask.actions = emptyList()
tasks.named("jar").configure {
enabled = false
actions = emptyList()
configurations.forEach { cfg ->
removeArtifacts(cfg, defaultJarTask)
removeArtifacts(cfg, this)
}
}
}
@@ -69,12 +64,11 @@ fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: Configurabl
}
}
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
extra["runtimeJarTask"] = task
tasks.findByName("jar")?.let { defaultJarTask ->
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {}): TaskProvider<T> {
tasks.named<Jar>("jar").configure {
removeArtifacts(configurations.getOrCreate("archives"), this)
}
return task.apply {
task.configure {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
@@ -86,9 +80,10 @@ fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
body()
project.runtimeJarArtifactBy(this, this)
}
return task
}
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
val task = tasks.register<Jar>("sourcesJar") {
@@ -103,7 +98,12 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
.resolvedArtifacts
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.map { project(it.projectPath).mainSourceSet.allSource }
.mapNotNull {
project(it.projectPath)
.findJavaPluginConvention()
?.mainSourceSet
?.allSource
}
})
}
@@ -116,15 +116,19 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
return task
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "javadoc"
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
val javadocTask = getOrCreateTask<Jar>("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
}
body()
project.addArtifact("archives", this, this)
addArtifact("archives", javadocTask)
return javadocTask
}
@@ -151,11 +155,6 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
private fun Project.runtimeJarTaskIfExists(): Task? =
if (extra.has("runtimeJarTask")) extra["runtimeJarTask"] as Task
else tasks.findByName("jar")
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {

View File

@@ -1,117 +0,0 @@
import org.gradle.api.Project
import org.gradle.api.initialization.Settings
import org.gradle.api.internal.DynamicObjectAware
import java.io.File
import java.util.*
/*
* 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.
*/
interface PropertiesProvider {
val rootProjectDir: File
fun getProperty(key: String): Any?
}
class KotlinBuildProperties(
private val propertiesProvider: PropertiesProvider
) {
private val localProperties: Properties = Properties()
init {
val localPropertiesFile = propertiesProvider.rootProjectDir.resolve("local.properties")
if (localPropertiesFile.isFile) {
localPropertiesFile.reader().use(localProperties::load)
}
}
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
private fun getBoolean(key: String, default: Boolean = false): Boolean =
(this[key]?.toString()?.toBoolean() ?: default) == true
val isJpsBuildEnabled: Boolean = getBoolean("jpsBuild")
val isInIdeaSync: Boolean = run {
// "idea.sync.active" was introduced in 2019.1
System.getProperty("idea.sync.active")?.toBoolean() == true || let {
// before 2019.1 there is "idea.active" that was true only on sync,
// but since 2019.1 "idea.active" present in task execution too.
// So let's check Idea version
val majorIdeaVersion = System.getProperty("idea.version")
?.split(".")
?.getOrNull(0)
val isBeforeIdea2019 = majorIdeaVersion == null || majorIdeaVersion.toInt() < 2019
isBeforeIdea2019 && System.getProperty("idea.active")?.toBoolean() == true
}
}
val isInJpsBuildIdeaSync: Boolean
get() = isJpsBuildEnabled && isInIdeaSync
val includeJava9: Boolean
get() = !isInJpsBuildIdeaSync && getBoolean("kotlin.build.java9", true)
val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync || getBoolean("kotlin.build.useBootstrapStdlib", false)
private val kotlinUltimateExists: Boolean = propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
val isTeamcityBuild: Boolean = getBoolean("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled: Boolean
get() {
val explicitlyEnabled = getBoolean("intellijUltimateEnabled")
if (!kotlinUltimateExists && explicitlyEnabled) {
error("intellijUltimateEnabled property is set, while kotlin-ultimate repository is not provided")
}
return kotlinUltimateExists && (explicitlyEnabled || isTeamcityBuild)
}
val includeCidrPlugins: Boolean = kotlinUltimateExists && getBoolean("cidrPluginsEnabled")
val includeUltimate: Boolean = kotlinUltimateExists && (isTeamcityBuild || intellijUltimateEnabled)
val postProcessing: Boolean get() = isTeamcityBuild || getBoolean("kotlin.build.postprocessing", true)
val relocation: Boolean get() = postProcessing
val proguard: Boolean get() = postProcessing && getBoolean("kotlin.build.proguard", isTeamcityBuild)
val jsIrDist: Boolean get() = getBoolean("kotlin.stdlib.js.ir.dist")
}
private const val extensionName = "kotlinBuildProperties"
class ProjectProperties(val project: Project) : PropertiesProvider {
override val rootProjectDir: File
get() = project.projectDir
override fun getProperty(key: String): Any? = project.findProperty(key)
}
val Project.kotlinBuildProperties: KotlinBuildProperties
get() = rootProject.extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(ProjectProperties(rootProject)).also {
rootProject.extensions.add(extensionName, it)
}
class SettingsProperties(val settings: Settings) : PropertiesProvider {
override val rootProjectDir: File
get() = settings.rootDir
override fun getProperty(key: String): Any? {
val obj = (settings as DynamicObjectAware).asDynamicObject
return if (obj.hasProperty(key)) obj.getProperty(key) else null
}
}
fun getKotlinBuildPropertiesForSettings(settings: Any) = (settings as Settings).kotlinBuildProperties
val Settings.kotlinBuildProperties: KotlinBuildProperties
get() = extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(SettingsProperties(this)).also {
extensions.add(extensionName, it)
}

View File

@@ -8,14 +8,21 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
val Project.isSnapshotIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT")
private val Project.isEAPIntellij get() = rootProject.extra["versions.intellijSdk"].toString().contains("-EAP-")
private val Project.isNightlyIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT") && !isEAPIntellij
val Project.intellijRepo get() = "https://www.jetbrains.com/intellij-repository/" + if (isSnapshotIntellij) "snapshots" else "releases"
val Project.intellijRepo get() =
when {
isEAPIntellij -> "https://www.jetbrains.com/intellij-repository/snapshots"
isNightlyIntellij -> "https://www.jetbrains.com/intellij-repository/nightly"
else -> "https://www.jetbrains.com/intellij-repository/releases"
}
fun Project.commonDep(coord: String): String {
val parts = coord.split(':')
@@ -128,7 +135,9 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
}
fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): File? =
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
val compilerManifestClassPath

View File

@@ -3,8 +3,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.tasks.TaskProvider
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
import org.gradle.kotlin.dsl.*
import java.io.File
@@ -59,12 +59,12 @@ private fun ShadowJar.configureEmbeddableCompilerRelocation(withJavaxInject: Boo
}
}
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): Jar {
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): TaskProvider<out ShadowJar> {
val compilerJar = configurations.getOrCreate("compilerJar")
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
return task<ShadowJar>(taskName) {
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerJar)
@@ -72,31 +72,39 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
}
}
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): Jar =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()
body()
}
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<out ShadowJar> =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()
body()
}
fun Project.compilerDummyForDependenciesRewriting(taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}): Jar =
compilerShadowJar(taskName) {
exclude(packagesToExcludeFromDummy)
body()
}
fun Project.compilerDummyForDependenciesRewriting(
taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}
): TaskProvider<out Jar> =
compilerShadowJar(taskName) {
exclude(packagesToExcludeFromDummy)
body()
}
const val COMPILER_DUMMY_JAR_CONFIGURATION_NAME = "compilerDummyJar"
fun Project.compilerDummyJar(task: Jar, body: Jar.() -> Unit = {}) {
task.body()
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, task, task)
fun Project.compilerDummyJar(task: TaskProvider<out Jar>, body: Jar.() -> Unit = {}) {
task.configure(body)
task.configure {
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, this, this)
}
}
fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "embeddable", body: Jar.() -> Unit = {}): Jar {
fun Project.embeddableCompilerDummyForDependenciesRewriting(
taskName: String = "embeddable", body: Jar.() -> Unit = {}
): TaskProvider<ShadowJar> {
val compilerDummyJar = configurations.getOrCreate("compilerDummyJar")
dependencies.add(compilerDummyJar.name,
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME))
dependencies.add(
compilerDummyJar.name,
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME)
)
return task<ShadowJar>(taskName) {
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerDummyJar)
@@ -105,14 +113,16 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "
}
}
fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, body: Jar.() -> Unit = {}): Jar {
originalJarTask.apply {
fun Project.rewriteDepsToShadedJar(
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}
): TaskProvider<out Jar> {
originalJarTask.configure {
classifier = "original"
}
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
return shadowJarTask.apply {
shadowJarTask.configure {
dependsOn(originalJarTask)
from(originalJarTask)// { include("**") }
@@ -123,7 +133,11 @@ fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, bod
classifier = ""
body()
}
return shadowJarTask
}
fun Project.rewriteDepsToShadedCompiler(originalJarTask: Jar, body: Jar.() -> Unit = {}): Jar =
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
fun Project.rewriteDepsToShadedCompiler(originalJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
fun Project.rewriteDefaultJarDepsToShadedCompiler(body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
rewriteDepsToShadedJar(tasks.named<Jar>("jar"), embeddableCompilerDummyForDependenciesRewriting(), body)

View File

@@ -44,10 +44,29 @@ fun Project.configureFormInstrumentation() {
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
val originalClassesDirs = files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy"))
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
+ originalClassesDirs)
// Since Kotlin 1.3.60, the friend paths available to the test compile task are calculated as the main source set's
// output.classesDirs. Since the classesDirs are excluded from the classpath (replaced by the originalClassesDirs),
// in order to be able to access the internals of 'main', tests need to receive the original classes dirs as a
// -Xfriend-paths compiler argument as well.
fun addFreeCompilerArgs(kotlinCompileTask: AbstractCompile, vararg args: String) {
val getKotlinOptions = kotlinCompileTask::class.java.getMethod("getKotlinOptions")
val kotlinOptions = getKotlinOptions(kotlinCompileTask)
val getFreeCompilerArgs = kotlinOptions::class.java.getMethod("getFreeCompilerArgs")
val freeCompilerArgs = getFreeCompilerArgs(kotlinOptions) as List<*>
val setFreeCompilerArgs = kotlinOptions::class.java.getMethod("setFreeCompilerArgs", List::class.java)
setFreeCompilerArgs(kotlinOptions, freeCompilerArgs + args)
}
addFreeCompilerArgs(testCompile, "-Xfriend-paths=" + originalClassesDirs.joinToString(",") { it.absolutePath })
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
@@ -68,16 +87,15 @@ fun Project.configureFormInstrumentation() {
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask =
project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
}
project.tasks.register(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java) {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
outputs.dir(instrumentedClassesDir)
}
instrumentTask.outputs.dir(instrumentedClassesDir)
// Ensure that our task is invoked when the source set is built
sourceSetParam.compiledBy(instrumentTask)
@Suppress("UNUSED_EXPRESSION")
@@ -93,17 +111,21 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
private const val LOADER_REF = "java2.loader"
}
var sourceSet: SourceSet? = null
@Classpath
var instrumentationClasspath: Configuration? = null
@Input
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
var originalClassesDirs: FileCollection? = null
@get:Input
var instrumentNotNull: Boolean = false
@Internal
var sourceSet: SourceSet? = null
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })

View File

@@ -4,6 +4,7 @@ import net.rubygrapefruit.platform.Native
import net.rubygrapefruit.platform.WindowsRegistry
import org.gradle.api.GradleException
import org.gradle.api.Project
import java.nio.file.Paths
import java.io.File
import net.rubygrapefruit.platform.WindowsRegistry.Key.HKEY_LOCAL_MACHINE
import org.gradle.internal.os.OperatingSystem
@@ -25,7 +26,7 @@ fun Project.getConfiguredJdks(): List<JdkId> {
?: System.getenv(jdkMajorVersion.name)
?: jdkAlternativeVarNames[jdkMajorVersion]?.mapNotNull { System.getenv(it) }?.firstOrNull()
?: continue
val explicitJdk = File(explicitJdkEnvVal)
val explicitJdk = Paths.get(explicitJdkEnvVal).toRealPath().toFile()
if (!explicitJdk.isDirectory) {
throw GradleException("Invalid environment value $jdkMajorVersion: $explicitJdkEnvVal, expecting JDK home path")
}

View File

@@ -23,10 +23,14 @@ import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.kotlinBuildLocalRepoDir() = File("${project.rootDir.absoluteFile}/dependencies/repo")
private fun Project.kotlinBuildLocalDependenciesDir(): File =
(findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File) ?: project.rootDir.absoluteFile.resolve("dependencies")
private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenciesDir().resolve("repo")
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
@@ -151,9 +155,9 @@ fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: D
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): TaskProvider<JavaExec> {
return task<JavaExec>(name) {
return tasks.register<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2020 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.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Plugin
import org.gradle.api.Project
@Suppress("unused")
class JpsCompatiblePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)
project.extensions.create("pill", PillExtension::class.java)
// 'jpsTest' does not require the 'tests-jar' artifact
project.configurations.create("jpsTest")
if (project == project.rootProject) {
project.tasks.create("pill") {
dependsOn(":pill:pill-importer:pill")
if (System.getProperty("pill.android.tests", "false") == "true") {
TaskUtils.useAndroidSdk(this)
TaskUtils.useAndroidJar(this)
}
}
project.tasks.create("unpill") {
dependsOn(":pill:pill-importer:unpill")
}
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2010-2020 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.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
open class PillExtension {
enum class Variant {
// Default variant (./gradlew pill)
BASE() {
override val includes = setOf(BASE)
},
// Full variant (./gradlew pill -Dpill.variant=full)
FULL() {
override val includes = setOf(BASE, FULL)
},
// Do not import the project to JPS model, but set some options for it
NONE() {
override val includes = emptySet<Variant>()
},
// 'BASE' if the "jps-compatible" plugin is applied, 'NONE' otherwise
DEFAULT() {
override val includes = emptySet<Variant>()
};
abstract val includes: Set<Variant>
}
open var variant: Variant = Variant.DEFAULT
open var excludedDirs: List<File> = emptyList()
@Suppress("unused")
fun Project.excludedDirs(vararg dirs: String) {
excludedDirs = excludedDirs + dirs.map { File(projectDir, it) }
}
@Suppress("unused")
fun serialize() = mapOf<String, Any?>(
"variant" to variant.name,
"excludedDirs" to excludedDirs
)
}

View File

@@ -1,33 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
class DependencyMapper(val predicate: (ResolvedArtifact) -> Boolean, val mapping: (ResolvedArtifact) -> MappedDependency?) {
companion object {
fun forProject(path: String, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ProjectComponentIdentifier
identifier?.projectPath == path
},
mapping = mapping
)
}
fun forModule(group: String, module: String, version: String?, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ModuleComponentIdentifier
identifier?.group == group && identifier?.module == module && (version == null || identifier?.version == version)
},
mapping = mapping
)
}
}
}
class MappedDependency(val main: PDependency?, val deferred: List<PDependency> = emptyList())
class ParserContext(val dependencyMappers: List<DependencyMapper>, val variant: PillExtension.Variant)

View File

@@ -1,94 +0,0 @@
/*
* 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.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
data class PDependencies(val main: List<PDependency>, val deferred: List<PDependency>) {
fun join(): List<PDependency> {
return main + deferred
}
}
fun Project.resolveDependencies(
configuration: Configuration,
forTests: Boolean,
dependencyMappers: List<DependencyMapper>,
withEmbedded: Boolean = false
): PDependencies {
val dependencies = mutableListOf<PDependency>()
val deferred = mutableListOf<PDependency>()
nextArtifact@ for (artifact in configuration.resolvedConfiguration.resolvedArtifacts) {
val identifier = artifact.id.componentIdentifier
for (mapper in dependencyMappers) {
if (mapper.predicate(artifact)) {
val mapped = mapper.mapping(artifact)
if (mapped != null) {
mapped.main?.let { dependencies += it }
deferred += mapped.deferred
}
continue@nextArtifact
}
}
fun addProjectDependency(projectPath: String) {
val project = rootProject.findProject(projectPath) ?: error("Cannot find project $projectPath")
fun addSourceSet(name: String, suffix: String): Boolean {
val sourceSet = project.sourceSets?.findByName(name)?.takeIf { !it.allSource.isEmpty() } ?: return false
dependencies += PDependency.Module(project.pillModuleName + '.' + suffix)
return true
}
if (forTests && artifact.classifier == "tests") {
addSourceSet(SourceSet.TEST_SOURCE_SET_NAME, "test") || addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
} else {
addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
}
if (withEmbedded) {
val embeddedConfiguration = project.configurations.findByName(EmbeddedComponents.CONFIGURATION_NAME)
if (embeddedConfiguration != null) {
dependencies += resolveDependencies(embeddedConfiguration, forTests, dependencyMappers, withEmbedded).join()
}
}
}
when (identifier) {
is ProjectComponentIdentifier -> addProjectDependency(identifier.projectPath)
is LibraryBinaryIdentifier -> addProjectDependency(identifier.projectPath)
is ModuleComponentIdentifier -> {
val file = artifact.file
val library = PLibrary(file.name, classes = listOf(file))
dependencies += PDependency.ModuleLibrary(library)
}
}
}
val existingFiles = mutableSetOf<File>()
for (dependency in configuration.dependencies) {
if (dependency !is SelfResolvingDependency) {
continue
}
val files = dependency.resolve().filter { it !in existingFiles }.takeIf { it.isNotEmpty() } ?: continue
existingFiles.addAll(files)
val library = PLibrary(dependency.name, classes = files.toList())
deferred += PDependency.ModuleLibrary(library)
}
return PDependencies(dependencies, deferred)
}

View File

@@ -1,39 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
open class PillExtension {
enum class Variant {
// Default variant (./gradlew pill)
BASE() { override val includes = setOf(BASE) },
// Full variant (./gradlew pill -Dpill.variant=full)
FULL() { override val includes = setOf(BASE, FULL) },
// Do not import the project to JPS model, but set some options for it
NONE() { override val includes = emptySet<Variant>() },
// 'BASE' if the "jps-compatible" plugin is applied, 'NONE' otherwise
DEFAULT() { override val includes = emptySet<Variant>() };
abstract val includes: Set<Variant>
}
open var variant: Variant = Variant.DEFAULT
open var importAsLibrary: Boolean = false
open var excludedDirs: List<File> = emptyList()
fun Project.excludedDirs(vararg dirs: String) {
excludedDirs = excludedDirs + dirs.map { File(projectDir, it) }
}
open var libraryPath: File? = null
set(v) {
importAsLibrary = true
field = v
}
}

View File

@@ -1,182 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.Copy
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.extra
import org.jetbrains.kotlin.pill.ArtifactElement.*
import org.jetbrains.kotlin.pill.POrderRoot.*
import java.io.File
class PArtifact(val artifactName: String, val outputDir: File, private val contents: ArtifactElement.Root) {
fun render(context: PathContext) = xml("component", "name" to "ArtifactManager") {
xml("artifact", "name" to artifactName) {
xml("output-path") {
raw(context(outputDir))
}
add(contents.renderRecursively(context))
}
}
}
sealed class ArtifactElement {
private val myChildren = mutableListOf<ArtifactElement>()
val children get() = myChildren
fun add(child: ArtifactElement) {
myChildren += child
}
fun add(children: List<ArtifactElement>) {
myChildren += children
}
abstract fun render(context: PathContext): xml
fun renderRecursively(context: PathContext): xml {
return render(context).apply {
children.forEach { add(it.renderRecursively(context)) }
}
}
fun getDirectory(path: String): ArtifactElement {
if (path.isEmpty()) {
return this
}
var current: ArtifactElement = this
for (segment in path.split("/")) {
val existing = current.children.firstOrNull { it is Directory && it.name == segment }
if (existing != null) {
current = existing
continue
}
current = Directory(segment).also { current.add(it) }
}
return current
}
class Root : ArtifactElement() {
override fun render(context: PathContext) = xml("root", "id" to "root")
}
data class Directory(val name: String) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "directory", "name" to name)
}
data class Archive(val name: String) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "archive", "name" to name)
}
data class ModuleOutput(val moduleName: String) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "module-output", "name" to moduleName)
}
data class FileCopy(val source: File, val outputFileName: String? = null) : ArtifactElement() {
override fun render(context: PathContext): xml {
val args = mutableListOf("id" to "file-copy", "path" to context(source))
if (outputFileName != null) {
args += "output-file-name" to outputFileName
}
return xml("element", *args.toTypedArray())
}
}
data class DirectoryCopy(val source: File) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "dir-copy", "path" to context(source))
}
data class ProjectLibrary(val name: String) : ArtifactElement() {
override fun render(context: PathContext) = xml("element", "id" to "library", "level" to "project", "name" to name)
}
data class ExtractedDirectory(val archive: File, val pathInJar: String = "/") : ArtifactElement() {
override fun render(context: PathContext) =
xml("element", "id" to "extracted-dir", "path" to context(archive), "path-in-jar" to pathInJar)
}
}
fun generateKotlinPluginArtifactFile(rootProject: Project, dependencyMappers: List<DependencyMapper>): PFile {
val root = Root()
fun Project.getProject(name: String) = findProject(name) ?: error("Cannot find project $name")
val prepareIdeaPluginProject = rootProject.getProject(":prepare:idea-plugin")
root.add(Directory("kotlinc").apply {
val kotlincDirectory = rootProject.extra["distKotlinHomeDir"].toString()
add(DirectoryCopy(File(kotlincDirectory)))
})
root.add(Directory("lib").apply {
val librariesConfiguration = prepareIdeaPluginProject.configurations.getByName("libraries")
add(getArtifactElements(rootProject, librariesConfiguration, dependencyMappers, false))
add(Directory("jps").apply {
val prepareJpsPluginProject = rootProject.getProject(":kotlin-jps-plugin")
add(Archive(prepareJpsPluginProject.name + ".jar").apply {
val jpsPluginConfiguration = prepareIdeaPluginProject.configurations.getByName("jpsPlugin")
add(getArtifactElements(rootProject, jpsPluginConfiguration, dependencyMappers, true))
})
})
add(Archive("kotlin-plugin.jar").apply {
add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
val embeddedConfiguration = prepareIdeaPluginProject.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
add(getArtifactElements(rootProject, embeddedConfiguration, dependencyMappers, true))
})
})
val artifact = PArtifact("KotlinPlugin", File(rootProject.projectDir, "out/artifacts/Kotlin"), root)
return PFile(
File(rootProject.projectDir, ".idea/artifacts/${artifact.artifactName}.xml"),
artifact.render(ProjectContext(rootProject))
)
}
private fun getArtifactElements(
rootProject: Project,
configuration: Configuration,
dependencyMappers: List<DependencyMapper>,
extractDependencies: Boolean
): List<ArtifactElement> {
val dependencies = rootProject.resolveDependencies(configuration, false, dependencyMappers, withEmbedded = true).join()
val artifacts = mutableListOf<ArtifactElement>()
for (dependency in dependencies) {
when (dependency) {
is PDependency.Module -> {
val moduleOutput = ModuleOutput(dependency.name)
if (extractDependencies) {
artifacts += moduleOutput
} else {
artifacts += Archive(dependency.name + ".jar").apply {
add(moduleOutput)
}
}
}
is PDependency.Library -> artifacts += ProjectLibrary(dependency.name)
is PDependency.ModuleLibrary -> {
val files = dependency.library.classes
if (extractDependencies) files.mapTo(artifacts) { ExtractedDirectory(it) }
else files.mapTo(artifacts) { FileCopy(it) }
}
}
}
return artifacts
}

View File

@@ -1,421 +0,0 @@
/*
* 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.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Project
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.*
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.kotlin.dsl.configure
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.HasConvention
import org.gradle.api.internal.file.copy.CopySpecInternal
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.language.jvm.tasks.ProcessResources
import org.jetbrains.kotlin.pill.POrderRoot.*
import org.jetbrains.kotlin.pill.PSourceRoot.*
import org.jetbrains.kotlin.pill.PillExtension.*
import java.io.File
import java.util.LinkedList
data class PProject(
val name: String,
val rootDirectory: File,
val modules: List<PModule>,
val libraries: List<PLibrary>
)
data class PModule(
val name: String,
val rootDirectory: File,
val moduleFile: File,
val contentRoots: List<PContentRoot>,
val orderRoots: List<POrderRoot>,
val moduleForProductionSources: PModule? = null
)
data class PContentRoot(
val path: File,
val forTests: Boolean,
val sourceRoots: List<PSourceRoot>,
val excludedDirectories: List<File>
)
data class PSourceRoot(
val path: File,
val kind: Kind,
val kotlinOptions: PSourceRootKotlinOptions?
) {
enum class Kind { PRODUCTION, TEST, RESOURCES, TEST_RESOURCES }
}
data class PSourceRootKotlinOptions(
val noStdlib: Boolean?,
val noReflect: Boolean?,
val moduleName: String?,
val apiVersion: String?,
val languageVersion: String?,
val jvmTarget: String?,
val extraArguments: List<String>
) {
fun intersect(other: PSourceRootKotlinOptions) = PSourceRootKotlinOptions(
if (noStdlib == other.noStdlib) noStdlib else null,
if (noReflect == other.noReflect) noReflect else null,
if (moduleName == other.moduleName) moduleName else null,
if (apiVersion == other.apiVersion) apiVersion else null,
if (languageVersion == other.languageVersion) languageVersion else null,
if (jvmTarget == other.jvmTarget) jvmTarget else null,
extraArguments.intersect(other.extraArguments).toList()
)
}
data class POrderRoot(
val dependency: PDependency,
val scope: Scope,
val isExported: Boolean = false,
val isProductionOnTestDependency: Boolean = false
) {
enum class Scope { COMPILE, TEST, RUNTIME, PROVIDED }
}
sealed class PDependency {
data class Module(val name: String) : PDependency()
data class Library(val name: String) : PDependency()
data class ModuleLibrary(val library: PLibrary) : PDependency()
}
data class PLibrary(
val name: String,
val classes: List<File>,
val javadoc: List<File> = emptyList(),
val sources: List<File> = emptyList(),
val annotations: List<File> = emptyList(),
val dependencies: List<PLibrary> = emptyList(),
val originalName: String = name
) {
fun attachSource(file: File): PLibrary {
return this.copy(sources = this.sources + listOf(file))
}
}
fun parse(project: Project, libraries: List<PLibrary>, context: ParserContext): PProject = with (context) {
if (project != project.rootProject) {
error("$project is not a root project")
}
fun Project.matchesSelectedVariant(): Boolean {
val extension = this.extensions.findByType(PillExtension::class.java) ?: return true
val projectVariant = extension.variant.takeUnless { it == Variant.DEFAULT } ?: Variant.BASE
return projectVariant in context.variant.includes
}
val (includedProjects, excludedProjects) = project.allprojects
.partition { it.plugins.hasPlugin(JpsCompatiblePlugin::class.java) && it.matchesSelectedVariant() }
val modules = includedProjects.flatMap { parseModules(it, excludedProjects) }
return PProject("Kotlin", project.projectDir, modules, libraries)
}
/*
Ordering here and below is significant.
Placing 'runtime' configuration dependencies on the top make 'idea' tests to run normally.
('idea' module has 'intellij-core' as transitive dependency, and we really need to get rid of it.)
*/
private val CONFIGURATION_MAPPING = mapOf(
listOf("runtimeClasspath") to Scope.RUNTIME,
listOf("compile", "embedded") to Scope.COMPILE,
listOf("compileOnly") to Scope.PROVIDED
)
private val TEST_CONFIGURATION_MAPPING = mapOf(
listOf("runtimeClasspath", "testRuntimeClasspath") to Scope.RUNTIME,
listOf("compile", "testCompile") to Scope.COMPILE,
listOf("compileOnly", "testCompileOnly") to Scope.PROVIDED,
listOf("jpsTest") to Scope.TEST
)
private fun ParserContext.parseModules(project: Project, excludedProjects: List<Project>): List<PModule> {
val (productionContentRoots, testContentRoots) = parseContentRoots(project).partition { !it.forTests }
val modules = mutableListOf<PModule>()
fun getJavaExcludedDirs() = project.plugins.findPlugin(IdeaPlugin::class.java)
?.model?.module?.excludeDirs?.toList() ?: emptyList()
fun getPillExcludedDirs() = project.extensions.getByType(PillExtension::class.java).excludedDirs
val allExcludedDirs = getPillExcludedDirs() + getJavaExcludedDirs() + project.buildDir +
(if (project == project.rootProject) excludedProjects.map { it.buildDir } else emptyList())
var productionSourcesModule: PModule? = null
fun getModuleFile(suffix: String = ""): File {
val relativePath = File(project.projectDir, project.pillModuleName + suffix + ".iml")
.toRelativeString(project.rootProject.projectDir)
return File(project.rootProject.projectDir, ".idea/modules/$relativePath")
}
for ((nameSuffix, roots) in mapOf(".src" to productionContentRoots, ".test" to testContentRoots)) {
if (roots.isEmpty()) {
continue
}
val mainRoot = roots.first()
var dependencies = parseDependencies(project, mainRoot.forTests)
if (productionContentRoots.isNotEmpty() && mainRoot.forTests) {
val productionModuleDependency = PDependency.Module(project.pillModuleName + ".src")
dependencies += POrderRoot(productionModuleDependency, Scope.COMPILE, true)
}
val module = PModule(
project.pillModuleName + nameSuffix,
mainRoot.path,
getModuleFile(nameSuffix),
roots,
dependencies,
productionSourcesModule
)
modules += module
if (!mainRoot.forTests) {
productionSourcesModule = module
}
}
val mainModuleFileRelativePath = when (project) {
project.rootProject -> File(project.rootProject.projectDir, project.rootProject.name + ".iml")
else -> getModuleFile()
}
modules += PModule(
project.pillModuleName,
project.projectDir,
mainModuleFileRelativePath,
listOf(PContentRoot(project.projectDir, false, emptyList(), allExcludedDirs)),
if (modules.isEmpty()) parseDependencies(project, false) else emptyList()
)
return modules
}
private fun parseContentRoots(project: Project): List<PContentRoot> {
val sourceRoots = parseSourceRoots(project).groupBy { it.kind }
fun getRoots(kind: PSourceRoot.Kind) = sourceRoots[kind] ?: emptyList()
val productionSourceRoots = getRoots(Kind.PRODUCTION) + getRoots(Kind.RESOURCES)
val testSourceRoots = getRoots(Kind.TEST) + getRoots(Kind.TEST_RESOURCES)
fun createContentRoots(sourceRoots: List<PSourceRoot>, forTests: Boolean): List<PContentRoot> {
return sourceRoots.map { PContentRoot(it.path, forTests, listOf(it), emptyList()) }
}
return createContentRoots(productionSourceRoots, forTests = false) +
createContentRoots(testSourceRoots, forTests = true)
}
private fun parseSourceRoots(project: Project): List<PSourceRoot> {
if (!project.plugins.hasPlugin(JavaPlugin::class.java)) {
return emptyList()
}
val kotlinTasksBySourceSet = project.tasks.names
.filter { it.startsWith("compile") && it.endsWith("Kotlin") }
.map { project.tasks.getByName(it) }
.associateBy { it.invokeInternal("getSourceSetName") }
val sourceRoots = mutableListOf<PSourceRoot>()
val sourceSets = project.sourceSets
if (sourceSets != null) {
for (sourceSet in sourceSets) {
val kotlinCompileTask = kotlinTasksBySourceSet[sourceSet.name]
val kind = if (sourceSet.isTestSourceSet) Kind.TEST else Kind.PRODUCTION
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
val oldIsAccessible = kotlinMethod.isAccessible
try {
kotlinMethod.isAccessible = true
return kotlinMethod(this) as SourceDirectorySet
} finally {
kotlinMethod.isAccessible = oldIsAccessible
}
}
val kotlinSourceDirectories = (sourceSet as HasConvention).convention
.plugins["kotlin"]?.getKotlin()?.srcDirs
?: emptySet()
val directories = (sourceSet.java.sourceDirectories.files + kotlinSourceDirectories).toList()
.filter { it.exists() }
.takeIf { it.isNotEmpty() }
?: continue
val kotlinOptions = kotlinCompileTask?.let { getKotlinOptions(it) }
for (resourceRoot in sourceSet.resources.sourceDirectories.files) {
if (!resourceRoot.exists() || resourceRoot in directories) {
continue
}
val resourceRootKind = when (kind) {
Kind.PRODUCTION -> Kind.RESOURCES
Kind.TEST -> Kind.TEST_RESOURCES
else -> error("Invalid source root kind $kind")
}
sourceRoots += PSourceRoot(resourceRoot, resourceRootKind, kotlinOptions)
}
for (directory in directories) {
sourceRoots += PSourceRoot(directory, kind, kotlinOptions)
}
for (root in parseResourceRootsProcessedByProcessResourcesTask(project, sourceSet)) {
if (sourceRoots.none { it.path == root.path }) {
sourceRoots += root
}
}
}
}
return sourceRoots
}
private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project, sourceSet: SourceSet): List<PSourceRoot> {
val isMainSourceSet = sourceSet.name == SourceSet.MAIN_SOURCE_SET_NAME
val resourceRootKind = if (sourceSet.isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val taskNameBase = "processResources"
val taskName = if (isMainSourceSet) taskNameBase else sourceSet.name + taskNameBase.capitalize()
val task = project.tasks.findByName(taskName) as? ProcessResources ?: return emptyList()
val roots = mutableListOf<File>()
fun collectRoots(spec: CopySpecInternal) {
if (spec is SingleParentCopySpec && spec.children.none()) {
roots += spec.sourcePaths.map { File(project.projectDir, it.toString()) }.filter { it.exists() }
return
}
spec.children.forEach(::collectRoots)
}
collectRoots(task.rootSpec)
return roots.map { PSourceRoot(it, resourceRootKind, null) }
}
private val SourceSet.isTestSourceSet: Boolean
get() = name == SourceSet.TEST_SOURCE_SET_NAME
|| name.endsWith("Test")
|| name.endsWith("Tests")
private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions? {
val compileArguments = run {
val method = kotlinCompileTask::class.java.getMethod("getSerializedCompilerArguments")
method.isAccessible = true
method.invoke(kotlinCompileTask) as List<String>
}
fun parseBoolean(name: String) = compileArguments.contains("-$name")
fun parseString(name: String) = compileArguments.dropWhile { it != "-$name" }.drop(1).firstOrNull()
fun isOptionForScriptingCompilerPlugin(option: String)
= option.startsWith("-Xplugin=") && option.contains("kotlin-scripting-compiler")
val extraArguments = compileArguments.filter {
it.startsWith("-X") && !isOptionForScriptingCompilerPlugin(it)
}
return PSourceRootKotlinOptions(
parseBoolean("no-stdlib"),
parseBoolean("no-reflect"),
parseString("module-name"),
parseString("api-version"),
parseString("language-version"),
parseString("jvm-target"),
extraArguments
)
}
private fun Any.invokeInternal(name: String, instance: Any = this): Any? {
val method = javaClass.methods.single { it.name.startsWith(name) && it.parameterTypes.isEmpty() }
val oldIsAccessible = method.isAccessible
try {
method.isAccessible = true
return method.invoke(instance)
} finally {
method.isAccessible = oldIsAccessible
}
}
private fun ParserContext.parseDependencies(project: Project, forTests: Boolean): List<POrderRoot> {
val configurations = project.configurations
val configurationMapping = if (forTests) TEST_CONFIGURATION_MAPPING else CONFIGURATION_MAPPING
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = configurations.findByName(configurationName) ?: continue
val (main, deferred) = project.resolveDependencies(configuration, forTests, dependencyMappers)
mainRoots += main.map { POrderRoot(it, scope) }
deferredRoots += deferred.map { POrderRoot(it, scope) }
}
}
return removeDuplicates(mainRoots + deferredRoots)
}
fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
val dependenciesByScope = roots.groupBy { it.scope }.mapValues { it.value.mapTo(mutableSetOf()) { it.dependency } }
fun dependenciesFor(scope: Scope) = dependenciesByScope[scope] ?: emptySet<PDependency>()
val result = mutableSetOf<POrderRoot>()
for (root in roots.distinct()) {
val scope = root.scope
val dependency = root.dependency
if (root in result) {
continue
}
if ((scope == Scope.PROVIDED || scope == Scope.RUNTIME) && dependency in dependenciesFor(Scope.COMPILE)) {
continue
}
if (scope == Scope.PROVIDED && dependency in dependenciesFor(Scope.RUNTIME)) {
result += POrderRoot(dependency, Scope.COMPILE)
continue
}
if (scope == Scope.RUNTIME && dependency in dependenciesFor(Scope.PROVIDED)) {
result += POrderRoot(dependency, Scope.COMPILE)
continue
}
result += root
}
return result.toList()
}
val Project.pillModuleName: String
get() = path.removePrefix(":").replace(':', '.')
val Project.sourceSets: SourceSetContainer?
get() {
val convention = project.convention.findPlugin(JavaPluginConvention::class.java) ?: return null
return convention.sourceSets
}

View File

@@ -1,54 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Project
import java.io.File
private val USER_HOME_DIR_PATH = System.getProperty("user.home").withSlash()
private fun replacePrefix(path: String, prefix: String, variableName: String): String {
if (path.startsWith(prefix)) {
return "$" + variableName + "$/" + path.drop(prefix.length)
}
return path
}
private fun simplifyUserHomeDirPath(path: String): String {
return replacePrefix(path, USER_HOME_DIR_PATH, "USER_HOME")
}
interface PathContext {
operator fun invoke(file: File): String
fun url(file: File): Pair<String, String> {
val path = when {
file.isFile && file.extension.toLowerCase() == "jar" -> "jar://" + this(file) + "!/"
else -> "file://" + this(file)
}
return Pair("url", path)
}
}
class ProjectContext private constructor(private val projectDir: File) : PathContext {
constructor(project: PProject) : this(project.rootDirectory)
constructor(project: Project) : this(project.projectDir)
override fun invoke(file: File): String {
return simplifyUserHomeDirPath(replacePrefix(file.absolutePath, projectDir.absolutePath.withSlash(), "PROJECT_DIR"))
}
}
class ModuleContext(val project: PProject, val module: PModule) : PathContext {
override fun invoke(file: File): String {
if (!file.startsWith(project.rootDirectory)) {
return simplifyUserHomeDirPath(file.absolutePath)
}
return "\$MODULE_DIR\$/" + file.toRelativeString(module.moduleFile.parentFile)
}
}
fun String.withSlash() = if (this.endsWith("/")) this else (this + "/")
fun String.withoutSlash() = this.trimEnd('/')

View File

@@ -1,336 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.kotlin.dsl.extra
import shadow.org.jdom2.input.SAXBuilder
import shadow.org.jdom2.*
import shadow.org.jdom2.output.Format
import shadow.org.jdom2.output.XMLOutputter
import java.io.File
class PillConfigurablePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)
project.extensions.create("pill", PillExtension::class.java)
}
}
class JpsCompatiblePlugin : Plugin<Project> {
companion object {
private fun getDependencyMappers(projectLibraries: List<PLibrary>): List<DependencyMapper> {
val mappersForKotlinLibrariesExeptStdlib = projectLibraries
.filter { it.name != "kotlin-stdlib" }
.map { DependencyMapper.forProject(it.originalName) { MappedDependency(PDependency.Library(it.name)) } }
val disabledModuleMappers = listOf(
":kotlin-stdlib-common",
":core:builtins",
":kotlin-compiler",
":kotlin-compiler-embeddable",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-annotations-common"
).map { DependencyMapper.forProject(it) { null } }
return listOf(
DependencyMapper.forProject(":kotlin-stdlib") {
MappedDependency(
PDependency.Library("kotlin-stdlib"),
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper.forProject(":kotlin-test:kotlin-test-jvm") { MappedDependency(PDependency.Library("kotlin-test-jvm")) },
DependencyMapper.forProject(":kotlin-reflect-api") { MappedDependency(PDependency.Library("kotlin-reflect")) }
) + mappersForKotlinLibrariesExeptStdlib + disabledModuleMappers
}
fun getProjectLibraries(rootProject: Project): List<PLibrary> {
val distLibDir = File(rootProject.extra["distLibDir"].toString())
fun distJar(name: String) = File(rootProject.projectDir, "dist/kotlinc/lib/$name.jar")
val libraries = rootProject.allprojects
.mapNotNull { library ->
val libraryExtension = library.extensions.findByType(PillExtension::class.java)
?.takeIf { it.importAsLibrary }
?: return@mapNotNull null
val libraryPath = libraryExtension.libraryPath ?: distLibDir
val archivesBaseName = library.convention.findPlugin(BasePluginConvention::class.java)?.archivesBaseName ?: library.name
fun List<File>.filterExisting() = filter { it.exists() }
PLibrary(
library.name,
classes = listOf(File(libraryPath, "$archivesBaseName.jar")).filterExisting(),
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting(),
originalName = library.path
)
}
return libraries + PLibrary("annotations-13.0", classes = listOf(distJar("annotations-13.0")))
}
}
override fun apply(project: Project) {
project.plugins.apply(PillConfigurablePlugin::class.java)
// 'jpsTest' does not require the 'tests-jar' artifact
project.configurations.create("jpsTest")
if (project == project.rootProject) {
project.tasks.create("pill") {
doLast { pill(project) }
if (System.getProperty("pill.android.tests", "false") == "true") {
TaskUtils.useAndroidSdk(this)
TaskUtils.useAndroidJar(this)
}
}
project.tasks.create("unpill") {
doLast { unpill(project) }
}
}
}
private lateinit var projectDir: File
private lateinit var platformVersion: String
private lateinit var platformBaseNumber: String
private lateinit var platformDir: File
private var isAndroidStudioPlatform: Boolean = false
private fun initEnvironment(project: Project) {
projectDir = project.projectDir
platformVersion = project.extensions.extraProperties.get("versions.intellijSdk").toString()
platformBaseNumber = platformVersion.substringBefore(".", "").takeIf { it.isNotEmpty() }
?: platformVersion.substringBefore("-", "").takeIf { it.isNotEmpty() }
?: error("Invalid platform version: $platformVersion")
platformDir = IntellijRootUtils.getIntellijRootDir(project)
isAndroidStudioPlatform = project.extensions.extraProperties.has("versions.androidStudioRelease")
}
private fun pill(rootProject: Project) {
initEnvironment(rootProject)
val variantOptionValue = System.getProperty("pill.variant", "base").toUpperCase()
val variant = PillExtension.Variant.values().firstOrNull { it.name == variantOptionValue }
?: run {
rootProject.logger.error("Invalid variant name: $variantOptionValue")
return
}
rootProject.logger.lifecycle("Pill: Setting up project for the '${variant.name.toLowerCase()}' variant...")
if (variant == PillExtension.Variant.NONE || variant == PillExtension.Variant.DEFAULT) {
rootProject.logger.error("'none' and 'default' should not be passed as a Pill variant property value")
return
}
val projectLibraries = getProjectLibraries(rootProject)
val dependencyMappers = getDependencyMappers(projectLibraries)
val parserContext = ParserContext(dependencyMappers, variant)
val jpsProject = parse(rootProject, projectLibraries, parserContext)
.mapLibraries(this::attachPlatformSources, this::attachAsmSources)
val files = render(jpsProject)
removeExistingIdeaLibrariesAndModules()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
generateKotlinPluginArtifactFile(rootProject, dependencyMappers).write()
copyRunConfigurations()
setOptionsForDefaultJunitRunConfiguration(rootProject)
files.forEach { it.write() }
}
private fun unpill(project: Project) {
initEnvironment(project)
removeExistingIdeaLibrariesAndModules()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
}
private fun removeExistingIdeaLibrariesAndModules() {
File(projectDir, ".idea/libraries").deleteRecursively()
File(projectDir, ".idea/modules").deleteRecursively()
}
private fun removeJpsAndPillRunConfigurations() {
File(projectDir, ".idea/runConfigurations")
.walk()
.filter { (it.name.startsWith("JPS_") || it.name.startsWith("Pill_")) && it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
private fun removeAllArtifactConfigurations() {
File(projectDir, ".idea/artifacts")
.walk()
.filter { it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
private fun copyRunConfigurations() {
val runConfigurationsDir = File(projectDir, "buildSrc/src/main/resources/runConfigurations")
val targetDir = File(projectDir, ".idea/runConfigurations")
val platformDirProjectRelative = "\$PROJECT_DIR\$/" + platformDir.toRelativeString(projectDir)
val additionalIdeaArgs = if (isAndroidStudioPlatform) "-Didea.platform.prefix=AndroidStudio" else ""
targetDir.mkdirs()
fun substitute(text: String): String {
return text
.replace("\$IDEA_HOME_PATH\$", platformDirProjectRelative)
.replace("\$ADDITIONAL_IDEA_ARGS\$", additionalIdeaArgs)
}
runConfigurationsDir.listFiles()
.filter { it.extension == "xml" }
.map { it.name to substitute(it.readText()) }
.forEach { File(targetDir, it.first).writeText(it.second) }
}
/*
This sets a proper (project root) working directory and a "idea.home.path" property to the default JUnit configuration,
so one does not need to make these changes manually.
*/
private fun setOptionsForDefaultJunitRunConfiguration(project: Project) {
val workspaceFile = File(projectDir, ".idea/workspace.xml")
if (!workspaceFile.exists()) {
project.logger.warn("${workspaceFile.name} does not exist, JUnit default run configuration was not modified")
return
}
val document = SAXBuilder().build(workspaceFile)
val rootElement = document.rootElement
fun Element.getOrCreateChild(name: String, vararg attributes: Pair<String, String>): Element {
for (child in getChildren(name)) {
if (attributes.all { (attribute, value) -> child.getAttributeValue(attribute) == value }) {
return child
}
}
return Element(name).apply {
for ((attributeName, value) in attributes) {
setAttribute(attributeName, value)
}
this@getOrCreateChild.addContent(this@apply)
}
}
val platformDirProjectRelative = "\$PROJECT_DIR\$/" + platformDir.toRelativeString(projectDir)
val runManagerComponent = rootElement.getOrCreateChild("component", "name" to "RunManager")
val junitConfiguration = runManagerComponent.getOrCreateChild(
"configuration",
"default" to "true",
"type" to "JUnit",
"factoryName" to "JUnit"
)
junitConfiguration.apply {
getOrCreateChild("option", "name" to "WORKING_DIRECTORY").setAttribute("value", "file://\$PROJECT_DIR\$")
getOrCreateChild("option", "name" to "VM_PARAMETERS").also { vmParams ->
var options = vmParams.getAttributeValue("value", "")
.split(' ')
.map { it.trim() }
.filter { it.isNotEmpty() }
fun addOrReplaceOptionValue(name: String, value: Any?) {
val optionsWithoutNewValue = options.filter { !it.startsWith("-D$name=") }
options = if (value == null) optionsWithoutNewValue else (optionsWithoutNewValue + listOf("-D$name=$value"))
}
val robolectricClasspath = project.rootProject
.project(":plugins:android-extensions-compiler")
.configurations.getByName("robolectricClasspath")
.files.joinToString(File.pathSeparator)
if (options.none { it == "-ea" }) {
options += "-ea"
}
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.jps", "true")
addOrReplaceOptionValue("kotlinVersion", project.rootProject.extra["kotlinVersion"].toString())
val isAndroidStudioBunch = project.findProperty("versions.androidStudioRelease") != null
addOrReplaceOptionValue("idea.platform.prefix", if (isAndroidStudioBunch) "AndroidStudio" else null)
val androidJarPath = project.configurations.findByName("androidJar")?.singleFile
val androidSdkPath = project.configurations.findByName("androidSdk")?.singleFile
if (androidJarPath != null && androidSdkPath != null) {
addOrReplaceOptionValue("android.sdk", "\$PROJECT_DIR\$/" + androidSdkPath.toRelativeString(projectDir))
addOrReplaceOptionValue("android.jar", "\$PROJECT_DIR\$/" + androidJarPath.toRelativeString(projectDir))
}
vmParams.setAttribute("value", options.joinToString(" "))
}
}
val output = XMLOutputter().also {
it.format = Format.getPrettyFormat().apply {
setEscapeStrategy { Verifier.isHighSurrogate(it) || it == '"' }
setIndent(" ")
setTextMode(Format.TextMode.TRIM)
setOmitEncoding(false)
setOmitDeclaration(false)
}
}
val postProcessedXml = output.outputString(document)
.replace("&#x22;", "&quot;")
.replace("&#xA;", "&#10;")
.replace("&#xC;", "&#13;")
workspaceFile.writeText(postProcessedXml)
}
private fun attachPlatformSources(library: PLibrary): PLibrary {
val platformSourcesJar = File(platformDir, "../../../sources/intellij-$platformVersion-sources.jar")
if (library.classes.any { it.startsWith(platformDir) }) {
return library.attachSource(platformSourcesJar)
}
return library
}
private fun attachAsmSources(library: PLibrary): PLibrary {
val asmSourcesJar = File(platformDir, "../asm-shaded-sources/asm-src-$platformBaseNumber.jar")
val asmAllJar = File(platformDir, "lib/asm-all.jar")
if (library.classes.any { it == asmAllJar }) {
return library.attachSource(asmSourcesJar)
}
return library
}
private fun PProject.mapLibraries(vararg mappers: (PLibrary) -> PLibrary): PProject {
fun mapLibrary(root: POrderRoot): POrderRoot {
val dependency = root.dependency
if (dependency is PDependency.ModuleLibrary) {
val newLibrary = mappers.fold(dependency.library) { lib, mapper -> mapper(lib) }
return root.copy(dependency = dependency.copy(library = newLibrary))
}
return root
}
val modules = this.modules.map { it.copy(orderRoots = it.orderRoots.map(::mapLibrary)) }
return this.copy(modules = modules)
}
}

View File

@@ -1,200 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
class PFile(val path: File, val text: String) {
fun write() {
path.parentFile.mkdirs()
path.writeText(text)
}
}
fun PFile(path: File, xml: xml) = PFile(path, xml.toString())
fun render(project: PProject): List<PFile> {
val files = mutableListOf<PFile>()
files += renderModulesFile(project)
project.modules.forEach { files += renderModule(project, it) }
project.libraries.forEach { files += renderLibrary(project, it) }
return files
}
private fun renderModulesFile(project: PProject) = PFile(
File(project.rootDirectory, ".idea/modules.xml"),
xml("project", "version" to 4) {
xml("component", "name" to "ProjectModuleManager") {
xml("modules") {
val pathContext = ProjectContext(project)
for (module in project.modules) {
val moduleFilePath = pathContext(module.moduleFile)
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath)
}
}
}
}
)
private fun renderModule(project: PProject, module: PModule) = PFile(
module.moduleFile,
xml("module",
"type" to "JAVA_MODULE",
"version" to 4
) {
val moduleForProductionSources = module.moduleForProductionSources
if (moduleForProductionSources != null) {
xml("component", "name" to "TestModuleProperties", "production-module" to moduleForProductionSources.name)
}
val kotlinCompileOptionsList = module.contentRoots.flatMap { it.sourceRoots }.mapNotNull { it.kotlinOptions }
var kotlinCompileOptions = kotlinCompileOptionsList.firstOrNull()
for (otherOptions in kotlinCompileOptionsList.drop(1)) {
kotlinCompileOptions = kotlinCompileOptions?.intersect(otherOptions)
}
val pathContext = ModuleContext(project, module)
val platformVersion = (kotlinCompileOptions?.jvmTarget ?: "1.8")
val classesDirectory = File(project.rootDirectory, "out/production/${module.name}")
if (kotlinCompileOptions != null) {
xml("component", "name" to "FacetManager") {
xml("facet", "type" to "kotlin-language", "name" to "Kotlin") {
xml("configuration", "version" to 3, "platform" to "JVM $platformVersion", "useProjectSettings" to "false") {
xml("compilerSettings") {
xml(
"option",
"name" to "additionalArguments",
"value" to kotlinCompileOptions.extraArguments.joinToString(" ")
)
}
xml("compilerArguments") {
xml("option", "name" to "destination", "value" to pathContext(classesDirectory))
fun Any?.option(name: String) {
if (this != null) xml("option", "name" to name, "value" to this.toString())
}
kotlinCompileOptions.noStdlib.option("noStdlib")
kotlinCompileOptions.noReflect.option("noReflect")
module.name.option("moduleName")
xml("option", "name" to "jvmTarget", "value" to platformVersion)
kotlinCompileOptions.languageVersion.option("languageVersion")
kotlinCompileOptions.apiVersion.option("apiVersion")
xml("option", "name" to "pluginOptions") { xml("array") }
xml("option", "name" to "pluginClasspaths") { xml("array") }
}
}
}
}
}
xml("component",
"name" to "NewModuleRootManager",
"LANGUAGE_LEVEL" to "JDK_${platformVersion.replace('.', '_')}",
"inherit-compiler-output" to "true"
) {
xml("exclude-output")
for (contentRoot in module.contentRoots) {
xml("content", pathContext.url(contentRoot.path)) {
for (sourceRoot in contentRoot.sourceRoots) {
var args = arrayOf(pathContext.url(sourceRoot.path))
args += when (sourceRoot.kind) {
PSourceRoot.Kind.PRODUCTION -> ("isTestSource" to "false")
PSourceRoot.Kind.TEST -> ("isTestSource" to "true")
PSourceRoot.Kind.RESOURCES -> ("type" to "java-resource")
PSourceRoot.Kind.TEST_RESOURCES -> ("type" to "java-test-resource")
}
xml("sourceFolder", *args)
}
for (excludedDir in contentRoot.excludedDirectories) {
xml("excludeFolder", pathContext.url(excludedDir))
}
}
}
xml("orderEntry", "type" to "inheritedJdk")
xml("orderEntry", "type" to "sourceFolder", "forTests" to "false")
for (orderRoot in module.orderRoots) {
val dependency = orderRoot.dependency
val args = when (dependency) {
is PDependency.ModuleLibrary -> mutableListOf(
"type" to "module-library"
)
is PDependency.Module -> mutableListOf(
"type" to "module",
"module-name" to dependency.name
)
is PDependency.Library -> mutableListOf(
"type" to "library",
"name" to dependency.name,
"level" to "project"
)
}
if (orderRoot.scope != POrderRoot.Scope.COMPILE) {
args.add(1, "scope" to orderRoot.scope.toString())
}
if (dependency is PDependency.Module && orderRoot.isProductionOnTestDependency) {
args += ("production-on-test" to "")
}
if (orderRoot.isExported) {
args += ("exported" to "")
}
xml("orderEntry", *args.toTypedArray()) {
if (dependency is PDependency.ModuleLibrary) {
add(renderLibraryToXml(dependency.library, pathContext, named = false))
}
}
}
}
}
)
private fun renderLibrary(project: PProject, library: PLibrary): PFile {
val pathContext = ProjectContext(project)
// TODO find how IDEA escapes library names
val escapedName = library.renderName().replace(" ", "_").replace(".", "_").replace("-", "_")
return PFile(
File(project.rootDirectory, ".idea/libraries/$escapedName.xml"),
xml("component", "name" to "libraryTable") {
add(renderLibraryToXml(library, pathContext))
})
}
private fun renderLibraryToXml(library: PLibrary, pathContext: PathContext, named: Boolean = true): xml {
val args = if (named) arrayOf("name" to library.renderName()) else emptyArray()
return xml("library", *args) {
xml("CLASSES") {
library.classes.forEach { xml("root", pathContext.url(it)) }
}
xml("JAVADOC") {
library.javadoc.forEach { xml("root", pathContext.url(it)) }
}
xml("SOURCES") {
library.sources.forEach { xml("root", pathContext.url(it)) }
}
}
}
fun PLibrary.renderName() = name.takeIf { it != "unspecified" } ?: classes.first().nameWithoutExtension

View File

@@ -1,61 +0,0 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import shadow.org.jdom2.Document
import shadow.org.jdom2.Element
import shadow.org.jdom2.output.Format
import shadow.org.jdom2.output.XMLOutputter
class xml(val name: String, private vararg val args: Pair<String, Any>, block: xml.() -> Unit = {}) {
private companion object {
fun makeXml(name: String, vararg args: Pair<String, Any>, block: xml.() -> Unit = {}): xml {
return xml(name, *args, block = block)
}
}
private val children = mutableListOf<xml>()
private var value: Any? = null
init {
@Suppress("UNUSED_EXPRESSION")
block()
}
fun xml(name: String, vararg args: Pair<String, Any>, block: xml.() -> Unit = {}) {
children += makeXml(name, *args, block = block)
}
fun add(xml: xml) {
children += xml
}
fun raw(text: String) {
value = text
}
private fun toElement(): Element {
val element = Element(name)
for (arg in args) {
element.setAttribute(arg.first, arg.second.toString())
}
require(value == null || children.isEmpty())
value?.let { value ->
element.addContent(value.toString())
}
for (child in children) {
element.addContent(child.toElement())
}
return element
}
override fun toString(): String {
val document = Document().also { it.rootElement = toElement() }
val output = XMLOutputter().also { it.format = Format.getPrettyFormat() }
return output.outputString(document)
}
}

View File

@@ -4,9 +4,10 @@ import org.codehaus.groovy.runtime.InvokerHelper
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer
import org.gradle.api.artifacts.maven.MavenDeployment
import org.gradle.api.artifacts.maven.MavenResolver
import org.gradle.api.plugins.MavenPluginConvention
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
import org.gradle.api.tasks.Upload
@@ -30,6 +31,12 @@ open class PublishedKotlinModule : Plugin<Project> {
plugins.apply("maven")
val publishedRuntime by configurations.creating {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
}
if (!project.hasProperty("prebuiltJar")) {
plugins.apply("signing")
@@ -41,7 +48,7 @@ open class PublishedKotlinModule : Plugin<Project> {
sign(configurations["archives"])
}
(tasks.getByName("signArchives") as Sign).apply {
tasks.named<Sign>("signArchives").configure {
enabled = signingRequired
}
}
@@ -98,9 +105,9 @@ open class PublishedKotlinModule : Plugin<Project> {
}
}
val preparePublication = project.rootProject.tasks.getByName("preparePublication")
tasks.named<Upload>("uploadArchives").configure {
val uploadArchives = (tasks.getByName("uploadArchives") as Upload).apply {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
dependsOn(preparePublication)
@@ -152,8 +159,8 @@ open class PublishedKotlinModule : Plugin<Project> {
}
}
tasks.create("publish") {
dependsOn(uploadArchives)
tasks.register("publish") {
dependsOn(tasks.named("uploadArchives"))
}
}
}

View File

@@ -0,0 +1,25 @@
import org.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
/*
* 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.
*/
val NamedDomainObjectContainer<Configuration>.publishedRuntime: NamedDomainObjectProvider<Configuration> get() = named("publishedRuntime")
fun DependencyHandler.publishedRuntime(dependencyNotation: Any): Dependency? =
add("publishedRuntime", dependencyNotation)
fun DependencyHandler.publishedRuntime(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "publishedRuntime", dependencyNotation, dependencyConfiguration)

View File

@@ -1,4 +1,5 @@
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
@@ -37,7 +38,13 @@ val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets
val Project.mainSourceSet: SourceSet
get() = sourceSets.getByName("main")
get() = javaPluginConvention().mainSourceSet
val Project.testSourceSet: SourceSet
get() = javaPluginConvention().testSourceSet
val JavaPluginConvention.mainSourceSet: SourceSet
get() = sourceSets.getByName("main")
val JavaPluginConvention.testSourceSet: SourceSet
get() = sourceSets.getByName("test")

View File

@@ -5,14 +5,17 @@ import org.jetbrains.org.objectweb.asm.*
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
import java.util.*
import java.util.jar.JarFile
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
private val CONSTANT_TIME_FOR_ZIP_ENTRIES = GregorianCalendar(1980, 1, 1, 0, 0, 0).timeInMillis
/**
* Removes @kotlin.Metadata annotations from compiled Kotlin classes
*/
fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFile: File) {
fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFile: File, preserveFileTimestamps: Boolean = true) {
val classRegex = classNamePattern.toRegex()
assert(inFile.exists()) { "Input file not found at $inFile" }
@@ -49,6 +52,9 @@ fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFil
}
val newEntry = ZipEntry(entry.name)
if (!preserveFileTimestamps) {
newEntry.time = CONSTANT_TIME_FOR_ZIP_ENTRIES
}
outJar.putNextEntry(newEntry)
outJar.write(outBytes)
outJar.closeEntry()

View File

@@ -21,10 +21,10 @@
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.task
import java.io.File
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
@@ -36,9 +36,9 @@ fun Project.projectTest(
parallel: Boolean = false,
shortenTempRootName: Boolean = false,
body: Test.() -> Unit = {}
): Test = getOrCreateTask(taskName) {
): TaskProvider<Test> = getOrCreateTask(taskName) {
doFirst {
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: mutableSetOf()
val patterns = filter.includePatterns + commandLineIncludePatterns
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
patterns.forEach { pattern ->
@@ -100,6 +100,7 @@ fun Project.projectTest(
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", buildDir)
@@ -134,15 +135,16 @@ fun Project.projectTest(
if (parallel) {
maxParallelForks =
project.findProperty("kotlin.test.maxParallelForks")?.toString()?.toInt()
?: Math.max(Runtime.getRuntime().availableProcessors() / 2, 1)
?: Math.max(Runtime.getRuntime().availableProcessors() / if (kotlinBuildProperties.isTeamcityBuild) 2 else 4, 1)
}
body()
}
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, body: T.() -> Unit): T =
(tasks.findByName(taskName)?.let { it as T } ?: task<T>(taskName)).apply { body() }
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, noinline body: T.() -> Unit): TaskProvider<T> =
if (tasks.names.contains(taskName)) tasks.named(taskName, T::class.java).apply { configure(body) }
else tasks.register(taskName, T::class.java, body)
object TaskUtils {
fun useAndroidSdk(task: Task) {

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